/* Wavcue. The look borrows from an editor's cue sheet: white paper, ink, hairline
   rules, and one colour, the red of a playhead, used only for "this is playing /
   this is selected". */
:root {
  --bg: #ffffff;
  --ink: #0b0b0c;
  --muted: #6c6d71;
  --line: #e6e6e3;
  --soft: #f4f4f1;
  --cue: #e8371a;
  --cue-ink: #ffffff;
  --wave: #c4c4bf;
  --code-bg: #0b0b0c;
  --code-ink: #ecebe6;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* names the review page still uses */
  --surface: var(--bg);
  --accent: var(--cue);
  --accent-ink: var(--cue-ink);
  --accent-soft: var(--soft);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0c0c0d;
  --ink: #f1f1ee;
  --muted: #8d8e93;
  --line: #242427;
  --soft: #161618;
  --cue: #ff5633;
  --cue-ink: #0c0c0d;
  --wave: #3c3c41;
  --code-bg: #000000;
  --code-ink: #dfe0dc;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif; padding-bottom: 96px; }
[hidden] { display: none !important; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--cue); outline-offset: 2px; }

/* small uppercase label used for every section heading */
.eyebrow, .label { margin: 0; font: 600 11px/1 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.display { margin: 14px 0 0; font-size: clamp(32px, 4.6vw, 52px); font-weight: 800; line-height: 0.98; letter-spacing: -0.04em; max-width: 16ch; }

/* masthead */
.mast { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.mast-row { display: flex; align-items: center; gap: 36px; height: 60px; }
.word { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 800; letter-spacing: -0.03em; text-decoration: none; text-transform: lowercase; }
.playhead { width: 4px; height: 20px; background: var(--cue); }
.nav { display: flex; gap: 26px; height: 100%; }
.nav a { display: flex; align-items: center; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.theme { margin-left: auto; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: none; }
.theme:hover { border-color: var(--ink); }
.theme svg { width: 15px; height: 15px; }

/* ---------- listing ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 38px; padding: 34px 0 26px; font-size: 14px; }
.crumbs .home { margin: 0; font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.crumbs .tagline { color: var(--muted); font-size: 15px; margin-left: 6px; }
.crumbs .sep { color: var(--muted); font-size: 22px; font-weight: 300; }
.crumbs .token { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ink); border-radius: 3px; padding: 4px 9px; background: none; font-weight: 600; }
.crumbs .token:hover { background: var(--ink); color: var(--bg); }
.crumbs .reset { border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

.listing-grid { display: grid; grid-template-columns: 212px minmax(0, 1fr); gap: 44px; align-items: start; }
.side { position: sticky; top: 76px; max-height: calc(100vh - 150px); overflow-y: auto; scrollbar-width: thin; padding: 0 6px 20px 0; }
.side .label { padding: 0 0 10px; margin-top: 28px; }
.side .label:first-child { margin-top: 0; }
.side-list { display: grid; }
.side-item { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%; padding: 6px 0 6px 12px; border: 0; border-left: 2px solid var(--line); background: none; text-align: left; color: var(--muted); }
.side-item small, .chip small, .check small { font: 11px var(--mono); }
.side-item:hover { color: var(--ink); border-left-color: var(--ink); }
.side-item[aria-pressed="true"] { color: var(--ink); font-weight: 700; border-left-color: var(--cue); }
.side-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 3px; background: none; font-size: 13.5px; font-weight: 550; }
.chip small { color: var(--muted); }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] small { color: inherit; opacity: 0.7; }
.side .check { display: flex; align-items: center; gap: 8px; height: auto; margin-top: 24px; padding: 0; border: 0; font-weight: 550; }
.side .check small { margin-left: auto; color: var(--muted); }
.filters-toggle { display: none; height: 42px; padding: 0 14px; border: 1px solid var(--ink); border-radius: 3px; background: none; font-weight: 650; }

.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.find { flex: 1 1 220px; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border: 1px solid var(--ink); border-radius: 3px; }
.find:focus-within { border-color: var(--cue); box-shadow: 0 0 0 1px var(--cue); }
.find svg { width: 16px; height: 16px; flex: none; }
.find input { flex: 1; min-width: 0; border: 0; background: none; outline: none; }
.selects { display: flex; flex-wrap: wrap; gap: 10px; }
.pick { position: relative; display: flex; align-items: center; height: 42px; border: 1px solid var(--line); border-radius: 3px; }
.pick:hover { border-color: var(--ink); }
.pick.set { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.pick select { appearance: none; -webkit-appearance: none; height: 100%; padding: 0 30px 0 12px; border: 0; background: none; font-weight: 600; outline-offset: 2px; }
.pick select option { color: #0b0b0c; background: #fff; }
.pick::after { content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.check { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 3px; font-weight: 600; white-space: nowrap; }
.check input { accent-color: var(--cue); width: 15px; height: 15px; margin: 0; }

.count { margin: 18px 0 0; font: 600 11px/1 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }

.group { margin-top: 30px; }
.group:first-child { margin-top: 14px; }
.group h2 { display: flex; align-items: baseline; gap: 10px; margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--ink); font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.group h2 span { font: 11px var(--mono); color: var(--muted); font-weight: 400; }
.row { position: relative; display: grid; grid-template-columns: 34px minmax(150px, 260px) minmax(80px, 1fr) 50px auto; align-items: center; gap: 18px; padding: 9px 0 9px 10px; border-bottom: 1px solid var(--line); }
.row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.row:hover { background: var(--soft); }
.row.active::before { background: var(--cue); }
.round { width: 34px; height: 34px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 50%; background: none; }
.round:hover, .row.active .round { background: var(--cue); border-color: var(--cue); color: var(--cue-ink); }
.round svg { width: 13px; height: 13px; }
.row-meta { min-width: 0; }
.row-title { font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; }
.row-wave { height: 30px; cursor: pointer; }
.row-time { color: var(--muted); font-size: 12.5px; text-align: right; }
.row-tools { display: flex; gap: 2px; }
.tool { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 3px; background: none; color: var(--muted); text-decoration: none; }
.tool:hover { background: var(--ink); color: var(--bg); }
.tool svg { width: 16px; height: 16px; }
.pill { padding: 2px 5px; border: 1px solid currentColor; border-radius: 2px; font: 600 9.5px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.energy { display: inline-flex; gap: 2px; align-items: flex-end; }
.energy i { width: 3px; background: var(--line); }
.energy i:nth-child(1) { height: 5px; } .energy i:nth-child(2) { height: 8px; } .energy i:nth-child(3) { height: 11px; }
.energy i.on { background: var(--ink); }

/* waveform: grey bars, with a red copy clipped to the playback position */
.wave { position: relative; height: 100%; color: var(--wave); }
.wave svg { display: block; width: 100%; height: 100%; }
.wave svg.on { position: absolute; inset: 0; color: var(--cue); clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0); }
.wave path { fill: none; stroke: currentColor; stroke-width: 1.5; vector-effect: non-scaling-stroke; }

.empty { margin-top: 26px; padding: 56px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); }
#sentinel { height: 1px; }

/* ---------- player: a transport bar along the bottom ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--ink); color: var(--bg); }
.dock-row { display: grid; grid-template-columns: auto minmax(90px, 240px) minmax(0, 1fr) auto; align-items: center; gap: 16px; height: 60px; }
.dock-play { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--cue); color: var(--cue-ink); }
.dock-play svg { width: 14px; height: 14px; }
.dock strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock input { width: 100%; margin: 0; accent-color: var(--cue); }
.dock .mono { font-size: 12px; opacity: 0.75; white-space: nowrap; }
.toast { position: fixed; left: 50%; bottom: 78px; transform: translateX(-50%); z-index: 7; padding: 8px 14px; border-radius: 3px; background: var(--cue); color: var(--cue-ink); font-size: 14px; font-weight: 600; }

/* ---------- developers page ---------- */
.lead { padding: 56px 0 30px; }
.lead p:not(.eyebrow) { margin: 14px 0 0; color: var(--muted); max-width: 58ch; font-size: 16px; }
.api { max-width: 820px; }
.api h2 { margin: 40px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.api p { color: var(--muted); }
.api code { font-family: var(--mono); font-size: 13px; }
.api p code, .api td code { padding: 2px 6px; background: var(--soft); color: var(--ink); }
.api pre { margin: 0 0 12px; padding: 16px 18px; background: var(--code-bg); color: var(--code-ink); overflow-x: auto; }
.card { padding: 22px; border: 1px solid var(--ink); }
.card h2 { margin-top: 0; border: 0; padding: 0; }
.btn { height: 42px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 3px; background: none; font-weight: 650; }
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.primary { background: var(--cue); border-color: var(--cue); color: var(--cue-ink); }
.btn:disabled { opacity: 0.6; cursor: default; }
#key-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
#key-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
#key-form input { height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--bg); color: var(--ink); min-width: 0; }
.form-error { margin: 12px 0 0; color: var(--cue) !important; }
.key-note { margin: 16px 0 8px; }
.key-box { display: flex; gap: 10px; align-items: center; }
.key-box code { flex: 1; min-width: 0; padding: 11px 14px; background: var(--code-bg); color: var(--code-ink); overflow-x: auto; white-space: nowrap; }
.table-scroll { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 14px 10px 0; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font: 600 11px/1 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
td:first-child { white-space: nowrap; }
.foot { margin-top: 64px; color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .wrap { padding: 0 16px; }
  .mast-row { gap: 16px; }
  .nav { gap: 16px; font-size: 14px; }
  .word { font-size: 17px; }
  .theme { flex: none; width: 32px; height: 32px; }
  .listing-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  /* the sidebar tucks away behind a Filters button */
  .side { position: static; max-height: none; display: none; padding: 0 0 8px; }
  .side.open { display: block; }
  .filters-toggle { display: inline-flex; align-items: center; }
  .crumbs { padding: 22px 0 18px; }
  .crumbs .home { font-size: 26px; }
  .crumbs .tagline { display: none; }
  .row { grid-template-columns: 34px minmax(0, 1fr) 44px auto; gap: 10px; }
  .row-wave { display: none; }
  .dock-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .dock input { display: none; }
  #key-form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .tool, .btn, .round, .chip { transition: background-color 0.12s, color 0.12s; }
}

/* ---------- accounts, plans ---------- */
.btn.slim { height: 36px; padding: 0 14px; margin-left: auto; font-size: 14px; }
.btn.slim:not([hidden]) + .theme { margin-left: 0; }
.btn.as-link { display: inline-flex; align-items: center; text-decoration: none; }
.linkish { padding: 0; border: 0; background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { color: var(--cue); }
.count { display: flex; flex-wrap: wrap; gap: 6px 18px; }
#preview-note { color: var(--ink); }
#preview-note::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--cue); vertical-align: 1px; }
.tool:disabled { opacity: 0.4; cursor: progress; }
.page { max-width: 820px; }
.page .display { max-width: 20ch; }
#account .display { font-size: clamp(24px, 3.4vw, 38px); max-width: none; overflow-wrap: anywhere; }
.page h2 { margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.page p { color: var(--muted); }
.page code { font-family: var(--mono); font-size: 13px; }
.fine { margin-top: 22px; max-width: 62ch; font-size: 13.5px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--ink); }
.plan { display: flex; flex-direction: column; padding: 26px; }
.plan + .plan { border-left: 1px solid var(--ink); }
.plan.pro { background: var(--soft); }
.plan .price { margin: 14px 0 0; font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: var(--ink); }
.plan .price small { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.plan ul { flex: 1; margin: 22px 0 26px; padding: 0; list-style: none; }
.plan li { padding: 9px 0; border-top: 1px solid var(--line); color: var(--ink); }
.plan .btn { align-self: flex-start; }
.plan-state { margin: 0; font-weight: 600; color: var(--ink) !important; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 18px; }
.fact { margin: 8px 0 0; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink) !important; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.inline-form input, .dialog input { height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--bg); color: var(--ink); min-width: 0; }
.inline-form input { flex: 1 1 200px; }
.inline-form input:focus, .dialog input:focus { border-color: var(--ink); outline: none; }
#owner-note { display: block; margin-top: 6px; }

.dialog { width: min(400px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--ink); border-radius: 0; background: var(--bg); color: var(--ink); }
.dialog::backdrop { background: rgb(11 11 12 / 0.55); }
.dialog form { position: relative; display: grid; gap: 14px; padding: 30px 28px 26px; }
.dialog h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.dialog label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.dialog .form-error { margin: 0; }
.dialog-why, .dialog-swap { margin: 0; color: var(--muted); font-size: 14px; }
.dialog-close { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); }
.dialog-close:hover { color: var(--ink); }

@media (max-width: 900px) {
  .nav { gap: 13px; }
  .btn.slim { padding: 0 10px; }
  .plans { grid-template-columns: 1fr; }
  .plan + .plan { border-left: 0; border-top: 1px solid var(--ink); }
  .facts { grid-template-columns: 1fr; gap: 14px; }
}

.pay { display: flex; flex-wrap: wrap; gap: 10px; }
.pay small { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.plan .price small { display: block; margin-top: 8px; }

.btn.google { display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.btn.google svg { width: 18px; height: 18px; }
.btn.google:hover { background: var(--soft); color: var(--ink); }
.dialog-or { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--muted); font-size: 12.5px; }
.dialog-or::before, .dialog-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.btn.slim { white-space: nowrap; flex: none; }
