:root {
  color-scheme: light;
  --bg: #f5f8fc;
  --bg-soft: #ebf1f7;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-2: rgba(255, 255, 255, 0.96);
  --border: rgba(20, 32, 48, 0.08);
  --border-strong: rgba(20, 143, 120, 0.18);
  --text: #102033;
  --muted: #53657a;
  --soft: #6d7e92;
  --accent: #148f78;
  --accent-text: #148f78;
  --accent-2: #d29a1c;
  --shadow: 0 24px 80px rgba(18, 33, 52, 0.11);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max: 1240px;
  --font-display: "Cormorant Garamond", "Iowan Old Style", serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(20, 143, 120, 0.16), transparent 26%),
    radial-gradient(circle at top right, rgba(210, 154, 28, 0.12), transparent 24%),
    linear-gradient(180deg, #fbfdff 0%, #f4f8fc 54%, #edf4fb 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(16, 32, 51, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 32, 51, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at center, black, transparent 92%);
  opacity: 0.35;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

button,
input {
  font: inherit;
}

.shell {
  position: relative;
  z-index: 1;
}

.topbar {
  position: relative;
  z-index: 40;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(20, 143, 120, 0.08), transparent 28%, rgba(210, 154, 28, 0.08)),
    rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(16, 32, 51, 0.08);
  box-shadow: 0 18px 60px rgba(18, 33, 52, 0.06);
}

.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 24px;
  display: grid;
  gap: 12px;
}

.topbar-stack {
  display: grid;
  gap: 12px;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 220px;
  padding: 8px 10px 8px 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(20, 143, 120, 0.96), rgba(210, 154, 28, 0.94));
  box-shadow: 0 10px 28px rgba(20, 143, 120, 0.14);
}

.brand-title {
  display: block;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.92rem;
}

.brand-subtitle {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 650;
  font-size: 0.9rem;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(20, 143, 120, 0.16), 0 8px 24px rgba(18, 33, 52, 0.06);
}

.nav-primary {
  width: fit-content;
  max-width: 100%;
  padding: 7px;
  border-radius: 999px;
  border: 1px solid rgba(16, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.58);
}

.nav-families {
  gap: 6px;
}

.nav-families a {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.36);
}

.nav a {
  color: var(--muted);
  transition: color 180ms ease, transform 180ms ease;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

.nav a:hover {
  transform: translateY(-1px);
}

.nav-primary {
  justify-content: flex-start;
}

.nav-families {
  justify-content: flex-start;
  gap: 14px;
  padding-bottom: 2px;
}

.lang-toggle {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
}

.lang-toggle button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.lang-toggle button[aria-pressed="true"] {
  color: var(--text);
  background: rgba(20, 143, 120, 0.12);
}

.page {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
}

.hero-home {
  grid-template-columns: 1fr;
}

.hero-home .hero-card {
  min-height: 360px;
}

.hero-card,
.panel,
.stat-card,
.section-card,
.result-card,
.faq-item,
.trust-block,
.mini-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 253, 0.94));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 34px;
  height: 100%;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(20, 143, 120, 0.13), transparent 28%),
    radial-gradient(circle at bottom left, rgba(210, 154, 28, 0.11), transparent 28%);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(20, 143, 120, 0.18);
  background: rgba(20, 143, 120, 0.08);
  color: #0f6c59;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1 {
  position: relative;
  z-index: 1;
  margin: 18px 0 16px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.9rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.hero p,
.panel p,
.trust-block p,
.mini-card p {
  position: relative;
  z-index: 1;
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  appearance: none;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 143, 120, 0.3);
  background: rgba(20, 143, 120, 0.08);
}

.button.primary {
  background: linear-gradient(135deg, rgba(20, 143, 120, 0.14), rgba(210, 154, 28, 0.14));
  border-color: rgba(20, 143, 120, 0.24);
}

.button:disabled {
  opacity: 0.72;
  cursor: default;
  transform: none;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 22px;
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1;
}

.stat-label {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.aside-note {
  padding: 22px;
}

.graphic-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  height: 100%;
}

.graphic-card::before,
.graphic-card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.graphic-card::before {
  inset: auto -28px -36px auto;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(20, 143, 120, 0.18);
  box-shadow: inset 0 0 0 1px rgba(210, 154, 28, 0.08);
}

.graphic-card::after {
  inset: 18px auto auto 18px;
  width: 10px;
  height: 10px;
  background: var(--accent-2);
  box-shadow:
    0 0 0 18px rgba(210, 154, 28, 0.08),
    64px 16px 0 0 rgba(20, 143, 120, 0.22),
    32px 74px 0 0 rgba(20, 143, 120, 0.14),
    118px 52px 0 0 rgba(210, 154, 28, 0.16);
}

.graphic-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.graphic-title strong {
  font-size: 1rem;
}

.hierarchy-path {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 10px;
  margin-top: 14px;
  padding-bottom: 4px;
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.hierarchy-browser {
  margin-top: 24px;
}

.hierarchy-tree {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.hierarchy-tree ul {
  list-style: none;
  margin: 10px 0 0 20px;
  padding: 0 0 0 16px;
  border-left: 1px solid rgba(16, 32, 51, 0.08);
  display: grid;
  gap: 8px;
}

.hierarchy-tree details {
  border: 1px solid rgba(16, 32, 51, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 28px rgba(18, 33, 52, 0.05);
}

.hierarchy-tree details[open] {
  padding-bottom: 10px;
}

.hierarchy-tree summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  cursor: pointer;
}

.hierarchy-tree summary::marker {
  color: var(--accent);
}

.hierarchy-tree > li > .hierarchy-tree-link,
.hierarchy-tree li > .hierarchy-tree-link {
  border: 1px solid rgba(16, 32, 51, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  min-height: 48px;
}

.hierarchy-tree-link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  color: inherit;
  text-decoration: none;
}

.hierarchy-tree-link strong {
  display: block;
  color: var(--text);
  line-height: 1.3;
}

.hierarchy-tree-link small {
  display: block;
  color: var(--soft);
  margin-top: 3px;
}

.tree-count {
  min-width: 34px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(20, 143, 120, 0.1);
  color: var(--accent-text, #0f6c59);
  text-align: center;
  font-weight: 800;
  font-size: 0.82rem;
}

.trail-chip {
  display: grid;
  gap: 4px;
  min-width: 92px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(16, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 24px rgba(16, 32, 51, 0.06);
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.trail-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(20, 143, 120, 0.22);
  box-shadow: 0 14px 30px rgba(16, 32, 51, 0.1);
}

.trail-chip small {
  color: var(--soft);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.trail-chip strong {
  color: var(--text);
  font-size: 0.98rem;
}

.metric-line {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px 18px;
  align-items: center;
  color: var(--soft);
  font-size: 0.95rem;
  overflow-x: auto;
  white-space: nowrap;
}

.metric-line strong {
  color: var(--text);
}

.orbit {
  position: relative;
  aspect-ratio: 1.18;
  border-radius: 26px;
  border: 1px solid rgba(16, 32, 51, 0.08);
  background:
    radial-gradient(circle at 50% 48%, rgba(20, 143, 120, 0.2), transparent 18%),
    radial-gradient(circle at 50% 50%, rgba(210, 154, 28, 0.08), transparent 35%),
    linear-gradient(180deg, rgba(247, 250, 253, 0.92), rgba(239, 244, 250, 0.98));
  overflow: hidden;
}

.orbit-ring {
  position: absolute;
  inset: 50% auto auto 50%;
  border-radius: 50%;
  border: 1px solid rgba(16, 32, 51, 0.08);
  transform: translate(-50%, -50%);
}

.orbit-ring.r1 { width: 58%; height: 58%; }
.orbit-ring.r2 { width: 78%; height: 78%; }
.orbit-ring.r3 { width: 94%; height: 94%; }

.orbit-center {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 18%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(20, 143, 120, 0.96), rgba(210, 154, 28, 0.92));
  box-shadow: 0 16px 34px rgba(20, 143, 120, 0.18);
}

.orbit-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid rgba(20, 143, 120, 0.88);
  box-shadow: 0 8px 18px rgba(16, 32, 51, 0.1);
}

.orbit-dot.dot-a { top: 12%; left: 18%; }
.orbit-dot.dot-b { top: 18%; right: 16%; border-color: rgba(210, 154, 28, 0.9); }
.orbit-dot.dot-c { bottom: 20%; left: 20%; }
.orbit-dot.dot-d { bottom: 14%; right: 22%; border-color: rgba(210, 154, 28, 0.9); }

.orbit-label {
  position: absolute;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(16, 32, 51, 0.08);
  color: var(--text);
  font-size: 0.82rem;
  box-shadow: 0 8px 24px rgba(16, 32, 51, 0.07);
}

.orbit-label.label-a { top: 10px; left: 12px; }
.orbit-label.label-b { top: 14px; right: 14px; }
.orbit-label.label-c { bottom: 14px; left: 16px; }
.orbit-label.label-d { bottom: 16px; right: 18px; }

.sparkline {
  display: grid;
  gap: 10px;
}

.sparkline-row {
  display: grid;
  grid-template-columns: 90px 1fr 42px;
  gap: 10px;
  align-items: center;
}

.sparkline-row span:first-child {
  color: var(--soft);
  font-size: 0.85rem;
}

.sparkline-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(16, 32, 51, 0.08);
  overflow: hidden;
}

.sparkline-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(20, 143, 120, 0.94), rgba(210, 154, 28, 0.88));
}

.sparkline-row b {
  font-size: 0.82rem;
  color: var(--text);
  text-align: right;
}

.layout {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.panel {
  padding: 24px;
}

.section-title,
.panel h2,
.faq h2,
.prose h1,
.prose h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.search-bar input {
  width: 100%;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  outline: none;
}

.search-bar input:focus {
  border-color: rgba(20, 143, 120, 0.34);
  box-shadow: 0 0 0 4px rgba(20, 143, 120, 0.12);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.chip,
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.85rem;
}

.chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  padding: 9px 14px;
  cursor: pointer;
}

.chip.active,
.chip:hover {
  color: var(--text);
  background: rgba(20, 143, 120, 0.1);
  border-color: rgba(20, 143, 120, 0.28);
}

.section-grid,
.result-grid,
.faq-grid,
.resource-grid {
  display: grid;
  gap: 16px;
}

.faq-vertical {
  grid-template-columns: 1fr;
}

.section-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  grid-auto-rows: auto;
}

.result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-card {
  padding: 18px;
  min-height: 0;
  height: auto;
  display: grid;
  gap: 14px;
  align-content: start;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.section-card:hover {
  transform: translateY(-3px);
  border-color: rgba(20, 143, 120, 0.26);
  box-shadow: 0 24px 80px rgba(18, 33, 52, 0.14);
}

.section-letter,
.code-badge {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(20, 143, 120, 0.12);
  color: #0f6c59;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.section-name {
  margin-top: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.section-name small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 500;
}

.section-meta {
  margin-top: 18px;
  color: var(--soft);
  font-size: 0.9rem;
}

.section-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.section-summary span {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(16, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.86);
}

.section-summary strong {
  color: var(--text);
  font-size: 1.02rem;
  line-height: 1;
}

.section-summary small {
  color: var(--soft);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.coverage-card {
  position: relative;
  min-height: 138px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
}

.coverage-card::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -22px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  border: 18px solid rgba(20, 143, 120, 0.1);
}

.coverage-card.direct::after {
  border-color: rgba(20, 143, 120, 0.18);
}

.coverage-card.via::after {
  border-color: rgba(210, 154, 28, 0.18);
}

.coverage-card.indirect::after {
  border-color: rgba(83, 101, 122, 0.14);
}

.coverage-card strong,
.coverage-card span {
  position: relative;
  z-index: 1;
  display: block;
}

.coverage-card strong {
  max-width: 180px;
  font-size: 1rem;
}

.coverage-card span {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.cross-lookup-panel {
  background:
    radial-gradient(circle at 8% 0%, rgba(20, 143, 120, 0.12), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(210, 154, 28, 0.12), transparent 30%),
    rgba(255, 255, 255, 0.9);
}

.cross-search-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.cross-search-hit,
.system-card {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(16, 32, 51, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  color: inherit;
  text-decoration: none;
}

.cross-search-hit {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.cross-search-hit strong,
.cross-search-hit small,
.system-card strong,
.system-card small {
  display: block;
}

.cross-search-hit strong {
  color: var(--text);
  line-height: 1.35;
}

.cross-search-hit small,
.system-card small {
  color: var(--muted);
  line-height: 1.4;
}

.coverage-matrix {
  display: grid;
  grid-template-columns: 76px repeat(8, minmax(72px, 1fr));
  gap: 6px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.coverage-axis,
.coverage-cell {
  min-height: 42px;
  padding: 9px 8px;
  border-radius: 12px;
  font-size: 0.76rem;
  line-height: 1.2;
}

.coverage-axis {
  display: grid;
  align-items: center;
  color: var(--muted);
  font-weight: 800;
}

.coverage-cell {
  display: grid;
  place-items: center;
  border: 1px solid rgba(16, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.coverage-cell.self {
  background: rgba(20, 143, 120, 0.12);
  color: #0f6c59;
}

.coverage-cell.derived {
  background: rgba(20, 143, 120, 0.16);
  color: #0f6c59;
}

.coverage-cell.heuristic {
  background: rgba(77, 101, 128, 0.1);
  color: #4d6580;
}

.coverage-cell.transitive {
  background: rgba(210, 154, 28, 0.18);
  color: #8a5a00;
}

.coverage-cell.statistical {
  background: rgba(80, 132, 180, 0.14);
  color: #315f8a;
}

.coverage-cell.product {
  background: rgba(120, 99, 170, 0.12);
  color: #594785;
}

.coverage-cell.none {
  background: rgba(77, 101, 128, 0.08);
  color: rgba(77, 101, 128, 0.72);
}

.system-reference-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.system-card {
  align-content: start;
}

.system-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
}

.result-card {
  padding: 20px;
  display: grid;
  gap: 10px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.result-card:hover {
  transform: translateY(-2px);
  border-color: rgba(210, 154, 28, 0.24);
  box-shadow: 0 24px 80px rgba(18, 33, 52, 0.14);
}

.result-card.pulse {
  border-color: rgba(20, 143, 120, 0.42);
  box-shadow: 0 0 0 4px rgba(20, 143, 120, 0.12), 0 24px 80px rgba(18, 33, 52, 0.16);
}

.result-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-card h3,
.code-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.4;
}

.result-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.code-inline {
  color: #0f6c59;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.search-hit {
  background: rgba(210, 154, 28, 0.22);
  color: inherit;
  border-radius: 4px;
  padding: 0 0.14em;
}

.branch-list {
  display: grid;
  gap: 12px;
}

.related-link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.related-link-grid .mini-card {
  display: grid;
  gap: 8px;
  align-content: start;
  color: inherit;
  text-decoration: none;
}

.equivalent-codes[hidden] {
  display: none;
}

.equivalent-code-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.risk-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(16, 32, 51, 0.08);
  background:
    radial-gradient(circle at 0% 0%, rgba(20, 143, 120, 0.12), transparent 34%),
    rgba(255, 255, 255, 0.9);
}

.risk-card.medium {
  background:
    radial-gradient(circle at 0% 0%, rgba(210, 154, 28, 0.16), transparent 34%),
    rgba(255, 255, 255, 0.9);
}

.risk-card.high {
  background:
    radial-gradient(circle at 0% 0%, rgba(168, 71, 71, 0.16), transparent 34%),
    rgba(255, 255, 255, 0.9);
}

.risk-meter {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  border: 10px solid rgba(20, 143, 120, 0.18);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 44px rgba(18, 33, 52, 0.08);
}

.risk-card.medium .risk-meter {
  border-color: rgba(210, 154, 28, 0.26);
}

.risk-card.high .risk-meter {
  border-color: rgba(168, 71, 71, 0.26);
}

.risk-meter strong {
  font-size: 1.9rem;
  line-height: 1;
}

.risk-meter span {
  margin-top: -18px;
  color: var(--muted);
  font-size: 0.8rem;
}

.risk-factor-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.risk-factor {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(16, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.82rem;
}

.risk-factor strong {
  color: var(--text);
  font-size: 0.72rem;
}

.risk-factor.ok strong {
  color: #0f6c59;
}

.risk-factor.warn strong {
  color: #8a5a00;
}

.equivalent-code-row {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(16, 32, 51, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  color: inherit;
  text-decoration: none;
}

.equivalent-code-row strong,
.equivalent-code-row small {
  display: block;
}

.equivalent-code-row strong {
  color: var(--text);
  line-height: 1.35;
}

.equivalent-code-row small,
.equivalent-source {
  color: var(--muted);
  font-size: 0.82rem;
}

.tag.is-official {
  background: rgba(20, 143, 120, 0.12);
  color: #0f6c59;
}

.tag.is-derived {
  background: rgba(210, 154, 28, 0.16);
  color: #8a5a00;
}

.tag.is-heuristic {
  background: rgba(77, 101, 128, 0.12);
  color: #4d6580;
}

.tag.is-statistical {
  background: rgba(77, 101, 128, 0.12);
  color: #4d6580;
}

.crosswalk-warning {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(210, 154, 28, 0.24);
  background: rgba(210, 154, 28, 0.1);
  color: #6d4d08;
  font-size: 0.88rem;
  line-height: 1.45;
}

.status-note {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(168, 71, 71, 0.18);
  background: linear-gradient(135deg, rgba(168, 71, 71, 0.08), rgba(210, 154, 28, 0.08));
}

.status-note strong {
  display: block;
  margin: 0;
  color: var(--text);
}

.status-note p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.branch-card {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(16, 32, 51, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 250, 253, 0.92)),
    linear-gradient(135deg, rgba(20, 143, 120, 0.05), rgba(210, 154, 28, 0.05));
  box-shadow: 0 10px 30px rgba(18, 33, 52, 0.06);
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.branch-card:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 143, 120, 0.22);
  box-shadow: 0 20px 44px rgba(18, 33, 52, 0.12);
}

.branch-card.is-current {
  border-color: rgba(20, 143, 120, 0.3);
  box-shadow: 0 18px 40px rgba(18, 33, 52, 0.1);
}

.branch-card-head {
  display: grid;
  gap: 8px;
  align-content: start;
}

.branch-card-body {
  display: grid;
  gap: 6px;
}

.branch-card-body strong {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.42;
}

.branch-card-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.profession-card small {
  display: block;
  margin-top: 8px;
  line-height: 1.35;
}

.profession-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.profession-section-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(16, 32, 51, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 253, 0.94)),
    radial-gradient(circle at 12% 8%, rgba(20, 143, 120, 0.1), transparent 34%),
    radial-gradient(circle at 92% 100%, rgba(210, 154, 28, 0.1), transparent 34%);
  box-shadow: 0 18px 56px rgba(18, 33, 52, 0.08);
}

.profession-section-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.profession-section-head .section-letter {
  text-decoration: none;
}

.profession-section-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.profession-section-meta span,
.profession-section-meta a {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(16, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.profession-section-meta a {
  color: #0f6c59;
  font-weight: 700;
  text-decoration: none;
}

.profession-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profession-role-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 8px;
  align-items: center;
  min-width: 0;
  padding: 10px 11px;
  border-radius: 16px;
  border: 1px solid rgba(16, 32, 51, 0.08);
  background: rgba(255, 255, 255, 0.82);
  color: inherit;
  text-decoration: none;
}

.profession-role-chip span {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  border-radius: 10px;
  background: rgba(20, 143, 120, 0.12);
  color: #0f6c59;
  font-weight: 800;
  font-size: 0.78rem;
}

.profession-role-chip strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profession-role-chip small {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.branch-card-cta {
  align-self: start;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(20, 143, 120, 0.18);
  background: rgba(20, 143, 120, 0.08);
  color: #0f6c59;
  font-size: 0.8rem;
  font-weight: 700;
}

.meta-row,
.code-kicker,
.language-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 7px 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
}

.page-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

.code-hero {
  padding: 28px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  color: var(--soft);
  font-size: 0.9rem;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.breadcrumbs a {
  color: var(--muted);
}

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

.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 0 2px;
}

.action-bar .button {
  min-width: 44px;
  min-height: 44px;
  padding: 12px 16px;
}

.action-status {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.86rem;
}

.code-hero h1 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 2.05rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.subtitle {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.language-tabs {
  margin-top: 18px;
}

.language-tabs button {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.language-tabs button.active {
  color: var(--text);
  border-color: rgba(20, 143, 120, 0.34);
  background: rgba(20, 143, 120, 0.1);
}

.stack {
  display: grid;
  gap: 16px;
}

.profession-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.mini-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
}

.mini-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.facts {
  width: 100%;
  border-collapse: collapse;
}

.facts th,
.facts td {
  text-align: left;
  padding: 12px 0;
  border-bottom: 1px solid rgba(16, 32, 51, 0.08);
  vertical-align: top;
}

.facts th {
  color: var(--soft);
  font-weight: 600;
  width: 38%;
}

.facts td {
  color: var(--text);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
}

.compare-table th,
.compare-table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(16, 32, 51, 0.08);
  vertical-align: top;
}

.compare-table thead th {
  color: var(--soft);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.compare-table tbody th {
  color: var(--soft);
  font-weight: 600;
  width: 26%;
}

.compare-table td strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.prose {
  color: var(--muted);
  line-height: 1.75;
}

.prose h1,
.prose h2,
.prose h3 {
  color: var(--text);
}

.prose h2 {
  margin-top: 28px;
  font-size: 1.7rem;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.metric-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
}

.metric-card span {
  display: block;
  color: var(--soft);
  font-size: 0.84rem;
  margin-bottom: 8px;
}

.metric-card strong {
  color: var(--text);
  font-size: 1.4rem;
}

.tool-input {
  width: 100%;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.tool-input:focus {
  outline: none;
  border-color: rgba(20, 143, 120, 0.34);
  box-shadow: 0 0 0 4px rgba(20, 143, 120, 0.08);
}

.tool-shell {
  display: grid;
  gap: 16px;
}

.tool-output {
  margin-top: 14px;
}

.tool-output .mini-card {
  margin-bottom: 12px;
}

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

@media print {
  body {
    background: #ffffff;
    color: #000000;
  }

  body::before,
  body::after,
  .topbar,
  .footer,
  .hero-actions,
  .lang-toggle,
  .chips,
  .search-bar button,
  .graphic-card::before,
  .graphic-card::after,
  .orbit,
  .hero-diagram-grid,
  .hero-diagram-card,
  .button {
    display: none !important;
  }

  .page {
    padding: 0;
  }

  .panel,
  .hero-card,
  .mini-card {
    box-shadow: none;
    background: #ffffff;
    border-color: #cfd7e2;
  }

  a {
    color: #000000;
    text-decoration: none;
  }
}

.route-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.route-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(16, 32, 51, 0.06);
}

.faq-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.faq-item {
  padding: 22px;
}

.faq-item h3 {
  margin: 0 0 10px;
  color: var(--text);
}

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px 44px;
  color: var(--soft);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(16, 32, 51, 0.08);
  padding-top: 20px;
}

.footer-brand {
  display: grid;
  gap: 4px;
}

.footer-note {
  color: var(--soft);
  font-size: 0.9rem;
}

.footer-note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  color: var(--muted);
}

.hero-diagram {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.hero-diagram-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.hero-diagram-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.86);
}

.hero-diagram-card small {
  display: block;
  color: var(--soft);
  margin-bottom: 8px;
}

.hero-diagram-card strong {
  font-size: 1.1rem;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 1080px) {
  .hero,
  .page-grid,
  .two-col,
  .three-col,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .section-grid,
  .faq-grid,
  .hero-diagram-grid,
  .coverage-grid,
  .related-link-grid,
  .profession-hub-grid,
  .cross-search-results,
  .system-reference-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    background:
      radial-gradient(circle at top left, rgba(20, 143, 120, 0.12), transparent 30%),
      linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
  }

  .topbar-inner,
  .page {
    padding-left: 10px;
    padding-right: 10px;
  }

  .page {
    padding-top: 18px;
  }

  .topbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .topbar-row {
    align-items: center;
    flex-direction: row;
    gap: 10px;
  }

  .nav-primary,
  .nav-families {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 10px;
    padding-bottom: 4px;
  }

  .brand {
    min-width: 0;
    gap: 12px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    flex: 0 0 auto;
  }

  .nav {
    justify-content: flex-start;
  }

  .nav a {
    font-size: 0.86rem;
    padding: 7px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(16, 32, 51, 0.06);
  }

  .brand-title {
    font-size: 0.84rem;
  }

  .brand-subtitle {
    font-size: 0.76rem;
  }

  .topbar .lang-toggle {
    width: fit-content;
    flex: 0 0 auto;
  }

  .lang-toggle {
    gap: 4px;
    padding: 4px;
  }

  .lang-toggle button {
    padding: 8px 10px;
  }

  .action-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: 12px;
    margin: 14px -2px 0;
    border: 1px solid rgba(16, 32, 51, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
  }

  .action-bar .button {
    width: calc(50% - 6px);
    flex: 1 1 calc(50% - 6px);
    min-height: 44px;
  }

  .action-status {
    width: 100%;
  }

  .hero-card,
  .panel,
  .code-hero,
  .stat-card,
  .aside-note,
  .faq-item,
  .mini-card {
    padding: 16px;
    border-radius: 20px;
  }

  .hero h1 {
    font-size: clamp(1.15rem, 5.4vw, 1.7rem);
    line-height: 1.06;
  }

  .code-hero h1 {
    font-size: clamp(1.16rem, 5.4vw, 1.58rem);
    line-height: 1.12;
  }

  .code-hero .subtitle {
    font-size: 0.98rem;
    line-height: 1.45;
  }

  .hero-actions {
    gap: 8px;
  }

  .hero-actions .button {
    width: 100%;
  }

  .language-tabs {
    gap: 8px;
    flex-wrap: wrap;
  }

  .section-grid,
  .faq-grid,
  .stat-grid,
  .search-bar,
  .hero-diagram-grid,
  .coverage-grid,
  .related-link-grid,
  .profession-hub-grid,
  .cross-search-results,
  .system-reference-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .section-card {
    min-height: 0;
    padding: 16px;
  }

  .profession-strip {
    grid-template-columns: 1fr;
  }

  .profession-section-card {
    padding: 14px;
    border-radius: 20px;
  }

  .profession-role-grid {
    grid-template-columns: 1fr;
  }

  .section-name {
    margin-top: 10px;
    font-size: 1rem;
  }

  .section-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .section-meta {
    margin-top: 12px;
    font-size: 0.84rem;
  }

  .branch-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .risk-card {
    grid-template-columns: 1fr;
  }

  .equivalent-code-row {
    grid-template-columns: 1fr;
  }

  .trail-chip {
    min-width: 84px;
    padding: 10px 12px;
  }

  .branch-card-cta {
    justify-self: start;
  }
}
