:root {
  color-scheme: dark;
  --surface: #181e2a;
  --canvas: #10141d;
  --panel: #202838;
  --line: #364056;
  --text: #edf2fb;
  --muted: #aab9cf;
  --accent: #a8c9ff;
  --primary: #aacafa;
  --ink: #122549;
  --good: #a9e3be;
  --danger: #ffc0bc;
  font: 16px/1.58 Inter, "Segoe UI", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: var(--canvas); }
a { color: var(--accent); text-underline-offset: .23em; }
a:hover { color: #d3e4ff; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid #e8c2ff; outline-offset: 3px; }
h1, h2 { font-family: Inter, "Segoe UI", system-ui, sans-serif; line-height: 1.16; letter-spacing: -.025em; }
h1 { margin: 0 0 .45rem; font-size: clamp(2rem,4vw,2.85rem); overflow-wrap: anywhere; }
h2 { font-size: 1.28rem; margin: 0 0 .65rem; }
p { margin: .35rem 0 .75rem; }
pre { background: #101622; border: 1px solid var(--line); padding: 1rem; border-radius: .6rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.topbar { display: flex; padding: 1rem clamp(1rem, 3vw, 2.5rem); gap: 1rem 2rem; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #141a25; }
.topbar nav { display: flex; flex-wrap: wrap; gap: .45rem 1.25rem; }
.topbar a, .rows a, .metric, .guide-index a { text-decoration: none; }
.topbar nav a:hover, .rows a:hover, .guide-index a:hover { text-decoration: underline; }
.brand { color: var(--text); font-weight: 750; font-size: 1.18rem; white-space: nowrap; letter-spacing: -.025em; }
.brand span { color: var(--accent); font-weight: 500; margin-left: .3rem; }
.layout { max-width: 1160px; margin: auto; padding: 2.5rem clamp(1rem, 4vw, 2rem) 4rem; }
.auth-layout { min-height: 100vh; display: grid; align-items: center; justify-items: center; padding: 2rem 1rem; background: radial-gradient(ellipse at 42% 5%, #243858 0%, var(--canvas) 61%); }
.auth-card, .card, dialog { background: var(--surface); border: 1px solid var(--line); border-radius: .85rem; padding: clamp(1.15rem, 3vw, 1.65rem); }
.auth-card { width: min(100%, 430px); box-shadow: 0 1.5rem 5rem #070a14aa; }
.auth-card .brand { display: block; padding-bottom: 1.1rem; }
.card { margin: 1rem 0; }
.narrow { max-width: 720px; margin-inline: auto; }
.stack { display: grid; gap: .9rem; }
.stack button { justify-self: start; }
.grid-form { display: flex; flex-wrap: wrap; gap: .65rem 1rem; align-items: end; margin: .75rem 0 1rem; }
.grid-form label { flex: 1 1 145px; }
label { display: grid; gap: .4rem; color: var(--text); font-size: .9rem; }
input, textarea { font: inherit; color: var(--text); background: #111723; border: 1px solid #566683; border-radius: .5rem; padding: .6rem .7rem; width: 100%; }
textarea { resize: vertical; }
button { font: 600 .9rem/1.25 Inter, "Segoe UI", system-ui, sans-serif; padding: .6rem .9rem; border: 1px solid var(--line); border-radius: .53rem; cursor: pointer; color: var(--text); background: var(--panel); min-height: 40px; }
button:hover { filter: brightness(1.17); }
.primary { background: var(--primary); color: var(--ink); border-color: var(--primary); }
.quiet { background: transparent; }
.danger { color: var(--danger); background: #4a252a; border-color: #835059; }
.muted, small { color: var(--muted); }
.page-head, .actions { display: flex; gap: .65rem 1rem; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.actions { justify-content: flex-start; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: .85rem; }
.metric { display: grid; margin: 0; padding: 1rem 1.45rem; color: var(--text); }
.metric span { color: var(--muted); }
.metric strong { font-size: 2.1rem; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; max-width: 100%; font-size: .81rem; border: 1px solid var(--line); border-radius: 100px; color: var(--muted); padding: .18rem .66rem; }
.badge.good { color: var(--good); border-color: #527b6b; }
.badge.wait { color: #ffd597; border-color: #947349; }
.rows, .tool-list { list-style: none; padding: 0; margin: 0; }
.rows li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem 1rem; padding: .8rem 0; }
.rows li + li, .tool-list li + li { border-top: 1px solid var(--line); }
.rows small { display: block; }
.tool-list li { padding: .8rem 0; }
.switch { display: inline-flex; gap: .5rem; align-items: center; }
.switch span { width: 1.55rem; height: .85rem; border: 1px solid #8193b2; border-radius: 20px; position: relative; }
.switch span::after { content: ""; position: absolute; top: .1rem; left: .12rem; width: .56rem; height: .56rem; background: #b6c3d8; border-radius: 50%; }
.switch[aria-checked=true] span { background: #4a6b93; }
.switch[aria-checked=true] span::after { left: .72rem; background: #f0f7ff; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
td, th { padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 600; color: var(--muted); }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.preline { white-space: pre-line; overflow-wrap: anywhere; }
.back { display: inline-block; margin-bottom: .85rem; }
.spaced { margin-top: .8rem; }
.empty { color: var(--muted); background: #131925; padding: .8rem; border-radius: .45rem; }
.error { color: var(--danger); }
.toast, .copy-status { display: flex; align-items: center; gap: .65rem; border: 1px solid #527b6b; border-radius: .6rem; padding: .55rem .85rem; color: var(--good); background: #203329; }
.toast { margin-bottom: 1rem; justify-content: space-between; }
.copy-status { position: fixed; bottom: 1rem; right: 1rem; max-width: calc(100vw - 2rem); }
dialog { color: var(--text); max-width: min(480px, calc(100% - 2rem)); }
dialog::backdrop { background: #05070bbd; }
summary { color: var(--accent); cursor: pointer; }
.guide-index { display: flex; gap: .8rem 1rem; flex-wrap: wrap; padding: .75rem 0; }
.guide { padding: .72rem 0; border-top: 1px solid var(--line); }
@media (max-width: 720px) { .topbar { flex-wrap: wrap; } .topbar nav { order: 2; width: 100%; } .grid-form { align-items: stretch; } }
@media (min-width: 386px) and (max-width: 609px) { .metric:last-child { grid-column: 1 / -1; } }
