/* 
 * BiologyCalculator.org - Impeccable Design System
 * Built on Apple Human Interface Guidelines, WCAG AAA Contrast, and Craft Floor Disciplines
 * Features: Optical typography, pure neutral elevation, tabular numerals, themed browser surfaces
 */

:root {
  /* Apple Neutral Canvas */
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-secondary: #f5f5f7;
  --surface-tertiary: #e5e5ea;
  --ink: #1d1d1f;
  --ink-secondary: #515154; /* 7.2:1 contrast on #fbfbfd */
  --muted: #6e6e73;         /* 5.1:1 contrast on #ffffff */
  --line: rgba(0, 0, 0, 0.09);
  --line-subtle: rgba(0, 0, 0, 0.05);
  
  /* System Accents - High Contrast for WCAG AA (>= 4.5:1 on light fills) */
  --accent: #0066cc;         /* 5.2:1 contrast on #ffffff, 4.6:1 on #f5f5f7 */
  --accent-ink: #004c99;     /* 7.3:1 contrast */
  --accent-tint: rgba(0, 102, 204, 0.07);
  --accent-border: rgba(0, 102, 204, 0.22);
  --ok: #1e7e34;
  --ok-ink: #155724;
  --ok-tint: rgba(40, 167, 69, 0.08);
  --warn: #92400e;
  --warn-ink: #78350f;
  --warn-tint: rgba(146, 64, 14, 0.08);
  --bad: #c92117;
  --bad-ink: #991b1b;
  --bad-tint: rgba(220, 38, 38, 0.08);

  /* Geometry & Single Clean Elevation (No Ghost Cards, Radii 12-16px) */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-full: 999px;
  --maxw: 1140px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --shadow-focus: 0 0 0 3px rgba(0, 102, 204, 0.18), 0 0 0 1px #0066cc;

  /* Smooth Exponential Deceleration (No Bouncy Easing) */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Cluster Theme Overrides with Strict Contrast */
body[data-cluster="genetics"] { --accent: #7928ca; --accent-ink: #551a8b; --accent-tint: rgba(121, 40, 202, 0.07); --accent-border: rgba(121, 40, 202, 0.22); }
body[data-cluster="animal-pregnancy"] { --accent: #92400e; --accent-ink: #78350f; --accent-tint: rgba(146, 64, 14, 0.07); --accent-border: rgba(146, 64, 14, 0.22); }
body[data-cluster="dog"] { --accent: #9a3412; --accent-ink: #7c2d12; --accent-tint: rgba(154, 52, 18, 0.07); --accent-border: rgba(154, 52, 18, 0.22); }
body[data-cluster="cat"] { --accent: #be185d; --accent-ink: #831843; --accent-tint: rgba(190, 24, 93, 0.07); --accent-border: rgba(190, 24, 93, 0.22); }
body[data-cluster="other-animals"] { --accent: #0e7490; --accent-ink: #155e75; --accent-tint: rgba(14, 116, 144, 0.07); --accent-border: rgba(14, 116, 144, 0.22); }
body[data-cluster="livestock"] { --accent: #166534; --accent-ink: #166534; --accent-tint: rgba(21, 128, 61, 0.07); --accent-border: rgba(21, 128, 61, 0.22); }
body[data-cluster="gardening-crops"] { --accent: #166534; --accent-ink: #14532d; --accent-tint: rgba(21, 128, 61, 0.07); --accent-border: rgba(21, 128, 61, 0.22); }
body[data-cluster="trees-forestry"] { --accent: #166534; --accent-ink: #14532d; --accent-tint: rgba(21, 128, 61, 0.07); --accent-border: rgba(21, 128, 61, 0.22); }
body[data-cluster="ecology-environment"] { --accent: #0f766e; --accent-ink: #115e59; --accent-tint: rgba(15, 118, 110, 0.07); --accent-border: rgba(15, 118, 110, 0.22); }
body[data-cluster="human-cell-biology"] { --accent: #b91c1c; --accent-ink: #7f1d1d; --accent-tint: rgba(185, 28, 28, 0.07); --accent-border: rgba(185, 28, 28, 0.22); }
body[data-cluster="lab-molecular-biology"] { --accent: #0066cc; --accent-ink: #004c99; --accent-tint: rgba(0, 102, 204, 0.07); --accent-border: rgba(0, 102, 204, 0.22); }

/* Themed Browser Surfaces */
::selection {
  background: rgba(0, 102, 204, 0.18);
  color: #1d1d1f;
}
* {
  box-sizing: border-box;
  caret-color: var(--accent);
}

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  font-feature-settings: "cv05" 1, "tnum" 1;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  letter-spacing: -0.028em;
  font-weight: 700;
}
h2 {
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  letter-spacing: -0.022em;
  font-weight: 700;
}
h3 {
  font-size: 1.2rem;
  letter-spacing: -0.015em;
  font-weight: 600;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "SF Pro Icons", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.58;
  letter-spacing: -0.006em;
  color: var(--ink);
  background-color: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

:where(img, svg, video, canvas) { max-width: 100%; height: auto; display: block; }
:where(table) { max-width: 100%; border-collapse: collapse; }

/* Apple Fluid Touch */
button, input, select, textarea, a, .chip, .ex-chip, .cluster-card, .tool-card {
  touch-action: manipulation;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 140ms ease, opacity 140ms ease;
}
a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}
a:active {
  opacity: 0.8;
}

/* Accessible Focus Ring */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* Containers with Safe Area Inset Support */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.wrap.narrow {
  max-width: 760px;
}
.muted { color: var(--ink-secondary); }
.small { font-size: 0.88rem; }
.mt { margin-top: 2.2rem; }
.vh {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   Header: Refined Translucent Chrome
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 1px 3px rgba(0, 0, 0, 0.02);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  flex-shrink: 0;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark-img,
.brand-mark-svg {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.32;
}
.brand-text strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.brand-text small {
  font-weight: 500;
  color: var(--ink-secondary);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  gap: 1.4rem;
  align-items: center;
}
.main-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.94rem;
  letter-spacing: -0.01em;
  padding: 0.35rem 0.2rem;
}
.main-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 1 220px;
  min-width: 0;
}
.nav-search-input {
  width: 100%;
  padding: 0.46rem 0.85rem;
  font: inherit;
  font-size: 0.88rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--surface-secondary);
  color: var(--ink);
}
.nav-search-input:focus {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}
.nav-search-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--ink-secondary);
  cursor: pointer;
  transition: all 140ms ease;
}
.nav-search-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.header-search { display: none; }

.nav-dropdown { position: relative; }
.nav-drop-trigger {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.nav-drop-trigger::after {
  content: "";
  width: 0.36em;
  height: 0.36em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 180ms ease;
}
.nav-dropdown.open .nav-drop-trigger::after {
  transform: rotate(-135deg) translateY(-1px);
}
.nav-drop-menu {
  position: absolute;
  top: calc(100% + 0.65rem);
  left: 0;
  min-width: 250px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 0.5rem;
  z-index: 120;
  display: none;
}
.nav-dropdown.open .nav-drop-menu { display: block; }
body:not(.js) .nav-dropdown:hover .nav-drop-menu,
body:not(.js) .nav-dropdown:focus-within .nav-drop-menu { display: block; }
.nav-drop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.nav-drop-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--ink);
  text-decoration: none;
}
.nav-drop-list a:hover {
  background: var(--surface-secondary);
  color: var(--accent);
  text-decoration: none;
}

/* Mobile Nav Toggle & Menu */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 220ms ease, opacity 180ms ease;
}
.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; transform: scaleX(0.4); }
.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-scrim {
  display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4);
  z-index: 150; opacity: 0; visibility: hidden; transition: opacity 240ms ease, visibility 240ms;
}
.nav-open .nav-scrim { opacity: 1; visibility: visible; }
.mobile-menu {
  display: none; position: fixed; top: 0; right: 0; bottom: 0;
  width: min(86vw, 340px); background: #ffffff;
  border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(0,0,0,0.1);
  z-index: 160; transform: translateX(100%); visibility: hidden;
  transition: transform 260ms var(--ease-out), visibility 0s linear 260ms;
  overflow-y: auto; padding: 5rem 1.4rem 2rem;
}
.nav-open .mobile-menu {
  transform: translateX(0); visibility: visible; transition: transform 260ms var(--ease-out), visibility 0s linear 0s;
}
.mobile-menu-list, .mobile-menu-secondary { list-style: none; margin: 0; padding: 0; }
.mobile-menu-list a {
  display: flex; align-items: center; min-height: 48px; padding: 0.65rem 0.4rem;
  font-weight: 600; font-size: 1.02rem; color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--line-subtle);
}
.mobile-menu-list a:hover { color: var(--accent); }
.mobile-menu-secondary { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; }
.mobile-menu-secondary a {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-secondary);
  font-size: 0.92rem; font-weight: 500; text-decoration: none;
}
.mobile-menu-secondary a:hover { color: var(--accent); }

/* ==========================================================================
   Hero & Page Head: WCAG AAA High Contrast
   ========================================================================== */
.hero {
  position: relative;
  background: #0d1726;
  background-image: 
    radial-gradient(circle at 18% 25%, rgba(0, 102, 204, 0.22) 0%, transparent 48%),
    radial-gradient(circle at 82% 75%, rgba(16, 185, 129, 0.14) 0%, transparent 52%),
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 28px 28px;
  color: #ffffff;
  padding: 4.5rem 0 3.8rem;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 3rem;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 1.2rem;
  letter-spacing: -0.01em;
}
.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}
.hero-badge-sep {
  opacity: 0.45;
}
.hero h1 {
  font-size: clamp(2.2rem, 3.8vw, 3.3rem);
  line-height: 1.32;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0 0 1rem;
  color: #ffffff;
  text-wrap: balance;
}
.hero .lead {
  font-size: 1.12rem;
  line-height: 1.62;
  color: #cbd5e1;
  max-width: 58ch;
  margin: 0 0 1.6rem;
}
.hero-search-wrap {
  margin: 0 0 1.35rem;
  max-width: 540px;
}
.hero-search-form {
  position: relative;
  display: flex;
  align-items: center;
}
.hero-search-input {
  width: 100%;
  padding: 0.85rem 4.2rem 0.85rem 2.85rem;
  font-size: 1rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  color: #ffffff;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 160ms ease;
  min-height: 52px;
}
.hero-search-input::placeholder {
  color: #94a3b8;
}
.hero-search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.25);
}
.hero-search-icon {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
}
.hero-search-kbd {
  position: absolute;
  right: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.22rem 0.5rem;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  pointer-events: none;
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 2rem;
}
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.82rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  text-decoration: none;
  transition: all 140ms ease;
}
.hero-chip:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
  text-decoration: none;
}
.hero-stats-deck {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding-top: 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.hero-stat-cell {
  display: flex;
  flex-direction: column;
}
.hero-stat-cell strong {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.hero-stat-cell span {
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 500;
  margin-top: 0.2rem;
}

/* Hero Live Laboratory Instrument Preview Card */
.hero-instrument {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}
.instrument-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.1rem;
}
.instrument-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #38bdf8;
}
.instrument-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}
.instrument-tabs {
  display: flex;
  gap: 0.3rem;
  background: rgba(0, 0, 0, 0.28);
  padding: 0.25rem;
  border-radius: var(--radius-full);
}
.instrument-tab {
  padding: 0.3rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 140ms ease;
}
.instrument-tab.active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.instrument-card {
  background: rgba(13, 23, 38, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
@keyframes instFade {
  0% { opacity: 0.55; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}
.instrument-card.animating {
  animation: instFade 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.instrument-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin: 0 0 0.4rem;
}
.instrument-primary-stat {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.instrument-unit {
  font-size: 0.98rem;
  font-weight: 600;
  color: #38bdf8;
  letter-spacing: 0;
}
.instrument-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  margin-top: 0.75rem;
}
.instrument-metric-row span:first-child {
  color: #94a3b8;
}
.instrument-metric-row span:last-child {
  font-weight: 700;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}
.instrument-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.instrument-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #38bdf8;
  text-decoration: none;
  transition: color 140ms ease;
}
.instrument-link:hover {
  color: #7dd3fc;
  text-decoration: none;
}
.instrument-link svg {
  width: 15px;
  height: 15px;
  transition: transform 140ms ease;
}
.instrument-link:hover svg {
  transform: translateX(3px);
}
.hero-stats {
  list-style: none;
  display: flex;
  gap: 2.2rem;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 1.4rem;
}
.hero-stats strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}
.hero-stats span {
  color: #c9d5e0;
  font-size: 0.86rem;
}

/* ==========================================================================
   Sections & Single Elevation Cards
   ========================================================================== */
.section { padding: 3.5rem 0; }
.section.alt { background: var(--surface-secondary); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section h2 { margin-top: 0; margin-bottom: 0.6rem; font-size: 1.8rem; letter-spacing: -0.025em; font-weight: 700; }
.section-intro { color: var(--ink-secondary); max-width: 70ch; margin-top: 0; font-size: 1.05rem; line-height: 1.55; }
.content section { margin-bottom: 2.6rem; }
.content h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin-top: 2.2rem; margin-bottom: 0.6rem; font-weight: 700; }

.cluster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 1.2rem;
  margin-top: 1.8rem;
}
.cluster-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1), border-color 160ms ease;
  position: relative;
}
.cluster-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.08), 0 3px 8px -2px rgba(0, 0, 0, 0.03);
  border-color: var(--accent);
  text-decoration: none;
}
.cluster-card:active {
  transform: scale(0.985);
}
.cluster-card h3 {
  margin: 0.75rem 0 0.35rem;
  font-size: 1.2rem;
  letter-spacing: -0.018em;
  font-weight: 700;
  color: var(--ink);
}
.cluster-card p {
  margin: 0.25rem 0 1rem;
  color: var(--ink-secondary);
  font-size: 0.93rem;
  line-height: 1.52;
  flex: 1 1 auto;
}
.cluster-ico-img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.cluster-stats {
  font-size: 0.84rem !important;
  color: var(--ink-secondary) !important;
  font-weight: 600;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-subtle);
  margin: 0 !important;
}
.cluster-stats strong {
  color: var(--ink);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
  margin-top: 1.6rem;
}
.tool-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), border-color 150ms ease, box-shadow 180ms ease;
}
.tool-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 18px -4px var(--accent-tint), var(--shadow-sm);
  transform: translateY(-2px);
  text-decoration: none;
}
.tool-card:active {
  transform: scale(0.98);
}
.tool-card strong {
  display: block;
  font-size: 0.98rem;
  letter-spacing: -0.012em;
  font-weight: 600;
  color: var(--ink);
  transition: color 140ms ease;
}
.tool-card:hover strong {
  color: var(--accent);
}
.tool-card small {
  color: var(--ink-secondary);
  font-size: 0.85rem;
  display: block;
  margin-top: 0.15rem;
}
.tool-ico-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Calculator Engine: Tabular Output & Inset Layout
   ========================================================================== */
.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.8rem;
  margin-top: 2rem;
  align-items: start;
}
.tool-card-full {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.85rem;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04), var(--shadow-sm);
}
.calc-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.field label {
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.field .hint {
  color: var(--ink-secondary);
  font-size: 0.78rem;
}
.field input, .field select {
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 11px;
  font: inherit;
  font-size: 1rem;
  background: var(--surface-secondary);
  color: var(--ink);
  min-height: 48px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "cv05" 1;
  transition: all 160ms ease;
}
.field input:hover, .field select:hover {
  border-color: rgba(0, 0, 0, 0.24);
}
.field input:focus, .field select:focus {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.calc-out {
  margin-top: 1.6rem;
  border-top: 1px solid var(--line);
  padding-top: 1.4rem;
  font-variant-numeric: tabular-nums;
}
.out-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.2rem;
  padding: 0.85rem 0.6rem;
  border-bottom: 1px solid var(--line-subtle);
  border-radius: 8px;
  transition: background-color 140ms ease;
  flex-wrap: wrap;
}
.out-row:not(.hi):hover {
  background-color: var(--surface-secondary);
}
.out-row .k {
  color: var(--ink-secondary);
  font-size: 0.94rem;
  font-weight: 500;
}
.out-row .v {
  font-weight: 700;
  text-align: right;
  font-size: 1.08rem;
  color: var(--ink);
  line-height: 1.4;
}
.out-row.hi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  background: linear-gradient(135deg, var(--surface) 0%, var(--accent-tint) 100%);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--accent-border);
  margin: 0.6rem 0 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.out-row.hi .k {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
}
.out-row.hi .v {
  font-size: clamp(1.85rem, 3.6vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.32;
  color: var(--ink);
  text-align: left;
}
.out-row.bad {
  background: var(--bad-tint);
  border: 1px solid rgba(201, 33, 23, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}
.out-row.bad .v {
  color: var(--bad-ink);
}
@keyframes calcArrival {
  0% { opacity: 0.65; transform: translateY(2px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes statArrival {
  0% { opacity: 0.7; transform: scale(0.985) translateY(3px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.calc-updated .out-row {
  animation: calcArrival 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.calc-updated .out-row.hi {
  animation: statArrival 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
.out-note {
  display: block;
  font-weight: 400;
  color: var(--ink-secondary);
  font-size: 0.86rem;
  max-width: 58ch;
  margin-top: 0.3rem;
  line-height: 1.5;
}
.calc-out .note {
  color: var(--ink-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ==========================================================================
   Tactile Output Actions (Copy Result, Print Lab Record, Reset)
   ========================================================================== */
/* Calculator Controls & Calculate Action Bar */
.calc-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem 1.4rem;
  margin-top: 1.5rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
}
.btn-calc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.72rem 1.6rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-ink) 100%);
  color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 2px 8px -1px var(--accent-tint), 0 1px 3px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  min-height: 48px;
  transition: transform 100ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 140ms ease, filter 140ms ease;
  line-height: 1.35;
}
.btn-calc:hover {
  filter: brightness(1.05);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 6px 18px -3px var(--accent-tint), 0 2px 5px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
  text-decoration: none;
  color: #ffffff;
}
.btn-calc.calc-pending-btn {
  background: var(--accent-ink);
  color: #ffffff;
  box-shadow: 0 0 0 3px var(--accent-tint), 0 6px 18px -3px var(--accent-tint), 0 2px 4px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
  text-decoration: none;
}
.btn-calc:active,
.btn-calc.btn-calc-active {
  transform: scale(0.96);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  filter: brightness(0.95);
}
.btn-calc svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  flex-shrink: 0;
}
.calc-controls .ex-chips {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--ink-secondary);
  flex: 1 1 auto;
}
.ex-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.15rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  background: var(--surface-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: 0.38rem 0.95rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: all 140ms ease;
  line-height: 1.35;
}
.chip:hover {
  background: var(--accent-tint);
  border-color: var(--accent-border);
  color: var(--accent-ink);
  transform: translateY(-1px);
  text-decoration: none;
}
.chip:active {
  transform: scale(0.96);
}
.chip.active {
  background: var(--accent-tint);
  border-color: var(--accent-border);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px var(--accent-border);
}

.calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.4rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line-subtle);
}
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  padding: 0.52rem 1.05rem;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 100ms cubic-bezier(0.16, 1, 0.3, 1), background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  line-height: 1.38;
  text-decoration: none;
  min-height: 38px;
}
.btn-action:hover {
  background: var(--surface-secondary);
  border-color: rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  color: var(--ink);
  text-decoration: none;
}
.btn-action:active {
  transform: scale(0.97);
}
.btn-action svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  flex-shrink: 0;
}
.btn-action.copied {
  background: var(--ok-tint);
  border-color: var(--ok);
  color: var(--ok-ink);
}

/* Fluid Range Sliders (Synced to Number Inputs) */
.field-range-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.55rem;
  padding: 0.2rem 0;
}
.field-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--surface-tertiary);
  outline: none;
  cursor: pointer;
  border: 0;
  padding: 0;
  margin: 0;
  transition: opacity 140ms ease;
}
.field-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16), 0 1px 1px rgba(0, 0, 0, 0.08);
  cursor: grab;
  transition: transform 120ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 120ms ease;
}
.field-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
}
.field-range::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.25);
  box-shadow: 0 0 0 5px var(--accent-tint), 0 2px 8px rgba(0, 0, 0, 0.25);
}
.field-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  cursor: grab;
  transition: transform 120ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 120ms ease;
}
.field-range::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
}
.field-range::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.25);
  box-shadow: 0 0 0 5px var(--accent-tint);
}

/* Sticky TOC */
.toc.card {
  background: var(--surface-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.25rem;
  position: sticky;
  top: 84px;
}
.toc ul { list-style: none; padding: 0; margin: 0.45rem 0 0; }
.toc li { margin: 0.45rem 0; }
.toc a {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  text-decoration: none;
}
.toc a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ==========================================================================
   Editorial Content & Typography (No AI Side-Tabs)
   ========================================================================== */
.formula {
  background: var(--surface-secondary);
  border: 1px solid var(--line);
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  overflow-x: auto;
}
.source {
  font-size: 0.9rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.05rem;
  color: var(--ink-secondary);
}
.callout {
  background: var(--accent-tint);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.2rem;
  margin: 1.2rem 0;
  font-size: 0.95rem;
  line-height: 1.55;
}
.callout.warn {
  background: var(--warn-tint);
  border-color: rgba(180, 83, 9, 0.25);
}
.steps { padding-left: 1.3rem; }
.steps li { margin: 0.45rem 0; }
.table-wrap { overflow-x: auto; margin: 1.2rem 0; }
.diagram { margin: 1.8rem 0; padding: 0; }
.diagram img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: 12px;
  background: #ffffff;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 260ms cubic-bezier(0.16, 1, 0.3, 1), border-color 200ms ease;
}
.diagram img:hover {
  border-color: var(--accent-border);
  box-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.08), 0 3px 8px -2px rgba(0, 0, 0, 0.03);
  transform: translateY(-2px);
}
.diagram figcaption {
  margin: 0.7rem 0 0; font-size: 0.92rem; color: var(--ink-secondary); line-height: 1.5;
}
table {
  border-collapse: collapse; width: 100%; font-size: 0.94rem; background: #ffffff;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}
th, td { border: 1px solid var(--line); padding: 0.65rem 0.85rem; text-align: left; }
th { background: var(--surface-secondary); font-weight: 600; color: var(--ink); }

.punnett {
  margin: 1.25rem 0;
  width: 100%;
  max-width: 460px;
  border-collapse: separate;
  border-spacing: 5px;
  border: 0;
  background: transparent;
}
.punnett caption {
  caption-side: top;
  font-weight: 700;
  padding-bottom: 0.65rem;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.punnett th {
  background: var(--accent-tint);
  border: 1px solid var(--accent-border);
  border-radius: 8px;
  text-align: center;
  color: var(--accent-ink);
  font-weight: 700;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  line-height: 1.38;
}
.punnett td {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  font-size: 1.08rem;
  padding: 0.75rem 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: all 120ms ease;
  line-height: 1.38;
}
.punnett td:hover {
  border-color: var(--accent);
  transform: scale(1.03);
}

.ratio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
  margin: 1.2rem 0;
}
.ratio-grid > div {
  background: var(--surface-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.15rem;
}
.ratio-grid h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--ink);
  line-height: 1.35;
}
.ratio-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ratio-grid li {
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--line-subtle);
  font-size: 0.9rem;
  line-height: 1.38;
}
.ratio-grid li:last-child {
  border-bottom: 0;
}
.ratio-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.25rem;
}
.ratio-bar-track {
  width: 100%;
  height: 6px;
  background: var(--surface-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.ratio-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

kbd.search-key {
  display: inline-block;
  padding: 0.12rem 0.35rem;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--surface-tertiary);
  border: 1px solid var(--line);
  border-radius: 4px;
  line-height: 1.35;
}

details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.2rem 1.15rem;
  margin: 0.65rem 0;
  background: #ffffff;
  transition: border-color 200ms cubic-bezier(0.16, 1, 0.3, 1), background-color 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
details[open] {
  border-color: var(--accent-border);
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}
details summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.8rem 0;
  color: var(--ink);
  transition: color 150ms ease;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
details summary::-webkit-details-marker {
  display: none;
}
details summary::after {
  content: "";
  width: 8px;
  height: 8px;
  color: var(--ink-secondary);
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1), color 150ms ease;
  margin-left: 0.75rem;
  flex-shrink: 0;
}
details[open] summary::after {
  transform: rotate(-135deg);
  color: var(--accent);
}
details summary:hover {
  color: var(--accent);
}
details summary:hover::after {
  border-color: var(--accent);
}
details p {
  margin: 0.1rem 0 0.95rem;
  color: var(--ink-secondary);
  line-height: 1.6;
}

.review-credit {
  background: var(--ok-tint);
  border: 1px solid rgba(30, 126, 52, 0.22);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.15rem;
  margin-top: 1.2rem;
}
.review-credit p {
  margin: 0.2rem 0 0;
  color: var(--ok-ink);
  font-size: 0.94rem;
  line-height: 1.5;
}
.inline-ico { vertical-align: -6px; border-radius: 6px; }

/* Author Bio Card */
.author-bio.card {
  display: flex;
  gap: 1.25rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}
.author-bio.card.wide { background: #ffffff; }
.author-bio h2 { margin: 0.15rem 0 0.45rem; font-size: 1.25rem; letter-spacing: -0.015em; }
.author-bio p { margin: 0.4rem 0; color: var(--ink-secondary); line-height: 1.55; }
.avatar {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 50%;
  background: var(--surface-secondary);
  border: 1px solid var(--line);
  object-fit: cover;
}
.avatar.big {
  width: 80px;
  height: 80px;
  min-width: 80px;
}
.author-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.2rem;
  margin-top: 1.6rem;
}
.author-card {
  display: flex;
  gap: 1.1rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms ease, transform 150ms ease;
}
.author-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
}
.author-card em {
  display: block;
  color: var(--ink-secondary);
  font-style: normal;
  font-size: 0.88rem;
  margin-top: 0.35rem;
}
.author-card small {
  display: block;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.84rem;
}

/* Pills & Chips */
.pill {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}
.pill.live { background: var(--ok-tint); color: var(--ok-ink); }
.pill.planned { background: var(--surface-secondary); color: var(--ink-secondary); }
.pill.niche { background: var(--warn-tint); color: var(--warn-ink); }

.ex-chips {
  margin: 0.9rem 0 0;
  font-size: 0.88rem;
  color: var(--ink-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.chip {
  display: inline-block;
  background: var(--surface-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: all 140ms ease;
}
.chip:hover {
  background: var(--accent-tint);
  border-color: var(--accent-border);
  color: var(--accent-ink);
  text-decoration: none;
}
.chip:active {
  transform: scale(0.96);
}

/* Topic Lists with Proper Inset */
.topic-list {
  list-style: none;
  padding: 0.4rem;
  margin: 1.2rem 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
}
.topic-list .topic {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1.15rem;
  border-radius: 8px;
  flex-wrap: wrap;
  transition: background-color 140ms ease;
}
.topic-list .topic:hover { background: var(--surface-secondary); }
.topic-list a { font-weight: 600; text-decoration: none; color: var(--ink); }
.topic-list a:hover { color: var(--accent); text-decoration: underline; }
.topic-name { font-weight: 600; color: #4a5a69; }
.topic-list.compact { border: 0; background: transparent; padding: 0; }
.topic-list.compact .topic { border-bottom: 1px dashed var(--line); border-radius: 0; padding: 0.75rem 0.6rem; }

/* TLDR & Glance Blocks (Clean 1px Border) */
.tldr, .glance {
  background: var(--surface-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.35rem;
  margin: 1.4rem 0;
}
.tldr h2, .glance h2 { font-size: 1.1rem; letter-spacing: -0.01em; margin: 0.1rem 0 0.5rem; }
.tldr ul, .glance ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.tldr li, .glance li { margin: 0.4rem 0; font-size: 0.95rem; color: var(--ink); }
.sources-list { padding-left: 1.3rem; }
.sources-list li { margin: 0.5rem 0; font-size: 0.93rem; }
.mistakes { list-style: none; padding: 0; margin: 0.5rem 0; }
.mistakes li { padding: 0.5rem 0; border-bottom: 1px dashed var(--line); font-size: 0.95rem; }
.mistakes li:last-child { border-bottom: 0; }
.page-foot { margin-top: 1.4rem; padding-top: 0.9rem; border-top: 1px dashed var(--line); }

/* ==========================================================================
   Footer: WCAG AAA High Contrast
   ========================================================================== */
/* ==========================================================================
   Search Page & Live Search System (Apple Precision & ResearchKit)
   ========================================================================== */
.search-hero {
  padding: 3.5rem 0 2.8rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.search-hero h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
  color: var(--ink);
}
.search-hero .lead {
  font-size: 1.1rem;
  color: var(--ink-secondary);
  max-width: 58ch;
  margin: 0 auto 1.6rem;
  line-height: 1.55;
}

/* Page Search Form */
.nav-search.page-search {
  flex: 1 1 100%;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
}
.page-search .nav-search-input {
  width: 100%;
  padding: 0.95rem 3.4rem 0.95rem 3.2rem;
  font-size: 1.12rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1.5px solid rgba(0, 0, 0, 0.14);
  box-shadow: var(--shadow-sm), 0 4px 16px -2px rgba(0, 0, 0, 0.04);
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  min-height: 54px;
}
.page-search .nav-search-input:hover {
  border-color: rgba(0, 0, 0, 0.22);
}
.page-search .nav-search-input:focus {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-tint), var(--shadow-md);
  outline: none;
}
.page-search .search-ico-lens {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  width: 20px;
  height: 20px;
}
.page-search .nav-search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  background: var(--accent);
  color: #ffffff;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 102, 204, 0.3);
  transition: background-color 140ms ease, transform 120ms ease;
}
.page-search .nav-search-btn:hover {
  background: var(--accent-ink);
  color: #ffffff;
  border-color: transparent;
}
.page-search .nav-search-btn:active {
  transform: translateY(-50%) scale(0.92);
}
.page-search .nav-search-btn svg {
  stroke: #ffffff;
}

/* Quick Search Suggestion Chips */
.search-quick-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.search-quick-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.25rem;
}
.search-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  background: var(--surface-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all 140ms ease;
  text-decoration: none;
  font-family: inherit;
}
.search-chip:hover {
  background: var(--accent-tint);
  border-color: var(--accent-border);
  color: var(--accent-ink);
  transform: translateY(-1px);
}
.search-chip:active {
  transform: scale(0.96);
}

/* Search Summary */
.search-summary-wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1.4rem;
  border-bottom: 1px solid var(--line);
}
.search-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.search-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--accent-tint);
  color: var(--accent-ink);
  border: 1px solid var(--accent-border);
  font-size: 0.84rem;
  font-weight: 600;
}

/* Search Results Cards */
.search-results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 820px;
  margin: 0 auto;
}
.search-result {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.25rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms ease, border-color 150ms ease;
  text-decoration: none;
  color: inherit;
}
.search-result:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.result-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--surface-secondary);
  border: 1px solid var(--line-subtle);
  padding: 8px;
  object-fit: contain;
}
.result-body {
  flex: 1;
  min-width: 0;
}
.result-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.3rem;
  line-height: 1.35;
  transition: color 140ms ease;
}
.search-result:hover .result-title {
  color: var(--accent);
  text-decoration: none;
}
.result-excerpt {
  margin: 0 0 0.65rem;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--ink-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.result-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.result-type {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-secondary);
  color: var(--ink-secondary);
  border: 1px solid var(--line);
}
.result-type.type-calculator {
  background: var(--ok-tint);
  color: var(--ok-ink);
  border-color: rgba(30, 126, 52, 0.2);
}
.result-type.type-guide {
  background: var(--accent-tint);
  color: var(--accent-ink);
  border-color: var(--accent-border);
}
.result-cluster {
  font-weight: 500;
  color: var(--ink-secondary);
}

/* Empty & Suggestion States */
.search-state {
  max-width: 640px;
  margin: 2rem auto;
  padding: 2.4rem 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.search-state-ico {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  color: var(--muted);
}
.search-state h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
  color: var(--ink);
}
.search-state p {
  color: var(--ink-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 1.25rem;
}
.search-suggest {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}
.search-suggest li a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--surface-secondary);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: all 140ms ease;
}
.search-suggest li a:hover {
  background: var(--accent-tint);
  border-color: var(--accent-border);
  color: var(--accent-ink);
  transform: translateX(3px);
}

/* Search More Button */
.search-more {
  text-align: center;
  margin-top: 2rem;
}
.search-more .btn {
  min-width: 180px;
}

/* Category Grid on Empty Query State */
.search-categories-section {
  max-width: 820px;
  margin: 1rem auto 0;
}
.search-categories-heading {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 1rem;
  color: var(--ink);
  text-align: left;
}
.search-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.85rem;
}
.search-cat-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all 140ms ease;
}
.search-cat-card:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.search-cat-ico {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
}

.site-footer {
  background: #111827;
  color: #9ca3af; /* 5.8:1 contrast on #111827 */
  margin-top: 4.5rem;
  padding-top: 3.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}
.footer-brand {
  font-weight: 700;
  color: #f9fafb;
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.015em;
}
.footer-brand-mark,
.footer-brand svg {
  width: 1.25rem;
  height: 1.25rem;
  vertical-align: -3px;
  border-radius: 5px;
  display: inline-block;
}
.site-footer h3 {
  color: #f9fafb;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin: 0.2rem 0 0.85rem;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin: 0.45rem 0; }
.site-footer a {
  color: #d1d5db; /* 9.5:1 contrast on #111827 */
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 140ms ease;
}
.site-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1.2rem 0 1.8rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

/* Cookie Consent Banner */
.consent-banner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  max-width: 960px;
  margin: 0 auto;
  background: #111827;
  color: #f9fafb;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.consent-banner[hidden] { display: none; }
.consent-inner {
  padding: 1.1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.consent-text {
  margin: 0;
  flex: 1 1 380px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #e5e7eb;
}
.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.consent-link {
  color: #38bdf8;
  font-size: 0.88rem;
  text-decoration: underline;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.2rem; }
  .hero-stats-deck { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
  .calc-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .nav-search { flex: 0 1 170px; }
}

@media (max-width: 680px) {
  .header-inner {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 20px;
    min-height: 60px;
  }
  .hero { padding: 3.5rem 0 2.8rem; }
  .hero-stats { gap: 1.4rem; }
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .mobile-menu { display: block; }
  .nav-scrim { display: block; }
  .header-search { display: flex; flex: 0 1 auto; min-width: 0; max-width: 196px; margin: 0; }
  .footer-links a { display: inline-block; padding: 0.45rem 0; }
  .topic-list a { display: inline-block; padding: 0.45rem 0; }
  .punnett { min-width: 0; }
  .tool-card-full { padding: 1.35rem 1.1rem; }
  .calc-controls { flex-direction: column; align-items: stretch; gap: 0.85rem; }
  .btn-calc { width: 100%; min-height: 48px; font-size: 1.05rem; }
  .calc-controls .ex-chips { width: 100%; justify-content: flex-start; }
  .consent-banner { left: 12px; right: 12px; bottom: 12px; }
}

@media (max-width: 480px) {
  .hero-stats-deck { grid-template-columns: 1fr; gap: 0.85rem; }
  .author-bio.card { flex-direction: column; }
  .author-card { flex-direction: column; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .diagram img:hover, .btn:hover, .btn-action:hover, .ex-chip:hover, .btn:active, .btn-action:active, .ex-chip:active {
    transform: none !important;
  }
  details summary::after {
    transition: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .toc.card {
    background: var(--surface-secondary) !important;
    backdrop-filter: none !important;
  }
  .mobile-menu {
    background: #ffffff !important;
    backdrop-filter: none !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(0, 0, 0, 0.22);
    --line-subtle: rgba(0, 0, 0, 0.15);
  }
  .tool-card-full,
  .cluster-card,
  .tool-card,
  .btn,
  .field input,
  .field select {
    border-color: rgba(0, 0, 0, 0.28);
  }
}

.site-footer .muted { color: #9ca3af !important; }
.site-footer small { color: #9ca3af; }

/* Laboratory Print Slip (Hidden on screen) */
.lab-print-record {
  display: none !important;
}

/* ==========================================================================
   Laboratory Print Record Formatting
   ========================================================================== */
@media print {
  @page {
    size: portrait;
    margin: 10mm 14mm;
  }
  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Helvetica, Arial, sans-serif !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .site-header,
  .site-footer,
  .consent-banner,
  .toc,
  .calc-actions,
  .mobile-menu,
  .nav-scrim,
  .ex-chips,
  .page-foot,
  script {
    display: none !important;
  }

  /* When printing on a calculator page: hide all website layout and educational text */
  body.print-record-active > *:not(#lab-print-record),
  .calc-layout ~ .content {
    display: none !important;
  }

  /* High-end Laboratory Computation Slip */
  body.print-record-active #lab-print-record {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-sizing: border-box !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  .print-slip {
    border: 1.5pt solid #0f172a;
    border-radius: 8pt;
    padding: 16pt 20pt;
    background: #ffffff;
    box-sizing: border-box;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .print-slip-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 10pt;
    border-bottom: 1pt solid #cbd5e1;
    margin-bottom: 10pt;
  }
  .print-brand {
    display: flex;
    align-items: center;
    gap: 8pt;
  }
  .print-brand-title {
    font-size: 13pt;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.15;
  }
  .print-brand-sub {
    font-size: 7.5pt;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-top: 2pt;
  }
  .print-meta {
    text-align: right;
    font-size: 7.5pt;
    color: #475569;
    line-height: 1.4;
  }
  .print-tool-head {
    margin: 0 0 12pt;
    padding-bottom: 8pt;
    border-bottom: 0.75pt dashed #cbd5e1;
  }
  .print-tool-title {
    font-size: 15pt;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin: 0 0 3pt;
    line-height: 1.25;
  }
  .print-tool-url {
    font-size: 8pt;
    color: #0066cc;
    font-weight: 500;
    word-break: break-all;
  }
  .print-tool-byline {
    font-size: 7.5pt;
    color: #64748b;
    margin-top: 2pt;
  }
  .print-body-grid {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 14pt;
    margin-bottom: 12pt;
    align-items: start;
  }
  .print-section-title {
    font-size: 8.5pt;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #334155;
    margin: 0 0 6pt;
    padding-bottom: 3pt;
    border-bottom: 1pt solid #e2e8f0;
  }
  .print-inputs-card {
    background: #f8fafc;
    border: 1pt solid #e2e8f0;
    border-radius: 6pt;
    padding: 8pt 10pt;
  }
  .print-input-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 8pt;
    padding: 3.5pt 0;
    border-bottom: 0.5pt solid #e2e8f0;
  }
  .print-input-item:last-child {
    border-bottom: 0;
  }
  .print-input-lbl {
    color: #64748b;
    font-weight: 500;
    max-width: 60%;
  }
  .print-input-val {
    color: #0f172a;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
  }
  .print-primary-card {
    background: #eff6ff;
    border: 1.5pt solid #0066cc;
    border-radius: 6pt;
    padding: 10pt 12pt;
    margin-bottom: 8pt;
  }
  .print-primary-lbl {
    font-size: 8pt;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #004c99;
    margin-bottom: 2pt;
  }
  .print-primary-val {
    font-size: 19pt;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
  }
  .print-primary-note {
    font-size: 7.5pt;
    color: #475569;
    margin-top: 3pt;
  }
  .print-secondary-card {
    background: #ffffff;
    border: 1pt solid #e2e8f0;
    border-radius: 6pt;
    padding: 6pt 10pt;
    margin-bottom: 8pt;
  }
  .print-secondary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 8pt;
    padding: 3.5pt 0;
    border-bottom: 0.5pt solid #f1f5f9;
  }
  .print-secondary-row:last-child {
    border-bottom: 0;
  }
  .print-secondary-k {
    color: #475569;
    font-weight: 600;
    max-width: 58%;
  }
  .print-secondary-v {
    color: #0f172a;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
  }
  .print-note {
    display: block;
    font-size: 7pt;
    font-weight: 400;
    color: #64748b;
    font-style: italic;
    margin-top: 1pt;
  }
  .print-extra-card {
    background: #f8fafc;
    border: 1pt solid #e2e8f0;
    border-radius: 6pt;
    padding: 6pt 10pt;
    font-size: 7.5pt;
    line-height: 1.4;
    color: #334155;
  }
  .print-extra-card .callout {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .print-slip-footer {
    padding-top: 10pt;
    border-top: 1pt solid #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
  }
  .print-footer-info {
    font-size: 7pt;
    color: #64748b;
    line-height: 1.4;
    max-width: 60%;
  }
  .print-sig-block {
    text-align: right;
    min-width: 170pt;
  }
  .print-sig-line {
    border-bottom: 0.75pt solid #475569;
    height: 14pt;
    margin-bottom: 3pt;
  }
  .print-sig-label {
    font-size: 7pt;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  /* Fallback if printing without print-record-active */
  .calc-layout {
    display: block !important;
  }
  .tool-card-full {
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .calc-out {
    border: 1px solid #d1d5db !important;
    border-radius: 8pt !important;
    padding: 12pt !important;
    margin-top: 14pt !important;
  }
  .out-row.hi {
    background: #f3f4f6 !important;
    border: 1px solid #9ca3af !important;
  }
}
