/* Version 3.1 by George A. Rauscher. Copyright 2026 George A. Rauscher. Source available on request for scientific review only. */
:root {
  color-scheme: dark;
  --bg: #111111;
  --bg-soft: #181818;
  --card: #242424;
  --card-strong: #303030;
  --line: rgba(255, 255, 255, 0.14);
  --text: #e8e8e8;
  --muted: #b5b5b5;
  --soft: #858585;
  --white: #ffffff;
  --red: #ff3f3f;
  --red-soft: rgba(255, 63, 63, 0.16);
  --green: #28f56d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  --inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 42px rgba(0, 0, 0, 0.24);
  --radius: 28px;
  --max: 1380px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.08), transparent 34rem),
    radial-gradient(circle at 84% 12%, rgba(255, 63, 63, 0.10), transparent 32rem),
    linear-gradient(135deg, #0d0d0d, #1b1b1b 44%, #111111);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

a {
  color: var(--white);
  text-decoration-color: rgba(255, 63, 63, 0.72);
  text-underline-offset: 0.24em;
}

.site-shell {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.78);
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}

.brand {
  display: grid;
  gap: 0;
  color: var(--white);
  text-decoration: none;
}

.brand strong {
  font-size: 1.04rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand span {
  color: var(--soft);
  font-size: 0.78rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.9rem;
}

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

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--white);
}

.page-intro {
  padding: clamp(28px, 5vw, 56px) 0 16px;
  text-align: center;
}

.page-intro h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
}

.page-intro .hero-copy {
  margin: 14px auto 0;
}

.hero {
  padding: clamp(54px, 8vw, 112px) 0 34px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: clamp(26px, 5vw, 76px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--white);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(3.2rem, 8.4vw, 8.6rem);
}

h2 {
  margin: 0 0 20px;
  font-size: clamp(2rem, 4.2vw, 4.6rem);
}

h3 {
  margin: 0 0 14px;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
}

.hero-copy {
  max-width: 790px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.28rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  background: linear-gradient(135deg, #3a3a3a, #252525);
  color: var(--white);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover,
button:hover,
.button:focus-visible,
button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 63, 63, 0.52);
  background: linear-gradient(135deg, #4a4a4a, #2e2e2e);
}

.button.primary,
button.primary {
  border-color: rgba(255, 63, 63, 0.52);
  background: linear-gradient(135deg, #ff3f3f, #8d1717);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.lucide-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-panel,
.calculator,
.content-card,
.result-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(48, 48, 48, 0.92), rgba(30, 30, 30, 0.92));
  box-shadow: var(--shadow);
}

.calculator {
  border-radius: 32px;
}

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

.metric-stack {
  display: grid;
  gap: 14px;
}

.metric {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 14px;
}

.metric:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.metric span {
  color: var(--soft);
}

.metric strong {
  color: var(--white);
  text-align: right;
}

.calculator-section,
.science-section,
.legal-preview {
  padding: 42px 0;
}

.calculator-section {
  padding-top: clamp(36px, 5vw, 72px);
  scroll-margin-top: 96px;
}

#method,
#subadult {
  scroll-margin-top: 96px;
}

.calculator {
  padding: clamp(22px, 3vw, 38px);
  background: linear-gradient(160deg, #2f2f2f, #262626);
  overflow: hidden;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}

.calculator-main {
  min-width: 0;
}

.calculator-lead {
  max-width: 700px;
  margin: -10px 0 16px;
  color: var(--muted);
  font-size: 0.98rem;
}

.method-strip,
.skeleton-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.method-strip {
  display: none;
}

.method-strip span,
.skeleton-stats span {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: #d6d6d6;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  padding: 5px 8px;
  text-transform: uppercase;
}

.control-grid,
.bone-row {
  display: grid;
  gap: 14px;
}

.control-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

label span {
  letter-spacing: 0.01em;
}

select,
input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: #3a3a3a;
  color: var(--white);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0 18px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

select:focus,
input:focus {
  border-color: rgba(255, 63, 63, 0.7);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.is-invalid {
  border-color: var(--red);
}

.bone-row {
  grid-template-columns: minmax(150px, 0.95fr) minmax(130px, 0.72fr) minmax(180px, 1.1fr) 44px;
  align-items: end;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 8px 10px;
  margin-top: 10px;
  background: #3a3a3a;
  box-shadow: none;
}

.icon-button {
  width: 44px;
  min-height: 42px;
  border-radius: 14px;
  padding: 0;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.form-actions button {
  min-width: 132px;
  min-height: 42px;
}

.notice,
.error {
  border: 1px solid rgba(255, 63, 63, 0.38);
  border-radius: 18px;
  background: var(--red-soft);
  color: #ffdede;
  padding: 14px 16px;
  margin-top: 16px;
}

.error[hidden],
.notice[hidden],
.empty-state[hidden] {
  display: none;
}

.empty-state {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
  margin-top: 18px;
  padding: 12px 14px;
}

.empty-state strong {
  color: var(--white);
  font-size: 0.98rem;
}

.skeleton-card {
  position: sticky;
  top: 98px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.16), transparent 17rem),
    radial-gradient(circle at 58% 52%, rgba(255, 63, 63, 0.10), transparent 16rem),
    linear-gradient(155deg, #222222, #101010);
  padding: clamp(18px, 3vw, 30px);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.skeleton-card p {
  color: var(--muted);
}

.skeleton-card h3 {
  max-width: 520px;
}

.skeleton-svg {
  width: 100%;
  max-height: 610px;
  display: block;
  margin: 0 auto;
  transform: translateY(8px);
}

.skeleton-base {
  fill: none;
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skeleton-skull,
.skeleton-pelvis {
  fill: none;
  stroke: rgba(255, 255, 255, 0.24);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skeleton-soft {
  fill: none;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skeleton-joint {
  fill: rgba(255, 255, 255, 0.06);
  stroke: rgba(255, 255, 255, 0.20);
  stroke-width: 4;
}

[data-bone] {
  fill: none;
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 8.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 180ms ease, stroke-width 180ms ease, filter 180ms ease;
}

[data-bone].is-selected {
  stroke: var(--red);
  stroke-width: 10;
  filter: drop-shadow(0 0 12px rgba(255, 63, 63, 0.55));
}

[data-bone].is-active {
  stroke: #ff7777;
  stroke-width: 14;
  filter: drop-shadow(0 0 20px rgba(255, 63, 63, 0.88));
}

.result-card {
  margin-top: 24px;
  padding: clamp(18px, 3vw, 30px);
  background:
    radial-gradient(circle at 8% 0%, rgba(40, 245, 109, 0.10), transparent 18rem),
    linear-gradient(145deg, rgba(40, 40, 40, 0.96), rgba(18, 18, 18, 0.96));
}

.result-hero h2 {
  margin-bottom: 10px;
  color: var(--green);
}

.result-hero p {
  color: var(--muted);
}

.score-panel {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(40, 245, 109, 0.32);
  border-radius: 24px;
  background:
    radial-gradient(circle at 0% 0%, rgba(40, 245, 109, 0.18), transparent 20rem),
    rgba(40, 245, 109, 0.08);
  padding: 20px;
  margin: 20px 0;
}

.diagnostic-grid span {
  color: var(--soft);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.score-panel h3 {
  margin: 0;
  color: var(--green);
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1;
}

.score-panel p {
  margin: 0;
  color: var(--muted);
}

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

.diagnostic-grid div,
.bone-results article,
.source-results p {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.15);
  padding: 14px;
}

.diagnostic-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--white);
}

.bone-results,
.source-results {
  margin-top: 22px;
}

.bone-results article {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 18px;
  margin-top: 10px;
}

.bone-results small {
  grid-column: 1 / -1;
  color: var(--soft);
}

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

.content-card {
  padding: clamp(20px, 3vw, 32px);
}

.content-card p,
.content-card li {
  color: var(--muted);
}

.content-card ul {
  margin: 0;
  padding-left: 1.1rem;
}

.wide {
  grid-column: 1 / -1;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--soft);
  padding: 34px 0;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer a {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  transition: color 180ms ease, text-shadow 180ms ease, transform 180ms ease;
}

.footer a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.28em;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 63, 63, 0.92), transparent);
  opacity: 0;
  transform: scaleX(0.24);
  transition: opacity 180ms ease, transform 180ms ease;
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--white);
  text-shadow: 0 0 18px rgba(255, 63, 63, 0.34);
  transform: translateY(-1px);
}

.footer a:hover::after,
.footer a:focus-visible::after {
  opacity: 1;
  transform: scaleX(1);
}

.footer a:focus-visible {
  outline: 2px solid rgba(255, 63, 63, 0.72);
  outline-offset: 5px;
  border-radius: 999px;
}

@media (min-width: 1600px) {
  .site-shell {
    --max: 1600px;
  }

  .calculator-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(480px, 0.8fr);
  }

  .calculator {
    padding: 44px;
  }
}

@media (max-width: 1200px) {
  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bone-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .icon-button {
    width: 100%;
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .calculator-layout,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .skeleton-card {
    position: relative;
    top: auto;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 16px 0;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 14px 18px;
  }
}

@media (max-width: 720px) {
  .site-shell {
    width: min(100% - 28px, var(--max));
  }

  .hero {
    padding-top: 42px;
  }

  .control-grid,
  .bone-row,
  .diagnostic-grid {
    grid-template-columns: 1fr;
  }

  .icon-button {
    width: 100%;
  }

  .button,
  button {
    width: 100%;
  }

  .form-actions,
  .hero-actions {
    flex-direction: column;
  }

  .bone-results article {
    grid-template-columns: 1fr;
  }

  .skeleton-svg {
    max-height: 520px;
  }
}

@media (max-width: 430px) {
  .site-shell {
    width: min(100% - 22px, var(--max));
  }

  .calculator,
  .content-card,
  .result-card,
  .skeleton-card,
  .hero-panel {
    border-radius: 22px;
  }

  h1 {
    font-size: clamp(2.64rem, 17vw, 4.2rem);
  }

  .nav-links {
    font-size: 0.84rem;
  }
}

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

/* Publication polish 3.1 */
.page-hero {
  padding: clamp(46px, 7vw, 92px) 0 18px;
}

.slim-hero h1 {
  max-width: 1120px;
  font-size: clamp(2.8rem, 6vw, 6.4rem);
}

.publication-hero h1 {
  font-size: clamp(3rem, 7.6vw, 7.9rem);
}

.compact-section {
  padding-top: 8px;
}

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

.feature-card {
  display: grid;
  gap: 14px;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(48, 48, 48, 0.92), rgba(24, 24, 24, 0.94));
  color: var(--white);
  padding: 22px;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.feature-card .lucide-icon {
  width: 26px;
  height: 26px;
  color: var(--red);
}

.feature-card span {
  color: var(--soft);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.feature-card strong {
  align-self: end;
  font-size: clamp(1.05rem, 1.4vw, 1.35rem);
  line-height: 1.16;
}

.v2-calculator {
  max-width: 1460px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px);
}

.v2-calculator .calculator-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.78fr);
}

.v2-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.v2-panel-head h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3.2vw, 3.4rem);
}

.v2-control-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.icon-field {
  position: relative;
}

.icon-field > span:not(.field-icon),
.v2-control span {
  margin-left: 2px;
}

.field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  color: var(--white);
  opacity: 0.85;
  pointer-events: none;
}

.field-icon .lucide-icon {
  width: 18px;
  height: 18px;
}

.icon-field select {
  padding-left: 46px;
}

.v2-bone-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.v2-bone-list .bone-row {
  grid-template-columns: 44px minmax(150px, 1.25fr) minmax(120px, 0.72fr) minmax(180px, 1fr) 44px;
  gap: 10px;
  align-items: end;
  margin-top: 0;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    rgba(0, 0, 0, 0.18);
}

.row-icon {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.row-icon .lucide-icon {
  width: 18px;
  height: 18px;
}

.v2-actions {
  align-items: center;
}

.v2-actions .button {
  min-height: 42px;
}

.instrument-card {
  top: 96px;
}

.publication-main {
  padding-top: clamp(34px, 5vw, 72px);
}

.article-shell {
  width: 100%;
}

.scientific-paper {
  padding: clamp(22px, 4vw, 52px);
}

.scientific-paper h1 {
  max-width: 980px;
  margin: 0 0 24px;
  font-size: clamp(2.4rem, 5vw, 5.8rem);
}

.scientific-paper h2 {
  margin-top: 34px;
  font-size: clamp(1.45rem, 2.2vw, 2.4rem);
  letter-spacing: -0.03em;
}

.scientific-paper p {
  max-width: 1040px;
  color: var(--muted);
  font-size: clamp(1rem, 1.1vw, 1.08rem);
}

.scientific-paper code {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.08em 0.32em;
}

.formula-block {
  display: grid;
  gap: 10px;
  margin: 20px 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 63, 63, 0.11), transparent 18rem),
    rgba(0, 0, 0, 0.18);
  padding: clamp(16px, 2.4vw, 26px);
  overflow-x: auto;
}

.formula-block math {
  color: var(--white);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 2.2vw, 2.15rem);
}

.formula-block figcaption {
  color: var(--soft);
  font-size: 0.9rem;
}

.references {
  display: grid;
  gap: 12px;
  padding-left: 1.2rem;
  color: var(--muted);
}

.definition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 28px;
}

.definition-grid div {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.16);
  padding: 16px;
}

.definition-grid strong {
  display: block;
  color: var(--red);
  font-size: 1.35rem;
  line-height: 1;
  margin-bottom: 8px;
}

.definition-grid span {
  color: var(--muted);
}

.legal-page .scientific-paper {
  max-width: 980px;
  margin: 0 auto;
}

/* V3.1 Bone row pill: inner selects/inputs blend into the row pill */
.v2-bone-list .bone-row select,
.v2-bone-list .bone-row input {
  background: transparent;
  border: none;
  box-shadow: none;
  min-height: 38px;
  padding: 0 14px;
}

.v2-bone-list .bone-row .row-icon {
  background: rgba(255, 255, 255, 0.10);
  border: none;
  border-radius: 999px;
}

.v2-bone-list .bone-row .icon-button {
  background: transparent;
  border: none;
  color: var(--muted);
}

.v2-bone-list .bone-row .icon-button:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.v2-bone-list .bone-row select:focus,
.v2-bone-list .bone-row input:focus {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

/* V3.1 Form: hide text labels above controls, V2.1 icon-only style */
.v2-control-grid label > span:not(.field-icon) {
  display: none;
}

.v2-control-grid label {
  gap: 0;
}

.v2-bone-list label > span {
  display: none;
}

.v2-bone-list label {
  gap: 0;
}

/* V3.1 Visual consistency */
.field-guide {
  padding: 28px 0 48px;
}

.field-guide h2 {
  margin-bottom: 20px;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
}

.field-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.field-guide-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.16);
  padding: 18px 20px;
}

.field-guide-card p {
  color: var(--soft);
  font-size: 0.84rem;
  margin: 8px 0 0;
}

.field-guide-card strong {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}

.field-guide-card h3 {
  margin: 0;
  font-size: 1.0rem;
  color: var(--white);
}

.how-to-use {
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,0.14);
  padding: clamp(16px, 2.5vw, 28px);
}

.how-to-use h2 {
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  margin: 0 0 14px;
}

.how-to-use ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  display: grid;
  gap: 10px;
}

.how-to-use li {
  font-size: 0.96rem;
}

.how-to-use li strong {
  color: var(--white);
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
}

.score-table th,
.score-table td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
  font-size: 0.9rem;
}

.score-table th {
  color: var(--white);
  background: rgba(255,255,255,0.06);
  font-weight: 800;
}

.score-table td {
  color: var(--muted);
}

@media (max-width: 1200px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 980px) {
  .v2-calculator .calculator-layout {
    grid-template-columns: 1fr;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
    padding: 12px 0;
  }

  .brand {
    min-width: 0;
  }

  .brand strong {
    font-size: 0.92rem;
  }

  .brand span {
    font-size: 0.68rem;
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    flex-wrap: initial;
    gap: 14px;
    padding: 8px 0 0;
    white-space: normal;
  }
}

@media (max-width: 720px) {
  .feature-grid,
  .definition-grid,
  .v2-control-grid,
  .v2-bone-list .bone-row {
    grid-template-columns: 1fr;
  }

  .row-icon {
    display: none;
  }

  .field-icon {
    bottom: 12px;
  }

  .nav {
    gap: 14px;
    padding: 8px 0;
  }

  .nav-links {
    gap: 9px 12px;
    font-size: 0.78rem;
  }

  .scientific-paper h1 {
    font-size: clamp(2.1rem, 12vw, 3.4rem);
  }

  .formula-block math {
    min-width: max-content;
  }
}

/* =============================================================
   V3.1 Final form polish : V2.1 pill style, consolidated
   This block intentionally ships at end-of-file to win the cascade
   against any earlier conflicting rules.
   ============================================================= */

/* Calculator card surface */
.calculator {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  background: linear-gradient(160deg, #2f2f2f, #232323);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

/* Top control grid: 7 pills (5 base + diurnal/age), equal height */
.v2-control-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  margin-bottom: 16px;
}

.v2-control-grid label {
  position: relative;
  display: block;
  gap: 0;
}

.v2-control-grid label > span:not(.field-icon) {
  display: none;
}

/* All selects/inputs become uniform pills */
.v2-calculator select,
.v2-calculator input {
  width: 100%;
  height: 48px;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  background: #3c3c3c;
  color: var(--white);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0 18px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.55) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.55) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.v2-calculator input {
  background-image: none;
}

.v2-calculator select:focus,
.v2-calculator input:focus {
  border-color: rgba(255, 63, 63, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 63, 63, 0.18);
}

.v2-calculator select::-ms-expand {
  display: none;
}

/* Selects in icon-field reserve room for the icon on the left */
.v2-control-grid .icon-field select {
  padding-left: 48px;
  padding-right: 36px;
  text-align: left;
}

/* Lucide icon, vertically centered inside the pill */
.v2-control-grid .field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  color: #ffffff;
  opacity: 0.92;
  pointer-events: none;
  display: inline-flex;
}

.v2-control-grid .field-icon .lucide-icon {
  width: 18px;
  height: 18px;
}

/* Bone list row: single horizontal pill cluster */
.v2-bone-list {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.v2-bone-list .bone-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1.1fr) 48px;
  gap: 10px;
  align-items: center;
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.v2-bone-list .bone-row label {
  display: block;
  gap: 0;
}

.v2-bone-list .bone-row label > span {
  display: none;
}

/* Inner selects/inputs in the bone row stay as full pills */
.v2-bone-list .bone-row select,
.v2-bone-list .bone-row input {
  background-color: #3c3c3c;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  height: 48px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
}

.v2-bone-list .bone-row select {
  padding-right: 36px;
}

/* Bone icon badge: circular pill on the left */
.v2-bone-list .bone-row .row-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  background: #3c3c3c;
  color: #ffffff;
}

.v2-bone-list .bone-row .row-icon .lucide-icon {
  width: 20px;
  height: 20px;
  opacity: 0.92;
}

/* Trash button: circular pill, ghost style until hover */
.v2-bone-list .bone-row .icon-button {
  width: 48px;
  height: 48px;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.v2-bone-list .bone-row .icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* Action buttons: keep .primary red but unify height */
.v2-actions {
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.v2-actions button,
.v2-actions .button {
  height: 48px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
}

/* Responsive: when the control grid wraps, keep pills evenly sized */
@media (max-width: 1320px) {
  .v2-calculator .v2-control-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .v2-calculator .v2-control-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .v2-calculator .v2-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .v2-calculator .v2-control-grid {
    grid-template-columns: 1fr;
  }
  .v2-bone-list .bone-row {
    grid-template-columns: 48px 1fr 48px;
    grid-auto-rows: auto;
  }
  .v2-bone-list .bone-row label {
    grid-column: 1 / -1;
  }
  .v2-bone-list .bone-row .row-icon {
    grid-column: 1;
    grid-row: 1;
  }
  .v2-bone-list .bone-row .icon-button {
    grid-column: 3;
    grid-row: 1;
  }
}

/* =============================================================
   V3.1 Bulletproof icons via inline SVG background images.
   Native <select> on Safari paints over absolute-positioned spans.
   Solution: bake icon and chevron straight into the select's bg.
   ============================================================= */

/* Hide the absolute-positioned field-icon spans entirely */
.v2-control-grid .field-icon {
  display: none !important;
}

/* Each top control select gets its own left icon plus shared chevron */
.v2-control-grid select#mode {
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 2v7.31'/%3E%3Cpath d='M14 9.3V2'/%3E%3Cpath d='M8.5 2h7'/%3E%3Cpath d='M14 9.3a6.5 6.5 0 1 1-4 0'/%3E%3Cpath d='M5.52 16h12.96'/%3E%3C/svg%3E"), url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"), linear-gradient(160deg, #3c3c3c, #353535);
}
.v2-control-grid select#population {
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 0 20'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 0 0 20'/%3E%3C/svg%3E"), url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"), linear-gradient(160deg, #3c3c3c, #353535);
}
.v2-control-grid select#sex {
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E"), url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"), linear-gradient(160deg, #3c3c3c, #353535);
}
.v2-control-grid select#unit {
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.3 15.3 8.7 2.7a2.4 2.4 0 0 0-3.4 0L2.7 5.3a2.4 2.4 0 0 0 0 3.4l12.6 12.6a2.4 2.4 0 0 0 3.4 0l2.6-2.6a2.4 2.4 0 0 0 0-3.4Z'/%3E%3Cpath d='m14.5 12.5 2-2'/%3E%3Cpath d='m11.5 9.5 2-2'/%3E%3Cpath d='m8.5 6.5 2-2'/%3E%3C/svg%3E"), url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"), linear-gradient(160deg, #3c3c3c, #353535);
}
.v2-control-grid select#interval {
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 14 4-4'/%3E%3Cpath d='M3.34 19a10 10 0 1 1 17.32 0'/%3E%3C/svg%3E"), url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"), linear-gradient(160deg, #3c3c3c, #353535);
}

.v2-control-grid select {
  background-color: #3c3c3c;
  background-position: 16px 50%, calc(100% - 16px) 50%, 0 0;
  background-size: 18px 18px, 12px 12px, auto;
  background-repeat: no-repeat, no-repeat, no-repeat;
  padding-left: 46px;
  padding-right: 38px;
}

/* Bone row select: chevron on the right, no left icon (the row-icon handles it) */
.v2-bone-list .bone-row select {
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"), linear-gradient(160deg, #3c3c3c, #353535);
  background-position: calc(100% - 14px) 50%, 0 0;
  background-size: 12px 12px, auto;
  background-repeat: no-repeat, no-repeat;
  background-color: #3c3c3c;
  padding-right: 36px;
}

/* V3.1 clock and calendar selects plus scientific result notes */
.v2-control-grid select#hoursSinceWaking {
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E"), url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"), linear-gradient(160deg, #3c3c3c, #353535);
}

.v2-control-grid select#age {
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='4' rx='2' ry='2'/%3E%3Cline x1='16' x2='16' y1='2' y2='6'/%3E%3Cline x1='8' x2='8' y1='2' y2='6'/%3E%3Cline x1='3' x2='21' y1='10' y2='10'/%3E%3C/svg%3E"), url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"), linear-gradient(160deg, #3c3c3c, #353535);
}

.outlier-note,
.diurnal-note {
  margin-top: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

.outlier-note {
  border-left: 3px solid rgba(255, 63, 63, 0.55);
}

.diurnal-note {
  border-left: 3px solid rgba(116, 196, 255, 0.55);
}

.outlier-note strong {
  color: var(--white);
  font-weight: 700;
}

/* =============================================================
   V3.1 Form clarity: visible labels, real-window breakpoints,
   iOS/Safari-safe select icons remain as SVG backgrounds.
   ============================================================= */
.v2-calculator .v2-control-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

@media (max-width: 1680px) {
  .v2-calculator .v2-control-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .v2-calculator .v2-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .v2-calculator .v2-control-grid {
    grid-template-columns: 1fr;
  }
}

.v2-calculator .v2-control-grid label,
.v2-calculator .v2-bone-list .bone-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.v2-calculator .v2-control-grid label > span:not(.field-icon),
.v2-calculator .v2-bone-list .bone-row label > span {
  display: block !important;
  margin: 0 0 0 8px;
  color: rgba(255, 63, 63, 0.88);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.v2-calculator .v2-control-grid select,
.v2-calculator .v2-bone-list .bone-row select,
.v2-calculator .v2-bone-list .bone-row input {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v2-calculator .v2-control-grid select {
  height: 48px;
  min-height: 48px;
}

.v2-calculator .v2-bone-list .bone-row {
  align-items: end;
}

@media (max-width: 720px) {
  .v2-calculator .v2-bone-list .bone-row {
    grid-template-columns: 48px 1fr 48px;
    grid-auto-rows: auto;
  }

  .v2-calculator .v2-bone-list .bone-row label {
    grid-column: 1 / -1;
  }
}

@media (max-width: 390px) {
  .v2-calculator .v2-control-grid select,
  .v2-calculator .v2-bone-list .bone-row select,
  .v2-calculator .v2-bone-list .bone-row input {
    font-size: 0.88rem;
  }
}

.field-guide-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.guide-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.guide-icon .lucide-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field-guide-card-head strong {
  display: block;
  margin: 0 0 5px;
}

.field-guide-card-head h3 {
  margin: 0;
}

/* V3.1 unified design system. Keep this version number fixed unless George A. Rauscher explicitly orders a change. */
:root {
  --content-max: 1200px;
  --card-radius: 28px;
  --card-bg: linear-gradient(145deg, rgba(47, 47, 47, 0.94), rgba(25, 25, 25, 0.96));
  --card-border: rgba(255, 255, 255, 0.13);
  --red-glow: rgba(255, 63, 63, 0.22);
}

.site-shell {
  width: min(var(--content-max), calc(100% - 48px));
}

@media (min-width: 1600px) {
  .site-shell {
    --max: var(--content-max);
  }
}

.nav {
  min-height: 74px;
}

.nav-links {
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 8px;
  column-gap: 18px;
}

.nav-links a[aria-current="page"] {
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: rgba(255, 63, 63, 0.75);
  text-underline-offset: 0.35em;
}

.page-intro,
.home-hero {
  padding-top: clamp(54px, 7vw, 96px);
  padding-bottom: clamp(34px, 4vw, 58px);
  text-align: center;
}

.page-intro h1,
.publication-hero h1 {
  max-width: 920px;
  margin-inline: auto;
  font-size: clamp(2.45rem, 5.4vw, 5.65rem);
}

.home-hero h1 {
  max-width: 800px;
  margin-inline: 0;
  text-align: left;
}

.page-lead,
.page-intro .page-lead,
.hero-copy {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1rem, 1.2vw, 1.16rem);
  line-height: 1.72;
}

.page-intro .page-lead {
  margin: 18px auto 0;
}

.hero-copy {
  margin-top: 22px;
}

.hero-panel,
.calculator,
.content-card,
.result-card,
.skeleton-card,
.field-guide-card,
.feature-card,
.formula-block,
.score-table,
.icon-section {
  border-color: var(--card-border);
  border-radius: var(--card-radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.calculator,
.v2-calculator,
.article-shell,
.field-guide .site-shell,
.publication-main .site-shell,
.legal-grid,
.feature-grid {
  max-width: var(--content-max);
  margin-inline: auto;
}

.article-shell {
  width: min(var(--content-max), calc(100% - 48px));
}

.scientific-paper {
  padding: clamp(26px, 4vw, 54px);
}

.scientific-paper p,
.scientific-paper li {
  max-width: 940px;
  font-size: clamp(0.98rem, 1.05vw, 1.08rem);
  line-height: 1.75;
}

.scientific-paper h2 {
  max-width: 940px;
}

.formula-block {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.formula-block math {
  min-width: max-content;
}

.score-table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.field-guide-grid {
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}

.field-guide-card {
  min-height: 188px;
}

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

.icon-section {
  padding: clamp(20px, 3vw, 30px);
}

.icon-section.full {
  grid-column: 1 / -1;
}

.icon-section-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.icon-section .guide-icon {
  color: var(--white);
  background: rgba(255, 63, 63, 0.14);
  border-color: rgba(255, 63, 63, 0.28);
}

.icon-section h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.icon-section p,
.icon-section address,
.icon-section li {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

.home-visual {
  position: relative;
  overflow: hidden;
}

.home-visual::before {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle at 50% 30%, rgba(255, 63, 63, 0.16), transparent 24rem);
  pointer-events: none;
}

.visual-stage {
  position: relative;
  min-height: 310px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}

.visual-stage svg {
  width: min(100%, 500px);
  height: auto;
  overflow: visible;
}

.visual-axis,
.visual-bone {
  fill: none;
  stroke: rgba(255, 255, 255, 0.32);
  stroke-width: 10;
  stroke-linecap: round;
}

.visual-bone-active {
  fill: none;
  stroke: var(--red);
  stroke-width: 12;
  stroke-linecap: round;
  filter: drop-shadow(0 0 14px rgba(255, 63, 63, 0.55));
  animation: antroPulse 2.7s ease-in-out infinite;
}

.visual-measure,
.visual-band {
  fill: none;
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 3;
  stroke-linecap: round;
}

.visual-band {
  stroke: rgba(255, 63, 63, 0.72);
  stroke-width: 8;
  opacity: 0.5;
}

.visual-node {
  fill: var(--red);
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 3;
}

.visual-stage text {
  fill: rgba(255, 255, 255, 0.58);
  font: 700 14px Inter, ui-sans-serif, system-ui;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@keyframes antroPulse {
  0%, 100% { opacity: 0.78; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  .visual-bone-active {
    animation: none;
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .calculator-layout,
  .v2-calculator .calculator-layout,
  .legal-grid {
    grid-template-columns: 1fr;
  }

  .home-hero h1,
  .home-hero .hero-copy {
    text-align: center;
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .site-shell,
  .article-shell {
    width: min(100% - 28px, var(--content-max));
  }

  .page-intro h1,
  .publication-hero h1 {
    font-size: clamp(2.25rem, 11vw, 3.8rem);
  }

  .scientific-paper {
    padding: 22px;
  }
}

@media (max-width: 430px) {
  .site-shell,
  .article-shell {
    width: min(100% - 22px, var(--content-max));
  }

  .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .nav-links a {
    font-size: 0.82rem;
  }

  .visual-stage {
    min-height: 230px;
  }
}

/* V3.1 mobile navigation cleanup. Keeps desktop navigation unchanged. */
.menu-toggle,
.menu-backdrop {
  display: none;
}

body.menu-open {
  overflow: hidden;
}

@media (max-width: 1320px) {
  .topbar {
    position: sticky;
    z-index: 60;
  }

  .nav {
    min-height: 70px;
  }

  .brand {
    min-width: 0;
  }

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

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
    font: inherit;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
  }

  .menu-toggle .lucide-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }

  .menu-toggle:focus-visible {
    outline: 2px solid rgba(255, 63, 63, 0.78);
    outline-offset: 3px;
  }

  .menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(8px);
  }

  .menu-backdrop[hidden] {
    display: none;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: auto;
    z-index: 80;
    display: flex;
    width: min(86vw, 360px);
    height: 100dvh;
    padding: max(28px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    overflow-y: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(145deg, rgba(29, 29, 29, 0.98), rgba(9, 9, 9, 0.99));
    box-shadow: -24px 0 70px rgba(0, 0, 0, 0.46);
    transform: translateX(104%);
    transition: transform 220ms ease;
  }

  body.menu-open .nav-links {
    transform: translateX(0);
  }

  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.96rem;
  }

  .nav-links a[aria-current="page"] {
    border-color: rgba(255, 63, 63, 0.48);
    background: rgba(255, 63, 63, 0.12);
    color: var(--white);
    text-decoration: none;
  }
}

@media (min-width: 1321px) {
  .menu-toggle,
  .menu-backdrop {
    display: none !important;
  }
}

