/* ==========================================================================
   WhatMyIPAddressIs.com — global stylesheet

   Design language: ink on paper, solid colour, structural borders.
   No gradients, minimal shadow, tight radii. Density over whitespace.
   ========================================================================== */

/* ----------------------------- 1. Tokens ---------------------------------- */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Archivo", "Inter", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Warm paper + ink. */
  --bg: #f4f2ed;
  --bg-alt: #eae6dd;
  --surface: #ffffff;
  --surface-2: #f7f5f0;
  --text: #17191c;
  --text-muted: #585c66;
  --text-faint: #878b95;
  --border: #ddd7cb;
  --border-strong: #c3bcac;

  /* One confident accent: vermillion. Plus a deep teal for data. */
  --accent: #c2401b;
  --accent-hover: #a33415;
  --accent-soft: rgba(194, 64, 27, 0.09);
  --accent-ink: #ffffff;
  --teal: #0d6e63;
  --teal-soft: rgba(13, 110, 99, 0.1);

  --ok: #1a7a4c;
  --ok-soft: rgba(26, 122, 76, 0.11);
  --warn: #a2600b;
  --warn-soft: rgba(162, 96, 11, 0.12);
  --danger: #b02d20;
  --danger-soft: rgba(176, 45, 32, 0.11);

  --radius-sm: 3px;
  --radius: 5px;
  --radius-lg: 8px;
  --shadow-sm: none;
  --shadow: 0 1px 2px rgba(23, 25, 28, 0.06);
  --shadow-lg: 0 10px 34px -12px rgba(23, 25, 28, 0.3);

  /* Header sits lighter than the page, footer grounds it in ink — the page
     reads as printed matter rather than a floating white box. */
  --header-bg: #fbf8f1;
  --footer-bg: #1c1e23;
  --footer-text: #d9d5cc;
  --footer-dim: #8e8879;
  --footer-line: #2f323a;
  --menu-bg: #efe9dc;
  --footer-accent: #ff7a4f;

  --maxw: 1180px;
  --header-h: 65px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] {
  --bg: #131417;
  --bg-alt: #0e0f12;
  --surface: #1a1c21;
  --surface-2: #212429;
  --text: #ecebe6;
  --text-muted: #9a9ea8;
  --text-faint: #70747e;
  --border: #2b2e35;
  --border-strong: #3d414a;

  --accent: #ff6a3d;
  --accent-hover: #ff855f;
  --accent-soft: rgba(255, 106, 61, 0.13);
  --accent-ink: #17191c;
  --teal: #35c9b8;
  --teal-soft: rgba(53, 201, 184, 0.13);

  --ok: #46c47f;
  --ok-soft: rgba(70, 196, 127, 0.13);
  --warn: #e2a33a;
  --warn-soft: rgba(226, 163, 58, 0.13);
  --danger: #ef6a5e;
  --danger-soft: rgba(239, 106, 94, 0.13);

  --header-bg: #191b20;
  --footer-bg: #0c0d10;
  --footer-text: #adb1ba;
  --footer-dim: #6e7280;
  --footer-line: #23262c;
  --footer-accent: #ff7a4f;
  --menu-bg: #23262c;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 44px -14px rgba(0, 0, 0, 0.75);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131417;
    --bg-alt: #0e0f12;
    --surface: #1a1c21;
    --surface-2: #212429;
    --text: #ecebe6;
    --text-muted: #9a9ea8;
    --text-faint: #70747e;
    --border: #2b2e35;
    --border-strong: #3d414a;
    --accent: #ff6a3d;
    --accent-hover: #ff855f;
    --accent-soft: rgba(255, 106, 61, 0.13);
    --accent-ink: #17191c;
    --teal: #35c9b8;
    --teal-soft: rgba(53, 201, 184, 0.13);
    --ok: #46c47f;
    --ok-soft: rgba(70, 196, 127, 0.13);
    --warn: #e2a33a;
    --warn-soft: rgba(226, 163, 58, 0.13);
    --danger: #ef6a5e;
    --danger-soft: rgba(239, 106, 94, 0.13);
    --header-bg: #191b20;
    --footer-bg: #0c0d10;
    --footer-text: #adb1ba;
    --footer-dim: #6e7280;
    --footer-line: #23262c;
    --footer-accent: #ff7a4f;
    --menu-bg: #23262c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 44px -14px rgba(0, 0, 0, 0.75);
  }
}

/* ----------------------------- 2. Reset ----------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 14px);
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.018em;
  font-weight: 700;
}
h1 { font-size: clamp(1.85rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.8rem); }
h3 { font-size: 1.1rem; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ----------------------------- 3. Layout ---------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.container-narrow { max-width: 780px; }

.section { padding-block: clamp(40px, 6vw, 68px); }
.section-tight { padding-block: clamp(28px, 4vw, 44px); }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

.grid { display: grid; gap: 16px; }
@media (min-width: 700px)  { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 700px)  { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px)  { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px)  { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px)  { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.layout-sidebar { display: grid; gap: 28px; align-items: start; }
@media (min-width: 1040px) {
  .layout-sidebar { grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; }
  .layout-sidebar > aside { position: sticky; top: calc(var(--header-h) + 16px); }
}

.text-center { text-align: center; }
.muted { color: var(--text-muted); }
.small { font-size: 0.86rem; }
.mono { font-family: var(--font-mono); }

/* Label above a heading — a rule and small caps, not a floating pill. */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
  padding-bottom: 7px; border-bottom: 2px solid var(--accent);
}
.lead { font-size: clamp(1rem, 1.6vw, 1.1rem); color: var(--text-muted); max-width: 62ch; }

/* Kept for markup compatibility: now a solid accent, never a gradient. */
.gradient-text { color: var(--accent); }

.section-head { max-width: 660px; margin-bottom: 30px; }
.section-head p { margin-top: 10px; }
.section-head.text-center { margin-inline: auto; }

/* ----------------------------- 4. Header ---------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  /* A masthead rule, pinned to the top of the viewport as the page scrolls. */
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--border-strong);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 18px; }

.logo {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  color: var(--text); letter-spacing: -0.03em; flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; flex-shrink: 0;
}
.logo-tld { color: var(--text-faint); font-weight: 600; }
@media (max-width: 400px) { .logo-tld { display: none; } }
@media (max-width: 480px) { .logo { font-size: 0.95rem; } }

/* The links sit in their own tinted rail, so the menu reads as one object
   rather than words floating on the header. */
.nav {
  margin-left: auto; display: none; align-items: center; gap: 2px;
  background: var(--menu-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 3px;
}
@media (min-width: 940px) { .nav { display: flex; } }
.nav > a {
  padding: 6px 11px; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500; color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}
.nav > a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav > a.is-active {
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
@media (min-width: 940px) { .header-actions { margin-left: 12px; } }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-muted);
  cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--text-muted); }
.nav-toggle { display: grid; }
@media (min-width: 940px) { .nav-toggle { display: none; } }

.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

.mobile-nav {
  position: fixed; inset: var(--header-h) 0 auto 0; z-index: 99;
  background: var(--header-bg); border-bottom: 1px solid var(--border-strong);
  padding: 10px 20px 18px; box-shadow: var(--shadow-lg);
  display: none; max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
}
.mobile-nav.is-open { display: block; }
@media (min-width: 940px) { .mobile-nav { display: none !important; } }
.mobile-nav a {
  display: block; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 500; font-size: 0.94rem;
}
.mobile-nav a:hover { background: var(--menu-bg); text-decoration: none; }
.mobile-nav a.is-active {
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; text-decoration: none;
}
.mobile-nav .group-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--accent); font-weight: 700; padding: 14px 12px 5px;
  border-top: 1px solid var(--border); margin-top: 8px;
}
.mobile-nav .group-label:first-child { border-top: 0; margin-top: 0; padding-top: 6px; }

/* ----------------------------- 5. Nav dropdown ---------------------------- */
.nav-item { position: relative; }
.nav-more {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500; color: var(--text-muted);
  background: none; border: 0; cursor: pointer; font-family: inherit;
  transition: color 0.15s, background 0.15s;
}
.nav-more:hover, .nav-more[aria-expanded="true"] { background: var(--surface); color: var(--text); }
.nav-more svg { transition: transform 0.15s var(--ease); }
.nav-more[aria-expanded="true"] svg { transform: rotate(180deg); }

.nav-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 120;
  min-width: 268px; padding: 6px;
  background: var(--header-bg); border: 1px solid var(--border-strong);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: none;
}
.nav-menu.is-open { display: block; }
.nav-menu a {
  display: block; padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 0.875rem; color: var(--text-muted); font-weight: 500;
}
.nav-menu a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav-menu a.is-active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav-menu .menu-label {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--text-faint); font-weight: 700; padding: 9px 10px 4px;
}
.nav-menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }

/* ----------------------------- 6. Buttons --------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius); border: 1px solid transparent;
  font-weight: 600; font-size: 0.9rem; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--text-muted); background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-lg { padding: 13px 26px; font-size: 0.98rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ----------------------------- 7. Cards ----------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-pad-lg { padding: clamp(20px, 3vw, 28px); }
.card-hover { transition: border-color 0.15s, background 0.15s; }
.card-hover:hover { border-color: var(--border-strong); }

.tool-card { display: block; color: inherit; height: 100%; position: relative; }
.tool-card:hover { text-decoration: none; border-color: var(--accent); }
.tool-card .icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: grid; place-items: center; margin-bottom: 13px;
  background: var(--accent-soft); color: var(--accent);
}
.tool-card h3 { margin-bottom: 6px; font-size: 1rem; }
.tool-card p { color: var(--text-muted); font-size: 0.875rem; line-height: 1.55; }
.tool-card .arrow {
  margin-top: 12px; display: inline-flex; align-items: center; gap: 5px;
  color: var(--accent); font-weight: 600; font-size: 0.84rem;
}
.tool-card:hover .arrow svg { transform: translateX(3px); }
.tool-card .arrow svg { transition: transform 0.15s var(--ease); }

/* ----------------------------- 8. Hero ------------------------------------ */
/* Flat tinted band with a hard rule underneath. No glow, no mesh. */
.hero {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding-block: clamp(28px, 4.5vw, 46px) clamp(30px, 5vw, 50px);
}
.hero-head { display: grid; gap: 14px; margin-bottom: 24px; max-width: 720px; }
.hero-head h1 { margin-top: 4px; }

/* ------------------------ 9. The IP record (homepage) --------------------- */
/* One dense card: both addresses up top, every derived fact beneath, in a
   two-column ledger. Everything visible without scrolling on a laptop. */
.ip-record {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.ip-record-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 9px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint);
}
.live-dot {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--ok); letter-spacing: 0.08em;
}
.live-dot::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); flex-shrink: 0;
}

.ip-primaries { display: grid; }
@media (min-width: 840px) { .ip-primaries { grid-template-columns: 1fr 1fr; } }
.ip-primary {
  padding: 18px 16px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 7px; min-width: 0;
}
@media (min-width: 840px) { .ip-primary:first-child { border-right: 1px solid var(--border); } }
.ip-primary .k {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--text-faint);
  display: flex; align-items: center; gap: 8px;
}
.ip-primary .v {
  font-family: var(--font-mono); font-weight: 700;
  line-height: 1.25; color: var(--text); overflow-wrap: anywhere;
}
/* Sized by how long the value actually is, not by column order — an IPv6 at
   full length is 39 characters and must not wrap, wherever it sits. */
.ip-primary .v.v--short { font-size: clamp(1.3rem, 4.4vw, 2rem); }
.ip-primary .v.v--long  { font-size: clamp(0.88rem, 3.4vw, 1.26rem); }
.ip-primary .v.v--name  {
  font-family: var(--font-display); font-size: clamp(1.15rem, 3.4vw, 1.7rem);
  letter-spacing: -0.02em;
}
.ip-primary .v.is-loading { color: var(--text-faint); font-weight: 500; }
.ip-primary .v.is-empty { font-size: 0.95rem; font-weight: 500; color: var(--text-muted); font-family: var(--font-sans); }
.ip-primary .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Ledger of facts: label left, value right, hairline between. */
.ip-facts { display: grid; }
@media (min-width: 700px) { .ip-facts { grid-template-columns: 1fr 1fr; } }
.ip-facts > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 9px 16px; border-bottom: 1px solid var(--border);
  font-size: 0.875rem; min-width: 0;
}
@media (min-width: 700px) { .ip-facts > div:nth-child(odd) { border-right: 1px solid var(--border); } }
.ip-facts dt { color: var(--text-muted); white-space: nowrap; }
.ip-facts dd {
  margin: 0; font-weight: 600; text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.ip-facts dd.mono { font-family: var(--font-mono); font-size: 0.83rem; }

.ip-record-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 13px 16px;
  background: var(--surface-2);
}
.ip-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Record and map sit together: the map is the visual answer to the address,
   so it belongs beside the record, not a scroll away. */
.record-layout { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1040px) { .record-layout { grid-template-columns: minmax(0, 1fr) 336px; } }

.record-side {
  display: grid; gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.record-side .map-frame {
  border: 0; border-bottom: 1px solid var(--border);
  border-radius: 0; aspect-ratio: 4 / 3; margin: 0;
}
@media (max-width: 1039px) { .record-side .map-frame { aspect-ratio: 16 / 9; } }
.record-side-body { padding: 0 16px 16px; display: grid; gap: 10px; }
.record-side-body h2 { font-size: 0.95rem; }
.record-side-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}

/* ----------------------- 10. Address rows (v4 / v6) ----------------------- */
/* Label and copy button on one line, the address alone on the next, so a full
   IPv6 never has to fight a label for horizontal space. */
.addr-list { display: grid; }
.addr-item { padding: 13px 0; border-bottom: 1px solid var(--border); }
.addr-item:first-child { padding-top: 0; }
.addr-item:last-child { border-bottom: 0; padding-bottom: 0; }
.addr-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 6px;
}
.addr-head .k {
  font-size: 0.69rem; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--text-faint);
}
.addr-value {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(0.9rem, 3.2vw, 1.12rem);
  line-height: 1.35; color: var(--text); overflow-wrap: anywhere;
}
.addr-value.is-loading { font-weight: 500; color: var(--text-faint); }
.addr-value.is-empty {
  font-family: var(--font-sans); font-size: 0.88rem;
  font-weight: 500; color: var(--text-muted);
}

/* ----------------------------- 11. Data lists ----------------------------- */
.data-list { display: grid; }
.data-row {
  display: grid; gap: 4px 18px; padding: 11px 0;
  border-bottom: 1px solid var(--border); align-items: baseline;
}
@media (min-width: 540px) { .data-row { grid-template-columns: 190px minmax(0, 1fr); } }
.data-row:last-child { border-bottom: 0; }
.data-row dt { color: var(--text-muted); font-size: 0.875rem; }
.data-row dd { margin: 0; font-weight: 600; word-break: break-word; min-width: 0; font-size: 0.925rem; }

.copy-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 3px 8px; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600;
  color: var(--text); transition: border-color 0.15s, color 0.15s;
  max-width: 100%; word-break: break-all; text-align: left;
}
.copy-chip:hover { border-color: var(--accent); color: var(--accent); }
.copy-chip svg { flex-shrink: 0; opacity: 0.5; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: var(--radius-sm);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.01em;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

/* ----------------------------- 11. Forms ---------------------------------- */
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.86rem; }
.input, .select, textarea.input {
  width: 100%; padding: 10px 13px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder { color: var(--text-faint); }
.input-mono { font-family: var(--font-mono); }

.search-bar { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 600px) {
  .search-bar { flex-direction: row; }
  .search-bar .input { flex: 1; }
}
.hint { font-size: 0.82rem; color: var(--text-faint); }

.alert {
  padding: 12px 15px; border-radius: var(--radius); font-size: 0.885rem;
  border: 1px solid; display: flex; gap: 9px; align-items: flex-start; line-height: 1.55;
}
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 34%, transparent); }
.alert-info { background: var(--teal-soft); color: var(--teal); border-color: color-mix(in srgb, var(--teal) 34%, transparent); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 34%, transparent); }

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  padding: 4px 10px; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-muted);
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
button.pill:hover { border-color: var(--accent); color: var(--accent); }

/* ----------------------------- 12. Map ------------------------------------ */
.map-frame {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2);
  aspect-ratio: 16 / 9; position: relative;
}
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.map-frame .map-placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--text-faint); font-size: 0.86rem; text-align: center; padding: 18px;
}

/* ----------------------------- 13. Ads ------------------------------------ */
.ad-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; overflow: hidden; margin-inline: auto;
}
.ad-zone-inline { margin-block: clamp(22px, 3.5vw, 34px); }
.ad-label {
  font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 5px; font-weight: 700;
}
.ad-placeholder {
  width: 100%; display: grid; place-items: center; text-align: center;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-faint); font-size: 0.78rem; padding: 14px;
}
.ad-zone[data-format="leaderboard"] .ad-placeholder { min-height: 90px; max-width: 970px; }
.ad-zone[data-format="rectangle"] .ad-placeholder { min-height: 250px; max-width: 336px; }
.ad-zone[data-format="skyscraper"] .ad-placeholder { min-height: 600px; max-width: 300px; }
.ad-zone[data-format="in-article"] .ad-placeholder { min-height: 200px; max-width: 728px; }
.ad-zone ins.adsbygoogle { display: block; width: 100%; }

/* ----------------------------- 14. Speed test ----------------------------- */
.gauge-wrap { display: grid; place-items: center; gap: 5px; }
.gauge { width: min(260px, 74vw); aspect-ratio: 1; position: relative; }
.gauge svg { width: 100%; height: 100%; transform: rotate(135deg); }
.gauge-track { fill: none; stroke: var(--border); stroke-width: 9; stroke-linecap: butt; }
.gauge-fill {
  fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: butt;
  transition: stroke-dashoffset 0.3s var(--ease);
}
.gauge-readout { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; }
.gauge-number { font-family: var(--font-display); font-size: clamp(2rem, 8vw, 3rem); font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.gauge-unit { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); font-weight: 700; }
.gauge-phase { font-size: 0.86rem; color: var(--text-muted); margin-top: 6px; min-height: 1.4em; }

.result-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.result-tile { background: var(--surface); padding: 14px 10px; text-align: center; }
.result-tile .val { font-family: var(--font-display); font-size: clamp(1.1rem, 3.6vw, 1.5rem); font-weight: 700; }
.result-tile .key { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); font-weight: 700; margin-top: 2px; }

/* ----------------------------- 15. Prose ---------------------------------- */
.prose { max-width: 72ch; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { margin-top: 2em; font-size: clamp(1.25rem, 2.4vw, 1.55rem); scroll-margin-top: 80px; }
.prose h3 { margin-top: 1.6em; font-size: 1.05rem; }
.prose p, .prose li { color: var(--text-muted); line-height: 1.72; }
.prose strong { color: var(--text); font-weight: 650; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.4em; }
.prose code {
  font-family: var(--font-mono); font-size: 0.86em;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 1px 5px; border-radius: var(--radius-sm); color: var(--text);
}
.prose blockquote {
  border-left: 3px solid var(--accent); padding: 2px 0 2px 18px;
  color: var(--text-muted);
}
.prose table { width: 100%; border-collapse: collapse; font-size: 0.885rem; }
.prose th, .prose td { text-align: left; padding: 9px 13px; border-bottom: 1px solid var(--border); }
.prose th { font-weight: 700; color: var(--text); background: var(--surface-2); }
.prose td { color: var(--text-muted); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); }

/* FAQ */
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); margin-bottom: 8px; overflow: hidden;
}
.faq-item summary {
  padding: 14px 18px; cursor: pointer; font-weight: 650; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  font-size: 0.95rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 1.25rem; color: var(--accent); font-weight: 400;
  transition: transform 0.15s var(--ease); flex-shrink: 0; line-height: 1;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item[open] summary { border-bottom: 1px solid var(--border); }
.faq-item .faq-body { padding: 14px 18px; color: var(--text-muted); line-height: 1.7; font-size: 0.92rem; }
.faq-item .faq-body > * + * { margin-top: 0.85em; }

.breadcrumb { font-size: 0.82rem; color: var(--text-faint); display: flex; flex-wrap: wrap; gap: 7px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb span::before { content: "/"; margin-right: 7px; color: var(--border-strong); }

/* ----------------------------- 16. Related searches ----------------------- */
.related-searches { border-top: 2px solid var(--border-strong); padding-top: 22px; }
.related-searches h2 { font-size: 0.95rem; }
.related-grid {
  display: grid; gap: 6px 20px; margin-top: 14px; list-style: none; padding: 0;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.related-grid li { font-size: 0.85rem; }
.related-grid a { color: var(--text-muted); }
.related-grid a:hover { color: var(--accent); }

/* ----------------------------- 17. Footer --------------------------------- */
/* Ink ground in both themes, bookending the accent rule at the masthead. */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  border-top: 3px solid var(--footer-accent);
  padding-block: 46px 22px;
}
.site-footer .logo { color: #fff; }
.site-footer .logo-tld { color: var(--footer-dim); }

.footer-grid { display: grid; gap: 28px; }
@media (min-width: 640px)  { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.5fr repeat(4, 1fr); gap: 24px; } }
.footer-brand p {
  color: var(--footer-text); opacity: 0.75;
  font-size: 0.86rem; margin-top: 12px; max-width: 34ch; line-height: 1.6;
}
.footer-col h4 {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--footer-dim); margin-bottom: 12px;
  font-family: var(--font-sans); font-weight: 700;
  padding-bottom: 8px; border-bottom: 1px solid var(--footer-line);
}
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.footer-col a { color: var(--footer-text); font-size: 0.865rem; opacity: 0.85; }
.footer-col a:hover { color: var(--footer-accent); opacity: 1; text-decoration: none; }
.footer-bottom {
  margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--footer-line);
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  font-size: 0.8rem; color: var(--footer-dim);
}
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-bottom a { color: var(--footer-dim); }
.footer-bottom a:hover { color: var(--footer-accent); }

/* ----------------------------- 18. Misc ----------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 130%);
  background: var(--text); color: var(--bg);
  padding: 9px 18px; border-radius: var(--radius); font-size: 0.86rem; font-weight: 600;
  box-shadow: var(--shadow-lg); z-index: 999; transition: transform 0.25s var(--ease);
  pointer-events: none; max-width: calc(100vw - 40px); text-align: center;
}
.toast.is-visible { transform: translate(-50%, 0); }

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 200;
  background: var(--accent); color: var(--accent-ink); padding: 9px 16px; border-radius: var(--radius);
}
.skip-link:focus { left: 16px; }

.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;
}

.spinner {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Reveal kept for markup compatibility, but no longer floats things around. */
.reveal, .reveal.is-in { opacity: 1; transform: none; }

.divider { height: 1px; background: var(--border); border: 0; margin-block: 24px; }

/* Solid ink band, not a gradient banner. */
.cta-band {
  background: var(--text); color: var(--bg);
  border-radius: var(--radius); padding: clamp(24px, 4vw, 38px);
}
.cta-band h2 { color: var(--bg); }
.cta-band p { color: var(--bg); opacity: 0.72; margin-top: 8px; }
.cta-band .btn-secondary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.cta-band .btn-secondary:hover { background: var(--accent-hover); }
.cta-band .btn-ghost { color: var(--bg); border: 1px solid color-mix(in srgb, var(--bg) 40%, transparent); }
.cta-band .btn-ghost:hover { background: color-mix(in srgb, var(--bg) 12%, transparent); color: var(--bg); }

.stat-strip {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
@media (min-width: 760px) { .stat-strip { grid-template-columns: repeat(4, 1fr); } }
.stat-strip > div { background: var(--surface); padding: 18px 14px; }
.stat-strip .num { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; }
.stat-strip .cap { font-size: 0.78rem; color: var(--text-muted); margin-top: 1px; }

/* ----------------------------- 19. Consent banner ------------------------- */
.consent-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
  background: var(--surface); border-top: 2px solid var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(105%); transition: transform 0.28s var(--ease);
  padding: 15px 0 max(15px, env(safe-area-inset-bottom));
}
.consent-banner.is-in { transform: none; }
.consent-inner {
  width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px;
  display: grid; gap: 14px; align-items: center;
}
@media (min-width: 940px) { .consent-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 26px; } }
.consent-copy h2 {
  font-size: 0.95rem; display: flex; align-items: center; gap: 7px; margin-bottom: 5px;
  font-family: var(--font-sans); font-weight: 700;
}
.consent-copy h2 svg { color: var(--accent); flex-shrink: 0; }
.consent-copy p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; max-width: 80ch; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.consent-actions .btn { padding: 9px 16px; font-size: 0.85rem; flex: 1 1 auto; }
@media (min-width: 560px) { .consent-actions .btn { flex: 0 0 auto; } }

/* ----------------------------- 20. Consent modal -------------------------- */
.consent-modal { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 18px; }
.consent-modal-backdrop {
  position: absolute; inset: 0; background: rgba(15, 16, 19, 0.6);
  opacity: 0; transition: opacity 0.22s var(--ease);
}
.consent-modal.is-in .consent-modal-backdrop { opacity: 1; }
.consent-modal-card {
  position: relative; width: min(580px, 100%); max-height: min(86dvh, 740px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(10px); transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.consent-modal.is-in .consent-modal-card { opacity: 1; transform: none; }
.consent-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.consent-modal-head h2 { font-size: 1.05rem; }
.consent-modal-body { padding: 18px; overflow-y: auto; }
.consent-modal-foot {
  display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
  padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.consent-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-top: 12px; }
.consent-group-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.consent-group h3 { font-size: 0.92rem; margin-bottom: 3px; font-family: var(--font-sans); }
.consent-group p { line-height: 1.5; }

.switch { flex-shrink: 0; cursor: pointer; display: inline-flex; align-items: center; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 42px; height: 24px; border-radius: 999px; background: var(--border-strong);
  padding: 3px; display: block; transition: background 0.18s var(--ease);
}
.switch-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: #fff; display: block;
  transition: transform 0.18s var(--ease);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ----------------------------- 21. Copy feedback -------------------------- */
/* Applied for ~1.6s after a successful copy, then reverted by app.js. */
.copy-chip.is-copied {
  background: var(--ok-soft); border-color: var(--ok); color: var(--ok);
}
.btn.is-copied,
.btn-primary.is-copied {
  background: var(--ok); border-color: var(--ok); color: #fff;
}
.btn-secondary.is-copied { background: var(--ok); border-color: var(--ok); color: #fff; }
.is-copied svg { opacity: 1; }

/* ----------------------------- 22. Speed test panel ----------------------- */
.speed-panel {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.speed-main { display: grid; }
@media (min-width: 820px) { .speed-main { grid-template-columns: 1fr 1fr; } }

.speed-gauge-col {
  padding: 22px; display: grid; place-items: center; gap: 14px;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 820px) {
  .speed-gauge-col { border-bottom: 0; border-right: 1px solid var(--border); }
}
.speed-side { padding: 20px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }

/* Three phases, each showing its own measured value as it completes. */
.phase-list { display: grid; gap: 4px; }
.phase {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius);
  border: 1px solid transparent; transition: background 0.18s, border-color 0.18s;
}
.phase-num {
  width: 23px; height: 23px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 0.7rem; font-weight: 700;
  background: var(--surface-2); color: var(--text-faint); border: 1px solid var(--border);
}
.phase-label { font-weight: 600; font-size: 0.89rem; flex: 1; }
.phase-value {
  font-family: var(--font-mono); font-size: 0.83rem; font-weight: 700;
  color: var(--text-faint); white-space: nowrap;
}
.phase.is-active { border-color: var(--accent); background: var(--accent-soft); }
.phase.is-active .phase-num { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.phase.is-active .phase-value { color: var(--accent); }
.phase.is-done .phase-num { background: var(--ok); color: #fff; border-color: var(--ok); }
.phase.is-done .phase-value { color: var(--text); }

.speed-tiles {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--border); border-top: 1px solid var(--border);
}
@media (min-width: 620px) { .speed-tiles { grid-template-columns: repeat(4, 1fr); } }
.speed-tile { background: var(--surface); padding: 15px 14px; }
.speed-tile .key {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-faint); font-weight: 700;
}
.speed-tile .val {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(1.3rem, 4vw, 1.75rem); line-height: 1.15; margin-top: 3px;
}
.speed-tile .val small { font-size: 0.55em; font-weight: 600; color: var(--text-faint); margin-left: 3px; }

.speed-verdict {
  padding: 13px 16px; border-top: 1px solid var(--border);
  background: var(--surface-2); font-size: 0.87rem; color: var(--text-muted);
  display: flex; align-items: flex-start; gap: 9px;
}
.speed-verdict svg { color: var(--ok); flex-shrink: 0; margin-top: 2px; }

.speed-context {
  display: flex; flex-wrap: wrap; gap: 5px 18px;
  padding: 11px 16px; border-top: 1px solid var(--border);
  font-size: 0.81rem; color: var(--text-faint);
}
.speed-context b { color: var(--text-muted); font-weight: 600; }

/* ----------------------------- 23. Language picker ------------------------ */
.lang-picker .nav-more span { font-weight: 700; letter-spacing: 0.04em; }
.lang-menu { min-width: 170px; }
.lang-menu a { display: flex; align-items: center; justify-content: space-between; }
.lang-menu a.is-active::after { content: "✓"; color: var(--accent); font-weight: 700; }

.footer-note {
  margin-top: 12px; font-size: 0.78rem; color: var(--footer-dim);
  border-inline-start: 2px solid var(--footer-line); padding-inline-start: 10px;
}

/* ----------------------------- 24. RTL -----------------------------------  */
/* Most of the layout is flex/grid and mirrors on its own. These are the
   properties that do not flip automatically. */
[dir="rtl"] .nav { margin-left: 0; margin-right: auto; }
[dir="rtl"] .header-actions { margin-left: 0; margin-right: auto; }
@media (min-width: 940px) {
  [dir="rtl"] .header-actions { margin-right: 12px; margin-left: 0; }
}
[dir="rtl"] .nav-menu { right: auto; left: 0; }
[dir="rtl"] .ip-facts dd { text-align: left; }
[dir="rtl"] .skip-link { left: auto; right: -9999px; }
[dir="rtl"] .skip-link:focus { right: 16px; left: auto; }
[dir="rtl"] .breadcrumb span::before { margin-right: 0; margin-left: 7px; }
[dir="rtl"] .prose ul, [dir="rtl"] .prose ol { padding-left: 0; padding-right: 1.25em; }
[dir="rtl"] .prose blockquote {
  border-left: 0; border-right: 3px solid var(--accent);
  padding: 2px 18px 2px 0;
}
[dir="rtl"] .prose th, [dir="rtl"] .prose td { text-align: right; }
[dir="rtl"] .toast { left: 50%; right: auto; }
[dir="rtl"] .tool-card:hover .arrow svg,
[dir="rtl"] .arrow svg { transform: scaleX(-1); }
[dir="rtl"] .tool-card:hover .arrow svg { transform: scaleX(-1) translateX(3px); }

/* Addresses, ASNs and coordinates are Latin-script data: they must read
   left-to-right even inside an RTL page, or the octets reorder on screen. */
[dir="rtl"] .mono,
[dir="rtl"] .ip-primary .v,
[dir="rtl"] .addr-value,
[dir="rtl"] .copy-chip,
[dir="rtl"] .input-mono,
[dir="rtl"] .gauge-number,
[dir="rtl"] .speed-tile .val,
[dir="rtl"] .phase-value {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
}
[dir="rtl"] .ip-primary .v,
[dir="rtl"] .addr-value { text-align: right; }
[dir="rtl"] .copy-chip { flex-direction: row-reverse; }

/* Arabic needs a face with proper Arabic glyphs and a little more line height. */
[lang="ar"] {
  --font-sans: "Noto Sans Arabic", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Noto Sans Arabic", "Archivo", "Inter", sans-serif;
}
[lang="ar"] body { line-height: 1.75; }
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3 { line-height: 1.35; letter-spacing: 0; }
[lang="ar"] .eyebrow { letter-spacing: 0; }
[lang="ar"] .ip-record-bar,
[lang="ar"] .ip-primary .k,
[lang="ar"] .ad-label,
[lang="ar"] .footer-col h4,
[lang="ar"] .speed-tile .key,
[lang="ar"] .addr-head .k { letter-spacing: 0; }

/* When no ad unit is configured the sidebar rail is removed by app.js and the
   content column takes the full width. */
.layout-sidebar.no-rail { grid-template-columns: minmax(0, 1fr); }
