/* Layout: a scoreboard header with countdown, then tabs: Leaderboard / Log a meeting / My meetings / Admin (owner + editors) */
:root {
  /* Callagy Recovery: black ink, steel-blue wings, silver */
  --bg: #f1f4f6;
  --surface: #ffffff;
  --fg: #111417;
  --muted: #5a6670;
  --line: #d6dde2;
  --accent: #3d6a84;
  --accent-ink: #ffffff;
  --accent-soft: #e3ecf1;
  --gold: #b7861a;
  --silver: #7a858c;
  --bronze: #a35f33;
  --ok: #1d7a3a; --ok-soft: #dff2e4;
  --warn: #9a6a00; --warn-soft: #fbf0d4;
  --bad: #b3261e; --bad-soft: #fbe2df;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Figtree", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0d1114; --surface: #161c21; --fg: #e8edf0; --muted: #93a0a8; --line: #2a333a;
  --accent: #8db4ca; --accent-ink: #0d1114; --accent-soft: #1f3340;
  --gold: #e3b341; --silver: #aab4ba; --bronze: #d08a5c;
  --ok: #5fd07f; --ok-soft: #173822; --warn: #e5b440; --warn-soft: #3a2f12; --bad: #f2867d; --bad-soft: #3d1b18;
  color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0d1114; --surface: #161c21; --fg: #e8edf0; --muted: #93a0a8; --line: #2a333a;
  --accent: #8db4ca; --accent-ink: #0d1114; --accent-soft: #1f3340;
  --gold: #e3b341; --silver: #aab4ba; --bronze: #d08a5c;
  --ok: #5fd07f; --ok-soft: #173822; --warn: #e5b440; --warn-soft: #3a2f12; --bad: #f2867d; --bad-soft: #3d1b18;
  color-scheme: dark }

* { box-sizing: border-box; }
/* Component display rules (.panel, .card, .notice) would otherwise override the hidden attribute */
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.5; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 28px 16px 64px; display: grid; gap: 20px; }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(28px, 5vw, 42px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
h2 { font-size: 20px; font-weight: 700; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 600; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

header.top { display: flex; flex-wrap: wrap; gap: 20px; align-items: end; justify-content: space-between; }
header.top .lede { max-width: 560px; display: grid; gap: 8px; }
.clock { display: flex; gap: 10px; }
.clock div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; text-align: center; min-width: 76px; }
.clock b { display: block; font-family: var(--mono); font-size: 26px; font-variant-numeric: tabular-nums; }
.clock span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); }
.window { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-family: var(--mono); }

nav.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
nav.tabs button { font: 600 14px var(--body); background: none; border: 0; color: var(--muted); padding: 10px 14px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
nav.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
nav.tabs button:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.panel { display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.notice { background: var(--accent-soft); border-radius: 10px; padding: 12px 16px; font-size: 14px; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }

/* podium */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.podium .spot { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 4px; border-top: 4px solid var(--c); }
.podium .place { font-family: var(--display); font-weight: 800; font-size: 13px; color: var(--c); text-transform: uppercase; letter-spacing: 0.08em; }
.podium .who { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.podium .score { font-family: var(--display); font-weight: 800; font-size: 36px; line-height: 1; }
.podium .empty { color: var(--muted); font-size: 14px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.r, th.r { text-align: right; }
tr.me td { background: var(--accent-soft); }
.rank { font-family: var(--mono); color: var(--muted); }

/* form */
form { display: grid; gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 600; }
label .req { color: var(--bad); }
input, select, textarea { font: 15px var(--body); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; }
textarea { min-height: 84px; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; }
legend { font-family: var(--display); font-weight: 700; font-size: 15px; padding: 0; margin-bottom: 4px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn { font: 600 14px var(--body); border-radius: 8px; padding: 10px 16px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.status-msg { font-size: 14px; }
.link-card { display: grid; gap: 12px; }
.link-card h3 { font-size: 16px; }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; min-width: 0; font: 13px var(--mono); }

.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.verified { background: var(--ok-soft); color: var(--ok); }
.pill.rejected { background: var(--bad-soft); color: var(--bad); }
.pill.dupe { background: var(--bad-soft); color: var(--bad); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.stat b { display: block; font-family: var(--display); font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filters .field { min-width: 150px; flex: 1; }
.mtg-detail { font-size: 13px; color: var(--muted); display: grid; gap: 2px; }
.mtg-detail strong { color: var(--fg); font-weight: 600; }
.rules { display: grid; gap: 6px; margin: 0; padding-left: 18px; font-size: 14px; }

@media (max-width: 640px) {
  .grid2, .stats { grid-template-columns: 1fr 1fr; }
  .grid2 .field { grid-column: 1 / -1; }
  .podium { grid-template-columns: 1fr; }
  .clock div { min-width: 0; flex: 1; }
  .clock { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* standalone site additions */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
.login { max-width: 420px; display: grid; gap: 12px; }
.foot { font-size: 12px; color: var(--muted); text-align: center; }
a { color: var(--accent); }
