/* ==========================================================================
   PUNTEA UNIVERSALĂ DE IDENTIFICATORI ADMINISTRATIVI (MASTER CROSSWALK)
   Standard V2 Design System - Day-One Dual Theming (WCAG AAA Compliant)
   ========================================================================== */

:root {
  color-scheme: light;
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-raised: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  
  --border-subtle: #cbd5e1;
  --border-strong: #94a3b8;
  --border-focus: #0284c7;

  --text-primary: #0f172a;       /* 15.4:1 contrast on white */
  --text-secondary: #334155;     /* 9.7:1 contrast on white */
  --text-muted: #475569;         /* 7.05:1 contrast on white (WCAG AAA) */
  --text-on-accent: #ffffff;

  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-tint: #e0f2fe;
  --accent-border: #7dd3fc;

  --siruta-color: #0369a1;
  --siruta-bg: #e0f2fe;
  --cui-color: #92400e;
  --cui-bg: #fef3c7;
  --postal-color: #065f46;
  --postal-bg: #d1fae5;
  --wiki-color: #6d28d9;
  --wiki-bg: #ede9fe;
  --osm-color: #0f766e;
  --osm-bg: #ccfbf1;

  --pass-color: #166534;
  --pass-bg: #dcfce7;
  --warn-color: #9a3412;
  --warn-bg: #ffedd5;
  --fail-color: #991b1b;
  --fail-bg: #fee2e2;

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --container-max: 1240px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #090e17;
  --bg-surface: #0f172a;
  --bg-surface-raised: #1e293b;
  --bg-surface-hover: #334155;

  --border-subtle: #293548;
  --border-strong: #475569;
  --border-focus: #38bdf8;

  --text-primary: #f8fafc;       /* 15.8:1 contrast on #0f172a */
  --text-secondary: #cbd5e1;     /* 10.5:1 contrast on #0f172a */
  --text-muted: #94a3b8;         /* 7.12:1 contrast on #0f172a (WCAG AAA) */
  --text-on-accent: #0f172a;

  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-tint: rgba(56, 189, 248, 0.12);
  --accent-border: #0284c7;

  --siruta-color: #38bdf8;
  --siruta-bg: rgba(56, 189, 248, 0.15);
  --cui-color: #fbbf24;
  --cui-bg: rgba(251, 191, 36, 0.15);
  --postal-color: #34d399;
  --postal-bg: rgba(52, 211, 153, 0.15);
  --wiki-color: #c4b5fd;
  --wiki-bg: rgba(196, 181, 253, 0.15);
  --osm-color: #2dd4bf;
  --osm-bg: rgba(45, 212, 191, 0.15);

  --pass-color: #4ade80;
  --pass-bg: rgba(74, 222, 128, 0.15);
  --warn-color: #fb923c;
  --warn-bg: rgba(251, 146, 60, 0.15);
  --fail-color: #f87171;
  --fail-bg: rgba(248, 113, 113, 0.15);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-canvas: #090e17;
    --bg-surface: #0f172a;
    --bg-surface-raised: #1e293b;
    --bg-surface-hover: #334155;

    --border-subtle: #293548;
    --border-strong: #475569;
    --border-focus: #38bdf8;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-on-accent: #0f172a;

    --accent: #38bdf8;
    --accent-hover: #7dd3fc;
    --accent-tint: rgba(56, 189, 248, 0.12);
    --accent-border: #0284c7;

    --siruta-color: #38bdf8;
    --siruta-bg: rgba(56, 189, 248, 0.15);
    --cui-color: #fbbf24;
    --cui-bg: rgba(251, 191, 36, 0.15);
    --postal-color: #34d399;
    --postal-bg: rgba(52, 211, 153, 0.15);
    --wiki-color: #c4b5fd;
    --wiki-bg: rgba(196, 181, 253, 0.15);
    --osm-color: #2dd4bf;
    --osm-bg: rgba(45, 212, 191, 0.15);

    --pass-color: #4ade80;
    --pass-bg: rgba(74, 222, 128, 0.15);
    --warn-color: #fb923c;
    --warn-bg: rgba(251, 146, 60, 0.15);
    --fail-color: #f87171;
    --fail-bg: rgba(248, 113, 113, 0.15);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  }
}

/* Base resets & typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Utility classes */
.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;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.brand-badge {
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  text-transform: uppercase;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.btn-ctrl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-ctrl:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* Hero & Lead Editorial Section */
.hero-section {
  padding: 3.5rem 0 2.5rem 0;
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-canvas) 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  max-width: 900px;
  margin-bottom: 1.25rem;
}

.hero-lead {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 820px;
  margin-bottom: 2rem;
}

.triad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.triad-card {
  padding: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.triad-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.triad-card.card-siruta::before { background: var(--siruta-color); }
.triad-card.card-cui::before { background: var(--cui-color); }
.triad-card.card-postal::before { background: var(--postal-color); }
.triad-card.card-wiki::before { background: var(--wiki-color); }
.triad-card.card-osm::before { background: var(--osm-color); }

.triad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.triad-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

.card-siruta .triad-tag { color: var(--siruta-color); background: var(--siruta-bg); }
.card-cui .triad-tag { color: var(--cui-color); background: var(--cui-bg); }
.card-postal .triad-tag { color: var(--postal-color); background: var(--postal-bg); }
.card-wiki .triad-tag { color: var(--wiki-color); background: var(--wiki-bg); }
.card-osm .triad-tag { color: var(--osm-color); background: var(--osm-bg); }

.triad-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.triad-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0.875rem;
}

.triad-meta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.75rem;
}

/* Metrics bar */
.metrics-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.75rem;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 2rem 0;
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-val {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.1;
}

.metric-lbl {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.25rem;
}

/* Resolver Application Section */
.app-section {
  padding: 3rem 0;
}

.section-header {
  margin-bottom: 1.75rem;
}

.section-title {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 780px;
}

.section-kicker {
  display: inline-block;
  margin-bottom: 0.65rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Visible data-quality ledger */
.quality-section {
  padding: 3rem 0;
  background: var(--bg-surface-raised);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.quality-card {
  display: flex;
  min-height: 8.25rem;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-top: 3px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.quality-card strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1.45rem;
  line-height: 1;
}

.quality-card span {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
}

.quality-card small {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.25;
}

.quality-good { border-top-color: var(--pass-color); }
.quality-warn { border-top-color: var(--warn-color); }
.quality-neutral { border-top-color: var(--accent); }

.quality-footnote {
  max-width: 840px;
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.quality-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1.25rem;
}

/* Omni-Search Box */
.search-container {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 1.25rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 3.75rem;
  padding: 0 3.5rem 0 3.25rem;
  font-size: 1.125rem;
  font-family: inherit;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.search-clear-btn {
  position: absolute;
  right: 1.25rem;
  display: none;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-raised);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
}

.search-clear-btn.visible {
  display: flex;
}

/* Filters & Chips */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.filter-select {
  padding: 0.5rem 2rem 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1rem;
}

.pill-group {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.pill-btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-btn:hover {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
}

.pill-btn.active {
  background: var(--accent);
  color: var(--text-on-accent);
  border-color: var(--accent);
  font-weight: 600;
}

/* Results & Detail Grid */
.resolver-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .resolver-layout {
    grid-template-columns: 1fr;
  }
}

.results-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  max-height: 680px;
  overflow: hidden;
}

.results-header {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface-raised);
}

.results-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.result-item {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.result-item:last-child {
  border-bottom: none;
}

.result-item:hover {
  background-color: var(--bg-surface-raised);
}

.result-item.selected {
  background-color: var(--accent-tint);
  border-left: 4px solid var(--accent);
}

.result-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.25rem;
}

.result-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.result-county {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.result-triad {
  display: flex;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.tag-cui { color: var(--cui-color); font-weight: 600; }
.tag-siruta { color: var(--siruta-color); font-weight: 600; }
.tag-postal { color: var(--postal-color); font-weight: 600; }
.tag-wiki { color: var(--wiki-color); font-weight: 600; }

/* Detail Card (The Universal Identity Passport) */
.detail-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  position: sticky;
  top: 5.5rem;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.detail-type {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.detail-name {
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.detail-official {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 0.25rem;
}

.share-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.share-action-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* Master Identifiers Trio/Quad in Card */
.id-trio,
.id-quad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.875rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .id-trio,
  .id-quad {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .id-trio,
  .id-quad {
    grid-template-columns: 1fr;
  }
}

.id-box {
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-raised);
}

.id-box.box-siruta { border-top: 3px solid var(--siruta-color); }
.id-box.box-cui { border-top: 3px solid var(--cui-color); }
.id-box.box-postal { border-top: 3px solid var(--postal-color); }
.id-box.box-wiki { border-top: 3px solid var(--wiki-color); }

.id-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.id-val {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.copy-btn:hover {
  color: var(--accent);
  background: var(--bg-surface);
}

.badge-status {
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
}

.status-valid {
  background: var(--pass-bg);
  color: var(--pass-color);
}

.status-invalid {
  background: var(--fail-bg);
  color: var(--fail-color);
}

/* Detail specs grid */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .specs-grid {
    grid-template-columns: 1fr;
  }
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.spec-val {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.spec-val.mono {
  font-family: var(--font-mono);
}

.contact-box {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-icon {
  flex-shrink: 0;
  margin-top: 0.2rem;
  color: var(--text-muted);
}

/* Administrative boundary box (OSM / ANCPI) */
.boundary-box {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.boundary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.boundary-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.boundary-attribution {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.boundary-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.boundary-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.boundary-id {
  font-weight: 700;
  color: var(--text-primary);
}

.boundary-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-boundary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

.btn-boundary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
  color: var(--accent);
}

.boundary-unavailable {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* Batch Crosswalk Converter Section */
.converter-section {
  padding: 3rem 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.converter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 860px) {
  .converter-grid {
    grid-template-columns: 1fr;
  }
}

.converter-input-card,
.converter-output-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.converter-textarea {
  width: 100%;
  height: 220px;
  padding: 0.875rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.5;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  resize: vertical;
  margin: 0.75rem 0;
}

.converter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 0.5rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  background: var(--accent);
  color: var(--text-on-accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.file-import-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.25rem;
}

.file-label {
  cursor: pointer;
}

.file-import-note {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.copy-success {
  color: var(--pass-color);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Fifty concrete uses: the bridge's reader-facing index */
.use-cases-section {
  padding: 3.5rem 0;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-subtle);
}

.use-cases-header {
  margin-bottom: 1.25rem;
}

.use-case-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 1.25rem 0 0.75rem;
}

.use-case-result {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  margin-bottom: 1rem;
}

.use-cases-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  list-style: none;
  counter-reset: use-case;
}

.use-case-card {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0.75rem;
  min-height: 8.25rem;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.use-case-card[hidden] {
  display: none;
}

.use-case-number {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 800;
  padding-top: 0.15rem;
}

.use-case-category {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.use-case-card h3 {
  margin: 0.2rem 0 0.35rem;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.25;
}

.use-case-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.45;
}

/* Math Checksum Sandbox */
.sandbox-section {
  padding: 3rem 0;
}

.sandbox-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  margin-top: 1.5rem;
}

.vector-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  margin: 1.25rem 0;
}

.vector-table th,
.vector-table td {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.vector-table th {
  background: var(--bg-surface-raised);
  color: var(--text-secondary);
  font-weight: 600;
}

.vector-table td.highlight {
  font-weight: 700;
  background: var(--accent-tint);
  color: var(--accent);
}

.vector-math-summary {
  padding: 1rem;
  background: var(--bg-surface-raised);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Editorial & Claims Section */
.editorial-section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--border-subtle);
}

.prose-block {
  max-width: 820px;
  line-height: 1.75;
  font-size: 1.0625rem;
  color: var(--text-secondary);
}

.prose-block h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 2.25rem 0 1rem 0;
}

.prose-block p {
  margin-bottom: 1.25rem;
}

.prose-block strong {
  color: var(--text-primary);
  font-weight: 700;
}

.prose-block ul {
  margin: 1rem 0 1.5rem 1.5rem;
}

.prose-block li {
  margin-bottom: 0.5rem;
}

.sources-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  margin: 1.5rem 0;
}

.sources-table th,
.sources-table td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
  text-align: left;
}

.sources-table th {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  font-weight: 700;
}

/* Footer Section */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
}

.footer-brand {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-brand a {
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-brand a:hover {
  color: var(--accent);
}

.footer-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.875rem;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--accent);
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .hero-title {
    font-size: 1.875rem;
  }
  .metrics-strip {
    flex-direction: column;
    align-items: flex-start;
  }
  .detail-card {
    padding: 1.25rem;
  }
  .header-inner {
    height: auto;
    padding: 1rem 0;
    flex-wrap: wrap;
  }
  .quality-grid,
  .use-cases-list {
    grid-template-columns: 1fr;
  }
  .quality-card {
    min-height: 6.5rem;
  }
}

@media (min-width: 641px) and (max-width: 1080px) {
  .quality-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
