/* The companion page. Phone first; no web fonts, no images, nothing inline (the CSP in
   site/_headers allows styles from this origin only). */
:root {
  --bg: #0f1115;
  --card: #181b22;
  --line: #2a2f3a;
  --text: #eceef3;
  --muted: #a4abb8;
  --accent: #e8b04a;
  --accent-text: #1a1406;
  --field: #0f1115;
  --bad: #ff8a80;
  --good: #8fd6a0;
  --focus: #7cb8ff;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f3ee;
    --card: #ffffff;
    --line: #d9d5cc;
    --text: #1b1d22;
    --muted: #5b606b;
    --accent: #95600f;
    --accent-text: #ffffff;
    --field: #ffffff;
    --bad: #b3261e;
    --good: #1e7a3a;
    --focus: #1a5fb4;
  }
}

* { box-sizing: border-box; }
.hidden { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
main { max-width: 34rem; margin: 0 auto; padding: 16px 16px 40px; }

.top { padding: 8px 0 4px; }
.brand { margin: 0; color: var(--accent); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 14px; }
h1 { margin: 4px 0 12px; font-size: 24px; line-height: 1.25; }
h2 { margin: 0 0 8px; font-size: 19px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 0 0 16px; }
.hint { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.empty { margin: 0 0 12px; color: var(--muted); }
#st-count { white-space: nowrap; }
.msg { margin: 10px 0 0; min-height: 1.5em; font-size: 15px; }
.msg.bad { color: var(--bad); }
.msg.good { color: var(--good); }

label { display: block; font-size: 14px; color: var(--muted); margin: 0 0 4px; }
input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  color: var(--text);
  font: inherit;
}
input.bad { border-color: var(--bad); }
#pin { font-size: 24px; letter-spacing: 0.15em; text-align: center; font-variant-numeric: tabular-nums; }

button {
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button:disabled { opacity: 0.5; cursor: default; }
button.link { border: 0; background: none; color: var(--muted); text-decoration: underline; min-height: 44px; padding: 8px 0; }
input:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Margins, not flex gap: this page is not bound by the TV's floor, but there is no need for gap. */
.row { display: flex; align-items: stretch; }
.row input { flex: 1 1 auto; min-width: 0; margin-right: 8px; }
.row button { flex: 0 0 auto; }

.facts { display: grid; grid-template-columns: max-content 1fr; margin: 0; }
.facts dt { color: var(--muted); padding: 2px 16px 2px 0; }
.facts dd { margin: 0; padding: 2px 0; overflow-wrap: anywhere; }

.stations { list-style: none; margin: 0 0 12px; padding: 0; }
.station { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0 0 10px; }
.station input { margin: 0 0 8px; }
.station .tools { display: flex; justify-content: flex-end; }
.station .tools button { margin-left: 8px; min-width: 48px; }
.actions { display: flex; flex-wrap: wrap; justify-content: space-between; }
.actions button { margin: 0 0 8px; }

.foot { text-align: center; margin: 8px 0 0; }
