:root {
  --ink: #16211d;
  --muted: #68736e;
  --paper: #f2f0e9;
  --card: #fbfaf6;
  --line: #d8d5ca;
  --green: #0f7958;
  --green-soft: #dcece4;
  --amber: #b06422;
  --red: #a63d36;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.topbar, main { width: min(1280px, calc(100% - 40px)); margin-inline: auto; }
.topbar {
  display: flex; justify-content: space-between; align-items: end;
  padding: 42px 0 24px; border-bottom: 1px solid var(--line);
}
h1, h2, p { margin: 0; }
h1 { font-family: Georgia, serif; font-size: clamp(2.4rem, 6vw, 5.2rem); font-weight: 500; letter-spacing: -.06em; }
h2 { font-family: Georgia, serif; font-weight: 500; font-size: 1.55rem; letter-spacing: -.02em; }
.eyebrow { font-size: .69rem; font-weight: 750; letter-spacing: .15em; color: var(--green); margin-bottom: 10px; }
.status-wrap { display: flex; gap: 10px; align-items: center; padding-bottom: 8px; }
.mode, .status { border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: .72rem; font-weight: 750; }
.mode { background: var(--ink); color: white; border-color: var(--ink); }
.status.ok { background: var(--green-soft); color: var(--green); border-color: #b7d4c7; }
.status.error { color: var(--red); }
main { padding: 24px 0 60px; }
.hero-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.metric { background: var(--card); min-height: 132px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; }
.metric span { color: var(--muted); font-size: .76rem; }
.metric strong { font-family: Georgia, serif; font-size: 2.5rem; font-weight: 500; }
.metric.accent { background: var(--green); color: white; }
.metric.accent span { color: #cce7dc; }
.panel { background: var(--card); border: 1px solid var(--line); margin-top: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
button { border: 1px solid var(--ink); background: transparent; color: var(--ink); padding: 9px 13px; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
button:hover { background: var(--ink); color: white; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 14px 16px; font-size: .78rem; }
th { color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .09em; }
td:first-child { max-width: 420px; font-weight: 600; }
.badge { display: inline-block; padding: 5px 8px; border-radius: 3px; font-size: .66rem; font-weight: 800; }
.badge.shadow { background: var(--green-soft); color: var(--green); }
.badge.abstain { background: #ece9df; color: var(--muted); }
.positive { color: var(--green); font-weight: 700; }
.negative { color: var(--red); font-weight: 700; }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.market-list { padding: 0 22px; }
.market { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.market:last-child { border-bottom: 0; }
.market p { font-size: .86rem; font-weight: 650; line-height: 1.4; }
.market small { color: var(--muted); display: block; margin-top: 6px; }
.probability { font-family: Georgia, serif; font-size: 1.5rem; }
.admin-panel { padding-bottom: 20px; }
.admin-panel > :not(.panel-head) { margin-left: 22px; margin-right: 22px; }
.hint, .guardrail, .result { color: var(--muted); font-size: .75rem; line-height: 1.5; }
.hint { margin-top: 18px; }
label { display: grid; gap: 7px; margin-top: 16px; font-size: .72rem; font-weight: 700; }
input { width: 100%; border: 1px solid var(--line); background: white; padding: 11px; font: inherit; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.result { min-height: 24px; margin-top: 12px; }
.guardrail { border-left: 3px solid var(--green); padding-left: 10px; margin-top: 18px; }
.empty { padding: 24px; color: var(--muted); text-align: center; }
@media (max-width: 850px) {
  .hero-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .topbar { align-items: start; gap: 18px; flex-direction: column; }
}
@media (max-width: 520px) {
  .topbar, main { width: min(100% - 24px, 1280px); }
  .hero-grid { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 108px; padding: 16px; }
  .metric strong { font-size: 1.9rem; }
  .status-wrap { flex-wrap: wrap; }
}
