/* VenueGap — editorial light theme, dark on request. Tokens first. */
:root {
  --paper: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #141414;
  --ink-2: #3a3a38;
  --muted: #6f6f6c;
  --faint: #a6a6a2;
  --line: #e7e5df;
  --line-2: #d8d5cc;
  --kalshi: #0e8f7e;
  --kalshi-soft: rgba(14, 143, 126, 0.12);
  --poly: #5b4bc4;
  --poly-soft: rgba(91, 75, 196, 0.12);
  --pos: #0f8a4b;
  --pos-soft: rgba(15, 138, 75, 0.12);
  --neg: #b0342f;
  --amber: #b7791f;
  --amber-soft: rgba(183, 121, 31, 0.14);
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 24px rgba(20, 20, 20, 0.05);
  --r: 12px;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1012; --surface: #17181b; --surface-2: #1c1d21; --ink: #f2f2ef; --ink-2: #d4d4cf; --muted: #9c9c98; --faint: #5f5f5c;
    --line: #26272b; --line-2: #34363b; --kalshi: #3dd6bd; --kalshi-soft: rgba(61,214,189,0.14); --poly: #a08bff; --poly-soft: rgba(160,139,255,0.16);
    --pos: #4ade80; --pos-soft: rgba(74,222,128,0.14); --neg: #f87171; --amber: #f5b14b; --amber-soft: rgba(245,177,75,0.16);
    --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.35);
  }
}
:root[data-theme="dark"] {
  --paper: #0f1012; --surface: #17181b; --surface-2: #1c1d21; --ink: #f2f2ef; --ink-2: #d4d4cf; --muted: #9c9c98; --faint: #5f5f5c;
  --line: #26272b; --line-2: #34363b; --kalshi: #3dd6bd; --kalshi-soft: rgba(61,214,189,0.14); --poly: #a08bff; --poly-soft: rgba(160,139,255,0.16);
  --pos: #4ade80; --pos-soft: rgba(74,222,128,0.14); --neg: #f87171; --amber: #f5b14b; --amber-soft: rgba(245,177,75,0.16);
  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--ui); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar-in { height: 58px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; }
.mark { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 21px; letter-spacing: -0.01em; }
.glyph { width: 20px; height: 20px; border-radius: 50%; background: conic-gradient(from 180deg, var(--ink) 0 50%, transparent 50% 100%); border: 2px solid var(--ink); }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: transparent; padding: 7px 11px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab.on { color: var(--paper); background: var(--ink); }
.tab .n { font-family: var(--mono); font-size: 11px; margin-left: 5px; opacity: .7; }
.bar-right { display: flex; align-items: center; gap: 10px; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.live.ok i { background: var(--pos); box-shadow: 0 0 0 4px var(--pos-soft); }
.live.err i { background: var(--neg); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-2); transition: border-color .15s, background .15s; }
.icon-btn:hover { border-color: var(--line-2); }
.icon-btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.icon-btn.small { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }

/* ---------- lead ---------- */
.lead { padding: 44px 0 20px; max-width: 860px; }
.lead h1 { font-family: var(--display); font-weight: 500; font-size: clamp(30px, 3.6vw, 42px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 12px; font-variation-settings: "opsz" 144; }
.lead-sub { margin: 0; color: var(--muted); font-size: 15.5px; }
.lead-sub b { color: var(--ink); font-weight: 600; }

/* ---------- spotlight cards ---------- */
.spot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 13px; box-shadow: var(--shadow); text-decoration: none; display: block; transition: transform .15s, border-color .15s; cursor: pointer; }
.card:hover { transform: translateY(-1px); border-color: var(--line-2); }
.card .lbl { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card .ev { font-weight: 600; margin-top: 6px; font-size: 14.5px; letter-spacing: -0.01em; }
.card .oc { color: var(--muted); font-size: 13px; margin-top: 1px; }
.card .nums { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.card .big { font-family: var(--mono); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.card .kp { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.card .kp b { font-weight: 600; }
.card .kp .k { color: var(--kalshi); } .card .kp .p { color: var(--poly); }
.card.dim .big { color: var(--faint); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0 12px; border-top: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; height: 36px; min-width: 190px; flex: 1 1 190px; color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); width: 100%; }
.search:focus-within { border-color: var(--ink); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; height: 36px; }
.seg button { border: 0; background: transparent; padding: 0 11px; border-radius: 7px; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--paper); font-weight: 600; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch span { width: 30px; height: 18px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(12px); }
.switch.big { font-size: 14px; color: var(--ink); }

.legend-line { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; }
.legend-line b { color: var(--ink); }

.list-head { display: grid; grid-template-columns: minmax(200px, 0.9fr) minmax(280px, 1.4fr) 140px 100px 108px 34px; gap: 18px; padding: 0 16px 6px 18px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.list-head .r { text-align: right; }
.list-head i { font-style: normal; }
.list-head i.k { color: var(--kalshi); } .list-head i.p { color: var(--poly); }
@media (max-width: 1040px) { .list-head { display: none; } }

/* ---------- list ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: clip; }
.row { border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-main { display: grid; grid-template-columns: minmax(200px, 0.9fr) minmax(280px, 1.4fr) 140px 100px 108px 34px; align-items: center; gap: 18px; padding: 13px 16px 13px 18px; cursor: pointer; }
.row-main:hover { background: var(--surface-2); }
.row.open .row-main { background: var(--surface-2); }
.ev-title { font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; }
.ev-meta { display: flex; gap: 8px; align-items: center; margin-top: 3px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.lg { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.flag { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; }
.flag.live { color: var(--amber); background: var(--amber-soft); }
.flag.thin, .flag.lop { color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }
.cmp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; }
.cmp-head .oc { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-head .px { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.cmp-head .px b { font-weight: 600; }
.cmp-head .px.k b { color: var(--kalshi); } .cmp-head .px.p b { color: var(--poly); }
.track { position: relative; height: 10px; margin-top: 8px; background: linear-gradient(90deg, var(--line) 0 100%) center / 100% 2px no-repeat; }
.track .bar { position: absolute; top: 3px; height: 4px; border-radius: 2px; background: var(--line-2); }
.track .bar.kp { background: linear-gradient(90deg, var(--poly), var(--kalshi)); }
.track .bar.pk { background: linear-gradient(90deg, var(--kalshi), var(--poly)); }
.track .dot { position: absolute; top: 0; width: 10px; height: 10px; border-radius: 50%; transform: translateX(-50%); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); }
.track .dot.k { background: var(--kalshi); } .track .dot.p { background: var(--poly); }
.track .mid { position: absolute; top: 1px; left: 50%; width: 1px; height: 8px; background: var(--line-2); }
.gap { font-family: var(--mono); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; text-align: right; white-space: nowrap; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.tr { width: 44px; height: 14px; flex: none; }
.tr line { stroke: var(--line-2); stroke-width: 1; }
.tr polyline { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.tr.k polyline { stroke: var(--kalshi); } .tr.p polyline { stroke: var(--poly); } .tr.z polyline { stroke: var(--faint); }
.gap small { font-size: 11px; color: var(--faint); margin-left: 3px; font-weight: 500; }
.gap.k { color: var(--kalshi); } .gap.p { color: var(--poly); } .gap.z { color: var(--faint); }
.edge { text-align: right; font-family: var(--mono); font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.edge .pill { display: inline-block; padding: 3px 8px; border-radius: 999px; background: var(--pos-soft); color: var(--pos); font-weight: 600; font-size: 12.5px; }
.vol { text-align: right; font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; line-height: 1.3; }
.vol .k { color: var(--kalshi); } .vol .p { color: var(--poly); }
.more { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .15s; }
.row.open .more { transform: rotate(180deg); }

/* detail */
.detail { padding: 6px 18px 18px; background: var(--surface-2); border-top: 1px dashed var(--line); display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; }
.detail h4 { margin: 12px 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.otable { width: 100%; border-collapse: collapse; font-size: 13px; }
.otable th { text-align: left; font-size: 11px; color: var(--faint); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.otable td { padding: 6px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.otable td.n, .otable th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.otable .k { color: var(--kalshi); } .otable .p { color: var(--poly); }
.otable tr.thin td { color: var(--faint); }
.edge-box { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.edge-box .big { font-family: var(--mono); font-size: 22px; font-weight: 600; }
.edge-box .big.pos { color: var(--pos); } .edge-box .big.neg { color: var(--faint); }
.edge-box .desc { color: var(--muted); font-size: 12.5px; margin-top: 4px; line-height: 1.4; }
.spark { width: 100%; height: 90px; display: block; margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600; cursor: pointer; transition: transform .15s, border-color .15s; }
.btn:hover { transform: translateY(-1px); border-color: var(--ink); }
.btn.k { color: var(--kalshi); } .btn.p { color: var(--poly); }
.btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* skeleton + empty */
.sk { height: 62px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 40%, var(--surface) 80%); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* report archive */
.report h1 { font-family: var(--display); font-weight: 500; font-size: 30px; letter-spacing: -0.02em; margin: 30px 0 10px; }
.report h2 { font-family: var(--display); font-weight: 500; font-size: 20px; margin: 26px 0 8px; }
.report p, .report li { color: var(--ink-2); max-width: 80ch; }
.report ol, .report ul { padding-left: 22px; }
.report li { margin: 4px 0; }
.report code { font-family: var(--mono); font-size: 12.5px; }
.rnav { display: flex; justify-content: space-between; gap: 12px; padding: 16px 0 0; font-size: 13px; }
.rnav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.rnav a:hover { color: var(--ink); }
.rlist { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.rlist a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-decoration: none; font-family: var(--mono); font-weight: 600; }
.tab.livetab { color: var(--neg); }
.tab.livetab::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--neg); margin-right: 6px; vertical-align: middle; animation: pulse 1.4s infinite; }
.tab.livetab.on { color: var(--paper); }
.tab.livetab.on::before { background: var(--paper); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* server-rendered category pages */
.ssr .otable.big { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: clip; margin-top: 14px; }
.ssr .otable.big th, .ssr .otable.big td { padding: 10px 12px; }
.ssr .otable.big td a { text-decoration: none; font-weight: 600; }
.ssr .otable.big .s { color: var(--muted); font-size: 12px; }
.ssr .otable.big .links a { color: var(--muted); font-weight: 500; }
.ssr .tabs a { text-decoration: none; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* subscribe */
.subscribe { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center; margin: 34px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; box-shadow: var(--shadow); }
.sub-copy h2 { font-family: var(--display); font-weight: 500; font-size: 22px; margin: 0 0 6px; letter-spacing: -0.01em; }
.sub-copy p { margin: 0; color: var(--muted); font-size: 13.5px; }
.sub-form { display: flex; gap: 8px; flex-wrap: wrap; position: relative; }
.sub-form input[type="email"] { flex: 1 1 220px; height: 40px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; font: inherit; background: var(--surface); color: var(--ink); }
.sub-form input[type="email"]:focus { outline: 0; border-color: var(--ink); }
.sub-form .btn { height: 40px; }
.sub-msg { flex-basis: 100%; font-size: 12.5px; color: var(--muted); min-height: 16px; }
.sub-msg.ok { color: var(--pos); } .sub-msg.err { color: var(--neg); }
@media (max-width: 820px) { .subscribe { grid-template-columns: 1fr; } }

/* method + footer */
.method { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin: 40px 0 36px; }
.method h2 { font-family: var(--display); font-weight: 500; font-size: 18px; margin: 0 0 6px; letter-spacing: -0.01em; }
.method p { margin: 0; color: var(--muted); font-size: 13.5px; }
.foot { border-top: 1px solid var(--line); padding: 18px 0 32px; color: var(--faint); font-size: 12px; }
.foot-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* alerts popover + toasts */
.pop { position: fixed; top: 66px; right: max(24px, calc((100vw - 1180px) / 2 + 24px)); width: 320px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px 12px; z-index: 40; }
.pop-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pop-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 10px; }
.pop-row input { width: 64px; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 8px; font: inherit; font-family: var(--mono); background: var(--surface); color: var(--ink); }
.pop-hint { color: var(--faint); font-size: 12px; margin: 10px 0 0; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: var(--paper); padding: 11px 14px; border-radius: 12px; box-shadow: var(--shadow); min-width: 280px; max-width: 380px; font-size: 13px; animation: pop .2s ease; }
.toast b { display: block; }
.toast span { opacity: .75; font-size: 12px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- responsive ---------- */
@media (max-width: 1040px) {
  .row-main { grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.3fr) 80px 92px 34px; }
  .vol { display: none; }
  .spot { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .bar-in { grid-template-columns: auto auto; }
  .tabs { grid-column: 1 / -1; padding-bottom: 8px; margin-top: -8px; }
  .bar-in { height: auto; padding-top: 10px; }
  .lead { padding-top: 28px; }
  .spot { grid-template-columns: 1fr; }
  .row-main { grid-template-columns: 1fr auto 26px; grid-template-areas: "ev gap more" "cmp cmp cmp"; gap: 8px 12px; }
  .row-main > .ev { grid-area: ev; } .row-main > .cmp { grid-area: cmp; } .row-main > .gap { grid-area: gap; } .row-main > .more { grid-area: more; }
  .edge { display: none; }
  .detail { grid-template-columns: 1fr; }
  .method { grid-template-columns: 1fr; gap: 18px; }
  .pop { right: 12px; left: 12px; width: auto; }
}
