:root {
  --bg: #0D1117;
  --panel: #151A21;
  --panel-2: #1C232C;
  --border: #2B3440;
  --row: #222A34;
  --text: #E8EBEF;
  --text-2: #C9D1DB;
  --muted: #A3ADBA;
  --pos: #5CADFF;
  --neg: #FFA552;
  --paper: #F2B544;
  --chip-blue-bg: #16314D;
  --chip-blue-fg: #A9D3FF;
  --chip-orange-bg: #3A2512;
  --chip-orange-fg: #FFC48F;
  --chip-amber-bg: #3A2E12;
  --chip-amber-fg: #F7D58A;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; }
a { color: var(--pos); }
a:hover { color: #8DC5FF; }
button { font-family: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--pos); outline-offset: 2px; }

.wrap { max-width: 1360px; margin: 0 auto; padding: 24px 16px 40px; display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 720px) { .wrap { padding: 24px 24px 40px; } }

.header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.brand { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.badge-paper { background: var(--paper); color: #1A1300; font-weight: 800; font-size: 13px; letter-spacing: 0.08em; padding: 4px 10px; border-radius: 4px; }
.badge-region { border: 1px solid #2E5A85; color: var(--chip-blue-fg); font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 4px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.sample { font-size: 12px; color: var(--muted); border: 1px dashed #3A4552; border-radius: 4px; padding: 3px 8px; }

.btn { min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid #3A4552; background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; }
.btn-ghost { background: transparent; font-size: 13px; }
.btn-kill { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; background: var(--neg); border-color: var(--neg); color: #1A0E00; }

.switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.switch button { min-height: 40px; padding: 0 14px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.switch button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
.tab { min-height: 44px; padding: 0 16px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; border-radius: 6px 6px 0 0; cursor: pointer; }
.tab[aria-pressed="true"] { background: var(--panel-2); color: var(--text); border-bottom-color: var(--pos); }

.banner { border: 1px solid #3A4552; background: var(--panel); border-radius: 8px; padding: 12px 16px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.banner.warn { border-color: var(--neg); background: #2A1A0C; color: var(--text); }
.banner.info { border-color: #2E5A85; background: #11202F; color: var(--text); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.card .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.card .value { font-family: var(--mono); font-size: 22px; font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel h2 { margin: 0; font-size: 16px; font-weight: 700; }
.panel h3 { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.panel p { margin: 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--row); }
.kv:last-child { border-bottom: 0; }

.meter { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.meter > span { display: block; height: 6px; background: var(--pos); border-radius: 3px; }

.log-line { display: flex; gap: 10px; align-items: baseline; font-size: 13px; line-height: 1.45; }
.chip { flex: none; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; padding: 2px 6px; border-radius: 4px; background: var(--panel-2); color: var(--text-2); white-space: nowrap; }
.chip.blue { background: var(--chip-blue-bg); color: var(--chip-blue-fg); }
.chip.orange { background: var(--chip-orange-bg); color: var(--chip-orange-fg); }
.chip.amber { background: var(--chip-amber-bg); color: var(--chip-amber-fg); }
.chip.grey { background: var(--border); color: var(--text); }
.chip.status { font-size: 12px; font-weight: 600; letter-spacing: 0; padding: 3px 8px; }

.table-box { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--row); vertical-align: middle; }
td.num, th.num { text-align: right; font-family: var(--mono); white-space: nowrap; }
th.num { font-family: inherit; }
tfoot td { font-weight: 700; border-bottom: 0; }
.sym { font-weight: 700; white-space: nowrap; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

.sessions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--row); align-items: center; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.filters input, .filters select { min-height: 44px; min-width: 160px; padding: 0 12px; border-radius: 8px; border: 1px solid #3A4552; background: var(--panel-2); color: var(--text); font: inherit; font-size: 14px; }
.th-sort, .linkish { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.th-sort { text-transform: inherit; letter-spacing: inherit; font-weight: 600; min-height: 32px; }
.linkish { display: flex; flex-direction: column; gap: 2px; min-height: 44px; justify-content: center; }
.linkish:hover .sym { color: var(--pos); }
.score { position: relative; display: inline-block; width: 60px; height: 6px; background: var(--border); border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.score-bar { position: absolute; top: 0; height: 6px; border-radius: 3px; }
.score-bar.up { background: var(--pos); }
.score-bar.down { background: var(--neg); }
tr.detail td { background: var(--panel-2); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; padding: 8px 4px; }
.detail-grid h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.detail-grid p { margin: 0 0 6px; }

.footer { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 14px; font-family: var(--mono); }
