/* ==========================================================================
   GTM AGENT — PARTNERSHIP DESK DESIGN SYSTEM
   Visual language: approved editorial workspace (v3)
   Paper surface · hairline rules · zero radius · Chivo + Chivo Mono
   Accent: warm mustard #c9a227 · stage semantics in muted ledger hues
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Surfaces — warm paper */
  --bg: #f4f1e8;
  --panel: #faf8f2;
  --panel2: #ece8db;
  --wash: #e7e2d5;
  --border: #d5cfc0;
  --rule: #d5cfc0;

  /* Ink */
  --text: #17161a;
  --ink: #17161a;
  --muted: #5f5b52;
  --dim: #5f5b52;

  /* Brand & accent */
  --accent: #c9a227;
  --accent-ink: #191400;
  --accent-text: #856b1a;

  /* Semantic feedback — ledger hues that hold 4.5:1 on paper */
  --green: #2f6b4c;
  --good: #2f6b4c;
  --blue: #35618f;
  --red: #93472f;

  /* Font stacks */
  --font-stack: 'Chivo', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Chivo Mono', monospace;
}

/* --------------------------------------------------------------------------
   Global typography & base
   -------------------------------------------------------------------------- */
body {
  background: var(--bg);
  color: var(--text);
  font: 13.5px/1.5 var(--font-stack);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-stack);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}

a {
  color: var(--accent-text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 130ms ease, color 130ms ease;
}
a:hover {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

::selection {
  background: rgba(201, 162, 39, 0.28);
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* --------------------------------------------------------------------------
   Header — ruled masthead
   -------------------------------------------------------------------------- */
header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 20px;
  padding: 14px 26px 13px;
  border-bottom: 2px solid var(--ink);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 320px;
}

.brand-title {
  display: flex;
  align-items: baseline;
  gap: 11px;
}

#appTitle {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desk-badge {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.sub {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
}

.gtm-brain-select {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--rule);
  padding: 0 4px 0 11px;
  height: 30px;
  transition: border-color 150ms ease;
}
.gtm-brain-select:hover {
  border-color: var(--accent);
}

.brain-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: border-color 130ms ease;
}
.brain-label:hover {
  border-bottom-color: var(--accent);
}

#kitSel {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-stack);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 4px;
  margin: 0;
  width: auto;
  max-width: 240px;
  outline: none;
}
#kitSel option {
  background: var(--panel);
  color: var(--text);
}

.model-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 0;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--good);
  flex-shrink: 0;
}
.model-badge:empty {
  display: none;
}

#crmBtn.on {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Main grid & numbered section markers
   -------------------------------------------------------------------------- */
main {
  display: grid;
  grid-template-columns: 336px minmax(0, 1fr);
  gap: 0 26px;
  padding: 22px 26px 48px;
  align-items: start;
}

aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.section-marker, .queue-head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 12px;
}

.queue-head {
  margin-bottom: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

.marker-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent-text);
  font-weight: 500;
}

.marker-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

aside .section-card {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

aside .card h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  color: var(--text);
}

#detail {
  min-width: 0;
}

#detail > h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-transform: none;
  margin-bottom: 6px;
}

#pipeline {
  border-top: 0;
}

/* --------------------------------------------------------------------------
   Forms & buttons — underline fields, square buttons
   -------------------------------------------------------------------------- */
input, select {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  color: var(--text);
  padding: 8px 2px;
  margin-bottom: 8px;
  font: inherit;
  transition: border-color 130ms ease;
}

select {
  border: 1px solid var(--rule);
  padding: 8px 10px;
  cursor: pointer;
}

textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--text);
  padding: 10px 12px;
  margin-bottom: 10px;
  font: inherit;
  min-height: 100px;
  resize: vertical;
  line-height: 1.55;
  transition: border-color 130ms ease;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: none;
}

input:disabled, textarea:disabled {
  color: var(--muted);
  background: transparent;
}

input::placeholder, textarea::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

button {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 0;
  padding: 10px 16px;
  font: 600 13px/1 var(--font-stack);
  cursor: pointer;
  transition: filter 130ms ease, background 130ms ease, color 130ms ease, border-color 130ms ease;
}

button:hover {
  filter: brightness(1.05);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--rule);
}

button.secondary:hover {
  filter: none;
  background: var(--wash);
  border-color: var(--rule);
}

button.ghost {
  background: transparent;
  color: var(--accent-text);
  border: 0;
  font-size: 12.5px;
  padding: 6px 2px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
}

button.ghost:hover {
  filter: none;
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin-top: 6px;
  text-wrap: pretty;
}

.hint code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--wash);
  padding: 1px 5px;
}

.empty {
  color: var(--muted);
  padding: 44px 24px;
  text-align: center;
  font-size: 13.5px;
}

/* --------------------------------------------------------------------------
   Pipeline queue — ruled rows with stage rail
   -------------------------------------------------------------------------- */
.school-card {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-left: 3px solid transparent;
  border-radius: 0;
  padding: 12px 12px 13px 13px;
  cursor: pointer;
  transition: background 130ms ease, border-color 130ms ease;
  margin-bottom: 0;
}

.school-card:hover {
  background: var(--wash);
  border-left-color: var(--rule);
}

.school-card.active {
  background: var(--wash);
  border-left: 3px solid var(--accent);
  box-shadow: none;
}

.school-card .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 9px;
}

.school-card b {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.school-card .city {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.score-pill {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.score-hi {
  color: var(--good);
  border: 0;
  background: transparent;
}
.score-mid {
  color: var(--accent-text);
  border: 0;
  background: transparent;
}
.score-lo {
  color: var(--red);
  border: 0;
  background: transparent;
}

.status-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0;
  border: 0;
  border-radius: 0;
  margin-top: 7px;
  background: transparent;
  color: var(--blue);
  font-family: var(--font-stack);
}

.status-responded, .status-meeting_done {
  color: var(--good);
  border: 0;
  background: transparent;
}

.status-mou_drafted, .status-signed {
  color: var(--accent-text);
  border: 0;
  background: transparent;
}

.status-opted_out {
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Detail head & editorial tabs
   -------------------------------------------------------------------------- */
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 16px;
  margin-bottom: 14px;
}

.detail-head h2 {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  text-transform: none;
}

.detail-head .city {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
}

.detail-head a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-text);
}

.tabs {
  display: flex;
  gap: 0;
  margin: 16px 0 0;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0;
  flex-wrap: wrap;
}

.tabs button {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-family: var(--font-stack);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 11px 0 10px;
  margin-right: 20px;
  cursor: pointer;
  transition: color 130ms ease, border-color 130ms ease;
}

.tabs button:hover {
  filter: none;
  color: var(--ink);
  border-bottom-color: transparent;
}

.tabs button.on {
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  border-bottom: 2px solid var(--ink);
}

.tabpane {
  padding-top: 18px;
  animation: fade 180ms ease;
}
@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Scorebar, verdict, chips, hooks, facts
   -------------------------------------------------------------------------- */
.scorebar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px 18px;
  margin: 4px 0 16px;
}

.scorebar .sc {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0 0 4px;
  text-align: left;
}

.sc .sc-bar {
  display: block;
  height: 3px;
  margin: 0 0 8px;
  background: var(--wash);
  overflow: hidden;
}

.sc .sc-bar span {
  display: block;
  height: 100%;
  margin: 0;
  background: var(--accent);
}

.sc .sc-bar .sc-fill-lo {
  background: rgba(201, 162, 39, 0.5);
}

.sc b {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  display: block;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.sc span {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-top: 5px;
  font-family: var(--font-stack);
}

.verdict {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 16px 0;
}

.verdict-col {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}

.verdict-col h4 {
  width: 100%;
  font-size: 11.5px;
  margin-bottom: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-stack);
}

.chip {
  display: inline-block;
  font-size: 12.5px;
  padding: 4px 9px;
  border-radius: 0;
  border: 1px solid;
  line-height: 1.4;
  font-weight: 400;
  margin-right: 4px;
  margin-bottom: 4px;
  background: transparent;
  font-family: var(--font-stack);
}

.chip-yes {
  color: var(--good);
  border-color: rgba(47, 107, 76, 0.5);
  background: transparent;
}

.chip-no {
  color: var(--red);
  border-color: rgba(147, 71, 47, 0.45);
  background: transparent;
}

.hooks {
  list-style: none;
  padding: 0;
  margin: 10px 0 14px;
  display: grid;
  gap: 0;
}

.hooks li {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-left: 2px solid var(--accent);
  border-radius: 0;
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  text-wrap: pretty;
}

.angle-box {
  background: var(--wash);
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 0;
  padding: 14px 18px;
  margin: 14px 0;
}

.angle-box b {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent-text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}

.angle-box p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  text-wrap: pretty;
}

.kv {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 0 20px;
  font-size: 13.5px;
  margin: 16px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.kv dt {
  color: var(--muted);
  font-size: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-stack);
}

.kv dd {
  color: var(--text);
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  min-width: 0;
  overflow-wrap: break-word;
}

/* Collapsible evidence / configuration panels */
details summary {
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  transition: color 130ms ease;
}
details summary:hover {
  color: var(--ink);
}
details[open] summary {
  border-bottom-color: transparent;
}

/* --------------------------------------------------------------------------
   Human review gate — solid accent band
   -------------------------------------------------------------------------- */
.gate {
  background: var(--accent);
  border: 0;
  border-radius: 0;
  padding: 15px 18px 16px;
  font-size: 13.5px;
  margin: 14px 0;
  color: var(--accent-ink);
  box-shadow: none;
  text-wrap: pretty;
}

.gate b {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11.5px;
  display: inline-block;
  margin-bottom: 4px;
  color: var(--accent-ink);
}

.gate label {
  font-size: 13px;
  color: var(--accent-ink);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-stack);
  margin: 0;
}

.gate input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent-ink);
}

.gate textarea {
  background: var(--accent-ink);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 0;
  padding: 10px 12px;
  margin: 8px 0;
  font-family: var(--font-stack);
}
.gate textarea::placeholder {
  color: rgba(255, 255, 255, 0.6);
}
.gate textarea:focus {
  border-color: rgba(255, 255, 255, 0.55);
}

.gate button {
  background: var(--accent-ink);
  color: var(--accent);
  border: 1px solid var(--accent-ink);
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 0;
}
.gate button:hover {
  filter: brightness(1.35);
}

.gate button.ghost {
  background: transparent;
  color: var(--accent-ink);
  border: 1px solid var(--accent-ink);
}
.gate button.ghost:hover {
  filter: none;
  background: rgba(25, 20, 0, 0.08);
}

/* --------------------------------------------------------------------------
   Follow-up sequence — ledger rows
   -------------------------------------------------------------------------- */
.followup {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-left: 3px solid transparent;
  border-radius: 0;
  padding: 14px 0 15px 12px;
  margin: 0;
  transition: border-color 150ms ease;
}

.followup .fh {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.followup .angle {
  color: var(--accent-text);
  font-weight: 500;
  text-transform: none;
  font-family: var(--font-stack);
  font-size: 12.5px;
  text-align: right;
}

.followup.sent {
  border-left: 3px solid var(--good);
  background: transparent;
}

.followup.sent .fh {
  color: var(--good);
}

.btnrow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 14px 0;
}

/* --------------------------------------------------------------------------
   Markdown deliverables (deck, meeting brief, MOU)
   -------------------------------------------------------------------------- */
.md {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 20px 24px;
  margin-top: 14px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.62;
}

.md h1 {
  font-size: 19px;
  margin: 14px 0 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
}
.md h1:first-child {
  margin-top: 0;
}

.md h2 {
  font-size: 15px;
  margin: 16px 0 8px;
  font-weight: 600;
  color: var(--text);
}

.md h3 {
  font-size: 13.5px;
  margin: 14px 0 6px;
  font-weight: 600;
}

.md p {
  margin-bottom: 10px;
  text-wrap: pretty;
}

.md table {
  border-collapse: collapse;
  margin: 12px 0;
  width: 100%;
}

.md td, .md th {
  border: 1px solid var(--rule);
  padding: 8px 12px;
  font-size: 13px;
  text-align: left;
}

.md th {
  background: var(--wash);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-family: var(--font-stack);
  font-weight: 600;
}

.md blockquote {
  border-left: 3px solid var(--accent);
  background: var(--wash);
  padding: 10px 14px;
  margin: 12px 0;
  border-radius: 0;
  color: var(--text);
}

.md ul, .md ol {
  margin-left: 20px;
  margin-bottom: 12px;
}

.md code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--wash);
  padding: 1px 5px;
}

.md hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 12px 0;
}

/* --------------------------------------------------------------------------
   Activity log — timestamped ledger
   -------------------------------------------------------------------------- */
.log {
  margin-top: 26px;
  border-top: 2px solid var(--ink);
  padding-top: 12px;
}

.log h3 {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  font-family: var(--font-stack);
}

.log div {
  font-size: 12.5px;
  color: var(--muted);
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-mono);
}

.log b {
  color: var(--text);
  font-family: var(--font-stack);
  font-weight: 500;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   CRM table view
   -------------------------------------------------------------------------- */
table.crm {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  margin-top: 12px;
}

table.crm th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding: 9px 12px;
  border-bottom: 2px solid var(--ink);
  background: var(--bg);
  position: sticky;
  top: 0;
  font-family: var(--font-stack);
}

table.crm td {
  padding: 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

table.crm tr:hover td {
  background: var(--wash);
}

table.crm b {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Toast & spinner
   -------------------------------------------------------------------------- */
#toast {
  position: fixed;
  bottom: 26px;
  right: 0;
  background: var(--ink);
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 0;
  color: var(--bg);
  padding: 13px 20px;
  display: none;
  max-width: 400px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
  z-index: 100;
  text-wrap: pretty;
}

#toast a {
  color: var(--accent);
}

.spin {
  display: inline-block;
  width: 11px;
  height: 11px;
  vertical-align: -1px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  font-size: 0;
  animation: rot 700ms linear infinite;
}

/* spinners inside buttons sit on accent / paper, not ink */
button .spin {
  border-color: rgba(25, 20, 0, 0.25);
  border-top-color: var(--accent-ink);
  margin-right: 4px;
}

@keyframes rot {
  to { transform: rotate(360deg); }
}

label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  display: block;
  margin: 12px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-stack);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  main {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .scorebar {
    grid-template-columns: 1fr 1fr;
  }
  .verdict {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .kv {
    grid-template-columns: 130px 1fr;
  }
}
@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  #appTitle, .sub {
    white-space: normal;
  }
  .brand-block {
    flex: 1 1 auto;
  }
  .brand-title {
    flex-wrap: wrap;
  }
  .header-controls {
    justify-content: flex-start;
    gap: 8px;
  }
  .gtm-brain-select {
    max-width: 100%;
  }
  #kitSel {
    max-width: 180px;
  }
  .scorebar {
    grid-template-columns: 1fr;
  }
  .detail-head {
    flex-direction: column;
  }
  .kv {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .kv dt {
    border-bottom: 0;
    padding-bottom: 0;
  }
}
