:root {
  --navy: #14213D;
  --gold: #F2A900;
  --bg: #FAFAF7;
  --card: #FFFFFF;
  --text: #14213D;
  --muted: #5B6478;
  --line: #E3E1DA;
  --danger: #B42318;
  --ok: #1E7A45;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1628;
    --card: #17223A;
    --text: #F4F2EC;
    --muted: #A9B1C3;
    --line: #2A3754;
    --danger: #F97066;
    --ok: #47CD89;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: inherit; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 'Atkinson Hyperlegible', Verdana, sans-serif;
}
.wrap { width: min(1040px, 100% - 32px); margin-inline: auto; }
.hidden { display: none !important; }
.top { background: var(--navy); color: #fff; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--navy); z-index: 10; }
.top-in { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.brand { color: #fff; font-weight: 700; font-size: 20px; text-decoration: none; }
.brand::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); margin-right: 10px; vertical-align: middle; }
.top-actions { display: flex; gap: 18px; }
.top .link { color: #fff; }
main { padding: 28px 0 64px; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; margin-bottom: 20px; }
.narrow { max-width: 460px; margin-inline: auto; }
.grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.grid .card { margin-bottom: 0; }
.grid + .card, .grid + section { margin-top: 20px; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }
.muted { color: var(--muted); margin: 0 0 18px; }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0 14px; }
label { display: block; margin: 14px 0 6px; font-weight: 700; }
label span { display: block; margin-bottom: 6px; }
input {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
input:focus { outline: 3px solid var(--gold); outline-offset: 1px; border-color: var(--navy); }
.btn {
  display: inline-block; font: inherit; font-weight: 700; border: 0; border-radius: 999px;
  padding: 12px 22px; background: var(--navy); color: #fff; cursor: pointer; margin-top: 12px;
}
@media (prefers-color-scheme: dark) { .btn { background: var(--gold); color: #14213D; } }
.btn.big { width: 100%; padding: 16px; font-size: 19px; background: var(--gold); color: #14213D; }
.btn.ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .55; cursor: wait; }
.btn:focus-visible, .link:focus-visible, .tab:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.link { background: none; border: 0; font: inherit; color: var(--text); text-decoration: underline; cursor: pointer; padding: 0; }
.small { font-size: 15px; display: block; margin-top: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tab { background: none; border: 0; font: inherit; color: var(--muted); padding: 10px 12px; cursor: pointer; border-bottom: 3px solid transparent; }
.tab.on { color: var(--text); font-weight: 700; border-color: var(--gold); }
.minutes { font-size: 44px; font-weight: 700; margin: 0; line-height: 1.1; }
.minutes span:last-child { font-size: 20px; color: var(--muted); font-weight: 400; }
.breakdown { list-style: none; padding: 0; margin: 10px 0 14px; color: var(--muted); }
.live { margin-top: 18px; padding: 18px; border-radius: 12px; background: var(--bg); text-align: center; }
.live-status { font-size: 20px; font-weight: 700; margin: 0; }
.live-time { font-size: 32px; margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.plan { border: 1.5px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; }
.plan h3 { margin: 0; font-size: 18px; }
.plan .price { font-size: 30px; font-weight: 700; margin: 6px 0 0; }
.plan .per { color: var(--muted); margin: 0 0 6px; }
.plan .btn { margin-top: auto; }
.plan.current { border-color: var(--gold); }
.scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 26px; }
.stat span { color: var(--muted); font-size: 14px; }
.adminlink { text-align: center; }
.adminlink a, main a { color: var(--text); }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; max-width: min(520px, 92vw);
  box-shadow: 0 6px 24px rgba(20, 33, 61, .25); z-index: 20;
}
.toast.bad { background: var(--danger); }
@media (prefers-reduced-motion: no-preference) { .toast { transition: opacity .2s; } }

.row.center { justify-content: center; }
.btn.pause { background: var(--gold); color: #14213D; }
.btn.pause.on { background: var(--ok); color: #fff; }
.hold-line { margin: 6px 0 0; font-weight: 700; }
.live.paused { outline: 3px solid var(--gold); }
