/* ============================================================================
   Swiss Cryptographic Observatory — Editorial Light Design System
   Zero neon gradients, zero dark-mode SaaS clichés, maximum technical clarity.
   ============================================================================ */

:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface-2: #efede6;
  --surface-hover: #faf9f5;
  --code-bg: #181b20;
  --code-fg: #e7eaef;
  --border: #dcd9ce;
  --border-strong: #141619;
  --text: #141619;
  --muted: #555b63;
  --accent: #0f5132;
  --accent-hover: #0a3c24;
  --accent-tint: #e8f4ee;
  --accent-border: #a6d5be;
  --link: #0d4a8c;
  --ok: #0f5132;
  --ok-tint: #e8f4ee;
  --ok-border: #a6d5be;
  --warn: #8a4b08;
  --warn-tint: #fef6e6;
  --warn-border: #e5c37a;
  --orange: #9a3412;
  --orange-tint: #fff1e6;
  --orange-border: #eeb48d;
  --danger: #991b1b;
  --danger-tint: #fdecec;
  --danger-border: #e5a3a3;
  --radius: 4px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

code, pre {
  font-family: var(--mono);
}

pre {
  background: var(--code-bg);
  color: var(--code-fg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.55;
  margin: 12px 0;
}

code {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.86em;
}

pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.muted { color: var(--muted); }
.small { font-size: 0.91rem; }
.tiny { font-size: 0.79rem; }
.full-width { width: 100%; text-align: center; display: inline-block; }
.hidden { display: none !important; }
.ta-right { text-align: right; }

/* ============================================================================
   Editorial Masthead Header
   ============================================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 2px solid var(--border-strong);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 16px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 11px;
  height: 11px;
  background: var(--accent);
  display: inline-block;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.main-nav a {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}
.main-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.btn-nav-pro {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 5px 11px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}
.btn-nav-pro:hover {
  background: var(--border-strong);
  color: #ffffff;
}

.lang-switch {
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 4px 9px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text) !important;
}
.lang-switch:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

/* ============================================================================
   Left-Aligned Editorial Hero
   ============================================================================ */
.hero {
  padding: 36px 0 22px;
  text-align: left;
}
.hero.compact {
  padding: 20px 0 14px;
}

.pill-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(1.95rem, 3.8vw, 2.85rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 10px;
  letter-spacing: -0.035em;
  color: var(--text);
  max-width: 820px;
}

.hero-sub {
  max-width: 720px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

/* ============================================================================
   Architectural Panels & Grids
   ============================================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: left;
  box-shadow: 0 1px 2px rgba(20, 22, 25, 0.03);
}

.client-card, .server-card {
  border-top: 3px solid var(--border-strong);
}

.dual-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 18px;
  align-items: stretch;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 18px 0;
}
.compliance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.faq-grid {
  display: grid;
  gap: 10px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.card-head h2, .card-head h3 {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

/* ============================================================================
   Signal Stamps & Cryptographic Grades
   ============================================================================ */
.status-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-pill.ok, .status-pill.aligned {
  background: var(--ok-tint);
  color: var(--ok);
  border: 1px solid var(--ok-border);
}
.status-pill.danger, .status-pill.gap {
  background: var(--danger-tint);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}
.status-pill.warn, .status-pill.transition {
  background: var(--warn-tint);
  color: var(--warn);
  border: 1px solid var(--warn-border);
}
.status-pill.accent {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.status-pill.neutral, .status-pill.pending, .status-pill.info {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.grade-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 3px 8px;
  border-radius: 3px;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.grade-aplus { background: var(--ok-tint); color: var(--ok); border: 1px solid var(--ok); }
.grade-a { background: var(--ok-tint); color: var(--ok); border: 1px solid var(--ok-border); }
.grade-b { background: var(--warn-tint); color: var(--warn); border: 1px solid var(--warn-border); }
.grade-c { background: var(--orange-tint); color: var(--orange); border: 1px solid var(--orange-border); }
.grade-f { background: var(--danger-tint); color: var(--danger); border: 1px solid var(--danger-border); }
.grade-na { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* ============================================================================
   Inputs & Crisp Tactile Controls
   ============================================================================ */
.input-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

input[type="text"], input[type="email"], select {
  background: var(--surface);
  border: 1px solid #b9b5a8;
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 0.94rem;
  width: 100%;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 2px rgba(20, 22, 25, 0.08);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
  text-decoration: none;
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid #b9b5a8;
  border-radius: var(--radius);
  padding: 9px 14px;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  color: var(--text);
  text-decoration: none;
}

.btn-mini {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 4px 9px;
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-mini:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.opt-row {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  color: var(--muted);
  cursor: pointer;
}
.quick-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 3px;
  padding: 3px 9px;
  font-family: var(--mono);
  font-size: 0.76rem;
  cursor: pointer;
}
.chip:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.battle-mini {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.battle-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.battle-inline input {
  padding: 8px 10px;
  font-size: 0.86rem;
  font-family: var(--mono);
}
.vs-sep {
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.client-body {
  margin: 14px 0;
  min-height: 88px;
}
.curl-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.code-copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--code-bg);
  color: var(--code-fg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-top: 6px;
  overflow-x: auto;
}
.code-copy-row code {
  background: none;
  border: none;
  color: var(--code-fg);
  padding: 0;
  font-size: 0.82rem;
  white-space: nowrap;
}
.code-copy-row .btn-mini {
  background: #2b3038;
  color: #f3f4f6;
  border-color: #414854;
}
.code-copy-row .btn-mini:hover {
  background: #3b424d;
  color: #ffffff;
}

/* ============================================================================
   Editorial Partner / Sponsor Strip
   ============================================================================ */
.ad-slot {
  margin: 22px 0;
}
.sponsor-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 13px 18px;
  color: var(--text);
}
.sponsor-card:hover {
  text-decoration: none;
  background: var(--surface);
  border-color: var(--border-strong);
}
.sponsor-badge {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.sponsor-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sponsor-copy span {
  color: var(--muted);
  font-size: 0.86rem;
}
.sponsor-arrow {
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--text);
}
button.sponsor-card {
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

/* ============================================================================
   Sections, Calculators & Swiss Data Tables
   ============================================================================ */
.section {
  margin: 44px 0;
}
.section-head {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-head h2 {
  margin: 0 0 4px;
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.mosca-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: center;
}
.slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}
.slider-row strong {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.mosca-output {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
}
.mosca-year {
  font-family: var(--mono);
  font-size: 2.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  margin-bottom: 8px;
}
.mosca-verdict {
  font-weight: 700;
  margin-bottom: 8px;
}

.table-wrap {
  overflow-x: auto;
  padding: 0;
}
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.lb-table th, .lb-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.lb-table th {
  color: var(--text);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border-strong);
}
.lb-table tbody tr:hover {
  background: var(--surface-hover);
}
.lb-table tr:last-child td {
  border-bottom: none;
}
.domain-link {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
}
.cat-tag {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

/* ============================================================================
   Audit Report & Official Grade Stamp
   ============================================================================ */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 0 12px;
  flex-wrap: wrap;
}
.back-link {
  font-family: var(--mono);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}
.action-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.report-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  border-top: 3px solid var(--border-strong);
}
.report-hero-left {
  flex: 1;
  min-width: 280px;
}
.report-hero h1 {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
}
.headline {
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 14px;
}
.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.grade-box {
  min-width: 168px;
  padding: 18px 22px;
  border-radius: var(--radius);
  border-width: 2px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-family: var(--mono);
}
.grade-kicker {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.grade-letter {
  font-size: 3.7rem;
  font-weight: 900;
  line-height: 1.05;
}
.grade-score {
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.kv-list {
  display: grid;
  grid-template-columns: 165px 1fr;
  gap: 8px 12px;
  margin: 12px 0 0;
  font-size: 0.88rem;
}
.kv-list dt {
  color: var(--muted);
  font-weight: 500;
}
.kv-list dd {
  margin: 0;
  word-break: break-word;
}

.callout {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border-left-width: 3px;
  font-size: 0.88rem;
}
.callout.warn {
  background: var(--warn-tint);
  border: 1px solid var(--warn-border);
  border-left: 3px solid var(--warn);
  color: var(--warn);
}
.callout.danger {
  background: var(--danger-tint);
  border: 1px solid var(--danger-border);
  border-left: 3px solid var(--danger);
  color: var(--danger);
}
.callout.accent {
  background: var(--accent-tint);
  border: 1px solid var(--accent-border);
  border-left: 3px solid var(--accent);
  color: var(--accent);
}
.bullet-list {
  margin: 10px 0;
  padding-left: 20px;
}
.bullet-list li {
  margin-bottom: 6px;
}

.badge-preview { margin: 12px 0; }
.battle-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.fix-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.fix-tab {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 13px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.8rem;
}
.fix-tab.active {
  background: var(--border-strong);
  border-color: var(--border-strong);
  color: #ffffff;
}

/* ============================================================================
   Editorial Knowledge Hub / Articles & FAQ
   ============================================================================ */
.blog-card {
  display: flex;
  flex-direction: column;
}
.blog-card h3, .blog-card h2, .blog-card h4 {
  margin: 10px 0 8px;
  font-size: 1.06rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.blog-card a { color: var(--text); }
.blog-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.read-link {
  display: inline-block;
  margin-top: auto;
  padding-top: 8px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent) !important;
}
.article-wrap { max-width: 820px; }
.article-body {
  padding: 32px;
  border-top: 3px solid var(--border-strong);
}
.article-body h1 {
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  margin: 12px 0;
  line-height: 1.18;
  letter-spacing: -0.03em;
}
.article-lead {
  font-size: 1.06rem;
  color: var(--muted);
  line-height: 1.6;
}
.article-section { margin: 28px 0; }
.article-section h2 {
  font-size: 1.28rem;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.code-title {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: -4px;
}
.article-cta {
  margin-top: 32px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  text-align: left;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

/* ============================================================================
   Config Linter, Stats Bar, Modals & Consent Bar
   ============================================================================ */
textarea {
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  color: var(--code-fg);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 0.84rem;
  width: 100%;
  resize: vertical;
}
textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(15, 81, 50, 0.22);
}
.config-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
  align-items: start;
}
.config-result-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 185px;
}

.stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 16px 20px;
}
.stat-item {
  display: flex;
  flex-direction: column;
}
.stat-val {
  font-family: var(--mono);
  font-size: 1.55rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ok);
  line-height: 1.1;
}
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-bar select {
  width: auto;
  min-width: 150px;
  padding: 8px 12px;
  font-size: 0.86rem;
}
.share-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 6px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 25, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  position: relative;
  max-width: 460px;
  width: 100%;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 16px 40px rgba(20, 22, 25, 0.22);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.6rem;
  cursor: pointer;
}
.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 14px;
}
.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}
.form-msg {
  margin: 6px 0 0;
  font-size: 0.86rem;
  min-height: 1.2em;
}
.form-msg.error { color: var(--danger); }
.form-msg.ok { color: var(--ok); }

.consent-banner {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 60;
  display: flex;
  justify-content: center;
}
.consent-banner[hidden] { display: none; }
.consent-inner {
  max-width: 960px;
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 12px 32px rgba(20, 22, 25, 0.16);
}

/* ============================================================================
   Footer
   ============================================================================ */
.site-footer {
  border-top: 2px solid var(--border-strong);
  background: var(--surface);
  margin-top: 64px;
  padding: 28px 0 40px;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}
.footer-brand {
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88rem;
}
.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text);
  font-weight: 500;
}

/* Accessibility: Skip link, visible keyboard focus, equal-weight GDPR buttons & reduced motion */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--border-strong);
  color: #ffffff;
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 700;
  z-index: 100;
  border-radius: var(--radius);
}
.skip-link:focus {
  left: 16px;
  color: #ffffff;
  text-decoration: none;
}

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

.btn-consent {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 9px 16px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-consent:hover {
  background: var(--border-strong);
  color: #ffffff;
}

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

.adv-mode {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 8px 12px;
}
.adv-mode summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}
.adv-body {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.adv-body input[type="text"] {
  font-family: var(--mono);
  font-size: 0.86rem;
  padding: 8px 10px;
}
.origin-result {
  margin-top: 18px;
  border-top: 3px solid var(--accent);
}
.origin-result[hidden] { display: none; }

/* ============================================================================
   Mobile & Tablet Responsive Layout (320px - 840px)
   ============================================================================ */
@media (max-width: 840px) {
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px 10px;
    padding-top: 10px;
    padding-bottom: 6px;
    min-height: auto;
  }
  .brand {
    font-size: 0.9rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .main-nav {
    grid-column: 1 / -1;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 14px;
    padding: 8px 0 4px;
    border-top: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a {
    white-space: nowrap;
    padding: 4px 0;
    font-size: 0.85rem;
  }

  .dual-grid, .detail-grid, .mosca-grid, .config-grid {
    grid-template-columns: 1fr;
  }
  .blog-grid, .compliance-grid {
    grid-template-columns: 1fr;
  }
  .input-row, .battle-inline {
    flex-direction: column;
    align-items: stretch;
  }
  .vs-sep {
    text-align: center;
  }
  .article-body {
    padding: 20px;
  }
  .report-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .report-hero-left {
    min-width: 0;
  }
  .grade-box {
    min-width: 0;
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    text-align: left;
  }
  .grade-letter {
    font-size: 2.5rem;
  }
  .stats-bar {
    gap: 14px;
  }
  .filter-bar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .filter-bar select {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 14px;
  }
  .hero {
    padding: 22px 0 16px;
  }
  .hero h1 {
    font-size: clamp(1.6rem, 7vw, 2.1rem);
  }
  .hero-sub {
    font-size: 0.94rem;
    margin-bottom: 18px;
  }
  .card {
    padding: 16px;
  }
  .section {
    margin: 30px 0;
  }
  .section-head h2 {
    font-size: 1.24rem;
  }
  .card-head {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Prevent iOS Safari auto-zoom on form focus & ensure 44px touch targets */
  input[type="text"], input[type="email"], select, textarea,
  .battle-inline input, .adv-body input[type="text"] {
    font-size: 16px;
  }
  .btn-primary, .btn-secondary, .btn-consent {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .chip, .fix-tab, .btn-mini {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  /* Stack key-value lists cleanly on narrow screens */
  .kv-list {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .kv-list dt {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 8px;
  }
  .kv-list dd {
    margin-bottom: 4px;
  }

  /* Keep Quantum Readiness Index table readable on small phones without horizontal bloat */
  .lb-table th, .lb-table td {
    padding: 9px 8px;
    font-size: 0.82rem;
  }
  .lb-table th:nth-child(2), .lb-table td:nth-child(2),
  .lb-table th:nth-child(5), .lb-table td:nth-child(5) {
    display: none;
  }

  .sponsor-card {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }
  .sponsor-arrow {
    display: none;
  }

  .top-bar {
    padding: 14px 0 10px;
  }
  .action-group {
    width: 100%;
  }
  .action-group > * {
    flex: 1 1 auto;
    text-align: center;
  }
  .battle-cta-row {
    flex-direction: column;
  }
  .battle-cta-row .battle-inline {
    width: 100%;
  }

  .consent-banner {
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    right: 10px;
  }
  .consent-inner {
    padding: 14px;
    gap: 12px;
  }
  .consent-inner .action-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .modal-card {
    padding: 20px 16px;
  }
  .article-body {
    padding: 16px;
  }
  .site-footer {
    margin-top: 40px;
    padding: 22px 0 calc(28px + env(safe-area-inset-bottom));
  }
  .footer-links {
    gap: 10px 14px;
  }
}

/* Crisp Auditor-Ready PDF Export via window.print() */
@media print {
  .no-print { display: none !important; }
  html, body { background: #ffffff !important; color: #141619 !important; font-size: 11pt; }
  .card, .grade-box, .callout { background: #ffffff !important; color: #141619 !important; border: 1px solid #9ca3af !important; box-shadow: none !important; break-inside: avoid; }
  .status-pill, .grade-pill, .pill-badge { background: #f3f4f6 !important; color: #141619 !important; border: 1px solid #6b7280 !important; }
  .muted { color: #374151 !important; }
  a { color: #141619 !important; text-decoration: none !important; }
  pre, code { background: #f9fafb !important; color: #141619 !important; border-color: #d1d5db !important; }
}
