/* ============================================================
   Percival's Toolkit — Design Tokens
   A playful "what's my IP" tool with an owl mascot.
   Type: Fredoka (display/playful) + Inter (body) + Space Mono (data)
   ============================================================ */

:root {
  --color-bg:        #F5F7FB;
  --color-bg-alt:     #ECF1F9;
  --color-surface:    #FFFFFF;
  --color-surface-2:  #F8FAFD;
  --color-text:       #0F172A;
  --color-muted:      #64748B;
  --color-border:     #E2E8F3;
  --color-border-strong: #CBD5E8;

  --color-accent:      #2563EB;   /* Percival blue */
  --color-accent-hover:#1D4ED8;
  --color-accent-light:#EAF0FE;
  --color-accent-ink:  #FFFFFF;   /* text on accent */

  --color-mint:        #0D9488;   /* secondary pop, links on light bg */
  --color-mask:        #EAF0FE;   /* soft accent-tinted panel bg */

  --color-success:     #15803D;
  --color-error:       #DC2626;

  --color-header-bg: rgba(245, 247, 251, 0.85);
  --color-card-inset-highlight: rgba(255, 255, 255, 0.8);
  --color-ip-copy-hover-bg: #DCE6FD;
  --color-stars-tint: #E7F5F1;

  --color-badge-good-bg: #DCFCE7;
  --color-badge-good-text: #15803D;
  --color-badge-warn-bg: #FEF3C7;
  --color-badge-warn-text: #92400E;
  --color-badge-bad-bg: #FEE2E2;
  --color-badge-bad-text: #B91C1C;

  --font-display: 'Fredoka', 'Baloo 2', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Space Mono', 'SFMono-Regular', Consolas, monospace;

  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.25rem;
  --fs-lg: 1.6rem;
  --fs-xl: 2.1rem;
  --fs-2xl: 2.75rem;

  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4rem;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 26px;
  --radius-full: 999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-base: 250ms;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.03);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 24px -8px rgba(15, 23, 42, 0.10);
  --shadow-card-hover: 0 2px 4px rgba(15, 23, 42, 0.05), 0 16px 32px -8px rgba(15, 23, 42, 0.14);
  --shadow-md: 0 12px 28px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 56px rgba(15, 23, 42, 0.10);
  --shadow-glow: 0 0 0 1px rgba(37, 99, 235, 0.16), 0 12px 32px rgba(37, 99, 235, 0.20);
  --shadow-glow-hover: 0 0 0 1px rgba(37, 99, 235, 0.22), 0 18px 40px rgba(37, 99, 235, 0.28);

  --gradient-accent: linear-gradient(135deg, #3B82F6 0%, var(--color-accent) 52%, var(--color-accent-hover) 100%);
}

/* ============================================================
   Dark theme — same tokens, dark values. Activated by
   [data-theme="dark"] on <html>, set before first paint by the
   inline script in <head> (localStorage, falling back to the OS
   prefers-color-scheme setting).
   ============================================================ */
:root[data-theme="dark"] {
  --color-bg:        #0F1A1E;
  --color-bg-alt:     #16232A;
  --color-surface:    #17252C;
  --color-surface-2:  #1E2E36;
  --color-text:       #EAF1F5;
  --color-muted:      #93A7B0;
  --color-border:     #253840;
  --color-border-strong: #33505B;

  --color-accent:      #4C93F8;
  --color-accent-hover:#6FA8FA;
  --color-accent-light:#152A42;
  --color-accent-ink:  #FFFFFF;

  --color-mint:        #2DD4BF;
  --color-mask:        #142430;

  --color-success:     #4ADE80;
  --color-error:       #F87171;

  --color-header-bg: rgba(15, 26, 30, 0.85);
  --color-card-inset-highlight: rgba(255, 255, 255, 0.04);
  --color-ip-copy-hover-bg: #1E3A5C;
  --color-stars-tint: rgba(45, 212, 191, 0.06);

  --color-badge-good-bg: rgba(74, 222, 128, 0.16);
  --color-badge-good-text: #4ADE80;
  --color-badge-warn-bg: rgba(251, 191, 36, 0.16);
  --color-badge-warn-text: #FBBF24;
  --color-badge-bad-bg: rgba(248, 113, 113, 0.16);
  --color-badge-bad-text: #F87171;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 1px rgba(0, 0, 0, 0.2);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 24px -8px rgba(0, 0, 0, 0.55);
  --shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 32px -8px rgba(0, 0, 0, 0.65);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 0 1px rgba(76, 147, 248, 0.28), 0 12px 32px rgba(76, 147, 248, 0.24);
  --shadow-glow-hover: 0 0 0 1px rgba(76, 147, 248, 0.34), 0 18px 40px rgba(76, 147, 248, 0.3);

  --gradient-accent: linear-gradient(135deg, #5B9DF9 0%, var(--color-accent) 52%, var(--color-accent-hover) 100%);
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
*, *::before, *::after {
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
html { scroll-behavior: smooth; }
@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;
  }
}
body, h1, h2, h3, p, figure { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

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

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}
::selection { background: var(--color-accent); color: var(--color-accent-ink); }

/* Soft daylight backdrop */
.stars {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 900px 520px at 88% -8%, var(--color-accent-light) 0%, transparent 60%),
    radial-gradient(ellipse 760px 500px at -10% 12%, rgba(37, 99, 235, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 700px 460px at -8% 92%, var(--color-stars-tint) 0%, transparent 55%),
    var(--color-bg);
}

/* ============================================================
   Layout helpers
   ============================================================ */
.container { max-width: 980px; margin-inline: auto; padding-inline: var(--space-4); }
@media (min-width: 768px) { .container { padding-inline: var(--space-6); } }

.section { padding-block: var(--space-7); position: relative; }
.section-alt {
  background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg-alt) 100%);
  box-shadow: inset 0 1px 0 var(--color-border), inset 0 -1px 0 var(--color-border);
}

/* Ad slots — dropped between tool section groups, never inside a tool's own
   card. Sized/blended to sit quietly rather than bark for attention: same
   surface color and radius as everything else, small muted label so it
   still reads honestly as an ad (required by most ad network policies). */
.ad-slot {
  max-width: 728px; margin-inline: auto; padding: var(--space-3);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); text-align: center; overflow: hidden;
}
.ad-slot-label {
  display: block; font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--color-muted); margin-bottom: var(--space-2);
}
#email-security { padding-top: var(--space-4); }

/* Bookmarkable sections: offset the anchor jump so the sticky header
   (which grows taller as the wrapping quick-nav adds rows on narrow
   screens) never covers the section heading you land on. */
section[id] { scroll-margin-top: calc(var(--header-height, 250px) + 20px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-mint); margin-bottom: var(--space-3);
}
.eyebrow::before { content: ''; width: 20px; height: 2px; background: var(--color-mint); border-radius: 2px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--color-accent); color: var(--color-accent-ink);
  padding: 0.75rem 1.25rem; z-index: 200; border-radius: 0 0 var(--radius-sm) 0; font-weight: 700;
}
.skip-link:focus { left: 0; }

h1, h2, h3 { font-family: var(--font-display); color: var(--color-text); font-weight: 600; line-height: 1.1; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-md); }
@media (max-width: 640px) {
  h1 { font-size: 2.1rem; }
  h2 { font-size: 1.6rem; }
}
.lede { font-size: var(--fs-md); color: var(--color-muted); line-height: 1.6; }

.section-link-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: 0.4rem;
  vertical-align: middle;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--color-border-strong);
  flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
/* Expand the tappable area to 44px without growing the visual icon (Apple HIG hit-slop pattern) */
.section-link-btn::before { content: ''; position: absolute; inset: -8px; }
.section-link-btn svg { width: 15px; height: 15px; }
.section-link-btn .icon-check { display: none; }
.section-link-btn:hover { background: var(--color-accent-light); color: var(--color-accent); }
.section-link-btn.is-copied { color: var(--color-mint); }
.section-link-btn.is-copied .icon-link { display: none; }
.section-link-btn.is-copied .icon-check { display: block; }

.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.section-head-row .btn { flex-shrink: 0; }

.section-head-icon-row { display: flex; align-items: center; gap: var(--space-3); margin-bottom: 0.5rem; }
.section-mascot { position: relative; flex-shrink: 0; width: 56px; height: 56px; border-radius: 50%; background: var(--gradient-accent); box-shadow: var(--shadow-glow); padding: 4px; }
.section-mascot-face { width: 100%; height: 100%; display: block; border-radius: 50%; object-fit: cover; background: var(--color-surface); }
.section-mascot-badge {
  position: absolute;
  bottom: -3px; right: -3px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-bg);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
}
.section-head-row .section-mascot-badge { border-color: var(--color-surface); }
.section-mascot-badge svg { width: 13px; height: 13px; }
.section-mascot-badge span { font-family: var(--font-display); font-weight: 700; font-size: 12px; line-height: 1; }
@media (max-width: 560px) {
  .section-mascot { width: 44px; height: 44px; }
  .section-mascot-badge { width: 20px; height: 20px; bottom: -2px; right: -2px; }
  .section-mascot-badge svg { width: 11px; height: 11px; }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.6rem; border-radius: var(--radius-full);
  font-weight: 700; font-size: var(--fs-sm); font-family: var(--font-body);
  border: 1px solid transparent; white-space: nowrap; cursor: pointer;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-primary { background: var(--gradient-accent); color: var(--color-accent-ink); box-shadow: var(--shadow-glow); }
.btn-primary:hover { box-shadow: var(--shadow-glow-hover); transform: translateY(-2px); }
.btn-primary.header-donate-btn:hover { color: #EC4899; }
.btn-primary:active { box-shadow: var(--shadow-glow); }
.btn-outline { background: var(--color-surface); border-color: var(--color-border-strong); color: var(--color-text); box-shadow: var(--shadow-sm); }
.btn-outline:hover { border-color: var(--color-mint); color: var(--color-mint); background: var(--color-surface-2); transform: translateY(-1px); box-shadow: var(--shadow-card); }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.site-header.is-scrolled { border-bottom-color: var(--color-border); box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06); }

.nav { display: flex; align-items: center; justify-content: space-between; padding-block: var(--space-3); gap: var(--space-3); }
.nav-actions { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.nav-actions .btn { padding-inline: 1.1rem; }
@media (max-width: 420px) {
  .nav-actions .btn span { display: none; }
  .nav-actions .btn { padding: 0.7rem; }
}

/* Icon-only toggle: same pill styling as the other header buttons, just
   without label text, so it reads as a compact icon button. */
#theme-toggle { padding: 0.7rem; }

/* Icon swap is pure CSS, keyed off the [data-theme] attribute the inline
   head script sets before first paint — so the correct icon shows even
   before main.js finishes running. */
#theme-toggle .icon-theme-sun { display: none; }
#theme-toggle .icon-theme-moon { display: block; }
:root[data-theme="dark"] #theme-toggle .icon-theme-sun { display: block; }
:root[data-theme="dark"] #theme-toggle .icon-theme-moon { display: none; }
.brand { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; object-fit: contain; }
.brand-name {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.15rem; color: var(--color-text); line-height: 1.1;
}
.brand-tag { display: none; font-size: 0.7rem; color: var(--color-muted); font-weight: 500; margin-top: 2px; }
@media (min-width: 560px) {
  .brand-name { font-size: 1.4rem; }
  .brand-tag { display: block; }
}

.quick-nav {
  border-top: 1px solid var(--color-border);
}
.quick-nav-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  padding-top: 0.6rem;
}
.quick-nav-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  border: none;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-muted);
  background: transparent;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.quick-nav-tab:hover { color: var(--color-accent); }
.quick-nav-tab[aria-selected="true"] { background: var(--gradient-accent); color: #fff; box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28); }
.quick-nav-tab[aria-selected="true"]:hover { color: #fff; }
.quick-nav-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  padding-block: 0.6rem;
}
.quick-nav-inner[hidden] { display: none; }
/* Phones: 24 links wrapped into rows can eat most of the screen height
   (a sticky header shouldn't do that), so scroll horizontally in one
   row instead — the same trick already used for wide data tables. */
@media (max-width: 600px) {
  .quick-nav-inner {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .quick-nav-inner::-webkit-scrollbar { display: none; }
}
.quick-nav a {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-muted);
  background: var(--color-bg-alt);
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.quick-nav a:hover { color: var(--color-accent); background: var(--color-accent-light); transform: translateY(-1px); }
.quick-nav a.is-active { background: var(--gradient-accent); color: #fff; box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28); }
.quick-nav a.is-active:hover { color: #fff; transform: translateY(-1px); }

/* ============================================================
   IP-changed banner
   ============================================================ */
.ip-change-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 980px;
  margin: var(--space-4) auto 0;
  padding: var(--space-3) var(--space-4);
  background: var(--color-accent-light);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: var(--fs-sm);
}
.ip-change-banner[hidden] { display: none; }
.ip-change-banner svg { width: 20px; height: 20px; color: var(--color-accent); flex-shrink: 0; }
.ip-change-banner span { flex-grow: 1; }
.ip-change-banner button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--radius-full);
  background: transparent; border: none; color: var(--color-muted); flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.ip-change-banner button:hover { background: rgba(37, 99, 235, 0.1); color: var(--color-accent); }
.ip-change-banner button svg { width: 16px; height: 16px; color: inherit; }

/* ============================================================
   Hero / IP display
   ============================================================ */
.hero { padding-block: var(--space-6) var(--space-6); text-align: center; }
.hero .eyebrow { justify-content: center; }
.hero h1 { margin-bottom: var(--space-2); }
.hero .lede { max-width: 46ch; margin-inline: auto; margin-bottom: var(--space-6); }

.mascot-wrap { display: flex; justify-content: center; margin-bottom: var(--space-4); }
.mascot { width: 200px; height: auto; filter: drop-shadow(0 16px 24px rgba(37, 99, 235, 0.18)); }

.hero h1 {
  background: linear-gradient(135deg, var(--color-text) 35%, var(--color-accent) 130%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.ip-card {
  position: relative;
  max-width: 640px;
  margin: 0 auto var(--space-5);
  background: linear-gradient(180deg, var(--color-surface-2), var(--color-surface));
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--color-card-inset-highlight), 0 0 0 1px rgba(37, 99, 235, 0.06);
}
.ip-card-label {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-muted); margin-bottom: var(--space-3);
}
.ip-value {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 3.2rem);
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 0.02em;
  word-break: break-all;
  min-height: 1.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}
.ip-value.is-loading { color: var(--color-muted); font-size: var(--fs-md); }
.ip-copy {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius-full);
  background: var(--color-accent-light); color: var(--color-accent);
  border: 1px solid rgba(37, 99, 235, 0.18); flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.ip-copy:hover { background: var(--color-ip-copy-hover-bg); transform: translateY(-1px); }
.ip-copy svg { width: 20px; height: 20px; }
.ip-copy-toast {
  position: absolute; top: -14px; right: var(--space-5);
  background: var(--color-mint); color: #FFFFFF;
  font-size: var(--fs-xs); font-weight: 700;
  padding: 0.35rem 0.8rem; border-radius: var(--radius-full);
  opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.ip-copy-toast.is-shown { opacity: 1; transform: translateY(0); }

.ip-card-error { color: var(--color-error); font-size: var(--fs-sm); margin-top: var(--space-3); display: none; }
.ip-card-error.is-shown { display: block; }

.ip-blacklist-status {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.ip-blacklist-status[hidden] { display: none; }
.ip-blacklist-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-muted); }
.ip-blacklist-label.is-alert { color: var(--color-error); }
.ip-blacklist-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.ip-blacklist-badges[hidden] { display: none; }
.ip-blacklist-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-accent);
  cursor: pointer;
  text-decoration: underline;
}
.ip-blacklist-toggle:hover { opacity: 0.8; }

.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: center; }

/* ============================================================
   Details grid
   ============================================================ */
.details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
@media (min-width: 640px) { .details-grid { grid-template-columns: 1fr 1fr; } }

.detail-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.detail-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); border-color: var(--color-border-strong); }
.detail-card .icon {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  background: rgba(111, 214, 190, 0.14); color: var(--color-mint);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.12);
}
.detail-card .icon svg { width: 20px; height: 20px; }
.detail-card .label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); margin-bottom: 0.2rem; }
.detail-card .value { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--color-text); word-break: break-word; }

.report-copy-toast {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-mint);
  margin: -0.75rem 0 var(--space-4);
  opacity: 0;
  height: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}
.report-copy-toast.is-shown { opacity: 1; height: auto; margin-top: -0.5rem; }

/* ============================================================
   Lookup tools (DNS / WHOIS-style forms)
   ============================================================ */
.lookup-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.lookup-form input {
  flex: 1 1 260px;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--fs-sm);
  font-family: var(--font-body);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.lookup-form input:hover { border-color: var(--color-border-strong); box-shadow: var(--shadow-card); }
.lookup-form input:focus,
.lookup-form select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}
.lookup-form select {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--fs-sm);
  font-family: var(--font-body);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.lookup-status {
  font-size: var(--fs-sm);
  color: var(--color-muted);
  min-height: 1.4em;
  margin-bottom: var(--space-3);
}
.lookup-status.is-error { color: var(--color-error); }

.lookup-table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-card);
}
.lookup-table { width: 100%; border-collapse: collapse; }
.lookup-table th, .lookup-table td {
  text-align: left;
  padding: 0.85rem var(--space-4);
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--color-border);
}
.lookup-table th {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--color-bg-alt);
}
.lookup-table td:first-child { font-weight: 700; color: var(--color-accent); white-space: nowrap; }
.lookup-table td:last-child { font-family: var(--font-mono); word-break: break-all; }
.lookup-table tr:last-child td { border-bottom: none; }
.lookup-table tbody tr { transition: background var(--dur-fast) var(--ease-out); }
.lookup-table tbody tr:hover { background: var(--color-bg-alt); }

/* ============================================================
   Email security check (SPF / DMARC)
   ============================================================ */
.record-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}
@media (min-width: 700px) { .record-grid { grid-template-columns: 1fr 1fr; } }

.record-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.record-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.record-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: 0.5rem; }
.record-card-head h3 { font-size: var(--fs-base); }
.record-card-desc { color: var(--color-muted); font-size: var(--fs-xs); margin-bottom: var(--space-3); line-height: 1.5; }

/* Affiliate product thumbnails (affiliates.html) — hotlinked straight from
   Amazon's own product-image CDN, same as what Amazon's SiteStripe affiliate
   tool generates. White backing box since product photos are shot on white/
   transparent backgrounds and would look cut off sitting directly on a card. */
.affiliate-product-img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  margin-bottom: var(--space-3);
}
.record-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  word-break: break-all;
  white-space: pre-wrap;
}

.badge {
  display: inline-flex; align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.badge-good { background: var(--color-badge-good-bg); color: var(--color-badge-good-text); }
.badge-warn { background: var(--color-badge-warn-bg); color: var(--color-badge-warn-text); }
.badge-bad { background: var(--color-badge-bad-bg); color: var(--color-badge-bad-text); }
.badge-neutral { background: var(--color-bg-alt); color: var(--color-muted); }

.record-note { font-size: var(--fs-xs); color: var(--color-muted); }

/* ============================================================
   Site status check
   ============================================================ */
.status-result {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-card);
}
.status-result[hidden] { display: none; }
.status-result-icon {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.status-result-icon svg { width: 24px; height: 24px; }
.status-result-icon.is-checking { background: var(--color-bg-alt); color: var(--color-muted); }
.status-result-icon.is-checking svg { animation: status-spin 1s linear infinite; }
@keyframes status-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .status-result-icon.is-checking svg { animation: none; } }
.status-result-icon.is-up { background: var(--color-badge-good-bg); color: var(--color-badge-good-text); }
.status-result-icon.is-down { background: var(--color-badge-bad-bg); color: var(--color-badge-bad-text); }
.status-result-headline { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-md); color: var(--color-text); margin-bottom: 0.2rem; }
.status-result-detail { font-size: var(--fs-sm); color: var(--color-muted); }

/* ============================================================
   Hash generator
   ============================================================ */
.hash-textarea {
  width: 100%;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--fs-sm);
  font-family: var(--font-mono);
  resize: vertical;
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.hash-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}
.hash-form-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.hash-file-label {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-full);
  border: 1px dashed var(--color-border-strong);
  color: var(--color-muted);
  font-size: var(--fs-sm);
  cursor: pointer;
  flex-grow: 1;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.hash-file-label:hover { border-color: var(--color-accent); color: var(--color-accent); }
.hash-file-label svg { width: 18px; height: 18px; flex-shrink: 0; }
.hash-table td:first-child { width: 90px; }
.hash-table td:nth-child(2) { font-size: 0.78rem; }
.hash-table td:last-child { width: 40px; }
.hash-copy {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--color-border-strong); color: var(--color-muted);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
/* Expand the tappable area to 44px without growing the visual icon (Apple HIG hit-slop pattern) */
.hash-copy::before { content: ''; position: absolute; inset: -6px; }
.hash-copy svg { width: 15px; height: 15px; }
.hash-copy:hover { background: var(--color-accent-light); color: var(--color-accent); border-color: transparent; }
.hash-copy.is-copied { background: var(--color-mint); color: #fff; border-color: transparent; }

/* ============================================================
   JWT decoder
   ============================================================ */
.jwt-results { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: var(--space-3); }
.jwt-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
}
.jwt-block-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
.jwt-block-head h3 { font-size: var(--fs-base); }
.jwt-json {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}

/* ============================================================
   Timestamp converter
   ============================================================ */
.ts-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
@media (min-width: 700px) { .ts-grid { grid-template-columns: 1fr 1fr; } }
.ts-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.ts-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.ts-card h3 { font-size: var(--fs-base); margin-bottom: var(--space-3); }
.ts-card input[type="text"],
.ts-card input[type="datetime-local"] {
  flex: 1 1 160px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-strong);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: var(--fs-sm);
  font-family: var(--font-body);
}
.ts-card input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}
.ts-output { margin-top: var(--space-3); display: flex; flex-direction: column; gap: 0.5rem; }
.ts-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: 0.6rem 0.85rem;
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}
.ts-label { color: var(--color-muted); font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; }
.ts-value { font-family: var(--font-mono); color: var(--color-text); word-break: break-word; text-align: right; }

/* ============================================================
   Regex tester
   ============================================================ */
.regex-pattern-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.5rem;
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-sm);
}
.regex-slash { color: var(--color-muted); font-family: var(--font-mono); font-size: var(--fs-md); flex-shrink: 0; }
.regex-pattern-row input#regex-pattern {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--color-text);
  padding: 0.5rem 0.25rem;
}
.regex-pattern-row input#regex-pattern:focus { outline: none; }
.regex-flags-input {
  width: 4.5rem;
  flex-shrink: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--color-accent);
  padding: 0.5rem 0.75rem;
  text-align: center;
}
.regex-flags-input:focus { outline: none; border-color: var(--color-accent); }
.regex-preview {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 3em;
  box-shadow: var(--shadow-card);
}
.regex-preview mark {
  background: var(--color-accent-light);
  color: var(--color-accent-hover);
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 700;
}
.regex-matches { margin-top: var(--space-3); font-size: var(--fs-sm); color: var(--color-muted); }
.regex-matches .match-item { color: var(--color-text); font-family: var(--font-mono); font-size: 0.8rem; padding: 0.3rem 0; border-bottom: 1px solid var(--color-border); }
.regex-matches .match-item:last-child { border-bottom: none; }
.regex-matches .match-item strong { color: var(--color-accent); }

/* ============================================================
   Password / passphrase generator
   ============================================================ */
.tabs { display: inline-flex; padding: 0.3rem; background: var(--color-bg-alt); border: 1px solid var(--color-border); border-radius: var(--radius-full); gap: 0.25rem; box-shadow: var(--shadow-sm); }
.tab-btn {
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-muted);
  background: transparent;
  border: none;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.tab-btn:hover:not([aria-selected="true"]) { color: var(--color-text); }
.tab-btn[aria-selected="true"] { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-sm); }
.pwgen-row { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: var(--space-3); }
.pwgen-row label { font-size: var(--fs-sm); font-weight: 600; color: var(--color-text); }
.pwgen-row input[type="range"] { width: 100%; accent-color: var(--color-accent); }
.pwgen-checks { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); }
.pwgen-checks label { display: flex; align-items: center; gap: 0.4rem; font-size: var(--fs-sm); color: var(--color-text); }
.pwgen-checks input[type="checkbox"] { accent-color: var(--color-accent); width: 16px; height: 16px; }
.pwgen-checks input[type="text"] {
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
}

/* ============================================================
   Speed test — climbing number
   ============================================================ */
.speed-numbers { display: grid; grid-template-columns: 1fr; gap: var(--space-4); margin-bottom: var(--space-3); }
@media (min-width: 700px) { .speed-numbers { grid-template-columns: 1fr 1fr; } }
.speed-number-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-base) var(--ease-out);
}
.speed-number-title { display: block; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-muted); margin-bottom: var(--space-2); }
.speed-number-value {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 8vw, 3.5rem);
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.speed-number-value.is-active { animation: speed-number-pulse 0.6s ease-in-out infinite; }
@keyframes speed-number-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
@media (prefers-reduced-motion: reduce) { .speed-number-value.is-active { animation: none; } }
.speed-number-unit { display: block; font-size: var(--fs-sm); color: var(--color-muted); font-weight: 600; margin-top: 0.3rem; }

/* ============================================================
   Blacklist check
   ============================================================ */
.blacklist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-2); margin-bottom: var(--space-3); }
.blacklist-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.blacklist-item:hover { box-shadow: var(--shadow-card); transform: translateY(-1px); }

/* ============================================================
   Preshared key generator
   ============================================================ */
.psk-form select { flex: 1 1 180px; }
.psk-output {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-card);
}
.psk-value {
  flex-grow: 1;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-accent);
  word-break: break-all;
  line-height: 1.6;
}

/* ============================================================
   Fun fact strip
   ============================================================ */
.fact-strip {
  background: var(--color-mask);
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  box-shadow: var(--shadow-card);
}
.fact-strip svg { width: 44px; height: 44px; color: var(--color-accent); flex-shrink: 0; }
.fact-strip-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-mint); margin-bottom: 0.3rem; }
.fact-strip p { color: var(--color-text); font-size: var(--fs-sm); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { padding-block: var(--space-6) var(--space-5); border-top: 1px solid var(--color-border); }
.footer-row {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-3); text-align: center;
}
.footer-brand { display: flex; align-items: center; gap: 0.5rem; color: var(--color-muted); font-size: var(--fs-sm); }
.footer-brand svg, .footer-brand img { width: 22px; height: 22px; color: var(--color-accent); object-fit: contain; }
.site-footer .footer-note { font-size: var(--fs-xs); color: var(--color-muted); }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-4); }
.footer-nav a { color: var(--color-muted); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.footer-nav a:hover { color: var(--color-accent); text-decoration: underline; }
.footer-nav a.footer-nav-gear:hover { color: var(--color-mint); }
.footer-nav a.footer-nav-donate { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--color-accent); font-weight: 700; }
.footer-nav a.footer-nav-donate svg { width: 13px; height: 13px; }
.footer-nav a.footer-nav-donate:hover { color: #EC4899; text-decoration: none; }

/* ============================================================
   Cron explainer
   ============================================================ */
.cron-description {
  padding: var(--space-4);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--fs-md);
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

/* ============================================================
   HTTP status code reference
   ============================================================ */
.http-status-result {
  padding: var(--space-4);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}
.http-status-result-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.http-status-result-code { font-family: var(--font-mono); font-size: var(--fs-xl); font-weight: 700; color: var(--color-accent); }
.http-status-result-name { font-weight: 700; margin-bottom: 0.25rem; }
.http-status-result-desc { color: var(--color-muted); font-size: var(--fs-sm); }
.http-status-full-table td:last-child { font-family: var(--font-body); }
.http-status-full-list summary {
  cursor: pointer; font-weight: 600; font-size: var(--fs-sm); color: var(--color-accent);
  padding: var(--space-2) 0;
}

/* ============================================================
   Mobile refinements (phones, ≤640px — iOS/Android)
   ============================================================ */
@media (max-width: 640px) {
  /* iOS Safari auto-zooms the whole page when a focused text input's
     font-size is under 16px — bump every form control to avoid it. */
  .lookup-form input,
  .lookup-form select,
  select,
  .hash-textarea,
  .ts-card input[type="text"],
  .ts-card input[type="datetime-local"],
  .regex-pattern-row input#regex-pattern,
  .regex-flags-input,
  .pwgen-checks input[type="text"] {
    font-size: 16px;
  }

  /* 24 stacked sections at desktop-level padding makes for a very long
     scroll on a phone — tighten the rhythm without feeling cramped. */
  .section { padding-block: var(--space-6); }
  .hero { padding-block: var(--space-5) var(--space-5); }

  /* Keep the category tabs on one row instead of wrapping to two,
     so the sticky header doesn't grow an extra row on small phones. */
  .quick-nav-tabs { gap: 0.2rem; }
  .quick-nav-tab { padding: 0.5rem 0.4rem; font-size: 0.68rem; min-height: 36px; }
}

/* ============================================================
   Reveal
   ============================================================ */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
   Master lookup
   ============================================================ */
.master-tool-picker-label { font-size: var(--fs-sm); color: var(--color-text); margin-bottom: var(--space-3); }
.master-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.master-tool-item {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.master-tool-item:hover { box-shadow: var(--shadow-card); transform: translateY(-1px); }
.master-tool-item.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.master-tool-item input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--color-accent); }

.master-progress-list { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.master-progress-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  font-size: var(--fs-sm);
}
.master-progress-item .badge { flex-shrink: 0; }

/* Report action toolbars (connection details + master lookup): a format
   picker plus download/copy buttons, sitting below that section's content
   rather than up by the heading. Right-aligned in one row on desktop; on
   phones there isn't room for that, so by default they wrap left-aligned
   and hug each other like a compact button row instead of each stacking
   as its own full-width line. */
.report-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  margin-top: var(--space-4);
}
.report-actions[hidden] { display: none; }
@media (max-width: 640px) {
  .report-actions { justify-content: flex-start; gap: var(--space-2); }
}

/* Master lookup's action row: fully stacked, one full-width button per
   row, on phones — .master-progress-list right above it already carries
   its own bottom margin, so no extra top margin needed here. Desktop
   still sits as a single row, inherited from .report-actions above. */
#master-report-actions { margin-top: 0; }
@media (max-width: 640px) {
  #master-report-actions {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }
  #master-report-actions .format-select-wrap,
  #master-report-actions .format-select-btn {
    width: 100%;
  }
}

.format-select-wrap { position: relative; }
.format-select-btn { display: inline-flex; align-items: center; gap: 0.5rem; justify-content: center; }
.format-select-chevron { width: 14px; height: 14px; flex-shrink: 0; transition: transform var(--dur-fast) var(--ease-out); }
.format-select-btn[aria-expanded="true"] .format-select-chevron { transform: rotate(180deg); }
.format-select-menu {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  z-index: 20;
}
.format-select-menu li {
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
}
.format-select-menu li:hover { background: var(--color-accent-light); color: var(--color-accent); }
.format-select-menu li[aria-selected="true"] { color: var(--color-accent); }

.subdomain-list {
  max-height: 280px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.9;
  white-space: pre-line;
  word-break: break-all;
  margin-bottom: var(--space-3);
}
