/* fail2ban.dev — design system
   Dark-first "security console" theme with an ember accent. Light theme via [data-theme="light"].
   Fonts: Space Grotesk (display), Inter (text), JetBrains Mono (code) — self-hosted, OFL. */

@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin-var.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/assets/fonts/space-grotesk-latin-var.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono-latin-var.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-s: 9px;
  --header-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --maxw: 1440px;

  /* dark (default) */
  --bg: #0b0e13;
  --bg-2: #10141b;
  --bg-3: #161b24;
  --bg-4: #1d2430;
  --line: #222a36;
  --line-2: #2d3746;
  --text: #e8edf3;
  --text-2: #a6b1bf;
  --text-3: #808b99;
  --accent: #ff5a36;
  --accent-2: #ff8b52;
  --accent-soft: rgba(255, 90, 54, .12);
  --accent-ink: #fff;
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, .1);
  --warn: #f5b83d;
  --warn-soft: rgba(245, 184, 61, .1);
  --info: #6aa8ff;
  --info-soft: rgba(106, 168, 255, .1);
  --danger: #ff4d6d;
  --danger-soft: rgba(255, 77, 109, .1);
  --code-bg: #0d1117;
  --code-head: #121821;
  --code-line: #1f2733;
  --code-text: #d6dee8;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 20px 50px -20px rgba(0,0,0,.6);
  --glass: rgba(11, 14, 19, .72);
  --grid: rgba(255,255,255,.035);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #faf9f6;
  --bg-2: #ffffff;
  --bg-3: #f3f1ec;
  --bg-4: #ebe8e1;
  --line: #e6e2d9;
  --line-2: #d8d3c7;
  --text: #15191f;
  --text-2: #4a5360;
  --text-3: #5f6873;
  --accent: #bf3618;
  --accent-2: #f26b32;
  --accent-soft: rgba(226, 66, 31, .08);
  --ok: #0a7d4e;
  --ok-soft: rgba(15, 157, 99, .08);
  --warn: #8f5e0f;
  --warn-soft: rgba(183, 121, 31, .09);
  --info: #2563eb;
  --info-soft: rgba(37, 99, 235, .07);
  --danger: #b81d3e;
  --danger-soft: rgba(214, 38, 74, .07);
  --shadow: 0 1px 2px rgba(20,20,10,.04), 0 18px 40px -22px rgba(40,30,10,.25);
  --glass: rgba(250, 249, 246, .78);
  --grid: rgba(20,20,10,.04);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 20px); }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
img, svg, canvas { max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.i { width: 18px; height: 18px; flex: none; vertical-align: middle; }
kbd {
  font: 500 11px/1 var(--mono); padding: 3px 6px; border-radius: 6px; color: var(--text-2);
  border: 1px solid var(--line-2); background: var(--bg-3); box-shadow: 0 1px 0 var(--line-2);
}
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 12px; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: var(--glass); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.hwrap { max-width: var(--maxw); margin: 0 auto; height: 100%; display: flex; align-items: center; gap: 22px; padding: 0 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex: none; }
.brand:hover { color: var(--text); }
.logo-mark { width: 30px; height: 30px; filter: drop-shadow(0 4px 14px rgba(255, 90, 54, .35)); }
.brand-text { font: 700 19px/1 var(--display); letter-spacing: -.02em; }
.brand-tld { color: var(--accent); }
.hnav { display: flex; gap: 2px; margin-left: 8px; overflow: hidden; }
.hnav a {
  color: var(--text-2); text-decoration: none; font-size: 14.5px; font-weight: 500; padding: 7px 11px; border-radius: 8px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.hnav a:hover, .hnav a[aria-current] { color: var(--text); background: var(--bg-3); }
.hnav a[aria-current] { box-shadow: inset 0 -2px 0 var(--accent); border-radius: 8px 8px 4px 4px; }
.hactions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 12px; min-width: 210px;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-3); border-radius: 10px; cursor: pointer; font: 14px var(--font);
  transition: border-color .15s, color .15s;
}
.search-btn span { flex: 1; text-align: left; }
.search-btn:hover { border-color: var(--accent); color: var(--text-2); }
.search-btn.big { min-width: min(420px, 100%); height: 48px; margin-top: 18px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text-2); cursor: pointer; transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--text-3); }
[data-theme="dark"] .icon-btn .moon, [data-theme="light"] .icon-btn .sun { display: none; }
.menu-btn { display: none; }

/* ---------------------------------------------------------------- drawer */
.drawer { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.5); backdrop-filter: blur(3px); }
.drawer-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(380px, 92vw); background: var(--bg-2); border-left: 1px solid var(--line);
  overflow-y: auto; padding: 16px 18px 40px; animation: slidein .25s var(--ease);
}
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.drawer details { border-bottom: 1px solid var(--line); }
.drawer summary { display: flex; gap: 10px; align-items: center; padding: 13px 4px; cursor: pointer; font-weight: 600; list-style: none; }
.drawer summary::-webkit-details-marker { display: none; }
.drawer ul { list-style: none; margin: 0 0 12px; padding: 0 0 0 28px; }
.drawer li a { display: block; padding: 6px 0; color: var(--text-2); text-decoration: none; font-size: 15px; }
.drawer li a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- docs layout */
.layout {
  max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 0;
}
.sidebar {
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 22px 14px 40px 22px;
  border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.sb-sec { margin-bottom: 4px; }
.sb-sec summary {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 8px; cursor: pointer; list-style: none;
  font: 600 13.5px/1.2 var(--font); color: var(--text); letter-spacing: .01em;
}
.sb-sec summary::-webkit-details-marker { display: none; }
.sb-sec summary .i { width: 16px; height: 16px; color: var(--text-3); }
.sb-sec summary .chev { margin-left: auto; transition: transform .2s; }
.sb-sec[open] summary .chev { transform: rotate(180deg); }
.sb-sec summary:hover { background: var(--bg-3); }
.sb-sec[open] > summary > .i:first-child { color: var(--accent); }
.sb-sec ul { list-style: none; margin: 2px 0 10px; padding: 0 0 0 17px; border-left: 1px solid var(--line); margin-left: 15px; }
.sb-sec li a {
  display: block; padding: 5px 10px; color: var(--text-2); text-decoration: none; font-size: 14px; line-height: 1.35; border-radius: 7px;
  margin-left: -1px; border-left: 1px solid transparent;
}
.sb-sec li a:hover { color: var(--text); background: var(--bg-3); }
.sb-sec li a[aria-current] { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); border-radius: 0 7px 7px 0; font-weight: 600; }

.main { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 48px; padding: 36px 40px 80px 52px; min-width: 0; }
.article { min-width: 0; max-width: 800px; }
.toc { position: relative; }
.toc-in { position: sticky; top: calc(var(--header-h) + 32px); max-height: calc(100vh - var(--header-h) - 60px); overflow-y: auto; scrollbar-width: none; }
.toc-t { font: 600 12px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a {
  display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text-3); text-decoration: none;
  font-size: 13.5px; line-height: 1.35; transition: color .15s, border-color .15s;
}
.toc li.l3 a { padding-left: 26px; font-size: 13px; }
.toc li a:hover { color: var(--text); }
.toc li a.active { color: var(--accent); border-left-color: var(--accent); }
.toc-top { display: inline-flex; gap: 6px; align-items: center; margin-top: 18px; font-size: 13px; color: var(--text-3); text-decoration: none; }
.toc-top .up { transform: rotate(-90deg); width: 14px; height: 14px; }

/* ---------------------------------------------------------------- page head */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 18px; font-size: 13px; color: var(--text-3); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-2); }
.crumbs a { color: var(--text-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; font: 600 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.page-head h1, .prose h1 {
  font: 700 clamp(2rem, 1.4rem + 2.4vw, 2.85rem)/1.08 var(--display); letter-spacing: -.035em; margin: 0 0 16px; text-wrap: balance;
}
.page-head h1 code { font: inherit; font-family: var(--mono); font-size: .82em; letter-spacing: -.04em; color: var(--accent); background: none; border: 0; padding: 0; }
.lead { font-size: 1.16rem; line-height: 1.6; color: var(--text-2); margin: 0 0 18px; text-wrap: pretty; max-width: 68ch; }
.page-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0 0 26px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.pm { display: inline-flex; gap: 7px; align-items: center; font-size: 13px; color: var(--text-3); }
.pm .i { width: 15px; height: 15px; }
.pm:last-child .i { color: var(--ok); }

/* ---------------------------------------------------------------- prose */
.prose { font-size: 16.5px; line-height: 1.75; color: var(--text); }
.prose > * { max-width: 72ch; }
.prose > figure.code, .prose > .table-wrap, .prose > .tabs, .prose > .cards, .prose > .tool, .prose > .callout, .prose > .steps, .prose > .lib, .prose > details { max-width: none; }
.prose p { margin: 0 0 1.15em; text-wrap: pretty; }
.prose h2 {
  font: 700 1.62rem/1.2 var(--display); letter-spacing: -.025em; margin: 2.4em 0 .7em; position: relative; text-wrap: balance;
}
.prose h2::before { content: ""; position: absolute; left: -22px; top: .35em; width: 4px; height: .75em; border-radius: 2px; background: var(--accent); opacity: .9; }
.prose h3 { font: 650 1.2rem/1.3 var(--display); letter-spacing: -.015em; margin: 1.9em 0 .55em; }
.prose h4 { font: 650 1rem/1.4 var(--font); margin: 1.6em 0 .5em; }
.prose h2 .anchor, .prose h3 .anchor { margin-left: 8px; color: var(--text-3); opacity: 0; text-decoration: none; font-weight: 400; transition: opacity .15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--text-3); }
.prose strong { font-weight: 650; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose blockquote { margin: 1.5em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--line-2); color: var(--text-2); }
.prose blockquote.upstream { background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--text-3); padding: 14px 18px; border-radius: 0 10px 10px 0; font-size: 15px; }
.prose blockquote.upstream footer { font-size: 13px; color: var(--text-3); }
.prose a.ext::after { content: "↗"; font-size: .8em; margin-left: 2px; opacity: .6; }
.prose :not(pre) > code, .prose td code, .lead code, .answer code {
  font: 500 .86em/1.4 var(--mono); padding: .14em .42em; border-radius: 6px; background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  overflow-wrap: anywhere;
}
.prose var { font-style: normal; color: var(--accent-2); }
[data-theme="light"] .prose var { color: var(--accent); }
.prose mark, .loglines mark { background: var(--accent-soft); color: var(--accent); padding: 0 .2em; border-radius: 4px; outline: 1px solid rgba(255,90,54,.3); }
.answer {
  font-size: 17px; padding: 18px 20px; border-radius: var(--radius); background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--bg-2);
  border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--accent);
}
.prose dl { margin: 0 0 1.4em; }
.prose dt { font-weight: 650; margin-top: .9em; }
.prose dd { margin: .2em 0 0 0; color: var(--text-2); }

/* tables */
.table-wrap { overflow-x: auto; margin: 1.4em 0 1.8em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.table-wrap th { text-align: left; font: 600 12.5px/1.3 var(--font); letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); background: var(--bg-3); }
.table-wrap th, .table-wrap td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap tr:last-child td, .table-wrap tr:last-child th { border-bottom: 0; }
.table-wrap tbody tr:hover { background: var(--bg-3); }
table.facts th { width: 34%; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text-2); background: var(--bg-2); }
table.cmds td:first-child { white-space: nowrap; }
table.cmds td:first-child code { white-space: nowrap; }

/* code blocks — always terminal-dark */
figure.code { margin: 1.4em 0 1.8em; border-radius: var(--radius); overflow: hidden; background: var(--code-bg); border: 1px solid var(--code-line); box-shadow: var(--shadow); }
[data-theme="light"] figure.code { border-color: #1a212c; }
figure.code figcaption {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 8px 0 16px; height: 38px; background: var(--code-head);
  border-bottom: 1px solid var(--code-line); font: 500 12.5px/1 var(--mono); color: #8a96a6;
}
figure.code figcaption .file::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff5a36; margin-right: 8px; box-shadow: 14px 0 0 #f5b83d, 28px 0 0 #3ddc97; margin-right: 44px; }
figure.code figcaption .lang { text-transform: lowercase; letter-spacing: .04em; }
figure.code.output { background: #090c10; }
figure.code.output figcaption .lang::before { content: "▸ "; color: #3ddc97; }
.copy {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid #2a3442; background: #161d27;
  color: #9fb0c3; font: 500 12px/1 var(--font); cursor: pointer; transition: all .15s;
}
.copy:hover { color: #fff; border-color: #ff5a36; }
.copy .i { width: 14px; height: 14px; }
.copy.done { color: #3ddc97; border-color: #3ddc97; }
figure.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font: 400 13.6px/1.7 var(--mono); color: var(--code-text); tab-size: 4; scrollbar-width: thin; scrollbar-color: #2a3442 transparent; }
figure.code code { font: inherit; white-space: pre; }
.t-c { color: #8090a2; font-style: italic; }
.t-k { color: #ff9a6b; }
.t-s { color: #a5e3a1; }
.t-v { color: #f5b83d; }
.t-f { color: #8fc1ff; }
.t-n { color: #d7a6ff; }
.t-o { color: #7f8ea1; }
.t-p { color: #7fd7d0; }
.t-ip { color: #ff6d4d; font-weight: 600; }
.t-tag { color: #ff6d4d; font-weight: 600; }
.t-sec { color: #f5b83d; font-weight: 600; }
.t-key { color: #8fc1ff; }
.t-d { color: #8090a2; }
.t-prompt { color: #3ddc97; user-select: none; }

/* callouts */
.callout { margin: 1.6em 0; padding: 14px 18px 4px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); position: relative; overflow: hidden; }
.callout::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.callout-head { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; font-size: 15px; }
.callout-body { font-size: 15.5px; }
.callout-body > :last-child { margin-bottom: 10px; }
.callout-tip { background: linear-gradient(90deg, var(--ok-soft), transparent 60%), var(--bg-2); }
.callout-tip::before, .callout-tip .callout-head .i { background: var(--ok); color: var(--ok); }
.callout-note { background: linear-gradient(90deg, var(--info-soft), transparent 60%), var(--bg-2); }
.callout-note::before, .callout-note .callout-head .i { background: var(--info); color: var(--info); }
.callout-warn { background: linear-gradient(90deg, var(--warn-soft), transparent 60%), var(--bg-2); }
.callout-warn::before, .callout-warn .callout-head .i { background: var(--warn); color: var(--warn); }
.callout-danger { background: linear-gradient(90deg, var(--danger-soft), transparent 60%), var(--bg-2); }
.callout-danger::before, .callout-danger .callout-head .i { background: var(--danger); color: var(--danger); }
.callout-success::before { background: var(--ok); }
.callout .callout-head .i { background: none !important; }

/* steps */
.steps > ol { list-style: none; counter-reset: step; padding: 0; margin: 1.5em 0; }
.steps > ol > li { counter-increment: step; position: relative; padding: 0 0 18px 52px; margin: 0; }
.steps > ol > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  font: 700 14px/1 var(--display); color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(255, 90, 54, .35);
}
.steps > ol > li::after { content: ""; position: absolute; left: 16px; top: 38px; bottom: 4px; width: 1px; background: var(--line); }
.steps > ol > li:last-child::after { display: none; }
.steps > ol > li > p:first-child { padding-top: 3px; }

/* tabs */
.tabs { margin: 1.4em 0 1.8em; }
.tablist { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; width: fit-content; max-width: 100%; }
.tablist button {
  border: 0; background: none; color: var(--text-2); font: 500 14px/1 var(--font); padding: 9px 14px; border-radius: 9px; cursor: pointer; transition: all .15s;
}
.tablist button:hover { color: var(--text); }
.tablist button[aria-selected="true"] { background: var(--bg-2); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 0 0 1px var(--line-2); }
.tabs [role="tabpanel"] { padding-top: 6px; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 1.4em 0 2em; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 40px 16px 16px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg-2); text-decoration: none; color: var(--text); transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.card strong { font: 650 15.5px/1.3 var(--display); letter-spacing: -.01em; }
.card span { font-size: 13.8px; line-height: 1.5; color: var(--text-2); }
.card .arrow { position: absolute; right: 14px; top: 17px; width: 16px; height: 16px; color: var(--text-3); transition: transform .2s, color .2s; }
.card:hover { color: var(--text); border-color: rgba(255, 90, 54, .55); transform: translateY(-2px); box-shadow: 0 16px 34px -20px rgba(255, 90, 54, .45); }
.card:hover .arrow { color: var(--accent); transform: translateX(3px); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 11px; font: 600 14.5px/1 var(--font); text-decoration: none;
  color: #fff; background: linear-gradient(180deg, var(--accent-2), var(--accent)); border: 1px solid rgba(255,255,255,.08); cursor: pointer;
  box-shadow: 0 8px 24px -10px rgba(255, 90, 54, .7), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .15s, box-shadow .15s;
}
.btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 12px 30px -10px rgba(255, 90, 54, .8), inset 0 1px 0 rgba(255,255,255,.25); }
.btn.ghost { background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); color: var(--text); }
.btn .i { width: 17px; height: 17px; }
.cta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.cta-line span { font-size: 14px; color: var(--text-3); }

/* log lines */
.loglines { padding-left: 0; list-style: none; margin: 1em 0 1.6em; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; counter-reset: ll; }
.loglines li { margin: 0; padding: 9px 14px 9px 44px; border-bottom: 1px solid var(--line); position: relative; background: var(--bg-2); counter-increment: ll; }
.loglines li:last-child { border-bottom: 0; }
.loglines li::before { content: counter(ll); position: absolute; left: 14px; top: 10px; font: 500 12px/1.4 var(--mono); color: var(--text-3); }
.loglines.miss li::before { content: "–"; }
.loglines code.logline { background: none !important; border: 0 !important; padding: 0 !important; font-size: 12.8px !important; line-height: 1.6; white-space: pre-wrap; word-break: break-all; color: var(--text-2) !important; }
.loglines.miss li { opacity: .75; }

details.src { margin: 1em 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
details.src summary { padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 15px; }
details.src figure.code { margin: 0; border-radius: 0 0 var(--radius) var(--radius); box-shadow: none; border: 0; border-top: 1px solid var(--line); }
.src-note { font-size: 13.5px; color: var(--text-3); }
.prose details:not(.src) { margin: 1em 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 0 16px; }
.prose details:not(.src) summary { padding: 12px 0; cursor: pointer; font-weight: 600; }

/* library tables */
.lib-search { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); margin: 1em 0 0; }
.lib-search:focus-within { border-color: var(--accent); }
.lib-search input { flex: 1; border: 0; background: none; color: var(--text); font: 15px var(--font); outline: none; min-width: 0; }
.lib-table td:first-child { white-space: nowrap; }
.lib-count { font-size: 13px; color: var(--text-3); }
.changelog ul { font-size: 15px; }

/* related + prev/next */
.related { margin-top: 56px; padding-top: 30px; border-top: 1px solid var(--line); }
.related h2 { font: 700 1.25rem/1.2 var(--display); margin: 0 0 4px; }
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; }
.pn { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); background: var(--bg-2); transition: border-color .15s; }
.pn span { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-3); }
.pn span .i { width: 14px; height: 14px; }
.pn strong { font: 600 15px/1.3 var(--display); }
.pn.next { text-align: right; align-items: flex-end; }
.pn:hover { border-color: var(--accent); color: var(--text); }
.edit-note { margin-top: 28px; font-size: 13.5px; color: var(--text-3); }

/* ---------------------------------------------------------------- search */
.search { position: fixed; inset: 0; z-index: 90; background: rgba(4, 6, 10, .6); backdrop-filter: blur(4px); display: flex; justify-content: center; padding: 10vh 16px 16px; }
.search[hidden] { display: none; }
.search-panel { width: min(680px, 100%); max-height: 75vh; display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); overflow: hidden; animation: pop .18s var(--ease); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.search-bar { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 58px; border-bottom: 1px solid var(--line); }
.search-bar .i { color: var(--accent); }
.search-bar input { flex: 1; border: 0; background: none; color: var(--text); font: 17px var(--font); outline: none; min-width: 0; }
.search-results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.search-results li a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text); }
.search-results li a .st { font-weight: 600; font-size: 15px; }
.search-results li a .ss { display: block; font-size: 12px; color: var(--accent); font-family: var(--mono); margin-bottom: 2px; }
.search-results li a .sd { display: block; font-size: 13px; color: var(--text-3); line-height: 1.45; margin-top: 2px; }
.search-results li a[aria-selected="true"], .search-results li a:hover { background: var(--bg-3); }
.search-results mark { background: none; color: var(--accent); }
.search-results .empty { padding: 26px 12px; text-align: center; color: var(--text-3); font-size: 14px; }
.search-foot { display: flex; gap: 16px; margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.search-foot kbd { margin-right: 3px; }

/* ---------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 40px; }
.fwrap { max-width: var(--maxw); margin: 0 auto; padding: 54px 24px 30px; display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 48px; }
.fbrand p { font-size: 14px; color: var(--text-2); }
.fbrand .disclaimer { font-size: 13px; color: var(--text-3); padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: 10px; }
.fcols { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 24px 20px; }
.fh { margin: 0 0 10px; font: 600 13px/1 var(--font); text-transform: uppercase; letter-spacing: .07em; }
.fh a { color: var(--text); text-decoration: none; }
.fcol ul { list-style: none; margin: 0; padding: 0; }
.fcol li a { display: block; padding: 3px 0; font-size: 13.5px; color: var(--text-3); text-decoration: none; }
.fcol li a:hover { color: var(--accent); }
.fbottom { max-width: var(--maxw); margin: 0 auto; padding: 18px 24px 30px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-3); }
.fbottom p { margin: 0; }
.fbottom a { color: var(--text-2); text-decoration: none; }

/* ---------------------------------------------------------------- 404 + sitemap */
.nf { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 20px; }
.nf-code { display: flex; align-items: center; gap: 6px; font: 700 clamp(5rem, 18vw, 10rem)/1 var(--display); letter-spacing: -.06em; }
.nf-code .ban { display: grid; place-items: center; width: .8em; height: .8em; color: var(--accent); filter: drop-shadow(0 0 30px rgba(255,90,54,.6)); }
.nf-code .ban .i { width: 100%; height: 100%; stroke-width: 2.4; }
.nf h1 { font: 700 2.2rem/1.1 var(--display); letter-spacing: -.03em; margin: 24px 0 10px; }
.nf p { color: var(--text-2); max-width: 520px; }
.nf-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 10px; }
ul.cols { columns: 3 220px; column-gap: 28px; padding-left: 1.1em; }
ul.cols.tight { columns: 4 170px; font-size: 14.5px; }
ul.cols li { break-inside: avoid; }

/* ---------------------------------------------------------------- tools (shared) */
.tool { margin: 1.4em 0 2.2em; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); box-shadow: var(--shadow); overflow: hidden; }
.tool-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--bg-3); }
.tool-body { padding: 18px; }
.tool label.f { display: block; font: 600 12.5px/1 var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin: 14px 0 7px; }
.tool label.f:first-child { margin-top: 0; }
.tool textarea, .tool input[type="text"], .tool input[type="number"], .tool select {
  width: 100%; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); border-radius: 10px; padding: 10px 12px;
  font: 13.5px/1.6 var(--mono); outline: none; transition: border-color .15s, box-shadow .15s;
}
.tool select { font-family: var(--font); font-size: 14.5px; cursor: pointer; }
.tool textarea { resize: vertical; min-height: 120px; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.tool textarea:focus, .tool input:focus, .tool select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tool .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.tool .hint { font-size: 13px; color: var(--text-3); margin: 6px 0 0; }
.tool .err { color: var(--danger); font: 13px/1.5 var(--mono); margin: 8px 0 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font: 600 12px/1.2 var(--font); border: 1px solid var(--line-2); color: var(--text-2); background: var(--bg-2); }
.pill.ok { color: var(--ok); border-color: rgba(61,220,151,.35); background: var(--ok-soft); }
.pill.bad { color: var(--accent); border-color: rgba(255,90,54,.35); background: var(--accent-soft); }
.pill.warn { color: var(--warn); border-color: rgba(245,184,61,.35); background: var(--warn-soft); }
.chk { display: inline-flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; user-select: none; }
.chk input { accent-color: var(--accent); width: 16px; height: 16px; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); }
.seg button { border: 0; background: none; color: var(--text-2); padding: 7px 12px; border-radius: 7px; font: 500 13.5px/1 var(--font); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--bg-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ---------------------------------------------------------------- reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .hnav a { padding: 7px 8px; font-size: 14px; }
  .search-btn { min-width: 0; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn.big span, .search-btn.big kbd { display: inline; }
}
@media (max-width: 1180px) {
  .main { grid-template-columns: minmax(0, 1fr); padding: 30px 32px 70px 40px; }
  .toc { display: none; }
}
@media (max-width: 1060px) {
  .hnav { display: none; }
  .menu-btn { display: inline-grid; }
}
@media (max-width: 920px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main { padding: 24px 16px 60px; }
  .prose h2::before { left: -12px; }
  .fwrap { grid-template-columns: 1fr; gap: 30px; }
  .hwrap { padding: 0 16px; gap: 12px; }
  .gh { display: none; }
}
@media (max-width: 560px) {
  .prose { font-size: 16px; }
  .prevnext { grid-template-columns: 1fr; }
  .page-meta { gap: 6px 14px; }
  .tool-body { padding: 14px; }
  figure.code pre { font-size: 12.8px; padding: 14px; }
  .brand-text { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media print {
  .site-header, .sidebar, .toc, .site-footer, .prevnext, .related, .copy, .search, .drawer, .edit-note { display: none !important; }
  .layout, .main { display: block; padding: 0; }
  body { background: #fff; color: #000; }
  figure.code { box-shadow: none; }
}

/* ================================================================ HOME */
.wide-main { overflow: hidden; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 860px; }
.hero { position: relative; padding: 56px 0 30px; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse 80% 70% at 60% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 30%, #000 30%, transparent 75%);
}
.hero::after {
  content: ""; position: absolute; z-index: -1; width: 900px; height: 900px; right: -220px; top: -260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 90, 54, .16), transparent 60%); filter: blur(10px);
}
.hero-grid { max-width: 1320px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 7px 14px 7px 10px; border-radius: 99px; border: 1px solid var(--line-2);
  background: var(--bg-2); font: 500 13px/1 var(--mono); color: var(--text-2);
}
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(61,220,151,.6); animation: livep 2s infinite; }
@keyframes livep { 70% { box-shadow: 0 0 0 9px rgba(61,220,151,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,151,0); } }
.hero h1 { font: 700 clamp(2.6rem, 1.6rem + 4.2vw, 5rem)/.98 var(--display); letter-spacing: -.05em; margin: 0 0 24px; text-wrap: balance; }
.grad { background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 55%, #ffc46b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: clamp(1.05rem, .98rem + .3vw, 1.22rem); line-height: 1.65; color: var(--text-2); max-width: 600px; margin: 0 0 30px; }
.hero-lead strong { color: var(--text); }
.hero-lead code, .hero-cmd code, .sec-head code, .cta code, .qs-steps :not(pre) > code { font: 500 .88em var(--mono); padding: .1em .38em; border-radius: 6px; background: var(--bg-3); border: 1px solid var(--line); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }
.hero-cta .btn { height: 50px; padding: 0 22px; font-size: 15.5px; border-radius: 13px; }
.hero-cmd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13.5px; color: var(--text-3); padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: 14px; max-width: 600px; }
.hero-cmd .lbl { font-weight: 600; color: var(--text-2); }
.hero-cmd code { font-size: 13px; color: var(--text); }
.hero-cmd var { color: var(--accent); font-style: normal; }
.hero-cmd a { margin-left: auto; text-decoration: none; font-weight: 500; }
.hero-visual { position: relative; height: 600px; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-term {
  position: absolute; left: 0; right: 6%; bottom: 0; border-radius: 14px; border: 1px solid #222b37; background: rgba(9, 12, 16, .9);
  backdrop-filter: blur(8px); box-shadow: 0 30px 60px -25px rgba(0,0,0,.8); overflow: hidden; color: #c9d4e0;
}
.ht-head { display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 12px; border-bottom: 1px solid #1d2530; font: 500 11.5px var(--mono); color: #7f8ea1; background: #0f141b; }
.dots i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; background: #ff5a36; }
.dots i:nth-child(2) { background: #f5b83d; } .dots i:nth-child(3) { background: #3ddc97; }
#hero-feed { list-style: none; margin: 0; padding: 10px 14px 12px; height: 176px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; font: 400 12px/1.85 var(--mono); }
#hero-feed li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: feedin .35s var(--ease); }
@keyframes feedin { from { opacity: 0; transform: translateY(6px); } }
#hero-feed .ts, .sim-log .ts { color: #8090a2; }
#hero-feed .w { color: #8fc1ff; font-weight: 500; }
#hero-feed .ip, .sim-log .ip { color: #ff6d4d; font-weight: 600; }
#hero-feed .n { color: #f5b83d; font-weight: 600; }
#hero-feed .ban { background: rgba(255, 90, 54, .1); }
#hero-feed .unban .n { color: #3ddc97; }
.hero-stats { max-width: 1272px; margin: 34px auto 0; padding: 0 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.hero-stats > div { padding: 18px 20px; border: 1px solid var(--line); background: var(--bg-2); }
.hero-stats > div:first-child { border-radius: 16px 0 0 16px; }
.hero-stats > div:last-child { border-radius: 0 16px 16px 0; }
.hero-stats > div + div { border-left: 0; }
.hero-stats strong { display: block; font: 700 2rem/1 var(--display); letter-spacing: -.04em; margin-bottom: 6px; }
.hero-stats span { font-size: 13.5px; color: var(--text-3); }

.band { padding: 90px 0; position: relative; }
.band + .band { border-top: 1px solid var(--line); }
.sec-head { max-width: 760px; margin-bottom: 40px; }
.kicker { margin: 0 0 12px; font: 600 12.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.sec-head h2 { font: 700 clamp(1.9rem, 1.3rem + 2vw, 2.9rem)/1.05 var(--display); letter-spacing: -.04em; margin: 0 0 16px; text-wrap: balance; }
.sec-head p { font-size: 1.08rem; color: var(--text-2); margin: 0; line-height: 1.65; }

/* simulator */
.how { background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
.sim { border: 1px solid var(--line); border-radius: 22px; background: var(--bg-2); box-shadow: var(--shadow); overflow: hidden; }
.pipeline { display: grid; grid-template-columns: repeat(5, 1fr); position: relative; padding: 30px 26px 26px; gap: 14px; }
.pipeline::before { content: ""; position: absolute; left: 10%; right: 10%; top: 62px; height: 2px; background: repeating-linear-gradient(90deg, var(--line-2) 0 8px, transparent 8px 14px); }
.stage { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stage .si { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text-2); position: relative; z-index: 1; transition: all .3s var(--ease); margin-bottom: 8px; }
.stage .si .i { width: 26px; height: 26px; }
.stage strong { font: 650 15px/1.2 var(--display); }
.stage small { font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.stage small code { font-size: 11.5px; color: var(--accent); }
.stage.hit .si { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft), 0 0 30px rgba(255,90,54,.35); transform: translateY(-3px); }
.sim.is-banned .stage[data-stage="4"] .si { border-color: var(--accent); color: #fff; background: var(--accent); }
.sim-dots { display: inline-flex; gap: 4px; margin-top: 6px; }
.sim-dots span { width: 10px; height: 10px; border-radius: 3px; border: 1px solid var(--line-2); background: var(--bg-3); transition: all .2s; }
.sim-dots span.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px rgba(255,90,54,.6); }
.fwrule { font-family: var(--mono); font-size: 11px !important; }
.sim.is-banned .fwrule { color: var(--accent); }
.sim-panel { border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 360px) 1fr; }
.sim-controls { padding: 22px; display: flex; flex-direction: column; gap: 12px; border-right: 1px solid var(--line); }
.sim-controls .btn { justify-content: center; }
.sim-range { display: flex; align-items: center; gap: 10px; font: 500 13px var(--mono); color: var(--text-2); }
.sim-range input { flex: 1; accent-color: var(--accent); }
.sim-status { font-size: 13.5px; color: var(--text-3); }
.sim.is-banned .sim-status { color: var(--accent); font-weight: 600; }
.sim-log { list-style: none; margin: 0; padding: 18px 20px; background: var(--code-bg); font: 12.5px/1.9 var(--mono); color: #c9d4e0; min-height: 210px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.sim-log li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: feedin .3s var(--ease); }
.sim-log .ban { color: #ff6d4d; }
.sim-log li.ban { background: rgba(255,90,54,.08); }
.sim-log li.drop { color: #7f8ea1; text-decoration: line-through; text-decoration-color: rgba(255,90,54,.6); }
.sim-log li.unban { color: #3ddc97; }

/* quick start */
.qs-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.qs-steps > li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg-2); }
.qn { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font: 700 18px var(--display); color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(255,90,54,.35); }
.qs-steps h3 { font: 650 1.25rem/1.3 var(--display); margin: 8px 0 12px; letter-spacing: -.02em; }
.qs-steps p { color: var(--text-2); margin: 0 0 10px; }
.qs-steps figure.code { margin: 12px 0; }
.qs-steps .tabs { margin: 0; }

/* tools grid */
.tgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tcard { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: 20px; border: 1px solid var(--line); background: var(--bg-2); text-decoration: none; color: var(--text); overflow: hidden; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.tcard::after { content: ""; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx, 80%) var(--my, 0%), rgba(255,90,54,.10), transparent 45%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.tcard:hover { transform: translateY(-4px); border-color: rgba(255,90,54,.5); color: var(--text); box-shadow: 0 24px 50px -28px rgba(255,90,54,.5); }
.tcard:hover::after { opacity: 1; }
.tico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(255,90,54,.3); }
.tico .i { width: 22px; height: 22px; }
.tcard strong { font: 650 1.15rem/1.25 var(--display); letter-spacing: -.02em; }
.tcard > span:not(.tico):not(.badge) { color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.tcard em { margin-top: auto; font-style: normal; font-size: 14px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.tcard em .i { width: 15px; height: 15px; transition: transform .2s; }
.tcard:hover em .i { transform: translateX(4px); }
.badge { position: absolute; top: 20px; right: 20px; font: 600 11px/1 var(--mono); padding: 5px 8px; border-radius: 99px; background: var(--accent); color: #fff; letter-spacing: .03em; }

/* tasks */
.tasks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.task { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg-2); text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s var(--ease); }
.task strong { font: 650 1.02rem/1.3 var(--display); }
.task code { font: 12.5px/1.5 var(--mono); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.task:hover code { color: var(--accent); }

.intro-band, .faq-band { background: var(--bg); }
.home-prose h2 { margin-top: 1.6em; }
.home-prose > h2:first-child { margin-top: 0; }
.home-faq h3 { font-size: 1.12rem; margin: 1.6em 0 .4em; }
.home-faq h3:first-child { margin-top: 0; }

.cta-band { padding: 60px 0 100px; }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 40px 44px; border-radius: 26px; border: 1px solid rgba(255,90,54,.35);
  background: radial-gradient(600px circle at 0% 0%, rgba(255,90,54,.18), transparent 60%), radial-gradient(600px circle at 100% 100%, rgba(255,196,107,.10), transparent 55%), var(--bg-2); }
.cta h2 { font: 700 clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem)/1.1 var(--display); letter-spacing: -.035em; margin: 0 0 10px; }
.cta p { margin: 0; color: var(--text-2); max-width: 640px; }
.cta .btn { flex: none; height: 52px; padding: 0 22px; }

@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { height: 520px; max-width: 720px; width: 100%; margin: 0 auto; }
  .tgrid, .tasks { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .hero { padding-top: 34px; }
  .hero-visual { height: 430px; }
  .hero-term { right: 0; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stats > div { border-radius: 0 !important; border-left: 1px solid var(--line) !important; }
  .hero-stats > div:nth-child(1) { border-radius: 14px 0 0 0 !important; } .hero-stats > div:nth-child(2) { border-radius: 0 14px 0 0 !important; }
  .hero-stats > div:nth-child(3) { border-radius: 0 0 0 14px !important; } .hero-stats > div:nth-child(4) { border-radius: 0 0 14px 0 !important; }
  .hero-stats > div:nth-child(n+3) { border-top: 0; } .hero-stats > div:nth-child(even) { border-left: 0 !important; }
  .band { padding: 64px 0; }
  .wrap, .hero-grid { padding: 0 16px; }
  .pipeline { grid-template-columns: repeat(5, minmax(64px, 1fr)); padding: 22px 12px; gap: 6px; overflow-x: auto; }
  .stage .si { width: 48px; height: 48px; border-radius: 14px; }
  .stage small { display: none; }
  .stage small.fwrule, .stage:nth-child(3) small { display: block; }
  .pipeline::before { top: 46px; }
  .sim-panel { grid-template-columns: 1fr; }
  .sim-controls { border-right: 0; border-bottom: 1px solid var(--line); }
  .tgrid, .tasks { grid-template-columns: 1fr; }
  .qs-steps > li { grid-template-columns: 1fr; padding: 18px; gap: 6px; }
  .cta { flex-direction: column; align-items: flex-start; padding: 28px 22px; }
  .hero-cmd a { margin-left: 0; }
}

/* ---------------------------------------------------------------- regex tester */
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.rt-preset { display: inline-flex; align-items: center; gap: 8px; font: 600 12.5px var(--font); color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; flex: 1 1 280px; }
.rt-preset select { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: 14px var(--font); text-transform: none; letter-spacing: 0; }
.rt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; }
.hint-inline { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-3); margin-left: 6px; }
.rt-adv { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px 12px; }
.rt-adv summary { padding: 10px 0 0; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text-2); }
.rt-sum { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.rt-sum .ms { font: 12px var(--mono); color: var(--text-3); margin-left: auto; }
.rt-lines { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--code-bg); }
.rt-lines li { padding: 8px 12px 8px 30px; border-bottom: 1px solid #18202b; position: relative; }
.rt-lines li::before { position: absolute; left: 11px; top: 9px; font: 700 12px var(--mono); }
.rt-lines li.ok::before { content: "✓"; color: #3ddc97; }
.rt-lines li.no::before { content: "·"; color: #5d6b7c; }
.rt-lines li.ign::before { content: "⊘"; color: #f5b83d; }
.rt-lines li.nf::before { content: "~"; color: #8fc1ff; }
.rt-lines li.ok { background: rgba(61, 220, 151, .04); }
.prose .tool .rt-lines code, .rt-lines code { display: block; font: 12.5px/1.6 var(--mono); color: #c9d4e0; white-space: pre-wrap; word-break: break-all; background: none; border: 0; padding: 0; }
.prose .tool .rt-lines li.no code, .rt-lines li.no code { color: #8090a2; }
.rt-lines small { display: block; font: 11.5px/1.5 var(--mono); color: #8090a2; margin-top: 2px; }
.rt-lines small b { color: #e8edf3; font-weight: 600; }
.rt-lines .md { color: #8090a2; text-decoration: underline dotted #3a4656; }
.rt-lines .mh { color: #fff; background: rgba(255, 90, 54, .35); border-radius: 3px; padding: 0 2px; }
.rt-lines li.more { color: #7f8ea1; font-size: 12px; }
.rt-ips { margin-top: 14px; }
.rt-ips table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rt-ips td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.rt-ips th { padding: 4px 8px 6px; border-bottom: 1px solid var(--line-2); text-align: left; font: 600 12px/1.2 var(--font); color: var(--text-3); }
.rt-ips p.f, .rt-cli p.f { font: 600 12.5px/1 var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin: 0 0 8px; }
.rt-cli { margin-top: 14px; }
.rt-cli pre { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--code-bg); color: var(--code-text); font: 12.5px/1.6 var(--mono); overflow-x: auto; border: 1px solid var(--code-line); }
@media (max-width: 1000px) { .rt-grid { grid-template-columns: 1fr; } }
.tool-page .main { grid-template-columns: minmax(0, 1fr); }
.tool-page .toc { display: none; }
.tool-page .article { max-width: 1160px; }
.prose .tool code, .prose .tool :not(pre) > code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.prose .rt-ips code { font: 13px var(--mono); }
.prose .tool table { margin: 0; }

/* ---------------------------------------------------------------- jail generator */
.jg-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.jg-form fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px 16px; margin: 0 0 14px; }
.jg-form legend { font: 650 14px var(--display); padding: 0 6px; color: var(--text); }
.tool .row.three { grid-template-columns: repeat(3, 1fr); }
.jg-form .chk { margin-top: 12px; }
.jg-svcs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 10px 0 4px; }
.chk.svc { margin: 0 !important; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; align-items: flex-start; }
.chk.svc:has(input:checked) { border-color: rgba(255,90,54,.5); background: var(--accent-soft); }
.chk.svc span { display: flex; flex-direction: column; gap: 1px; }
.chk.svc b { font-weight: 600; font-size: 13.5px; color: var(--text); }
.chk.svc small { font: 11.5px var(--mono); color: var(--text-3); }
.jg-sticky { position: sticky; top: calc(var(--header-h) + 16px); }
.jg-sticky figure.code { margin: 0 0 10px; }
.jg-sticky pre { max-height: 70vh; }
.jg-btns { display: inline-flex; gap: 6px; }
@media (max-width: 1000px) { .jg-grid { grid-template-columns: 1fr; } .jg-sticky { position: static; } }
@media (max-width: 520px) { .jg-svcs, .tool .row.three { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- bantime calculator */
.bc-conv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.bc-conv input { font-size: 20px !important; height: 54px; }
.bc .ex { border: 1px solid var(--line-2); background: var(--bg); color: var(--text-2); border-radius: 7px; padding: 2px 8px; font: 12.5px var(--mono); cursor: pointer; margin: 2px 2px 0 0; }
.bc .ex:hover { border-color: var(--accent); color: var(--accent); }
.bc-res { padding: 18px 20px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); min-height: 86px; display: flex; flex-direction: column; justify-content: center; }
.bc-res strong { font: 700 1.7rem/1.1 var(--display); letter-spacing: -.03em; color: var(--accent); }
.bc-res span { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.bc-h { font: 650 15px var(--display); }
.bc-h code { font-size: 12.5px; margin-left: 6px; color: var(--text-3); }
.tool .row.bc-opts { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.bc-chart { display: flex; align-items: flex-end; gap: 8px; height: 190px; margin: 22px 0 6px; padding: 0 4px; border-bottom: 1px solid var(--line); }
.bc-chart .bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.bc-chart .bar i { display: block; width: 100%; height: var(--h); border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); box-shadow: 0 0 18px -6px rgba(255,90,54,.7); transition: height .4s var(--ease); }
.bc-chart .bar span { font: 600 11px var(--mono); color: var(--text-2); white-space: nowrap; }
.bc-chart .bar b { font: 500 11px var(--mono); color: var(--text-3); margin-bottom: -22px; }
.bc-table small { color: var(--text-3); font-weight: 400; }
@media (max-width: 760px) { .bc-conv { grid-template-columns: 1fr; } .bc-chart .bar span { display: none; } }

/* ---------------------------------------------------------------- log analyzer */
.la-file { cursor: pointer; }
.la-opts { display: inline-flex; gap: 12px; margin-left: auto; font: 500 13px var(--mono); color: var(--text-2); }
.la-opts input { width: 74px; height: 32px; padding: 0 8px !important; margin-left: 6px; }
.la-status { font-size: 13px; color: var(--text-3); margin: 8px 0 14px; min-height: 18px; }
.la-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.la-card { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
.la-card strong { display: block; font: 700 1.7rem/1 var(--display); letter-spacing: -.03em; }
.la-card span { font-size: 13px; color: var(--text-3); }
.la-card.hot { border-color: rgba(255,90,54,.45); background: var(--accent-soft); }
.la-card.hot strong { color: var(--accent); }
.la-jails a.pill { text-decoration: none; margin: 0 4px 4px 0; }
.la .f, #la-out p.f { font: 600 12.5px/1 var(--font) !important; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin: 22px 0 8px !important; }
.la-spark { display: flex; align-items: flex-end; gap: 2px; height: 70px; padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.la-spark i { flex: 1; height: var(--h); background: var(--accent); opacity: .75; border-radius: 2px 2px 0 0; min-width: 2px; }
.la-spark i:hover { opacity: 1; }
.la-users .pill { margin: 0 4px 6px 0; } .la-users b { color: var(--accent); }
@media (max-width: 760px) { .la-cards { grid-template-columns: repeat(2, 1fr); } .la-opts { margin-left: 0; } }

/* ---------------------------------------------------------------- filter generator */
.fg-tokens { font: 13.5px/2.1 var(--mono); padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--code-bg); color: #c9d4e0; overflow-wrap: anywhere; }
.fg-tokens .tk { font: inherit; color: inherit; background: none; border: 1px dashed transparent; border-radius: 5px; padding: 1px 2px; cursor: pointer; }
.fg-tokens .tk:hover { border-color: #3a4656; background: #161d27; }
.fg-tokens .tk.date { color: #8090a2; text-decoration: underline dotted; cursor: default; }
.fg-tokens .tk.host { background: rgba(255,90,54,.3); color: #fff; border: 1px solid #ff5a36; }
.fg-tokens .tk.user { background: rgba(106,168,255,.25); color: #fff; border: 1px solid #6aa8ff; }
.fg-tokens .hint { font-family: var(--font); line-height: 1.5; color: #7f8ea1; }
.fg-checks { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.fg-test ul { list-style: none; padding: 0; margin: 10px 0 0; }
.fg-test li { display: grid; grid-template-columns: 220px 1fr; gap: 10px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.fg-test li.ok span { color: var(--ok); font-weight: 600; } .fg-test li.no span { color: var(--text-3); }
.fg-test code { font: 12px var(--mono); overflow-wrap: anywhere; }
.fg-outs { padding: 0 18px 8px; }
@media (max-width: 760px) { .fg-test li { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- command builder */
.cb-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 22px; }
.cb-grid .row { margin-top: 4px; }
.cb-env { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; }
.cb-env input[type="text"] { width: 160px; }
.cb-grid figure.code { margin-top: 0; }
.cb-grid figure.code pre { font-size: 14.5px; white-space: pre-wrap; }
.cb-expl p { font-size: 15px; color: var(--text-2); margin: 0; }
@media (max-width: 900px) { .cb-grid { grid-template-columns: 1fr; } }
.hero-alert { display: flex; gap: 10px; align-items: baseline; margin-top: 14px; max-width: 600px; font-size: 13.5px; line-height: 1.5; color: var(--text-2); text-decoration: none; }
.hero-alert span { flex: none; font: 600 11px/1.6 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: #fff; background: var(--danger); padding: 0 7px; border-radius: 5px; }
.hero-alert:hover { color: var(--text); }
.prose p, .prose li, .prose blockquote, .answer, .callout-body, .prose dd { overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- filter/action reference blocks */
.fref { margin: 1.6em 0 2.2em; padding-top: .4em; scroll-margin-top: calc(var(--header-h) + 20px); }
.fref + .fref { border-top: 1px solid var(--line); padding-top: 1.6em; }
.prose .fref h2, .prose .fref h3 { margin-top: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.prose .fref h2 code, .prose .fref h3 code { font-size: .92em; color: var(--accent); background: var(--accent-soft); border-color: rgba(255,90,54,.3); }
.fref-svc { font: 500 .78em var(--font); color: var(--text-3); letter-spacing: 0; }
.fref-l { font-size: 14px; color: var(--text-3); margin: 10px 0 4px !important; }
.fref .loglines { margin: .4em 0 1em; }
.fref-test { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 14px; color: var(--text-3); }
.fref-intro { color: var(--text-2); }

/* full-site footer: every page linked */
.fcols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fcol-guides { grid-row: span 2; }
.fcol-guides ul { columns: 2; column-gap: 18px; }
.fcol li a { line-height: 1.35; padding: 3px 0; }
@media (max-width: 1100px) { .fcols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .fcols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fcol-guides { grid-column: 1 / -1; grid-row: auto; } }
