/* Self-hosted fonts (zero external CDNs) */
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-ext-500.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-next-latin-ext-400.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-next-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-next-latin-ext-600.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/atkinson-hyperlegible-next-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Design tokens: Day (default) & Night */
:root {
  --bg: #FBF8F4;
  --surface: #FFFFFF;
  --sunk: #F3EEE7;
  --sage-tint: #E7EFEC;
  --blue-tint: #E6ECF3;
  --text: #2A2830;
  --muted: #5C5866;
  --accent: #3F6B73;
  --on-accent: #FFFFFF;
  --blue: #4E6A8C;
  --focus: #2F5D8A;
  --control-border: #857D72;
  --border: #D9D1C7;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px rgb(0 0 0 / 0.04);
  --radius: 12px;
  color-scheme: light;
}

[data-theme="night"] {
  --bg: #17181D;
  --surface: #202128;
  --sunk: #1B1C22;
  --sage-tint: #1F2B2D;
  --blue-tint: #22293A;
  --text: #ECE9E4;
  --muted: #B4AFA7;
  --accent: #93BEC6;
  --on-accent: #17181D;
  --blue: #A9BEDB;
  --focus: #9CC3F0;
  --control-border: #767884;
  --border: #3A3B44;
  --shadow: none;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.6;
  font-weight: 400;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

h1, h2, h3, .brand {
  font-family: "Source Serif 4", Georgia, Cambria, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.2; margin: 6px 0 10px; }
h2 { font-size: clamp(21px, 2.5vw, 24px); line-height: 1.3; margin: 0 0 12px; }
h3 { font-size: 19px; line-height: 1.35; margin: 22px 0 8px; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  z-index: 999;
}
.skip-link:focus { left: 16px; }

.wrap {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
}
.prose { max-width: 70ch; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin-bottom: 8px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.xs { font-size: 14px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-28 { margin-top: 28px; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }

/* Icons */
svg.i {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* Header */
header.top {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: relative;
  z-index: 40;
}
header.top .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding-block: 8px;
}
.brand {
  font-size: 24px;
  color: var(--text);
  text-decoration: none;
  line-height: 1;
  padding: 6px 2px;
}
nav.main {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}
nav.main a, nav.main button.nav-more-btn {
  white-space: nowrap;
  color: var(--text);
  text-decoration: none;
  font-family: inherit;
  font-size: 16px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
nav.main a:hover, nav.main button.nav-more-btn:hover { background: var(--sunk); }
nav.main a.on, nav.main a[aria-current="page"] { background: var(--sage-tint); font-weight: 600; }

.more-wrap { position: relative; }
.more-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.more-menu a {
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 15px;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.more-menu a:hover { background: var(--sunk); }
.more-menu a[aria-current="page"] { background: var(--sage-tint); font-weight: 600; }

.sp { flex: 1; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-tint);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  min-height: 40px;
}
.chip:hover { text-decoration: underline; }
.tgl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  min-height: 40px;
  white-space: nowrap;
}
.tgl:hover { background: var(--sunk); }
.lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.lang a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 4px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.lang a:hover { color: var(--text); text-decoration: underline; }
.lang .cur-lang { color: var(--text); font-weight: 600; padding: 8px 4px; }

/* Hero */
.hero {
  background: var(--sage-tint);
  padding: 32px 0 28px;
}
.hero p { color: var(--muted); max-width: 64ch; }
.eyebrow {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 4px;
  letter-spacing: 0.01em;
}

/* Grids & Cards */
.grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 28px;
  align-items: start;
}
.grid-aside {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.card-stack { display: flex; flex-direction: column; gap: 24px; margin-top: 28px; }
.section-block { margin-top: 36px; }

/* Segmented controls */
.seg {
  display: inline-flex;
  border: 1px solid var(--control-border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  font-size: 15px;
  flex-wrap: wrap;
  background: var(--surface);
}
.seg button {
  font-family: inherit;
  font-size: 15px;
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}
.seg button:hover { background: var(--sunk); }
.seg button[aria-pressed="true"],
.seg button.on {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

/* Inputs & Labels */
label.field-label, .field-label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin: 14px 0 6px;
  color: var(--text);
}
input[type="text"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="password"],
select,
textarea {
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-height: 48px;
  width: 100%;
}
textarea { min-height: 110px; line-height: 1.5; resize: vertical; }
select { cursor: pointer; }

.ig {
  display: flex;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 48px;
  background: var(--surface);
}
.ig:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}
.ig input {
  border: 0;
  border-radius: 0;
  min-height: 46px;
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.ig select {
  border: 0;
  border-left: 1px solid var(--control-border);
  border-radius: 0;
  background: var(--sunk);
  color: var(--text);
  width: auto;
  min-height: 46px;
  padding: 8px 10px;
  font-size: 15px;
  outline: none;
}

/* Lab panel rows */
.lab-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.lab-row .n { font-weight: 600; font-size: 16px; line-height: 1.3; }
.lab-row .n small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.lab-row .out { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 16px; line-height: 1.35; }
.lab-row .out small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.lab-row .ambig {
  grid-column: 1 / -1;
  background: var(--blue-tint);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.prl-details, .opt-details {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}
.prl-details summary, .opt-details summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 600;
  padding: 4px 0;
}
.prl-details input {
  width: 96px;
  min-height: 36px;
  padding: 4px 10px;
  font-size: 14px;
  margin-top: 6px;
}

/* Result panel & Info note */
.res {
  background: var(--sunk);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 16px;
}
.res .big {
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin: 4px 0 6px;
}
.res .lbl { color: var(--muted); font-size: 15px; }
.res dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin: 12px 0 0;
}
.res dt { color: var(--muted); font-size: 15px; }
.res dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.note {
  background: var(--blue-tint);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 15px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
}
.note svg.i { margin-top: 3px; color: var(--blue); }
.note-validation {
  border: 1px solid var(--blue);
  background: var(--blue-tint);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.one { color: var(--muted); font-size: 14px; margin-top: 14px; line-height: 1.5; }
.one a { color: var(--muted); }
.support-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  margin-top: 12px;
}
.support-line a { color: var(--blue); }

/* Summary bar */
.sum {
  background: var(--sage-tint);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 24px 0 0;
}
.sum pre {
  font-family: inherit;
  font-size: 16px;
  line-height: 1.55;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}
.sum-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 15px;
  margin-bottom: 12px;
}
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  cursor: pointer;
  min-height: 40px;
}
.check-inline input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Buttons */
.btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 600;
  font-size: 16px;
  border: 1px solid var(--control-border);
  color: var(--text);
  background: var(--surface);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--sunk); }
.btn.p {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.btn.p:hover { opacity: 0.92; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 12px; }
table.t {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 16px;
}
table.t th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.t td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.t tr.today td {
  background: var(--sage-tint);
  font-weight: 600;
}

/* Reader stepper & confirmation rows */
.steps {
  display: flex;
  gap: 8px;
  margin: 22px 0 18px;
  flex-wrap: wrap;
}
.steps .step-pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
  background: var(--surface);
}
.steps .step-pill.cur {
  border-color: var(--accent);
  color: var(--text);
  font-weight: 600;
  background: var(--sage-tint);
}
.dropzone {
  border: 2px dashed var(--control-border);
  border-radius: var(--radius);
  background: var(--sunk);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.dropzone.dragover {
  background: var(--sage-tint);
  border-color: var(--accent);
}
.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--sunk);
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 12px 0;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.2s ease;
}
.crow {
  display: grid;
  grid-template-columns: minmax(220px, 310px) minmax(200px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.crop-box {
  min-height: 44px;
  border-radius: 8px;
  background: var(--sunk);
  border: 1px solid var(--border);
  padding: 8px 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.crop-box canvas { max-width: 100%; height: auto; display: block; border-radius: 4px; }
.crop-text { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; color: var(--text); word-break: break-word; }
.ok-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 15px;
  color: var(--accent);
}

/* Charts & Diagrams */
.chart-svg { width: 100%; height: auto; display: block; margin-top: 8px; }
.embryo-svg { width: 100%; max-width: 420px; height: auto; display: block; margin: auto; }
.hcg-input-row {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

/* Glossary */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}
.filter-chip {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--control-border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.filter-chip[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  font-weight: 600;
}
.az-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 12px 0 20px;
}
.az-bar a {
  padding: 6px 10px;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.az-bar a:hover { background: var(--sage-tint); }
dl.glossary-list { margin: 0; }
.glossary-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
}
.glossary-item dt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  font-weight: 600;
  font-size: 19px;
  font-family: "Source Serif 4", Georgia, serif;
}
.glossary-item .exp {
  font-family: "Atkinson Hyperlegible Next", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
}
.glossary-item dd { margin: 8px 0 0; }
.glossary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}
.tag-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--sunk);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

/* Questions & Partners */
.q-phase {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 16px;
}
.q-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.q-item:first-of-type { border-top: 0; }
.q-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin-top: 2px;
  flex: none;
  accent-color: var(--accent);
}
.print-lines { display: none; }

/* Journal calendar */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}
.cal-head { text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal-cell {
  min-height: 54px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  color: var(--text);
}
.cal-cell.has-entry { background: var(--sage-tint); border-color: var(--accent); font-weight: 600; }
.cal-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); align-self: flex-end; }
.journal-entry {
  border-top: 1px solid var(--border);
  padding: 14px 0;
}
.journal-entry:first-child { border-top: 0; padding-top: 0; }

/* Embed preview */
.embed-preview {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
pre.code-box {
  background: var(--sunk);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Footer */
footer.site-foot {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 26px 0 40px;
  color: var(--muted);
  font-size: 15px;
}
footer.site-foot nav.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 14px;
}
footer.site-foot nav.foot-links a {
  color: var(--text);
  text-decoration: none;
  padding: 4px 0;
}
footer.site-foot nav.foot-links a:hover { text-decoration: underline; }
footer.site-foot p { margin: 0 0 10px; font-size: 14px; }

/* Mobile bottom tabbar + drawer */
.tabbar {
  display: none;
}
.mobile-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 64px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgb(0 0 0 / 0.12);
  padding: 14px 20px 18px;
  z-index: 70;
}
.mobile-drawer nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mobile-drawer a {
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--sunk);
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Responsive breakpoints */
@media (max-width: 960px) {
  .grid2, .grid-aside { grid-template-columns: 1fr; gap: 18px; margin-top: 20px; }
  .crow { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  body { font-size: 17px; padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  header.top .wrap { min-height: 58px; gap: 8px; }
  nav.main, header.top .lang { display: none; }
  .chip { padding: 6px 10px; font-size: 13px; }
  .tgl { padding: 6px 10px; font-size: 13px; }
  .hero { padding: 22px 0 20px; }
  .card { padding: 20px; }
  .lab-row { grid-template-columns: 1fr; gap: 6px; }
  .hcg-input-row { grid-template-columns: 1fr 1fr; }
  /* Mobile first-screen priority on Home: timeline before converter */
  .home-grid { display: flex; flex-direction: column-reverse; }
  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 64px;
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--border);
    justify-content: space-around;
    align-items: center;
    z-index: 65;
  }
  .tabbar a, .tabbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 60px;
    min-height: 52px;
    color: var(--muted);
    text-decoration: none;
    font-family: inherit;
    font-size: 12px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 4px;
  }
  .tabbar a.on, .tabbar a[aria-current="page"], .tabbar button[aria-expanded="true"] {
    color: var(--accent);
    font-weight: 600;
  }
  footer.site-foot { padding-bottom: 32px; }
}

@media (max-width: 400px) {
  .wrap { padding-inline: 16px; }
  .seg { width: 100%; border-radius: 14px; }
  .seg button { flex: 1; padding: 8px 6px; font-size: 14px; border-radius: 10px; }
}

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

/* Print stylesheet */
@media print {
  @page { margin: 16mm; }
  body {
    background: #FFFFFF !important;
    color: #111111 !important;
    font-size: 12pt;
    line-height: 1.45;
    padding-bottom: 0 !important;
  }
  header.top, .tabbar, .mobile-drawer, .no-print, .btns, .sum-opts, .chip-row, .az-bar, .steps, .dropzone {
    display: none !important;
  }
  .hero { background: none !important; padding: 0 0 12px !important; border-bottom: 1px solid #CCC; }
  .card, .q-phase, .glossary-item {
    border: 1px solid #CCC !important;
    box-shadow: none !important;
    break-inside: avoid;
    padding: 12px 14px !important;
  }
  .print-lines {
    display: block;
    border-bottom: 1px dotted #999;
    height: 22px;
    margin-top: 6px;
  }
  a { color: #111111 !important; text-decoration: none; }
  footer.site-foot { margin-top: 18px; padding-top: 10px; border-top: 1px solid #CCC; }
  footer.site-foot nav.foot-links { display: none !important; }
}
