/* ══════════════════════════════════════════════════════════════════════════
   oh no, it's DOWN? — styles
   One system: spacing 4/8/12/16/24/32/48/64/96/128 · radius 8/12/20
   Type: Open Sans (self-hosted), weights 400/500 only
   Interface neutral; one accent (#a60000) for primary button, focus, links, state
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Font ─────────────────────────────────────────────────────────────────── */
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 300 800;
  src: url("../fonts/open-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 300 800;
  src: url("../fonts/open-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ── Tokens ───────────────────────────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --soft: #f4f6f9;
  --surface: #ffffff;
  --border: #e8ecf1;
  --border-strong: #d5dbe3;
  --text: #0f1729;
  --text2: #4f5a6b;
  --text3: #667085;
  --accent: #a60000;
  --accent-hover: #8c0000;
  --accent-soft: #fbeeee;
  --on-accent: #ffffff;

  --ok: #15803d;      --ok-bg: #f0fdf4;   --ok-line: #bbf7d0;
  --warn: #c2410c;    --warn-bg: #fff7ed; --warn-line: #fed7aa;
  --bar-warn: #ea580c;   /* bars only: brighter than --down, 3.6:1 on white (text keeps --warn) */
  --down: #b91c1c;    --down-bg: #fef2f2; --down-line: #fecaca;

  --ph-dns: #0891b2;
  --ph-connect: #3b82f6;
  --ph-tls: #d49b0b;
  --ph-server: #ea6a1f;
  --ph-download: #94a3b8;

  --shadow: 0 1px 2px rgba(15, 23, 41, .04), 0 8px 24px rgba(15, 23, 41, .06);
  --shadow-lift: 0 2px 4px rgba(15, 23, 41, .05), 0 16px 32px rgba(15, 23, 41, .09);

  --nav-h: 72px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px;
  --font: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17; --soft: #0f1520; --surface: #121826; --border: #232c3d; --border-strong: #2f3a4f;
    --text: #eef1f6; --text2: #a3adbf; --text3: #8d97aa;
    --accent: #ff7b70; --accent-hover: #ff978e; --accent-soft: rgba(255, 123, 112, .12); --on-accent: #2a0606;
    --ok: #4ade80;   --ok-bg: rgba(74, 222, 128, .08);  --ok-line: rgba(74, 222, 128, .28);
    --warn: #fb923c; --warn-bg: rgba(251, 146, 60, .08); --warn-line: rgba(251, 146, 60, .3); --bar-warn: #fb923c;
    --down: #f87171; --down-bg: rgba(248, 113, 113, .08); --down-line: rgba(248, 113, 113, .3);
    --ph-dns: #22b8d6; --ph-connect: #60a5fa; --ph-tls: #eab308; --ph-server: #fb8a3c; --ph-download: #7c8798;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .3), 0 16px 32px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f17; --soft: #0f1520; --surface: #121826; --border: #232c3d; --border-strong: #2f3a4f;
  --text: #eef1f6; --text2: #a3adbf; --text3: #8d97aa;
  --accent: #ff7b70; --accent-hover: #ff978e; --accent-soft: rgba(255, 123, 112, .12); --on-accent: #2a0606;
  --ok: #4ade80;   --ok-bg: rgba(74, 222, 128, .08);  --ok-line: rgba(74, 222, 128, .28);
  --warn: #fb923c; --warn-bg: rgba(251, 146, 60, .08); --warn-line: rgba(251, 146, 60, .3); --bar-warn: #fb923c;
  --down: #f87171; --down-bg: rgba(248, 113, 113, .08); --down-line: rgba(248, 113, 113, .3);
  --ph-dns: #22b8d6; --ph-connect: #60a5fa; --ph-tls: #eab308; --ph-server: #fb8a3c; --ph-download: #7c8798;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .3), 0 16px 32px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 24px); }
body {
  margin: 0;
  padding-top: var(--nav-h);
  background: var(--bg);
  color: var(--text);
  font: 400 16px/26px var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: 58px; line-height: 1.04; letter-spacing: -0.035em; }
h2 { font-size: 38px; line-height: 1.1;  letter-spacing: -0.03em; }
h3 { font-size: 20px; line-height: 28px; letter-spacing: -0.01em; }
h4 { font-size: 13px; line-height: 20px; letter-spacing: 0; color: var(--text2); }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
strong { font-weight: 500; }
code { font-family: var(--mono); font-size: 14px; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.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; top: 8px; left: 8px; z-index: 100;
  padding: 8px 16px; border-radius: var(--r-sm);
  background: var(--text); color: var(--bg); font-size: 14px;
  transform: translateY(-200%); transition: transform .15s;
}
.skip:focus { transform: none; }

.wrap {
  width: 100%; max-width: 1280px; margin: 0 auto;
  padding-left: max(80px, env(safe-area-inset-left, 0px));
  padding-right: max(80px, env(safe-area-inset-right, 0px));
}
.muted { color: var(--text3); }
.lead { font-size: 20px; line-height: 32px; color: var(--text2); }
.t-ok { color: var(--ok); } .t-warn { color: var(--warn); } .t-down { color: var(--down); }
.wrap-any { overflow-wrap: anywhere; }

/* links in running text: underline draws in on hover */
.prose a, .faq a, .footer a, .cc-intro a {
  color: var(--accent);
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  transition: background-size .25s ease;
}
.prose a:hover, .faq a:hover, .footer a:hover, .cc-intro a:hover { background-size: 100% 1px; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 24px; border-radius: var(--r-md);
  font: 500 16px/1 var(--font); letter-spacing: 0;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 6px 16px -6px var(--accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--text3); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; border-radius: var(--r-sm); }
.btn-lg { height: 52px; padding: 0 32px; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: var(--r-md); border: 1px solid transparent; background: none;
  color: var(--text2); cursor: pointer; transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--soft); color: var(--text); }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: none; }
}

/* ── Navigation ───────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h); background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-inner { height: 100%; display: flex; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); flex-shrink: 0; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent);
}
.brand-name { font-size: 18px; font-weight: 500; letter-spacing: -0.02em; white-space: nowrap; }
.brand-down { color: var(--accent); }
.nav-links { display: flex; gap: 32px; margin-left: 16px; }
.nav-links a {
  color: var(--text2); font-size: 15px;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  transition: color .15s, background-size .25s ease; padding: 4px 0;
}
.nav-links a:hover { color: var(--text); background-size: 100% 1px; }
.nav-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lang-select {
  height: 44px; padding: 0 32px 0 12px; border-radius: var(--r-md);
  border: 1px solid transparent; background: transparent; color: var(--text2);
  font: 500 14px var(--font); cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.lang-select:hover { background-color: var(--soft); color: var(--text); }
.lang-select option { color: #0f1729; background: #fff; }
.nav-cta { margin-left: 8px; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  min-height: calc(100svh - var(--nav-h));
  display: flex; align-items: center;
  padding: 64px 0 96px;
  background:
    radial-gradient(60% 50% at 50% 0%, var(--accent-soft), transparent 70%),
    var(--bg);
}
.hero-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero h1 { max-width: 15ch; margin-top: 24px; }
.hero .lead { max-width: 640px; margin-top: 24px; }
.hero-compact { min-height: 0; padding: 64px 0 48px; }
.hero-compact h1 { font-size: 38px; }
.hero-compact .lead { display: none; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; line-height: 1; font-weight: 500; color: var(--text2);
}
.pill-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 var(--ok); animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 8px transparent; }
}

.check-form { width: 100%; max-width: 680px; margin-top: 48px; text-align: left; }
.field-label { display: block; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--text2); margin: 0 0 8px 4px; }
.field {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.field-icon { color: var(--text3); flex-shrink: 0; }
.field input {
  flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent;
  color: var(--text); font: 400 18px var(--font);
}
.field input::placeholder { color: var(--text3); }
.field .btn { height: 48px; padding: 0 28px; }
.form-msg { min-height: 0; }
.form-error {
  margin-top: 12px; padding: 12px 16px; border-radius: var(--r-md);
  background: var(--down-bg); border: 1px solid var(--down-line); color: var(--down); font-size: 15px; line-height: 24px;
}
.hero-note { margin: 12px 0 0 4px; font-size: 14px; color: var(--text3); }

/* entrance once on load */
@media (prefers-reduced-motion: no-preference) {
  .hero-wrap > * { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-wrap > :nth-child(2) { animation-delay: .06s; }
  .hero-wrap > :nth-child(3) { animation-delay: .12s; }
  .hero-wrap > :nth-child(4) { animation-delay: .18s; }
  .hero-compact .hero-wrap > * { animation: none; }
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ── Result ───────────────────────────────────────────────────────────────── */
.result { padding: 0 0 72px; }
.result-wrap { display: grid; gap: 24px; }

.verdict {
  --v: var(--text2); --v-bg: var(--soft); --v-line: var(--border);
  display: grid; grid-template-columns: auto 1fr; gap: 24px;
  padding: 32px; border-radius: var(--r-lg);
  background: var(--v-bg); border: 1px solid var(--v-line);
}
.v-up      { --v: var(--ok);   --v-bg: var(--ok-bg);   --v-line: var(--ok-line); }
.v-slow,
.v-partial { --v: var(--warn); --v-bg: var(--warn-bg); --v-line: var(--warn-line); }
.v-down    { --v: var(--down); --v-bg: var(--down-bg); --v-line: var(--down-line); }
.verdict-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; background: var(--v); color: var(--bg);
}
.verdict-icon svg { width: 32px; height: 32px; stroke-width: 2.4; }
.v-pending .verdict-icon { background: var(--surface); color: var(--accent); border: 1px solid var(--border); }
.v-pending .verdict-icon svg { animation: spin 1s linear infinite; }
.v-unknown .verdict-icon, .v-invalid .verdict-icon { background: var(--text3); }
@keyframes spin { to { transform: rotate(360deg); } }
.verdict-body { min-width: 0; }
.verdict-label { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--v); }
.verdict-title {
  margin-top: 4px; font-size: 32px; line-height: 1.15; letter-spacing: -0.03em;
  overflow-wrap: anywhere; outline: none;
}
.verdict-text { margin-top: 12px; max-width: 760px; font-size: 18px; line-height: 28px; color: var(--text2); }
.timer { font-variant-numeric: tabular-nums; }

.dots { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.dots li { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text2); }

.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.is-ok .dot { background: var(--ok); }
.is-slow .dot { background: var(--warn); }
.is-fail .dot { background: var(--down); }
.is-unreach .dot { background: transparent; border: 2px solid var(--text3); }
.is-pending .dot { background: var(--text3); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

.verdict-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--v-line);
}
.recheck { margin: 0; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-link {
  display: inline-flex; align-items: center; height: 36px; padding: 0 12px;
  border-radius: var(--r-sm); font-size: 14px; color: var(--text2);
  transition: background-color .15s, color .15s;
}
.share-link:hover { background: var(--surface); color: var(--text); }
.checked-at { margin-left: auto; font-size: 13px; color: var(--text3); }

/* cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 32px;
}
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }

.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.legend li { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text3); }
.swatch { width: 10px; height: 10px; border-radius: 3px; }

.ph-dns { background: var(--ph-dns); }
.ph-connect { background: var(--ph-connect); }
.ph-tls { background: var(--ph-tls); }
.ph-server { background: var(--ph-server); }
.ph-download { background: var(--ph-download); }

/* locations */
.locs { list-style: none; margin: 0; padding: 0; }
.loc { padding: 16px 0; border-top: 1px solid var(--border); }
.loc:first-child { border-top: 0; padding-top: 0; }
.loc:last-child { padding-bottom: 0; }
.loc-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; }
.loc-name { font-size: 16px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-status { font-size: 14px; color: var(--text2); text-align: right; }
.is-fail .loc-status { color: var(--down); }
.is-slow .loc-status { color: var(--warn); }
.is-unreach .loc-status, .is-pending .loc-status { color: var(--text3); }
.loc-time { min-width: 72px; text-align: right; font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 500; }
.bar { margin: 12px 0 0 22px; height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.bar-fill { display: flex; height: 100%; border-radius: 4px; overflow: hidden; }
.bar-fill .seg { height: 100%; min-width: 2px; }
.loc-meta { margin: 8px 0 0 22px; font-size: 13px; line-height: 20px; color: var(--text3); }
@media (prefers-reduced-motion: no-preference) {
  .loc.is-ok, .loc.is-slow, .loc.is-fail, .loc.is-unreach { animation: fadein .35s ease both; }
  .bar-fill { animation: grow .6s cubic-bezier(.2, .7, .2, 1) both; transform-origin: left; }
}
@keyframes fadein { from { opacity: .3; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* details */
.det-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.det { min-width: 0; }
.det h4 { margin-bottom: 8px; font-weight: 500; }
.det p { font-size: 15px; line-height: 24px; }
.kv { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; font-size: 15px; line-height: 24px; }
.kv dt { color: var(--text3); }
.kv dd { margin: 0; min-width: 0; }
.hops { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hops li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; font-size: 14px; line-height: 22px; }
.hops .code { font-variant-numeric: tabular-nums; color: var(--text2); min-width: 32px; }
.hop-url { overflow-wrap: anywhere; color: var(--text); }
.grade { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; margin-bottom: 12px; }
.grade-ok { background: var(--ok-bg); color: var(--ok); }
.grade-warn { background: var(--warn-bg); color: var(--warn); }
.grade-down { background: var(--down-bg); color: var(--down); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.checks li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; line-height: 22px; }
.checks code { font-size: 13px; color: var(--text2); overflow-wrap: anywhere; }
.checks .is-yes span { color: var(--ok); }
.checks .is-no span { color: var(--text3); }
.det-wait { animation: blink 1.6s ease-in-out infinite; }

/* ad below the result */
.ad-wrap { padding-bottom: 48px; }
.ad-label { font-size: 13px; color: var(--text3); margin-bottom: 8px; }

/* ── Sections ─────────────────────────────────────────────────────────────── */
.section { padding: 120px 0 72px; }
.section-soft { background: var(--soft); padding-bottom: 120px; }
.section-lead { margin-top: 16px; max-width: 720px; }

.cards-3 { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.feature { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--border-strong); }
.num { display: block; font-size: 13px; font-weight: 500; color: var(--accent); margin-bottom: 24px; font-variant-numeric: tabular-nums; }
.feature h3 { margin-bottom: 8px; }
.feature p { color: var(--text2); }
.feature-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 24px; }
.feature .legend { margin-top: 12px; }

.loc-list { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.loc-list li {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); font-size: 16px;
}
.cc {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm);
  background: var(--soft); color: var(--text2); font-size: 13px; font-weight: 500; letter-spacing: .02em;
}

.faq-wrap { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 48px; }
.faq { display: grid; }
.faq-item { padding: 24px 0; border-top: 1px solid var(--border); }
.faq-item:first-child { border-top: 0; padding-top: 8px; }
.faq-item p { margin-top: 8px; color: var(--text2); }

.cta { padding-bottom: 120px; }
.cta-wrap {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px;
  padding-top: 96px; padding-bottom: 96px;
  border-radius: var(--r-lg);
  background: radial-gradient(70% 90% at 50% 0%, var(--accent-soft), transparent 70%), var(--soft);
  max-width: calc(1280px - 160px);
}
.cta-wrap .btn { margin-top: 16px; }

/* ── Legal pages ──────────────────────────────────────────────────────────── */
.legal { padding: 96px 0 120px; }
.legal-wrap { max-width: 880px; }
.legal h1 { font-size: 38px; line-height: 1.1; margin-bottom: 12px; }
.prose { margin-top: 32px; max-width: 70ch; color: var(--text2); }
.prose h2 { font-size: 22px; line-height: 30px; color: var(--text); margin: 48px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 20px; color: var(--text); margin: 32px 0 8px; }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: 12px; }
.prose ul { padding-left: 20px; margin: 12px 0 0; }
.prose li + li { margin-top: 8px; }
.prose strong { color: var(--text); }
.prose code { overflow-wrap: anywhere; background: var(--soft); padding: 2px 6px; border-radius: 6px; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 64px 0 32px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
.footer-brand p { margin-top: 16px; max-width: 360px; color: var(--text2); }
.footer-h { font-size: 13px; font-weight: 500; color: var(--text3); margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer nav a { color: var(--text2); }
.footer nav a:hover, .footer nav a[aria-current] { color: var(--text); }
.footer-langs { grid-template-columns: repeat(2, max-content); column-gap: 24px !important; }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text3); }

/* ── Cookie banner ────────────────────────────────────────────────────────── */
.cc-overlay {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center;
  padding: 16px; background: rgba(11, 15, 23, .35);
}
.cc-box {
  width: 100%; max-width: 640px; max-height: calc(100svh - 32px); overflow: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 32px; box-shadow: var(--shadow-lift);
}
.cc-title { font-size: 24px; line-height: 32px; }
.cc-intro { margin-top: 12px; color: var(--text2); font-size: 15px; line-height: 24px; }
.cc-link { margin-top: 12px; padding: 0; border: 0; background: none; color: var(--accent); font: 500 14px var(--font); cursor: pointer; }
.cc-cats { margin-top: 16px; display: grid; gap: 12px; }
.cc-cat { border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; }
.cc-cat-hdr { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.cc-cat-name { font-weight: 500; }
.cc-cat-txt p + p { margin-top: 4px; font-size: 14px; line-height: 22px; color: var(--text2); }
.cc-always { font-size: 13px; color: var(--ok); white-space: nowrap; }
.cc-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.cc-slider { position: absolute; inset: 0; border-radius: 12px; background: var(--border-strong); transition: background-color .15s; }
.cc-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.cc-switch input:checked + .cc-slider { background: var(--accent); }
.cc-switch input:checked + .cc-slider::after { transform: translateX(20px); }
.cc-switch input:focus-visible + .cc-slider { outline: 2px solid var(--accent); outline-offset: 2px; }
.cc-detail { margin-top: 12px; font-size: 14px; }
.cc-detail summary { cursor: pointer; color: var(--text2); }
.cc-table-wrap { overflow-x: auto; margin-top: 8px; }
.cc-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 20px; }
.cc-table th, .cc-table td { text-align: left; padding: 8px; border-top: 1px solid var(--border); vertical-align: top; }
.cc-table th { font-weight: 500; color: var(--text3); }
.cc-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 24px; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .det-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-links { display: none; }
}
@media (max-width: 900px) {
  .cards-3, .loc-list { grid-template-columns: minmax(0, 1fr); }
  .faq-wrap { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  :root { --nav-h: 56px; }
  .wrap {
    padding-left: max(24px, env(safe-area-inset-left, 0px));
    padding-right: max(24px, env(safe-area-inset-right, 0px));
  }
  h1 { font-size: 30px; line-height: 1.12; }
  h2 { font-size: 24px; line-height: 1.2; }
  h3 { font-size: 18px; line-height: 26px; }
  .lead { font-size: 18px; line-height: 28px; }
  .nav-inner { gap: 8px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-name { font-size: 16px; }
  .nav-cta { display: none; }
  .hero { padding: 48px 0 64px; }
  .hero-compact { padding: 32px 0 32px; }
  .hero-compact h1 { font-size: 24px; }
  .check-form { margin-top: 32px; }
  .field { flex-wrap: wrap; padding: 8px; }
  .field-icon { display: none; }
  .field input { flex-basis: 100%; padding: 0 8px; font-size: 16px; }
  .field .btn { width: 100%; }
  .section { padding: 96px 0 48px; }
  .section-soft, .cta { padding-bottom: 96px; }
  .verdict { grid-template-columns: minmax(0, 1fr); padding: 24px; gap: 16px; }
  .verdict-icon { width: 48px; height: 48px; }
  .verdict-icon svg { width: 24px; height: 24px; }
  .verdict-title { font-size: 22px; }
  .verdict-text { font-size: 16px; line-height: 26px; }
  .checked-at { margin-left: 0; width: 100%; }
  .card { padding: 24px; }
  .det-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .loc-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  .loc-status { grid-column: 2 / -1; grid-row: 2; text-align: left; }
  .loc-name { white-space: normal; }
  .loc-time { min-width: 0; }
  .share-link { padding: 0 8px; }
  .cta-wrap { padding: 64px 24px; margin: 0 24px; width: auto; }
  .legal { padding: 64px 0 96px; }
  .legal h1 { font-size: 24px; }
  .prose h2 { font-size: 19px; line-height: 27px; }
  .footer-grid { gap: 32px; }
  .cc-box { padding: 24px; }
  .cc-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 420px) {
  .lang-select { padding: 0 24px 0 8px; background-position: right 6px center; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
}


/* ══ Pages beyond the home page: services, account ════════════════════════ */
.small { font-size: 14px; line-height: 22px; }
.is-none .dot { background: var(--border-strong); }

.nav-account {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px;
  border-radius: var(--r-md); color: var(--text2); font-size: 15px; transition: background-color .15s, color .15s;
}
.nav-account:hover { background: var(--soft); color: var(--text); }

.page-head { padding: 64px 0 32px; }
.page-head h1 { font-size: 38px; line-height: 1.1; }
.page-head .lead { margin-top: 16px; }
.section-tight { padding: 32px 0 64px; }
.crumb { font-size: 14px; color: var(--text3); margin-bottom: 16px; }
.crumb a { color: var(--text2); }
.crumb a:hover { color: var(--text); }
.h-sub { font-size: 22px; line-height: 30px; margin-bottom: 8px; }
.h-card { font-size: 20px; line-height: 28px; }
.h-card a { color: var(--text); }
.h-card a:hover { color: var(--accent); }
.h-cat { font-size: 20px; line-height: 28px; margin-bottom: 16px; }
.section-more { margin-top: 24px; }
.link-arrow { font-weight: 500; background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px; transition: background-size .25s ease; }
.link-arrow::after { content: " →"; }
.link-arrow:hover { background-size: 100% 1px; }

/* service list */
.svc-grid { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.svc-cat .svc-grid { margin-top: 0; }
.svc-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px;
  padding: 16px 20px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border);
  color: var(--text); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.svc-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--border-strong); }
.svc-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-state { grid-column: 2; font-size: 13px; line-height: 20px; color: var(--text3); }
.svc-item.is-fail .svc-state { color: var(--down); }
.svc-item.is-slow .svc-state { color: var(--warn); }
.svc-cats { display: grid; gap: 48px; }

/* 24 h history bars */
.blocks { display: flex; gap: 2px; height: 32px; }
.blocks span { flex: 1; border-radius: 2px; background: var(--border); }
.blocks .b-up { background: var(--ok); }
.blocks .b-partial, .blocks .b-slow { background: var(--bar-warn); }
.blocks .b-down { background: var(--down); }
.blocks-note { margin-top: 12px; }
.mon .blocks { height: 24px; margin-top: 16px; }

/* home: account teaser */
.acct-teaser { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 48px; align-items: center; }
.acct-card { display: grid; gap: 24px; justify-items: start; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 32px; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ok-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* forms */
.form { display: grid; gap: 16px; }
.form-row { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.f { display: grid; gap: 8px; min-width: 0; }
.f label, .f-label { font-size: 13px; line-height: 20px; font-weight: 500; color: var(--text2); }
.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 400 16px var(--font); transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { appearance: auto; }
.hint { font-size: 13px; line-height: 20px; color: var(--text3); margin-top: -8px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-ok {
  padding: 12px 16px; border-radius: var(--r-md); background: var(--ok-bg); border: 1px solid var(--ok-line);
  color: var(--ok); font-size: 15px; line-height: 24px;
}
.form-ok a, .form-error a { color: inherit; text-decoration: underline; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover { color: var(--down); background: var(--down-bg); }
.btn-danger { background: var(--down); color: #fff; }
.btn-danger:hover { box-shadow: 0 6px 16px -6px var(--down); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* auth pages */
.auth { padding: 64px 0 120px; }
.auth-wrap { display: grid; justify-content: center; }
.auth-two { grid-template-columns: minmax(0, 440px) minmax(0, 360px); gap: 64px; align-items: center; }
.auth-card { width: 100%; max-width: 440px; display: grid; gap: 16px; }
.auth-card h1 { font-size: 24px; line-height: 32px; }
.auth-lead { margin-top: -8px; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; font-size: 14px; }
.auth-side .ticks { margin-top: 16px; }

/* account app */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 32px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 12px 16px; color: var(--text2); font-size: 15px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }
.tabs a:last-child { margin-left: auto; }
.acct-stack { display: grid; gap: 24px; }
.acct-stack.narrow { max-width: 760px; }
.empty { padding: 24px 0; }
.card-danger { border-color: var(--down-line); }
.card > .h-card + .form, .card > .h-card + .muted { margin-top: 16px; }

.mon-add { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; gap: 16px; align-items: end; }
.mon-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.mon-dot { display: inline-flex; }
.mon-dot .dot { display: block; width: 12px; height: 12px; }
.mon-dot.is-ok .dot { background: var(--ok); } .mon-dot.is-slow .dot { background: var(--warn); } .mon-dot.is-fail .dot { background: var(--down); }
.mon-state { font-size: 15px; color: var(--text2); text-align: right; }
.st-up { color: var(--ok); } .st-slow, .st-partial { color: var(--warn); } .st-down { color: var(--down); }
.st-unknown, .st-paused { color: var(--text3); }
.stats { margin: 24px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; }
.stats dt { font-size: 13px; line-height: 20px; color: var(--text3); }
.stats dd { margin: 4px 0 0; font-size: 20px; line-height: 28px; font-weight: 500; font-variant-numeric: tabular-nums; }
.stats dd.small { font-size: 13px; line-height: 20px; font-weight: 400; margin-top: 0; }
.stats-4 { margin: 0; }
.mon-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.mon-actions form { display: flex; flex-wrap: wrap; gap: 8px; }

.seg-nav { display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--r-md); background: var(--soft); }
.seg-nav a { padding: 6px 12px; border-radius: var(--r-sm); font-size: 14px; color: var(--text2); }
.seg-nav a[aria-current] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 41, .08); }
.chart-box { position: relative; height: 280px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 22px; }
.table th { text-align: left; font-weight: 500; font-size: 13px; color: var(--text3); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
  .svc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-account span { display: none; }
}
@media (max-width: 900px) {
  .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acct-teaser, .auth-two { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mon-add { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .page-head { padding: 40px 0 24px; }
  .page-head h1 { font-size: 24px; }
  .h-sub { font-size: 19px; line-height: 27px; }
  .section-tight { padding: 24px 0 48px; }
  .auth { padding: 32px 0 64px; }
  .mon-head { grid-template-columns: auto minmax(0, 1fr); }
  .mon-state { grid-column: 2; text-align: left; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .chart-box { height: 220px; }
  .nav-account { padding: 0 10px; }
}
@media (max-width: 420px) {
  .svc-grid { grid-template-columns: minmax(0, 1fr); }
  .stats dd { font-size: 18px; }
}


/* ══ Service pages: status in sentences, archive, outages page ════════════ */
.status-text { display: grid; gap: 12px; }
.status-text p { color: var(--text2); }
.status-text p:first-of-type { color: var(--text); font-size: 18px; line-height: 28px; }
.loc-sentences { list-style: none; margin: 24px 0 0; padding: 24px 0 0; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.loc-sentences li { font-size: 15px; line-height: 24px; color: var(--text2); }
.arch-sum { margin: 8px 0 24px; max-width: 820px; color: var(--text2); font-size: 17px; line-height: 28px; }
#archive .result-card { margin-bottom: 16px; }
.arch-details { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); margin-top: 12px; }
.arch-details summary {
  cursor: pointer; list-style: none; padding: 16px 20px; font-weight: 500;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.arch-details summary::-webkit-details-marker { display: none; }
.arch-details summary::after { content: "+"; font-size: 20px; color: var(--text3); transition: transform .2s; }
.arch-details[open] summary::after { transform: rotate(45deg); }
.arch-details summary:hover { color: var(--accent); }
.arch-list { list-style: none; margin: 0; padding: 0 20px 16px; display: grid; gap: 10px; }
.arch-list li { font-size: 15px; line-height: 24px; color: var(--text2); padding-top: 10px; border-top: 1px solid var(--border); }
.arch-list li.is-open, .inc-page-list li.is-open p { color: var(--down); }
.inc-page-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.inc-page-list li { padding: 20px 24px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.inc-page-list li.is-open { border-color: var(--down-line); background: var(--down-bg); }
.inc-page-list a.h-card { color: var(--text); }
.inc-page-list a.h-card:hover { color: var(--accent); }
.inc-page-list p { margin-top: 6px; color: var(--text2); font-size: 15px; line-height: 24px; }
@media (max-width: 768px) {
  .status-text p:first-of-type { font-size: 16px; line-height: 26px; }
  .arch-sum { font-size: 16px; line-height: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ══ Knowledge pages: error codes, guides, tools, monthly reports ═════════ */
.lex-link { font-size: 14px; white-space: nowrap; margin-left: 4px; }
.lex-link::after { content: " →"; }
.lex-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.loc-status .lex-link { margin-left: 6px; }

/* header: three dropdown menus — open on hover (mouse), keyboard focus or tap (.is-open, set by app.js) */
.nav-links { gap: 8px; margin-left: 8px; }
.nav-dd { position: relative; }
.nav-dd-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px;
  border: 0; border-radius: var(--r-md); background: transparent; cursor: pointer;
  color: var(--text2); font: 400 15px var(--font); white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.nav-dd-btn svg { flex-shrink: 0; transition: transform .2s; }
.nav-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; min-width: 230px;
  list-style: none; margin: 0; padding: 8px; display: grid; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lift);
  /* hidden; closes with a short delay so a small slip of the mouse does not shut it */
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .15s ease .15s, transform .15s ease .15s, visibility 0s linear .3s;
}
/* invisible bridge over the 8 px gap, so the menu stays open on the way down */
.nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.nav-dd.is-open .nav-menu, .nav-dd:has(:focus-visible) .nav-menu {
  opacity: 1; visibility: visible; transform: none; transition: opacity .15s ease, transform .15s ease, visibility 0s;
}
.nav-dd.is-open .nav-dd-btn, .nav-dd:has(:focus-visible) .nav-dd-btn { color: var(--text); background: var(--soft); }
.nav-dd.is-open .nav-dd-btn svg, .nav-dd:has(:focus-visible) .nav-dd-btn svg { transform: rotate(180deg); }
@media (hover: hover) {
  .nav-dd:hover .nav-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .15s ease, transform .15s ease, visibility 0s; }
  .nav-dd:hover .nav-dd-btn { color: var(--text); background: var(--soft); }
  .nav-dd:hover .nav-dd-btn svg { transform: rotate(180deg); }
}
/* closed with Esc: stays shut while the focus is still on its button */
.nav-links .nav-dd.esc-closed .nav-menu { opacity: 0; visibility: hidden; transition: none; }
.nav-links .nav-dd.esc-closed .nav-dd-btn svg { transform: none; }
.nav-menu a {
  display: block; padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--text2); font-size: 15px; line-height: 22px; white-space: nowrap; background: none;
}
.nav-menu a:hover, .nav-menu a:focus-visible { color: var(--text); background: var(--soft); }
.nav-account span { white-space: nowrap; }
.nav-links, .nav-tools { flex-shrink: 0; }
/* below 1280 px the account link shows its icon only, so the menus keep their room */
@media (max-width: 1280px) { .nav-account span { display: none; } }
@media (max-width: 1200px) {
  .nav .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
  .nav-inner { gap: 16px; }
  .nav-links { margin-left: 0; gap: 4px; }
}
.nav-account svg, .icon-btn svg { flex-shrink: 0; }

/* redirect chain: an error sits below its URL */
.hop-error { display: block; color: var(--down); font-size: 13px; line-height: 20px; margin-top: 2px; }
.hop-fail .code { color: var(--down); }

/* footer with four columns */
.footer-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }

/* service page: fact sheet */
.facts { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
.facts-kv { margin-top: 16px; }
.facts-text p { color: var(--text2); margin-top: 12px; max-width: 70ch; }
.facts-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* lexicon index */
.lex-groups { display: grid; gap: 56px; }
.lex-group-p { max-width: 760px; margin: -8px 0 20px; }
.lex-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lex-item {
  display: grid; gap: 2px; height: 100%; padding: 16px 20px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.lex-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--border-strong); }
.lex-code { font-weight: 500; overflow-wrap: anywhere; }
.lex-label { font-size: 14px; line-height: 22px; color: var(--text3); }
.kn-check { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; align-items: center; }
.kn-check .check-form { margin-top: 0; }

/* article + side column (error pages, guides, tools) */
.article-grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 64px; align-items: start; }
.know-prose { margin-top: 0; max-width: 72ch; }
.know-prose h2 { font-size: 24px; line-height: 32px; }
.know-prose ol { padding-left: 22px; margin: 12px 0 0; }
.know-prose ol li + li { margin-top: 8px; }
.know-prose p + ol, .know-prose ul + ul, .know-prose ol + p, .know-prose pre + p, .know-prose p + pre, .know-prose table + p { margin-top: 12px; }
.know-prose pre {
  margin: 12px 0 0; padding: 12px 16px; border-radius: var(--r-sm); background: var(--soft); border: 1px solid var(--border);
  overflow-x: auto; font-size: 14px; line-height: 22px; color: var(--text);
}
.know-prose pre code { background: none; padding: 0; font-size: 14px; }
.know-prose .table-wrap { margin-top: 16px; }
.know-prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 24px; }
.know-prose th { text-align: left; font-weight: 500; font-size: 13px; color: var(--text3); padding: 8px 16px 8px 0; border-bottom: 1px solid var(--border); }
.know-prose td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--border); color: var(--text); font-variant-numeric: tabular-nums; }
.know-prose .note { padding: 16px 20px; border-radius: var(--r-md); background: var(--soft); color: var(--text2); margin-top: 16px; }
.who {
  display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 14px; border-radius: 999px;
  font-size: 14px; line-height: 22px; background: var(--soft); color: var(--text);
}
.who-k { color: var(--text3); }
.who-site { background: var(--down-bg); }
.who-you  { background: var(--warn-bg); }
.who-both { background: var(--soft); }
.who-none { background: var(--ok-bg); }
.know-prose .who + h2 { margin-top: 32px; }
.kn-more { margin-top: 40px !important; }
.aside-stack { display: grid; gap: 24px; position: sticky; top: calc(var(--nav-h) + 24px); }
.aside-check .check-form { margin-top: 16px; }
.aside-check .field { flex-wrap: wrap; padding: 8px; }
.aside-check .field-icon { display: none; }
.aside-check .field input { flex-basis: 100%; padding: 0 8px; height: 44px; }
.aside-check .field .btn { width: 100%; }
.aside-check .field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.aside-check .muted { margin-top: 8px; }
.aside-links ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.aside-links a { font-size: 15px; line-height: 22px; }
.aside-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.guide-phases { margin-top: 16px; padding: 16px 20px; border-radius: var(--r-md); border: 1px solid var(--border); }
.guide-phases .legend { margin-top: 12px; }

/* cards: guides index, tools index, home */
.kn-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.kn-cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kn-cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 48px; }
.kn-card { display: grid; align-content: start; gap: 8px; }
.kn-card p { color: var(--text2); overflow-wrap: anywhere; }
.kn-card h2 a, .kn-card h3 a { color: var(--text); }
.kn-card h2 a:hover, .kn-card h3 a:hover { color: var(--accent); }
.kn-cards-4 .kn-card { grid-template-rows: auto 1fr auto; }
.kn-cards-4 .link-arrow { justify-self: start; margin-top: 8px; font-size: 15px; }

/* tools */
.tool-top { padding-top: 0; }
.tool-form { margin-top: 0; max-width: 760px; }
.tool-result { margin-top: 24px; display: grid; gap: 16px; }
.tool-result .card-head { flex-wrap: wrap; gap: 4px 16px; margin-bottom: 0; }
.tool-msg { font-size: 17px; line-height: 28px; }
.tool-kv { font-size: 15px; }
.tool-table td:first-child { white-space: nowrap; }
.rr { display: inline-block; min-width: 52px; font-family: var(--mono); font-size: 13px; color: var(--text2); }
.tool-legend { margin-top: 8px; font-size: 14px; line-height: 22px; }
.tool-notes { margin: 0; padding-left: 20px; color: var(--text2); display: grid; gap: 6px; }
.tool-next { margin-top: 4px; }
[data-tool-form][aria-busy="true"] .btn { opacity: .7; }

/* monthly reports */
.rep-wrap { display: grid; gap: 24px; }
.rep-stats { margin: 0; }
.rep-text { max-width: 80ch; }
.rep-text p { color: var(--text2); }
.rep-text p:first-child { color: var(--text); font-size: 18px; line-height: 28px; }
.rep-causes { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.rep-n { display: inline-block; min-width: 40px; font-variant-numeric: tabular-nums; color: var(--text3); }
.rep-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.rep-rank { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.rep-rank li span { float: right; color: var(--text2); font-variant-numeric: tabular-nums; }
.rep-all { padding: 0 20px 16px; }
.rep-method { margin-top: 24px; }
.rep-method p { color: var(--text2); }
.rep-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rep-running { margin-top: 12px; }

@media (max-width: 1100px) {
  .lex-grid, .kn-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kn-cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-grid { gap: 40px; }
}
@media (max-width: 900px) {
  .article-grid, .facts, .kn-check, .rep-two { grid-template-columns: minmax(0, 1fr); }
  .aside-stack { position: static; }
  .facts { gap: 24px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .lex-groups { gap: 40px; }
  .know-prose h2 { font-size: 19px; line-height: 27px; }
  .tool-msg, .rep-text p:first-child { font-size: 16px; line-height: 26px; }
}
@media (max-width: 600px) {
  .lex-grid, .kn-cards, .kn-cards-2, .kn-cards-4 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
}
/* long codes and grid children never push the page wider */
.rep-wrap > *, .article-grid > *, .facts > * { min-width: 0; }
.page-head h1, .lex-code, .stats dt, .stats dd { overflow-wrap: anywhere; }

/* history bars: one short info on hover (mouse) or tap (.is-tip, set by app.js) */
.blocks [data-tip] { position: relative; cursor: default; outline: none; }
.blocks [data-tip]:hover, .blocks [data-tip].is-tip { filter: brightness(1.15); }
.blocks [data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 20;
  transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  padding: 6px 10px; border-radius: var(--r-sm); background: var(--text); color: var(--bg);
  font-size: 13px; line-height: 18px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transition: opacity .12s;
}
.blocks .tip-l::after { left: 0; transform: none; }
.blocks .tip-r::after { left: auto; right: 0; transform: none; }
@media (hover: hover) { .blocks [data-tip]:hover::after { opacity: 1; visibility: visible; } }
.blocks [data-tip].is-tip::after { opacity: 1; visibility: visible; }
