/* ============================================================
   RAIDER WIRE — THE WIRE BOARD
   A transit board crossed with a printed field guide.
   ============================================================ */

:root {
  color-scheme: light;
  --paper: #f1efe6;
  --panel: #fffdf8;
  --ink: #111a36;
  --ink-2: #49536e;
  --ink-3: #5b6480;
  --line: #ddd9c8;
  --line-strong: #c6c0aa;
  --blue: #1a4fd6;
  --blue-deep: #1743b4;
  --navy: #0e1c44;
  --navy-dark: #0a1330;
  --gold: #f2b32a;
  --gold-deep: #805300;
  --gold-light: #ffd57a;
  --red: #b3261e;
  --green: #1f7a3d;
  --amber: #9d6a00;
  --font: "Avenir Next", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --maxw: 960px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden], [x-cloak] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    repeating-linear-gradient(90deg, rgb(17 26 54 / 0.022) 0 1px, transparent 1px 110px),
    linear-gradient(180deg, #ebe9df, #f3f1e9 340px);
  background-attachment: fixed;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.dialog-open { overflow: hidden; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.6; }
a { color: inherit; text-underline-offset: 3px; }
svg { display: block; }
form { margin: 0; }
::selection { background: rgb(242 179 42 / 0.35); }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip {
  position: fixed; top: 10px; left: 10px; z-index: 100;
  padding: 10px 16px; border-radius: 10px;
  color: white; background: var(--navy); font-weight: 700; text-decoration: none;
  transform: translateY(-300%); transition: transform 180ms var(--ease);
}
.skip:focus-visible { transform: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.mast :focus-visible, .bulletin :focus-visible, .toast :focus-visible { outline-color: var(--gold-light); }

/* ---------- masthead ---------- */
.mast {
  color: white;
  background:
    radial-gradient(880px 240px at 84% -70%, rgb(26 79 214 / 0.38), transparent 62%),
    linear-gradient(180deg, #0c1737, var(--navy-dark));
}
.mast::after {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg, var(--gold), #d99a12 55%, var(--gold));
}
.mast-in {
  width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 12px 16px 0;
  display: flex; flex-direction: column;
}
.mast-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: white; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; color: var(--gold-light); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-words { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: 0.01em; line-height: 1.1; white-space: nowrap; }
.brand-sub { display: none; }
.mast-side { display: flex; align-items: center; gap: 14px; flex: none; }
.mast-clock { display: none; }
.mast-status {
  min-height: 44px; padding: 0 13px;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgb(255 255 255 / 0.17); border-radius: 999px;
  color: #e2e8f7; background: rgb(255 255 255 / 0.07);
  font-size: 12.5px; font-weight: 650; white-space: nowrap;
  transition: background-color 150ms ease;
}
.mast-status-detail { color: #a6b1d6; font-weight: 600; }
.mast-status-detail::before { content: "· "; }
.mast-dateline { margin: 6px 0 0; padding-bottom: 12px; color: #9aa6c9; font-size: 12.5px; }
@media (hover: hover) { .mast-status:hover { background: rgb(255 255 255 / 0.13); } }
@media (max-width: 379.98px) { .mast-status-detail { display: none; } }

.views { display: flex; gap: 6px; }
.views-btn {
  position: relative; min-width: 0;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink-3); text-decoration: none;
}
.views-icon { width: 21px; height: 21px; display: grid; place-items: center; }
.views-icon svg { width: 100%; height: 100%; }
.views-label { font-weight: 650; }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-grid; place-items: center; border-radius: 999px;
  font: 700 10.5px var(--mono);
}
.badge-blue { color: white; background: var(--blue); }
.badge-gold { color: var(--ink); background: var(--gold); }
.badge-dim { color: white; background: #8b93a8; }

@media (max-width: 719.98px) {
  .views {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line); background: rgb(255 253 248 / 0.96);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .views-btn {
    flex: 1 1 0; min-height: 52px; padding: 5px 4px;
    flex-direction: column; justify-content: center; gap: 3px;
    border-radius: 12px; font-size: 11px;
    transition: background-color 150ms ease, color 150ms ease;
  }
  .views-btn .badge {
    position: absolute; top: 4px; right: calc(50% - 27px);
    max-width: 42px; box-shadow: 0 0 0 2px var(--panel);
  }
  .views-btn.is-active { color: white; background: var(--navy); }
  .views-btn.is-active .views-icon { color: var(--gold-light); }
  .views-btn.is-active .badge { box-shadow: 0 0 0 2px var(--navy); }
}
@media (max-width: 719.98px) and (hover: hover) {
  .views-btn:hover { color: var(--ink); background: #e9e6d8; }
  .views-btn.is-active:hover { color: white; background: var(--navy); }
}
@media (min-width: 720px) {
  .mast-in { padding: 18px 32px 0; }
  .mast-row { padding-bottom: 13px; }
  .brand { gap: 12px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-name { font-size: 21px; }
  .brand-sub { display: block; color: #97a4c8; font-size: 12px; }
  .mast-clock { display: block; color: var(--gold-light); font: 600 12px var(--mono); letter-spacing: 0.08em; }
  .mast-dateline { display: none; }
  .views { gap: 2px; margin: 0 -14px; }
  .views-btn {
    min-height: 44px; padding: 9px 14px 11px; color: #aab5d3;
    font-size: 13.5px; transition: color 150ms ease;
  }
  .views-icon { display: none; }
  .views-btn .badge { box-shadow: 0 0 0 1px rgb(255 255 255 / 0.22); }
  .views-btn.is-active { color: var(--gold-light); box-shadow: inset 0 -3px 0 var(--gold); }
}
@media (min-width: 720px) and (hover: hover) { .views-btn:hover { color: white; } }

/* ---------- page structure ---------- */
.page-shell {
  width: 100%; max-width: var(--maxw); min-height: 65vh; margin: 0 auto;
  padding: 20px 16px 44px;
}
.view { min-width: 0; }
.view-kicker {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 2px 0 18px;
}
.view-kicker h1 { font-size: 21px; font-weight: 800; letter-spacing: -0.015em; }
.view-rule {
  flex: 1; min-width: 36px; height: 2px; align-self: center;
  background: linear-gradient(90deg, var(--gold) 0 40px, var(--line) 40px);
}
.view-kicker p {
  color: var(--ink-3); font: 600 11px var(--mono); letter-spacing: 0.075em; text-transform: uppercase;
}
.view-kicker p strong { color: var(--red); }
.view-note { max-width: 68ch; margin: -5px 0 20px; color: var(--ink-2); font-size: 13.5px; }
.view-note strong { color: var(--ink); }
.block, .archive-section { margin-top: 34px; }
.block:first-of-type { margin-top: 0; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.section-head h2 { display: inline-flex; align-items: center; font-size: 14px; font-weight: 750; white-space: nowrap; }
.section-head h2 > span { width: 8px; height: 8px; margin-right: 9px; flex: none; border-radius: 2px; background: var(--gold); }
.section-head > i { flex: 1; height: 1px; background: var(--line-strong); }
.section-head > p { color: var(--ink-3); font: 600 11px var(--mono); letter-spacing: 0.07em; text-align: right; text-transform: uppercase; }
.section-head > p strong { color: var(--red); }
@media (max-width: 359.98px) {
  .section-head > p { max-width: 48%; line-height: 1.35; }
}
@media (min-width: 720px) {
  .page-shell { padding: 30px 32px 56px; }
  .view-kicker h1 { font-size: 24px; }
  .view-kicker p { white-space: nowrap; }
}

/* ---------- status + priority ---------- */
.outage-banner {
  display: flex; align-items: center; gap: 12px; margin: 0 0 22px; padding: 14px 16px;
  border: 1px solid #dca09a; border-radius: 12px; color: #812920; background: #fdf0ef;
}
.outage-banner > span { width: 22px; height: 22px; flex: none; }
.outage-banner svg { width: 100%; height: 100%; }
.outage-banner p { font-size: 13px; }
.bulletin {
  display: grid; gap: 16px; margin-bottom: 20px; padding: 18px 18px 18px 20px;
  border-left: 4px solid var(--gold); border-radius: 16px; color: white;
  background:
    repeating-linear-gradient(135deg, rgb(242 179 42 / 0.045) 0 2px, transparent 2px 18px),
    radial-gradient(640px 220px at 92% -50%, rgb(26 79 214 / 0.32), transparent 65%),
    linear-gradient(160deg, #0e1b42, var(--navy-dark));
  box-shadow: 0 18px 44px -18px rgb(10 19 48 / 0.45);
}
.bulletin-main { min-width: 0; }
.bulletin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.bulletin-kicker {
  display: inline-flex; align-items: center; gap: 8px; color: var(--gold-light);
  font: 700 11px var(--mono); letter-spacing: 0.13em; text-transform: uppercase;
}
.bulletin-kicker i { width: 13px; height: 13px; }
.bulletin-kicker svg { width: 100%; height: 100%; }
.bulletin-new { padding: 3px 7px; border-radius: 5px; color: var(--ink); background: var(--gold); font: 700 10px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.bulletin h2 { max-width: 38ch; font-size: clamp(19px, 2.6vw, 23px); font-weight: 800; letter-spacing: -0.01em; line-height: 1.22; }
.bulletin h2 a { text-decoration: none; }
.bulletin-detail { max-width: 62ch; margin-top: 8px; color: #c3ceee; font-size: 14px; line-height: 1.55; }
.bulletin-action { max-width: 62ch; margin-top: 11px; padding-top: 11px; border-top: 1px solid rgb(255 255 255 / 0.14); color: #aebce4; font-size: 13px; }
.bulletin-side {
  display: flex; align-items: center; flex-wrap: wrap; gap: 9px 18px;
  padding-top: 16px; border-top: 1px solid rgb(255 255 255 / 0.14);
}
.bulletin-side .button-gold { flex: 1 1 100%; }
.watch-why { color: #c3ceee; font-size: 13px; }
.watch-why summary { min-height: 44px; display: inline-flex; align-items: center; font-weight: 650; text-decoration: underline; text-decoration-color: rgb(195 206 238 / 0.45); cursor: pointer; }
.watch-why p { max-width: 52ch; padding: 8px 0 4px; color: #aebce4; line-height: 1.5; }
.bulletin-side .stamp { margin-left: auto; }
.bulletin-side form { flex: none; }
@media (min-width: 480px) and (max-width: 899.98px) { .bulletin-side .button-gold { flex: 0 1 auto; } }
@media (min-width: 900px) {
  .bulletin { grid-template-columns: minmax(0, 1fr) 244px; gap: 26px; padding: 22px 24px; }
  .bulletin-side {
    flex-direction: column; align-items: stretch; flex-wrap: nowrap; justify-content: center; gap: 8px;
    padding: 0 0 0 26px; border-top: 0; border-left: 1px solid rgb(255 255 255 / 0.14);
  }
  .bulletin-side .button-gold { flex: 0 0 auto; }
  .bulletin-side .stamp { margin-left: 0; }
  .watch-why summary { width: 100%; }
}

/* ---------- buttons ---------- */
.button {
  min-height: 44px; padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px;
  font-size: 13.5px; font-weight: 700; line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, transform 120ms var(--ease);
}
.button:active { transform: translateY(1px); }
.button-primary { color: white; background: var(--blue); }
.button-primary:hover { background: var(--blue-deep); }
.button-gold { color: var(--ink); background: var(--gold); }
.button-gold:hover { background: #e6a51d; }
.button-ghost { color: var(--ink-2); border-color: var(--line-strong); background: transparent; }
.button-ghost:hover { color: var(--ink); border-color: var(--ink-2); }
.button-dark-ghost { color: #dbe3fa; border-color: rgb(255 255 255 / 0.25); background: rgb(255 255 255 / 0.06); }
.button-dark-ghost:hover { color: white; background: rgb(255 255 255 / 0.13); }
.button-small { padding: 0 14px; font-size: 13px; }
.icon-button {
  width: 44px; height: 44px; padding: 0; flex: none;
  display: grid; place-items: center; border: 0; border-radius: 11px;
  color: var(--ink-2); background: transparent;
  transition: color 150ms ease, background-color 150ms ease;
}
.icon-button svg { width: 19px; height: 19px; }
.icon-button:hover { color: var(--red); background: #fdf0ef; }

/* ---------- ledger ---------- */
.ledger { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.ledger > .row + .row, .day-rows > .row + .row { border-top: 1px solid var(--line); }
.row {
  min-width: 0; padding: 13px 16px;
  display: grid; align-items: center; column-gap: 12px; row-gap: 5px;
  transition: opacity 180ms ease, transform 180ms var(--ease), background-color 150ms ease;
}
.task, .update-row, .archive-row {
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-areas: "a b" "d d";
}
.task.no-control, .update-row.no-control, .archive-row.no-control {
  grid-template-columns: minmax(0, 1fr); grid-template-areas: "b" "d";
}
.row-control { grid-area: a; }
.check, .restore {
  width: 44px; height: 44px; padding: 0; margin: -4px 0;
  display: grid; place-items: center; border: 0; border-radius: 12px; color: var(--ink-3); background: transparent;
}
.check > span, .restore > span {
  width: 27px; height: 27px; display: grid; place-items: center;
  border: 2px solid var(--ink-3); border-radius: 8px; color: transparent; background: var(--panel);
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease, transform 150ms var(--ease);
}
.check svg, .restore svg { width: 16px; height: 16px; }
.restore > span { border-width: 1.5px; color: var(--ink-3); }
.check-hide > span { border-color: var(--line-strong); color: var(--ink-3); }
@media (hover: hover) {
  .check:hover > span { color: var(--blue); border-color: var(--blue); transform: scale(1.06); }
  .restore:hover > span { color: var(--blue); border-color: var(--blue); background: #eef3fe; transform: rotate(-24deg); }
  .row:hover { background: #f8f6ee; }
}
.row-main { grid-area: b; min-width: 0; }
.row-main h3 { font-size: 15px; font-weight: 680; line-height: 1.32; letter-spacing: -0.006em; }
.row-main h3 a { text-decoration: none; }
.row-main h3 a:hover { color: var(--blue); }
.row-main p { margin-top: 2px; color: var(--ink-2); font-size: 13px; line-height: 1.42; overflow-wrap: anywhere; }
.row-meta {
  grid-area: d; min-width: 0;
  display: flex; align-items: center; gap: 7px 14px; flex-wrap: wrap;
}
.is-overdue { box-shadow: inset 3px 0 0 var(--red); }
.upcoming, .is-major { box-shadow: inset 3px 0 0 var(--gold); }
.update-row .check > span { border-radius: 50%; }
.due {
  padding: 5px 9px; border: 1px solid transparent; border-radius: 7px;
  font: 700 11px var(--mono); letter-spacing: 0.035em; text-transform: uppercase; white-space: nowrap;
}
.due-overdue { color: var(--red); border-color: #edb3ae; background: #fdf0ef; }
.due-today { color: white; background: var(--blue); }
.due-soon { color: var(--gold-light); background: var(--navy); }
.due-future { color: var(--ink-2); border-color: var(--line-strong); }
.stamp {
  max-width: 100%; min-height: 28px;
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--ink-3); font: 600 11px/1.35 var(--mono); letter-spacing: 0.025em;
  text-decoration: none; overflow-wrap: anywhere;
}
.stamp:hover { color: var(--blue); }
.stamp-dark { color: #9eadd2; }
.stamp-dark:hover { color: white; }
.dot { width: 7px; height: 7px; display: inline-block; flex: none; border-radius: 50%; background: var(--gold); }
.dot.ok { background: var(--green); }
.dot.stale, .dot.warn { background: #c07a00; }
.dot.off { background: #c2452d; }
.reason, .tag, .keyword {
  padding: 4px 10px; border: 1px solid; border-radius: 999px;
  font-size: 11px; font-weight: 650; letter-spacing: 0.005em; white-space: nowrap;
}
.reason-completed { color: #146231; border-color: #b5dcc2; background: #eaf6ee; }
.reason-filtered { color: var(--ink-2); border-color: var(--line-strong); background: #f5f3ea; }
.reason-aside { color: #16409f; border-color: #c3d3f5; background: #e9effc; }
.tag-school { color: #16409f; border-color: #c3d3f5; background: #e9effc; }
.tag-team { color: #146359; border-color: #acd9d1; background: #e5f5f1; }
.tag-athletics { color: #805300; border-color: #e6c677; background: #fbf3da; }
.tag-other { color: var(--ink-2); border-color: var(--line-strong); background: #f5f3ea; }
.caught-up {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: 14px; background: rgb(255 253 248 / 0.72);
}
.caught-up > span { width: 36px; height: 36px; flex: none; color: var(--green); }
.caught-up svg { width: 100%; height: 100%; }
.caught-up h3 { font-size: 15px; }
.caught-up p { margin-top: 2px; color: var(--ink-2); font-size: 13px; }
.more-note { margin: 11px 0 0; color: var(--ink-3); font-size: 12px; }
.more-note a, .show-more { color: var(--blue); font-weight: 700; }
.show-more { min-height: 44px; padding: 0; border: 0; background: transparent; }
.is-collapsed .extra-item { display: none; }

@media (min-width: 900px) {
  .task, .update-row, .archive-row {
    grid-template-columns: 48px minmax(0, 1fr) minmax(220px, auto);
    grid-template-areas: "a b d"; column-gap: 18px; padding: 14px 20px;
  }
  .task.no-control, .update-row.no-control, .archive-row.no-control {
    grid-template-columns: minmax(0, 1fr) minmax(220px, auto); grid-template-areas: "b d";
  }
  .row-meta { justify-content: flex-end; flex-wrap: nowrap; }
  .stamp { max-width: 300px; }
}

/* ---------- agenda ---------- */
.agenda { background: var(--panel); }
.day + .day { border-top: 1px solid var(--line); }
.day-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px 2px;
  font-size: 13.5px; font-weight: 750;
}
.day-head::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--gold); }
.day-marker { display: none; }
.day-head + .day-rows .row:first-child { padding-top: 9px; }
.event-row { position: relative; grid-template-columns: minmax(0, 1fr); grid-template-areas: "b" "d"; }
.event-time { display: none; grid-area: t; color: var(--ink); font: 700 11.5px var(--mono); letter-spacing: 0.035em; text-transform: uppercase; }
.event-time-inline { color: var(--ink); font: 700 11.5px var(--mono); letter-spacing: 0.025em; text-transform: uppercase; }
.event-meta { justify-content: flex-start; }
.event-meta form { display: inline-flex; margin-left: auto; }
.event-meta .icon-button { width: 44px; height: 44px; }
@media (max-width: 899.98px) {
  .event-row:has(.event-meta form) { padding-right: 64px; }
  .event-meta form { position: absolute; right: 10px; top: 50%; margin: 0; transform: translateY(-50%); }
}
.milestone-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px 12px; margin-bottom: 14px; padding: 11px 16px;
  border: 1px solid #e5c766; border-radius: 12px; box-shadow: inset 3px 0 0 var(--gold);
  color: var(--ink-2); background: #fbf3da; font-size: 13px;
}
.milestone-strip strong { color: var(--ink); }
@media (min-width: 900px) {
  .day { display: grid; grid-template-columns: 90px minmax(0, 1fr); }
  .day-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .day-marker {
    display: flex; flex-direction: column; align-items: center; padding: 15px 6px 12px; text-align: center;
  }
  .day-marker::before { content: ""; width: 7px; height: 7px; margin-bottom: 7px; flex: none; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--panel); }
  .day-marker::after { content: ""; width: 2px; flex: 1; margin-top: 9px; background: var(--line); }
  .day-marker span { color: var(--ink-3); font: 700 10px var(--mono); letter-spacing: 0.15em; }
  .day-marker strong { margin-top: 2px; font-size: 24px; line-height: 1.05; }
  .day-marker small { margin-top: 4px; color: var(--gold-deep); font: 700 10px var(--mono); letter-spacing: 0.1em; }
  .event-row {
    grid-template-columns: 70px minmax(0, 1fr) minmax(240px, auto);
    grid-template-areas: "t b d"; column-gap: 18px; padding: 14px 20px;
  }
  .event-time { display: block; }
  .event-time-inline { display: none; }
  .event-meta { justify-content: flex-end; flex-wrap: nowrap; }
}

/* ---------- calendar controls ---------- */
.calendar-controls { display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 18px; }
.range-switcher {
  position: relative; width: 100%; padding: 4px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line); border-radius: 13px; background: #e6e2d2;
}
.range-switcher a {
  min-height: 44px; padding: 0 10px; z-index: 1;
  display: flex; align-items: baseline; justify-content: center; gap: 5px;
  border-radius: 9px; color: var(--ink-2); text-decoration: none;
}
.range-switcher strong { font-size: 14.5px; font-weight: 800; }
.range-switcher span { font: 600 10px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }
.range-switcher a.is-active { color: white; background: var(--navy); box-shadow: 0 4px 12px rgb(14 28 68 / 0.16); }
.source-key { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
@media (min-width: 720px) {
  .calendar-controls { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 16px; }
  .range-switcher { width: 260px; flex: none; }
}

/* ---------- review ---------- */
.review-list { display: grid; gap: 14px; }
.review-card {
  display: grid; gap: 16px; padding: 18px;
  border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 14px; background: var(--panel);
  transition: opacity 180ms ease, transform 180ms var(--ease), border-color 150ms ease;
}
.review-body { min-width: 0; }
.review-flag {
  position: relative; padding-left: 21px; color: #805300;
  font-size: 13px; font-weight: 650; line-height: 1.45;
}
.review-flag > span { position: absolute; left: 0; top: 2px; width: 14px; height: 14px; }
.review-flag svg { width: 100%; height: 100%; }
.review-card h2 { margin-top: 8px; font-size: 17px; letter-spacing: -0.008em; }
.review-card h2 a { text-decoration: none; }
.review-card h2 a:hover { color: var(--blue); }
.review-excerpt { max-width: 66ch; margin-top: 6px; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.review-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 12px; }
.keyword { color: var(--ink-2); border-color: var(--line-strong); background: #f5f3ea; }
.review-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.review-actions form { flex: 1 1 auto; }
.review-actions .button { width: 100%; }
@media (min-width: 900px) {
  .review-card:not(.no-actions) { grid-template-columns: minmax(0, 1fr) 196px; gap: 22px; padding: 20px 22px; }
  .review-actions { flex-direction: column; justify-content: center; flex-wrap: nowrap; padding-left: 22px; border-left: 1px solid var(--line); }
  .review-actions form { flex: 0 0 auto; }
}

/* ---------- archive filters ---------- */
.filter-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 20px; }
.filter-links a {
  min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink-2); background: var(--panel);
  font-size: 12.5px; font-weight: 650; text-decoration: none; white-space: nowrap;
}
.filter-links a.is-active { color: white; border-color: var(--navy); background: var(--navy); }
.archive-section:first-of-type { margin-top: 0; }
.archived-events { margin-top: 12px; }
.archive-pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 22px; }
.archive-pager a { min-height: 44px; display: inline-flex; align-items: center; color: var(--blue); font-size: 13px; font-weight: 700; text-decoration: none; }
@media (min-width: 720px) {
  .filter-links { display: flex; flex-wrap: wrap; }
  .filter-links a { padding: 0 16px; }
}

/* ---------- empty states ---------- */
.empty {
  padding: 46px 24px; border: 2px dashed var(--line-strong); border-radius: 16px;
  background: rgb(255 253 248 / 0.6); text-align: center;
}
.empty > span { width: 46px; height: 46px; margin: 0 auto; display: inline-grid; place-items: center; color: var(--green); }
.empty > span svg { width: 100%; height: 100%; }
.empty h2 { margin-top: 12px; font-size: 16px; }
.empty p { max-width: 46ch; margin: 6px auto 0; color: var(--ink-2); font-size: 13px; }
.empty .button { margin-top: 18px; }
.compact-empty { padding: 24px; }
.compact-empty a { color: var(--blue); font-weight: 700; }

/* ---------- footer ---------- */
.site-footer {
  width: 100%; max-width: var(--maxw); margin: 6px auto 0;
  padding: 18px 16px calc(152px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px;
  border-top: 1px solid var(--line);
}
.tally { color: var(--ink-2); font: 600 11px var(--mono); letter-spacing: 0.045em; text-transform: uppercase; }
.tally b { color: var(--gold-deep); }
.footer-note { width: 100%; color: var(--ink-3); font-size: 12px; }
.footer-note a { font-weight: 650; }
@media (min-width: 720px) {
  .site-footer { padding: 22px 32px 96px; }
  .site-footer > .button { margin-left: auto; }
}

/* ---------- source drawer ---------- */
.source-drawer {
  width: min(430px, 94vw); max-width: none; height: 100dvh; max-height: none;
  margin: 0 0 0 auto; padding: 0; overflow: hidden;
  border: 0; border-left: 1px solid var(--line); color: var(--ink); background: var(--panel);
  box-shadow: -18px 0 50px rgb(10 19 48 / 0.2);
}
.source-drawer[open] { display: flex; flex-direction: column; animation: drawer-in 240ms var(--ease) both; }
.source-drawer::backdrop { background: rgb(10 19 48 / 0.48); animation: fade-in 180ms ease both; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 16.5px; }
.drawer-body { padding: 20px; overflow-y: auto; }
.drawer-section + .drawer-section { margin-top: 26px; }
.drawer-section h3 { margin-bottom: 12px; font-size: 13px; }
.drawer-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.drawer-section-head > span { color: var(--ink-3); font: 600 10px var(--mono); text-transform: uppercase; }
.drawer-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.drawer-pills span { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink-2); background: #f5f3ea; font-size: 12.5px; font-weight: 600; }
.drawer-pills.is-muted span { color: var(--ink-3); background: transparent; }
.coverage-meter { height: 6px; margin: 3px 0 12px; overflow: hidden; border-radius: 8px; background: var(--line); }
.coverage-meter span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.source-row { display: flex; align-items: flex-start; gap: 11px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.source-row:last-child { border-bottom: 0; }
.source-row > .dot { margin-top: 7px; }
.source-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.source-main strong { font-size: 13.5px; }
.source-main > span { color: var(--ink-2); font-size: 11.5px; }
.source-main small { margin-top: 4px; color: #8d4b12; font-size: 11.5px; line-height: 1.4; }
.source-off .source-main small { color: var(--red); }
.source-state { color: var(--ink-3); font: 600 10px var(--mono); text-transform: uppercase; }
.drawer-note, .readonly-note { margin-top: 14px; color: var(--ink-2); font-size: 12.5px; line-height: 1.55; }
.readonly-note { padding: 12px; border: 1px solid #e5c766; border-radius: 10px; background: #fbf3da; }
.drawer-signout { min-height: 44px; margin-top: 24px; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 700; text-decoration: none; }
.drawer-signout:hover { color: var(--blue); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 70;
  padding: 10px 10px 10px 18px; display: flex; align-items: center; gap: 14px;
  border-radius: 16px; color: white; background: var(--navy); box-shadow: 0 16px 44px rgb(10 19 48 / 0.4);
  font-size: 13.5px; animation: toast-in 240ms var(--ease) both;
}
.toast-message { min-width: 0; flex: 1; line-height: 1.4; overflow-wrap: anywhere; }
.toast-undo {
  min-height: 44px; padding: 0 16px; flex: none;
  border: 1px solid rgb(242 179 42 / 0.45); border-radius: 999px;
  color: var(--gold-light); background: rgb(242 179 42 / 0.14); font-size: 12.5px; font-weight: 700;
}
.toast-undo:hover { background: rgb(242 179 42 / 0.28); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (min-width: 720px) {
  .toast { left: 50%; right: auto; bottom: 26px; width: max-content; max-width: min(560px, calc(100% - 32px)); transform: translateX(-50%); border-radius: 999px; }
  @keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
}

/* ---------- action motion ---------- */
.is-leaving { opacity: 0 !important; transform: translateX(14px) !important; pointer-events: none; }
@keyframes flash-row { 0%, 100% { background: transparent; } 25%, 60% { background: #fbf0d0; } }
.is-flash { animation: flash-row 1.4s ease; }

/* ---------- login ---------- */
.login-body {
  min-height: 100vh;
  background:
    radial-gradient(800px 320px at 85% -10%, rgb(26 79 214 / 0.25), transparent 65%),
    linear-gradient(150deg, var(--navy-dark) 0 34%, var(--paper) 34% 100%);
}
.login-page {
  width: min(calc(100% - 32px), 960px); min-height: 100vh; min-height: 100svh; margin: 0 auto; padding: 20px 0;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
}
.login-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: white; }
.login-brand { display: inline-flex; align-items: center; gap: 11px; color: white; text-decoration: none; }
.login-brand-mark { width: 38px; height: 38px; color: var(--gold-light); }
.login-brand-mark svg { width: 100%; height: 100%; }
.login-brand > span:last-child { display: flex; flex-direction: column; }
.login-brand strong { font-size: 18px; }
.login-brand small { margin-top: 2px; color: #9ba7ca; font-size: 11px; }
.login-access { display: flex; align-items: center; gap: 8px; color: #aeb9d7; font-size: 11px; }
.login-access > span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgb(31 122 61 / 0.15); }
.login-main { display: grid; place-items: center; padding: 50px 0; }
.login-card {
  position: relative; width: min(100%, 430px); padding: 38px 40px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 22px; background: rgb(255 253 248 / 0.97);
  box-shadow: 0 28px 70px rgb(10 19 48 / 0.2);
}
.login-card::before { content: ""; position: absolute; top: 0; left: 40px; width: 48px; height: 4px; background: var(--gold); }
.login-kicker { margin-bottom: 8px; color: var(--blue); font: 750 10px var(--mono); letter-spacing: 0.13em; text-transform: uppercase; }
.login-intro h1 { font-size: 36px; line-height: 1.08; letter-spacing: -0.04em; }
.login-intro > p:last-child { margin-top: 11px; color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.login-error { display: flex; align-items: flex-start; gap: 9px; margin: 22px 0 -3px; padding: 11px 12px; border: 1px solid #e6aaa5; border-radius: 10px; color: #8f3128; background: #fdf0ef; font-size: 12px; }
.login-error > span { width: 17px; height: 17px; flex: none; }
.login-error svg { width: 100%; height: 100%; }
.login-form { display: flex; flex-direction: column; gap: 17px; margin-top: 27px; }
.login-field { display: flex; flex-direction: column; gap: 7px; }
.login-field label { font-size: 12px; font-weight: 720; }
.login-field input {
  width: 100%; height: 50px; padding: 0 14px;
  border: 1px solid #d1cec6; border-radius: 11px; outline: none;
  color: var(--ink); background: white; font-size: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.login-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(26 79 214 / 0.12); }
.login-field input[aria-invalid="true"] { border-color: #d17870; }
.password-control { position: relative; }
.password-control input { padding-right: 54px; }
.password-toggle { position: absolute; top: 3px; right: 3px; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 9px; color: var(--ink-3); background: transparent; }
.password-toggle:hover { color: var(--blue); background: #eef3fe; }
.password-toggle span, .password-toggle svg { width: 19px; height: 19px; }
.login-submit { width: 100%; height: 50px; margin-top: 3px; padding: 0 18px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 11px; color: white; background: var(--navy); font-weight: 750; box-shadow: 0 9px 20px rgb(14 28 68 / 0.18); }
.login-submit:hover { background: #172b61; }
.login-submit > span:last-child, .login-submit svg { width: 17px; height: 17px; }
.login-footer { display: flex; justify-content: center; color: var(--ink-3); }
.login-footer p { display: flex; align-items: center; gap: 8px; font-size: 10.5px; }
.login-footer p > span { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
@media (max-width: 560px) {
  .login-body { background: linear-gradient(180deg, var(--navy-dark) 0 120px, var(--paper) 120px); }
  .login-page { padding: 14px 0 18px; }
  .login-access { display: none; }
  .login-main { padding: 36px 0; }
  .login-card { padding: 32px 24px; border-radius: 18px; }
  .login-card::before { left: 24px; }
  .login-intro h1 { font-size: 32px; }
}

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