/* ==========================================================================
   IPAPI.GR design system — "signal console"   (public/assets/css/site.css)
   Shared by every page. Page-specific styles live in assets/css/pages/<page>.css.
   Do not add page-specific rules here.
   ========================================================================== */

:root {
  /* surfaces */
  --bg: #0a0b0a;
  --bg-2: #0e100e;
  --surface: #131613;
  --surface-2: #181c18;
  --surface-3: #1e231e;
  --line: rgba(236, 239, 233, 0.08);
  --line-2: rgba(236, 239, 233, 0.16);
  --line-3: rgba(236, 239, 233, 0.28);
  /* text */
  --text: #eceee9;
  --muted: #a3aca2;
  --faint: #6d766c;
  /* brand + signals */
  --signal: #c8f542;
  --signal-ink: #0b0d06;
  --signal-soft: rgba(200, 245, 66, 0.12);
  --ai: #b7a3ff;
  --crawler: #63e3ec;
  --scanner: #ffb547;
  /* status */
  --ok: #7ee787;
  --warn: #ffb547;
  --danger: #ff6b5b;
  --info: #63e3ec;

  --font-display: "Bricolage Grotesque", "Geist", system-ui, sans-serif;
  --font-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1180px;
  --wrap-narrow: 760px;
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
code, pre, kbd { font-family: var(--font-mono); }
::selection { background: var(--signal); color: var(--signal-ink); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip {
  position: fixed; left: 16px; top: -60px; z-index: 200; background: var(--signal); color: var(--signal-ink);
  padding: 10px 14px; border-radius: 8px; font-weight: 600; text-decoration: none; transition: top 0.2s var(--ease);
}
.skip:focus { top: 12px; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap--narrow { max-width: var(--wrap-narrow); }
.page-main { padding-top: var(--nav-h); }
.section { padding: 110px 0; position: relative; }
.section--tight { padding: 64px 0; }
.section--alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section__head { max-width: 640px; margin-bottom: 48px; }
.section__head--center { margin-inline: auto; text-align: center; }
.section__lede { color: var(--muted); font-size: 1.08rem; margin: 18px 0 0; }
.stack { display: grid; gap: var(--gap, 16px); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--gap, 12px); align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* ---------- type ---------- */
.display { font: 800 clamp(2.5rem, 5.2vw, 4.6rem)/0.98 var(--font-display); letter-spacing: -0.035em; margin: 0; text-wrap: balance; }
.display--md { font-size: clamp(2.2rem, 5vw, 4.2rem); }
.display__line { display: block; text-wrap: balance; }
.h1 { font: 800 clamp(2.3rem, 4.6vw, 3.8rem)/1 var(--font-display); letter-spacing: -0.033em; margin: 0; text-wrap: balance; }
.h2 { font: 700 clamp(2rem, 4.2vw, 3.3rem)/1.02 var(--font-display); letter-spacing: -0.03em; margin: 0; text-wrap: balance; }
.h3 { font: 700 clamp(1.3rem, 2vw, 1.6rem)/1.15 var(--font-display); letter-spacing: -0.015em; margin: 0; }
.h4 { font: 700 1.12rem/1.25 var(--font-display); letter-spacing: -0.01em; margin: 0; }
.lede { color: var(--muted); font-size: clamp(1.05rem, 1.5vw, 1.2rem); max-width: 36em; margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--font-mono); }
.hl {
  color: var(--signal);
  background: linear-gradient(100deg, var(--signal) 0%, #e9ffa6 45%, var(--signal) 90%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: shimmer 7s linear infinite;
}
.eyebrow, .kicker {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 20px;
  font: 500 0.78rem/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.kicker { color: var(--signal); }
.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.link:hover { text-decoration-color: var(--signal); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); flex: none; animation: pulse 2.2s var(--ease) infinite; }

/* ---------- buttons ---------- */
.btn {
  --h: 50px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font: 600 0.98rem/1 var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap; background: transparent;
  transition: transform 0.25s var(--ease), background-color 0.25s, border-color 0.25s, box-shadow 0.25s, opacity 0.2s;
}
.btn--sm { --h: 40px; padding: 0 16px; font-size: 0.9rem; }
.btn--xs { --h: 32px; padding: 0 12px; font-size: 0.82rem; }
.btn--block { width: 100%; }
.btn--signal { background: var(--signal); color: var(--signal-ink); }
.btn--signal:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(200, 245, 66, 0.55); }
.btn--ghost { color: var(--text); border-color: var(--line-2); background: rgba(236, 239, 233, 0.02); }
.btn--ghost:hover { border-color: var(--text); transform: translateY(-2px); }
.btn--quiet { color: var(--muted); }
.btn--quiet:hover { color: var(--text); background: rgba(236, 239, 233, 0.05); }
.btn--danger { color: var(--danger); border-color: rgba(255, 107, 91, 0.45); background: rgba(255, 107, 91, 0.06); }
.btn--danger:hover { background: rgba(255, 107, 91, 0.14); border-color: var(--danger); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--signal-ink) transparent var(--signal-ink) transparent; animation: spin 0.8s linear infinite;
}
.btn--ghost.is-loading::after, .btn--danger.is-loading::after { border-color: var(--text) transparent var(--text) transparent; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand__mark { width: 28px; height: 28px; flex: none; }
.brand__word { font: 800 1.18rem/1 var(--font-display); letter-spacing: -0.03em; }
.brand__word span { color: var(--faint); }

/* ---------- nav ---------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; padding-top: env(safe-area-inset-top, 0px); border-bottom: 1px solid transparent; transition: background-color 0.3s, border-color 0.3s; }
.nav.is-scrolled, .nav--solid {
  background: rgba(10, 11, 10, 0.78); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); }
.nav__links { display: flex; align-items: center; gap: 26px; }
.nav__links > a:not(.btn) { color: var(--muted); text-decoration: none; font-size: 0.93rem; transition: color 0.2s; position: relative; }
.nav__links > a:not(.btn):hover, .nav__links > a[aria-current="page"] { color: var(--text); }
.nav__links > a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; border-radius: 2px; background: var(--signal); }
/* 44px tap/click target without changing the bar's height. */
.nav__links > a:not(.btn) { padding-block: 10px; }
.nav__sep { width: 1px; height: 18px; background: var(--line-2); }
.nav__toggle { display: none; }

/* ---------- page hero (inner pages) ---------- */
.page-hero { position: relative; padding: calc(var(--nav-h) + 72px) 0 56px; isolation: isolate; overflow: hidden; }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 80% at 70% 0%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 70% 0%, #000 10%, transparent 70%);
}
.page-hero::after {
  content: ""; position: absolute; z-index: -1; width: 700px; height: 700px; right: -220px; top: -380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 245, 66, 0.12), transparent 65%);
}
.page-hero .lede { margin-top: 20px; }

/* ---------- cards ---------- */
.card { position: relative; padding: 26px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); }
.card--quiet { background: transparent; border-color: var(--line); }
.card--signal { border-color: rgba(200, 245, 66, 0.45); background: linear-gradient(180deg, rgba(200, 245, 66, 0.07), var(--surface) 60%); }
.card__title { margin: 0 0 8px; font: 700 1.2rem/1.2 var(--font-display); letter-spacing: -0.01em; }
.card > p:last-child { margin-bottom: 0; }

/* ---------- forms ---------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.label { font: 500 0.9rem/1.3 var(--font-body); color: var(--text); }
.hint { font-size: 0.82rem; color: var(--faint); margin: 0; }
.field-error { font-size: 0.84rem; color: var(--danger); margin: 0; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); font: 400 1rem/1.4 var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.textarea { min-height: 140px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px rgba(200, 245, 66, 0.16); background: var(--bg); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input--mono { font-family: var(--font-mono); letter-spacing: 0.04em; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23a3aca2' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 52px; }
.input-group__btn { position: absolute; right: 6px; height: 40px; min-width: 40px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.input-group__btn:hover { color: var(--text); background: rgba(236, 239, 233, 0.06); }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.94rem; color: var(--muted); }
.check input { appearance: none; width: 18px; height: 18px; margin: 0; border-radius: 5px; border: 1px solid var(--line-3); background: var(--bg-2); display: grid; place-items: center; cursor: pointer; flex: none; transition: background-color 0.2s, border-color 0.2s; }
.check input::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--signal-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked { background: var(--signal); border-color: var(--signal); }
.check input:checked::after { opacity: 1; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); margin: 0; cursor: pointer; transition: background-color 0.25s; position: relative; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 0.25s var(--ease), background-color 0.25s; }
.switch input:checked { background: var(--signal-soft); border-color: rgba(200, 245, 66, 0.5); }
.switch input:checked::after { transform: translateX(18px); background: var(--signal); }
.code-inputs { display: flex; gap: 8px; }
.code-inputs .input { width: 48px; min-height: 56px; padding: 0; text-align: center; font: 500 1.3rem/1 var(--font-mono); }

/* ---------- alerts ---------- */
.alert { --c: var(--info); display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 8%, transparent); color: var(--text); font-size: 0.94rem; }
.alert::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent); }
.alert strong { display: block; margin-bottom: 2px; }
.alert p { margin: 0; color: var(--muted); }
.alert--success { --c: var(--ok); } .alert--warn { --c: var(--warn); } .alert--danger { --c: var(--danger); } .alert--info { --c: var(--info); } .alert--important { --c: var(--ai); }

/* ---------- badges / tags / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font: 500 0.72rem/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; color: var(--muted); background: rgba(236, 239, 233, 0.06); }
.badge--signal { color: var(--signal); background: var(--signal-soft); }
.badge--ok { color: var(--ok); background: rgba(126, 231, 135, 0.1); }
.badge--warn { color: var(--warn); background: rgba(255, 181, 71, 0.1); }
.badge--danger { color: var(--danger); background: rgba(255, 107, 91, 0.1); }
.badge--ai { color: var(--ai); background: rgba(183, 163, 255, 0.12); }
.badge--crawler { color: var(--crawler); background: rgba(99, 227, 236, 0.1); }
.badge--scanner { color: var(--scanner); background: rgba(255, 181, 71, 0.1); }
.chip { font: 400 0.78rem/1 var(--font-mono); color: var(--muted); background: transparent; border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 11px; cursor: pointer; transition: color 0.2s, border-color 0.2s; }
.chip:hover, .chip[aria-pressed="true"] { color: var(--text); border-color: var(--text); }

/* ---------- tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { text-align: left; font: 500 0.74rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 14px 16px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color 0.2s; }
.table tbody tr:hover { background: rgba(236, 239, 233, 0.025); }
.table td strong, .table td.is-strong { color: var(--text); font-weight: 500; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); width: max-content; max-width: 100%; overflow-x: auto; }
.tabs [role="tab"] { border: 0; background: transparent; color: var(--muted); padding: 9px 14px; border-radius: 9px; font: 500 0.88rem/1 var(--font-body); cursor: pointer; white-space: nowrap; transition: color 0.2s, background-color 0.2s; }
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { background: var(--signal); color: var(--signal-ink); }

/* ---------- accordion ---------- */
.accordion details { border-bottom: 1px solid var(--line); }
.accordion details:first-child { border-top: 1px solid var(--line); }
.accordion summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 2px; font: 600 1.05rem/1.35 var(--font-body); }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: ""; flex: none; width: 14px; height: 14px; transition: transform 0.35s var(--ease); background: linear-gradient(var(--signal), var(--signal)) center / 100% 1.5px no-repeat, linear-gradient(var(--signal), var(--signal)) center / 1.5px 100% no-repeat; }
.accordion details[open] summary::after { transform: rotate(45deg); }
.accordion details > :not(summary) { margin: 0 0 20px; color: var(--muted); animation: fadeUp 0.35s var(--ease) both; }

/* ---------- code ---------- */
.code { position: relative; margin: 0; padding: 18px 20px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg-2); overflow-x: auto; font: 400 0.86rem/1.7 var(--font-mono); color: #d9e1d6; }
.code--block { white-space: pre; }
.code .k { color: #d9e1d6; } .code .s { color: var(--signal); } .code .n { color: var(--crawler); } .code .b { color: var(--ai); } .code .c { color: var(--faint); }
:not(pre) > code.inline, .prose :not(pre) > code { font-size: 0.88em; padding: 2px 6px; border-radius: 6px; background: rgba(236, 239, 233, 0.07); color: var(--text); }
.copy-btn { position: absolute; top: 10px; right: 10px; font: 500 0.74rem/1 var(--font-mono); color: var(--muted); background: var(--surface); border: 1px solid var(--line-2); border-radius: 7px; padding: 7px 10px; cursor: pointer; }
.copy-btn:hover { color: var(--text); }
.copy-btn.is-done { color: var(--signal); border-color: rgba(200, 245, 66, 0.45); }
.method { display: inline-flex; font: 500 0.74rem/1 var(--font-mono); padding: 5px 8px; border-radius: 6px; color: var(--signal); background: var(--signal-soft); }

/* ---------- prose (legal, docs) ---------- */
.prose { color: var(--muted); font-size: 1.02rem; line-height: 1.75; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font: 700 1.6rem/1.2 var(--font-display); letter-spacing: -0.02em; color: var(--text); margin: 2.2em 0 0.6em; }
.prose h3 { font: 700 1.2rem/1.3 var(--font-display); color: var(--text); margin: 1.8em 0 0.5em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--signal); }
.prose a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--signal); }
.prose strong { color: var(--text); font-weight: 600; }
.toc { position: sticky; top: calc(var(--nav-h) + 24px); display: grid; gap: 2px; font-size: 0.9rem; }
.toc__title { font: 500 0.74rem/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px; }
.toc a { color: var(--muted); text-decoration: none; padding: 7px 12px; border-left: 1px solid var(--line); transition: color 0.2s, border-color 0.2s; }
.toc a:hover { color: var(--text); }
.toc a[aria-current="true"] { color: var(--text); border-left-color: var(--signal); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; background: rgba(5, 6, 5, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn 0.2s var(--ease) both; }
.modal[hidden] { display: none !important; }
.modal__panel { width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 28px; border-radius: var(--radius-lg); border: 1px solid var(--line-2); background: var(--surface); box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.9); animation: popIn 0.3s var(--ease) both; }
.modal__panel--wide { max-width: 640px; }
.modal__title { margin: 0 0 10px; font: 700 1.35rem/1.2 var(--font-display); }
.modal__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* ---------- toast ---------- */
.toast-stack { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 400; display: grid; gap: 10px; }
.toast { --c: var(--signal); min-width: 240px; max-width: 360px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line-2); border-left: 3px solid var(--c); background: var(--surface-2); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8); font-size: 0.92rem; animation: popIn 0.3s var(--ease) both; }
.toast--error { --c: var(--danger); } .toast--success { --c: var(--ok); } .toast--info { --c: var(--info); }

/* ---------- auth layout ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth__aside { position: relative; overflow: hidden; padding: calc(var(--nav-h) + 48px) 56px 56px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; isolation: isolate; }
.auth__aside::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 15%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 15%, transparent 75%); }
.auth__aside::after { content: ""; position: absolute; z-index: -1; width: 640px; height: 640px; left: -200px; bottom: -300px; border-radius: 50%; background: radial-gradient(circle, rgba(200, 245, 66, 0.12), transparent 65%); }
.auth__main { display: flex; align-items: center; justify-content: center; padding: calc(var(--nav-h) + 40px) 24px 56px; }
.auth__panel { width: 100%; max-width: 420px; }
.auth__panel .h2 { font-size: clamp(1.9rem, 3vw, 2.4rem); }
.auth__alt { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.94rem; text-align: center; }
.ticks { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; color: var(--muted); }
.ticks li { position: relative; padding-left: 28px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--signal-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' fill='none' stroke='%23c8f542' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }

/* ---------- status pages (404, error, 429, maintenance, success) ---------- */
.status { min-height: calc(100vh - var(--nav-h)); display: grid; align-items: center; padding: calc(var(--nav-h) + 40px) 0 80px; }
.status__code { font: 500 0.82rem/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--signal); margin: 0 0 18px; }
.status__icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 24px; border: 1px solid var(--line-2); background: var(--surface); color: var(--signal); }
.status__icon--danger { color: var(--danger); } .status__icon--warn { color: var(--warn); } .status__icon--ok { color: var(--ok); }
.status .lede { margin-top: 18px; }
.status__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 64px 0 32px; color: var(--muted); font-size: 0.92rem; }
.foot__grid { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 32px; }
.foot__brand p { margin: 14px 0 0; max-width: 32ch; }
.foot__attr { font-size: 0.8rem; color: var(--faint); line-height: 1.7; }
.foot nav { display: flex; flex-direction: column; gap: 10px; }
.foot h3 { margin: 0 0 6px; color: var(--text); font: 600 0.84rem/1 var(--font-body); }
.foot a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.foot a:hover { color: var(--text); }
.foot__attr a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
.foot__base { display: flex; justify-content: space-between; gap: 16px; margin-top: 52px; padding-top: 22px; border-top: 1px solid var(--line); font: 400 0.8rem/1 var(--font-mono); color: var(--faint); }
.foot--compact { padding: 24px 0; }
.foot--compact .foot__base { margin-top: 0; padding-top: 0; border-top: 0; }

/* ---------- reveal (only when JS runs: html.js is set in <head>) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- keyframes ---------- */
@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(200, 245, 66, 0.55); } 70% { box-shadow: 0 0 0 10px rgba(200, 245, 66, 0); } 100% { box-shadow: 0 0 0 0 rgba(200, 245, 66, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  /* Footer links: 40px+ tap targets on touch screens. */
  .foot nav { gap: 0; }
  .foot nav a, .foot__base a, .foot .foot__link-btn { padding-block: 9px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: 1fr; }
  .auth__aside { display: none; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .foot__brand { grid-column: 1 / -1; }
}
/* Mobile/tablet navigation: hamburger + sheet below 900px (the full bar needs ~900px). */
@media (max-width: 900px) {
  .nav__toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; }
  .nav__bars, .nav__bars::before, .nav__bars::after { display: block; width: 18px; height: 1.5px; background: currentColor; border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.2s; }
  .nav__bars { position: relative; }
  .nav__bars::before, .nav__bars::after { content: ""; position: absolute; left: 0; }
  .nav__bars::before { top: -6px; } .nav__bars::after { top: 6px; }
  .nav.is-open .nav__bars { background: transparent; }
  .nav.is-open .nav__bars::before { transform: translateY(6px) rotate(45deg); }
  .nav.is-open .nav__bars::after { transform: translateY(-6px) rotate(-45deg); }
  .nav__links { position: fixed; inset: calc(var(--nav-h) + env(safe-area-inset-top, 0px)) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; padding: 10px 24px 24px; background: rgba(10, 11, 10, 0.97); border-bottom: 1px solid var(--line); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity 0.25s, transform 0.3s var(--ease), visibility 0.25s; }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; transform: none; }
  .nav.is-open { background: rgba(10, 11, 10, 0.97); }
  .nav__links > a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav__links > a[aria-current="page"]::after { display: none; }
  .nav__links .btn { margin-top: 16px; }
  .nav__sep { display: none; }
}

/* Touch-sized shared controls. */
@media (max-width: 820px) {
  .tabs [role="tab"], .chip { min-height: 40px; }
  .copy-btn { min-height: 40px; min-width: 44px; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 20px; }
  .section { padding: 64px 0; }
  .section__head { margin-bottom: 36px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-hero { padding: calc(var(--nav-h) + 44px) 0 40px; }
  .card { padding: 22px; }
  .modal__panel { padding: 22px; }
  .modal__actions .btn { flex: 1 1 auto; }
  .foot__base { flex-direction: column; padding-top: 28px; }
  .foot--compact .foot__base { padding-top: 0; }
  .toast-stack { left: 16px; right: 16px; }
  .toast { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- analytics consent banner ---------- */
.consent {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 350;
  max-width: 720px; margin-inline: auto;
  display: flex; align-items: center; gap: 16px 24px; padding: 16px 18px;
  border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-2);
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.85); animation: popIn 0.3s var(--ease) both;
}
.consent__text { margin: 0; font-size: 0.9rem; line-height: 1.5; color: var(--muted); }
.consent__text strong { color: var(--text); font-weight: 600; }
.consent__actions { display: flex; gap: 8px; flex: none; }
.foot__link-btn { padding: 0; border: 0; background: none; font: inherit; color: var(--muted); text-align: left; cursor: pointer; transition: color 0.2s; }
.foot__link-btn:hover { color: var(--text); }
@media (max-width: 600px) {
  .consent { flex-direction: column; align-items: stretch; }
  .consent__actions > .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .consent { animation: none; } }

/* ---------- scrollbars ----------
   Standard properties (Chrome/Edge 121+, Firefox) first; ::-webkit-scrollbar only where they are
   unsupported (Safari), because Chrome ignores the webkit styles once scrollbar-color is set.
   Containers that hide their scrollbar on purpose (scrollbar-width: none) keep doing so. */
:root {
  --scroll-thumb: rgba(236, 239, 233, 0.16);
  --scroll-thumb-hover: rgba(236, 239, 233, 0.30);
  --scroll-track: var(--bg);
}
html { scrollbar-color: var(--scroll-thumb) var(--scroll-track); scrollbar-gutter: stable; }
pre, .code, .table-wrap, .toc, textarea, .modal__panel, [role="region"] { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { width: 12px; height: 12px; }
  ::-webkit-scrollbar-track { background: var(--scroll-track); }
  ::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border: 3px solid var(--scroll-track); border-radius: 999px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
  ::-webkit-scrollbar-thumb:active { background: var(--signal); }
  ::-webkit-scrollbar-corner { background: transparent; }
  pre::-webkit-scrollbar, .code::-webkit-scrollbar, .table-wrap::-webkit-scrollbar, .toc::-webkit-scrollbar,
  textarea::-webkit-scrollbar, .modal__panel::-webkit-scrollbar { width: 8px; height: 8px; }
  pre::-webkit-scrollbar-track, .code::-webkit-scrollbar-track, .table-wrap::-webkit-scrollbar-track,
  .toc::-webkit-scrollbar-track, textarea::-webkit-scrollbar-track, .modal__panel::-webkit-scrollbar-track { background: transparent; }
  pre::-webkit-scrollbar-thumb, .code::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb,
  .toc::-webkit-scrollbar-thumb, textarea::-webkit-scrollbar-thumb, .modal__panel::-webkit-scrollbar-thumb { border-width: 2px; border-color: transparent; background-clip: padding-box; }
}
