/* Atlas — clean, quiet, black + red.
   Principles: one accent colour, hairline dividers instead of boxes, no bordered chip grids,
   compact header, content starts high on the page. */
:root {
  /* pure black, neutral greys, hairline dividers (Geist-style neutrals) */
  --bg: #000;
  --top: #000;
  --head: #000;
  --panel: #000;
  --hover: #0f0f0f;
  --raise: #1a1a1a;
  --line: #262626;
  --line-2: #3c3c3c;
  --tx: #fafafa;
  --tx-2: #d4d4d4;
  --mu: #a1a1a1;
  --fa: #666;
  --red: #e5202e;
  --red-hi: #ff4a57;
  --red-soft: #ff8c94;
  --red-bg: rgba(229, 32, 46, .10);
  --red-line: rgba(229, 32, 46, .42);
  --ok: #3fcf8e;
  --redir: #7aa2ff;
  --warn: #e9a23b;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --wrap: 1320px;
  --r: 8px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--tx); font: 14.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--red); color: #fff; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--mu); }
.faint { color: var(--fa); }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--red-line); outline-offset: 2px; }

/* ---------------------------------------------------------------- top bar */
.top { background: var(--top); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.top .wrap { display: flex; align-items: center; gap: 30px; height: 52px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.logo i { width: 20px; height: 20px; border-radius: 5px; background: var(--red); display: grid; place-items: center; font-style: normal; font-size: 11.5px; color: #fff; font-weight: 800; }
.nav { display: flex; gap: 4px; height: 100%; align-items: center; }
.nav a { color: var(--mu); font-size: 14px; padding: 6px 10px; border-radius: 6px; }
.nav a:hover { color: var(--tx); background: var(--hover); }
.nav a.on { color: var(--tx); background: var(--raise); }
.top .sp { flex: 1; }
.gsearch { position: relative; width: 300px; }
.gsearch input { width: 100%; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; color: var(--tx); font: inherit; font-size: 13.5px; padding: 6px 36px 6px 32px; outline: 0; }
.gsearch input:focus { border-color: var(--red-line); background: #000; }
.gsearch svg { position: absolute; left: 11px; top: 9px; color: var(--fa); }
.gsearch kbd { position: absolute; right: 8px; top: 6px; }
kbd { font: 11px var(--mono); color: var(--fa); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; }
.btn { display: inline-flex; align-items: center; gap: 7px; background: var(--panel); color: var(--tx); border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 12px; font: inherit; font-size: 13.5px; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #45454b; background: var(--hover); }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.red:hover { background: var(--red-hi); border-color: var(--red-hi); }
.btn.ghost { background: none; border-color: transparent; color: var(--mu); }
.btn.ghost:hover { color: var(--tx); background: var(--hover); }
.btn .spin { width: 7px; height: 7px; border-radius: 50%; background: var(--fa); }
.btn .spin.run { background: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------------------------------------------------------------- page header (compact) */
.band { border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--head), var(--bg)); }
.band .wrap { padding-top: 26px; padding-bottom: 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.band h1 { font-size: 24px; line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -.02em; }
.band .lead { font-size: 14.5px; color: var(--mu); max-width: 760px; margin: 6px 0 0; }
.band .lead b { color: var(--tx-2); font-weight: 600; }
.band .crumbs { color: var(--fa); font-size: 13px; margin-bottom: 6px; }
.band .crumbs a { color: var(--mu); }
.band .crumbs a:hover { color: var(--tx); }
.band .actions { display: flex; gap: 8px; flex: none; }
.stats { display: flex; gap: 28px; flex: none; }
.stats div { text-align: right; }
.stats b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stats b.red { color: var(--red-hi); }
.stats span { color: var(--fa); font-size: 12.5px; }

/* ---------------------------------------------------------------- layout */
.body { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 40px; padding-top: 22px; padding-bottom: 80px; align-items: start; }
.body.single { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 960px) { .body { grid-template-columns: 1fr; } .facets { position: static !important; max-height: none !important; } }

/* ---------------------------------------------------------------- facet sidebar: quiet checkbox lists */
.facets { position: sticky; top: 72px; max-height: calc(100vh - 92px); overflow: auto; padding-right: 6px; display: flex; flex-direction: column; gap: 22px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.fh { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.fh h4 { margin: 0; font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--mu); }
.fh a { font-size: 12px; color: var(--red-soft); }
.fh a:hover { color: var(--red-hi); }
.fg p { margin: -2px 0 6px; color: var(--fa); font-size: 12.5px; line-height: 1.45; }
.fl { display: flex; flex-direction: column; }
.fl a { display: flex; align-items: center; gap: 9px; padding: 4px 8px; margin: 0 -8px; border-radius: 6px; color: var(--tx-2); font-size: 14px; line-height: 1.45; }
.fl a:hover { background: var(--hover); color: var(--tx); }
.fl a .l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fl a .n { color: var(--fa); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.fl a.zero { color: var(--fa); }
.fl a.on { color: var(--tx); }
.fl a.on .n { color: var(--mu); }
.cb { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid #3d3d43; flex: none; display: grid; place-items: center; transition: background .1s, border-color .1s; }
.fl a:hover .cb { border-color: #5a5a61; }
.fl a.on .cb { background: var(--red); border-color: var(--red); }
.fl a.on .cb::after { content: ""; width: 7px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.more { margin-top: 4px; color: var(--mu); font-size: 13px; cursor: pointer; background: none; border: 0; padding: 2px 0; font-family: inherit; text-align: left; }
.more:hover { color: var(--tx); }
.fg .input { width: 100%; font-size: 13px; margin: 0 0 6px; padding: 5px 10px; }

.d { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.b-2xx { background: var(--ok); } .b-3xx { background: var(--redir); } .b-4xx { background: var(--warn); }
.b-5xx { background: var(--red); } .b-dead { background: var(--fa); } .b-unknown, .b-1xx { background: transparent; box-shadow: inset 0 0 0 1.2px var(--fa); }

/* ---------------------------------------------------------------- results column */
.searchrow { display: flex; gap: 10px; align-items: center; }
.field { position: relative; flex: 1; }
.field svg { position: absolute; left: 12px; top: 10px; color: var(--fa); }
.field input, .select, textarea, .input {
  background: var(--panel); color: var(--tx); border: 1px solid var(--line-2); border-radius: 8px;
  font: inherit; font-size: 14px; padding: 7px 12px; outline: 0;
}
.field input { width: 100%; padding-left: 36px; }
.field input:focus, .select:focus, textarea:focus, .input:focus { border-color: var(--red-line); background: #000; }
.select { appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--mu) 50%), linear-gradient(135deg, var(--mu) 50%, transparent 50%);
  background-position: right 14px top 52%, right 9px top 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.select.sm { font-size: 13px; padding: 3px 26px 3px 9px; background-position: right 12px top 52%, right 7px top 52%; border-radius: 6px; }
.select option { background: #111; }
.lbl-inline { color: var(--fa); font-size: 13px; }
.tabs { display: flex; gap: 2px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs a { padding: 7px 10px 10px; color: var(--mu); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13.5px; cursor: pointer; }
.tabs a:hover { color: var(--tx); }
.tabs a.on { color: var(--tx); border-bottom-color: var(--red); }
.tabs a .n { color: var(--fa); font-size: 12px; margin-left: 5px; }
.count { color: var(--mu); font-size: 13px; margin: 14px 0 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 28px; }
.count b { color: var(--tx); font-weight: 600; }
.count .right { display: flex; align-items: center; gap: 12px; }
.keys { color: var(--fa); font-size: 12.5px; display: flex; gap: 12px; align-items: center; }

/* ---------------------------------------------------------------- tables */
.tbl { border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
table.fixed { table-layout: fixed; }
table.fixed td { overflow: hidden; }
.name.nowrap { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
th { text-align: left; font-size: 12px; font-weight: 550; color: var(--fa); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th.r, td.r { text-align: right; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--hover); }
tbody tr.sel td { background: var(--red-bg); }
tbody tr.sel td:first-child { box-shadow: inset 2px 0 0 var(--red); }
td:first-child, th:first-child { padding-left: 14px; }
.name { font-weight: 600; color: var(--tx); font-size: 14.5px; word-break: break-word; }
a.name:hover { color: var(--red-hi); }
.sub { color: var(--fa); font-size: 13px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.sub .p { color: var(--mu); }
.snip { color: var(--mu); font-size: 12.5px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 680px; }
mark { background: var(--red-bg); color: var(--tx); border-radius: 2px; box-shadow: 0 0 0 1px var(--red-line); }
.code { display: inline-flex; align-items: center; gap: 7px; font-weight: 550; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.code.dim { color: var(--fa); font-weight: 400; }
.chg { display: block; font-size: 12px; color: var(--warn); margin-top: 1px; white-space: nowrap; }
.stack { color: var(--mu); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack .plus { color: var(--fa); }
.sev { font-weight: 600; font-size: 13px; }
.sev-CRITICAL { color: var(--red-hi); }
.sev-HIGH { color: var(--red-soft); }
.sev-MEDIUM { color: #d9a2a7; }
.sev-LOW, .sev-INFO, .sev-UNKNOWN { color: var(--mu); }
.badge { display: inline-block; font-size: 11px; font-weight: 650; letter-spacing: .03em; padding: 1px 7px; border-radius: 4px; text-transform: capitalize; white-space: nowrap; }
.badge.CRITICAL { background: var(--red); color: #fff; }
.badge.HIGH { background: var(--red-bg); color: var(--red-hi); }
.badge.MEDIUM { background: rgba(217, 162, 167, .08); color: #d9a2a7; }
.badge.LOW, .badge.INFO, .badge.UNKNOWN { background: var(--raise); color: var(--mu); }
.state { font-size: 13px; color: var(--fa); text-transform: capitalize; }
.state.submitted, .state.triaged { color: var(--redir); }
.state.paid { color: var(--ok); font-weight: 600; }
.state.resolved { color: var(--ok); }
.state.drafting { color: var(--warn); }
.state.duplicate, .state.informative { text-decoration: line-through; }
.tag { display: inline-block; font-size: 11.5px; color: var(--red-soft); background: var(--red-bg); border-radius: 4px; padding: 0 6px; line-height: 18px; margin-left: 4px; }
.empty { padding: 56px 20px; text-align: center; color: var(--fa); }
.foot { color: var(--fa); font-size: 12.5px; margin-top: 18px; max-width: 760px; line-height: 1.6; }

/* ---------------------------------------------------------------- pager */
.pager { display: flex; gap: 4px; justify-content: space-between; align-items: center; margin-top: 18px; color: var(--mu); font-size: 13px; flex-wrap: wrap; }
.pager .pages { display: flex; gap: 2px; align-items: center; }
.pager .pages a, .pager .pages span { min-width: 30px; height: 30px; padding: 0 8px; display: grid; place-items: center; border-radius: 6px; color: var(--mu); font-variant-numeric: tabular-nums; }
.pager .pages a:hover { background: var(--hover); color: var(--tx); }
.pager .pages .cur { background: var(--red-bg); color: var(--tx); font-weight: 600; box-shadow: inset 0 0 0 1px var(--red-line); }
.pager .pages .gap { min-width: 16px; color: var(--fa); }
.perpage { display: inline-flex; align-items: center; gap: 8px; color: var(--fa); font-size: 13px; }

/* ---------------------------------------------------------------- chips (forms inside panels) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 11px; font-size: 13px; color: var(--tx-2); background: transparent; white-space: nowrap; cursor: pointer; font-family: inherit; text-transform: capitalize; }
.chip:hover { border-color: #45454b; color: var(--tx); }
.chip.on { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------------------------------------------------------------- side panel */
.sheet { position: fixed; top: 52px; right: 0; bottom: 0; width: min(820px, 60vw); background: var(--panel); border-left: 1px solid var(--line-2);
  box-shadow: -30px 0 60px rgba(0, 0, 0, .5); transform: translateX(102%); transition: transform .18s ease; z-index: 25; display: flex; flex-direction: column; }
.sheet.open { transform: none; }
.sheet .loading { padding: 40px; color: var(--fa); }
@media (max-width: 900px) { .sheet { width: 100vw; } }
.ph { padding: 20px 26px 0; border-bottom: 1px solid var(--line); }
.ph .row1 { display: flex; gap: 8px; align-items: flex-start; }
.ph h2 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.01em; word-break: break-all; flex: 1; line-height: 1.3; padding-top: 3px; }
.ph .about { color: var(--mu); margin: 6px 0 0; font-size: 14px; }
.ph .facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 12px 0 2px; font-size: 13px; color: var(--fa); }
.ph .facts b { color: var(--tx-2); font-weight: 550; }
.ph .facts a:hover b { color: var(--red-hi); }
.ph .tabs { margin-top: 10px; border-bottom: 0; }
.iconbtn { background: none; border: 1px solid transparent; color: var(--mu); border-radius: 6px; width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; flex: none; font-size: 14px; }
.iconbtn:hover { color: var(--tx); background: var(--hover); border-color: var(--line-2); }
.pb { overflow: auto; padding: 4px 26px 60px; flex: 1; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.pane { display: none; }
.pane.on { display: block; }
.toc { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 16px 0 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.toc a { font-size: 12.5px; color: var(--fa); }
.toc a:hover { color: var(--tx); }
.toc a.k-next_steps { color: var(--red-soft); }
.section { scroll-margin-top: 10px; }
.section > h3 { font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--fa); margin: 26px 0 8px; }
.section.k-next_steps { background: var(--red-bg); border-radius: var(--r); padding: 2px 16px 10px; margin-top: 20px; box-shadow: inset 2px 0 0 var(--red); }
.section.k-next_steps > h3 { color: var(--red-soft); }
.techrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.techrow a { font-size: 12.5px; color: var(--tx-2); background: var(--raise); border-radius: 5px; padding: 2px 8px; }
.techrow a:hover { color: #fff; background: var(--red-bg); }
.techrow a .faint { margin-left: 3px; }
.flist { display: flex; flex-direction: column; margin-top: 14px; }
.fitem { display: grid; grid-template-columns: 74px 1fr auto; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fitem:hover .t { color: var(--red-hi); }
.fitem .t { font-weight: 550; font-size: 14px; }
.fitem .e { color: var(--fa); font-size: 12px; font-family: var(--mono); margin-top: 2px; word-break: break-all; }
.notes { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.notes textarea { width: 100%; min-height: 180px; font-size: 14px; resize: vertical; line-height: 1.55; }
.notes .row { display: flex; justify-content: space-between; align-items: center; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 16px; font-size: 13.5px; margin-top: 18px; }
.kv .k { color: var(--fa); }
.kv > span { min-width: 0; overflow-wrap: anywhere; color: var(--tx-2); }

/* ---------------------------------------------------------------- rendered markdown */
.md { overflow-wrap: anywhere; font-size: 14px; color: var(--tx-2); line-height: 1.65; }
.md h1 { font-size: 18px; color: var(--tx); }
.md h2 { font-size: 16px; color: var(--tx); margin: 22px 0 8px; }
.md h3, .md h4 { font-size: 14.5px; color: var(--tx); margin: 18px 0 6px; }
.md p { margin: 8px 0; }
.md ul, .md ol { padding-left: 20px; margin: 6px 0; }
.md li { margin: 2px 0; }
.md li::marker { color: var(--fa); }
.md strong { color: var(--tx); font-weight: 600; }
.md code { background: var(--raise); border-radius: 4px; padding: 1px 5px; color: #f2c4c8; font-size: 12.5px; }
.md pre { background: #050505; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; overflow: auto; max-height: 520px; }
.md pre code { background: none; padding: 0; color: #d6d6d6; }
.md table { display: block; overflow: auto; margin: 10px 0; border-collapse: collapse; }
.md th { color: var(--tx-2); font-size: 12.5px; padding: 6px 10px; border: 1px solid var(--line); background: var(--head); }
.md td { padding: 6px 10px; border: 1px solid var(--line); font-size: 13px; }
.md tbody tr { cursor: default; }
.md tbody tr:hover td { background: none; }
.md blockquote { margin: 8px 0; padding: 2px 14px; border-left: 2px solid var(--red-line); color: var(--mu); }
.md a { color: var(--red-soft); text-decoration: underline; text-decoration-color: var(--red-line); text-underline-offset: 2px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------------------------------------------------------------- full pages */
.page { padding-top: 24px; padding-bottom: 80px; max-width: 980px; }
.page .ph { padding: 0; }
.page .pb { padding: 0; overflow: visible; }
.statrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 0 0 22px; }
.statrow > * { padding: 14px 18px; background: var(--bg); }
.statrow .v { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.statrow .v.red { color: var(--red-hi); }
.statrow .l { color: var(--fa); font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
a.statlink:hover { background: var(--hover); }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .cols2 { grid-template-columns: 1fr; } }
.boxed { border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px; }
h4.label { margin: 0 0 8px; font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--mu); }
pre.scope { white-space: pre-wrap; margin: 0; color: var(--tx-2); font-size: 12.5px; line-height: 1.75; }
.diff { font-family: var(--mono); font-size: 12px; background: #050505; border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
.diff div { white-space: pre-wrap; padding: 0 14px; word-break: break-all; }
.diff .add { background: rgba(63, 207, 142, .07); color: #a7f3c9; }
.diff .del { background: var(--red-bg); color: #ffb3b9; }
.diff .hunk { color: var(--redir); padding-top: 6px; }
.diff .ctx { color: var(--mu); }
.err { background: var(--red-bg); border: 1px solid var(--red-line); color: #ffb3b9; padding: 10px 14px; border-radius: 8px; margin: 16px 0; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 8px); background: var(--raise); border: 1px solid var(--line-2); padding: 8px 16px; border-radius: 8px; font-size: 13.5px; z-index: 50; opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* refinements */
.md .section > h3 { font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--fa); margin: 28px 0 8px; }
.md .section.k-next_steps > h3 { color: var(--red-soft); margin-top: 14px; }
.band .actions .btn, .btn.ghost { font-weight: 500; }
.band .actions .btn:not(.red) { color: var(--tx-2); background: transparent; }

/* pure-black theme: no tinted surfaces, separation by hairlines only */
.band { background: var(--bg); }
.nav a.on { background: var(--raise); }
.gsearch input, .field input, .select, textarea, .input { background: var(--bg); }
.gsearch input:focus, .field input:focus, .select:focus, textarea:focus, .input:focus { background: var(--bg); border-color: #5a5a5a; }
.btn { background: var(--bg); border-color: var(--line-2); }
.btn:hover { background: var(--hover); border-color: #5a5a5a; }
.btn.red:hover { background: var(--red-hi); }
.sheet { box-shadow: -1px 0 0 var(--line), -24px 0 48px rgba(0, 0, 0, .85); border-left-color: var(--line); }
.md pre, .diff { background: #0a0a0a; border-color: var(--line); }
.md th { background: #0a0a0a; }
.cb { border-color: #525252; }
.fl a.on .cb { border-color: var(--red); }
.tabs { border-bottom-color: var(--line); }
.toast { background: #0a0a0a; border-color: var(--line-2); }
kbd { border-color: var(--line-2); color: var(--mu); }

/* status filter row under the search bar */
.statusbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin-top: 10px; }
.sb-label { font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--fa); margin-right: 8px; cursor: help; }
.sb { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 6px; color: var(--tx-2); font-size: 14px; }
.sb:hover { background: var(--hover); color: var(--tx); }
.sb .n { color: var(--fa); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sb.on { color: var(--tx); background: var(--red-bg); }
.sb.on .n { color: var(--mu); }
.sb.zero { color: var(--fa); }
.sb:hover .cb { border-color: #7a7a7a; }
.sb.on .cb { background: var(--red); border-color: var(--red); }
.sb.on .cb::after { content: ""; width: 7px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.sb-clear { font-size: 12.5px; color: var(--red-soft); margin-left: 6px; }
.sb-clear:hover { color: var(--red-hi); }

/* export menu */
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary { border-color: #5a5a5a; background: var(--hover); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 300px; background: #000; border: 1px solid var(--line-2); border-radius: 10px; padding: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, .8); }
.menu-pop a { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 6px; }
.menu-pop a:hover { background: var(--hover); }
.menu-pop a b { font-weight: 550; font-size: 14px; color: var(--tx); }
.menu-pop a span { font-size: 12.5px; color: var(--fa); }
.menu-h { font-size: 12px; color: var(--fa); padding: 6px 10px 8px; }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
a.dl { font-size: 12.5px; color: var(--mu); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; margin-left: 4px; }
a.dl:hover { color: var(--tx); border-color: #5a5a5a; }

/* narrower windows: keep the top bar on one line, never scroll sideways */
html, body { overflow-x: hidden; }
@media (max-width: 1180px) {
  .top .wrap { gap: 16px; }
  .gsearch { width: 220px; }
  .nav a { padding: 6px 8px; white-space: nowrap; }
}
@media (max-width: 900px) {
  .wrap { padding: 0 16px; }
  .gsearch { display: none; }
  .nav { overflow-x: auto; scrollbar-width: none; flex: 1; }
  .band .wrap { flex-direction: column; align-items: flex-start; }
  .count { flex-wrap: wrap; }
  .keys { display: none; }
}

/* sortable column headers */
th.sortable { padding: 0; }
th.sortable a { display: flex; align-items: center; gap: 5px; padding: 9px 12px; color: var(--fa); user-select: none; }
th.sortable.r a { justify-content: flex-end; }
th:first-child.sortable a { padding-left: 14px; }
th.sortable a:hover { color: var(--tx); }
th.sortable .arr { font-size: 11px; opacity: 0; transition: opacity .1s; }
th.sortable a:hover .arr { opacity: .5; }
th.sortable.on a { color: var(--tx); }
th.sortable.on .arr { opacity: 1; color: var(--red-hi); }

/* live check upload */
.notice { border: 1px solid var(--line-2); border-left: 2px solid var(--ok); border-radius: 8px; padding: 10px 14px; margin-bottom: 18px; color: var(--tx-2); font-size: 14px; }
.notice a { color: var(--tx); text-decoration: underline; text-decoration-color: var(--line-2); }
.upload { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.upload input[type=file] { color: var(--mu); font: inherit; font-size: 13.5px; }
.upload input[type=file]::file-selector-button { background: #000; color: var(--tx); border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 12px; margin-right: 12px; font: inherit; font-size: 13.5px; cursor: pointer; }
.upload input[type=file]::file-selector-button:hover { border-color: #5a5a5a; }
.checkline { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; color: var(--tx-2); line-height: 1.45; }
.checkline input { accent-color: var(--red); margin-top: 3px; }

/* login */
.login-body { min-height: 100vh; display: grid; place-items: center; }
.login { width: min(360px, calc(100vw - 32px)); padding: 32px 0; }
.login .logo { margin-bottom: 28px; }
.login h1 { font-size: 22px; margin: 0 0 18px; letter-spacing: -.01em; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--mu); }
.login-form .input { width: 100%; font-size: 14.5px; padding: 9px 12px; }
.login-form .btn { justify-content: center; padding: 9px 12px; margin-top: 6px; }
.login-cmd { background: #0a0a0a; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; }
.userbox { display: flex; align-items: center; gap: 4px; font-size: 13px; }

/* ---------------------------------------------------------------- side-by-side panel with a draggable divider */
:root { --sheet-w: 46vw; }
.sheet { width: var(--sheet-w); transition: transform .18s ease; }
.sheet-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sheet-grip { position: absolute; left: -5px; top: 0; bottom: 0; width: 10px; cursor: col-resize; z-index: 2; touch-action: none; }
.sheet-grip::after { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .12s; }
.sheet-grip:hover::after, .sheet-grip:focus-visible::after, body.resizing .sheet-grip::after { background: var(--red); }
.sheet-grip::before { content: ""; position: absolute; left: 1px; top: 50%; width: 8px; height: 36px; margin-top: -18px; border-radius: 4px;
  background: var(--raise); border: 1px solid var(--line-2); }
.sheet-grip:hover::before, body.resizing .sheet-grip::before { border-color: var(--red); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing .sheet, body.resizing #page { transition: none; }

/* push the list aside instead of covering it */
#page { transition: margin-right .18s ease; container-type: inline-size; container-name: page; }
@media (min-width: 901px) {
  body.sheet-open #page { margin-right: var(--sheet-w); }
  body.sheet-open .sheet { box-shadow: none; border-left: 1px solid var(--line-2); }
}
@media (max-width: 900px) { .sheet { width: 100vw !important; } .sheet-grip { display: none; } }

/* as the list gets narrower, drop the least important parts first */
@container page (max-width: 1080px) {
  .body { grid-template-columns: 190px minmax(0, 1fr); gap: 24px; }
  .band .actions, .band .lead, .keys { display: none; }
}
@container page (max-width: 900px) {
  .body { grid-template-columns: minmax(0, 1fr); }
  .facets { display: none; }
  .statusbar .sb-label { display: none; }
}
@container page (max-width: 760px) {
  .tbl table.fixed th:nth-child(3), .tbl table.fixed td:nth-child(3) { display: none; }
  .tabs a { padding-left: 8px; padding-right: 8px; }
  .perpage > span, .count .faint { display: none; }
}
@container page (max-width: 560px) {
  .tbl table.fixed th:nth-child(4), .tbl table.fixed td:nth-child(4) { display: none; }
  .tbl table.fixed th:nth-child(2) { width: 82px !important; }
  .band h1 { font-size: 20px; }
  .sub { display: none; }
}
