/* Markets Calendar — design tokens + base styles */

:root {
  /* Type scale — Bloomberg-dense, modern SaaS */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 28px;

  /* Spacing — tight, on a 4px grid */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Light theme (default) */
  --bg: #FAFAF9;
  --bg-alt: #F4F4F2;
  --bg-elev: #FFFFFF;
  --bg-sunken: #F4F4F2;
  --bg-hover: #F4F4F2;
  --bg-selected: #EFF6FF;

  --border: #E7E5E2;
  --border-strong: #D6D3CE;
  --border-subtle: #EFEDE9;

  --text: #1C1917;
  --text-secondary: #57534E;
  --text-muted: #78716C;
  --text-soft: #A8A29E;

  --accent: #2563EB;
  --accent-soft: #DBEAFE;
  --accent-text: #1E40AF;

  --hydro: #0891B2;
  --hydro-bg: #ECFEFF;
  --hydro-border: #67E8F9;
  --hydro-strong: #155E75;

  --initiative: #6D28D9;
  --initiative-bg: #F5F3FF;
  --initiative-border: #C4B5FD;
  --initiative-strong: #4C1D95;

  --warn: #F59E0B;
  --warn-bg: #FEF3C7;

  --success: #10B981;
  --success-bg: #D1FAE5;

  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow: 0 1px 3px rgba(28, 25, 23, 0.06), 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-md: 0 4px 6px rgba(28, 25, 23, 0.05), 0 2px 4px rgba(28, 25, 23, 0.04);
  --shadow-lg: 0 10px 15px rgba(28, 25, 23, 0.06), 0 4px 6px rgba(28, 25, 23, 0.04);

  /* Density (tweakable) */
  --row-h: 32px;
  --card-pad: 12px;
  --gap: 12px;
}

[data-density="compact"] {
  --row-h: 28px;
  --card-pad: 10px;
  --gap: 10px;
  --fs-base: 12px;
}

[data-density="ultra"] {
  --row-h: 24px;
  --card-pad: 8px;
  --gap: 8px;
  --fs-base: 11.5px;
  --fs-sm: 11px;
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #0C0A09;
  --bg-alt: #1C1917;
  --bg-elev: #1C1917;
  --bg-sunken: #0C0A09;
  --bg-hover: #292524;
  --bg-selected: #1E3A8A33;

  --border: #292524;
  --border-strong: #44403C;
  --border-subtle: #1F1B19;

  --text: #FAFAF9;
  --text-secondary: #D6D3D1;
  --text-muted: #A8A29E;
  --text-soft: #78716C;

  --accent: #60A5FA;
  --accent-soft: #1E3A8A55;
  --accent-text: #93C5FD;

  --hydro: #22D3EE;
  --hydro-bg: #0E303855;
  --hydro-border: #0E7490;
  --hydro-strong: #67E8F9;

  --initiative: #A78BFA;
  --initiative-bg: #2E1A6655;
  --initiative-border: #6D28D9;
  --initiative-strong: #C4B5FD;

  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
}

/* Hydro-blue theme */
[data-theme="hydro"] {
  --bg: #F0F9FF;
  --bg-alt: #E0F2FE;
  --bg-elev: #FFFFFF;
  --bg-sunken: #E0F2FE;
  --bg-hover: #E0F2FE;
  --bg-selected: #BAE6FD;

  --border: #BAE6FD;
  --border-strong: #7DD3FC;
  --border-subtle: #DDF4FE;

  --text: #082F49;
  --text-secondary: #0C4A6E;
  --text-muted: #0369A1;
  --text-soft: #38BDF8;

  --accent: #0284C7;
  --accent-soft: #BAE6FD;
  --accent-text: #075985;

  --hydro: #0E7490;
  --hydro-bg: #CFFAFE;
  --hydro-border: #06B6D4;
  --hydro-strong: #155E75;
}

/* Terminal-green theme */
[data-theme="terminal"] {
  --font-sans: "JetBrains Mono", ui-monospace, monospace;
  --bg: #0A0E0A;
  --bg-alt: #0F1410;
  --bg-elev: #0F1410;
  --bg-sunken: #050805;
  --bg-hover: #1A2418;
  --bg-selected: #14301844;

  --border: #1A2418;
  --border-strong: #2A4226;
  --border-subtle: #131913;

  --text: #C8E6C8;
  --text-secondary: #6FB46F;
  --text-muted: #4F8050;
  --text-soft: #2F5530;

  --accent: #4ADE80;
  --accent-soft: #14301855;
  --accent-text: #86EFAC;

  --hydro: #67E8F9;
  --hydro-bg: #0E303855;
  --hydro-border: #0891B2;
  --hydro-strong: #A5F3FC;

  --warn: #FACC15;
  --warn-bg: #2A2410;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01", "ss03";
}

#root { height: 100%; }

button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font-family: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 5px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-soft); }

/* ─── App layout ──────────────────────────────────────────────── */

.app {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;
  overflow: hidden;
}

.app-body {
  display: grid;
  min-height: 0;
}

[data-sidebar="left"] .app-body { grid-template-columns: 240px 1fr; }
[data-sidebar="right"] .app-body { grid-template-columns: 1fr 240px; }
[data-sidebar="hidden"] .app-body { grid-template-columns: 1fr; }
[data-sidebar="right"] .sidebar { order: 2; border-right: none; border-left: 1px solid var(--border); }
[data-sidebar="hidden"] .sidebar { display: none; }

/* ─── Top bar ─────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 var(--sp-4);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  gap: var(--sp-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 600;
  font-size: var(--fs-md);
  letter-spacing: -0.01em;
}

.brand-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--hydro), var(--accent));
  display: grid;
  place-items: center;
  color: white;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0;
}

.brand-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.sidebar-footer {
  padding: var(--sp-3);
  border-top: 1px solid var(--border);
}
.theme-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.theme-toggle:hover {
  background: var(--bg-sunken);
  color: var(--text);
  border-color: var(--border-strong, var(--border));
}

/* ─── About / Settings modal ─────────────────────────────────── */
.settings-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 18, 22, 0.55);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  z-index: 1000;
  animation: fadein 0.15s ease-out;
}
.settings-modal {
  position: relative;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 28px 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.settings-close {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px;
  background: transparent;
  border: none; border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: grid; place-items: center;
}
.settings-close:hover { background: var(--bg-sunken); color: var(--text); }
.settings-headshot {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 4px auto 18px;
  display: block;
  border: 3px solid var(--bg-elev);
  box-shadow: 0 0 0 1px var(--border), 0 6px 18px rgba(0,0,0,0.10);
}
.settings-credit-eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.settings-credit-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.settings-credit-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* Document type tag — PJM prominent header on doc-card */
.doc-type-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  padding: 3px 7px;
  border-radius: 3px;
  margin-bottom: 6px;
}
.doc-card.hydro .doc-type-tag {
  color: var(--hydro);
  background: color-mix(in oklab, var(--hydro) 10%, var(--bg-elev));
  border-color: color-mix(in oklab, var(--hydro) 30%, var(--border));
}
/* Three modes change how loudly hydro-relevant items pop:
   - quiet:    desaturated flag, no row tint, slimmer triangle marker
   - standard: current behaviour (no overrides)
   - loud:     tinted hydro-relevant rows + cards, accent left-stripe */

[data-hydro-signal="quiet"] .hydro-flag {
  background: var(--bg-sunken);
  color: var(--text-muted);
  border-color: var(--border);
}
[data-hydro-signal="quiet"] .hydro-tri {
  opacity: 0.55;
}
[data-hydro-signal="quiet"] .meeting-row .hydro-flag,
[data-hydro-signal="quiet"] .day-section-today {
  filter: grayscale(0.45);
}

[data-hydro-signal="loud"] .meeting-row:has(.hydro-flag) {
  background: linear-gradient(90deg, color-mix(in oklab, var(--hydro) 14%, transparent) 0%, transparent 60%);
  box-shadow: inset 3px 0 0 var(--hydro);
}
[data-hydro-signal="loud"] .doc-card.hydro {
  background: color-mix(in oklab, var(--hydro) 10%, var(--bg-elev));
  box-shadow: inset 3px 0 0 var(--hydro), 0 1px 2px rgba(0,0,0,0.04);
}
[data-hydro-signal="loud"] .hydro-flag {
  font-weight: 700;
  letter-spacing: 0.02em;
  background: color-mix(in oklab, var(--hydro) 18%, var(--bg-elev));
  border-color: color-mix(in oklab, var(--hydro) 50%, transparent);
}
[data-hydro-signal="loud"] .hydro-tri {
  transform: scale(1.25);
}
[data-hydro-signal="loud"] .cal-event.hydro,
[data-hydro-signal="loud"] .week-event.hydro {
  outline: 1.5px solid var(--hydro);
  outline-offset: -1.5px;
}

.topbar-search {
  position: relative;
  flex: 1;
  max-width: 480px;
}
.topbar-search input {
  width: 100%;
  height: 32px;
  padding: 0 32px 0 32px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--fs-base);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.topbar-search input:focus {
  border-color: var(--accent);
  background: var(--bg-elev);
}
.topbar-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
  pointer-events: none;
}
.topbar-search .kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text-soft);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

.topbar-spacer { flex: 1; }

.topbar-actions { display: flex; gap: var(--sp-2); align-items: center; }

.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-secondary);
  position: relative;
  transition: background 0.12s, color 0.12s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.has-badge::after {
  content: "";
  position: absolute;
  top: 6px; right: 6px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--hydro);
  border: 1.5px solid var(--bg-elev);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: white;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
}

/* ─── Sidebar ─────────────────────────────────────────────────── */

.sidebar {
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: var(--sp-3) 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.sidebar-section { padding: 0 var(--sp-3); }

.sidebar-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  padding: 0 var(--sp-2);
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-label .add-btn {
  width: 16px; height: 16px;
  display: grid; place-items: center;
  background: transparent;
  border: none;
  color: var(--text-soft);
  border-radius: 3px;
  font-size: 14px;
  line-height: 1;
}
.sidebar-label .add-btn:hover { background: var(--bg-hover); color: var(--text); }

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px var(--sp-2);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: var(--fs-base);
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background 0.1s;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active {
  background: var(--bg-selected);
  color: var(--accent-text);
  font-weight: 500;
}
.nav-item .nav-icon {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.nav-item .nav-count {
  margin-left: auto;
  font-size: var(--fs-xs);
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.nav-item.active .nav-count { color: var(--accent-text); }

.rto-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.pinned-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 5px var(--sp-2);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  cursor: pointer;
}
.pinned-item:hover { background: var(--bg-hover); }
.pinned-item .pin-icon { color: var(--warn); flex-shrink: 0; }
.pinned-item .pin-meta {
  margin-left: auto;
  font-size: var(--fs-xs);
  color: var(--text-soft);
}

/* ─── Main content area ──────────────────────────────────────── */

.main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.main-tabs {
  display: flex;
  align-items: center;
  height: 38px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--sp-4);
  gap: var(--sp-1);
}
.tab {
  padding: 0 var(--sp-3);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-base);
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.1s;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 500;
}
.tab-count {
  font-size: var(--fs-xs);
  background: var(--bg-sunken);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}
.tab.active .tab-count {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.toolbar {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 var(--sp-4);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  gap: var(--sp-2);
}
.toolbar-group {
  display: flex;
  align-items: center;
  gap: 1px;
  background: var(--bg-sunken);
  border-radius: var(--radius);
  padding: 2px;
}
.toolbar-btn {
  height: 24px;
  padding: 0 var(--sp-2);
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background 0.1s, color 0.1s;
}
.toolbar-btn:hover { color: var(--text); }
.toolbar-btn.active {
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 var(--sp-2);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  cursor: pointer;
}
.filter-chip:hover { border-color: var(--border-strong); }
.filter-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}
.filter-chip .x { color: var(--text-soft); margin-left: 2px; }

.toolbar-spacer { flex: 1; }

.toolbar-meta {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.toolbar-meta strong { color: var(--hydro); font-weight: 600; }

/* ─── Calendar + List split ─────────────────────────────────── */

.split {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}
.split.list-collapsed {
  grid-template-columns: minmax(0, 1fr);
}
.split.list-collapsed .calendar-pane {
  border-right: none;
}

.calendar-pane {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.list-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* ─── Month grid ─────────────────────────────────────────────── */

.cal-header {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  gap: var(--sp-3);
}
.cal-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.cal-nav { display: flex; gap: 2px; align-items: center; }
.cal-nav-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
}
.cal-nav-btn:hover { background: var(--bg-hover); color: var(--text); }
.cal-today-btn {
  height: 28px;
  padding: 0 var(--sp-3);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: var(--sp-2);
}
.cal-today-btn:hover { background: var(--bg-hover); color: var(--text); }

.cal-grid {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.cal-weekday {
  padding: 6px 8px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-right: 1px solid var(--border-subtle);
}
.cal-weekday:last-child { border-right: none; }

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  background: var(--border-subtle);
  gap: 1px;
  min-height: 0;
}

.cal-day {
  background: var(--bg-elev);
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  position: relative;
  min-height: 0;
  overflow: hidden;
  transition: background 0.1s;
}
.cal-day:hover { background: var(--bg-hover); }
.cal-day.other-month { background: var(--bg); color: var(--text-soft); }
.cal-day.today .day-num {
  background: var(--accent);
  color: white;
  border-radius: 50%;
  width: 22px; height: 22px;
  display: grid; place-items: center;
}
.cal-day.selected {
  background: var(--bg-selected);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.day-num {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-bottom: 1px;
}
.cal-day.other-month .day-num { color: var(--text-soft); }
.cal-day .day-meta {
  position: absolute;
  top: 4px; right: 6px;
  font-size: 9px;
  color: var(--text-soft);
  font-weight: 600;
}

.cal-event {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: var(--fs-xs);
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 2px solid;
  background: var(--bg-sunken);
  transition: background 0.1s;
}
.cal-event:hover { filter: brightness(0.96); }
.cal-event.hydro {
  background: var(--hydro-bg);
  border-left-color: var(--hydro);
  font-weight: 500;
}
.cal-event .ev-time {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
}
.cal-event .ev-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.cal-event .ev-hydro {
  color: var(--hydro);
  font-size: 9px;
  flex-shrink: 0;
}

.cal-day-more {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  padding: 1px 5px;
  cursor: pointer;
}
.cal-day-more:hover { color: var(--text); text-decoration: underline; }

/* ─── List of meetings ──────────────────────────────────────── */

.list-header {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  gap: var(--sp-3);
}
.list-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.list-meta {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-2) 0;
}

.day-section {
  padding: 0;
}
.day-section-header {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4) var(--sp-1);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid var(--border-subtle);
}
.day-section-date {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.day-section-day {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.day-section-count {
  font-size: var(--fs-xs);
  color: var(--text-soft);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.day-section-today {
  font-size: var(--fs-xs);
  background: var(--accent);
  color: white;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meeting-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}
.meeting-row:hover { background: var(--bg-hover); }
.meeting-row.selected {
  background: var(--bg-selected);
}
.meeting-row.selected::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
}

.row-time {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.row-body { min-width: 0; }

.row-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}
.rto-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.row-title {
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hydro-flag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  background: var(--hydro-bg);
  color: var(--hydro-strong);
  border: 1px solid var(--hydro-border);
  flex-shrink: 0;
}

.row-meta-line {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-bottom: 4px;
}
.row-meta-line .dot { color: var(--text-soft); }
.row-meta-line .committee { color: var(--text-secondary); font-weight: 500; }

.row-reason {
  font-size: var(--fs-xs);
  color: var(--hydro-strong);
  background: var(--hydro-bg);
  padding: 5px var(--sp-2);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--hydro);
  margin-top: 4px;
  line-height: 1.5;
}

.row-docs {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: 6px;
  flex-wrap: wrap;
}
.row-doc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  background: var(--bg-sunken);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.row-doc.hydro {
  background: var(--hydro-bg);
  color: var(--hydro-strong);
  border-color: var(--hydro-border);
  font-weight: 500;
}
.row-doc-icon { opacity: 0.7; }

/* ─── Detail drawer / page ─────────────────────────────────── */

.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.4);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.detail-overlay.open { opacity: 1; pointer-events: auto; }

.detail-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(960px, 92vw);
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: -8px 0 24px rgba(28, 25, 23, 0.08);
}
.detail-panel.open { transform: translateX(0); }

.detail-head {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  gap: var(--sp-3);
}
.detail-head-title {
  font-size: var(--fs-md);
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.detail-hero {
  padding: var(--sp-5) var(--sp-6);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.detail-hero-tags {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.detail-hero h1 {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.detail-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  color: var(--text-secondary);
  font-size: var(--fs-base);
}
.detail-hero-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-hero-meta-item .label {
  color: var(--text-soft);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.detail-hero-actions {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 var(--sp-3);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--text);
  transition: background 0.1s;
}
.btn:hover { background: var(--bg-hover); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.btn.primary:hover { background: var(--accent); filter: brightness(1.05); }
.btn.hydro {
  background: var(--hydro);
  border-color: var(--hydro);
  color: white;
}

.section {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--border-subtle);
}
.section h3 {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-base);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.callout {
  background: var(--hydro-bg);
  border: 1px solid var(--hydro-border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  gap: var(--sp-3);
}
.callout-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--hydro);
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
}
.callout-body { font-size: var(--fs-base); line-height: 1.5; color: var(--hydro-strong); }
.callout-body .label {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

/* ── Detail-pane: hydro banner + tabs ────────────────────────── */

.hydro-banner {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  background: var(--hydro-bg);
  border: 1px solid var(--hydro-border);
  border-left: 3px solid var(--hydro);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  margin-top: var(--sp-4);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--hydro-strong);
}
.hydro-banner-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--hydro);
  color: white;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  margin-top: 1px;
}
.hydro-banner-body { flex: 1; min-width: 0; }
.hydro-banner-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
  opacity: 0.8;
}

.detail-tabs {
  display: flex;
  align-items: center;
  min-height: 38px;
  flex-shrink: 0;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border-subtle);
  padding: 0 var(--sp-6);
  gap: var(--sp-4);
  position: sticky;
  top: 0;
  z-index: 1;
}

.tab-panel {
  padding: var(--sp-5) var(--sp-6);
}
.tab-subhead {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 var(--sp-3);
}
.tab-subhead:not(:first-child) {
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-subtle);
}

/* ── Initiative tracking ─────────────────────────────────────── */

.initiative-flag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  background: var(--initiative-bg);
  color: var(--initiative-strong);
  border: 1px solid var(--initiative-border);
  flex-shrink: 0;
}
.initiative-icon { color: var(--initiative); }
.toolbar-meta strong.initiative-count { color: var(--initiative); }
.filter-chip.active.initiative {
  background: var(--initiative-bg);
  border-color: var(--initiative-border);
  color: var(--initiative-strong);
}

.initiative-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
  background: var(--bg);
  border-left: 3px solid var(--initiative);
}
.initiative-card:last-child { margin-bottom: 0; }
.initiative-card.closed {
  border-left-color: var(--border-strong);
  opacity: 0.78;
}

.initiative-card-head {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.initiative-name {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.35;
}
.initiative-name:hover { color: var(--initiative); text-decoration: underline; }
.initiative-name svg { color: var(--text-soft); flex-shrink: 0; }
.initiative-name:hover svg { color: var(--initiative); }

.initiative-status {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: var(--fs-xs);
  font-weight: 500;
  background: var(--initiative-bg);
  color: var(--initiative-strong);
  border: 1px solid var(--initiative-border);
  flex-shrink: 0;
  white-space: nowrap;
}
.initiative-status.closed {
  background: var(--bg-sunken);
  color: var(--text-muted);
  border-color: var(--border);
}

.initiative-meta {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}

.initiative-timeline { margin-top: var(--sp-3); }
.initiative-tl-track {
  position: relative;
  height: 6px;
  background: var(--bg-sunken);
  border-radius: 3px;
  margin: 4px 6px;
}
.initiative-tl-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  background: var(--initiative);
  border-radius: 3px 0 0 3px;
  opacity: 0.45;
  transition: width 0.2s;
}
.initiative-tl-track.complete .initiative-tl-fill {
  background: var(--success);
  opacity: 0.55;
  border-radius: 3px;
}
.initiative-tl-track.overdue .initiative-tl-fill {
  background: var(--warn);
  opacity: 0.55;
}
.initiative-tl-dot {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--initiative);
  transform: translate(-50%, -50%);
}
.initiative-tl-dot.start { left: 0; }
.initiative-tl-dot.end   { left: 100%; }
.initiative-tl-track.complete .initiative-tl-dot.end {
  border-color: var(--success);
  background: var(--success);
}
.initiative-tl-track.overdue .initiative-tl-dot.end {
  border-color: var(--warn);
}
.initiative-tl-today {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--text);
  transform: translateX(-50%);
  border-radius: 1px;
  box-shadow: 0 0 0 2px var(--bg);
}

.initiative-tl-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--sp-3);
  font-size: 10.5px;
  line-height: 1.3;
}
.initiative-tl-labels > span {
  display: flex;
  flex-direction: column;
}
.initiative-tl-date {
  color: var(--text);
  font-weight: 600;
  font-size: var(--fs-xs);
}
.initiative-tl-meta {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 9.5px;
  font-weight: 600;
}

.initiative-timeline-text {
  margin-top: var(--sp-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
}
.initiative-timeline-text > span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

/* ── CAISO timeline (Stage A-D vertical list) ──────────────── */

.caiso-timeline {
  margin-top: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.caiso-stage {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  position: relative;
}
.caiso-stage:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 22px;
  bottom: -12px;
  width: 1px;
  background: var(--initiative-border);
}
.caiso-stage-marker {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--initiative-bg);
  color: var(--initiative-strong);
  border: 1px solid var(--initiative-border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  z-index: 1;
}
.caiso-stage-marker.complete {
  background: var(--success);
  color: white;
  border-color: var(--success);
}
.caiso-stage-events {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 2px;
  min-width: 0;
}
.caiso-stage-event {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  line-height: 1.4;
}
.caiso-stage-event-date {
  color: var(--text-muted);
  font-weight: 600;
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.caiso-stage-event-label {
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
}
.caiso-stage-complete .caiso-stage-event-label {
  color: var(--success);
  font-weight: 600;
}

/* ── Stakeholders (doc card line + tab panel) ─────────────── */

.doc-sponsors {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}
.doc-sponsors svg { color: var(--text-soft); flex-shrink: 0; }

.stakeholders-hint {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
  line-height: 1.5;
}
.stakeholder-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
  background: var(--bg);
}
.stakeholder-group:last-child { margin-bottom: 0; }
.stakeholder-entity {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: var(--fs-base);
  margin-bottom: var(--sp-3);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text);
}
.stakeholder-entity-count {
  font-size: var(--fs-xs);
  background: var(--bg-sunken);
  color: var(--text-muted);
  padding: 1px 7px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.stakeholder-person {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: 5px 0;
  font-size: var(--fs-sm);
}
.stakeholder-person + .stakeholder-person {
  border-top: 1px dashed var(--border-subtle);
}
.stakeholder-name {
  font-weight: 500;
  color: var(--text);
}
.stakeholder-roles {
  display: inline-flex;
  gap: 4px;
}
.stakeholder-role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-sunken);
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
}
.stakeholder-email {
  margin-left: auto;
  font-size: var(--fs-xs);
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono, monospace);
  word-break: break-all;
}
.stakeholder-email:hover { text-decoration: underline; }
.stakeholder-email svg { flex-shrink: 0; }

.doc-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-2);
  cursor: pointer;
  transition: border-color 0.1s, box-shadow 0.1s;
}
.doc-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.doc-card.hydro {
  border-left: 3px solid var(--hydro);
}
.doc-icon {
  width: 32px; height: 40px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.doc-icon.hydro { background: var(--hydro-bg); color: var(--hydro-strong); border-color: var(--hydro-border); }

.doc-body { min-width: 0; }
.doc-title {
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.doc-meta {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  display: flex;
  gap: var(--sp-2);
  margin-bottom: 4px;
}
.doc-summary {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.55;
  margin-top: 6px;
}
.doc-why {
  font-size: var(--fs-xs);
  color: var(--hydro-strong);
  background: var(--hydro-bg);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  margin-top: 6px;
  line-height: 1.5;
}
.doc-why .label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
  margin-right: 4px;
}

.doc-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.doc-pages {
  font-size: var(--fs-xs);
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

/* ─── Doc Reader (split pane) ────────────────────────────── */

.reader-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: none;
}
.reader-overlay.open { display: flex; }

.reader {
  position: fixed; inset: 24px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-rows: 48px 1fr;
  z-index: 201;
  overflow: hidden;
}

.reader-head {
  display: flex;
  align-items: center;
  padding: 0 var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  gap: var(--sp-3);
}
.reader-back {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  background: transparent; border: none;
  padding: 4px 8px;
  border-radius: var(--radius);
}
.reader-back:hover { background: var(--bg-hover); color: var(--text); }
.reader-doc-title {
  font-size: var(--fs-base);
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-split {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  min-height: 0;
}

.reader-summary {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--bg-elev);
  padding: var(--sp-5);
}
.reader-summary h2 {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-xl);
  letter-spacing: -0.02em;
  font-weight: 600;
}

.reader-summary-section { margin-bottom: var(--sp-5); }
.reader-summary-section h4 {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}
.reader-summary-section p {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
}

.key-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.key-points li {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text-secondary);
}
.key-points li::before {
  content: "→";
  color: var(--hydro);
  font-weight: 700;
}

.reader-pdf {
  background: var(--bg-sunken);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.reader-pdf-toolbar {
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 var(--sp-3);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  gap: var(--sp-2);
  font-size: var(--fs-sm);
}
.reader-pdf-toolbar .pages {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.reader-pdf-toolbar .spacer { flex: 1; }

.reader-pdf-canvas {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
}

/* Synthetic PDF page */
.pdf-page {
  width: min(640px, 100%);
  aspect-ratio: 8.5/11;
  background: white;
  box-shadow: var(--shadow-md);
  border-radius: 2px;
  padding: 60px 56px;
  font-family: Georgia, "Times New Roman", serif;
  color: #222;
  font-size: 11px;
  line-height: 1.6;
  position: relative;
  overflow: hidden;
}
.pdf-page .pdf-h1 { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: #111; }
.pdf-page .pdf-meta { font-size: 9px; color: #666; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 24px; border-bottom: 1px solid #ddd; padding-bottom: 8px; }
.pdf-page .pdf-h2 { font-size: 13px; font-weight: 700; margin: 16px 0 6px; color: #222; }
.pdf-page .pdf-p { margin-bottom: 10px; text-align: justify; }
.pdf-page .pdf-list { margin: 8px 0 12px 18px; }
.pdf-page .pdf-list li { margin-bottom: 4px; }
.pdf-page .pdf-table { width: 100%; border-collapse: collapse; font-size: 10px; margin: 8px 0; }
.pdf-page .pdf-table th { background: #f0f0f0; text-align: left; padding: 4px 6px; border: 1px solid #ddd; font-weight: 600; }
.pdf-page .pdf-table td { padding: 4px 6px; border: 1px solid #ddd; }
.pdf-page .pdf-highlight { background: #FEF08A; padding: 1px 2px; }
.pdf-page .pdf-pageno { position: absolute; bottom: 24px; right: 56px; font-size: 9px; color: #888; }

/* ─── Digest banner ─────────────────────────────────────── */

.digest {
  margin: var(--sp-3) var(--sp-4) 0;
  background: linear-gradient(135deg, var(--hydro-bg), var(--accent-soft));
  border: 1px solid var(--hydro-border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--sp-3);
  align-items: center;
}
.digest-icon {
  width: 32px; height: 32px;
  background: var(--hydro);
  color: white;
  border-radius: var(--radius);
  display: grid; place-items: center;
  font-size: 14px;
}
.digest-body { min-width: 0; }
.digest-title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--hydro-strong);
  margin-bottom: 1px;
}
.digest-text {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.digest-text strong { color: var(--hydro-strong); font-weight: 600; }

/* ─── Empty state ─────────────────────────────────────── */

.empty {
  padding: 64px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-icon {
  width: 48px; height: 48px;
  margin: 0 auto var(--sp-3);
  background: var(--bg-sunken);
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-soft);
}

/* close button */
.close-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 16px;
}
.close-btn:hover { background: var(--bg-hover); color: var(--text); }

/* keyboard hint */
.kbd-hint {
  font-size: var(--fs-xs);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.kbd-hint kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  padding: 1px 5px;
  border-radius: 3px;
}

/* hydro indicator: small triangle */
.hydro-tri {
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 7px solid var(--hydro);
  vertical-align: middle;
}

/* ─── Week View ───────────────────────────────────────────────── */

.week-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.week-day-headers {
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.week-gutter-spacer { border-right: 1px solid var(--border); }

.week-day-head {
  padding: 8px 10px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.week-day-head:last-child { border-right: none; }
.week-day-head.today {
  background: var(--accent-soft);
}
.week-day-name {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.week-day-head.today .week-day-name { color: var(--accent-text); }
.week-day-num {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.week-day-head.today .week-day-num { color: var(--accent-text); }
.week-day-meta {
  font-size: 10px;
  color: var(--text-soft);
  display: flex;
  gap: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.week-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 56px repeat(7, 1fr);
  overflow-y: auto;
  position: relative;
}

.week-gutter {
  border-right: 1px solid var(--border);
  background: var(--bg-elev);
}
.week-hour-label {
  height: var(--hour-px);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 2px 6px 0 0;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
  border-bottom: 1px solid transparent;
  transform: translateY(-6px);
}

.week-day-col {
  position: relative;
  border-right: 1px solid var(--border);
  background: var(--bg-elev);
}
.week-day-col:last-child { border-right: none; }
.week-day-col.today { background: var(--accent-soft); background: color-mix(in srgb, var(--accent-soft) 35%, var(--bg-elev)); }
.week-hour-cell {
  height: var(--hour-px);
  border-bottom: 1px dashed var(--border);
}
.week-hour-cell:nth-child(2n) {
  border-bottom-style: solid;
}

.week-now-line {
  position: absolute;
  left: 0; right: 0;
  height: 0;
  border-top: 2px solid var(--accent);
  z-index: 3;
  pointer-events: none;
}
.week-now-dot {
  position: absolute;
  left: -4px; top: -5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-elev);
}

.week-event {
  position: absolute;
  border-radius: 4px;
  background: var(--bg-sunken);
  border-left: 3px solid var(--text-muted);
  padding: 4px 6px;
  font-size: 11px;
  cursor: pointer;
  overflow: hidden;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 1px;
  box-shadow: var(--shadow-sm);
  transition: filter 0.12s, transform 0.08s;
}
.week-event:hover {
  filter: brightness(0.97);
  transform: translateX(1px);
  z-index: 4;
}
.week-event.hydro {
  background: var(--hydro-bg);
  border-left-color: var(--hydro);
  border: 1px solid var(--hydro-border);
  border-left: 3px solid var(--hydro);
}
.week-event-time {
  font-size: 9px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.week-event-title {
  font-size: 11px;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
}

.week-allday {
  position: absolute;
  top: 4px; left: 2px; right: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 5;
}
.week-allday-event {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  font-size: 10px;
  border-left: 3px solid var(--text-muted);
  background: var(--bg-sunken);
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.week-allday-event.hydro {
  background: var(--hydro-bg);
  border-left-color: var(--hydro);
}

/* ─── Agenda View ─────────────────────────────────────────────── */

.agenda-pane {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
  background: var(--bg);
}

.agenda-side {
  border-right: 1px solid var(--border);
  background: var(--bg-elev);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.agenda-side-head {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.agenda-side-title {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin-bottom: 6px;
  font-weight: 600;
}
.agenda-side-sub {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.agenda-week-list {
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.agenda-week-item {
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.agenda-week-item:hover {
  background: var(--bg-hover);
}
.agenda-week-item.current {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.agenda-week-range {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}
.agenda-week-stats {
  display: flex;
  gap: 12px;
  font-size: 11px;
  margin-bottom: 4px;
}
.agenda-week-stat {
  display: flex;
  gap: 4px;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
}
.agenda-week-bar {
  display: flex;
  gap: 2px;
}
.agenda-week-tick {
  flex: 1;
  height: 3px;
  border-radius: 1px;
  background: var(--border);
}
.agenda-week-tick.filled {
  background: var(--hydro);
}

.agenda-main {
  overflow-y: auto;
  padding: var(--sp-4) 0;
}
.agenda-day {
  padding: 0 var(--sp-5);
  margin-bottom: var(--sp-5);
}
.agenda-day-stripe {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: var(--sp-3) 0;
  border-bottom: 2px solid var(--text);
  margin-bottom: 2px;
}
.agenda-day-stripe.past { border-bottom-color: var(--border); }
.agenda-day-stripe.today {
  border-bottom-color: var(--accent);
}
.agenda-stripe-num {
  font-size: 36px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.02em;
}
.agenda-day-stripe.past .agenda-stripe-num { color: var(--text-soft); }
.agenda-day-stripe.today .agenda-stripe-num { color: var(--accent); }
.agenda-stripe-month {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.agenda-stripe-weekday {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  font-weight: 500;
}
.agenda-stripe-today {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: white;
  background: var(--accent);
  padding: 3px 8px;
  border-radius: 10px;
}
.agenda-stripe-counts {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.agenda-stripe-hydro {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--hydro);
  font-weight: 600;
}
.agenda-stripe-total {
  color: var(--text-muted);
}

.agenda-rows {
  display: flex;
  flex-direction: column;
}
.agenda-row {
  display: grid;
  grid-template-columns: 80px 60px 1fr auto auto;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.agenda-row:hover { background: var(--bg-hover); }
.agenda-row.hydro {
  position: relative;
}
.agenda-row.hydro::before {
  content: "";
  position: absolute;
  left: -16px; top: 0; bottom: 0;
  width: 3px;
  background: var(--hydro);
}
.agenda-row-time {
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  font-weight: 500;
}
.agenda-row-title {
  font-size: var(--fs-base);
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agenda-row.hydro .agenda-row-title { font-weight: 600; }
.agenda-row-committee {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.agenda-row-docs {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ─── Scraped PDF frame ───────────────────────────────────── */

.reader-pdf-live {
  position: relative;
  background: #525659;
  padding: 0;
  overflow: hidden;
  display: block;
}
.reader-pdf-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
  display: block;
}
.reader-pdf-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev);
  z-index: 2;
}
.reader-pdf-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.reader-pdf-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: var(--sp-5);
  height: 100%;
  overflow: auto;
}
.reader-pdf-empty-card {
  max-width: 440px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--sp-5);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.reader-pdf-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-sunken);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  margin: 0 auto var(--sp-3);
}
.reader-pdf-empty-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.reader-pdf-empty-body {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}
.reader-pdf-empty-body code {
  background: var(--bg-sunken);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 11px;
}

