:root {
  --bg: #0b0b0c;
  --bg-2: #131315;
  --bg-3: #1b1b1e;
  --line: #2a2a2e;
  --text: #ecebe6;
  --muted: #a3a29b;
  --accent: #f0b040;
  --accent-ink: #1a1203;
  --danger: #ff7b6b;
  --ok: #7bd88f;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--sans);
  min-height: 100vh; display: flex; flex-direction: column;
}
main { width: 100%; max-width: 62rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; flex: 1; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: #ffd07a; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }
h1, h2, h3 { line-height: 1.25; margin: 1.8rem 0 .6rem; font-weight: 650; }
h1 { font-size: 1.9rem; margin-top: .5rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p, ul, ol { margin: .6rem 0; }
code, pre, .mono { font-family: var(--mono); }
code { background: var(--bg-3); padding: .1em .35em; border-radius: 3px; font-size: .9em; }
pre {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px;
  padding: .9rem 1rem; overflow-x: auto; font-size: .85rem; line-height: 1.5; tab-size: 4;
}
pre code { background: none; padding: 0; font-size: inherit; }
.muted { color: var(--muted); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 42rem; }

.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem;
  padding: .9rem 1rem; border-bottom: 1px solid var(--line); max-width: 62rem; margin: 0 auto; width: 100%;
}
.logo { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text); font-family: var(--mono); font-weight: 700; font-size: 1.1rem; }
.logo .bar { width: 1.6rem; height: .85rem; background: var(--accent); display: inline-block; border-radius: 1px; }
.logo .dot { color: var(--accent); }
.site-header nav { display: flex; gap: 1.2rem; }
.site-header nav a { color: var(--muted); text-decoration: none; padding: .25rem 0; }
.site-header nav a:hover { color: var(--text); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; padding: 1rem; text-align: center; }

/* redacted-bar motif */
.redact { background: var(--text); color: transparent; border-radius: 2px; user-select: none; padding: 0 .2em; }
.hero h1 { font-size: 2.4rem; font-family: var(--mono); letter-spacing: -.02em; }
.hero h1 .redact { padding: 0 .1em; }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 1rem; }
.card h3 { margin-top: 0; }
.stat { font-family: var(--mono); font-size: 1.8rem; color: var(--accent); margin: 0; }

ul.list { list-style: none; padding: 0; margin: 1rem 0; border: 1px solid var(--line); border-radius: 6px; }
ul.list > li { padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--bg-2); }
ul.list > li:last-child { border-bottom: 0; }
ul.list a.title { font-weight: 600; text-decoration: none; }
ul.list a.title:hover { text-decoration: underline; }
.meta { color: var(--muted); font-family: var(--mono); font-size: .8rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.handle { font-family: var(--mono); color: var(--accent); }

/* untrusted content treatment */
.untrusted-note {
  border: 1px dashed var(--line); border-left: 3px solid var(--accent); background: var(--bg-2);
  padding: .5rem .8rem; font-size: .85rem; color: var(--muted); border-radius: 4px; margin: 1rem 0;
}
.untrusted {
  border-left: 3px solid #5a4a22; background: var(--bg-2); padding: .7rem 1rem;
  border-radius: 0 6px 6px 0; margin: .8rem 0; position: relative;
}
.untrusted .body { white-space: pre-wrap; overflow-wrap: anywhere; margin: .4rem 0 0; font-family: var(--sans); }
.untrusted .tag { font-family: var(--mono); font-size: .7rem; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 .35rem; }
.untrusted.is-hidden { opacity: .6; border-left-color: var(--danger); }

.msg-list { max-height: 70vh; overflow-y: auto; padding-right: .25rem; }
.status { color: var(--muted); font-family: var(--mono); font-size: .8rem; min-height: 1.4em; }
.error { color: var(--danger); border: 1px solid var(--danger); border-radius: 4px; padding: .5rem .8rem; margin: .8rem 0; font-size: .9rem; }
.ok { color: var(--ok); }
.empty { color: var(--muted); padding: 1rem 0; }
.badge { font-family: var(--mono); font-size: .7rem; border: 1px solid var(--line); border-radius: 3px; padding: 0 .35rem; color: var(--muted); }
.badge.warn { color: var(--danger); border-color: var(--danger); }
.crumbs { font-family: var(--mono); font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }

table { border-collapse: collapse; width: 100%; font-size: .9rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: .45rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-family: var(--mono); font-size: .8rem; white-space: nowrap; }

form { margin: 1rem 0; }
label { display: block; margin: .8rem 0 .25rem; color: var(--muted); font-size: .9rem; }
input[type=text], input[type=password], input[type=number], input[type=search] {
  width: 100%; max-width: 22rem; background: var(--bg-3); color: var(--text);
  border: 1px solid #44444a; border-radius: 4px; padding: .5rem .6rem; font: inherit; font-family: var(--mono);
}
button, .btn {
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 4px; padding: .5rem 1rem;
  font: inherit; font-weight: 650; cursor: pointer;
}
button:hover { background: #ffd07a; }
button.small { padding: .15rem .6rem; font-size: .8rem; }
button.ghost { background: transparent; color: var(--text); border: 1px solid #55555c; font-weight: 500; }
button.ghost:hover { background: var(--bg-3); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button.danger:hover { background: #2a1512; }
button:disabled { opacity: .5; cursor: not-allowed; }
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.tabs button { background: transparent; color: var(--text); border: 1px solid #55555c; font-weight: 500; }
.tabs button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row input { max-width: 14rem; }
.toc { font-size: .9rem; columns: 2; padding-left: 1.2rem; }
details { margin: .6rem 0; }
summary { cursor: pointer; color: var(--accent); }
[hidden] { display: none !important; }
@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.8rem; }
  .toc { columns: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  a, button { transition: color .12s, background-color .12s; }
}
