:root {
  color-scheme: light;
  --bg: #f6f8ff;
  --bg-2: #eef5ff;
  --surface: rgba(255,255,255,.88);
  --surface-solid: #ffffff;
  --surface-2: #f1f5fb;
  --surface-3: #e8eef8;
  --text: #0b1220;
  --heading: #071026;
  --muted: #536174;
  --soft: #718096;
  --border: rgba(105,121,148,.22);
  --border-strong: rgba(82,98,127,.34);
  --accent: #635bff;
  --accent-2: #12c2e9;
  --accent-3: #7c3aed;
  --success: #087443;
  --success-bg: #eaf8f1;
  --warning: #a15c07;
  --warning-bg: #fff6e6;
  --danger: #b42318;
  --danger-bg: #fff0ef;
  --shadow-sm: 0 10px 28px rgba(15, 23, 42, .08);
  --shadow: 0 24px 70px rgba(15, 23, 42, .13);
  --shadow-lg: 0 34px 110px rgba(15, 23, 42, .17);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 30px;
  --max: 1180px;
  --nav-h: 76px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070a12;
  --bg-2: #0b1220;
  --surface: rgba(15, 23, 42, .82);
  --surface-solid: #101827;
  --surface-2: #111c2e;
  --surface-3: #17233a;
  --text: #e8edf7;
  --heading: #f8fbff;
  --muted: #a4afbf;
  --soft: #8794a8;
  --border: rgba(148,163,184,.18);
  --border-strong: rgba(148,163,184,.28);
  --accent: #8b7cff;
  --accent-2: #1bd5ef;
  --accent-3: #a78bfa;
  --success: #5ee0a2;
  --success-bg: rgba(8,116,67,.18);
  --warning: #f7c66b;
  --warning-bg: rgba(161,92,7,.18);
  --danger: #ff8f86;
  --danger-bg: rgba(180,35,24,.18);
  --shadow-sm: 0 14px 34px rgba(0,0,0,.28);
  --shadow: 0 28px 80px rgba(0,0,0,.38);
  --shadow-lg: 0 42px 120px rgba(0,0,0,.50);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    color-scheme: dark;
    --bg: #070a12;
    --bg-2: #0b1220;
    --surface: rgba(15, 23, 42, .82);
    --surface-solid: #101827;
    --surface-2: #111c2e;
    --surface-3: #17233a;
    --text: #e8edf7;
    --heading: #f8fbff;
    --muted: #a4afbf;
    --soft: #8794a8;
    --border: rgba(148,163,184,.18);
    --border-strong: rgba(148,163,184,.28);
    --accent: #8b7cff;
    --accent-2: #1bd5ef;
    --accent-3: #a78bfa;
    --success: #5ee0a2;
    --success-bg: rgba(8,116,67,.18);
    --warning: #f7c66b;
    --warning-bg: rgba(161,92,7,.18);
    --danger: #ff8f86;
    --danger-bg: rgba(180,35,24,.18);
    --shadow-sm: 0 14px 34px rgba(0,0,0,.28);
    --shadow: 0 28px 80px rgba(0,0,0,.38);
    --shadow-lg: 0 42px 120px rgba(0,0,0,.50);
  }
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; text-size-adjust: 100%; }
body {
  min-height: 100%;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at 12% -8%, rgba(99,91,255,.22), transparent 34rem),
    radial-gradient(circle at 92% 0%, rgba(18,194,233,.18), transparent 32rem),
    linear-gradient(180deg, var(--bg), var(--bg-2) 42%, var(--bg));
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(100,116,139,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100,116,139,.055) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
}

a { color: inherit; text-underline-offset: .18em; }
a:hover { color: var(--accent); }
p { margin: 0 0 1rem; }
h1, h2, h3, h4 { color: var(--heading); margin: 0 0 .75rem; line-height: 1.06; letter-spacing: -.035em; }
h1 { font-size: clamp(2.9rem, 7vw, 5.35rem); }
h2 { font-size: clamp(2rem, 4vw, 3.35rem); }
h3 { font-size: 1.15rem; letter-spacing: -.015em; }
h4 { font-size: .98rem; letter-spacing: 0; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }
pre {
  margin: 0;
  white-space: pre-wrap;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-solid));
  color: var(--text);
  font-size: .92rem;
}
button, input, textarea, select { font: inherit; }
img, svg { max-width: 100%; }

.container { width: min(var(--max), calc(100% - 40px)); margin-inline: auto; }
.narrow { max-width: 800px; }
.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .7rem 1rem;
  box-shadow: var(--shadow-sm);
}
.skip-link:focus { top: 16px; outline: 3px solid rgba(99,91,255,.35); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 0;
  backdrop-filter: saturate(160%) blur(18px);
  background: rgba(246,248,255,.78);
  border-bottom: 1px solid var(--border);
}
html[data-theme="dark"] .site-header { background: rgba(7,10,18,.72); }
@media (prefers-color-scheme: dark) { html[data-theme="system"] .site-header { background: rgba(7,10,18,.72); } }

.nav-shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  min-height: 52px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  color: var(--heading);
  min-width: max-content;
}
.brand:hover { color: var(--heading); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(99,91,255,.26);
}
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: .98rem; }
.brand-copy small { color: var(--muted); font-size: .74rem; font-weight: 700; }

.site-nav {
  justify-self: center;
  display: flex;
  gap: .25rem;
  align-items: center;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: .48rem .72rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 780;
}
.site-nav a:hover {
  background: var(--surface-2);
  color: var(--heading);
}
.nav-actions { display: flex; gap: .55rem; align-items: center; justify-content: end; }
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-solid);
  color: var(--text);
  cursor: pointer;
  padding: 10px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  border-radius: 999px;
  background: currentColor;
}
.theme-toggle {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .55rem .78rem;
  background: var(--surface);
  color: var(--text);
  font-weight: 820;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .78rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 850;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); color: inherit; }
.btn-primary, .primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 18px 38px rgba(99,91,255,.26);
}
.btn-primary:hover { box-shadow: 0 22px 46px rgba(99,91,255,.34); }
.btn-secondary, .ghost {
  color: var(--heading);
  background: var(--surface-solid);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-danger, .danger {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: rgba(180,35,24,.22);
}
.btn-small, .small { min-height: 36px; padding: .5rem .75rem; font-size: .88rem; }
.btn-tiny, .tiny { min-height: 30px; padding: .35rem .55rem; font-size: .78rem; }

.hero {
  position: relative;
  padding: clamp(56px, 8vw, 96px) 0 clamp(42px, 6vw, 72px);
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 84% 26%, rgba(18,194,233,.18), transparent 24rem),
    radial-gradient(circle at 20% 40%, rgba(124,58,237,.14), transparent 28rem);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, .78fr);
  gap: clamp(28px, 5vw, 58px);
  align-items: center;
}
.hero-copy-block { max-width: 760px; }
.eyebrow {
  margin: 0 0 .8rem;
  color: var(--accent);
  font-size: .78rem;
  line-height: 1.3;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-weight: 920;
}
.hero h1 {
  max-width: 820px;
  margin-bottom: 1rem;
  letter-spacing: -.066em;
}
.hero-copy, .lede, .page-hero p, .section-head p, .cta p {
  color: var(--muted);
  font-size: clamp(1.03rem, 1.25vw, 1.18rem);
  max-width: 780px;
}
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.6rem 0 1.1rem; }
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  max-width: 760px;
}
.trust-row span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: .38rem .65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: .84rem;
  font-weight: 790;
}

.resolver-card, .panel, .feature-card, .metric, .notice, .flash, .footer-panel {
  position: relative;
  background: linear-gradient(180deg, var(--surface), var(--surface-solid));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.resolver-card, .panel, .feature-card, .metric { padding: clamp(20px, 2.4vw, 30px); }
.hero-card {
  min-height: 410px;
  overflow: hidden;
  align-self: stretch;
}
.card-glow {
  position: absolute;
  right: -70px;
  top: -70px;
  width: 190px;
  height: 190px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(99,91,255,.28), transparent 66%);
}
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 1rem;
}
.card-top strong { color: var(--heading); }
.mini-divider {
  height: 1px;
  margin: 1.25rem 0;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}
.status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: .34rem .6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 850;
  font-size: .78rem;
  text-transform: capitalize;
}
.status-strong, .status.strong, .status.strong_public_disambiguation, .status.multi_source_verified, .status.account_control_verified, .status.verified, .status.pass, .status.ok, .status.active {
  color: var(--success);
  background: var(--success-bg);
  border-color: rgba(8,116,67,.22);
}
.status.warn, .status.disputed, .status.self_asserted, .status.pending, .status.reviewed {
  color: var(--warning);
  background: var(--warning-bg);
  border-color: rgba(161,92,7,.24);
}
.status.fail, .status.error, .status.revoked, .status.suspended, .status.rejected {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: rgba(180,35,24,.24);
}
.check-list, .binding-list, .result-list {
  display: grid;
  gap: .65rem;
  padding: 0;
  margin: 1rem 0;
  list-style: none;
}
.check-list li, .binding-list li, .result-list li {
  position: relative;
  padding: .78rem .9rem .78rem 2.25rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.38);
}
.check-list li::before, .binding-list li::before {
  content: "✓";
  position: absolute;
  left: .82rem;
  top: .75rem;
  color: var(--success);
  font-weight: 900;
}
.check-list li span { display: block; color: var(--muted); font-size: .82rem; }
.check-list li strong { display: block; color: var(--heading); font-size: .98rem; }
.boundary-note {
  margin-top: 1.35rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
}
.boundary-note p { margin-bottom: 0; color: var(--muted); }

.section { padding: clamp(42px, 7vw, 84px) 0; }
.section-head {
  text-align: center;
  max-width: 880px;
}
.section-head h2 { margin-inline: auto; max-width: 900px; }
.section-head p { margin-inline: auto; }
.grid-2, .grid-4, .split-grid {
  display: grid;
  gap: 20px;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split-grid { grid-template-columns: .9fr 1.1fr; align-items: stretch; }
.feature-card {
  min-height: 220px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.step-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  margin-bottom: 1.1rem;
  background: linear-gradient(135deg, rgba(99,91,255,.14), rgba(18,194,233,.16));
  color: var(--accent);
  font-weight: 900;
}
.feature-card p, .method-list p, .panel p, .doc p { color: var(--muted); }
.panel-xl h2 { max-width: 680px; }
.method-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 1.3rem;
}
.method-list > div {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.35);
}
.method-list strong { color: var(--heading); display: block; margin-bottom: .25rem; }
.code-panel pre { margin-top: 1.1rem; }

.trust-band {
  display: grid;
  grid-template-columns: .55fr 1fr;
  gap: 24px;
  align-items: center;
}
.trust-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}
.trust-rail span {
  position: relative;
  display: grid;
  min-height: 72px;
  place-items: center;
  text-align: center;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--heading);
  background: var(--surface-2);
  font-size: .85rem;
  font-weight: 850;
}
.trust-rail span:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -10px;
  top: 50%;
  width: 10px;
  height: 2px;
  background: var(--border-strong);
}
.cta { padding: clamp(46px, 8vw, 92px) 0 24px; }
.cta-panel {
  text-align: center;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 14% 0%, rgba(99,91,255,.16), transparent 24rem),
    radial-gradient(circle at 88% 18%, rgba(18,194,233,.16), transparent 22rem),
    linear-gradient(180deg, var(--surface), var(--surface-solid));
  box-shadow: var(--shadow-lg);
}
.cta-panel p { margin-inline: auto; }

.page-hero {
  padding: clamp(44px, 7vw, 78px) 0 clamp(12px, 3vw, 28px);
}
.page-hero-inner {
  max-width: 920px;
}
.page-hero h1 { font-size: clamp(2.35rem, 6vw, 4.65rem); }
.stack-form { display: grid; gap: 16px; }
.stack-form label {
  display: grid;
  gap: 7px;
  color: var(--heading);
  font-weight: 820;
}
input, textarea, select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-solid);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
textarea { min-height: 122px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  border-color: rgba(99,91,255,.66);
  box-shadow: 0 0 0 4px rgba(99,91,255,.14);
}
input::placeholder, textarea::placeholder { color: var(--soft); }
.sticky-panel { align-self: start; position: sticky; top: calc(var(--nav-h) + 20px); }
.output-box { display: grid; gap: 12px; margin-top: 1rem; }
.download-link, .link-card {
  display: block;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  text-decoration: none;
  font-weight: 800;
}
.notice, .flash {
  width: min(var(--max), calc(100% - 40px));
  margin: 16px auto;
  padding: 14px 16px;
}
.notice { width: 100%; margin: 0 0 1rem; }
.notice.info { color: var(--accent); }
.flash.success, .notice.success { color: var(--success); background: var(--success-bg); border-color: rgba(8,116,67,.22); }
.flash.error, .notice.error { color: var(--danger); background: var(--danger-bg); border-color: rgba(180,35,24,.22); }
.danger-text { color: var(--danger); font-weight: 850; }
.muted { color: var(--muted); }
.button-stack, .row-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  align-items: center;
}
.challenge {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin: 12px 0;
  background: var(--surface-2);
}
.table-panel { margin-top: 20px; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
}
table { width: 100%; border-collapse: collapse; min-width: 720px; background: var(--surface-solid); }
th, td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
th {
  color: var(--heading);
  background: var(--surface-2);
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
tr:last-child td { border-bottom: 0; }
.doc {
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.doc h2, .doc h3 { margin-top: 1.4rem; }
.doc ul, .doc ol { color: var(--muted); }
.doc li { margin: .45rem 0; }

.mega-footer {
  padding: 48px 0 30px;
}

.footer-panel {
  padding: 0;
  overflow: hidden;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.45fr) repeat(4, minmax(140px, 1fr));
  column-gap: clamp(34px, 5vw, 72px);
  row-gap: 30px;
  align-items: start;
  padding: clamp(28px, 4vw, 40px);
}

.footer-grid > div {
  min-width: 0;
  align-self: start;
}

.footer-grid h4 {
  margin: 0 0 14px;
  color: var(--heading);
  font-size: .98rem;
  line-height: 1.1;
  letter-spacing: -.01em;
  font-weight: 900;
}

.footer-brand {
  display: grid;
  gap: 12px;
  max-width: 285px;
}

.footer-brand p,
.mega-footer p {
  color: var(--muted);
}

.footer-brand p {
  margin: 0;
  font-size: .96rem;
  line-height: 1.58;
}

.footer-brand .brand-copy {
  margin-top: 2px;
}

.mega-footer a {
  display: block;
  margin: 0;
  padding: 4px 0;
  color: var(--muted);
  text-decoration: none;
  font-weight: 760;
  line-height: 1.45;
}

.mega-footer a + a {
  margin-top: 4px;
}

.mega-footer a:hover {
  color: var(--heading);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 18px clamp(24px, 4vw, 34px);
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}

.footer-bottom p,
.footer-bottom small {
  display: block;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.admin-layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 22px;
  padding-top: 30px;
}
.admin-nav {
  position: sticky;
  top: calc(var(--nav-h) + 18px);
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.admin-nav a {
  padding: .75rem .85rem;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}
.admin-nav a:hover { background: var(--surface-2); color: var(--heading); }
.admin-main { min-width: 0; }
.admin-main > h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
.metric span {
  display: block;
  color: var(--muted);
  font-weight: 780;
  text-transform: capitalize;
}
.metric strong {
  display: block;
  margin-top: .35rem;
  color: var(--heading);
  font-size: 2.2rem;
  line-height: 1;
}
.search {
  display: flex;
  gap: 10px;
  margin: 0 0 16px;
}
.install-body {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 32px 20px;
}
.install-panel {
  width: min(940px,100%);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 38px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 1040px) {
  .nav-primary { display: none; }
  .site-nav a { padding-inline: .58rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { max-width: 680px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-grid, .trust-band { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --nav-h: 66px; }
  .container { width: min(100% - 28px, var(--max)); }
  .site-header { padding: 8px 0; }
  .nav-shell {
    width: min(100% - 24px, var(--max));
    grid-template-columns: auto auto;
    gap: 10px;
  }
  .brand-copy small { display: none; }
  .nav-toggle {
    display: block;
    justify-self: end;
    grid-column: 2;
    grid-row: 1;
  }
  .nav-actions {
    grid-column: 1 / -1;
    display: none;
    justify-content: stretch;
  }
  .site-nav {
    display: none;
    grid-column: 1 / -1;
    justify-self: stretch;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    border-radius: 18px;
    padding: 10px;
  }
  .site-nav.open, .nav-actions.open { display: flex; }
  .site-nav a {
    min-height: 42px;
    justify-content: center;
    border-radius: 12px;
  }
  .nav-actions.open { flex-direction: column; }
  .theme-toggle, .nav-actions .btn { width: 100%; }
  .hero { padding-top: 42px; }
  .hero h1 { font-size: clamp(2.55rem, 15vw, 4.2rem); letter-spacing: -.06em; }
  .hero-copy { font-size: 1.02rem; }
  .resolver-card, .panel, .feature-card, .metric { padding: 20px; }
  .grid-2, .grid-4, .split-grid, .footer-grid, .admin-layout, .method-list, .trust-rail {
    grid-template-columns: 1fr;
  }
  .feature-card { min-height: auto; }
  .trust-rail span:not(:last-child)::after { display: none; }
  .footer-grid { gap: 12px; }
  .admin-nav { position: static; }
  .sticky-panel { position: static; }
  .search { flex-direction: column; }
  .actions .btn { width: 100%; }
  .page-hero h1 { font-size: clamp(2.25rem, 12vw, 3.6rem); }
  table { min-width: 680px; }
}

@media (max-width: 420px) {
  .container { width: min(100% - 22px, var(--max)); }
  .brand-mark { width: 34px; height: 34px; border-radius: 12px; }
  .brand-copy strong { font-size: .92rem; }
  .hero-card { min-height: 0; }
  .trust-row span { width: 100%; justify-content: center; }
  .footer-panel { border-radius: 20px; }
}

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


/* V4 brand mark: E to the power id.
   This version centers the equation lockup as one unit inside the blue square
   and works in the header, mega-footer, and any other public shell location. */

.brand-mark.equation-mark {
  --mark-size: 42px;
  --mark-radius: 14px;
  --base-size: 1.18rem;
  --exp-size: .56rem;
  --base-x: -5px;
  --base-y: 2px;
  --exp-x: 8px;
  --exp-y: -6px;

  position: relative;
  display: inline-grid !important;
  place-items: center;
  width: var(--mark-size);
  height: var(--mark-size);
  min-width: var(--mark-size);
  inline-size: var(--mark-size);
  block-size: var(--mark-size);
  border-radius: var(--mark-radius);
  overflow: hidden;
  flex: 0 0 auto;
  color: #fff;
  background:
    radial-gradient(circle at 28% 20%, rgba(255,255,255,.44), transparent 30%),
    linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 16px 38px rgba(60, 103, 255, .34);
  isolation: isolate;
  line-height: 1;
  text-align: center;
}

.brand-mark.equation-mark::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,.24);
  pointer-events: none;
  z-index: 3;
}

.brand-mark.equation-mark .equation-lockup {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 2;
  pointer-events: none;
}

.brand-mark.equation-mark .equation-base,
.brand-mark.equation-mark .equation-exp {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  line-height: 1;
  font-family: inherit;
  font-weight: 950;
  color: #fff;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  pointer-events: none;
}

.brand-mark.equation-mark .equation-base {
  font-size: var(--base-size);
  letter-spacing: -.06em;
  transform: translate(
    calc(-50% + var(--base-x)),
    calc(-50% + var(--base-y))
  );
}

.brand-mark.equation-mark .equation-exp {
  font-size: var(--exp-size);
  letter-spacing: -.045em;
  transform: translate(
    calc(-50% + var(--exp-x)),
    calc(-50% + var(--exp-y))
  );
}

/* Header logo sizing */
.site-header .brand-mark.equation-mark {
  --mark-size: 44px;
  --mark-radius: 14px;
  --base-size: 1.18rem;
  --exp-size: .52rem;
  --base-x: -5px;
  --base-y: 2px;
  --exp-x: 8px;
  --exp-y: -6px;
}

/* Mega-footer logo sizing */
.footer-brand .brand-mark.equation-mark,
.mega-footer .brand-mark.equation-mark {
  --mark-size: 50px;
  --mark-radius: 17px;
  --base-size: 1.34rem;
  --exp-size: .62rem;
  --base-x: -6px;
  --base-y: 2px;
  --exp-x: 9px;
  --exp-y: -7px;
}

/* V4 top-menu hardening for small screens and long labels. */
.site-header {
  width: 100%;
}

.nav-shell {
  gap: clamp(.75rem, 2vw, 1.4rem);
}

.brand {
  min-width: 0;
  flex-shrink: 0;
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong,
.brand-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-nav a {
  white-space: nowrap;
}

@media (max-width: 980px) {
  .brand-copy small {
    display: none;
  }
}

@media (max-width: 760px) {
  .site-header .brand-mark.equation-mark {
    --mark-size: 40px;
    --mark-radius: 13px;
    --base-size: 1.1rem;
    --exp-size: .5rem;
    --base-x: -5px;
    --base-y: 2px;
    --exp-x: 8px;
    --exp-y: -6px;
  }

  .nav-actions .nav-primary {
    display: none;
  }
}

@media (max-width: 420px) {
  .site-header .brand-mark.equation-mark {
    --mark-size: 38px;
    --mark-radius: 12px;
    --base-size: 1.04rem;
    --exp-size: .48rem;
    --base-x: -5px;
    --base-y: 2px;
    --exp-x: 7px;
    --exp-y: -6px;
  }
}

/* V4 form/table overflow protection across all public shells. */
.panel,
.feature-card,
.resolver-card,
.footer-panel,
.code-panel,
.metric,
.notice,
.flash {
  max-width: 100%;
}

.table-wrap,
pre,
.output-box,
.doc,
.code-panel {
  overflow-wrap: anywhere;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

input,
textarea,
select,
button {
  min-width: 0;
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 24px, var(--max));
  }

  .hero h1,
  .page-hero h1 {
    letter-spacing: -.05em;
  }

  .actions {
    width: 100%;
  }

  .actions .btn {
    width: 100%;
  }

  .mega-footer .brand {
    align-items: flex-start;
  }
}
/* --------------------------------------------------------------------------
   Ensan ID V4.2 one-pass homepage + footer correction
   Scope: layout only. Content still comes from private_content through PHP.
   -------------------------------------------------------------------------- */

/* Keep the E^id mark centered everywhere. Requires shell markup:
   .equation-mark > .equation-lockup > .equation-base + .equation-exp */
.brand-mark.equation-mark {
  --mark-size: 42px;
  --mark-radius: 14px;
  --base-size: 1.18rem;
  --exp-size: .54rem;
  --base-x: -5px;
  --base-y: 2px;
  --exp-x: 8px;
  --exp-y: -6px;

  position: relative;
  display: inline-grid !important;
  place-items: center;
  width: var(--mark-size) !important;
  height: var(--mark-size) !important;
  min-width: var(--mark-size) !important;
  inline-size: var(--mark-size) !important;
  block-size: var(--mark-size) !important;
  border-radius: var(--mark-radius);
  overflow: hidden;
  flex: 0 0 auto;
  color: #fff;
  background:
    radial-gradient(circle at 28% 20%, rgba(255,255,255,.44), transparent 30%),
    linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 16px 38px rgba(60, 103, 255, .34);
  isolation: isolate;
  line-height: 1;
  text-align: center;
}

.brand-mark.equation-mark::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,.24);
  pointer-events: none;
  z-index: 3;
}

.brand-mark.equation-mark .equation-lockup {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 2;
  pointer-events: none;
}

.brand-mark.equation-mark .equation-base,
.brand-mark.equation-mark .equation-exp {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  line-height: 1;
  font-family: inherit;
  font-weight: 950;
  color: #fff;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  pointer-events: none;
}

.brand-mark.equation-mark .equation-base {
  font-size: var(--base-size);
  letter-spacing: -.06em;
  transform: translate(calc(-50% + var(--base-x)), calc(-50% + var(--base-y)));
}

.brand-mark.equation-mark .equation-exp {
  font-size: var(--exp-size);
  letter-spacing: -.045em;
  transform: translate(calc(-50% + var(--exp-x)), calc(-50% + var(--exp-y)));
}

.site-header .brand-mark.equation-mark {
  --mark-size: 44px;
  --mark-radius: 14px;
  --base-size: 1.18rem;
  --exp-size: .52rem;
}

.footer-brand .brand-mark.equation-mark,
.mega-footer .brand-mark.equation-mark {
  --mark-size: 50px;
  --mark-radius: 17px;
  --base-size: 1.34rem;
  --exp-size: .62rem;
  --base-x: -6px;
  --base-y: 2px;
  --exp-x: 9px;
  --exp-y: -7px;
}

/* Homepage rhythm */
.view-home .section {
  padding: clamp(34px, 5.5vw, 68px) 0;
}

.view-home .section + .section {
  padding-top: clamp(26px, 4.5vw, 56px);
}

.view-home .section-head {
  margin: 0 auto clamp(22px, 3vw, 34px);
}

.view-home .section-head .eyebrow {
  margin-bottom: .7rem;
}

.view-home .section-head h2 {
  max-width: 940px;
}

.view-home .section-head p {
  max-width: 820px;
}

/* Missing grid-3 caused audience cards to stack as huge full-width blocks. */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.audiences-section .grid-3 {
  align-items: stretch;
}

.audiences-section .feature-card {
  min-height: 0 !important;
  padding: clamp(18px, 2.2vw, 26px);
  display: grid;
  align-content: start;
  gap: .55rem;
}

.audiences-section .feature-card h3 {
  margin-bottom: .25rem;
}

.audiences-section .feature-card p {
  margin: 0;
  font-size: .98rem;
  line-height: 1.55;
}

/* Steps should be compact, not enormous blocks. */
.steps-section .feature-card {
  min-height: 0;
  padding: clamp(18px, 2.2vw, 26px);
}

/* Methods/code section: prevent one tall panel from stretching the other into a blank column. */
.methods-section .split-grid {
  align-items: start !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.methods-section .panel {
  align-self: start;
  min-height: 0;
}

.methods-section .method-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.methods-section .method-list > div {
  min-height: 0;
  display: grid;
  align-content: start;
}

.methods-section .method-list p {
  margin-bottom: .65rem;
}

.methods-section .method-list small {
  color: var(--text);
  line-height: 1.55;
}

.code-panel pre {
  max-height: 420px;
}

/* Trust preview should stay visually centered and compact. */
.trust-model-preview .trust-band {
  align-items: center;
  min-height: 0;
}

.trust-model-preview .panel {
  padding: clamp(22px, 3vw, 34px);
}

.trust-model-preview .trust-rail {
  align-items: center;
}

/* Mega-footer: final, clean, five-column layout. */
.mega-footer {
  padding: 48px 0 30px;
}

.footer-panel {
  padding: 0 !important;
  overflow: hidden;
}

.footer-grid {
  display: grid !important;
  grid-template-columns: minmax(260px, 1.55fr) repeat(4, minmax(130px, 1fr)) !important;
  column-gap: clamp(32px, 5vw, 68px);
  row-gap: 30px;
  align-items: start;
  padding: clamp(28px, 4vw, 40px);
}

.footer-grid > * {
  min-width: 0;
  align-self: start;
}

.footer-brand {
  display: grid;
  gap: 10px;
  max-width: 300px;
}

.footer-brand-link {
  align-items: center;
  width: fit-content;
}

.footer-brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .96rem;
  line-height: 1.58;
}

.footer-column h4,
.footer-grid h4 {
  margin: 0 0 14px;
  color: var(--heading);
  font-size: .98rem;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -.01em;
}

.footer-column a,
.mega-footer a {
  display: block;
  margin: 0;
  padding: 4px 0;
  color: var(--muted);
  text-decoration: none;
  font-weight: 760;
  line-height: 1.45;
}

.footer-column a + a,
.mega-footer a + a {
  margin-top: 5px;
}

.footer-column a:hover,
.mega-footer a:hover {
  color: var(--heading);
}

.footer-bottom {
  display: block;
  width: 100%;
  border-top: 1px solid var(--border);
  padding: 18px clamp(24px, 4vw, 34px);
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}

.footer-bottom p,
.footer-bottom small {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  text-align: center;
}

/* If an old hard-coded Boundary footer column is still present, hide only the sixth
   footer grid item, not the Product column. */
.footer-grid > div:nth-child(n+6):not(.footer-bottom) {
  display: none !important;
}

/* Responsive homepage corrections */
@media (max-width: 1100px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .methods-section .split-grid {
    grid-template-columns: 1fr;
  }

  .methods-section .code-panel {
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .footer-brand {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .grid-3,
  .methods-section .method-list,
  .footer-grid {
    grid-template-columns: 1fr !important;
  }

  .view-home .section {
    padding: 34px 0;
  }

  .audiences-section .feature-card,
  .steps-section .feature-card {
    padding: 20px;
  }

  .footer-grid {
    gap: 22px;
    padding: 26px 22px;
  }

  .footer-bottom {
    padding: 18px 22px;
  }

  .site-header .brand-mark.equation-mark {
    --mark-size: 40px;
    --mark-radius: 13px;
    --base-size: 1.1rem;
    --exp-size: .5rem;
    --base-x: -5px;
    --base-y: 2px;
    --exp-x: 8px;
    --exp-y: -6px;
  }
}

@media (max-width: 420px) {
  .site-header .brand-mark.equation-mark {
    --mark-size: 38px;
    --mark-radius: 12px;
    --base-size: 1.04rem;
    --exp-size: .48rem;
    --exp-x: 7px;
  }

  .footer-brand .brand-mark.equation-mark,
  .mega-footer .brand-mark.equation-mark {
    --mark-size: 46px;
    --mark-radius: 15px;
    --base-size: 1.24rem;
    --exp-size: .58rem;
  }
}
