/* The new look (Andrew, 2026-10-03; docs/new-look-plan.md): every colour on every screen comes
   from these variables, set twice, once per mode. Loaded first; js/theme-boot.js picks the mode
   before the page is drawn. Only the tape shells (js/tape.js) and the glow yellow keep their own
   colours, the same in both modes. */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #191917; --panel: #242422; --text: #ecebe6; --muted: #a8a59c; --line: #2f2f2b;
  --line-2: #3d3d38; --line-3: #55554f; --faint: #8f8c84;
  --raised: var(--panel); --field: #1e1e1c;
  --key: #262624; --key-edge: #0f0f0e; --key-hover: #2d2d2a;
  --on-bg: #ecebe6; --on-text: #191917;            /* a filled key (the open tab, SIDE A, DARK) */
  --recess: #141413; --well: #1f1f1d;               /* sunk into the panel: the tape well, the drawer, the dial */
  --shadow: #00000080;
  --accent: #e8642c; --accent-text: #ee7440;        /* fills / small text in the accent */
  --accent-ink: var(--accent-text); --accent-hi: #f07a46; --accent-bg: #e8642c24;
  --rec: var(--accent); --rec-bg: #e8642c1f;
  --lit: #ffe36b;                                   /* the one glow: the frequency, the memory lights */
  --grille: #4d4d48;
  --tray: #222220; --tray-row: #2a2a27; --pull: #0f0f0e;   /* the tape drawer: its body, the rows in it, the finger-pull */
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #e7e5df; --panel: #f4f3ef; --text: #1d1d1b; --muted: #676661; --line: #d8d5cc;   /* muted: the drawn #6b6a64 a shade darker, so small text reads 4.5:1 on the page */
  --line-2: #c8c5bb; --line-3: #a9a69c; --faint: #6b6a64;
  --field: #faf9f6;
  --key: #f4f3ef; --key-edge: #bdb9ae; --key-hover: #fbfaf7;
  --on-bg: #1d1d1b; --on-text: #f4f3ef;
  --recess: #e1dfd8; --well: #ebe9e3;
  --shadow: #0000002e;
  --accent-text: #ac4518;                           /* small accent text, darker so it reads 4.5:1 on light panels */
  --accent-hi: #d9561f; --accent-bg: #e8642c1f;
  --grille: #1d1d1b;
  --tray: #dcd9d1; --tray-row: #f4f3ef; --pull: #e2dfd7;
}

body { background: var(--bg); color: var(--text); font-family: var(--sans); }

/* Square keys: a flat face, a thin line, a small darker bottom edge. Pressed, the edge goes. */
.key, .btn {
  height: 34px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 3px;
  background: var(--key); color: var(--text); box-shadow: 0 2px 0 var(--key-edge);
  font-family: var(--sans); font-weight: 700; font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.key:hover:not(:disabled), .btn:hover:not(:disabled) { background: var(--key-hover); border-color: var(--line-3); }
.key:active:not(:disabled), .btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.key.on, .key[aria-pressed="true"], .key[aria-selected="true"] { background: var(--on-bg); color: var(--on-text); border-color: var(--on-bg); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #1d1d1b; box-shadow: 0 2px 0 #9c3c12; font-size: 13px; height: 38px; } /* dark on the accent: 5:1 (white is 3.3:1) */
.btn-accent:hover:not(:disabled) { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn-accent-outline { color: var(--text); }
.rec-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.btn-close { border-radius: 3px; border: 1px solid var(--line-2); background: var(--key); color: var(--muted); box-shadow: 0 2px 0 var(--key-edge); }
.link-btn { color: var(--accent-text); }
.link-btn:hover { color: var(--accent); }

/* Focus rings: always visible from the keyboard, in the accent. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Section names: Archivo in spaced capitals. Times and counts: Plex Mono. */
.caps { font-family: var(--sans); font-weight: 700; font-size: 12px; letter-spacing: 3.5px; color: var(--text); text-transform: uppercase; }
.num { font-family: var(--mono); }

/* ---------------------------------------------------------------- the header */
.topbar { height: 64px; gap: 18px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--bg); }
.wordmark { font-family: var(--sans); font-weight: 700; font-size: 19px; letter-spacing: 7px; color: var(--text); gap: 0; }
.wordmark .slash { color: var(--accent); margin: 0 1px; }
.tower-status { font-family: var(--mono); font-size: 12px; letter-spacing: 1.2px; color: var(--muted); text-transform: uppercase; white-space: nowrap; margin-left: 10px; }
/* A dub's progress, on every screen (2026-10-06): DUBBING 42% · ABOUT 4 MIN LEFT, then the tape's name */
.dub-pill { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: 1.2px; color: var(--accent-text); white-space: nowrap; text-transform: uppercase; }
.dub-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.dub-pill[hidden] { display: none; }
.storage { display: flex; align-items: center; font-family: var(--sans); font-size: 13px; color: var(--muted); gap: 10px; flex-direction: row-reverse; }
.storage-bar { overflow: hidden; }
.storage-fill { height: 100%; width: 0; }
.storage-bar { width: 120px; height: 4px; border-radius: 2px; background: var(--line-2); }
.storage-fill { background: var(--text); }
.storage-fill.full { background: var(--accent); }
.mode-switch { display: inline-flex; border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; }
.mode-switch button { height: 32px; padding: 0 12px; border: 0; background: transparent; color: var(--muted);
  font-family: var(--sans); font-weight: 700; font-size: 11px; letter-spacing: 2.2px; cursor: pointer; }
.mode-switch button[aria-pressed="true"] { background: var(--on-bg); color: var(--on-text); }
.topbar #open-add { height: 40px; text-transform: none; letter-spacing: .6px; font-size: 14px; padding: 0 18px; }
.pill { height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--line-2); background: transparent; color: var(--text);
  font-family: var(--sans); font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: none; text-transform: none; letter-spacing: 0; }
.pill:hover { border-color: var(--line-3); }
.me-menu { border-radius: 4px; border-color: var(--line-2); background: var(--panel); box-shadow: 0 10px 30px var(--shadow); }
.me-tower { align-self: stretch; }
.terms-note { background: var(--panel); border-bottom: 1px solid var(--line); color: var(--muted); padding: 8px 32px; }
.terms-note .link-btn { font-size: 13px; }
.phone-only { display: none !important; }
@media (max-width: 720px), (pointer: coarse) and (max-height: 500px) { .phone-only { display: inline-flex !important; } }
