/* Orem council data site: design tokens, layout, components. Light and dark are separate, validated sets. */
:root {
  color-scheme: light;
  --bg: #f5f4f0;
  --surface-1: #ffffff;
  --surface-2: #f3f2ee;
  --surface-3: #e9e8e2;
  --border: #e3e2dc;
  --border-strong: #cfcec6;
  --text-primary: #111110;
  --text-secondary: #55544f;
  --text-muted: #85847c;
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --accent-soft: #e6f0fc;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --band: #eeede8;
  --band-alt: #f8f7f4;
  --other: #c4c3bb;
  --good: #0f7b3e;
  --good-soft: #e3f4ea;
  --bad: #c2302f;
  --bad-soft: #fbe7e6;
  --warn: #9a6400;
  --warn-soft: #fbf0d9;
  --link: #1c5cab;
  --shadow-sm: 0 1px 2px rgba(17, 17, 16, .05);
  --shadow: 0 1px 2px rgba(17, 17, 16, .04), 0 6px 20px -8px rgba(17, 17, 16, .12);
  --shadow-lg: 0 2px 4px rgba(17, 17, 16, .04), 0 18px 40px -16px rgba(17, 17, 16, .22);
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1200px;
  --header-bg: rgba(255, 255, 255, .78);
  --hero-grad: radial-gradient(1200px 400px at 10% -10%, #dcebfd 0%, rgba(220, 235, 253, 0) 60%),
               radial-gradient(900px 380px at 100% 0%, #fde6da 0%, rgba(253, 230, 218, 0) 55%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e0e0d;
    --surface-1: #181817;
    --surface-2: #1f1f1d;
    --surface-3: #2a2a27;
    --border: #2c2c29;
    --border-strong: #3b3b37;
    --text-primary: #f5f5f2;
    --text-secondary: #c3c2b7;
    --text-muted: #8f8e85;
    --accent: #3987e5;
    --accent-ink: #86b6ef;
    --accent-soft: #15263b;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --band: #22221f;
    --band-alt: #1b1b19;
    --other: #4a4a45;
    --good: #4cc884;
    --good-soft: #10291b;
    --bad: #f07a79;
    --bad-soft: #351616;
    --warn: #e8b04a;
    --warn-soft: #33270f;
    --link: #86b6ef;
    --shadow-sm: none;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 18px 40px -16px rgba(0, 0, 0, .7);
    --header-bg: rgba(14, 14, 13, .72);
    --hero-grad: radial-gradient(1200px 400px at 10% -10%, #13253c 0%, rgba(19, 37, 60, 0) 60%),
                 radial-gradient(900px 380px at 100% 0%, #301a10 0%, rgba(48, 26, 16, 0) 55%);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e0d;
  --surface-1: #181817;
  --surface-2: #1f1f1d;
  --surface-3: #2a2a27;
  --border: #2c2c29;
  --border-strong: #3b3b37;
  --text-primary: #f5f5f2;
  --text-secondary: #c3c2b7;
  --text-muted: #8f8e85;
  --accent: #3987e5;
  --accent-ink: #86b6ef;
  --accent-soft: #15263b;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --band: #22221f;
  --band-alt: #1b1b19;
  --other: #4a4a45;
  --good: #4cc884;
  --good-soft: #10291b;
  --bad: #f07a79;
  --bad-soft: #351616;
  --warn: #e8b04a;
  --warn-soft: #33270f;
  --link: #86b6ef;
  --shadow-sm: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 18px 40px -16px rgba(0, 0, 0, .7);
  --header-bg: rgba(14, 14, 13, .72);
  --hero-grad: radial-gradient(1200px 400px at 10% -10%, #13253c 0%, rgba(19, 37, 60, 0) 60%),
               radial-gradient(900px 380px at 100% 0%, #301a10 0%, rgba(48, 26, 16, 0) 55%);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font: 15.5px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
@media (max-width: 560px) { .wrap { padding: 0 16px; } }
h1, h2, h3 { letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(30px, 4.6vw, 48px); line-height: 1.06; margin: 0 0 12px; letter-spacing: -0.035em; }
h2 { font-size: 24px; line-height: 1.2; margin: 48px 0 6px; }
h3 { font-size: 16px; line-height: 1.3; margin: 0 0 4px; letter-spacing: -0.01em; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 600; color: var(--accent-ink); margin-bottom: 10px; }
.lede { color: var(--text-secondary); font-size: 18px; line-height: 1.55; max-width: 720px; margin: 0; }
.section-lede { color: var(--text-secondary); margin: 0 0 18px; max-width: 760px; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.num, .tnum { font-variant-numeric: tabular-nums; }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

/* ---------- header ---------- */
header.top {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
header.top .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text-primary); text-decoration: none; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand small { display: block; font-weight: 500; color: var(--text-muted); font-size: 11.5px; letter-spacing: 0; margin-top: -2px; }
nav.main { display: flex; gap: 2px; font-size: 14px; font-weight: 500; overflow-x: auto; scrollbar-width: none; }
nav.main::-webkit-scrollbar { display: none; }
nav.main a { color: var(--text-secondary); text-decoration: none; padding: 7px 11px; border-radius: 999px; white-space: nowrap; transition: background .15s, color .15s; }
nav.main a:hover { background: var(--surface-2); color: var(--text-primary); }
nav.main a[aria-current="page"] { background: var(--text-primary); color: var(--bg); }
.header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.search-trigger {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; min-width: 180px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-1); color: var(--text-muted);
  font: 500 13.5px "Inter", system-ui, sans-serif; cursor: pointer; text-decoration: none; transition: border-color .15s;
}
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger kbd { margin-left: auto; font: 11px ui-monospace, monospace; border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-1); color: var(--text-secondary); cursor: pointer; }
.icon-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
.menu-btn { display: none; }
@media (max-width: 1020px) {
  .search-trigger { min-width: 0; } .search-trigger span, .search-trigger kbd { display: none; }
}
@media (max-width: 860px) {
  header.top .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 8px; gap: 8px 12px; }
  nav.main { order: 3; width: 100%; margin: 0 -4px; }
}

/* ---------- hero ---------- */
.hero { background: var(--hero-grad); border-bottom: 1px solid var(--border); }
.hero .wrap { padding-top: 56px; padding-bottom: 44px; }
.page-head { padding: 36px 0 8px; }
.page-head .lede { font-size: 17px; }
main { padding-bottom: 72px; }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 32px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat-tile .k { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }
.stat-tile .v { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-tile .d { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.delta { font-weight: 600; }
.delta.down { color: var(--bad); }
.delta.up { color: var(--good); }

/* ---------- cards & grids ---------- */
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
a.card { display: block; color: inherit; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(500px, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid.three { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .grid, .grid.two { grid-template-columns: 1fr; } }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-title a { font-size: 14px; font-weight: 500; text-decoration: none; }
.explore-card .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 12px; }
.explore-card p { margin: 4px 0 0; color: var(--text-secondary); font-size: 14px; }
.fact { position: relative; padding-left: 20px; }
.fact::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 3px; background: var(--accent); }
.fact .txt { font-size: 15px; }
.fact .src { margin-top: 8px; font-size: 12.5px; color: var(--text-muted); }
.fact .src a { color: var(--text-muted); }

/* ---------- charts ---------- */
.chart-card { padding: 18px 18px 12px; display: flex; flex-direction: column; }
.chart-card .desc { color: var(--text-secondary); font-size: 13.5px; margin: 0 0 6px; }
.chart-card .big { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.chart { width: 100%; overflow: hidden; margin-top: 4px; }
.chart svg { max-width: 100%; height: auto; display: block; }
.chart-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--text-muted); margin-top: 8px; }
.chart-foot button, .linkish { background: none; border: none; padding: 0; color: var(--text-muted); cursor: pointer; font: inherit; }
.chart-foot a { color: var(--text-muted); text-decoration: none; }
.chart-foot button:hover, .chart-foot a:hover { color: var(--text-primary); }
.sources-panel { margin-top: 10px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13.5px; animation: pop .18s ease; }
.sources-panel ul { margin: 6px 0 0; padding-left: 18px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-secondary); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- controls ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 20px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary); font: 500 13px "Inter", system-ui, sans-serif; cursor: pointer; text-decoration: none; transition: all .15s; }
.chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chip.on, .chip[aria-pressed="true"] { background: var(--text-primary); color: var(--bg); border-color: var(--text-primary); }
select, input[type=search], input[type=text] {
  font: 14px "Inter", system-ui, sans-serif; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-1); color: var(--text-primary); outline: none; transition: border-color .15s, box-shadow .15s;
}
select:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=search] { min-width: 220px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ---------- tables ---------- */
.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); position: sticky; top: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.neutral { background: var(--surface-3); color: var(--text-secondary); }
.pill { display: inline-block; font-size: 11.5px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--text-secondary); }
.report { font-size: 12px; color: var(--text-muted); }
.report a { color: var(--text-muted); }

/* ---------- people ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; color: #fff; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.profile-head { display: flex; gap: 18px; align-items: center; }
.person-row { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; padding: 8px 10px; border-radius: 12px; }
.person-row:hover { background: var(--surface-2); }
.people { display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

/* ---------- meeting page ---------- */
.meeting-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 28px; align-items: start; }
.player-col { position: sticky; top: 84px; }
.player { aspect-ratio: 16 / 9; width: 100%; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: var(--shadow); }
.player iframe, .player > div { width: 100%; height: 100%; border: 0; }
@media (max-width: 1000px) { .meeting-layout { grid-template-columns: 1fr; } .player-col { position: static; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 22px 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: none; padding: 10px 14px; font: 600 14px "Inter", system-ui, sans-serif; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text-primary); border-bottom-color: var(--text-primary); }
.tabs button .count { font-weight: 500; color: var(--text-muted); margin-left: 4px; }
.tab-panel[hidden] { display: none; }
.meta-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.turn { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 12px 6px; border-radius: 12px; }
.turn:hover { background: var(--surface-1); }
.turn .who { font-weight: 650; font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.turn .who .ts { font-weight: 500; font-size: 12px; color: var(--text-muted); text-decoration: none; font-variant-numeric: tabular-nums; cursor: pointer; }
.turn .who .ts:hover { color: var(--accent-ink); }
.turn .who.unid { color: var(--text-muted); font-weight: 500; }
.turn p { margin: 2px 0 0; color: var(--text-secondary); }
.turn.active { background: var(--accent-soft); }
.transcript-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
mark { background: #ffe58f; color: #111; border-radius: 3px; padding: 0 2px; }
.notice { display: flex; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--surface-1); color: var(--text-secondary); font-size: 13.5px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; }
details > summary { cursor: pointer; color: var(--accent-ink); font-weight: 500; }
.breadcrumb { font-size: 13.5px; color: var(--text-muted); margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text-primary); }

/* ---------- trends layout ---------- */
.with-side { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 32px; align-items: start; }
.side-nav { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.side-nav a { color: var(--text-secondary); text-decoration: none; padding: 7px 12px; border-radius: 10px; font-weight: 500; }
.side-nav a:hover, .side-nav a.on { background: var(--surface-1); color: var(--text-primary); box-shadow: var(--shadow-sm); }
@media (max-width: 900px) { .with-side { grid-template-columns: 1fr; } .side-nav { position: static; flex-direction: row; flex-wrap: wrap; } }
.context-key { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); font-size: 13px; }
.context-key .k { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 4px; }
@media (max-width: 900px) { .context-key { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); padding: 36px 0 56px; color: var(--text-muted); font-size: 13px; background: var(--surface-1); }
footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
footer a { color: var(--text-secondary); text-decoration: none; }
footer a:hover { color: var(--text-primary); }
footer .cols div > a { display: block; margin: 4px 0; }
@media (max-width: 700px) { footer .cols { grid-template-columns: 1fr; } }

/* ---------- search ---------- */
.pagefind-ui { --pagefind-ui-scale: .9; --pagefind-ui-primary: var(--accent); --pagefind-ui-text: var(--text-primary); --pagefind-ui-background: var(--surface-1);
  --pagefind-ui-border: var(--border); --pagefind-ui-tag: var(--surface-2); --pagefind-ui-border-radius: 12px; --pagefind-ui-font: "Inter", system-ui, sans-serif; }

/* entrance */
.fade-in { animation: fadeUp .5s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- key moments ---------- */
.km-grid { display: grid; grid-template-columns: minmax(150px, max-content) repeat(var(--cols), minmax(34px, 1fr)); gap: 4px; align-items: stretch; overflow-x: auto; }
.km-grid button { font: 600 13px "Inter", system-ui, sans-serif; border: 0; border-radius: 8px; cursor: pointer; min-height: 34px; transition: transform .12s, box-shadow .12s; font-variant-numeric: tabular-nums; }
.km-grid .km-cell { background: var(--surface-2); }
.km-grid .km-cell:disabled { cursor: default; background: transparent !important; box-shadow: inset 0 0 0 1px var(--border); }
.km-grid .km-cell:not(:disabled):hover { transform: scale(1.06); box-shadow: var(--shadow); }
.km-grid .km-cell.on { box-shadow: 0 0 0 2px var(--text-primary); }
.km-grid .km-k { text-align: left; background: none; color: var(--text-secondary); padding: 0 10px 0 0; font-weight: 500; }
.km-grid .km-y { background: none; color: var(--text-muted); font-weight: 500; font-size: 12px; min-height: 24px; }
.km-grid .km-k:hover, .km-grid .km-y:hover, .km-grid .km-k.on, .km-grid .km-y.on { color: var(--text-primary); text-decoration: underline; }
.km-list { display: flex; flex-direction: column; }
.km-item { display: grid; grid-template-columns: 100px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.km-date { color: var(--text-muted); font-size: 13px; padding-top: 2px; }
.km-title { margin: 6px 0 2px; font-size: 14.5px; }
.km-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
@media (max-width: 600px) { .km-item { grid-template-columns: 1fr; gap: 4px; } }
