:root {
  --bg: #0e1210;
  --bg-2: #151a17;
  --panel: #1a211c;
  --panel-2: #222b25;
  --border: #2c3830;
  --text: #edf2ec;
  --muted: #8f9d93;
  --accent: #d4a574;
  --accent-dim: rgba(212, 165, 116, 0.14);
  --ok: #5dbe8c;
  --ok-dim: rgba(93, 190, 140, 0.12);
  --warn: #e0b35a;
  --warn-dim: rgba(224, 179, 90, 0.12);
  --danger: #e07a72;
  --danger-dim: rgba(224, 122, 114, 0.12);
  --info: #7eb8c9;
  --info-dim: rgba(126, 184, 201, 0.12);
  --font: "Sora", "Noto Sans SC", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --max: 960px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse 70% 45% at 8% -8%, rgba(212, 165, 116, 0.11), transparent 55%),
    radial-gradient(ellipse 50% 35% at 100% 0%, rgba(126, 184, 201, 0.08), transparent 50%),
    linear-gradient(180deg, #121714 0%, var(--bg) 40%, #0c100e 100%);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--info); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: rgba(126, 184, 201, 0.45); }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.15rem 4rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.brand {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.brand em {
  font-style: normal;
  color: var(--accent);
}
.top-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.hero h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.55rem, 4.2vw, 2.2rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.lede {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  max-width: 46rem;
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.1rem 0 0;
}
.pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
}
.pill.ok { background: var(--ok-dim); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-dim); color: var(--warn); border-color: transparent; }
.pill.danger { background: var(--danger-dim); color: var(--danger); border-color: transparent; }
.pill.info { background: var(--info-dim); color: var(--info); border-color: transparent; }

.toc {
  margin: 1.6rem 0 2rem;
  padding: 1rem 1.1rem;
  background: rgba(26, 33, 28, 0.85);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.toc h2 {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.toc ol {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.35rem;
}
.toc a { font-size: 0.9rem; color: var(--text); }
.toc a:hover { color: var(--accent); }

section {
  margin: 0 0 2.4rem;
  scroll-margin-top: 1.2rem;
}
section > h2 {
  margin: 0 0 0.85rem;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}
section > h3 {
  margin: 1.35rem 0 0.55rem;
  font-size: 1.02rem;
  color: var(--accent);
}
p { margin: 0 0 0.85rem; color: #d5ddd6; }
.note {
  margin: 0.9rem 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 10px 10px 0;
  color: #e8dfd2;
  font-size: 0.92rem;
}
.note.warn {
  border-left-color: var(--warn);
  background: var(--warn-dim);
  color: #efe3c8;
}
.note.danger {
  border-left-color: var(--danger);
  background: var(--danger-dim);
  color: #f0d4d1;
}
.note strong { color: var(--text); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin: 0.7rem 0 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: block;
  overflow-x: auto;
}
thead, tbody, tr { width: 100%; }
th, td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  min-width: 5.5rem;
}
th {
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
tr:last-child td { border-bottom: none; }
td.mono, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pos { color: var(--ok); font-weight: 600; }
.neg { color: var(--danger); font-weight: 600; }
.muted { color: var(--muted); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.85rem 0 1rem;
}
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}
.stat .k {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.stat .v {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
}
.stat .s { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }

.timeline {
  position: relative;
  margin: 1rem 0;
  padding-left: 1.25rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.2rem;
  bottom: 0.2rem;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--info), transparent);
}
.t-item {
  position: relative;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.t-item::before {
  content: "";
  position: absolute;
  left: -1.05rem;
  top: 1.15rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
}
.t-item .when {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.t-item .what { font-weight: 600; margin-bottom: 0.2rem; }
.t-item .detail { font-size: 0.88rem; color: var(--muted); margin: 0; }
.t-item.critical::before { background: var(--danger); box-shadow: 0 0 0 3px rgba(224, 122, 114, 0.25); }
.t-item.critical .when { color: var(--danger); }
.t-item.ok::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(93, 190, 140, 0.25); }

.formula {
  font-family: var(--mono);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-size: 0.88rem;
  margin: 0.7rem 0 1rem;
  color: #e7efe8;
}

.sources li { margin-bottom: 0.45rem; font-size: 0.9rem; }
.sources .tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--info-dim);
  color: var(--info);
  margin-right: 0.35rem;
  vertical-align: 0.05em;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
}
.checklist li {
  position: relative;
  padding: 0.55rem 0.75rem 0.55rem 2rem;
  margin-bottom: 0.4rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
}
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0.7rem;
  color: var(--ok);
  font-weight: 700;
}

footer {
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}
.tz-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--warn);
  margin-left: 0.25rem;
}
