/* Theme variables — matches lakikartta.css */
#app {
  --bg: #fafaf8; --fg: #1a1a1a; --accent: #2563eb; --border: #e5e5e5;
  --card-bg: #fff; --muted: #666; --green: #16a34a; --red: #dc2626;
  --bg-alt: #f3f4f6; --bg-hover: #f0f0ee;
  --badge-silent-bg: #fde8e8; --badge-topic-bg: #fef3e2; --badge-grave-bg: #eef0f0;
  --badge-attn-bg: #fef9e7; --badge-strong-bg: #e8f8e8; --badge-impl-bg: #e8f0fe;
  --sel-bg: #dbeafe;
  color: var(--fg);
}
@media (prefers-color-scheme: dark) {
  #app {
    --bg: #0f0f0f; --fg: #e5e5e5; --accent: #60a5fa; --border: #333;
    --card-bg: #1a1a1a; --muted: #999; --green: #4ade80; --red: #f87171;
    --bg-alt: #1e1e1e; --bg-hover: #252525;
    --badge-silent-bg: #3b1c1c; --badge-topic-bg: #3b2c10; --badge-grave-bg: #2a2a2a;
    --badge-attn-bg: #3b3410; --badge-strong-bg: #1c3b1c; --badge-impl-bg: #1c2a3b;
    --sel-bg: #1e3a5f;
  }
}
[data-theme="dark"] #app {
  --bg: #0f0f0f; --fg: #e5e5e5; --accent: #60a5fa; --border: #333;
  --card-bg: #1a1a1a; --muted: #999; --green: #4ade80; --red: #f87171;
  --bg-alt: #1e1e1e; --bg-hover: #252525;
  --badge-silent-bg: #3b1c1c; --badge-topic-bg: #3b2c10; --badge-grave-bg: #2a2a2a;
  --badge-attn-bg: #3b3410; --badge-strong-bg: #1c3b1c; --badge-impl-bg: #1c2a3b;
  --sel-bg: #1e3a5f;
}
[data-theme="light"] #app {
  --bg: #fafaf8; --fg: #1a1a1a; --accent: #2563eb; --border: #e5e5e5;
  --card-bg: #fff; --muted: #666; --green: #16a34a; --red: #dc2626;
  --bg-alt: #f3f4f6; --bg-hover: #f0f0ee;
  --badge-silent-bg: #fde8e8; --badge-topic-bg: #fef3e2; --badge-grave-bg: #eef0f0;
  --badge-attn-bg: #fef9e7; --badge-strong-bg: #e8f8e8; --badge-impl-bg: #e8f0fe;
  --sel-bg: #dbeafe;
}

.he-wrap { max-width: 1200px; }

.he-header { margin-bottom: 1rem; }
.he-header h1 { font-size: 1.3rem; margin: 0 0 0.3rem; }
.he-header .meta { color: var(--muted); font-size: 0.85rem; }
.he-header .links a { margin-right: 1rem; font-size: 0.85rem; color: var(--accent); }
.stats-row { display: flex; gap: 0.8rem; flex-wrap: wrap; margin: 0.8rem 0; }
.stat-card { border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 0.8rem; text-align: center; min-width: 80px; background: var(--card-bg); }
.stat-card .val { font-size: 1.4rem; font-weight: 700; }
.stat-card .label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; }

/* IDE-style layout: sidebar + main content */
.ide-layout { display: grid; grid-template-columns: 30% 1fr; grid-template-rows: 1fr; gap: 0; height: calc(100vh - 280px); min-height: 400px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
@media (max-width: 900px) { .ide-layout { grid-template-columns: 1fr; height: auto; } }

/* Sidebar (atom tree) */
.sidebar { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; background: var(--bg-alt); border-right: 1px solid var(--border); }
.sidebar-head { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: var(--muted); padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border); letter-spacing: 0.03em; flex-shrink: 0; }
.sidebar-scroll { overflow-y: auto; flex: 1; min-height: 0; }

/* Main content pane — flex column: fixed tabs + scrollable body */
.main-pane { display: flex; flex-direction: column; overflow: hidden; min-height: 0; min-width: 0; background: var(--card-bg); }
.pane-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--card-bg); }
.pane-tab { padding: 0.45rem 1rem; font-size: 0.78rem; cursor: pointer; border: none; background: none; color: var(--muted); border-bottom: 2px solid transparent; }
.pane-tab:hover { color: var(--fg); background: var(--bg-hover); }
.pane-tab.active { color: var(--fg); border-bottom-color: var(--accent); }
.pane-tab .tab-count { font-size: 0.68rem; margin-left: 0.3rem; opacity: 0.6; }
.pane-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0.8rem 1rem; }
.pane-body.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.85rem; }

.atom-list { list-style: none; padding: 0; margin: 0; }
.atom-item { padding: 0.3rem 0.5rem; border-left: 3px solid transparent; cursor: pointer; font-size: 0.78rem; line-height: 1.3; }
.atom-item:hover { background: var(--bg-hover); }
.atom-item.selected { background: var(--sel-bg); border-left-color: var(--accent); }
.atom-type { font-size: 0.6rem; color: var(--muted); margin-right: 0.3rem; text-transform: uppercase; letter-spacing: 0.02em; }
.atom-type-PROPOSED_SECTION { color: #3b82f6; }
.atom-type-IMPACT { color: #f59e0b; }
.atom-type-CONSTITUTIONAL { color: #a855f7; }
.atom-type-FEEDBACK { color: var(--green); }
.atom-type-ALTERNATIVES { color: #14b8a6; }
.atom-type-OBJECTIVES { color: #8b5cf6; }
.atom-type-PROPOSED_STATUTE { color: #2563eb; }
.atom-type-SUMMARY { color: #0891b2; }
.atom-type-BACKGROUND { color: #64748b; }
.atom-type-CURRENT_STATE { color: #0d9488; }
.atom-type-SECTION_JUSTIFICATION { color: #6366f1; }

.atom-section { margin-bottom: 1.5rem; padding: 0.25rem 0 0; transition: background 0.3s; border-bottom: none; }
.atom-section.highlight { background: var(--sel-bg); border-radius: 4px; }
.atom-heading { font-size: 1rem; margin: 0 0 0.4rem; font-weight: 600; }
.atom-heading .atom-type { font-size: 0.62rem; vertical-align: middle; }
h4.atom-heading { font-size: 0.92rem; margin-left: 0.5rem; }
.atom-content { font-size: 0.88rem; line-height: 1.7; overflow-x: hidden; overflow-wrap: break-word; word-break: break-word; font-style: normal; }
.atom-content p, .atom-content div, .atom-content blockquote { margin-bottom: 0.7rem; max-width: none; }
.atom-content > :last-child { margin-bottom: 0; }
.atom-content em, .atom-content i { font-style: normal; }
.atom-content table { max-width: 100%; font-size: 0.85rem; overflow-x: auto; display: block; }
.atom-content img { max-width: 100%; height: auto; }
.atom-refs { font-size: 0.78rem; margin-top: 0.5rem; color: var(--muted); }
.atom-refs a { color: var(--accent); }

.expert-card { border: 1px solid var(--border); border-radius: 6px; padding: 0.6rem; margin-bottom: 0.5rem; background: var(--card-bg); }
.expert-card.SILENT { border-left: 4px solid var(--red); }
.expert-card.TOPIC_ONLY { border-left: 4px solid #f59e0b; }
.expert-card.GRAVEYARD { border-left: 4px solid var(--muted); }
.expert-card.ATTENTION { border-left: 4px solid #eab308; }
.expert-card.STRONG { border-left: 4px solid var(--green); }
.expert-card.IMPLICIT { border-left: 4px solid #3b82f6; }
.expert-name { font-weight: 600; font-size: 0.88rem; }
.expert-meta { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 3px; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; }
.badge-SILENT { background: var(--badge-silent-bg); color: var(--red); }
.badge-TOPIC_ONLY { background: var(--badge-topic-bg); color: #f59e0b; }
.badge-GRAVEYARD { background: var(--badge-grave-bg); color: var(--muted); }
.badge-ATTENTION { background: var(--badge-attn-bg); color: #eab308; }
.badge-STRONG { background: var(--badge-strong-bg); color: var(--green); }
.badge-IMPLICIT { background: var(--badge-impl-bg); color: #3b82f6; }
.badge-NO_MIETINTO { background: var(--bg-alt); color: var(--muted); }
.expert-card details { margin-top: 0.2rem; }
.expert-card summary { cursor: pointer; font-size: 0.72rem; color: var(--accent); list-style: none; }
.expert-card summary::-webkit-details-marker { display: none; }
.expert-content { font-size: 0.8rem; line-height: 1.5; margin-top: 0.4rem; max-height: 300px; overflow-y: auto; overflow-x: hidden; color: var(--fg); background: var(--bg-alt); padding: 0.6rem 0.8rem; border-radius: 4px; overflow-wrap: break-word; word-break: break-word; }
.expert-content p { margin: 0 0 0.5rem; max-width: none; }
.expert-content p:last-child { margin-bottom: 0; }

/* Noise blocks: LLM-tagged boilerplate (header/footer/signature) collapsed by default */
details.noise-block { margin: 0.1em 0; }
details.noise-block > summary {
  list-style: none; -webkit-appearance: none; appearance: none;
  cursor: pointer; display: flex; flex-direction: column; gap: 2px;
  padding: 2px 0; opacity: 0.25; transition: opacity 0.15s;
}
details.noise-block > summary::-webkit-details-marker { display: none; }
details.noise-block > summary::marker { display: none; content: ''; }
details.noise-block > summary::before,
details.noise-block > summary::after {
  content: ''; display: block; height: 0;
  border-top: 1px solid var(--muted);
}
details.noise-block > summary:hover { opacity: 0.6; }
details.noise-block[open] > summary { opacity: 0.45; }
details.noise-block > p { font-size: 0.72em; color: var(--muted); margin: 0.1em 0; }
.filter-bar { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.5rem; flex-shrink: 0; }
.filter-btn { padding: 0.25rem 0.6rem; border: 1px solid var(--border); border-radius: 4px; font-size: 0.72rem; cursor: pointer; background: var(--card-bg); color: var(--fg); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
#pane-committee summary { cursor: pointer; font-size: 0.9rem; font-weight: 600; }
.committee-text { font-size: 0.82rem; line-height: 1.6; overflow-x: hidden; padding: 0.8rem 1rem; background: var(--bg-alt); border-radius: 4px; color: var(--fg); overflow-wrap: break-word; word-break: break-word; }
.committee-text p { margin: 0 0 0.6rem; max-width: none; }
.committee-text p:last-child { margin-bottom: 0; }
#he-select { padding: 0.4rem; font-size: 0.9rem; min-width: 300px; background: var(--card-bg); color: var(--fg); border: 1px solid var(--border); border-radius: 4px; }
.loading { text-align: center; padding: 2rem; color: var(--muted); }
.chart-bar { display: flex; height: 22px; border-radius: 4px; overflow: hidden; margin: 0.4rem 0; }
.chart-bar > div { display: flex; align-items: center; justify-content: center; font-size: 0.62rem; font-weight: 600; color: #fff; min-width: 18px; }

/* Search */
.sidebar-head { display: flex; align-items: center; gap: 0.4rem; }
#he-search { flex: 1; padding: 0.3rem 0.5rem; font-size: 0.75rem; border: 1px solid var(--border); border-radius: 4px; background: var(--card-bg); color: var(--fg); min-width: 0; }
#he-search::placeholder { color: var(--muted); }
.search-result { padding: 0.35rem 0.6rem; cursor: pointer; border-bottom: 1px solid var(--border); font-size: 0.76rem; }
.search-result:hover { background: var(--bg-hover); }
.search-result-label { font-weight: 600; font-size: 0.78rem; }
.search-result-cat { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.search-result-snippet { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; line-height: 1.3; }
.search-result-snippet mark { background: #fef08a; color: #1a1a1a; border-radius: 2px; padding: 0 1px; }
.search-result-pane { display: inline-block; font-size: 0.6rem; padding: 0.1rem 0.3rem; border-radius: 3px; background: var(--bg-alt); color: var(--muted); margin-left: 0.3rem; }

/* Drift tab */
.drift-statute { margin-bottom: 0.8rem; border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 0.7rem; background: var(--card-bg); }
.drift-statute > summary { list-style: none; }
.drift-statute > summary::-webkit-details-marker { display: none; }
.drift-section { border-radius: 4px; background: var(--bg-alt); }
.drift-diff { font-size: 0.78rem; line-height: 1.6; padding: 0.5rem; margin-top: 0.3rem; background: var(--card-bg); border-radius: 4px; border: 1px solid var(--border); overflow-wrap: break-word; }
.drift-del { background: #fecaca; color: #991b1b; text-decoration: line-through; border-radius: 2px; padding: 0 2px; }
.drift-ins { background: #bbf7d0; color: #14532d; border-radius: 2px; padding: 0 2px; }
@media (prefers-color-scheme: dark) {
  .drift-del { background: #450a0a; color: #fca5a5; }
  .drift-ins { background: #052e16; color: #86efac; }
}
[data-theme="dark"] .drift-del { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .drift-ins { background: #052e16; color: #86efac; }
.drift-section details > summary::-webkit-details-marker { display: none; }

/* Law-as-diff (operation badges + diff blocks) */
.op-badge { font-size: 0.62rem; font-weight: 600; padding: 1px 5px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.03em; vertical-align: middle; }
.op-insert { background: #bbf7d0; color: #14532d; }
.op-replace { background: #fef3c7; color: #92400e; }
.op-delete { background: #fecaca; color: #991b1b; }
@media (prefers-color-scheme: dark) {
  .op-insert { background: #052e16; color: #86efac; }
  .op-replace { background: #451a03; color: #fcd34d; }
  .op-delete { background: #450a0a; color: #fca5a5; }
}
[data-theme="dark"] .op-insert { background: #052e16; color: #86efac; }
[data-theme="dark"] .op-replace { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .op-delete { background: #450a0a; color: #fca5a5; }

.law-diff { margin: 0.4rem 0 0.6rem; padding: 0.4rem 0.6rem; border-radius: 4px; font-size: 0.8rem; }
.law-diff-insert { border-left: 3px solid #22c55e; background: rgba(34,197,94,0.05); }
.law-diff-replace { border-left: 3px solid #f59e0b; }
.law-diff-delete { border-left: 3px solid #ef4444; background: rgba(239,68,68,0.05); }
.diff-label { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.diff-body { font-size: 0.78rem; line-height: 1.6; padding: 0.4rem; margin-top: 0.3rem; background: var(--card-bg); border-radius: 4px; border: 1px solid var(--border); overflow-wrap: break-word; }
.diff-del-text { color: var(--red); text-decoration: line-through; opacity: 0.8; }
.law-diff > summary { cursor: pointer; list-style: none; }
.law-diff > summary::-webkit-details-marker { display: none; }

/* Portals (inline transclusion of proposed sections in audit cards) */
.portal-block { margin-top: 0.5rem; border-top: 1px solid var(--border); padding-top: 0.4rem; }
.portal-toggle { font-size: 0.72rem; color: var(--accent); cursor: pointer; font-weight: 600; list-style: none; }
.portal-toggle::-webkit-details-marker { display: none; }
.portal-content { margin-top: 0.3rem; display: flex; flex-direction: column; gap: 0.3rem; }
.portal-card { font-size: 0.76rem; padding: 0.35rem 0.5rem; border-radius: 4px; border: 1px solid var(--border); background: var(--card-bg); line-height: 1.5; }
.portal-insert { border-left: 2px solid #22c55e; }
.portal-replace { border-left: 2px solid #f59e0b; }
.portal-delete { border-left: 2px solid #ef4444; }
.portal-text { font-size: 0.72rem; color: var(--muted); margin-top: 0.2rem; line-height: 1.4; }
.portal-expand { font-size: 0.68rem; color: var(--accent); cursor: pointer; margin-top: 0.2rem; list-style: none; }
.portal-expand::-webkit-details-marker { display: none; }
.portal-diff { font-size: 0.72rem; line-height: 1.5; padding: 0.3rem; margin-top: 0.2rem; background: var(--bg); border-radius: 3px; border: 1px solid var(--border); overflow-wrap: break-word; }
.portal-link { font-size: 0.62rem; color: var(--accent); text-decoration: none; margin-left: 0.3rem; }

/* PTK speech cards */
.ptk-card { border: 1px solid var(--border); border-radius: 6px; padding: 0.6rem; margin-bottom: 0.5rem; background: var(--card-bg); }
.ptk-card details { margin-top: 0.2rem; }
.ptk-card summary { cursor: pointer; font-size: 0.72rem; color: var(--accent); list-style: none; }
.ptk-card summary::-webkit-details-marker { display: none; }
.ptk-content { font-size: 0.8rem; line-height: 1.5; margin-top: 0.4rem; max-height: 300px; overflow-y: auto; color: var(--fg); background: var(--bg-alt); padding: 0.6rem 0.8rem; border-radius: 4px; overflow-wrap: break-word; }

/* Stance badges */
.stance-support { background: #e8f8e8; color: var(--green); }
.stance-oppose { background: #fde8e8; color: var(--red); }
.stance-procedural { background: var(--bg-alt); color: var(--muted); }
.stance-neutral { background: var(--bg-alt); color: var(--fg); }
@media (prefers-color-scheme: dark) {
  .stance-support { background: #1c3b1c; color: var(--green); }
  .stance-oppose { background: #3b1c1c; color: var(--red); }
}
[data-theme="dark"] .stance-support { background: #1c3b1c; color: var(--green); }
[data-theme="dark"] .stance-oppose { background: #3b1c1c; color: var(--red); }

/* Party badges */
.party-badge { display: inline-block; padding: 0.1rem 0.4rem; border-radius: 3px; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; background: var(--bg-alt); color: var(--muted); }

/* Tag pills (lausunto/mietinto tag summaries) */
.tag-pills { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.2rem; }
.tag-pill { font-size: 0.62rem; padding: 0.1rem 0.35rem; border-radius: 3px; font-weight: 600; }
.tag-pill-position { background: #dbeafe; color: #1d4ed8; }
.tag-pill-fact_claim { background: #fef3c7; color: #92400e; }
.tag-pill-concern { background: #fecaca; color: #991b1b; }
.tag-pill-amendment { background: #bbf7d0; color: #14532d; }
.tag-pill-reference { background: var(--bg-alt); color: var(--muted); }
.tag-pill-describes { background: var(--bg-alt); color: var(--muted); opacity: 0.7; }
@media (prefers-color-scheme: dark) {
  .tag-pill-position { background: #1e3a5f; color: #93c5fd; }
  .tag-pill-fact_claim { background: #451a03; color: #fcd34d; }
  .tag-pill-concern { background: #450a0a; color: #fca5a5; }
  .tag-pill-amendment { background: #052e16; color: #86efac; }
}
[data-theme="dark"] .tag-pill-position { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .tag-pill-fact_claim { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .tag-pill-concern { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .tag-pill-amendment { background: #052e16; color: #86efac; }

/* Discourse edge cards */
.discourse-edge { border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem; margin-bottom: 0.4rem; font-size: 0.8rem; background: var(--card-bg); }
.discourse-edge .edge-source, .discourse-edge .edge-target { line-height: 1.4; }
.discourse-edge .edge-arrow { text-align: center; color: var(--muted); font-size: 0.7rem; padding: 0.1rem 0; }

/* Dissent cards */
.dissent-card { border: 1px solid var(--border); border-left: 4px solid var(--red); border-radius: 6px; padding: 0.6rem; margin-bottom: 0.5rem; background: var(--card-bg); }
.dissent-card details { margin-top: 0.2rem; }
.dissent-card summary { cursor: pointer; font-size: 0.72rem; color: var(--accent); list-style: none; }
.dissent-card summary::-webkit-details-marker { display: none; }

/* Government badge */
.govt-badge { font-size: 0.6rem; padding: 0.1rem 0.3rem; border-radius: 3px; background: #dbeafe; color: #1d4ed8; margin-left: 0.3rem; font-weight: 600; }
@media (prefers-color-scheme: dark) { .govt-badge { background: #1e3a5f; color: #93c5fd; } }
[data-theme="dark"] .govt-badge { background: #1e3a5f; color: #93c5fd; }

/* EV decision bar */
.ev-bar { font-size: 0.78rem; padding: 0.4rem 0.6rem; margin: 0.5rem 0; border-radius: 4px; border-left: 3px solid var(--green); background: rgba(22,163,74,0.05); }

/* Span highlights — signal against noise */
.hl-text { font-size: 0.82rem; line-height: 1.7; color: var(--muted); overflow-wrap: break-word; }
.hl { color: var(--fg); border-radius: 2px; padding: 0 1px; }
.hl-concern    { background: rgba(239,68,68,0.12); border-bottom: 2px solid #ef4444; }
.hl-question   { background: rgba(168,85,247,0.12); border-bottom: 2px solid #a855f7; }
.hl-proposal   { background: rgba(34,197,94,0.12); border-bottom: 2px solid #22c55e; }
.hl-reference  { background: rgba(59,130,246,0.12); border-bottom: 2px solid #3b82f6; }
.hl-admission  { background: rgba(245,158,11,0.12); border-bottom: 2px solid #f59e0b; }
.hl-political  { background: rgba(236,72,153,0.12); border-bottom: 2px solid #ec4899; }
.hl-fiscal     { background: rgba(16,185,129,0.15); border-bottom: 2px solid #10b981; font-weight: 600; }
.hl-law_ref    { background: rgba(99,102,241,0.08); color: var(--accent); font-family: var(--font-mono, monospace); font-size: 0.9em; }
.hl-rhetoric   { opacity: 0.35; border-bottom: 1px dashed var(--muted); }
a.hl.hl-law_ref  { text-decoration: none; cursor: pointer; }
a.hl.hl-law_ref:hover { text-decoration: underline; }
a.hl.hl-reference { text-decoration: none; cursor: pointer; }
a.hl.hl-reference:hover { text-decoration: underline; }

/* Hover preview tooltips */
.hc-tooltip {
  display: none;
  position: fixed;
  z-index: 1000;
  max-width: 350px;
  padding: 0.5rem 0.7rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 0.78rem;
  line-height: 1.4;
  pointer-events: none;
}
.hc-tooltip-title { font-weight: 600; margin-bottom: 0.2rem; }
.hc-tooltip-summary { color: var(--muted); font-size: 0.72rem; margin-bottom: 0.3rem; }
.hc-tooltip-affs { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.hc-tooltip-pill { font-size: 0.62rem; padding: 0.1rem 0.3rem; border-radius: 3px; background: var(--bg-alt); color: var(--muted); }

@media (prefers-color-scheme: dark) {
  .hl-concern    { background: rgba(239,68,68,0.2); }
  .hl-question   { background: rgba(168,85,247,0.2); }
  .hl-proposal   { background: rgba(34,197,94,0.2); }
  .hl-reference  { background: rgba(59,130,246,0.2); }
  .hl-admission  { background: rgba(245,158,11,0.2); }
  .hl-political  { background: rgba(236,72,153,0.2); }
  .hl-fiscal     { background: rgba(16,185,129,0.25); }
  .hl-law_ref    { background: rgba(99,102,241,0.15); }
}
[data-theme="dark"] .hl-concern    { background: rgba(239,68,68,0.2); }
[data-theme="dark"] .hl-question   { background: rgba(168,85,247,0.2); }
[data-theme="dark"] .hl-proposal   { background: rgba(34,197,94,0.2); }
[data-theme="dark"] .hl-reference  { background: rgba(59,130,246,0.2); }
[data-theme="dark"] .hl-admission  { background: rgba(245,158,11,0.2); }
[data-theme="dark"] .hl-political  { background: rgba(236,72,153,0.2); }
[data-theme="dark"] .hl-fiscal     { background: rgba(16,185,129,0.25); }
[data-theme="dark"] .hl-law_ref    { background: rgba(99,102,241,0.15); }

/* AI capability banner */
#ai-banner { display: flex; justify-content: space-between; align-items: center;
  padding: 0.4rem 0.8rem; margin-bottom: 0.5rem; font-size: 0.75rem;
  background: linear-gradient(90deg, #eef2ff, #f0fdf4); border: 1px solid #c7d2fe;
  border-radius: 6px; color: #4338ca; }
#ai-banner button { background: none; border: none; cursor: pointer; font-size: 1rem;
  color: #6366f1; padding: 0 0.3rem; }
#ai-banner button:hover { color: #4338ca; }

/* Chrome built-in AI buttons */
.ai-actions { display: inline-flex; gap: 0.3rem; margin: 0.3rem 0; }
.ai-btn { font-size: 0.65rem; padding: 0.15rem 0.4rem; border: 1px solid var(--border);
  border-radius: 3px; background: var(--bg-alt); cursor: pointer; color: var(--muted); }
.ai-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.ai-result { font-size: 0.8rem; color: var(--fg); margin: 0.2rem 0 0.4rem;
  padding: 0.3rem 0.5rem; border-left: 2px solid var(--accent); display: none; }
.ai-result:not(:empty) { display: block; }
