/* Groovebox (fans.dj.support). Fonts are self-hosted (SIL OFL, see fonts/): the page may only load its own files. */
@font-face { font-family: "Big Shoulders Display"; font-weight: 700; font-display: swap; src: url("/fonts/big-shoulders-display-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Big Shoulders Display"; font-weight: 800; font-display: swap; src: url("/fonts/big-shoulders-display-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 400; font-display: swap; src: url("/fonts/archivo-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 600; font-display: swap; src: url("/fonts/archivo-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 700; font-display: swap; src: url("/fonts/archivo-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Mono"; font-weight: 400; font-display: swap; src: url("/fonts/dm-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Mono"; font-weight: 500; font-display: swap; src: url("/fonts/dm-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --bg: #e8e9eb; --surface: #f6f6f7; --surface-2: #dfe1e4; --ink: #15161a; --ink-2: #454a52; --ink-3: #686e78;
  --line: #cdd0d5; --line-2: #b7bbc2; --accent: #d9481a; --accent-ink: #ffffff;
  --deck: #1c1d20; --deck-2: #292b30; --deck-3: #34373d; --deck-ink: #f1eee7; --deck-dim: #a0a3aa; --led: #ff8a3d;
  --drums: #cf3b28; --bass: #3b55d4; --melody: #9c6f00; --hook: #0e8374;
  --step-1: #d8412f; --step-2: #ee8024; --step-3: #e3b62a; --step-4: #efebe1;
  --ok: #1d7f48; --ok-bg: #dcefe3; --bad: #b8321f; --bad-bg: #f7deda;
  --grid: rgba(21, 22, 26, 0.07); --grid-2: rgba(21, 22, 26, 0.18);
  --shadow: 0 1px 2px rgba(20, 22, 26, 0.06), 0 10px 28px -16px rgba(20, 22, 26, 0.25);
  --f-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", sans-serif;
  --f-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 8px;
  --gutter: max(16px, env(safe-area-inset-left));
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #101113; --surface: #18191c; --surface-2: #0c0d0f; --ink: #eeece6; --ink-2: #b7bac1; --ink-3: #8a8f98;
    --line: #2a2d32; --line-2: #3b3f46; --accent: #f2642a;
    --deck: #1e2024; --deck-2: #2a2d32; --deck-3: #363a40;
    --drums: #f0624c; --bass: #8397ff; --melody: #edbe3a; --hook: #37c4b2; --step-4: #e6e1d6;
    --ok: #53c286; --ok-bg: #15271d; --bad: #f07a66; --bad-bg: #2e1714;
    --grid: rgba(238, 236, 230, 0.06); --grid-2: rgba(238, 236, 230, 0.16);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px -16px rgba(0, 0, 0, 0.8);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.cam-open { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(10px, env(safe-area-inset-top)) var(--gutter) 10px; max-width: 1232px; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 24px/1 var(--f-display); letter-spacing: 0.04em; text-transform: uppercase; }
.brand svg { width: 30px; height: 30px; }
.brand .k1 { fill: var(--step-1); } .brand .k2 { fill: var(--step-2); } .brand .k3 { fill: var(--step-3); } .brand .k4 { fill: var(--ink-2); }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { text-decoration: none; font: 700 16px/1 var(--f-display); letter-spacing: 0.08em; text-transform: uppercase; padding: 9px 12px; border-radius: 999px; color: var(--ink-2); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.nav .nav-out { color: var(--ink-3); }
@media (max-width: 420px) { .nav .nav-out { display: none; } .brand span { font-size: 21px; } }

main { max-width: 1232px; margin: 0 auto; padding-inline: var(--gutter); padding-bottom: 96px; }
.view { display: grid; gap: 22px; padding-top: 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 15px; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--ink-3); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.btn-ghost { background: transparent; border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.55; cursor: progress; }

.kicker { margin: 0; font: 500 12px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
h1 { margin: 0; font: 800 clamp(40px, 7vw, 76px)/0.9 var(--f-display); text-transform: uppercase; text-wrap: balance; }
.lede { margin: 0; color: var(--ink-2); max-width: 60ch; font-size: 16px; }
.fine { margin: 0; font-size: 13px; color: var(--ink-3); max-width: 70ch; }
.err { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--bad-bg); color: var(--bad); font-size: 14px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; justify-content: space-between; }
.sec-head h2 { margin: 0; font: 800 26px/1 var(--f-display); text-transform: uppercase; letter-spacing: 0.02em; }
.sec-head p { margin: 0; color: var(--ink-3); font-size: 13px; }
.sec-head a { font-weight: 600; font-size: 14px; }

/* ---------- home ---------- */
.home-hero { display: grid; gap: 16px; padding-block: clamp(12px, 5vw, 48px) 8px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.home-top { display: grid; gap: 14px; }

/* ---------- track cards (home + Discover) ---------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tcard { position: relative; display: grid; gap: 8px; }
.tcard-art { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); max-width: 100%; }
.tcard-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tcard-play { position: absolute; right: 8px; bottom: 8px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.tcard-play svg { width: 18px; height: 18px; fill: currentColor; }
.tcard-rank { position: absolute; left: 8px; top: 8px; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: #f1eee7; color: #111214; font: 500 13px/28px var(--f-mono); text-align: center; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
.tcard a { text-decoration: none; }
.tcard-title { font: 800 19px/1.05 var(--f-display); text-transform: uppercase; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.tcard-meta { font: 400 12px/1.4 var(--f-mono); color: var(--ink-3); }
.tcard-meta b { color: var(--ink); font-weight: 500; }
.gchip { display: inline-block; padding: 2px 7px; border-radius: 4px; font: 500 10px/1.5 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; background: var(--surface-2); color: var(--ink-2); margin-right: 6px; vertical-align: 1px; }
.gchip--house { background: #f3d5c6; color: #7a2a0e; } .gchip--techno { background: #d9dbe2; color: #23262d; } .gchip--dnb { background: #cfe6ef; color: #0d4a5e; }
@media (prefers-color-scheme: dark) { .gchip--house { background: #3a2016; color: #ffb48f; } .gchip--techno { background: #2a2d33; color: #d9dbe2; } .gchip--dnb { background: #11303a; color: #8fd6ee; } }
.cards--chart { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.empty { color: var(--ink-3); font-size: 14px; }

/* ---------- Discover ---------- */
.disc-head { display: grid; gap: 12px; padding-top: 8px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); justify-self: start; }
.tabs button { border: 0; background: transparent; padding: 0 16px; min-height: 36px; border-radius: 999px; font: 700 15px/1 var(--f-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }

/* ---------- deck (transport) ---------- */
.deck { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 12px; border-radius: 12px; background: var(--deck); color: var(--deck-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 12px 30px -18px rgba(0, 0, 0, 0.7); }
.play { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 20px/1 var(--f-display); letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08) inset; }
.play:hover { filter: brightness(1.06); }
.play svg { width: 18px; height: 18px; fill: currentColor; }
.play .i-stop, .play[aria-pressed="true"] .i-play { display: none; }
.play[aria-pressed="true"] .i-stop { display: block; }
.play:disabled { opacity: 0.6; cursor: progress; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--deck-2); gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--deck-dim); min-height: 34px; padding: 0 13px; border-radius: 999px; cursor: pointer; font: 700 15px/1 var(--f-display); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--deck-ink); color: var(--deck); }
.seg button .rec { font: 500 9px/1 var(--f-mono); letter-spacing: 0.06em; margin-left: 6px; opacity: 0.7; vertical-align: 2px; }
.lcd { display: flex; flex-wrap: wrap; gap: 2px; background: #0b0b0c; border-radius: 8px; padding: 3px; }
.lcd-cell { display: grid; gap: 3px; padding: 5px 10px 6px; min-width: 64px; }
.lcd-k { font: 500 9px/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; color: #8b8e94; }
.lcd-v { font: 500 15px/1 var(--f-mono); color: var(--led); font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 0 10px rgba(255, 138, 61, 0.35); }
.deck-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-left: auto; }
.tool { min-height: 34px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--deck-3); background: var(--deck-2); color: var(--deck-ink); cursor: pointer; font-size: 13px; font-weight: 600; }
.tool:hover { border-color: var(--deck-dim); }
.tool[aria-pressed="true"] { border-color: var(--led); color: var(--led); }
.vol { display: inline-flex; align-items: center; gap: 8px; font: 500 10px/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--deck-dim); }
.vol input { width: 92px; accent-color: var(--led); }
.meter { width: 64px; height: 6px; border-radius: 3px; background: var(--deck-3); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3ec27a 0 60%, #e3b62a 60% 85%, #e0452c 85%); transition: width 60ms linear; }
@media (max-width: 560px) {
  .deck { gap: 8px; padding: 8px; }
  .play { min-height: 42px; width: 42px; padding: 0; justify-content: center; }
  .play span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .seg button { padding: 0 9px; font-size: 13px; }
  .seg button .rec, .vol, .meter { display: none; }
  .deck-tools { gap: 6px; }
  .tool { padding: 0 9px; }
  .lcd { order: 5; flex: 1 1 100%; }
  .lcd-cell { flex: 1 1 0; min-width: 0; padding: 5px 6px 6px; }
  .lcd-v { font-size: 13px; }
}

/* ---------- studio ---------- */
.track-head { display: grid; gap: 6px; }
.track-head h1 { font-size: clamp(34px, 6vw, 58px); overflow-wrap: anywhere; }
.track-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 400 13px/1.4 var(--f-mono); color: var(--ink-3); }
.track-meta b { color: var(--ink); font-weight: 500; }
.hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 880px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.photo { margin: 0; display: grid; gap: 10px; }
.photo-stage { position: relative; border-radius: var(--r); overflow: hidden; background: #000; box-shadow: var(--shadow); }
.photo-stage canvas { display: block; width: 100%; height: auto; }
.photo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.seg-light { background: var(--surface-2); }
.seg-light button { color: var(--ink-2); min-height: 30px; font-size: 14px; padding: 0 12px; }
.seg-light button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.photo figcaption { font: 400 12px/1.4 var(--f-mono); color: var(--ink-3); }
.dna { display: grid; gap: 16px; align-content: start; }
.h-sec { margin: 0; font: 800 26px/1 var(--f-display); text-transform: uppercase; letter-spacing: 0.02em; }
.dna-top { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.dna-side { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.dna-var { font: 500 11px/1 var(--f-mono); color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; }
.btn-midi { gap: 6px; }
.btn-midi svg { width: 16px; height: 16px; }
.readouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
@media (max-width: 520px) { .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ro { padding: 10px 12px 12px 0; display: grid; gap: 4px; align-content: start; border-bottom: 1px solid var(--line); min-width: 0; }
.ro + .ro { padding-left: 12px; border-left: 1px solid var(--line); }
@media (max-width: 520px) { .ro:nth-child(3) { padding-left: 0; border-left: 0; } }
.ro-k { font: 500 10px/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.ro-v { font: 800 38px/0.95 var(--f-display); text-transform: uppercase; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ro-v small { font: 700 15px/1 var(--f-display); letter-spacing: 0.06em; margin-left: 3px; color: var(--ink-2); }
.ro-why { font-size: 12px; line-height: 1.35; color: var(--ink-3); }
.pads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 480px) { .pads { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pad { position: relative; border-radius: 6px; padding: 10px 10px 9px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 4px; transition: background 90ms, border-color 90ms; min-width: 0; }
.pad-sym { font: 700 22px/1 var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pad-rn { font: 500 12px/1 var(--f-mono); color: var(--ink-3); }
.pad-notes { font: 400 11px/1.3 var(--f-mono); color: var(--ink-3); }
.pad.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pad.on .pad-rn { color: var(--accent); }
.scene-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.scene-arch { font: 700 18px/1.1 var(--f-display); letter-spacing: 0.04em; text-transform: uppercase; margin: 0 6px 0 0; }
.tag { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 600; }
.dna-flow { margin: 0; font-size: 13px; color: var(--ink-2); }
.studio-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.studio-actions .spacer { flex: 1; }
.linklike { background: none; border: 0; padding: 6px 2px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13px; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: clamp(14px, 2.4vw, 22px); display: grid; gap: 16px; box-shadow: var(--shadow); min-width: 0; }
.arr { display: block; width: 100%; height: 96px; cursor: pointer; border-radius: 6px; touch-action: manipulation; }
.lanes { display: grid; gap: 6px; }
.lane { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 10px; align-items: stretch; }
@media (max-width: 640px) { .lane { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
.lane-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; align-content: center; min-width: 0; }
.lane-name { font: 700 17px/1 var(--f-display); letter-spacing: 0.06em; text-transform: uppercase; }
.lane-sub { flex-basis: 100%; font: 400 11px/1.3 var(--f-mono); color: var(--ink-3); }
@media (max-width: 640px) { .lane-sub { flex-basis: auto; } }
.chip { width: 10px; height: 10px; border-radius: 2px; flex: none; display: inline-block; }
.chip--drums { background: var(--drums); } .chip--bass { background: var(--bass); } .chip--melody { background: var(--melody); } .chip--hook { background: var(--hook); } .chip--global { background: var(--ink); }
.ms { display: inline-flex; gap: 4px; margin-left: auto; }
.ms button { width: 30px; height: 28px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font: 500 11px/1 var(--f-mono); color: var(--ink-2); }
.ms .m[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ms .s[aria-pressed="true"] { background: var(--step-3); color: #15161a; border-color: var(--step-3); }
.lane canvas { display: block; width: 100%; border-radius: 5px; }
.lane.muted canvas { opacity: 0.35; }
.seq-note { margin: 0; font-size: 12px; color: var(--ink-3); }

.how summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; font: 800 22px/1.1 var(--f-display); text-transform: uppercase; letter-spacing: 0.02em; list-style: none; }
.how summary::-webkit-details-marker { display: none; }
.how summary::before { content: "+"; font-family: var(--f-mono); color: var(--accent); width: 1ch; }
.how[open] summary::before { content: "−"; }
.how-sub { font: 400 13px/1.3 var(--f-body); color: var(--ink-3); text-transform: none; letter-spacing: 0; }
.how-body { display: grid; gap: 14px; margin-top: 12px; }
.h3 { margin: 10px 0 0; font: 800 20px/1 var(--f-display); text-transform: uppercase; letter-spacing: 0.03em; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.note { margin: 0; font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.an-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.card { grid-column: span 3; border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 10px; align-content: start; min-width: 0; background: var(--bg); }
.card.w2 { grid-column: span 2; } .card.w4 { grid-column: span 4; } .card.w6 { grid-column: span 6; }
@media (max-width: 900px) { .card, .card.w2, .card.w4 { grid-column: span 6; } }
.card h4 { margin: 0; font: 700 16px/1 var(--f-display); letter-spacing: 0.08em; text-transform: uppercase; }
.pal-bar { display: flex; height: 34px; border-radius: 5px; overflow: hidden; border: 1px solid var(--line); }
.pal-bar i { display: block; height: 100%; }
.pal-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
@media (max-width: 520px) { .pal-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sw { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sw b { width: 22px; height: 22px; border-radius: 4px; flex: none; border: 1px solid var(--line); }
.sw span { font: 400 12px/1.3 var(--f-mono); color: var(--ink-2); }
.sw em { font-style: normal; color: var(--ink-3); }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart text { fill: var(--ink-3); font: 500 10px var(--f-mono); }
svg.chart .lbl { fill: var(--ink-2); }
svg.chart .strong { fill: var(--ink); }
svg.chart .axis { stroke: var(--line-2); }
svg.chart .zone { fill: var(--grid-2); }
svg.chart .area { fill: var(--ink-2); fill-opacity: 0.55; stroke: var(--ink); stroke-width: 1; }
svg.chart .mean { stroke: var(--accent); stroke-width: 2; }
svg.chart .dot { fill: var(--ink-2); }
svg.chart .tonic { stroke: var(--ink); stroke-width: 2; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.stat { border-top: 1px solid var(--line-2); padding-top: 8px; display: grid; gap: 5px; }
.stat-k { font: 500 10px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.stat-v { font: 700 22px/1 var(--f-display); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.stat-bar { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.stat-bar i { display: block; height: 100%; background: var(--ink-2); }
.stat-to { font-size: 12px; color: var(--ink-3); line-height: 1.35; }
.scene-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.scene-list li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; font-size: 13px; }
.scene-list li span { font: 400 12px/1.4 var(--f-mono); color: var(--ink-3); text-align: right; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; min-width: 720px; font-size: 13px; }
th, td { text-align: left; padding: 9px 12px; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { font: 500 10px/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); background: var(--bg); }
tbody tr:last-child td { border-bottom: 0; }
td.grp { white-space: nowrap; font: 700 15px/1.1 var(--f-display); letter-spacing: 0.06em; text-transform: uppercase; }
td.grp .chip { margin-right: 8px; vertical-align: 1px; }
td.par { font-weight: 600; white-space: nowrap; }
td.val { font-family: var(--f-mono); font-size: 12.5px; }
td.src { color: var(--ink-2); }
tr.first td { border-top: 2px solid var(--line-2); }
@media (max-width: 640px) {
  .table-wrap { border: 0; overflow: visible; }
  table { min-width: 0; }
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { padding: 8px 0 10px; border-bottom: 1px solid var(--line); }
  td, tr.first td { border: 0; padding: 2px 0; }
  td.grp:empty { display: none; }
  td.grp { padding: 14px 0 6px; border-bottom: 2px solid var(--line-2); margin-bottom: 4px; }
  td.par { white-space: normal; }
}
.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
@media (max-width: 760px) { .checks { grid-template-columns: minmax(0, 1fr); } }
.checks li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pill { grid-row: span 2; align-self: start; font: 500 10px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 7px; border-radius: 4px; background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.checks b { font-weight: 600; font-size: 14px; }
.checks .d { font: 400 12px/1.4 var(--f-mono); color: var(--ink-3); }
.checks em { font-style: normal; color: var(--ink-3); font-size: 11px; font-family: var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; margin-left: 6px; }
.tally { font: 700 18px/1 var(--f-display); letter-spacing: 0.04em; color: var(--ok); }
.tally.bad { color: var(--bad); }
.seed-body { display: grid; gap: 10px; }
.seed-body .btn { justify-self: start; }
pre { margin: 0; max-height: 360px; overflow: auto; padding: 12px; border-radius: 6px; background: var(--surface-2); font: 400 12px/1.5 var(--f-mono); color: var(--ink-2); }

/* ---------- camera ---------- */
.camera { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100dvh; }
.viewfinder { position: relative; overflow: hidden; background: #000; touch-action: none; }
.viewfinder video, .viewfinder canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewfinder.mirror video, .viewfinder.mirror canvas { transform: scaleX(-1); }
.cam-top { position: absolute; left: 0; right: 0; top: 0; padding: max(12px, env(safe-area-inset-top)) 16px 12px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; background: linear-gradient(rgba(0, 0, 0, 0.55), transparent); }
.cam-hint { font: 500 12px/1.3 var(--f-mono); letter-spacing: 0.04em; background: rgba(0, 0, 0, 0.45); padding: 6px 10px; border-radius: 999px; transition: opacity 400ms; }
.cam-hint.gone { opacity: 0; position: absolute; pointer-events: none; }
.cam-chips { display: flex; gap: 6px; flex: none; max-width: 55%; margin-left: auto; justify-content: flex-end; }
.cam-chip { font: 700 15px/1 var(--f-display); letter-spacing: 0.06em; text-transform: uppercase; background: rgba(0, 0, 0, 0.45); padding: 7px 10px; border-radius: 999px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-chip:empty { display: none; }
.cam-flash { position: absolute; inset: 0; background: #fff7ec; z-index: 5; }
.cam-bar { display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; align-items: center; justify-items: center; gap: 6px; padding: 14px 12px max(18px, env(safe-area-inset-bottom)); background: #000; }
.cam-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.cam-btn svg { width: 22px; height: 22px; }
.cam-btn[aria-pressed="true"] { background: #ffd23d; color: #111; }
.cam-btn[disabled] { opacity: 0.35; }
.cam-shutter { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 5px; cursor: pointer; flex: none; }
.cam-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform 80ms; }
.cam-shutter:active span { transform: scale(0.9); }
.cam-shutter:disabled { opacity: 0.35; cursor: default; }
.cam-msg { position: absolute; left: 16px; right: 16px; bottom: calc(120px + env(safe-area-inset-bottom)); margin: 0; text-align: center; font-size: 14px; }
.cam-msg:empty { display: none; }
.cam-msg span { display: inline-block; background: rgba(0, 0, 0, 0.7); padding: 8px 12px; border-radius: 8px; }

/* the action wheel (Bulbo's pull-down), styled as in Bulbo */
.aw-surface { user-select: none; -webkit-user-select: none; }
.aw-dim { position: fixed; inset: 0; background: #333; pointer-events: none; z-index: 60; opacity: 0; transition: opacity 120ms ease; }
.aw-panels { position: fixed; top: 0; left: 0; right: 0; z-index: 70; min-height: 7rem; pointer-events: none; display: flex; padding-top: env(safe-area-inset-top); background: #10171f; }
.aw-panel { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 1.1rem 0.9rem; transition: background 120ms ease, color 120ms ease; border-right: 1px solid rgba(255, 255, 255, 0.08); }
.aw-panel:last-child { border-right: 0; }
.aw-content { width: 100%; max-width: 22rem; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; text-align: center; }
.aw-badge { font: 600 12px/1.2 var(--f-mono); letter-spacing: 0.08em; padding: 3px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.aw-label { margin: 0; font: 600 17px/1.2 var(--f-body); border-bottom: 2px solid transparent; padding-bottom: 1px; transition: border-color 120ms ease; }
.aw-label--primed { border-bottom-color: currentColor; }
.aw-desc { margin: 0; font-size: 11.5px; line-height: 1.35; max-width: 19rem; opacity: 0.78; text-wrap: balance; }

/* ---------- mini player ---------- */
.mini { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 40; width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 8px; border-radius: 14px; background: var(--deck); color: var(--deck-ink); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.6); }
.mini-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.mini-open img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--deck-2); flex: none; }
.mini-text { min-width: 0; display: grid; }
.mini-text b { font: 800 17px/1.1 var(--f-display); text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-text span { font: 400 11px/1.3 var(--f-mono); color: var(--deck-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.mini-play svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------- sheets (dialogs) ---------- */
dialog { border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--ink); width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 32px); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6); }
dialog::backdrop { background: rgba(8, 9, 11, 0.6); }
.sheet { display: grid; gap: 14px; padding: 20px; margin: 0; }
.sheet h2 { margin: 0; font: 800 28px/1 var(--f-display); text-transform: uppercase; }
.sheet-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.save-preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.field em { font-weight: 400; color: var(--ink-3); font-style: normal; }
.field input { min-height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); font-size: 16px; }
.toggle { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: 13px; color: var(--ink-2); }
.toggle input { width: 22px; height: 22px; accent-color: var(--accent); margin-top: 2px; }
.toggle b { color: var(--ink); }
.linkbox { display: flex; gap: 8px; }
.linkbox input { flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); font: 400 13px var(--f-mono); }
.share-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.share-grid .btn { border-radius: 10px; padding: 0 10px; font-size: 14px; }
.share-grid .btn-primary { grid-column: span 2; }
.radios { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.radios label { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.radios input { width: 20px; height: 20px; accent-color: var(--accent); }
.progress { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); }
#video-preview { width: 100%; border-radius: 10px; background: #000; }

#toast { position: fixed; left: 0; right: 0; margin: 0 auto; width: max-content; max-width: min(460px, calc(100% - 32px)); bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateY(20px); z-index: 90; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 14px; font-size: 14px; line-height: 1.35; opacity: 0; pointer-events: none; transition: opacity 180ms, transform 180ms; text-align: center; }
#toast.on { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
