/* DAW X-Ray
   Identity (keep it when editing):
   - World: the producer's desk. Grey console faceplates, a rack unit with a backlit segment display (the
     transport readout every DAW and every MPC has), masking tape on the scribble strip with the track names,
     and the red record button.
   - Palette: faceplate #e9ebe6 / #dfe2d9, ink #1c232b / #4a545f, chassis #2a3037 / #343b43, LCD #bccb86 with
     ink #1f2a12, record red #c8302b, tape #e6dcb2. One accent (record red) for the main action only.
   - Type: Saira (expanded width, gear-panel lettering) for headings; Schibsted Grotesk for everything else;
     DSEG14 only inside the LCD.
   - Signature: the 14-segment LCD with its unlit "ghost" segments, and tape-strip track names in the arrangement.
   - Voice: a studio colleague. Plain, specific, never hype. "Drop it. It stays on this computer." not
     "Upload your files securely". Errors say what the file is and what to drop instead.
   - Paragraphs use the container width (no max-width in ch). */

@font-face { font-family: 'Saira'; src: url('/fonts/saira-latin-wdth-normal.woff2') format('woff2'); font-weight: 100 900; font-stretch: 50% 125%; font-display: swap; }
@font-face { font-family: 'Schibsted Grotesk'; src: url('/fonts/schibsted-grotesk-latin-wght-normal.woff2') format('woff2'); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Schibsted Grotesk'; src: url('/fonts/schibsted-grotesk-latin-wght-italic.woff2') format('woff2'); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'DSEG14'; src: url('/fonts/dseg14-classic-700-normal.woff2') format('woff2'); font-weight: 700; font-display: block; }

:root {
  --paper: #e9ebe6;
  --paper-2: #dfe2d9;
  --ink: #1c232b;
  --ink-2: #4a545f;
  --rule: #c2c8c0;
  --chassis: #2a3037;
  --chassis-2: #343b43;
  --chassis-3: #20262d;
  --silk: #aeb8c1;
  --lcd: #bccb86;
  --lcd-ink: #1f2a12;
  --rec: #c8302b;
  --rec-dark: #9e221e;
  --tape: #e6dcb2;
  --ok: #2c6a3a;
  --display: 'Saira', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { min-height: 100vh; display: flex; flex-direction: column; margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.55 var(--body); }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.rack :focus-visible, .site-foot :focus-visible, .unlock :focus-visible, #drop-veil :focus-visible { outline-color: var(--tape); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px; }

h1, h2, h3 { font-family: var(--display); font-stretch: 125%; line-height: 1.08; margin: 0; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.1rem, 1.2rem + 3.4vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 1.05rem + 1.2vw, 1.95rem); font-weight: 650; }
h3 { font-size: 1.15rem; font-weight: 650; font-stretch: 112%; }
h1.long { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.3rem); }
p { margin: 0 0 1em; }
.sub { color: var(--ink-2); margin: 6px 0 0; }
.small { font-size: 0.88rem; color: var(--ink-2); }

/* ------------------------------------------------------------------ header */
.site-top { border-bottom: 1px solid var(--rule); }
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-stretch: 125%; font-weight: 700; font-size: 1.15rem; }
.brand .mark { width: 30px; height: 30px; }
.site-nav { display: flex; gap: 22px; }
.site-nav a { text-decoration: none; font-weight: 550; font-size: 0.98rem; color: var(--ink-2); }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }

/* ------------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; gap: 9px; font: 600 0.98rem/1.2 var(--body); color: var(--ink); background: transparent; border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 10px 16px; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn:hover { background: rgba(28, 35, 43, 0.06); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.rec { background: var(--rec); border-color: var(--rec-dark); color: #fff; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18); }
.btn.rec:hover { background: #b52a26; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35); }
.btn.ghost { border-color: #7d8791; }
.btn.locked { border-style: dashed; color: var(--ink-2); }
.free-tag, .paid-tag { font-size: 0.8rem; font-weight: 650; padding: 3px 8px; border-radius: 3px; white-space: nowrap; }
.free-tag { background: var(--lcd); color: var(--lcd-ink); }
.paid-tag { background: var(--tape); color: var(--ink); }
.link-btn { font: inherit; font-weight: 600; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule); text-align: left; }
.link-btn:hover { text-decoration-color: currentColor; }

/* ------------------------------------------------------------------ bench */
.bench { padding: 44px 0 52px; position: relative; }
.bench-intro { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px 56px; align-items: end; margin-bottom: 28px; }
.lede { font-size: 1.14rem; color: var(--ink-2); margin: 16px 0 0; }
.loader { padding-bottom: 4px; }
.open-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.hint { font-size: 0.9rem; color: var(--ink-2); margin: 0; }
.error, .notice { margin-top: 14px; padding: 12px 14px; border-radius: 4px; font-size: 0.95rem; }
.error { background: #f5e2df; border-left: 4px solid var(--rec); }
.notice { background: #e1ebd6; border-left: 4px solid var(--ok); }
.error strong, .notice strong { display: block; margin-bottom: 2px; }

.rack { background: var(--chassis); color: #e9ecef; border-radius: 10px; padding: 18px; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 40px -24px rgba(20, 26, 32, 0.55); }
.rack-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 28px; align-items: center; margin-bottom: 16px; }
.file-kicker { margin: 0; font-size: 0.85rem; color: var(--silk); }
.file-name { font-family: var(--body); font-stretch: 100%; font-size: 1.35rem; font-weight: 700; margin: 2px 0 2px; overflow-wrap: anywhere; color: #fff; }
.file-meta { margin: 0; font-size: 0.92rem; color: #c8d0d7; }
.mini-select { display: inline-flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 0.82rem; color: var(--silk); }
.mini-select select { font: inherit; font-size: 0.92rem; color: var(--ink); background: var(--tape); border: 0; border-radius: 4px; padding: 6px 8px; max-width: 100%; }

/* The transport display: lit segments over their own unlit ghosts. */
.lcd { display: flex; gap: 2px; background: var(--chassis-3); border-radius: 8px; padding: 6px; }
.lcd-cell { display: flex; flex-direction: column; align-items: flex-end; min-width: 88px; overflow: hidden; padding: 6px 12px 7px; background: var(--lcd); color: var(--lcd-ink); box-shadow: inset 0 2px 6px rgba(31, 42, 18, 0.35); }
.lcd-cell:first-child { border-radius: 4px 0 0 4px; }
.lcd-cell:last-child { border-radius: 0 4px 4px 0; }
.lcd-legend { align-self: flex-start; font-size: 0.72rem; font-weight: 650; line-height: 1; margin-bottom: 7px; color: rgba(31, 42, 18, 0.78); }
.seg { position: relative; font-family: 'DSEG14', monospace; font-weight: 700; font-size: 1.32rem; line-height: 1; letter-spacing: 0.04em; white-space: pre; }
.seg::before { content: attr(data-ghost); position: absolute; right: 0; top: 0; opacity: 0.1; }
.lcd-note { font-size: 0.72rem; line-height: 1; margin-top: 6px; color: rgba(31, 42, 18, 0.78); white-space: nowrap; }

.arr { border-radius: 6px; overflow: hidden; background: var(--chassis-3); }
.arr-scroll { position: relative; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-color: #4a535d var(--chassis-3); }
.arr-scroll canvas { position: sticky; top: 0; touch-action: pan-y; cursor: grab; }
.arr-scroll canvas:active { cursor: grabbing; }
.arr-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 10px 10px 14px; background: var(--chassis-2); }
.arr-help { margin-right: auto; font-size: 0.85rem; color: var(--silk); }
.knob { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #48515b; color: #f1f3f5; font: 700 1.1rem/1 var(--body); display: inline-grid; place-items: center; cursor: pointer; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3); }
.knob svg { width: 18px; height: 18px; }
.knob.wide { width: auto; border-radius: 19px; padding: 0 14px; font-size: 0.9rem; }
.knob:hover { background: #57616c; }
.arr-inventory { background: var(--chassis-3); border-radius: 6px; padding: 22px; color: #dfe4e8; }
.arr-inventory p { margin: 0; }
.warnings { margin: 12px 0 0; padding: 0; list-style: none; font-size: 0.9rem; color: var(--tape); }
.warnings li { display: flex; gap: 9px; align-items: baseline; }
.warnings li::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--tape); transform: translateY(-1px); }

#drop-veil { position: fixed; inset: 0; background: rgba(32, 38, 45, 0.88); z-index: 20; display: grid; place-items: center; pointer-events: none; }
#drop-veil div { border: 3px dashed var(--lcd); color: #fff; font: 700 1.4rem/1.3 var(--display); font-stretch: 125%; padding: 40px 48px; border-radius: 12px; text-align: center; }

/* ------------------------------------------------------------------ bands */
.band { padding: 60px 0; border-top: 1px solid var(--rule); }
.band.needs, .band.limits { background: var(--paper-2); }
.section-head { margin-bottom: 24px; }
.split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.panel-head { margin-bottom: 14px; }
.roll-box { background: #1d232a; border-radius: 6px; overflow: hidden; }
.actions { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; flex-wrap: wrap; }
.status { min-height: 1.4em; font-size: 0.92rem; color: var(--ink-2); margin: 8px 0 0; }
.patterns { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; max-height: 420px; overflow: auto; }
.pattern-btn { width: 100%; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 10px; text-align: left; font: inherit; color: inherit; background: transparent; border: 1px solid var(--rule); border-radius: 4px; padding: 9px 12px; cursor: pointer; }
.pattern-btn:hover { border-color: var(--ink-2); }
.pattern-btn[aria-pressed='true'] { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--rec); background: #fff; }
.pattern-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pattern-meta { font-size: 0.82rem; color: var(--ink-2); white-space: nowrap; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; background: #8a96a3; flex: none; margin-right: 8px; vertical-align: -1px; }
.pattern-btn .swatch { margin: 0; }
.tracks-block { margin-top: 48px; }

.table-scroll { overflow-x: auto; margin-top: 14px; -webkit-overflow-scrolling: touch; }
table.grid { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.grid th { text-align: left; font-weight: 650; font-size: 0.85rem; color: var(--ink-2); border-bottom: 1.5px solid var(--ink); padding: 8px 14px 8px 0; white-space: nowrap; }
table.grid td { border-bottom: 1px solid var(--rule); padding: 9px 14px 9px 0; vertical-align: top; }
table.grid .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid td.empty { color: var(--ink-2); font-style: italic; }
.sub-line { display: block; font-size: 0.82rem; color: var(--ink-2); margin-top: 2px; }
.path { overflow-wrap: anywhere; }
.muted-row td { color: var(--ink-2); }
.missing-row td:first-child strong { text-decoration: underline wavy var(--rec); text-underline-offset: 4px; }
.status-present, .status-missing, .status-embedded, .status-factory { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 2px 8px; border-radius: 3px; }
.status-present { background: var(--lcd); color: var(--lcd-ink); }
.status-missing { background: var(--rec); color: #fff; }
.status-embedded, .status-factory { background: var(--tape); color: var(--ink); }

.needs h3 { margin-top: 36px; }
.needs-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.paid-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; }
details.native { margin-top: 28px; border-top: 1px solid var(--rule); padding-top: 14px; }
details.native summary { cursor: pointer; font-family: var(--display); font-stretch: 112%; font-weight: 650; font-size: 1.15rem; }

.export-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 0; border: 1.5px solid var(--ink); border-radius: 8px; overflow: hidden; }
.export-col { padding: 24px 26px; }
.export-col.paid { background: var(--paper-2); border-left: 1.5px solid var(--ink); }
.export-col h3 { margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--ink-2); margin-bottom: 14px; }
.field select { font: inherit; color: var(--ink); font-size: 1rem; padding: 9px 10px; border: 1.5px solid var(--ink); border-radius: 4px; background: #fff; max-width: 100%; }
.paid-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.paid-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }

.unlock { background: var(--chassis); color: #e9ecef; padding: 60px 0; }
.unlock-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.unlock h2 { color: #fff; margin-bottom: 16px; }
.unlock .small, .unlock .status { color: #c3ccd3; }
.ticks { padding: 0; margin: 0 0 18px; list-style: none; display: grid; gap: 10px; }
.ticks li { padding-left: 28px; position: relative; }
.ticks li::before { content: ''; position: absolute; left: 0; top: 0.45em; width: 14px; height: 8px; border-left: 2.5px solid var(--lcd); border-bottom: 2.5px solid var(--lcd); transform: rotate(-45deg); }
.unlock-box { background: var(--chassis-2); border-radius: 8px; padding: 24px; }
.price { font: 700 2.6rem/1 'DSEG14', var(--display); color: var(--lcd); margin: 0 0 14px; }
.soon { font-weight: 700; font-size: 1.1rem; color: var(--tape); margin: 0 0 6px; }
.unlock .btn.ghost { color: #fff; border-color: #8b96a0; }
.batch-results { list-style: none; padding: 0; margin: 10px 0 0; font-size: 0.9rem; display: grid; gap: 4px; }
.batch-results .bad { color: #f0b6b0; }

.limits-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; }
.limits-grid h3 { margin-bottom: 10px; }
.formats-table td:first-child { white-space: nowrap; }

.guide-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 32px; }
.guide-cards a { display: block; text-decoration: none; padding: 16px 0 18px; border-top: 1.5px solid var(--ink); height: 100%; }
.guide-cards strong { display: block; font-family: var(--display); font-stretch: 112%; font-weight: 650; font-size: 1.08rem; margin-bottom: 6px; }
.guide-cards span { color: var(--ink-2); font-size: 0.95rem; }
.guide-cards a:hover strong { text-decoration: underline; text-underline-offset: 4px; }

/* ------------------------------------------------------------------ articles and plain pages */
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; align-items: start; }
.prose { font-size: 1.06rem; line-height: 1.7; }
.prose h2 { margin: 1.8em 0 0.55em; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.4em; }
.aside h2 { font-size: 1.2rem; margin-bottom: 12px; }
.aside .guide-cards { grid-template-columns: 1fr; }
.page-head { padding: 52px 0 36px; }
.page-head p { font-size: 1.12rem; color: var(--ink-2); margin-top: 14px; }
.legal h2 { font-size: 1.3rem; }

/* ------------------------------------------------------------------ footer */
.site-foot { background: var(--chassis); color: #c9d1d8; padding: 48px 0 40px; font-size: 0.92rem; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.site-foot .brand { color: #fff; margin-bottom: 12px; }
.site-foot h2 { font-size: 1rem; color: #fff; margin-bottom: 10px; }
.site-foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.site-foot a { color: var(--tape); }
.disclaimer, .foot-note { color: #a9b3bc; font-size: 0.85rem; }

/* The collab sheet lives in the page only for printing. */
.print-sheet { display: none; }

/* ------------------------------------------------------------------ narrow screens */
@media (max-width: 980px) {
  .bench-intro, .split, .unlock-grid, .article-grid { grid-template-columns: minmax(0, 1fr); }
  .rack-head { grid-template-columns: minmax(0, 1fr); }
  .lcd { flex-wrap: wrap; }
  .lcd-cell { flex: 1 1 30%; min-width: 0; border-radius: 0 !important; }
  .limits-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .foot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-about { grid-column: 1 / -1; }
  .paid-group { margin-left: 0; }
}
@media (max-width: 720px) {
  .export-grid { grid-template-columns: minmax(0, 1fr); }
  .export-col.paid { border-left: 0; border-top: 1.5px solid var(--ink); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .site-nav { gap: 14px; }
  .site-nav a { font-size: 0.9rem; }
  .brand span { font-size: 1rem; }
  .bench { padding-top: 28px; }
  .rack { padding: 10px; border-radius: 8px; margin: 0 -6px; }
  .lcd-cell { padding: 6px 8px 7px; }
  .seg { font-size: 1.05rem; }
  .arr-help { display: none; }
  .band, .unlock { padding: 44px 0; }
  .export-col { padding: 20px 18px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .open-row .btn { flex: 1 1 100%; justify-content: center; }
}
@media (max-width: 400px) {
  .site-nav a[href='/#export'] { display: none; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

@media print {
  body.printing-sheet { background: #fff; }
  body.printing-sheet .site-top, body.printing-sheet .site-foot, body.printing-sheet .skip { display: none !important; }
  body.printing-sheet main > *:not(.print-sheet) { display: none !important; }
  body.printing-sheet .print-sheet { display: block; }
}
#tracks-body td:first-child { white-space: nowrap; }
main { flex: 1 0 auto; }

/* The collab sheet (src/engine/needs.mjs), printed from the page */

.dx-sheet{font:11pt/1.4 system-ui,-apple-system,"Segoe UI",sans-serif;color:#141a20;background:#fff;padding:0}
.dx-sheet h1{font-size:18pt;margin:0 0 2pt}
.dx-sheet h2{font-size:12pt;margin:14pt 0 4pt;border-bottom:1.5pt solid #141a20;padding-bottom:2pt}
.dx-sheet .dx-meta{display:flex;flex-wrap:wrap;gap:4pt 18pt;margin:6pt 0 0;padding:0;list-style:none}
.dx-sheet .dx-meta b{font-weight:600}
.dx-sheet table{width:100%;border-collapse:collapse;font-size:9.5pt}
.dx-sheet th{text-align:left;font-weight:600;border-bottom:1pt solid #141a20;padding:3pt 6pt 3pt 0}
.dx-sheet td{border-bottom:.5pt solid #b9c0c6;padding:3pt 6pt 3pt 0;vertical-align:top}
.dx-sheet td.num{text-align:right}
.dx-sheet .dx-path{color:#4b5560;font-size:8.5pt;word-break:break-all}
.dx-sheet .dx-tick{display:inline-block;width:9pt;height:9pt;border:1pt solid #141a20;vertical-align:-1pt}
.dx-sheet .dx-missing{font-weight:700}
.dx-sheet .dx-foot{margin-top:14pt;font-size:8.5pt;color:#4b5560}
.dx-sheet .dx-notes{border:1pt solid #141a20;height:60pt;margin-top:4pt}
