/* CurateAI dashboard
   Tokens: slate ink, grey-green ground, cobalt action. Section colours only in the time strip. */
:root {
  --ground: #EEF1EF;
  --surface: #FFFFFF;
  --ink: #18262E;
  --muted: #485960;
  --line: #D3DBD8;
  --action: #2348D6;
  --action-ink: #FFFFFF;
  --danger: #B3261E;
  --ok: #1D7A4F;
  --s0: #2348D6; --s1: #C23A6B; --s2: #E2A21B; --s3: #157A63; --s4: #6A4BC4; --s5: #3E7FA8;
  --radius-s: 8px; --radius-m: 14px;
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --step-0: 1rem; --step-1: 1.2rem; --step-2: clamp(1.35rem, 4.5vw, 1.6rem); --step-3: clamp(2rem, 7vw, 2.4rem);
  --tabbar: 64px;
  --account-row: 0px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 var(--step-0)/1.5 var(--font); font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--action); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; border-radius: 4px; }
:is(.list .item, .tracks button, .chips button):focus-visible { outline-offset: -4px; }
.chips button[aria-pressed="true"]:focus-visible { outline-color: var(--surface); }
::placeholder { color: var(--muted); opacity: 1; }
main:focus, main:focus-visible { outline: none; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.boot { position: fixed; inset: 0; display: grid; place-items: center; color: var(--muted); }

h1, h2, h3 { font-stretch: 75%; font-weight: 800; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.fine { font-size: .875rem; color: var(--muted); }

/* ---------- Shell ---------- */
.shell { min-height: 100dvh; }
.side {
  position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + var(--account-row) + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.brand, .account { display: none; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); height: var(--tabbar); }
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .75rem; font-weight: 600;
}
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"] svg { stroke: var(--action); }

#main, .dashboard-footer { max-width: 820px; margin: 0 auto; }
#main { padding: 20px 16px 0; outline: none; }
.dashboard-footer {
  padding: 24px 16px calc(var(--tabbar) + var(--account-row) + 24px + env(safe-area-inset-bottom));
}

.account-youtube { display: flex; flex-wrap: wrap; gap: 0 4px; }
.account-links { display: flex; flex-wrap: wrap; column-gap: 16px; }
.account-links a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; font-weight: 600; }
/* The studio link belongs on the Create landing screen, before a mix is open. */
.account-links .account-studio-link { display: none; }
#shell:has(#main[data-view="create"]):not(:has(#draft-box .draft)) .account-studio-link { display: inline-flex; }
@media (width < 900px) {
  html:has(.shell:not([hidden])) {
    --account-row: 46px;
    scroll-padding-bottom: calc(var(--tabbar) + var(--account-row) + env(safe-area-inset-bottom) + 8px);
  }
  html:has(.shell:not([hidden]) .account-youtube) { --account-row: 90px; }
  html:has(.shell:not([hidden]) .account-usage:not([hidden])) { --account-row: 116px; }
  html:has(.shell:not([hidden]) .account-delete) { --account-row: 134px; }
  html:has(.shell:not([hidden]) .account-delete):has(.account-usage:not([hidden])) { --account-row: 160px; }
  .account-usage { min-height: 26px; text-align: center; }
  .account-delete { display: flex; justify-content: center; }
  .account:has(.account-links) {
    display: block; border-top: 1px solid var(--line); font-size: .875rem;
  }
  .account > :not(.account-links, .account-youtube, .account-usage, .account-delete) { display: none; }
  .account-links, .account-youtube { justify-content: center; }
}

@media (min-width: 900px) {
  .side {
    top: 0; bottom: 0; right: auto; width: 232px; height: auto; border-top: 0; border-right: 1px solid var(--line);
    display: flex; flex-direction: column; padding: 24px 16px;
  }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-stretch: 75%; font-size: 1.4rem; margin: 0 8px 28px; }
  .brand svg { width: 30px; height: 30px; }
  .tabs { display: flex; flex-direction: column; height: auto; gap: 2px; }
  .tabs a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; font-size: 1rem; border-radius: var(--radius-s); }
  .tabs a:hover { background: var(--ground); color: var(--ink); }
  .tabs a[aria-current="page"] { background: var(--ground); }
  .account { display: block; margin-top: auto; padding: 0 8px; font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
  .account button { margin-top: 6px; }
  #main, .dashboard-footer { margin-left: 232px; max-width: none; }
  #main { padding: 40px 48px 0; }
  .dashboard-footer { padding: 24px 48px 48px; }
  #main > * { max-width: 760px; }
}

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 6px; }
.section { margin-top: 32px; }
.section > h3 { margin-bottom: 10px; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: var(--radius-s); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--action); border-color: var(--action); color: var(--action-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--action); padding: 0 10px; }
.btn.danger { color: var(--danger); }
.btn.big { min-height: 52px; padding: 0 24px; font-size: 1.05rem; }
.btn[disabled] { opacity: .5; cursor: default; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: var(--radius-s);
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--ground); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[disabled] { opacity: .3; cursor: default; background: transparent; }

label.field { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
label.field span.hint { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="search"], input[type="number"], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface);
}
textarea { resize: vertical; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Notice ---------- */
.notice { background: var(--surface); border-left: 4px solid var(--s2); padding: 12px 14px; border-radius: 0 var(--radius-s) var(--radius-s) 0; margin-bottom: 20px; }
.notice.error { border-left-color: var(--danger); }
.notice .row { margin-top: 8px; }

/* ---------- Create: conversation ---------- */
.convo { display: grid; gap: 12px; margin-bottom: 16px; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: var(--radius-m); }
.msg.you { justify-self: end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.msg.curator { justify-self: start; background: var(--surface); border-bottom-left-radius: 4px; }
.msg.curator .understood { font-weight: 700; display: block; margin-bottom: 4px; }
.msg.curator ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: .92rem; }

.ask { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px; }
.ask textarea { border: 0; min-height: 56px; padding: 6px; }
.ask textarea:focus-visible { outline: none; }
.ask:focus-within { border-color: var(--action); box-shadow: 0 0 0 3px rgba(35,72,214,.18); }
.ask .row { justify-content: space-between; }
.examples { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; padding: 0; list-style: none; }
.examples button { min-height: 44px; min-width: 44px; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 8px 12px; cursor: pointer; text-align: left; font-size: .9rem; }
.examples button:hover { border-color: var(--action); color: var(--action); }

/* ---------- Draft & time strip (the signature element) ---------- */
.draft { margin-top: 28px; min-width: 0; }
textarea.draft-title { width: 100%; min-height: 0; border-radius: 0; resize: none; overflow: hidden; field-sizing: content; border: 0; background: transparent; padding: 4px 0; font-weight: 800; font-stretch: 75%; font-size: var(--step-2); line-height: 1.15; border-bottom: 2px solid transparent; }
textarea.draft-title:hover { border-bottom-color: var(--line); }
textarea.draft-title:focus-visible { outline: none; border-bottom-color: var(--action); }
.saved { font-size: .85rem; color: var(--muted); min-height: 1.3em; }

.strip-wrap { margin: 18px 0 8px; }
.strip-time { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; margin-bottom: 8px; }
.strip-time b { white-space: nowrap; font-size: clamp(2rem, 9vw, 2.6rem); font-weight: 800; font-stretch: 62%; line-height: 1; font-variant-numeric: tabular-nums; }
.strip-time span { color: var(--muted); font-variant-numeric: tabular-nums; }
.strip { position: relative; display: flex; gap: 2px; height: 40px; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--line) calc(10% - 1px) 10%); border-radius: 6px; padding: 0; }
.strip i { display: block; height: 100%; border-radius: 3px; min-width: 3px; background: var(--c, var(--s0)); }
.strip i.est { background: repeating-linear-gradient(135deg, var(--c) 0 6px, color-mix(in srgb, var(--c) 70%, #fff) 6px 9px); }
.strip i.lit { outline: 3px solid var(--ink); outline-offset: 1px; }
.strip .target { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--ink); }
.strip .target::after { content: attr(data-label); position: absolute; top: -20px; transform: translateX(-50%); font-size: .75rem; font-weight: 700; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: .9rem; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c); margin-right: 6px; vertical-align: 0; }
@media (prefers-reduced-motion: no-preference) {
  .strip.fresh i { animation: grow .5s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--n) * 18ms); transform-origin: left; }
  @keyframes grow { from { transform: scaleX(0); opacity: 0; } }
}

.tracks { list-style: none; margin: 16px 0 0; padding: 0; background: var(--surface); border-radius: var(--radius-m); overflow: hidden; }
.track { display: grid; grid-template-columns: 6px 44px minmax(0, 1fr) auto auto; align-items: center; gap: 8px 10px; padding: 8px 6px 8px 0; border-bottom: 1px solid var(--line); background: var(--surface); }
.track .grip { display: grid; place-items: center; width: 44px; height: 44px; color: var(--muted); cursor: grab; touch-action: none; border-radius: 6px; }
.track .grip:hover { background: var(--ground); color: var(--ink); }
.track .grip svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.track.dragging { opacity: .5; background: var(--ground); }
.track:last-child { border-bottom: 0; }
.track .bar { align-self: stretch; background: var(--c); }
.track .what { min-width: 0; text-align: left; background: none; border: 0; padding: 4px 0; cursor: default; }
.track .what-toggle { display: none; min-height: 44px; }
.track .what b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .what small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .len { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .92rem; }
.track .tools { display: flex; }
.flag { display: inline-block; font-size: .78rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; margin-left: 6px; vertical-align: 1px; }
.flag.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, #fff); }
@media (max-width: 560px) {
  .track { grid-template-columns: 6px 44px minmax(0, 1fr) auto; }
  .track .what-label { display: none; }
  .track .what-toggle { display: block; cursor: pointer; }
  .track .tools { display: none; grid-column: 3 / -1; justify-content: flex-start; margin-left: -8px; }
  .track.open { background: #F6F8F7; }
  .track.open .tools { display: flex; flex-wrap: wrap; }
}
.tracks-hint { display: block; margin-top: 10px; }
.phone-only { display: none; }
@media (max-width: 560px) { .phone-only { display: inline; } }


.draft-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.draft-actions .btn.primary { flex: 1 1 220px; }

/* ---------- Lists (playlists, library, search) ---------- */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius-m); overflow: hidden; }
.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; width: 100%; text-align: left; background: none; border: 0; text-decoration: none; color: inherit; cursor: pointer; min-height: 56px; }
.list .item:hover { background: #F6F8F7; }
.list .item.no-thumb { grid-template-columns: 1fr auto; }
.list .item b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.list .item small { display: block; color: var(--muted); }
.thumb { width: 72px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; background: var(--ground); }
.thumb.big { width: 112px; }
.meta { color: var(--muted); font-size: .9rem; text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius-m); }
.empty .btn { margin-top: 12px; }

.filters { display: grid; gap: 10px; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips button { min-height: 44px; min-width: 44px; flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: .9rem; }
.chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.count-line { color: var(--muted); margin: 0 0 8px; font-size: .9rem; }

.result { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 14px; align-items: start; }
.result .row { margin-top: 8px; }

/* ---------- Sheet (dialog) ---------- */
.sheet { border: 0; padding: 0; border-radius: var(--radius-m); width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 48px); background: var(--surface); color: var(--ink); }
.sheet::backdrop { background: rgba(24,38,46,.45); }
.sheet > div { padding: 20px; display: grid; gap: 14px; }
.account-delete-form { display: grid; gap: 12px; }
.sheet .sheet-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--action); background: #F3F5FD; }
.choice input { margin-top: 4px; }
.picker { max-height: 50dvh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-s); }
.skipped { margin: 0; padding-left: 18px; color: var(--muted); font-size: .92rem; }

/* ---------- Sign-in ---------- */
.signin { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.signin-inner {
  width: min(100%, 860px); display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 20px; align-items: center;
}
.signin h1 { font-size: clamp(2.5rem, 9vw, 3.2rem); font-stretch: 62%; }
.signin-copy { display: grid; gap: 12px; }
.signin-copy p { color: var(--muted); }
.signin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.signin-actions .btn { padding-inline: 16px; }
.signin-actions .fine { flex-basis: 100%; }
.signin-actions .fine:empty { margin-top: -10px; }
#welcome-tape .window { width: 78%; }
@media (min-width: 760px) {
  .signin-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 36px; }
  #welcome-tape { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---------- Help ---------- */
.help-page {
  max-width: 680px; margin: 0 auto; padding: 40px 20px 64px;
  display: grid; gap: 24px; line-height: 1.6;
}
.help-page section { display: grid; gap: 8px; }
.help-page h2 { font-size: 1.3rem; }

/* ---------- Affiliate placement preview ---------- */
.affiliate-preview {
  min-height: 100px; display: grid; place-items: center; text-align: center;
  padding: 16px; border: 1px dashed var(--muted); border-radius: var(--radius-m);
}
.signin-inner > .affiliate-preview { grid-column: 1 / -1; }

/* ---------- Terms & privacy ---------- */
.policy-links { display: flex; flex-wrap: wrap; column-gap: 16px; }
.policy-links a { display: inline-flex; align-items: center; min-height: 44px; }
.signin-actions .policy-links, .studio-credit { flex-basis: 100%; }
.policy-page { max-width: 680px; margin: 0 auto; padding: 40px 20px 64px; }
.policy-page .notice { margin-bottom: 16px; }
.policy-date { margin-top: 8px; }
.policy-content { display: grid; gap: 18px; margin-top: 28px; line-height: 1.6; }
.policy-content h2 { font-size: 1.3rem; }
.policy-page .policy-links { margin-top: 20px; }

/* ---------- Guides ---------- */
.guide-card {
  display: grid; justify-items: start; gap: 8px; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface);
}

/* ---------- Toasts & busy ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + var(--account-row) + 16px + env(safe-area-inset-bottom)); z-index: 40; display: grid; gap: 8px; width: min(520px, calc(100vw - 24px)); }
@media (min-width: 900px) { .toasts { bottom: 24px; left: calc(50% + 116px); } }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius-s); }
.toast.error { background: var(--danger); }
.busy { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; vertical-align: -3px; }
@media (prefers-reduced-motion: no-preference) { .busy { animation: spin .8s linear infinite; } @keyframes spin { to { transform: rotate(1turn); } } }
.loading { padding: 24px 0; color: var(--muted); }

/* ---------- Mixtape: cassette, sides, liner note, J-card ---------- */
.hand { font-family: "Caveat", "Bradley Hand", "Segoe Print", cursive; }
.tape-wrap { margin: 18px 0 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.cassette { position: relative; min-width: 0; width: min(100%, 420px); aspect-ratio: 16 / 10; box-sizing: border-box; padding: 3.5% 4% 0; border-radius: 16px; background: #26363E; display: flex; flex-direction: column; }
.cassette .screw { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #3B4D56; }
.cassette .s1 { left: 8px; top: 8px; } .cassette .s2 { right: 8px; top: 8px; } .cassette .s3 { left: 8px; bottom: 8px; } .cassette .s4 { right: 8px; bottom: 8px; }
.cassette .label { position: relative; min-width: 0; flex: 1 1 auto; border-radius: 8px; background: #FFFFFF; overflow: hidden; display: flex; flex-direction: column; }
.label-stripes { display: flex; height: 9px; flex: none; }
.label-stripes i { flex: 3; background: var(--s0); } .label-stripes i:nth-child(2) { flex: 2; background: var(--s1); } .label-stripes i:nth-child(3) { flex: 4; background: var(--s2); } .label-stripes i:nth-child(4) { flex: 2; background: var(--s3); }
.label-top { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 2px 12px 0; }
.label-title { min-width: 0; font-size: clamp(20px, 5.6vw, 26px); font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.label-side { font-weight: 800; font-stretch: 62%; font-size: 24px; }
.label-rule { margin: 2px 12px 0; border-top: 1px solid #C9D3D0; }
.window { margin: auto auto 0; width: 66%; height: 36%; min-height: 54px; border-radius: 999px; background: var(--ink); display: flex; align-items: center; justify-content: space-between; padding: 0 2.5%; box-sizing: border-box; }
.reel { width: 54px; height: 54px; display: grid; place-items: center; flex: none; }
.tape-pack { border-radius: 50%; background: #5A3B2A; display: grid; place-items: center; }
.hub { position: relative; width: 26px; height: 26px; border-radius: 50%; background: #F4F6F5; }
.hub i { position: absolute; left: 50%; top: 50%; width: 4px; height: 9px; margin: -4.5px 0 0 -2px; background: var(--ink); border-radius: 1px; transform-origin: 50% 50%; }
.hub i:nth-child(1) { transform: rotate(0deg) translateY(-6px); } .hub i:nth-child(2) { transform: rotate(120deg) translateY(-6px); } .hub i:nth-child(3) { transform: rotate(240deg) translateY(-6px); }
.counter { flex: 1; margin: 0 6px; height: 26px; border-radius: 4px; background: #2E4049; color: #C9D3D0; font-size: 12px; display: grid; place-items: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.counter.over { color: #F2B8C6; }
.label-foot { display: flex; justify-content: space-between; padding: 6px 12px 6px; font-size: 11px; color: var(--muted); }
.cassette-base { margin: 6px auto 0; width: 64%; height: 30px; background: #2E4049; clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%); display: flex; justify-content: center; align-items: center; gap: 46px; }
.cassette-base i { width: 11px; height: 11px; border-radius: 50%; background: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .tape-pack { transition: width .6s ease, height .6s ease; }
  .reel.spin .hub { animation: reelspin 1.2s linear 1; }
  @keyframes reelspin { to { transform: rotate(-360deg); } }
}
.sides { display: grid; gap: 8px; }
.side-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) 76px; align-items: center; gap: 8px; }
.side-name { white-space: nowrap; font-weight: 800; font-stretch: 62%; font-size: 18px; }
.side-bar { display: flex; gap: 2px; height: 22px; }
.side-bar i { display: block; height: 100%; border-radius: 3px; min-width: 3px; background: var(--c, var(--s0)); }
.side-bar i.est { background: repeating-linear-gradient(135deg, var(--c) 0 6px, color-mix(in srgb, var(--c) 70%, #fff) 6px 9px); }
.side-bar i.lit { outline: 3px solid var(--ink); outline-offset: 1px; }
.side-room { border: 1px dashed #B5C0BC; border-radius: 3px; }
.side-min { font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: no-preference) {
  .side-bar.fresh i { animation: grow .5s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--n) * 25ms); transform-origin: left; }
}
.liner-box { display: grid; gap: 2px; background: var(--surface); border-radius: var(--radius-m); padding: 10px 14px; }
textarea.liner { border: 0; padding: 0; min-height: 0; resize: none; font-size: 22px; line-height: 1.2; background: transparent; field-sizing: content; }
textarea.liner:focus-visible { outline: none; }
.liner-box:focus-within { box-shadow: 0 0 0 3px rgba(35,72,214,.18); }
.side-tag { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%; background: var(--ground); color: var(--muted); font-size: 11px; font-weight: 800; vertical-align: 1px; }
.jcard { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.jc-spine { flex: none; width: 44px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; }
.jc-spine span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; max-height: 360px; }
.jc-body { flex: 1; min-width: 0; padding: 12px 14px 14px; background-image: repeating-linear-gradient(#fff 0 25px, #E1E8E5 25px 26px); background-position: 0 42px; }
.jc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.jc-title { font-size: 28px; font-weight: 700; line-height: 1.05; }
.jc-side { margin-top: 10px; }
.jc-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 800; }
.jc-dot.a { background: var(--s0); } .jc-dot.b { background: var(--s1); }
.jc-list { margin: 4px 0 0; padding-left: 24px; font-size: 20px; line-height: 26px; }
.jc-by { color: var(--muted); }
.jc-note { margin-top: 10px; font-size: 21px; line-height: 1.2; white-space: pre-wrap; }

/* ---------- Skins ---------- */
.skin-picker { display: inline-flex; justify-self: start; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.skin-picker button { min-height: 44px; min-width: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; font-size: .9rem; color: var(--muted); cursor: pointer; }
.skin-picker button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* Boombox */
.boombox { width: min(100%, 520px); min-width: 0; display: flex; flex-direction: column; align-items: center; }
.bb-handle { width: 58%; height: 22px; border: 6px solid #3B4D56; border-bottom: 0; border-radius: 14px 14px 0 0; box-sizing: border-box; }
.bb-body { width: 100%; box-sizing: border-box; border-radius: 18px; background: #26363E; padding: 10px 12px 14px; display: grid; gap: 10px; }
.bb-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #C9D3D0; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.bb-brand { font-weight: 800; font-stretch: 70%; font-size: 14px; letter-spacing: 0; color: #fff; }
.bb-meter { flex: 1; max-width: 220px; display: flex; gap: 3px; height: 12px; padding: 3px; border-radius: 4px; background: #18262E; }
.bb-meter i { flex: 1; border-radius: 1px; background: #33454E; }
.bb-meter i.on { background: #4FC08D; }
.bb-meter i.hot { background: #E2A21B; }
.bb-front { display: grid; grid-template-columns: 1fr 1.35fr 1fr; align-items: center; gap: 10px; min-width: 0; }
.bb-speaker { aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #1E2C33 1.4px, transparent 1.6px) 0 0 / 7px 7px, #2E4049; display: grid; place-items: center; border: 4px solid #3B4D56; box-sizing: border-box; }
.bb-cone { width: 58%; aspect-ratio: 1; border-radius: 50%; background: #18262E; box-shadow: inset 0 0 0 5px #22323A; display: grid; place-items: center; }
.bb-dust { width: 30%; aspect-ratio: 1; border-radius: 50%; background: #3B4D56; }
.bb-deck { min-width: 0; display: grid; gap: 8px; }
.bb-door { min-width: 0; border-radius: 8px; background: #FFFFFF; padding: 6px 6px 8px; display: grid; gap: 4px; justify-items: center; }
.bb-title { max-width: 100%; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.bb-door .window { width: 100%; height: auto; min-height: 0; padding: 6px 4px; margin: 0; }
.bb-door .reel { width: 40px; height: 40px; }
.bb-door .reel { position: relative; overflow: visible; }
.bb-door .reel .tape-pack { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.74); }
.bb-door .hub { width: 20px; height: 20px; }
.bb-door .counter { font-size: 10px; height: 22px; margin: 0 3px; }
.bb-keys { display: flex; gap: 4px; justify-content: center; }
.bb-keys i { width: 22px; height: 12px; border-radius: 2px; background: #C9D3D0; }
.bb-keys i.play { background: #4FC08D; }
.bb-keys i.rec { background: #E05A6F; }
@media (max-width: 560px) {
  .bb-front { grid-template-columns: 0.8fr 1.6fr 0.8fr; gap: 6px; }
  .bb-door .reel { width: 32px; height: 32px; }
  .bb-door .reel .tape-pack { transform: translate(-50%, -50%) scale(.6); }
  .bb-door .hub { width: 16px; height: 16px; }
  .bb-door .hub i { height: 7px; margin-top: -3.5px; }
  .bb-title { font-size: 16px; }
}

/* Keep the policy and account controls accessible before consent. */
.shell:has(#main[data-view="privacy"]) .side { display: none; }
#main[data-view="privacy"], .shell:has(#main[data-view="privacy"]) .dashboard-footer {
  max-width: 680px; margin-inline: auto; padding-inline: 20px;
}
.shell:has(#main[data-view="privacy"]) .dashboard-footer { padding-bottom: 24px; }
/* B6: measured tempos sit below the cassette sides, never obstructing track controls. */
.tempo-line { display: flex; width: 100%; gap: 2px; overflow: hidden; margin: 4px 0 10px; }
.tempo-line span { min-width: 0; background: var(--ground); border-bottom: 2px solid var(--action);
  text-align: center; font-size: .7rem; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: clip; color: var(--muted); }
.tempo-line span:not(:first-child) { border-left: 1px solid var(--line); }
