/* Gamendar — colours chosen to meet WCAG 2.2 AA contrast (4.5:1 text, 3:1 UI). */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1117;
  --surface: #181c27;
  --surface2: #1f2436;
  --surface3: #262d42;
  --border: rgba(255,255,255,0.10);
  --border2: rgba(255,255,255,0.22);
  --text: #eef0f6;
  --text2: #a9b0c4;
  --text3: #8890a8;
  --accent: #7f9bf7;
  --accent-btn: #4a68dc;
  --accent-btn-hover: #3d5bd4;
  --accent-glow: rgba(108,142,245,0.15);
  --green: #3ecf8e;
  --green-bg: rgba(62,207,142,0.12);
  --red: #f47c7c;
  --red-bg: rgba(240,107,107,0.12);
  --amber: #f5a623;
  --amber-bg: rgba(245,166,35,0.12);
  --focus: #7f9bf7;
  --focus-ring: rgba(127,155,247,0.38);
  --radius: 10px;
  --radius-lg: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  min-height: 100vh; font-size: 15px; line-height: 1.5;
  display: flex; flex-direction: column;
}
a { color: var(--accent); }
a:hover { text-decoration: none; }
img { max-width: 100%; }

/* Visible keyboard focus (WCAG 2.4.7 / 2.4.11): a blue ring in the brand
   colour, 7:1 contrast against the background. */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
/* Headings receive focus on page change only so screen readers announce the
   new page; they shouldn't look selected. */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 1000; background: var(--accent-btn); color: #fff;
  padding: 8px 14px; border-radius: 8px; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ── Layout ──────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,17,23,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 1rem; display: flex; align-items: center; gap: 0.5rem; min-height: 54px; flex-wrap: wrap;
}
.topbar-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; }
.topbar-logo .dot { width: 9px; height: 9px; background: var(--accent); border-radius: 50%; }
.topbar-nav { display: flex; gap: 2px; margin-left: 1rem; }
.nav-link {
  padding: 7px 14px; border-radius: 7px; color: var(--text2); text-decoration: none; font-size: 14px; font-weight: 500;
}
.nav-link:hover, .nav-link[aria-current="page"] { background: var(--surface2); color: var(--text); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-chip {
  display: flex; align-items: center; gap: 8px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 10px; font-size: 14px; color: var(--text); text-decoration: none;
}
.user-chip:hover { border-color: var(--border2); }

.main { width: 100%; max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 3rem; flex: 1; min-width: 0; }
.main:focus { outline: none; }

.site-footer {
  border-top: 1px solid var(--border); padding: 1.5rem 1rem; color: var(--text3); font-size: 13px; text-align: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-bottom: 0.6rem; }
.site-footer a { color: var(--text2); }

.banner {
  background: var(--amber-bg); color: var(--text); border-bottom: 1px solid rgba(245,166,35,0.35);
  padding: 10px 1rem; font-size: 14px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
}

.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.75rem; flex-wrap: wrap; gap: 1rem; }
.page-header h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.4px; }
.page-header p { color: var(--text2); font-size: 14px; margin-top: 3px; }
.page-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }
h2.section { font-size: 18px; font-weight: 600; margin: 2rem 0 0.9rem; }
h2.section:first-child { margin-top: 0; }
.section-title { font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 0.75rem; }
.muted { color: var(--text2); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* ── Cards / panels ──────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem;
}
.card + .card { margin-top: 1rem; }
.card h2 { font-size: 17px; font-weight: 600; margin-bottom: 0.4rem; }
.card > p.muted { margin-bottom: 1rem; font-size: 14px; }
.card-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.card-row:first-of-type { border-top: none; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }

/* ── Auth ────────────────────────────────────────────────── */
.auth-wrap {
  display: flex; align-items: flex-start; justify-content: center; padding: 2rem 0;
}
.auth-card {
  width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); padding: 2.25rem;
}
.auth-card h1 { font-size: 22px; font-weight: 650; margin-bottom: 0.3rem; }
.auth-card > p.muted { margin-bottom: 1.5rem; font-size: 14px; }
.auth-alt { margin-top: 1.25rem; text-align: center; font-size: 14px; color: var(--text2); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text3); font-size: 13px; margin: 1.25rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; border-top: 1px solid var(--border2); }
.providers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.provider-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 10px;
  border: 1px solid var(--border2); border-radius: 8px; background: var(--bg); color: var(--text);
  text-decoration: none; font-size: 14px; font-weight: 500;
}
.provider-btn:hover { background: var(--surface2); }
.provider-btn .mark { width: 22px; height: 22px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group > label, .label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; font-weight: 500; }
.hint { font-size: 12px; color: var(--text3); margin-top: 5px; }
.hint.ok { color: var(--green); }
.hint.bad { color: var(--red); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="time"],
input[type="number"], input[type="search"], input[type="url"], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border2); border-radius: 8px;
  padding: 10px 13px; color: var(--text); font-family: var(--font); font-size: 15px;
}
input:focus, select:focus, textarea:focus, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring);
}
.check input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: none; }
input[readonly] { color: var(--text2); background: var(--surface2); }
input[aria-invalid="true"] { border-color: var(--red); }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; margin: 0.5rem 0; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent-btn); flex-shrink: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; }
.code-input { font-family: var(--mono); font-size: 22px !important; letter-spacing: 0.25em; text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent; cursor: pointer;
  font-family: var(--font); font-size: 15px; font-weight: 550; text-decoration: none; line-height: 1.2;
  min-height: 40px;
}
.btn-primary { background: var(--accent-btn); color: #fff; }
.btn-primary:hover { background: var(--accent-btn-hover); }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border2); }
.btn-ghost:hover { background: var(--surface2); }
.btn-danger { background: var(--red-bg); color: var(--red); border-color: rgba(240,107,107,0.4); }
.btn-danger:hover { background: rgba(240,107,107,0.22); }
.btn-sm { padding: 6px 12px; font-size: 13px; min-height: 32px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }

.msg { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 1rem; border: 1px solid; }
.msg-error { background: var(--red-bg); color: #ffc9c9; border-color: rgba(240,107,107,0.4); }
.msg-ok { background: var(--green-bg); color: #b9f5d8; border-color: rgba(62,207,142,0.35); }
.msg-info { background: var(--accent-glow); color: var(--text); border-color: rgba(108,142,245,0.35); }
.msg-warn { background: var(--amber-bg); color: var(--text); border-color: rgba(245,166,35,0.4); }

.badge {
  display: inline-block; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 20px;
  background: var(--accent-glow); color: var(--accent); letter-spacing: 0.3px; white-space: nowrap;
}
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.gray { background: var(--surface3); color: var(--text2); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent-btn-hover); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
  flex-shrink: 0; overflow: hidden; object-fit: cover;
}
.avatar.lg { width: 88px; height: 88px; font-size: 32px; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border2); margin-bottom: 1.5rem; overflow-x: auto; }
.tab {
  padding: 10px 14px; border: none; background: none; color: var(--text2); font: inherit; font-size: 14px;
  font-weight: 550; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.6px; border-bottom: 1px solid var(--border2); }
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }

/* ── Events list ─────────────────────────────────────────── */
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1.25rem; }
.chip {
  padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border2); background: transparent;
  color: var(--text2); font: inherit; font-size: 13px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent-glow); color: var(--text); border-color: var(--accent); }
.events-grid { display: grid; gap: 12px; }
.event-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.1rem 1.4rem; display: flex; align-items: center; gap: 1rem; color: var(--text); text-decoration: none;
}
.event-card:hover { border-color: var(--border2); background: var(--surface2); }
.event-card.past { opacity: 0.8; }
.week-badge { background: var(--accent-glow); color: var(--accent); border-radius: 8px; padding: 8px 12px; text-align: center; min-width: 78px; flex-shrink: 0; }
.week-badge .month { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.8px; }
.week-badge .days { font-size: 17px; font-weight: 650; font-family: var(--mono); }
.event-info { flex: 1; min-width: 0; }
.event-title { font-weight: 600; font-size: 16px; }
.event-meta { color: var(--text2); font-size: 13px; margin-top: 3px; }
details.prev { margin-top: 1rem; }
details.prev summary { cursor: pointer; color: var(--text2); font-weight: 550; padding: 8px 0; }
details.prev .events-grid { margin-top: 0.5rem; }

.empty-state { text-align: center; padding: 3.5rem 1.5rem; color: var(--text2); }
.empty-state .icon { font-size: 44px; margin-bottom: 0.75rem; }
.empty-state h2 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 0.5rem; }
.empty-state .row { justify-content: center; margin-top: 1.25rem; }

.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.choice-card { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 1.5rem; }
.choice-card h2 { font-size: 17px; margin: 0.4rem 0; }
.choice-card .icon { font-size: 28px; }

/* ── Event detail ────────────────────────────────────────── */
.back-link { display: inline-flex; gap: 6px; color: var(--text2); font-size: 14px; margin-bottom: 1rem; text-decoration: none; }
.back-link:hover { color: var(--text); }
.legend { display: flex; gap: 14px; margin-bottom: 1.25rem; flex-wrap: wrap; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text2); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-dot.green { background: var(--green); } .legend-dot.red { background: var(--red); }
.legend-dot.amber { background: var(--amber); } .legend-dot.gray { background: var(--text3); }
.view-toggle { display: flex; gap: 2px; background: var(--bg); border-radius: 8px; padding: 3px; border: 1px solid var(--border2); margin-left: auto; }
.view-toggle button { padding: 5px 12px; border-radius: 6px; border: none; background: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 550; color: var(--text2); }
.view-toggle button[aria-pressed="true"] { background: var(--surface3); color: var(--text); }

.af-card { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 1.5rem; max-width: 600px; }
.af-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.af-header h2 { font-size: 19px; font-weight: 600; }
.af-progress { font-size: 13px; color: var(--text2); white-space: nowrap; }
.af-progress strong { color: var(--accent); }
.af-quick { display: flex; gap: 8px; margin-bottom: 1rem; flex-wrap: wrap; }
.af-day { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.af-day-label { flex: 1; font-size: 15px; font-weight: 600; min-width: 70px; }
.af-day-label .num { color: var(--text2); font-weight: 400; margin-left: 4px; }
.af-day.today .af-day-label { color: var(--accent); }
.af-choices { display: flex; gap: 4px; }
.af-choice, .af-icon-btn, .af-time-btn {
  height: 36px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border2); background: var(--bg);
  color: var(--text2); font: inherit; font-size: 15px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center;
}
.af-choice { width: 42px; }
.af-icon-btn { width: 38px; font-size: 14px; }
.af-time-btn { padding: 0 10px; font-size: 12px; white-space: nowrap; }
.af-choice:hover, .af-icon-btn:hover, .af-time-btn:hover { background: var(--surface2); color: var(--text); }
.af-choice[aria-pressed="true"].available { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.af-choice[aria-pressed="true"].maybe { background: var(--amber-bg); color: var(--amber); border-color: var(--amber); }
.af-choice[aria-pressed="true"].unavailable { background: var(--red-bg); color: var(--red); border-color: var(--red); }
.af-icon-btn.on, .af-time-btn.on { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }
.af-extra { width: 100%; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 6px; }
.af-extra input[type="time"] { width: auto; padding: 7px 10px; font-size: 14px; }
.af-extra input[type="text"] { flex: 1; min-width: 180px; padding: 8px 12px; font-size: 14px; }
.af-footer { text-align: center; font-size: 12px; color: var(--text3); margin-top: 0.75rem; }

.grid-scroll { position: relative; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
table.week { border-collapse: collapse; width: 100%; min-width: 640px; }
table.week th, table.week td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 8px 6px; text-align: center; font-size: 13px; }
table.week th:last-child, table.week td:last-child { border-right: none; }
table.week thead th { background: var(--surface2); }
table.week thead .dname { color: var(--text2); font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 550; }
table.week thead .dnum { font-size: 17px; font-family: var(--mono); font-weight: 650; }
table.week thead th.today .dnum { color: var(--accent); }
table.week th.who { text-align: left; background: var(--surface2); min-width: 120px; font-weight: 550; }
table.week th.who .row { flex-wrap: nowrap; gap: 8px; }
table.week tfoot td { background: var(--surface); font-family: var(--mono); font-weight: 650; color: var(--green); font-size: 16px; }
table.week tfoot td small { display: block; color: var(--text3); font-family: var(--font); font-size: 11px; font-weight: 400; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 30px; height: 28px; padding: 0 8px; border-radius: 14px; background: var(--surface3); color: var(--text2); font-size: 12px; font-weight: 600; }
.pill.available { background: var(--green-bg); color: var(--green); }
.pill.unavailable { background: var(--red-bg); color: var(--red); }
.pill.maybe { background: var(--amber-bg); color: var(--amber); }
.note-mark { display: inline-block; margin-left: 4px; color: var(--accent); font-size: 11px; }
.detail-bottom { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; margin-top: 1.5rem; }
.detail-bottom > * { min-width: 0; flex: 1 1 320px; }

.times-panel { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 1rem 1.15rem; }
.times-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.times-days { display: flex; gap: 2px; flex-wrap: wrap; }
.times-day { padding: 4px 8px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--text2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.times-day:hover { background: var(--surface2); }
.times-day[aria-pressed="true"] { background: var(--accent-glow); color: var(--text); border-color: var(--accent); }
.times-day.has-times::after { content: '•'; color: var(--green); margin-left: 2px; }
.tl-row, .tl-axis { display: grid; grid-template-columns: 90px 1fr; gap: 10px; align-items: center; }
.tl-row { margin-bottom: 6px; position: relative; }
.tl-name { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-track { position: relative; height: 26px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.tl-block { position: absolute; top: 2px; bottom: 2px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 650; white-space: nowrap; overflow: hidden; }
.tl-block.available { background: rgba(62,207,142,0.28); color: var(--green); border: 1px solid rgba(62,207,142,0.6); }
.tl-block.maybe { background: rgba(245,166,35,0.25); color: var(--amber); border: 1px solid rgba(245,166,35,0.6); }
.tl-overlap { position: absolute; top: 0; bottom: 0; background: rgba(108,142,245,0.18); border-left: 1px dashed var(--accent); border-right: 1px dashed var(--accent); pointer-events: none; }
.tl-ticks { position: relative; height: 16px; }
.tl-tick { position: absolute; top: 0; font-size: 10px; color: var(--text3); font-family: var(--mono); white-space: nowrap; }
.tl-note { margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px solid var(--border); font-size: 13px; color: var(--text2); }
.tl-note strong { color: var(--accent); }

/* ── Modal ───────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.65); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 1rem; overflow-y: auto; }
.modal { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-lg); width: 100%; max-width: 500px; padding: 1.75rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.modal h2 { font-size: 19px; font-weight: 600; margin-bottom: 1rem; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 1.25rem; flex-wrap: wrap; }

.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-family: var(--mono); font-size: 15px; background: var(--bg); border: 1px solid var(--border2); border-radius: 8px; padding: 1rem; margin: 0.75rem 0; }
.qr { background: #fff; border-radius: 10px; padding: 8px; width: 200px; height: 200px; display: block; margin: 0.75rem 0; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { font-family: var(--mono); font-size: 13px; }

#toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(120px);
  background: var(--surface3); border: 1px solid var(--border2); color: var(--text);
  padding: 10px 20px; border-radius: 100px; font-size: 14px; font-weight: 550; z-index: 999;
  transition: transform 0.25s ease; max-width: calc(100vw - 2rem); text-align: center;
}
#toast.show { transform: translateX(-50%) translateY(0); }

.spinner { width: 22px; height: 22px; border: 2px solid var(--border2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
.loading { padding: 3rem; text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .topbar { padding: 0.4rem 0.75rem; }
  .topbar-nav { margin-left: 0.25rem; order: 3; width: 100%; }
  .user-chip .uname { display: none; }
  .main { padding: 1.25rem 1rem 2.5rem; }
  .auth-card { padding: 1.5rem; }
  .providers { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 20px; }
  .event-card { padding: 1rem; }
  .tl-row, .tl-axis { grid-template-columns: 64px 1fr; gap: 8px; }
  .view-toggle { margin-left: 0; }
}

#toast:empty { display: none; }
.choice-card p { margin-bottom: 1rem; }
.card h2 + p, .card h2 + .row { margin-top: 0.25rem; }
.card .row + .form-grid, .card .stack + .form-grid { margin-top: 1rem; }

/* ── Legal pages ─────────────────────────────────────────── */
.legal { max-width: 780px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.legal h1 { font-size: 28px; margin-bottom: 0.25rem; }
.legal h2 { font-size: 19px; margin: 2rem 0 0.6rem; }
.legal h3 { font-size: 16px; margin: 1.25rem 0 0.4rem; }
.legal p, .legal li { color: var(--text); margin-bottom: 0.7rem; }
.legal ul, .legal ol { padding-left: 1.4rem; }
.legal .meta { color: var(--text2); font-size: 14px; margin-bottom: 1.5rem; }
.legal .draft { background: var(--amber-bg); border: 1px solid rgba(245,166,35,0.5); border-radius: 8px; padding: 12px 16px; margin-bottom: 1.5rem; font-size: 14px; }
.legal table { border-collapse: collapse; width: 100%; margin: 0.5rem 0 1rem; font-size: 14px; }
.legal th, .legal td { border: 1px solid var(--border2); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal .ph { background: var(--surface3); padding: 0 4px; border-radius: 4px; font-family: var(--mono); font-size: 0.92em; }
.legal-top { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border); }
