/* BugOut Index — minimal, print-friendly styles. No JS, no trackers. */
:root {
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #fafaf9;
  --card: #ffffff;
  --accent: #111827;
  --high: #27ae60;
  --moderate: #f1c40f;
  --low: #e67e22;
  --critical: #c0392b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f3f4f6;
    --muted: #9ca3af;
    --line: #374151;
    --bg: #0b0f14;
    --card: #111827;
    --accent: #f3f4f6;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 32px 20px 80px; }

header.site {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 28px;
}
header.site h1 { font-size: 20px; margin: 0; letter-spacing: -0.01em; }
header.site nav a { margin-left: 18px; color: var(--muted); text-decoration: none; font-size: 14px; }
header.site nav a:hover { color: var(--ink); }

.hero {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px; display: grid; grid-template-columns: 1fr 1.3fr; gap: 28px;
  align-items: center;
}
.hero .label { color: var(--muted); font-size: 13px; letter-spacing: 0.02em; text-transform: uppercase; }
.hero h2 { margin: 6px 0 4px; font-size: 36px; line-height: 1.1; letter-spacing: -0.02em; }
.hero .sub { color: var(--muted); font-size: 14px; }
.hero .delta { margin-top: 10px; font-size: 13px; color: var(--muted); }
.hero .delta strong { color: var(--ink); }

.band { display: inline-block; font-weight: 600; padding: 2px 10px; border-radius: 999px;
        font-size: 12px; letter-spacing: 0.02em; text-transform: uppercase; margin-top: 12px; }
.band.high     { background: rgba(39,174,96,0.12); color: var(--high); }
.band.moderate { background: rgba(241,196,15,0.15); color: #a88b06; }
.band.low      { background: rgba(230,126,34,0.15); color: var(--low); }
.band.critical { background: rgba(192,57,43,0.15); color: var(--critical); }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
}

.section-title {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 40px 0 14px;
}
.section-title h3 { font-size: 18px; margin: 0; letter-spacing: -0.01em; }
.section-title .hint { color: var(--muted); font-size: 13px; }

.grid { display: grid; gap: 14px; }
.grid.metrics { grid-template-columns: repeat(3, 1fr); }
.grid.markets { grid-template-columns: repeat(3, 1fr); }
.grid.pulse   { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 820px) {
  .grid.metrics { grid-template-columns: repeat(2, 1fr); }
  .grid.pulse   { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .grid.metrics, .grid.markets, .grid.pulse { grid-template-columns: 1fr; }
}

.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px;
}
.tile .k { color: var(--muted); font-size: 12px; letter-spacing: 0.02em; text-transform: uppercase; }
.tile .v { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin: 4px 0; }
.tile .u { color: var(--muted); font-size: 12px; font-weight: 500; margin-left: 4px; }
.tile .meta { color: var(--muted); font-size: 12px; margin-top: 8px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tile .meta > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile svg.sparkline { display: block; width: 100%; height: 32px; margin-top: 10px; }

.tile .delta-up   { color: var(--high); }
.tile .delta-down { color: var(--critical); }

.norm-bar { margin-top: 8px; height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; }
.norm-bar > span { display: block; height: 100%; background: var(--ink); }

footer { margin-top: 60px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line);
         padding-top: 16px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

pre.json { background: var(--card); border: 1px solid var(--line); padding: 12px; border-radius: 8px;
           overflow-x: auto; font-size: 12px; }

table.hx { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--card);
           border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.hx th, table.hx td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; }
table.hx th:first-child, table.hx td:first-child { text-align: left; }
table.hx thead th { background: rgba(0,0,0,0.03); font-weight: 600; font-size: 12px; }

.chart-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 8px; overflow-x: auto;
}
.chart-card svg.chart-multiline { display: block; width: 100%; height: auto; max-width: 100%; }
.chart-caption { color: var(--muted); font-size: 12px; padding: 8px 4px 0; }
.rev-callout {
  margin: -4px 0 16px; padding: 10px 14px; font-size: 13px;
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--moderate);
  border-radius: 8px; color: var(--muted);
}
details.rev-table { margin: 8px 0 24px; }
details.rev-table > summary {
  cursor: pointer; color: var(--muted); font-size: 13px; padding: 6px 0; user-select: none;
}
details.rev-table[open] > summary { margin-bottom: 8px; }

@media print {
  body { background: white; }
  .hero, .tile, table.hx { border-color: #ccc; }
  header.site nav, footer a { display: none; }
}
