/* MuzikCaffe: a dark, native-feeling music app. Phone first; tablet keeps the tab bar; desktop gets a left rail. */

@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/poppins-700.woff2") format("woff2"); }

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;
  /* colour */
  --bg: #000000;
  --surface-1: #121214;
  --surface-2: #1c1c20;
  --surface-3: #2a2a30;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .14);
  --text: #ffffff;
  --text-2: #a8a8b0;
  --text-3: #74747c;
  --accent: #2fdc76;
  --accent-press: #26bf65;
  --accent-ink: #03150a;
  --accent-soft: rgba(47, 220, 118, .13);
  --warn: #ffc54d;
  --warn-soft: rgba(255, 197, 77, .13);
  --danger: #ff6b6b;
  --danger-fill: #e5484d;
  --danger-soft: rgba(255, 107, 107, .13);
  /* spacing (4-pt scale) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px;
  /* type scale */
  --t-xs: 11px; --t-sm: 13px; --t-md: 15px; --t-lg: 17px; --t-xl: 20px; --t-2xl: 24px; --t-3xl: 32px; --t-4xl: 48px;
  /* radii */
  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 24px; --r-pill: 999px;
  /* layout */
  --tap: 44px;
  --gutter: 16px;
  --appbar-h: 64px;
  --tabbar-h: 68px;
  --rail-w: 0px;
  --player-h: 72px;
  --max: 1120px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 960px) { :root { --gutter: 32px; --rail-w: 248px; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
html:has(dialog[open]) { overflow: hidden; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); overflow-x: hidden;
       font: 400 var(--t-md)/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
       -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, label, summary, [role="button"] { touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
img, svg, video { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ellipsis { display: block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.note { font-size: var(--t-sm); color: var(--text-2); }
.note:empty { display: none; }
.note.center { text-align: center; margin-top: var(--s3); }
.hint { font-size: var(--t-sm); color: var(--text-3); margin-top: var(--s1); }
.err, .form-error, .job-error { color: var(--danger); font-size: var(--t-sm); white-space: pre-line; overflow-wrap: anywhere; }
.err:empty, .form-error:empty, .job-error:empty { display: none; }
.skip { position: absolute; top: var(--s2); left: var(--s2); z-index: 200; padding: var(--s3) var(--s4); border-radius: var(--r-pill);
        background: var(--text); color: #000; font-weight: 600; text-decoration: none; transform: translateY(-300%); }
.skip:focus { transform: none; }

.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.art { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- brand mark ---------- */
.mark { width: 36px; height: 36px; flex: none; border-radius: 11px; background: var(--accent); color: var(--accent-ink);
        display: grid; place-items: center; }
.mark svg { width: 22px; height: 22px; }
.mark-lg { width: 64px; height: 64px; border-radius: 19px; }
.mark-lg svg { width: 38px; height: 38px; }
.wordmark { font-size: var(--t-xl); font-weight: 700; letter-spacing: -.02em; }

/* ---------- buttons ---------- */
.btn { min-height: 52px; padding: 0 var(--s6); border: 0; border-radius: var(--r-pill); display: inline-flex; align-items: center;
       justify-content: center; gap: var(--s2); font-size: var(--t-md); font-weight: 600; line-height: 1.2; white-space: nowrap;
       text-decoration: none; min-width: 0; transition: transform .12s var(--ease), background-color .15s, opacity .15s; }
.btn > span { overflow: hidden; text-overflow: ellipsis; }
.btn .i { width: 20px; height: 20px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-secondary { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-danger { background: var(--danger-fill); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger-soft); }
.btn-block { width: 100%; }
.btn-sm { min-height: var(--tap); padding: 0 var(--s4); font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-row { display: flex; gap: var(--s3); }
.btn-row > .btn { flex: 1 1 0; }
.stack-actions { display: grid; gap: var(--s3); width: 100%; }

.round-btn { width: var(--tap); height: var(--tap); flex: none; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center;
             background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); text-decoration: none;
             transition: transform .12s var(--ease), background-color .15s; }
.round-btn.ghost { box-shadow: none; color: var(--text-2); }
.avatar-btn { overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-2); }
.avatar { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none;
          background: linear-gradient(135deg, #2fdc76, #1a7f8f); color: #03150a; font-weight: 700; font-size: 16px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.play-btn { width: 48px; height: 48px; flex: none; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
            display: grid; place-items: center; position: relative; transition: transform .12s var(--ease); }
.play-btn .i { width: 24px; height: 24px; }
.play-lg { width: 56px; height: 56px; }
.play-lg .i { width: 26px; height: 26px; }
.play-btn.loading .i { opacity: 0; }
.play-btn.loading::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%;
                           border: 2.5px solid rgba(3, 21, 10, .25); border-top-color: var(--accent-ink); animation: spin .8s linear infinite; }

.text-link { min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 var(--s1); font-size: 14px; font-weight: 600;
             color: var(--accent); text-decoration: none; white-space: nowrap; }

.ic-circle { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center;
             background: var(--surface-2); color: var(--accent); }
.ic-sm { width: 36px; height: 36px; }
.ic-sm .i { width: 18px; height: 18px; }
.ic-xl { width: 64px; height: 64px; }
.ic-xl .i { width: 30px; height: 30px; }
.ic-accent { background: var(--accent); color: var(--accent-ink); }

/* press states (no hover-only affordances) */
.btn:not(:disabled):active, .round-btn:active, .play-btn:not(:disabled):active, .tile:active, .lib-main:active, .menu-item:not(:disabled):active,
.cta-row:active, .hero-card.latest:active, .tab:active .tab-ic, .list-row:active, .bar:active, .seg button:active, .stepper button:active { transform: scale(.97); }
.list-row:active, .menu-item:not(:disabled):active { background: var(--surface-2); }
@media (hover: hover) {
  .btn-primary:not(:disabled):hover { background: var(--accent-press); }
  .btn-secondary:not(:disabled):hover, .round-btn:hover { background: var(--surface-3); }
  .menu-item:not(:disabled):hover, .list-row:hover, .lib-row:hover { background: var(--surface-2); }
  .tab:hover .tab-label { color: var(--text); }
  .bar:hover { border-color: var(--line-2); }
}

/* ---------- switch ---------- */
.switch { position: relative; width: 51px; height: 31px; flex: none; display: inline-block; }
.switch input { position: absolute; inset: 0; margin: 0; opacity: 0; z-index: 1; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--surface-3); transition: background-color .2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
                      box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transition: transform .22s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- segmented control ---------- */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(max-content, 1fr); gap: 2px; padding: 3px; border-radius: var(--r-pill);
       background: var(--surface-2); }
.seg button { min-height: var(--tap); min-width: 0; padding: 0 var(--s3); border: 0; border-radius: var(--r-pill); background: transparent;
              color: var(--text-2); font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
              display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background-color .15s, color .15s; }
.seg button .i { width: 18px; height: 18px; }
.seg button.on { background: var(--text); color: #000; font-weight: 600; }
.seg-lg button { min-height: 46px; font-size: var(--t-md); }

/* ---------- inputs ---------- */
.text-input, .field input { font-size: 16px; }
.text-input { width: 100%; min-height: 52px; padding: 0 var(--s4); border-radius: var(--r-md); border: 1px solid var(--line-2);
              background: var(--surface-2); color: var(--text); outline: none; transition: border-color .15s; }
.text-input:focus { border-color: var(--accent); }
.text-input::placeholder, .field input::placeholder, .num-input::placeholder { color: var(--text-3); }
.input-label { font-size: var(--t-sm); color: var(--text-2); margin-top: var(--s1); }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: var(--tap); margin: 0; background: transparent;
                      cursor: pointer; --pct: 0%; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px;
  background: linear-gradient(to right, var(--accent) var(--pct), var(--surface-3) var(--pct)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--surface-3); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%;
  background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; }

/* ---------- surfaces ---------- */
.panel { background: var(--surface-1); border-radius: var(--r-lg); padding: var(--s4); }
.pill-tag { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; align-self: flex-start; padding: 6px var(--s3);
            border-radius: var(--r-pill); background: rgba(0, 0, 0, .42); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
            color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-tag .i { width: 15px; height: 15px; }

.hero-card { position: relative; display: block; overflow: hidden; border-radius: var(--r-xl); background: var(--surface-1);
             color: #fff; text-decoration: none; isolation: isolate; transition: transform .15s var(--ease); }
.hero-overlay { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--s2);
                padding: var(--s5); background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, .15) 55%, transparent); min-width: 0; }

.list-group { background: var(--surface-1); border-radius: var(--r-lg); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: var(--s3) var(--s4); border: 0;
            background: transparent; color: var(--text); text-align: left; cursor: pointer; transition: background-color .15s, transform .12s var(--ease); }
.list-row + .list-row { box-shadow: inset 0 1px 0 var(--line); }
.row-ic { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.row-ic .i { width: 20px; height: 20px; }
.row-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-text > b { font-size: var(--t-md); font-weight: 600; line-height: 1.35; }
.row-text > span { font-size: var(--t-sm); color: var(--text-2); line-height: 1.4; }
.chev { width: 20px; height: 20px; color: var(--text-3); }

.empty-card { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: var(--s2); text-align: center; padding: var(--s8) var(--s5);
              background: var(--surface-1); border-radius: var(--r-xl); }
.empty-card b { font-size: var(--t-lg); margin-top: var(--s2); }
.empty-card p { color: var(--text-2); margin-bottom: var(--s3); }
.empty-note { color: var(--text-2); text-align: center; padding: var(--s7) 0; }

.verdict { color: var(--text-2); }
.verdict.good { color: var(--accent); }
.verdict.fair { color: var(--warn); }
.verdict.risky { color: var(--danger); }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s6); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent);
           animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- landing ---------- */
.landing { max-width: 1160px; min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column;
           padding: calc(var(--safe-t) + var(--s2)) max(var(--gutter), var(--safe-r)) calc(var(--safe-b) + var(--s4)) max(var(--gutter), var(--safe-l)); }
.landing-top { display: flex; align-items: center; gap: var(--s3); min-height: 56px; }
.landing-grid { display: grid; gap: var(--s6); margin-top: var(--s3); align-items: center; }
.landing-media { display: grid; gap: var(--s4); min-width: 0; }
.video-frame { aspect-ratio: 16 / 9; border-radius: var(--r-xl); overflow: hidden; background: var(--surface-1); box-shadow: 0 0 0 1px var(--line); }
.video-frame video { width: 100%; height: 100%; object-fit: cover; }
.landing-hero { aspect-ratio: 16 / 11; }
.hero-chords { display: flex; flex-wrap: wrap; gap: var(--s2); }
.hc { padding: 6px var(--s3); border-radius: var(--r-sm); background: rgba(255, 255, 255, .14); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
      font-size: var(--t-xl); font-weight: 700; line-height: 1.2; }
.hc sup { font-size: 11px; font-weight: 600; opacity: .7; margin-left: 1px; }
.hc.on { background: var(--accent); color: var(--accent-ink); }
.hero-meta { font-size: var(--t-sm); color: rgba(255, 255, 255, .78); }
.landing-copy { min-width: 0; }
.landing-copy h1 { font-size: var(--t-3xl); line-height: 1.15; font-weight: 700; letter-spacing: -.025em; }
.accent { color: var(--accent); }
.lede { margin-top: var(--s3); font-size: 16px; line-height: 1.6; color: var(--text-2); }
.signin { margin-top: var(--s6); display: grid; gap: var(--s2); max-width: 400px; }
.gsi { min-height: var(--tap); display: flex; flex-direction: column; align-items: center; }
.mock-gsi { width: 100%; min-height: 52px; border: 0; border-radius: var(--r-pill); background: #fff; color: #1f1f1f;
            display: inline-flex; align-items: center; justify-content: center; gap: var(--s3); font-size: 16px; font-weight: 600; }
.mock-gsi svg { width: 20px; height: 20px; }
.mock-note { font-size: 12px; color: var(--text-3); margin-top: var(--s2); text-align: center; overflow-wrap: anywhere; }
.feature-list { list-style: none; margin: var(--s7) 0 0; padding: 0; display: grid; gap: var(--s5); }
.feature-list li { display: flex; gap: var(--s4); align-items: flex-start; }
.feature-list b { display: block; font-size: var(--t-md); font-weight: 600; }
.feature-list p { font-size: 14px; color: var(--text-2); margin-top: 2px; }
.site-foot { margin-top: auto; padding-top: var(--s8); display: flex; flex-direction: column; align-items: center; gap: var(--s1);
             font-size: 12px; color: var(--text-3); text-align: center; }
.foot-links { display: flex; gap: var(--s2); }
.foot-links a { min-height: var(--tap); min-width: var(--tap); display: inline-flex; align-items: center; justify-content: center;
                padding: 0 var(--s3); color: var(--text-2); font-size: var(--t-sm); font-weight: 500; text-decoration: none; }
@media (max-width: 599px) and (max-height: 760px) {   /* short phones: keep the sign-in button near the fold */
  .landing-top { min-height: 48px; }
  .landing-grid { gap: var(--s4); margin-top: var(--s2); }
  .landing-hero { aspect-ratio: 2 / 1; }
  .landing-hero .hero-overlay { padding: var(--s4); }
  .landing-copy h1 { font-size: 27px; }
  .lede { font-size: var(--t-md); line-height: 1.5; }
  .signin { margin-top: var(--s4); }
}
@media (min-width: 600px) {
  .landing-copy h1 { font-size: 42px; }
  .landing-hero { aspect-ratio: 16 / 9; }
}
@media (min-width: 900px) {
  .landing-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s9); margin-top: var(--s7); }
  .landing-copy { grid-row: 1; grid-column: 1; }
  .landing-media { grid-column: 2; }
  .landing-copy h1 { font-size: var(--t-4xl); }
  .landing-hero { aspect-ratio: 4 / 3.4; }
  .site-foot { flex-direction: row; justify-content: space-between; }
}

/* ---------- notice (no access / API down) ---------- */
.notice { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
          padding: calc(var(--safe-t) + var(--s6)) var(--gutter) calc(var(--safe-b) + var(--s4)); }
.notice-card { width: 100%; max-width: 420px; margin-top: auto; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: var(--s3); text-align: center; }
.notice-card h1 { font-size: var(--t-2xl); line-height: 1.25; margin-top: var(--s2); }
.notice-card p { color: var(--text-2); overflow-wrap: anywhere; }
.notice-card > *, .empty-card > * { max-width: 100%; }
.signed-as { display: flex; align-items: center; gap: var(--s3); max-width: 100%; margin: var(--s2) 0 var(--s3); padding: 6px var(--s4) 6px 6px;
             border-radius: var(--r-pill); background: var(--surface-1); font-size: 14px; }
.signed-as .avatar { width: 32px; height: 32px; font-size: 14px; }

/* ---------- app shell ---------- */
.appbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--s3);
          min-height: calc(var(--appbar-h) + var(--safe-t)); margin-left: var(--rail-w);
          padding: var(--safe-t) max(var(--gutter), var(--safe-r)) 0 max(var(--gutter), var(--safe-l));
          background: rgba(0, 0, 0, .82); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px); }
.appbar-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.appbar-title .kicker { font-size: var(--t-sm); color: var(--text-2); line-height: 1.3; }
.appbar-title .title { font-size: var(--t-2xl); font-weight: 700; line-height: 1.25; letter-spacing: -.02em;
                       overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar.sub .appbar-title .title { font-size: var(--t-lg); font-weight: 600; }
.appbar-actions { display: flex; gap: var(--s2); flex: none; }

.content { display: block; margin-left: var(--rail-w); outline: none;
           padding: var(--s2) max(var(--gutter), var(--safe-r)) calc(var(--tabbar-h) + var(--safe-b) + var(--s7)) max(var(--gutter), var(--safe-l)); }
body.has-player .content { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--player-h) + var(--s7)); }
.view { max-width: var(--max); margin: 0 auto; min-width: 0; }

.tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: flex; justify-content: center;
          height: calc(var(--tabbar-h) + var(--safe-b)); padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
          background: rgba(12, 12, 14, .9); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
          box-shadow: inset 0 1px 0 var(--line); }
.rail-brand { display: none; }
.tab { flex: 1 1 0; max-width: 168px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
       border: 0; background: transparent; color: var(--text-3); text-decoration: none; padding: 0; }
.tab-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; transition: background-color .2s, color .2s, transform .12s var(--ease); }
.tab-label { font-size: var(--t-xs); font-weight: 500; line-height: 1.3; white-space: nowrap; transition: color .2s; }
.tab.on { color: var(--text); }
.tab.on .tab-ic { background: var(--accent); color: var(--accent-ink); }

@media (min-width: 960px) {
  .tabbar { top: 0; right: auto; width: var(--rail-w); height: auto; flex-direction: column; justify-content: flex-start; gap: var(--s1);
            padding: calc(var(--safe-t) + var(--s6)) var(--s4) var(--s6) max(var(--s4), var(--safe-l));
            background: var(--bg); box-shadow: inset -1px 0 0 var(--line); }
  .rail-brand { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s2) var(--s6); font-size: var(--t-xl); font-weight: 700; letter-spacing: -.02em; }
  .tab { flex: none; max-width: none; flex-direction: row; justify-content: flex-start; gap: 14px; min-height: 52px; padding: 6px;
         border-radius: var(--r-pill); color: var(--text-2); }
  .tab-label { font-size: var(--t-md); }
  .tab.on { background: var(--surface-1); }
  .content { padding-bottom: var(--s8); }
  body.has-player .content { padding-bottom: calc(var(--player-h) + var(--s8) + var(--s4)); }
}

/* ---------- home ---------- */
#homeHero { display: grid; gap: var(--s3); }
.hero-card.latest { aspect-ratio: 16 / 10; }
.hero-card.latest .hero-overlay { padding-right: 92px; gap: 2px; }
.hero-card.latest > .play-btn { position: absolute; right: var(--s5); bottom: var(--s5); z-index: 2; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.hero-title { font-size: var(--t-2xl); font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.hero-sub { font-size: 14px; color: rgba(255, 255, 255, .8); }
.cta-hero .hero-overlay { position: relative; min-height: 340px; gap: var(--s3); }
.cta-hero h2 { font-size: var(--t-2xl); line-height: 1.2; font-weight: 700; }
.cta-hero p { color: rgba(255, 255, 255, .85); font-size: 14px; }
.cta-hero .btn { margin-top: var(--s2); }
.cta-row { display: flex; align-items: center; gap: 14px; min-height: 72px; color: var(--text); text-decoration: none; transition: transform .12s var(--ease); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin: var(--s6) 0 var(--s3); min-height: var(--tap); }
.section-head h2 { font-size: var(--t-xl); font-weight: 700; white-space: nowrap; }
.section-head .note { text-align: right; }
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5) var(--s3); }
.tile { min-width: 0; display: flex; flex-direction: column; color: var(--text); text-decoration: none; transition: transform .12s var(--ease); }
.tile-art { position: relative; display: block; aspect-ratio: 1; border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--s2); background: var(--surface-1); }
.tile-badge { position: absolute; top: var(--s2); left: var(--s2); z-index: 1; padding: 2px var(--s2); border-radius: var(--r-pill);
              background: rgba(0, 0, 0, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: var(--t-xs); font-weight: 600; }
.tile b { font-size: 14px; font-weight: 600; line-height: 1.35; }
.tile > span:last-child { font-size: 12px; color: var(--text-2); }
@media (min-width: 600px) {
  .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-card.latest { aspect-ratio: 21 / 9; }
  .hero-title { font-size: 28px; }
}
@media (min-width: 1200px) { .tile-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } .hero-card.latest { aspect-ratio: 3 / 1; } }

/* ---------- new track ---------- */
.make { display: grid; gap: var(--s4); padding: 0; background: none; max-width: 640px; }
.field { display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: 0 var(--s4); border-radius: var(--r-md);
         background: var(--surface-2); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s; }
.field:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.field input { flex: 1; min-width: 0; height: 54px; border: 0; outline: none; background: transparent; color: var(--text); }
.drop { display: grid; justify-items: center; gap: 6px; padding: var(--s7) var(--s4); border-radius: var(--r-lg); text-align: center;
        background: var(--surface-1); border: 1.5px dashed var(--line-2); cursor: pointer; transition: border-color .15s, background-color .15s; }
.drop .ic-circle { width: 56px; height: 56px; margin-bottom: var(--s2); }
.drop b { font-size: 16px; font-weight: 600; }
.drop-hint { font-size: var(--t-sm); color: var(--text-2); }
.drop.over, .drop.has-file { border-color: var(--accent); background: var(--accent-soft); }
.switch-row { cursor: pointer; }
@media (max-width: 359px) { .list-row .row-ic { display: none; } }
.make .form-error { margin-top: calc(var(--s2) * -1); }
.view#viewNew > .job-slot { max-width: 640px; margin-top: var(--s6); }

/* ---------- job progress ---------- */
.job { display: grid; gap: 14px; margin-bottom: var(--s4); }
.job-head { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.job-art { position: relative; width: 48px; height: 48px; flex: none; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.job-head .row-text > span { overflow-wrap: anywhere; }
.progress { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .5s var(--ease); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.step { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: var(--s3); min-height: 36px;
        font-size: 14px; color: var(--text-2); }
.step-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.step-ic .i { width: 14px; height: 14px; stroke-width: 2.6; }
.step-name { min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.step-name small { display: block; font-size: 12px; color: var(--text-3); }
.step .tm { font-size: var(--t-sm); color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.step.done .step-ic { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.step.done { color: var(--text); }
.step.cached .step-ic { background: var(--surface-3); color: var(--text-2); box-shadow: none; }
.step.active { color: var(--text); font-weight: 500; }
.step.active .step-ic { box-shadow: inset 0 0 0 1.5px var(--accent); }
.step.active .tm { color: var(--accent); }
.step.failed .step-ic { background: var(--danger-fill); color: #fff; box-shadow: none; }
.step.failed { color: var(--danger); }
.step.later { opacity: .65; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
#viewHome .job .steps, #viewLibrary .job .steps { display: none; }

/* confidence rating */
.rating { display: grid; gap: var(--s3); }
.rating-top { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: var(--s4); align-items: center; }
.score { --c: var(--text-2); width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center;
         background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0); }
.score.good { --c: var(--accent); } .score.fair { --c: var(--warn); } .score.risky { --c: var(--danger); }
.score-in { width: 78px; height: 78px; border-radius: 50%; background: var(--surface-1); display: grid; place-content: center; text-align: center; line-height: 1.1; }
.score-in b { font-size: 26px; font-weight: 700; }
.score-in small { font-size: 12px; color: var(--text-2); }
.subs { display: grid; gap: var(--s2); min-width: 0; }
.sub .row { display: flex; justify-content: space-between; gap: var(--s2); font-size: 12px; color: var(--text-2); }
.sub .num { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; }
.meter { height: 5px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; margin-top: 3px; }
.meter > div { height: 100%; border-radius: inherit; background: var(--text-2); }
.notes { margin: 0; padding-left: 18px; font-size: 14px; color: var(--text-2); display: grid; gap: var(--s1); }
p.notes { padding-left: 0; }
.rating .stack-actions { margin-top: var(--s2); }

/* ---------- library ---------- */
.lib-list { display: grid; gap: var(--s1); }
.lib-row { display: flex; align-items: center; gap: var(--s1); border-radius: var(--r-md); padding-right: var(--s1); min-width: 0; transition: background-color .15s; }
.lib-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 76px; padding: var(--s2) var(--s1);
            color: var(--text); text-decoration: none; border-radius: var(--r-md); transition: transform .12s var(--ease); }
.thumb { position: relative; width: 60px; height: 60px; flex: none; border-radius: var(--r-md); overflow: hidden; background: var(--surface-1); }
.meta { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.meta > b { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px var(--s2); border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 600; background: var(--surface-2); line-height: 1.6; }
.meta > .verdict.good { background: var(--accent-soft); } .meta > .verdict.fair { background: var(--warn-soft); } .meta > .verdict.risky { background: var(--danger-soft); }
.meta > .tag { color: var(--text-2); }
.meta > .verdict { flex: none; }
@media (min-width: 1100px) { .lib-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s6); } }

/* ---------- song ---------- */
#viewSong.loading .song-layout { visibility: hidden; }
.song-layout { display: grid; gap: var(--s6); min-width: 0; }
.song-side, .song-main { min-width: 0; display: grid; gap: var(--s4); align-content: start; }
.song-hero { aspect-ratio: 16 / 10; }
.song-hero .hero-overlay { padding-right: 92px; }
.hero-play { position: absolute; right: var(--s4); bottom: var(--s4); z-index: 2; }
.title-view { display: flex; align-items: flex-start; gap: var(--s3); }
.title-text { flex: 1 1 auto; min-width: 0; }
.title-text h1 { font-size: var(--t-2xl); line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.title-text .sub { margin-top: 2px; color: var(--text-2); overflow-wrap: anywhere; }
.edit-form { display: grid; gap: 6px; }
.edit-form .btn-row { margin-top: var(--s2); }
.song-actions .btn { padding: 0 var(--s4); }
@media (max-width: 359px) { .song-actions .btn { padding: 0 var(--s3); gap: 6px; font-size: 14px; } .song-actions .btn .i { width: 18px; height: 18px; } }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.stat { background: var(--surface-1); border-radius: var(--r-md); padding: var(--s3) 14px; min-width: 0; }
.stat .k { font-size: 12px; color: var(--text-2); }
.stat .v { font-size: var(--t-lg); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.stat .d { font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }
.conf-panel { padding: 0; }
.conf-panel summary { list-style: none; display: flex; align-items: center; gap: var(--s3); min-height: 60px; padding: var(--s2) var(--s4); cursor: pointer; }
.conf-panel summary::-webkit-details-marker { display: none; }
.conf-sum { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 var(--s2); font-weight: 500; }
.conf-sum b { font-weight: 600; }
.conf-panel .chev { transition: transform .2s var(--ease); }
.conf-panel[open] .chev { transform: rotate(90deg); }
.conf-panel > div { padding: 0 var(--s4) var(--s4); }
.panel-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.panel-title b { font-size: var(--t-md); font-weight: 600; }
.panel-title span { font-size: var(--t-sm); color: var(--text-2); }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: var(--s2); }
.chip { display: flex; flex-direction: column; align-items: center; padding: var(--s2) var(--s1); border-radius: var(--r-sm); background: var(--surface-2); min-width: 0; }
.chip i { font-style: normal; font-size: 11px; color: var(--accent); font-weight: 600; }
.chip b { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; text-align: center; }
@media (min-width: 600px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .song-hero { aspect-ratio: 21 / 9; }
}
@media (min-width: 1100px) {
  .song-layout { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: var(--s7); align-items: start; }
  .song-hero { aspect-ratio: 1; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #chartBox > .section-head:first-child { margin-top: 0; }
}

/* chart */
#chartBox > .section-head { margin: var(--s2) 0 var(--s1); }
.chart-tools { margin: var(--s3) 0; }
.chart-tools .btn { flex: 0 1 auto; }
.bars { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--s2); }
.bar { position: relative; min-width: 0; min-height: 100px; display: flex; flex-direction: column; gap: 2px; padding: 0 0 var(--s3) var(--s3);
       border-radius: var(--r-md); background: var(--surface-1); box-shadow: inset 0 0 0 1px transparent; cursor: pointer;
       transition: background-color .15s, box-shadow .15s, transform .12s var(--ease); }
.bar-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s1); }
.bar .t { padding-top: 10px; min-width: 0; display: flex; flex-direction: column; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; line-height: 1.3; }
.cue-label { color: var(--accent); font-weight: 600; font-size: 11px; }
.mic { width: var(--tap); height: var(--tap); flex: none; border: 0; padding: 0; border-radius: 50%; background: transparent;
       color: var(--text-3); display: grid; place-items: center; }
.mic .i { width: 19px; height: 19px; }
.chords { display: flex; flex-wrap: wrap; gap: 0 var(--s3); padding-right: var(--s3); min-width: 0; }
.c { font-size: 19px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.c sup { font-size: 11px; font-weight: 500; color: var(--accent); margin-left: 1px; }
.c.none { color: var(--text-3); }
.ly { font-size: var(--t-sm); line-height: 1.35; color: var(--text-2); padding-right: var(--s3); overflow-wrap: anywhere; }
.bar.now { background: #10301d; box-shadow: inset 0 0 0 1.5px var(--accent); }
.bar.now .ly { color: var(--text); }
.bar.muted .mic { color: var(--danger); }
.bar.muted .ly { color: var(--text-3); text-decoration: line-through; text-decoration-color: rgba(255, 107, 107, .6); }
#deleteTrack { margin-top: var(--s5); }

/* ---------- mini player ---------- */
.mini-player { position: fixed; z-index: 35; left: calc(var(--rail-w) + max(var(--s2), var(--safe-l))); right: max(var(--s2), var(--safe-r));
               bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--s2)); pointer-events: none; }
.mini-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3) var(--s2) var(--s2);
              border-radius: 22px; background: rgba(30, 30, 35, .92); backdrop-filter: saturate(160%) blur(20px); -webkit-backdrop-filter: saturate(160%) blur(20px);
              box-shadow: 0 0 0 1px var(--line-2), 0 12px 32px rgba(0, 0, 0, .55); pointer-events: auto; animation: rise .3s var(--ease); }
.seek-wrap { position: relative; flex: 1 1 auto; min-width: 0; height: 48px; display: flex; align-items: flex-start; }
.seek-wrap input { height: var(--tap); }
.seek-wrap .time { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; color: var(--text-2); text-align: right;
                   font-variant-numeric: tabular-nums; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vox-btn { position: relative; width: var(--tap); height: var(--tap); flex: none; border-radius: 50%; display: grid; place-items: center;
           background: var(--surface-3); color: var(--text); cursor: pointer; }
.vox-btn input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.vox-btn .i { width: 20px; height: 20px; grid-area: 1 / 1; }
.vox-btn .off-ic { display: none; }
.vox-btn.off { background: var(--danger-soft); color: var(--danger); }
.vox-btn.off .on-ic { display: none; }
.vox-btn.off .off-ic { display: block; }
.vox-btn.disabled { opacity: .4; }
@media (min-width: 960px) { .mini-player { bottom: calc(var(--safe-b) + var(--s4)); left: calc(var(--rail-w) + var(--gutter)); right: var(--gutter); } }

/* ---------- sheets (dialogs) ---------- */
dialog.sheet { border: 0; padding: 0; margin: auto; width: min(480px, calc(100vw - 48px)); max-width: none; max-height: min(86dvh, 780px);
               background: var(--surface-1); color: var(--text); border-radius: var(--r-xl); overflow: hidden;
               box-shadow: 0 0 0 1px var(--line-2), 0 30px 80px rgba(0, 0, 0, .7); }
dialog.sheet[open] { display: flex; flex-direction: column; animation: pop .22s var(--ease); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet-sm { width: min(400px, calc(100vw - 48px)); }
.sheet-head { position: relative; display: flex; align-items: center; gap: var(--s3); padding: var(--s5) var(--s5) var(--s2); flex: none; }
.sheet-head h2 { flex: 1 1 auto; min-width: 0; font-size: var(--t-xl); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.menu-head-text { flex: 1 1 auto; min-width: 0; }
.menu-head-text h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--s2) var(--s5) var(--s5); }
.sheet-foot { flex: none; padding: var(--s3) var(--s5) var(--s5); box-shadow: inset 0 1px 0 var(--line); }
.sheet-foot.btn-row > .btn { flex: 1 1 0; }
@media (max-width: 599px) {
  dialog.sheet, .sheet-sm { width: 100%; max-width: 100%; margin: auto 0 0; max-height: calc(100dvh - var(--safe-t) - var(--s6));
                            border-radius: var(--r-xl) var(--r-xl) 0 0; }
  dialog.sheet[open] { animation: sheet-up .32s var(--ease); }
  .sheet-head { padding-top: 28px; }
  .sheet-head::before { content: ""; position: absolute; top: 10px; left: 50%; width: 36px; height: 5px; margin-left: -18px;
                        border-radius: var(--r-pill); background: var(--line-2); }
  .sheet-body:last-child, .sheet-foot { padding-bottom: calc(var(--s5) + var(--safe-b)); }
  .sheet-body, .sheet-head, .sheet-foot { padding-left: max(var(--s5), var(--safe-l)); padding-right: max(var(--s5), var(--safe-r)); }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* action menu */
.menu-list { display: grid; gap: 2px; }
.menu-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: var(--s2) var(--s2); border: 0; border-radius: var(--r-md);
             background: transparent; color: var(--text); text-align: left; transition: background-color .15s, transform .12s var(--ease); }
.menu-item .row-text > b { font-weight: 500; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger .ic-circle { background: var(--danger-soft); color: var(--danger); }
.menu-item:disabled { opacity: .45; cursor: default; }

/* options */
.opt-group { display: grid; gap: var(--s2); padding: var(--s4) 0; }
.opt-group + .opt-group { box-shadow: inset 0 1px 0 var(--line); }
.opt-group:first-child { padding-top: var(--s1); }
.opt-group h3 { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 52px; }
.opt { display: grid; gap: var(--s2); padding: var(--s2) 0; }
.label { font-size: var(--t-md); color: var(--text); min-width: 0; }
.opt .label { font-size: 14px; color: var(--text-2); }
.value { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.switch-line { cursor: pointer; }
.stepper { display: flex; align-items: center; flex: none; border-radius: var(--r-pill); background: var(--surface-2); }
.stepper button { width: var(--tap); height: var(--tap); border: 0; border-radius: 50%; background: transparent; color: var(--text); font-size: 22px; line-height: 1; }
.stepper output { min-width: 28px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.unit-input { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 0 var(--s3); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font-size: 14px; }
.num-input { width: 72px; height: var(--tap); border: 0; outline: none; background: transparent; color: var(--text); font-size: 16px; text-align: right; -moz-appearance: textfield; }
.num-input::-webkit-inner-spin-button, .num-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.unit-input:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }

/* invites */
.invite-form { display: flex; gap: var(--s2); margin: var(--s4) 0 var(--s2); }
.invite-form .text-input { flex: 1 1 auto; min-width: 0; }
.invite-form .btn { flex: none; }
.invite-list { list-style: none; margin: var(--s2) 0 0; padding: 0; }
.invite-list li { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) 0; min-width: 0; }
.invite-list li + li { box-shadow: inset 0 1px 0 var(--line); }
.invite-list .row-text > b { font-size: 14px; font-weight: 500; }
.invite-list .row-text > span { font-size: 12px; color: var(--text-3); }
.invite-list .empty-row { color: var(--text-2); padding: var(--s5) 0; justify-content: center; }

/* ---------- toast ---------- */
.toast { position: fixed; z-index: 300; left: 50%; bottom: calc(var(--safe-b) + var(--s6)); max-width: min(440px, calc(100vw - 32px));
         padding: var(--s3) var(--s5); border-radius: 22px; background: #fff; color: #000; font-size: 14px; font-weight: 500;
         text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); pointer-events: none; overflow-wrap: break-word; width: max-content;
         opacity: 0; visibility: hidden; transform: translate(-50%, 12px); transition: opacity .2s, transform .25s var(--ease), visibility .2s; }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast.error { background: var(--danger-fill); color: #fff; }
body[data-screen="app"] .toast { bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--s3)); }
body[data-screen="app"].has-player .toast { bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--player-h) + var(--s4)); }
@media (min-width: 960px) {
  body[data-screen="app"] .toast { bottom: var(--s6); margin-left: calc(var(--rail-w) / 2); }
  body[data-screen="app"].has-player .toast { bottom: calc(var(--player-h) + var(--s7)); }
}

/* ---------- privacy / terms ---------- */
.doc-page { max-width: 760px; margin: 0 auto;
            padding: 0 max(var(--gutter), var(--safe-r)) calc(var(--safe-b) + var(--s4)) max(var(--gutter), var(--safe-l)); min-height: 100dvh;
            display: flex; flex-direction: column; }
.doc-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: var(--s3); min-height: calc(var(--appbar-h) + var(--safe-t));
           padding-top: var(--safe-t); background: rgba(0, 0, 0, .85); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.doc-bar .wordmark { font-size: var(--t-lg); }
.doc h1 { font-size: var(--t-3xl); line-height: 1.2; font-weight: 700; margin-top: var(--s4); }
.doc .updated { color: var(--text-3); font-size: var(--t-sm); margin: var(--s1) 0 var(--s6); }
.doc section { background: var(--surface-1); border-radius: var(--r-lg); padding: var(--s5); margin-bottom: var(--s3); }
.doc h2 { font-size: var(--t-lg); font-weight: 600; margin-bottom: var(--s2); }
.doc p, .doc li { color: var(--text-2); line-height: 1.65; overflow-wrap: anywhere; }
.doc p + p { margin-top: var(--s3); }
.doc b { color: var(--text); font-weight: 600; }
.doc ul { margin: var(--s3) 0 0; padding-left: var(--s5); display: grid; gap: var(--s2); }
.doc > p.intro { color: var(--text-2); margin-bottom: var(--s5); font-size: 16px; }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .spinner, .spin, .play-btn.loading::after { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
  .btn:active, .round-btn:active, .play-btn:active, .tile:active, .lib-main:active, .menu-item:active, .cta-row:active,
  .hero-card.latest:active, .tab:active .tab-ic, .list-row:active, .bar:active, .seg button:active, .stepper button:active { transform: none; }
}
