/* radio1 — shares the offl1ne design language (tokens, topbar, cards, pill
   buttons, light+dark). Mirrors bookshelf so the app doesn't stick out. */

/* ---- design tokens -------------------------------------------------- */
:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #efedea;
  --border: #e4e1db;
  --ink: #1c1a17;
  --muted: #74706a;
  --accent: #e8590c;
  --accent-hover: #cf4f0a;
  --accent-ink: #ffffff;
  --accent-weak: rgba(232, 89, 12, .10);
  --ok: #2f6b46;
  --err: #b23b2e;
  --warn-bg: #fbeecc;
  --warn-ink: #7a4f05;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.07);
  --radius: 16px;
  --radius-sm: 11px;
  --bar: rgba(255,255,255,.78);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17161a;
    --surface: #232127;
    --surface-2: #2b2930;
    --border: #38353d;
    --ink: #f0ede8;
    --muted: #a39e98;
    --accent: #ff8c42;
    --accent-hover: #ff9d5c;
    --accent-ink: #241205;
    --accent-weak: rgba(255, 140, 66, .16);
    --ok: #6fcf97;
    --err: #f08b7e;
    --warn-bg: #3a3320;
    --warn-ink: #f0d68a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.45);
    --bar: rgba(25,24,28,.72);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1 { letter-spacing: -.02em; }
h1, h2 { color: var(--ink); }

/* ---- top bar -------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem clamp(1rem, 4vw, 1.5rem);
  padding-top: max(.7rem, env(safe-area-inset-top));
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--ink); font-weight: 700; font-size: 1.08rem;
  text-decoration: none; letter-spacing: -.01em;
}
.brand::before { content: "📻"; font-size: 1.15rem; }
.topbar nav { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav a {
  color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 500;
  padding: .4rem .7rem; border-radius: 999px; transition: background .15s, color .15s;
}
.topbar nav a:hover { color: var(--ink); background: var(--surface-2); }
.topbar nav a.on { color: var(--accent); background: var(--accent-weak); }
.topbar .who { color: var(--muted); font-size: .85rem; }

main { max-width: 1080px; margin: 0 auto; padding: clamp(1rem, 4vw, 1.6rem); }

/* ---- cards / forms -------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.2rem;
  box-shadow: var(--shadow-sm);
}
.card > h2:first-child { margin-top: 0; }
label { display: block; margin: .2rem 0 .3rem; font-size: .82rem; font-weight: 500; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--ink); width: 100%;
  padding: .6rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak);
}

button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid transparent; border-radius: 999px;
  padding: .55rem 1.1rem; background: var(--accent); color: var(--accent-ink);
  text-decoration: none; transition: background .15s, border-color .15s, transform .05s;
}
button:active, .btn:active { transform: translateY(1px); }
button:hover, .btn:hover { background: var(--accent-hover); }
.btn-ghost, button.ghost, .btn.ghost {
  background: transparent; border-color: var(--border); color: var(--ink);
}
.btn-ghost:hover, button.ghost:hover, .btn.ghost:hover { background: var(--surface-2); }
.btn.small, button.small { padding: .35rem .7rem; font-size: .82rem; }
.btn.icon { width: 40px; height: 40px; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* ---- table ---------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .6rem .7rem; text-align: left; vertical-align: middle; }
.table thead th {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); border-bottom: 1px solid var(--border);
}
.table tbody td { border-bottom: 1px solid var(--border); }
.table tbody tr:hover td { background: var(--surface-2); }
.table td a { color: var(--accent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .rank { color: var(--muted); font-variant-numeric: tabular-nums; width: 3rem; }

/* ---- badges / alerts ------------------------------------------------ */
.badge { display: inline-block; padding: .18rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge-ok { background: var(--accent-weak); color: var(--ok); }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.badge-warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge-err { background: var(--accent-weak); color: var(--err); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-ok { background: var(--ok); }
.dot-muted { background: var(--muted); }

.alert { padding: .6rem .8rem; border-radius: var(--radius-sm); margin: .5rem 0; font-size: .92rem; }
.alert-ok { background: var(--accent-weak); color: var(--ok); }
.alert-warn { background: var(--warn-bg); color: var(--warn-ink); }
.alert-err { background: var(--accent-weak); color: var(--err); }

/* ---- auth ----------------------------------------------------------- */
.auth { max-width: 360px; margin: 12vh auto 0; }
.auth h1 { margin-top: 0; }
.auth form { display: flex; flex-direction: column; gap: .8rem; }
.err { color: var(--err); margin: 0; font-size: .9rem; }

.muted { color: var(--muted); }
footer { margin: 2rem auto; max-width: 1080px; padding: 0 1rem; color: var(--muted); font-size: .85rem; }
