/* ─── V2 Design Tokens ─────────────────────────────────────── */
:root {
  /* ── Surface — Deep Charcoal palette ── */
  /* Semantic aliases (used throughout) */
  --bg-app:      #010203;  /* true app background — near-pure black       */
  --bg-panel:    #07090d;  /* panel surface — slightly raised              */
  --bg-elevated: #0d1016;  /* modals, drawers — higher z-surface           */
  --bg-input:    #10131a;  /* form inputs                                  */

  /* Legacy tokens — mapped to new palette for backward compat */
  --bg:          #010203;
  --bg-soft:     #07090d;
  --bg-card:     #07090d;
  --bg-elev:     #11141b;
  --bg-overlay:  rgba(1, 2, 3, 0.76);

  --line:        #1a1d24;
  --line-soft:   #141720;
  --line-strong: #2a2f3a;

  /* text */
  --text:       #e8edf7;
  --text-muted: #8a92a3;
  --text-dim:   #7b8496;
  --text-faint: #3d4454;

  /* interactive */
  --accent:      #7f8fa8;
  --accent-hot:  #aeb8ca;
  --accent-soft: rgba(174, 184, 202, 0.14);
  --focus-ring:  rgba(174, 184, 202, 0.46);

  /* stance */
  --accent-anti:    #ff3b1f;
  --accent-pro:     #2356d9;
  --accent-enacted: #5fc8a1;
  --accent-symbolic:#9b6cd1;
  --accent-pending: #f5b945;

  --anti:       #ff3b1f;
  --anti-soft:  rgba(255, 59, 31, 0.18);
  --anti-strong:#ff5a2f;
  --pro:        #2356d9;
  --pro-soft:   rgba(35, 86, 217, 0.18);
  --pro-strong: #5d86ff;
  --x-stance:   #94a3b8;
  --fa-stance:  #f59e0b;

  /* status */
  --enacted:         #5fc8a1;
  --enacted-soft:    rgba(95, 200, 161, 0.18);
  --symbolic:        #9b6cd1;
  --symbolic-soft:   rgba(155, 108, 209, 0.18);
  --pending:         #f5b945;
  --pending-soft:    rgba(245, 185, 69, 0.18);
  --dead:            #6b7280;
  --dead-soft:       rgba(107, 114, 128, 0.18);

  /* focus areas */
  --ce: #3b82f6;
  --ci: #6366f1;
  --eb: #a855f7;
  --ncs: #ec4899;
  --x-focus: #6b7280;

  /* general */
  --warn: #f59e0b;
  --ok: #22c55e;
  --err: #ef4444;

  /* sizes */
  --topbar-h: 56px;
  --bottom-tabs-h: 64px;
  --sidenav-w: 240px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* shadows */
  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow:       0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg:    0 12px 36px rgba(0, 0, 0, 0.65);
  /* panel — inner highlight + deep drop, for depth on near-black bg */
  --shadow-panel: 0 1px 0 rgba(255,255,255,0.03) inset, 0 4px 24px rgba(0,0,0,0.6);

  /* type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Menlo", "Monaco", "Cascadia Mono", monospace;
  --fs-sm: 0.78rem;
  --fs-base: 0.92rem;
  --fs-md: 1.05rem;
  --fs-lg: 1.2rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 1.9rem;

  /* z-index */
  --z-topbar: 50;
  --z-sidenav: 45;
  --z-bottom-tabs: 50;
  --z-filter-drawer: 60;
  --z-modal: 80;
  --z-search-palette: 90;
}

/* ─── Reset / globals ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg-app);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.45;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-app);
  color: var(--text);
  font-size: var(--fs-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Numeric data — tabular layout for aligned figures */
.v2-kpi-value, .v2-stat-num, [data-numeric] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 600;
  letter-spacing: -0.02em;
}
body[data-loading="true"] .v2-main { opacity: 0.4; pointer-events: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hot); }
button { cursor: pointer; font-family: inherit; touch-action: manipulation; }
input, select, textarea, button { font: inherit; color: inherit; }
kbd {
  font-family: var(--font-mono);
  font-size: 0.8em;
  padding: 1px 5px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.v2-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100px; left: 8px;
  padding: 8px 12px; background: var(--accent); color: white;
  border-radius: 6px; z-index: 999;
}
.skip-link:focus { top: 8px; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-app); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

::selection { background: rgba(79,158,255,0.25); color: var(--text); }

/* ─── Layout shell ──────────────────────────────────────────── */
.v2-app {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  min-height: 100dvh;
}

/* Topbar */
.v2-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(28px, 2.7vw, 48px);
  min-width: 0;
  width: 100%;
  height: var(--topbar-h);
  padding: 0 14px;
  background:
    linear-gradient(180deg, rgba(10, 13, 20, 0.34), rgba(3, 5, 9, 0.18));
  backdrop-filter: blur(46px) saturate(230%);
  -webkit-backdrop-filter: blur(46px) saturate(230%);
  border-bottom: 1px solid rgba(220, 230, 248, 0.10);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 18px 44px rgba(0,0,0,0.28);
}
.v2-topbar-filters {
  justify-self: start;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  padding-left: clamp(8px, 1.1vw, 22px);
}
@supports not (width: fit-content) {
  .v2-topbar-filters {
    width: auto;
  }
}
.v2-topbar-filters .v2-qfs {
  width: max-content;
  max-width: 100%;
}
.v2-topbar-filters .v2-qfs {
  position: static;
  top: auto;
  z-index: auto;
  margin: 0;
  min-height: 38px;
  padding: 0;
  gap: clamp(24px, 2vw, 36px);
  background: transparent;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  backdrop-filter: blur(28px) saturate(205%);
  -webkit-backdrop-filter: blur(28px) saturate(205%);
}
.v2-topbar-filters .v2-qfs-group {
  gap: 10px;
}
.v2-topbar-filters .v2-qfs-label {
  padding-left: 0;
  color: rgba(164, 174, 190, 0.72);
  font-size: 0.62rem;
  font-weight: 820;
  letter-spacing: 0;
}
.v2-topbar-filters .v2-qfs-seg-btn,
.v2-topbar-filters .v2-qfs-chip,
.v2-topbar-filters .v2-qfs-more {
  min-height: 30px !important;
  padding: 5px 8px !important;
  font-size: 0.72rem !important;
  font-weight: 680 !important;
}
.v2-topbar-filters .v2-qfs-seg {
  border-color: rgba(220, 230, 248, 0.14);
  background: linear-gradient(180deg, rgba(23, 29, 41, 0.34), rgba(6, 9, 15, 0.18));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.09), 0 10px 28px rgba(0,0,0,0.16);
  backdrop-filter: blur(26px) saturate(220%);
  -webkit-backdrop-filter: blur(26px) saturate(220%);
}
.v2-topbar-filters .v2-qfs-seg-btn.is-active,
.v2-topbar-filters .v2-qfs-seg-btn[aria-pressed="true"] {
  background:
    linear-gradient(180deg, rgba(72, 80, 96, 0.58), rgba(24, 29, 39, 0.74));
  color: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 8px 18px rgba(0,0,0,0.24);
}
.v2-menu-btn {
  display: flex; flex-direction: column; gap: 4px; justify-content: center; align-items: center;
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(148, 163, 184, 0.13); border-radius: 10px;
  padding: 0; color: var(--text);
}
.v2-menu-btn:hover, .v2-menu-btn:focus-visible { background: rgba(255,255,255,0.075); }
.v2-menu-btn span {
  width: 18px; height: 2px; background: currentColor; border-radius: 2px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.v2-brand {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
  max-width: 310px;
  padding-right: clamp(6px, 1vw, 14px);
}
.v2-brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.05);
  color: white; border-radius: 10px; font-weight: 760; font-size: 0.78rem;
  letter-spacing: 0.5px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 5px 14px rgba(0,0,0,0.36);
}
.v2-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.v2-brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.v2-brand-title { font-weight: 720; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-brand-sub { font-size: 0.72rem; color: #9aa5b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-topbar-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  min-width: max-content;
}
.v2-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(185, 201, 230, 0.15);
  border-radius: 11px;
  color: #dbe4f0;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 9px 26px rgba(0,0,0,0.20);
  backdrop-filter: blur(18px) saturate(185%);
  -webkit-backdrop-filter: blur(18px) saturate(185%);
}
.v2-icon-btn:hover,
.v2-icon-btn:focus-visible {
  border-color: rgba(220, 230, 248, 0.26);
  background: rgba(255,255,255,0.065);
  color: #ffffff;
  outline: none;
}
.v2-filter-trigger {
  width: auto;
  min-width: 38px;
  gap: 6px;
  padding: 0 12px;
  border-color: rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(24, 31, 45, 0.58), rgba(10, 14, 24, 0.42));
}
.v2-filter-trigger:hover,
.v2-filter-trigger:focus-visible {
  border-color: rgba(220, 230, 248, 0.30);
  background: rgba(255,255,255,0.07);
}
.v2-filter-trigger-label {
  font-size: 0.78rem;
  font-weight: 760;
  color: #dce6f5;
}
.v2-filter-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 17px; height: 17px;
  background: linear-gradient(180deg, rgba(92, 104, 126, 0.92), rgba(39, 48, 64, 0.96));
  color: white; font-size: 0.62rem; font-weight: 700;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Side nav (mobile drawer / desktop sidebar) */
.v2-sidenav {
  position: fixed; top: var(--topbar-h); left: 0;
  width: 84vw; max-width: 320px; height: calc(100dvh - var(--topbar-h));
  background: linear-gradient(180deg, rgba(9, 13, 21, 0.72), rgba(3, 5, 9, 0.88));
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  z-index: var(--z-sidenav);
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  display: flex; flex-direction: column;
  overflow-y: auto;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.025);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
}
.v2-sidenav.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
.v2-tab-list { list-style: none; padding: 10px 8px; margin: 0; flex: 0 0 auto; }
.v2-tab-list li { margin: 0; }
.v2-tab {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin: 1px 0;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none; font-size: 0.88rem; font-weight: 560;
  min-height: 40px;
  transition: background 0.15s ease, color 0.15s ease;
}
.v2-tab svg { flex-shrink: 0; opacity: 0.85; }
.v2-tab:hover { background: rgba(255,255,255,0.045); color: var(--text); }
.v2-tab[aria-selected="true"], .v2-tab.is-active {
  background: linear-gradient(180deg, rgba(105, 116, 136, 0.18), rgba(72, 82, 100, 0.09));
  color: #c7d0dd;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.055);
}
.v2-sidenav-footer {
  padding: 10px 12px 14px; border-top: 1px solid rgba(148, 163, 184, 0.10);
  display: flex; flex-direction: column; gap: 7px;
  margin-top: auto;
}
.v2-side-overview-toc {
  display: none;
  margin: 18px 14px 8px;
  border: 1px solid rgba(185, 201, 230, 0.055);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(8, 11, 17, 0.16), rgba(2, 4, 7, 0.10));
  flex: 0 0 auto;
  max-height: none;
  overflow: visible;
  box-shadow: none;
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}
body[data-view="overview"] .v2-side-overview-toc {
  display: block;
}
.v2-side-overview-toc summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 25px;
  padding: 6px 8px 5px;
  color: #7c8798;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(148, 163, 184, 0.045);
}
.v2-side-overview-toc summary em {
  color: #7f8fa8;
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 900;
}
.v2-side-overview-toc__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 8px 8px 0;
}
.v2-side-overview-toc__actions button {
  min-height: 28px;
  padding: 0 6px;
  border: 1px solid rgba(71, 85, 105, 0.52);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.7);
  color: #cbd5e1;
  font-size: 0.66rem;
  font-weight: 850;
}
.v2-side-overview-toc__actions button:hover,
.v2-side-overview-toc__actions button:focus-visible {
  border-color: rgba(220, 230, 248, 0.22);
  background: rgba(255,255,255,0.055);
  color: #fff;
}
.v2-side-overview-toc__hint {
  padding: 7px 10px 2px;
  color: #7d8798;
  font-size: 0.65rem;
  line-height: 1.25;
}
.v2-side-overview-toc__links {
  display: grid;
  gap: 1px;
  padding: 4px 5px 7px 13px;
}
.v2-side-overview-link {
  width: 100%;
  min-height: 23px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #7f8a9c;
  font-size: 0.63rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
}
.v2-side-overview-link:hover,
.v2-side-overview-link:focus-visible {
  border-color: rgba(185, 201, 230, 0.12);
  background: rgba(255,255,255,0.025);
  color: #c1c9d6;
  outline: none;
}
.v2-side-overview-link[hidden] {
  display: none !important;
}
.v2-side-footer-link {
  background: transparent; border: 1px solid var(--line);
  color: var(--text-muted); padding: 9px 11px;
  border-radius: var(--radius-sm); font-size: 0.8rem;
  text-align: left; cursor: pointer;
}
.v2-side-footer-link:hover { background: var(--bg-elev); color: var(--text); }

/* Backdrop when drawer is open */
.v2-app.has-drawer-open::before {
  content: ""; position: fixed; inset: var(--topbar-h) 0 0 0;
  background: rgba(0,0,0,0.5); z-index: calc(var(--z-sidenav) - 1);
}

/* Main */
.v2-main {
  padding: 16px 12px calc(var(--bottom-tabs-h) + 24px) 12px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  justify-self: stretch;
  overflow-x: hidden;
  transition: opacity 0.2s ease;
}
.v2-view { display: block; }
.v2-view[hidden] { display: none !important; }
.v2-view-content {
  display: flex; flex-direction: column; gap: 16px;
}
.v2-loading {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted); font-size: 0.92rem;
}
.v2-loading::after {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 10px;
  border: 2px solid var(--accent); border-top-color: transparent;
  border-radius: 50%; animation: v2-spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes v2-spin { to { transform: rotate(360deg); } }

/* Slice summary strip (always visible) */
.v2-slice-summary {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 12px;
  margin-bottom: 10px; font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.v2-slice-summary strong { color: var(--text); }
body[data-view="overview"] .v2-slice-summary {
  display: none;
}
body[data-view="overview"] .v2-main {
  padding-top: clamp(14px, 1.4vw, 22px);
}
body[data-view="overview"] .v2-view-content {
  gap: 10px;
}

/* Bottom tabs (mobile only) */
.v2-bottom-tabs {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; align-items: stretch;
  height: calc(var(--bottom-tabs-h) + env(safe-area-inset-bottom, 0));
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: rgba(13, 15, 20, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--line);
  z-index: var(--z-bottom-tabs);
}
.v2-bot-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--text-muted); font-size: 0.68rem; font-weight: 500;
  text-decoration: none; background: transparent; border: 0;
  padding: 6px 4px 4px;
  min-height: 44px;
  position: relative;
  touch-action: manipulation;
  transition: color 0.15s ease;
}
.v2-bot-tab svg { opacity: 0.75; }
.v2-bot-tab.is-active { color: var(--accent); }
.v2-bot-tab.is-active svg { opacity: 1; }
/* bright top-line indicator on active tab */
.v2-bot-tab.is-active::before {
  content: "";
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
}

/* Filter popover (anchored from the sticky topbar) */
.v2-filter-drawer {
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  right: 12px;
  left: auto;
  bottom: auto;
  width: min(560px, calc(100vw - 24px));
  max-height: min(76dvh, 720px);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: var(--z-filter-drawer);
  display: none;
  overflow: visible;
  pointer-events: none;
}
.v2-filter-drawer.is-open { display: block; }
.v2-filter-drawer-inner {
  margin-top: 0;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.58), 0 1px 0 rgba(255,255,255,0.03) inset;
  min-height: 0;
  max-height: min(76dvh, 720px);
  display: flex; flex-direction: column;
  width: 100%;
  overflow: hidden;
  pointer-events: auto;
}
.v2-filter-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  position: relative; top: auto; background: var(--bg-panel); z-index: 2;
}
.v2-filter-drawer-header h2 { margin: 0; font-size: 1rem; font-weight: 690; }
.v2-filter-drawer-body {
  padding: 12px;
  padding-bottom: 12px;
  display: flex; flex-direction: column; gap: 10px;
  overflow: auto;
}

/* Modal root */
.v2-modal-root {
  position: fixed; inset: 0;
  z-index: var(--z-modal);
  display: none;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.v2-modal-root[aria-hidden="false"] { display: block; }

/* Modal drag-to-close: smooth snap-back and dismiss transitions.
   Only applied to mobile sheet (align-items: flex-end). Desktop modals are
   centered and don't have a drag handle so we cap the transition to mobile. */
@media (max-width: 699px) {
  .v2-modal-inner {
    transition: transform 0.25s ease, opacity 0.25s ease;
    will-change: transform, opacity;
  }
}

/* Search palette */
.v2-search-palette {
  position: fixed; inset: 0;
  background: rgba(5, 6, 8, 0.70);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: var(--z-search-palette);
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 8vh 12px 12px;
}
.v2-search-palette[aria-hidden="false"] { display: flex; }
.v2-search-palette-inner {
  width: 100%; max-width: 600px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  max-height: 80vh;
}
.v2-search-input {
  width: 100%; padding: 16px 18px;
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  font-size: 1.05rem; color: var(--text); outline: none;
  font-variant-numeric: tabular-nums;
}
.v2-search-input::placeholder { color: var(--text-dim); }
.v2-search-results {
  list-style: none; margin: 0; padding: 6px 0; flex: 1;
  overflow-y: auto;
}
.v2-search-results li {
  padding: 10px 18px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  border-left: 3px solid transparent;
}
.v2-search-results li.is-focus,
.v2-search-results li:hover {
  background: var(--bg-elev); border-left-color: var(--accent);
}
.v2-search-results .res-kind {
  font-size: 0.68rem; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 0.5px; padding: 2px 6px; background: var(--bg-soft); border-radius: 4px;
}
.v2-search-results .res-title { flex: 1; font-size: 0.9rem; }
.v2-search-results .res-sub { font-size: 0.74rem; color: var(--text-muted); }
.v2-search-palette-footer {
  padding: 8px 18px; border-top: 1px solid var(--line);
  display: flex; gap: 18px; font-size: 0.72rem; color: var(--text-muted);
}

/* ─── Responsive: desktop ───────────────────────────────────── */
@media (min-width: 900px) {
  .v2-app {
    grid-template-columns: var(--sidenav-w) minmax(0, 1fr);
    grid-template-rows: var(--topbar-h) 1fr;
  }
  .v2-topbar { grid-column: 1 / -1; }
  .v2-menu-btn { display: none; }
  .v2-sidenav {
    position: sticky; top: var(--topbar-h);
    transform: translateX(0);
    width: var(--sidenav-w);
    height: calc(100dvh - var(--topbar-h));
    border-right: 1px solid var(--line);
    box-shadow: none;
  }
  .v2-app::before { display: none !important; }
  .v2-main {
    padding: 24px 28px;
    max-width: min(100%, 1920px);
    justify-self: center;
  }
  .v2-bottom-tabs { display: none; }
  .v2-filter-drawer {
    right: 24px;
    width: min(580px, calc(100vw - var(--sidenav-w) - 56px));
  }
  .v2-filter-drawer-inner {
    margin-top: 0;
    margin-left: auto;
    max-width: none;
    border-left: 1px solid var(--line-strong);
    border-top: 1px solid var(--line-strong);
  }
}

@media (max-width: 520px) {
  .v2-filter-trigger-label {
    display: none;
  }
}

@media (max-width: 1180px) {
  :root {
    --topbar-h: 94px;
  }
  .v2-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 40px 38px;
    align-content: center;
    gap: 5px 8px;
    padding-top: 5px;
    padding-bottom: 7px;
  }
  .v2-menu-btn {
    grid-column: 1;
    grid-row: 1;
  }
  .v2-brand {
    grid-column: 1 / 3;
    grid-row: 1;
  }
  .v2-topbar-actions {
    grid-column: 3;
    grid-row: 1;
  }
  .v2-topbar-filters {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    width: 100%;
    max-width: none;
    padding-left: 0;
  }
  .v2-topbar-filters .v2-qfs {
    width: 100%;
    max-width: 100%;
  }
  .v2-topbar-filters .v2-qfs-label {
    display: none;
  }
}

@media (max-width: 899px) {
  .v2-brand {
    grid-column: 2;
  }
}

@media (max-width: 560px) {
  :root {
    --topbar-h: 94px;
  }
  .v2-topbar {
    padding-left: 8px;
    padding-right: 8px;
  }
  .v2-brand {
    gap: 8px;
  }
  .v2-brand-mark {
    width: 34px;
    height: 34px;
  }
  .v2-brand-title {
    font-size: 0.94rem;
  }
  .v2-brand-sub {
    display: none;
  }
  .v2-icon-btn {
    width: 36px;
    height: 36px;
  }
  .v2-dash-switch {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }
  .v2-dash-switch-chevron {
    display: none;
  }
  .v2-dash-switch-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
  }
  .v2-filter-trigger {
    padding: 0 10px;
  }
  .v2-topbar-filters [data-qfs-group="status"] .v2-qfs-seg-btn:not(.is-active):not([aria-pressed="true"]),
  .v2-topbar-filters [data-qfs-group="stance"] {
    display: none;
  }
  .v2-topbar-filters .v2-qfs-seg-btn,
  .v2-topbar-filters .v2-qfs-chip,
  .v2-topbar-filters .v2-qfs-more {
    padding: 4px 8px !important;
    font-size: 0.64rem !important;
  }
}

@media (min-width: 1280px) {
  .v2-main { padding: 28px 36px; max-width: min(100%, 2200px); }
}
