/* Controls demos: QuantityStepper, RulerPicker, BarChart, MiniPlayer (cp/controls.js). The components
   bring their own styles (web/lib); here the demo frames and the site palette on their tokens. */

.cc {
  --cc-fill: var(--raised);
  --cc-card: var(--surface-2);
  --cc-danger: #FF453A;
  --cc-frame: #0F0F10;
  --cc-sheet: #232326;
  --dissolve-danger: var(--cc-danger);
  --dissolve-primary: var(--text);
  --dissolve-primary-foreground: var(--bg);
  --dissolve-chart-1: #FF4F98;
  --dissolve-chart-2: #8E72FF;
  --dissolve-chart-3: #FFD233;
}
[data-theme='light'] .cc {
  --cc-fill: #ECEEF2;
  --cc-card: #FFFFFF;
  --cc-danger: #FF3B30;
  --cc-frame: #FFFFFF;
  --cc-sheet: #F2F3F6;
  --dissolve-chart-1: #FF3787;
  --dissolve-chart-2: #7C5CFF;
  --dissolve-chart-3: #FFC400;
}

/* ---------- QuantityStepper: a cart row ---------- */

.cc-qs-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 10px;
  border-radius: 18px; background: var(--cc-card); box-shadow: inset 0 0 0 1px var(--line);
}
.cc-qs-art { flex: none; width: 52px; height: 52px; border-radius: 12px; background: center / cover; }
.cc-qs-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cc-qs-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-qs-sub { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.cc-qs { background: var(--cc-fill); }

/* ---------- BarChart: the period switch ---------- */

.cc-bc { display: flex; flex-direction: column; }
.cc-seg { align-self: flex-end; display: inline-flex; padding: 2px; border-radius: 999px; background: var(--cc-fill); }
.cc-seg-btn {
  height: 26px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  transition: background .25s cubic-bezier(0.32, 0.72, 0, 1), color .25s;
  -webkit-tap-highlight-color: transparent;
}
.cc-seg-btn.on { background: var(--cc-card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.cc-bc .cc-seg { margin-bottom: 6px; }
.cc-bc-tile .dissolve-bar-lane { height: 40px; }

/* ---------- MiniPlayer: a phone frame with a library behind the player ---------- */

.cc-mp {
  position: relative; overflow: hidden; border-radius: 38px; background: var(--cc-frame);
  box-shadow: inset 0 0 0 1px var(--line); isolation: isolate; text-align: left;
  --dissolve-background: var(--cc-frame);
  --dissolve-surface-2: var(--raised);
  /* Liquid glass imitation: tinted translucent fill, blur and saturation of what is behind,
     a specular rim (bright top edge, softer bottom) and a faint inner shadow. */
  --cc-glass: color-mix(in srgb, var(--cc-sheet) 52%, transparent);
  --cc-glass-hi: rgba(255, 255, 255, 0.16);
  --cc-glass-rim: rgba(255, 255, 255, 0.10);
  --cc-glass-in: rgba(0, 0, 0, 0.28);
}
[data-theme='light'] .cc-mp {
  --cc-glass: color-mix(in srgb, var(--cc-frame) 58%, transparent);
  --cc-glass-hi: rgba(255, 255, 255, 0.9);
  --cc-glass-rim: rgba(255, 255, 255, 0.55);
  --cc-glass-in: rgba(0, 0, 0, 0.06);
}
.cc-mp-lib { position: absolute; inset: 0; padding: 22px 20px; }
.cc-mp-lib-h { margin: 0 0 14px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.cc-mp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.cc-mp-grid i { display: block; aspect-ratio: 1; border-radius: 12px; background: center / cover; }
.cc-mp-grid span { display: block; margin-top: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.cc-mp-glass {
  background: var(--cc-glass);
  -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.16),
    inset 0 1px 0.5px var(--cc-glass-hi),
    inset 0 -1px 1px var(--cc-glass-rim),
    inset 0 0 0 0.5px var(--cc-glass-rim),
    inset 0 -10px 24px -14px var(--cc-glass-in);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .cc-mp-glass { background: var(--cc-sheet); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16), inset 0 0 0 1px var(--line-2); }
}
