:root {
  --bg: #0b1020;
  --bg-2: #121a31;
  --panel: #151d38;
  --panel-2: #1b2444;
  --line: #27314f;
  --text: #e8ecf8;
  --muted: #94a0c4;
  --accent: #4dd4ac;
  --accent-2: #5aa9ff;
  --warn: #ffb020;
  --danger: #ff5d6c;
  --ok: #35c98b;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: radial-gradient(1200px 600px at 20% -10%, #1a2550 0%, var(--bg) 60%);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.05rem; }
h2 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(180deg, rgba(27, 36, 68, 0.95), rgba(11, 16, 32, 0.95));
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06121f;
  font-weight: 800;
  font-size: 0.9rem;
}
.brand-sub { margin: 0; font-size: 0.75rem; color: var(--muted); }

.match-strip { display: flex; align-items: center; gap: 1rem; }
.fixture { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; }
.score {
  padding: 0.15rem 0.6rem;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.clock {
  font-variant-numeric: tabular-nums;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 4.5rem;
  text-align: center;
}

.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.role-select { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--muted); }
select, textarea, input {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  font: inherit;
  font-size: 0.85rem;
}
.pill {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
}
.pill-live { color: var(--ok); border-color: rgba(53, 201, 139, 0.4); }
.pill-offside { color: var(--danger); border-color: rgba(255, 93, 108, 0.45); background: rgba(255, 93, 108, 0.12); }
.pill-on_side, .pill-no_change { color: var(--ok); border-color: rgba(53, 201, 139, 0.4); background: rgba(53, 201, 139, 0.12); }
.pill-indeterminate, .pill-pending { color: var(--warn); border-color: rgba(255, 176, 32, 0.45); background: rgba(255, 176, 32, 0.12); }

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 1rem;
  padding: 1rem 1.25rem 2rem;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.panel-hint { margin: 0; padding: 0.6rem 1rem; font-size: 0.78rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.panel-hint strong { color: var(--accent); }

.btn {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 60ms ease;
}
.btn:hover { background: #222d54; border-color: #3a4770; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.btn-ghost { background: transparent; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #37b98f); color: #04121b; border-color: transparent; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { background: rgba(255, 93, 108, 0.15); border-color: rgba(255, 93, 108, 0.4); color: #ffb3ba; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.incident-list { list-style: none; margin: 0; padding: 0; max-height: 62vh; overflow-y: auto; }
.incident-item {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: grid;
  gap: 0.25rem;
  transition: background 120ms ease;
}
.incident-item:hover { background: rgba(90, 169, 255, 0.06); }
.incident-item[aria-selected="true"] { background: rgba(77, 212, 172, 0.1); box-shadow: inset 3px 0 0 var(--accent); }
.incident-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.incident-kind { font-weight: 650; text-transform: capitalize; }
.incident-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.8rem; }
.incident-meta { color: var(--muted); font-size: 0.75rem; }

.empty { padding: 1.5rem 1rem; color: var(--muted); text-align: center; }

.review-body { padding: 1rem; display: grid; gap: 1rem; }
.verdict-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.verdict-banner strong { font-size: 1.05rem; }
.verdict-confidence { margin-left: auto; color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

.reasoning { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.85rem; }
.reasoning li { margin-bottom: 0.25rem; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.6rem; }
.metric {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
}
.metric dt { margin: 0 0 0.15rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.metric dd { margin: 0; font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.decision-box { border-top: 1px solid var(--line); padding-top: 0.9rem; display: grid; gap: 0.6rem; }
.decision-box label { font-size: 0.8rem; color: var(--muted); }
.decision-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.decision-actions .hint { color: var(--muted); font-size: 0.78rem; }
textarea { width: 100%; min-height: 68px; resize: vertical; }

.audit-list { list-style: none; margin: 0; padding: 0; font-size: 0.78rem; }
.audit-list li { display: flex; gap: 0.6rem; padding: 0.35rem 0; border-bottom: 1px dashed var(--line); }
.audit-list .audit-action { font-weight: 600; min-width: 12rem; }
.audit-list .audit-hash { color: var(--muted); font-family: ui-monospace, "Cascadia Code", monospace; font-size: 0.7rem; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  box-shadow: var(--shadow);
  z-index: 50;
  max-width: min(90vw, 40rem);
}
.toast[data-kind="error"] { border-color: rgba(255, 93, 108, 0.5); }
.toast[data-kind="success"] { border-color: rgba(53, 201, 139, 0.5); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .incident-list { max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
/*
 * Decision engine outcomes.
 *
 * A refusal must never look like a ruling. "AI declines to rule" is a different
 * statement from "AI is confident this is on side", and colour is what a
 * referee's eye lands on first - so abstentions are muted grey and incomplete
 * evidence is amber, never green.
 */
.pill-offence { color: var(--danger); border-color: rgba(255, 93, 108, 0.45); background: rgba(255, 93, 108, 0.12); }
.pill-no_offence { color: var(--ok); border-color: rgba(53, 201, 139, 0.4); background: rgba(53, 201, 139, 0.12); }
.pill-abstain { color: var(--warn); border-color: rgba(255, 176, 32, 0.45); background: rgba(255, 176, 32, 0.12); }
.pill-insufficient_evidence,
.pill-not_checkable {
  color: var(--muted);
  border-color: rgba(148, 160, 196, 0.45);
  background: rgba(148, 160, 196, 0.12);
}
.pill-muted { color: var(--muted); border-color: rgba(148, 160, 196, 0.45); background: rgba(148, 160, 196, 0.12); }
.pill-warn { color: var(--warn); border-color: rgba(255, 176, 32, 0.45); background: rgba(255, 176, 32, 0.12); }
.pill-ok { color: var(--ok); border-color: rgba(53, 201, 139, 0.4); background: rgba(53, 201, 139, 0.12); }
.pill-danger { color: var(--danger); border-color: rgba(255, 93, 108, 0.45); background: rgba(255, 93, 108, 0.12); }