/* The Pentarchy · Polymarket — light theme, dataviz reference palette */
:root {
  color-scheme: light;
  --page:      #f9f9f7;
  --surface:   #fcfcfb;
  --ink:       #0b0b0b;
  --ink-2:     #52514e;
  --muted:     #898781;
  --grid:      #e1e0d9;
  --baseline:  #c3c2b7;
  --border:    rgba(11,11,11,.10);
  --series:    #2a78d6;   /* categorical slot 1 (blue) */
  --up:        #006300;   /* delta ↑ good (light-surface text step) */
  --down:      #d03b3b;   /* status critical */
  --hold:      #52514e;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* top bar */
.top { background: var(--surface); border-bottom: 1px solid var(--border);
       position: sticky; top: 0; z-index: 5; }
.topbar { display: flex; align-items: center; justify-content: space-between;
          padding-top: 14px; padding-bottom: 14px; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mark { color: var(--series); font-size: 20px; line-height: 1; }
.name { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.edition { color: var(--ink-2); font-size: 13px; }
.badge-paper {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--ink-2);
  border: 1px solid var(--baseline); border-radius: 999px; padding: 4px 10px;
  white-space: nowrap; background: var(--page);
}

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0; }
.tile { background: var(--surface); border: 1px solid var(--border);
        border-radius: 10px; padding: 14px 16px; }
.tile .k { color: var(--muted); font-size: 12px; letter-spacing: .05em;
           text-transform: uppercase; }
.tile .v { font-size: 26px; font-weight: 700; margin-top: 2px; }
.tile .d { font-size: 13px; margin-top: 2px; color: var(--ink-2); }
.pos { color: var(--up); } .neg { color: var(--down); }

/* panels */
.panel { background: var(--surface); border: 1px solid var(--border);
         border-radius: 10px; padding: 16px 16px 14px; margin: 0 0 16px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between;
              gap: 10px; margin-bottom: 8px; }
.panel-head h2 { font-size: 15px; margin: 0; letter-spacing: .02em; }
.sub { color: var(--muted); font-size: 12px; }
.cols { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }

/* chart */
.chart { position: relative; width: 100%; height: 260px; }
.chart svg { display: block; width: 100%; height: 100%; }
.tooltip {
  position: absolute; pointer-events: none; background: var(--ink); color: #fff;
  font-size: 12px; padding: 5px 8px; border-radius: 6px; white-space: nowrap;
  transform: translate(-50%, -130%); display: none; z-index: 3;
}
.chart-empty { color: var(--muted); font-size: 13px; padding: 40px 0; text-align: center; }

/* council */
.council { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.seat { border: 1px solid var(--border); border-radius: 10px; padding: 12px;
        background: var(--page); }
.seat.live { background: var(--surface); border-color: var(--series); }
.seat .who { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--baseline); }
.seat.live .dot { background: var(--up); }
.seat .model { color: var(--muted); font-size: 11px; margin-top: 2px;
               overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .stat { margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.seat .stat b { color: var(--ink); }
.seat .soon { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* tables */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px;
     text-transform: uppercase; letter-spacing: .05em;
     border-bottom: 1px solid var(--grid); padding: 6px 8px; white-space: nowrap; }
td { border-bottom: 1px solid var(--grid); padding: 8px; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td a { color: var(--ink); text-decoration: none; border-bottom: 1px dotted var(--baseline); }
td a:hover { color: var(--series); border-bottom-color: var(--series); }
.outcome-pill { display: inline-block; font-size: 11px; font-weight: 700;
  border: 1px solid var(--baseline); border-radius: 999px; padding: 1px 8px;
  color: var(--ink-2); white-space: nowrap; }

/* decision feed */
.feed { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; }
.dec { border: 1px solid var(--grid); border-radius: 8px; padding: 10px 12px; }
.dec .head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.dec .when { color: var(--muted); font-size: 11px; margin-left: auto; white-space: nowrap; }
.dec .q { font-weight: 600; font-size: 13px; margin-top: 4px; }
.dec .why { color: var(--ink-2); font-size: 13px; margin-top: 4px; white-space: pre-wrap; }
.dec .res { color: var(--muted); font-size: 12px; margin-top: 4px; }
.act { font-size: 10px; font-weight: 700; letter-spacing: .08em; border-radius: 4px;
       padding: 2px 6px; color: #fff; }
.act-BUY { background: var(--series); }
.act-SELL { background: #eb6834; }       /* categorical slot 6 (orange) */
.act-HOLD { background: var(--hold); }
.act-SETTLE { background: var(--up); }

.foot { color: var(--muted); font-size: 12px; padding: 8px 20px 32px; }

/* vault */
.vault { border-color: var(--series); }
.live-badge { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: #fff;
  background: var(--muted); border-radius: 4px; padding: 2px 7px; vertical-align: 2px; }
.live-badge.on { background: var(--up); }
.vault-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.vault-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.vault-stats .tile { padding: 10px 12px; }
.vault-stats .tile .v { font-size: 21px; }
.vault-side { display: flex; flex-direction: column; gap: 12px; }
.vault-me, .vault-deposit { border: 1px solid var(--grid); border-radius: 8px; padding: 12px; }
.vault-me .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.btn { font: inherit; font-size: 13px; font-weight: 600; border-radius: 8px;
  padding: 8px 14px; cursor: pointer; border: 1px solid var(--baseline);
  background: var(--surface); color: var(--ink); }
.btn:hover { border-color: var(--series); color: var(--series); }
.btn-primary { background: var(--series); border-color: var(--series); color: #fff; }
.btn-primary:hover { color: #fff; opacity: .92; }
.btn-ghost { padding: 4px 10px; font-size: 12px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.hint a { color: var(--series); }
.addr-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.addr-row code { font-size: 12px; word-break: break-all; color: var(--ink-2); }
.mini-head { font-size: 13px; margin: 14px 0 6px; }
.feed-short { max-height: 300px; }
.me-stat { font-size: 14px; }
.me-stat b { font-size: 17px; }
.field { font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--baseline);
  border-radius: 8px; width: 90px; background: var(--surface); color: var(--ink); }
@media (max-width: 900px) { .vault-grid { grid-template-columns: 1fr; } }

/* responsive */
@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .council { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile .v { font-size: 21px; }
  .council { grid-template-columns: 1fr; }
}
