/* Layout: a ballot-shaped single column; ward picker first, then one comparison grid per race (topics down, candidates across). */
:root {
  --ink: #12332a;          /* Forest City green, text + structure */
  --ink-soft: #4a6058;
  --ground: #f3f6f2;       /* page */
  --paper: #ffffff;        /* panels */
  --line: #d7e0da;
  --accent: #c8891a;       /* saffron, used sparingly */
  --accent-ink: #7a4f05;
  --tint: #e6eee8;
  --strong: #1d7a4c; --strong-bg: #dff1e6;
  --partial: #24658a; --partial-bg: #dcebf4;
  --mixed: #9a6410; --mixed-bg: #f8ebd3;
  --opposes: #a83a32; --opposes-bg: #f7e0dd;
  --addressed: #475a62; --addressed-bg: #e8edef;
  --engaged: #6b4fa0; --engaged-bg: #eee8f6;
  --none: #8a9a93;
  --shadow: 0 1px 2px rgba(18,51,42,.06), 0 8px 24px rgba(18,51,42,.06);
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e4efe8; --ink-soft: #9fb5ab; --ground: #0e1915; --paper: #15241e; --line: #284038;
    --accent: #e3a83c; --accent-ink: #f1c879; --tint: #1b2e27;
    --strong: #6fd19c; --strong-bg: #173a2a; --partial: #7fbfe3; --partial-bg: #16303f;
    --mixed: #e8b35a; --mixed-bg: #3a2c12; --opposes: #f08b80; --opposes-bg: #3f1c19;
    --addressed: #b3c3c9; --addressed-bg: #24333a; --engaged: #c2aef0; --engaged-bg: #2d2540; --none: #6f827a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #e4efe8; --ink-soft: #9fb5ab; --ground: #0e1915; --paper: #15241e; --line: #284038;
  --accent: #e3a83c; --accent-ink: #f1c879; --tint: #1b2e27;
  --strong: #6fd19c; --strong-bg: #173a2a; --partial: #7fbfe3; --partial-bg: #16303f;
  --mixed: #e8b35a; --mixed-bg: #3a2c12; --opposes: #f08b80; --opposes-bg: #3f1c19;
  --addressed: #b3c3c9; --addressed-bg: #24333a; --engaged: #c2aef0; --engaged-bg: #2d2540; --none: #6f827a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; line-height: 1.1; margin: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 16px; }
.label { font: 500 11px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.muted { color: var(--ink-soft); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Masthead with an eight-point star lattice */
.mast { background: var(--ink); color: var(--ground); position: relative; overflow: hidden; }
.mast::before { content: ""; position: absolute; inset: 0; opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.2'%3E%3Crect x='14' y='14' width='28' height='28'/%3E%3Crect x='14' y='14' width='28' height='28' transform='rotate(45 28 28)'/%3E%3Ccircle cx='28' cy='28' r='6'/%3E%3C/g%3E%3C/svg%3E"); }
.mast .wrap { position: relative; padding-block: 28px 30px; display: grid; gap: 18px; }
.mast-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font: 800 18px/1 var(--f-display); letter-spacing: -.01em; }
.brand svg { width: 28px; height: 28px; color: var(--accent); }
.countdown { font: 500 12px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 6px 12px; }
:root[data-theme="dark"] .countdown { border-color: var(--line); }
.mast h1 { font-size: clamp(30px, 5.4vw, 54px); font-weight: 800; letter-spacing: -.02em; max-width: 18ch; }
.mast h1 em { font-style: normal; color: var(--accent); }
.mast p { margin: 0; max-width: 62ch; color: color-mix(in srgb, var(--ground) 82%, transparent); }

.srclink { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; text-align: left; }
.srclink:hover { color: var(--accent); }
.srclink svg { width: 15px; height: 15px; vertical-align: -2px; margin-left: 4px; }

/* Ward picker */
.picker { margin-top: -18px; position: relative; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.picker .panel { padding: 20px; display: grid; gap: 16px; }
.picker-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.picker-head h2 { font-size: 22px; }
.wards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ward { text-align: left; align-content: start; background: var(--tint); border: 1px solid transparent; border-radius: var(--r); padding: 10px 12px; display: grid; gap: 2px; min-width: 0; transition: border-color .15s, background .15s; }
.ward b { font: 700 16px/1.2 var(--f-display); }
.ward span { font-size: 12.5px; line-height: 1.35; color: var(--ink-soft); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ward:hover { border-color: var(--accent); }
.ward[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.ward[aria-pressed="true"] span { color: color-mix(in srgb, var(--ground) 75%, transparent); }
.school { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }

/* Ballot */
#ballot { display: grid; gap: 20px; }
main { display: grid; gap: 28px; padding-block: 28px 56px; }
.ballot-head { display: grid; gap: 12px; justify-items: start; }
.ballot-head h2 { font-size: clamp(24px, 3.4vw, 34px); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.lv-strong { --c: var(--strong); --b: var(--strong-bg); }
.lv-partial { --c: var(--partial); --b: var(--partial-bg); }
.lv-mixed { --c: var(--mixed); --b: var(--mixed-bg); }
.lv-opposes { --c: var(--opposes); --b: var(--opposes-bg); }
.lv-addressed { --c: var(--addressed); --b: var(--addressed-bg); }
.lv-engaged { --c: var(--engaged); --b: var(--engaged-bg); }
.lv-none { --c: var(--none); --b: transparent; }
.dot { background: var(--c); }
.lv-none .dot, .dot.lv-none { background: transparent; border: 1.5px dashed var(--none); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tab { flex: none; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; }
.tab small { font: 500 11px var(--f-mono); color: var(--ink-soft); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.tab[aria-selected="true"] small { color: color-mix(in srgb, var(--ground) 70%, transparent); }

.race { display: grid; gap: 14px; }
.race-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: end; }
.race-head h3 { font-size: 24px; }
.race-head p { margin: 4px 0 0; color: var(--ink-soft); font-size: 14.5px; max-width: 70ch; }
.viewtoggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--paper); }
.viewtoggle button { border: 0; background: none; padding: 6px 12px; font-size: 13px; }
.viewtoggle button[aria-pressed="true"] { background: var(--tint); font-weight: 700; }

.meet { display: grid; gap: 10px; }
.compare-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.meet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.meet-card { display: grid; gap: 6px; align-content: start; justify-items: center; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 16px 12px 14px; box-shadow: var(--shadow); min-width: 0; transition: border-color .15s; }
.meet-card:hover { border-color: var(--accent); }
.meet-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; background: var(--tint); border: 3px solid var(--paper); box-shadow: 0 0 0 1px var(--line); margin-bottom: 4px; }
.meet-initials { display: grid; place-items: center; font: 800 34px var(--f-display); color: var(--ink-soft); }
.meet-name { font: 700 17px/1.2 var(--f-display); }
.meet-card .note { font: 500 10.5px/1.3 var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--accent-ink); }
.meet-job { font-size: 13.5px; line-height: 1.35; color: var(--ink-soft); }
.meet-tag { font-size: 13.5px; line-height: 1.35; font-style: italic; color: var(--ink); border-top: 1px solid var(--line); padding-top: 6px; margin-top: 2px; width: 100%; }
@media (max-width: 640px) { .meet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .meet-photo { width: 88px; height: 88px; } }

.tfilter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; scroll-margin-top: 12px; }
.tfilter .label { margin-right: 4px; }
.tchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; }
.tchip svg { width: 16px; height: 16px; color: var(--accent-ink); }
.tchip:hover { border-color: var(--accent); }
.tchip[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.tchip[aria-pressed="true"] svg { color: var(--accent); }

.debates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.deb { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; text-decoration: none; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 12px; }
.deb:hover { border-color: var(--accent); }

/* Grid view */
.gridwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); }
table.matrix { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line); vertical-align: top; }
.matrix thead th { position: sticky; top: 0; background: var(--paper); z-index: 2; padding: 14px 10px 12px; width: 178px; min-width: 178px; max-width: 178px; text-align: left; font-weight: 400; }
.matrix .topic { position: sticky; left: 0; z-index: 1; background: var(--paper); width: 210px; min-width: 210px; padding: 12px 14px; border-right: 1px solid var(--line); text-align: left; font-weight: 400; }
.matrix thead .topic { z-index: 3; vertical-align: bottom; }
.matrix td { padding: 8px; }
.matrix tr:last-child td, .matrix tr:last-child th { border-bottom: 0; }
.cand { display: grid; gap: 8px; justify-items: start; }
.cand button.who { border: 0; background: none; padding: 0; text-align: left; display: grid; gap: 8px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--tint); display: grid; place-items: center; font: 700 20px var(--f-display); color: var(--ink-soft); border: 2px solid var(--paper); box-shadow: 0 0 0 1px var(--line); }
.cand .name { font: 700 16px/1.2 var(--f-display); }
.cand .note { font: 500 10.5px/1.3 var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--accent-ink); }
.cand .links { display: flex; gap: 10px; font-size: 13px; color: var(--ink-soft); }
.topic-name { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; line-height: 1.25; }
.topic-name svg { width: 22px; height: 22px; flex: none; color: var(--accent-ink); margin-top: 1px; }
.topic .flag { display: inline-block; margin-top: 6px; font: 500 10px/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); border: 1px solid var(--line); padding: 2px 6px; border-radius: 4px; }
.topic button.why { margin-top: 6px; border: 0; background: none; padding: 0; font-size: 12.5px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; display: block; }
.cell { width: 100%; text-align: left; border: 1px solid transparent; background: var(--b); border-radius: 8px; padding: 9px 10px; display: grid; gap: 4px; min-height: 64px; align-content: start; font-size: 13.5px; line-height: 1.35; }
.cell .lvl { display: flex; align-items: center; gap: 6px; font: 500 10.5px/1.2 var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--c); }
.cell .txt { color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.cell .more { font-size: 12px; color: var(--ink-soft); }
.cell:hover { border-color: var(--c); }
.cell.lv-none { border: 1px dashed var(--line); color: var(--ink-soft); background: transparent; cursor: default; }
.cell.lv-none .txt { color: var(--ink-soft); }

/* Topic (card) view */
.bytopic { display: grid; gap: 14px; }
.tcard { padding: 16px; display: grid; gap: 12px; }
.tcard-head { display: grid; gap: 4px; }
.tcard-head .topic-name { font: 700 18px/1.2 var(--f-display); }
.ask { font-size: 14px; color: var(--ink-soft); margin: 0; }
.tlist { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.trow { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: start; text-align: left; border: 1px solid transparent; background: var(--b); border-radius: 10px; padding: 10px; min-width: 0; }
.trow.lv-none { background: transparent; border: 1px dashed var(--line); }
.trow .avatar { width: 40px; height: 40px; font-size: 14px; }
.trow .who { font-weight: 700; font-size: 14.5px; }
.trow .lvl { font: 500 10.5px/1.3 var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--c); display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.trow .txt { font-size: 13.5px; line-height: 1.4; margin-top: 4px; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.trow.lv-none .txt { color: var(--ink-soft); }
.nonerow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; color: var(--ink-soft); }
.nonerow .label { display: inline-flex; align-items: center; gap: 6px; }
.nonerow .p { display: inline-flex; align-items: center; gap: 6px; }
.nonerow .avatar { width: 26px; height: 26px; font-size: 10px; border-width: 1px; }

.callout { border-left: 3px solid var(--accent); background: var(--paper); padding: 12px 14px; border-radius: 0 10px 10px 0; font-size: 14.5px; }
.callout b { font-family: var(--f-display); }

/* Search */
.search { padding: 20px; display: grid; gap: 14px; }
.search h2 { font-size: 24px; }
.sbar { display: flex; gap: 8px; flex-wrap: wrap; }
.sbar input { flex: 1 1 240px; min-width: 0; font: inherit; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--ground); color: var(--ink); }
.sbar select { font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--ground); color: var(--ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--ground); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.results { display: grid; gap: 12px; }
.rcand { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.rcand-head { display: flex; align-items: center; gap: 10px; }
.rcand-head .avatar { width: 36px; height: 36px; font-size: 13px; }
.hit { font-size: 14.5px; margin: 0; padding-left: 12px; border-left: 2px solid var(--line); }
.hit mark { background: color-mix(in srgb, var(--accent) 35%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.hit .src { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

/* Ask + method */
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.ask-panel, .method { padding: 20px; display: grid; gap: 12px; align-content: start; }
.ask-panel h2, .method h2 { font-size: 22px; }
.qtext { white-space: pre-wrap; font-size: 14px; background: var(--ground); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0; max-height: 300px; overflow: auto; }
.btn { border: 1px solid var(--ink); background: var(--ink); color: var(--ground); border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 14px; justify-self: start; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.emails { display: grid; gap: 4px; font-size: 13.5px; }
.emails code { font: 500 12.5px var(--f-mono); user-select: all; word-break: break-all; }
.method ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14.5px; }
footer { border-top: 1px solid var(--line); padding-block: 20px 40px; font-size: 13px; color: var(--ink-soft); }

/* Dialog */
dialog { border: 0; padding: 0; border-radius: 16px; background: var(--paper); color: var(--ink); width: min(680px, calc(100vw - 24px)); max-height: min(86vh, 900px); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10, 25, 20, .55); }
.dlg { display: grid; grid-template-rows: auto 1fr; max-height: inherit; }
.dlg-head { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dlg-head .avatar { width: 52px; height: 52px; }
.dlg-head h3 { font-size: 20px; }
.dlg-head .x { margin-left: auto; border: 1px solid var(--line); background: none; border-radius: 999px; width: 36px; height: 36px; font-size: 18px; flex: none; }
.dlg-body { overflow: auto; padding: 16px 18px 22px; display: grid; gap: 14px; align-content: start; }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 500 11px/1.2 var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--c); background: var(--b); padding: 5px 9px; border-radius: 999px; justify-self: start; }
.lv-none.pill { border: 1px dashed var(--none); }
.ev { display: grid; gap: 4px; }
.ev blockquote { margin: 0; padding-left: 14px; border-left: 3px solid var(--accent); font-size: 15px; }
.ev .rec { margin: 0; font-size: 15px; padding-left: 14px; border-left: 3px solid var(--line); }
.ev .src { font-size: 12.5px; color: var(--ink-soft); }
.vote { display: inline-block; font: 500 11px var(--f-mono); padding: 2px 7px; border-radius: 4px; margin-right: 6px; }
.vote.FOR { background: var(--strong-bg); color: var(--strong); }
.vote.AGAINST { background: var(--opposes-bg); color: var(--opposes); }
.vote.ABSENT, .vote.RECUSED, .vote.UNCONF { background: var(--addressed-bg); color: var(--addressed); }
.ptopic { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.ptopic h4 { margin: 0; display: flex; gap: 8px; align-items: center; font: 700 15px var(--f-display); }
.ptopic h4 svg { width: 18px; height: 18px; color: var(--accent-ink); }
.empty { padding: 28px 20px; text-align: center; color: var(--ink-soft); }
@media (max-width: 640px) {
  .matrix .topic { width: 140px; min-width: 140px; padding: 10px; }
  .matrix thead th { width: 156px; min-width: 156px; max-width: 156px; }
  .matrix .topic-name svg { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Ask Noor */
:root { --noor-metal: #b9811c; --noor-glass: #fff4d6; --noor-glow: #ffd36b; --noor-ink: #12332a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --noor-metal: #e3a83c; --noor-glass: #3a2f17; --noor-glow: #ffcf5a; --noor-ink: #1b1305; } }
:root[data-theme="dark"] { --noor-metal: #e3a83c; --noor-glass: #3a2f17; --noor-glow: #ffcf5a; --noor-ink: #1b1305; }
.noor-launch { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 50; display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px 8px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--ink); color: var(--ground); font-weight: 700; font-size: 15px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.noor-launch .noor-svg { width: 40px; height: 40px; background: var(--ground); border-radius: 50%; padding: 3px; }
.noor-launch:hover { transform: translateY(-1px); }
.noor-panel { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 32px)); display: grid; grid-template-rows: auto 1fr auto auto; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.3); overflow: hidden; }
.noor-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--ink); color: var(--ground); }
.noor-head .noor-svg { width: 44px; height: 44px; background: var(--ground); border-radius: 50%; padding: 3px; flex: none; }
.noor-head > div { flex: 1; min-width: 0; }
.noor-head b { font: 800 18px/1.1 var(--f-display); display: block; }
.noor-head span { font-size: 12.5px; opacity: .8; }
.noor-x { margin-left: auto; width: 34px; height: 34px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); background: none; color: inherit; font-size: 18px; flex: none; }
.noor-log { overflow-y: auto; padding: 14px; display: grid; gap: 10px; align-content: start; background: var(--ground); }
.noor-msg { max-width: 92%; padding: 10px 12px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.noor-msg p { margin: 0 0 6px; } .noor-msg p:last-child { margin-bottom: 0; }
.noor-msg ul { margin: 4px 0 6px; padding-left: 18px; display: grid; gap: 4px; }
.noor-bot { background: var(--paper); border: 1px solid var(--line); justify-self: start; border-bottom-left-radius: 4px; }
.noor-me { background: var(--ink); color: var(--ground); justify-self: end; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.cite { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; margin: 0 1px; border-radius: 9px; background: var(--tint); color: var(--accent-ink); font: 600 11px/1 var(--f-mono); text-decoration: none; vertical-align: 2px; }
.cite:hover { background: var(--accent); color: #fff; }
.noor-src { margin-top: 6px; font-size: 13px; } .noor-src summary { cursor: pointer; color: var(--ink-soft); }
.noor-src ol { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 4px; }
.noor-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.noor-chip { border: 1px solid var(--line); background: var(--ground); border-radius: 999px; padding: 5px 10px; font-size: 13px; text-align: left; }
.noor-chip:hover { border-color: var(--accent); }
.noor-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--paper); }
.noor-form textarea { flex: 1; min-width: 0; resize: none; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--ground); color: var(--ink); max-height: 120px; }
.noor-send { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--ink); color: var(--ground); display: grid; place-items: center; flex: none; }
.noor-send svg { width: 18px; height: 18px; }
.noor-form.busy .noor-send { opacity: .4; pointer-events: none; }
.noor-foot { margin: 0; padding: 0 14px 10px; font-size: 11.5px; color: var(--ink-soft); background: var(--paper); }
.noor-err { color: var(--opposes); }
.noor-typing { display: flex; gap: 4px; } .noor-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); animation: noorblink 1.2s infinite both; }
.noor-typing i:nth-child(2) { animation-delay: .2s; } .noor-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes noorblink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (max-width: 560px) {
  .noor-panel { inset: 0; width: auto; height: auto; max-width: 100%; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .noor-head span { display: none; }
  .noor-x { width: 40px; height: 40px; font-size: 22px; }
}
@media (max-width: 560px) { body.noor-open { overflow: hidden; } }
@media (prefers-reduced-motion: reduce) { .noor-typing i { animation: none; opacity: .6; } }
.inf { font-style: normal; margin-left: 6px; padding: 1px 5px; border-radius: 4px; border: 1px dotted currentColor; opacity: .75; font: 500 9.5px/1.3 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; }
.aitoggle { margin-left: auto; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.aitoggle[aria-pressed="true"] { border-color: var(--engaged); color: var(--engaged); }
.aitoggle:hover { border-color: var(--accent); }
.scorecard { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.scorecard summary { cursor: pointer; font-weight: 700; }
.scorecard p { margin: 8px 0; }
.scorecard ul { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.scorecard li { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: start; padding: 6px; border-radius: 8px; opacity: .65; }
.scorecard li.on { opacity: 1; background: var(--tint); outline: 2px solid var(--c, var(--accent)); }
@media (max-width: 560px) { .scorecard li { grid-template-columns: 1fr; } }
