/* =====================================================================
   Pedigree practical – styles
   The shell, tutorial and question styles follow the other practicals.
   ===================================================================== */
:root {
  --bg: #eef1f5;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --panel-3: #eef1f5;
  --ink: #18212f;
  --ink-2: #384355;
  --muted: #647086;
  --line: #e0e5ec;
  --line-2: #cbd3de;
  --accent: #0b6b8a;
  --accent-2: #0a5a74;
  --accent-soft: #e2f1f6;
  --accent-ink: #ffffff;
  --act: #b8480b;
  --act-soft: #fff3e9;
  --good: #16794a;
  --good-soft: #e3f4eb;
  --bad: #b3261e;
  --bad-soft: #fdeceb;
  --warn: #8a5a00;
  --warn-soft: #fff6de;
  --ethics: #6b3fa0;
  --ethics-soft: #f3edfb;
  --radius: 10px;
  --radius-s: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 2px 6px rgba(16, 24, 40, 0.06);
  --shadow-l: 0 10px 30px rgba(16, 24, 40, 0.18);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --tut-w: 44%;
  --header-h: 52px;
  color-scheme: only light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
a:hover { color: var(--accent-2); }
code, kbd { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--panel-3); padding: 0.05em 0.35em; border-radius: 4px; }
kbd, .kbd { border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 0.35em; background: #fff; font-size: 0.85em; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.86em; margin: 0.4em 0; }
[hidden] { display: none !important; }
.ic { flex: none; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
body.dragging { user-select: none; }
body.dragging iframe { pointer-events: none; }

/* ---------------- buttons ---------------- */
.btn { display: inline-flex; align-items: center; gap: 0.4em; border: 1px solid var(--line-2); background: #fff; color: var(--ink); border-radius: var(--radius-s); padding: 0.38em 0.8em; cursor: pointer; font-size: 0.92em; font-weight: 550; line-height: 1.2; white-space: nowrap; transition: background 0.12s, border-color 0.12s; }
.btn:hover { background: var(--panel-2); border-color: #b6c0ce; }
.btn:focus-visible, .ch-tab:focus-visible, .wb-tab:focus-visible, .do:focus-visible, .goto:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.small { padding: 0.28em 0.65em; font-size: 0.84em; }
.btn.ghost { background: transparent; }
.btn .ic { width: 16px; height: 16px; }
.btn.running { opacity: 0.6; pointer-events: none; }
.linkbtn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0 0.2em; font-weight: 600; display: inline-flex; align-items: center; gap: 0.3em; font-size: 0.86em; }
.linkbtn .ic { width: 14px; height: 14px; }
.icon-btn { border: 0; background: none; cursor: pointer; padding: 3px; border-radius: 5px; color: var(--muted); display: inline-flex; }
.icon-btn:hover { background: var(--panel-3); color: var(--ink); }
.icon-btn .ic { width: 16px; height: 16px; }
.chip { display: inline-block; border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 0 0.6em; font-size: 0.84em; margin: 1px 0; }

/* ---------------- app shell ---------------- */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.topbar { height: var(--header-h); flex: none; display: flex; align-items: center; gap: 14px; padding: 0 14px; background: #10263a; color: #eaf2f8; border-bottom: 1px solid #0a1a28; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-title { font-weight: 700; font-size: 1.02rem; letter-spacing: 0.01em; white-space: nowrap; }
.brand-sub { font-size: 0.78rem; color: #9fb6c8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.progress-wrap { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: #b9cad7; }
.progress { width: 140px; height: 8px; border-radius: 99px; background: #26435b; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3fb7a0, #7fd67a); transition: width 0.4s; }
.topbar .btn { background: #1c3a52; border-color: #2b5170; color: #eaf2f8; }
.topbar .btn:hover { background: #24496a; }
.main { flex: 1; min-height: 0; display: flex; }
.tut { width: var(--tut-w); min-width: 320px; max-width: 72%; overflow: auto; background: var(--panel); border-right: 1px solid var(--line); scroll-behavior: smooth; }
.splitter { width: 7px; flex: none; cursor: col-resize; background: var(--bg); border-right: 1px solid var(--line); position: relative; touch-action: none; }
.splitter::after { content: ''; position: absolute; left: 2px; top: 50%; width: 3px; height: 38px; margin-top: -19px; border-radius: 3px; background: var(--line-2); }
.splitter:hover::after, .splitter.drag::after, .splitter:focus-visible::after { background: var(--accent); }
.bench { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--panel); }
.wb-tabs { display: flex; gap: 2px; padding: 6px 8px 0; background: var(--bg); border-bottom: 1px solid var(--line); flex: none; align-items: flex-end; }
.wb-tab { display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent; border-bottom: 0; background: transparent; padding: 7px 14px 8px; border-radius: 9px 9px 0 0; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 0.92rem; position: relative; top: 1px; }
.wb-tab:hover { color: var(--ink); background: rgba(255, 255, 255, 0.6); }
.wb-tab.on { background: var(--panel); border-color: var(--line); color: var(--ink); }
.wb-tab .ic { width: 17px; height: 17px; }
.wb-tab .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--act); display: none; }
.wb-tab.attn .dot { display: inline-block; }
.wb-body { flex: 1; min-height: 0; position: relative; }
.wb-pane { position: absolute; inset: 0; display: flex; flex-direction: column; }
.wb-pane[hidden] { display: none !important; }

/* pedigree pane */
.ped-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--panel-2); flex-wrap: wrap; }
.ped-pick { display: flex; align-items: center; gap: 7px; font-size: 0.82rem; font-weight: 650; color: var(--muted); flex: 1; min-width: 220px; }
.ped-pick select { flex: 1; min-width: 0; max-width: 420px; border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 8px; background: #fff; color: var(--ink); font-weight: 600; font-size: 0.9rem; }
#studioFrame { flex: 1; min-height: 0; width: 100%; border: 0; display: block; background: #f5f6f8; }
.ex-empty { padding: 30px 20px; text-align: center; color: var(--muted); }
.ex-empty h3 { color: var(--ink); margin: 0 0 6px; }

/* ---------------- tutorial pane ---------------- */
.ch-nav { position: sticky; top: 0; z-index: 5; background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); padding: 8px 14px; display: flex; gap: 4px; flex-wrap: wrap; }
.ch-tab { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 3px 10px 3px 4px; font-size: 0.82rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 550; }
.ch-tab .num { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--panel-3); font-size: 0.74rem; font-weight: 700; color: var(--muted); }
.ch-tab.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
.ch-tab.on .num { background: var(--accent); color: #fff; }
.ch-tab.done .num { background: var(--good); color: #fff; }
.chapter { padding: 18px 26px 60px; max-width: 840px; }
.chapter h1 { font-size: 1.55rem; line-height: 1.25; margin: 0.2em 0 0.2em; letter-spacing: -0.01em; }
.chapter h2 { font-size: 1.18rem; margin: 1.7em 0 0.5em; padding-top: 0.6em; border-top: 1px solid var(--line); scroll-margin-top: 60px; }
.chapter h2:first-of-type { border-top: 0; }
.chapter h3 { font-size: 1.02rem; margin: 1.3em 0 0.4em; }
.chapter p, .chapter li { color: var(--ink-2); }
.chapter ul, .chapter ol { padding-left: 1.3em; }
.chapter li { margin: 0.25em 0; }
.lede { font-size: 1.04rem; color: var(--ink-2); }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0.6em 0 1em; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; font-weight: 600; border-radius: 99px; padding: 2px 9px; background: var(--panel-3); color: var(--ink-2); }
.pill.time { background: var(--accent-soft); color: var(--accent-2); }
.pill.ext { background: var(--ethics-soft); color: var(--ethics); }
.callout { border-radius: var(--radius); padding: 10px 14px; margin: 1em 0; border: 1px solid var(--line); background: var(--panel-2); }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout .co-t { font-weight: 700; font-size: 0.86rem; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.callout.info { background: var(--accent-soft); border-color: #bfdfe9; }
.callout.info .co-t { color: var(--accent-2); }
.callout.ethics { background: var(--ethics-soft); border-color: #dccdf1; }
.callout.ethics .co-t { color: var(--ethics); }
.callout.warn { background: var(--warn-soft); border-color: #f0dca3; }
.callout.warn .co-t { color: var(--warn); }
.callout.points { background: #f1f6ee; border-color: #d3e6c7; }
.callout.points .co-t { color: #3f6b22; }
.callout.scenario { background: #fffdf4; border-color: #eadfae; border-left: 4px solid #c9a227; }
.callout.scenario .co-t { color: #7a5f00; }

/* activity cards */
.activity { border: 1px solid #f1d2bb; border-left: 4px solid var(--act); background: #fffaf6; border-radius: var(--radius); padding: 12px 16px; margin: 1.1em 0; }
.activity > .act-t { margin: 0 0 6px; font-size: 1rem; color: var(--act); font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.activity .act-t .btn { margin-left: auto; }
.steps { list-style: none; padding: 0; margin: 6px 0; counter-reset: st; }
.steps > li { counter-increment: st; position: relative; padding: 6px 0 6px 34px; margin: 0; border-top: 1px dashed #f0dccc; }
.steps > li:first-child { border-top: 0; }
.steps > li::before { content: counter(st); position: absolute; left: 0; top: 6px; width: 23px; height: 23px; border-radius: 50%; background: #fff; border: 1.5px solid var(--act); color: var(--act); font-weight: 700; font-size: 0.78rem; display: grid; place-items: center; }
.steps > li.task-done::before { content: '✓'; background: var(--good); border-color: var(--good); color: #fff; }
.steps > li.task-done { color: var(--muted); }
.steps .task-check { float: right; margin: 2px 0 0 10px; display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--muted); cursor: pointer; user-select: none; }
.steps .task-check input { accent-color: var(--good); }
.auto-tag { font-size: 0.72rem; color: var(--good); font-weight: 600; margin-left: 4px; }
.do { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #cfe3ea; background: #fff; color: var(--accent-2); border-radius: 999px; padding: 1px 10px 1px 7px; font-size: 0.82rem; font-weight: 650; cursor: pointer; vertical-align: 1px; white-space: nowrap; }
.do::before { content: '▶'; font-size: 0.7em; }
.do:hover { background: var(--accent-soft); border-color: var(--accent); }
.do.running { opacity: 0.6; pointer-events: none; }
.do.showme { border-style: dashed; color: var(--muted); }
.do.showme:hover { color: var(--accent-2); }
.goto { display: inline-flex; align-items: center; gap: 4px; border: 0; background: var(--panel-3); border-radius: 6px; padding: 0 7px; font-size: 0.86rem; font-weight: 650; cursor: pointer; color: var(--ink-2); }
.goto:hover { background: var(--accent-soft); color: var(--accent-2); }

/* questions */
.q { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 1em 0; background: #fff; box-shadow: var(--shadow); }
.q-h { display: flex; gap: 10px; align-items: flex-start; }
.q-n { flex: none; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; color: #fff; background: var(--accent); border-radius: 6px; padding: 2px 7px; margin-top: 2px; }
.q-text { font-weight: 600; color: var(--ink); }
.q-text p { margin: 0 0 0.4em; color: var(--ink); }
.q-body { margin-top: 8px; }
.q textarea, .q input[type='text'] { width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 7px 9px; background: var(--panel-2); resize: vertical; }
.q textarea { min-height: 64px; }
.q textarea:focus, .q input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); background: #fff; }
.q-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.q-feedback { font-size: 0.88rem; font-weight: 600; flex-basis: 100%; }
.q-feedback:empty { display: none; }
.q-feedback.ok { color: var(--good); }
.q-feedback.no { color: var(--bad); }
.q-answer { margin-top: 8px; border-radius: var(--radius-s); background: var(--good-soft); border: 1px solid #c3e4d0; padding: 8px 12px; font-size: 0.93rem; }
.q-answer > :first-child { margin-top: 0; }
.q-answer > :last-child { margin-bottom: 0; }
.q.answered { border-color: #bfe0cc; }
.q.picking { border-color: #f1a57c; box-shadow: 0 0 0 3px #fde3d3; }
.mcq { display: grid; gap: 6px; }
.mcq label { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 10px; cursor: pointer; background: var(--panel-2); }
.mcq label:hover { border-color: var(--accent); }
.mcq label.right { border-color: var(--good); background: var(--good-soft); }
.mcq label.wrong { border-color: var(--bad); background: var(--bad-soft); }
.mcq input { margin-top: 5px; accent-color: var(--accent); }
.pick-chosen { margin-top: 8px; font-size: 0.86rem; color: var(--ink-2); line-height: 1.8; }
.pc-out { margin-top: 8px; }
.pc-sum { font-size: 0.92rem; padding: 7px 10px; border-radius: var(--radius-s); background: var(--warn-soft); border: 1px solid #f0dca3; }
.pc-sum.ok { background: var(--good-soft); border-color: #c3e4d0; color: var(--good); }
.pc-list { margin: 6px 0 0; padding-left: 1.2em; font-size: 0.88rem; }
.pc-list li { margin: 3px 0; }
.pc-list li.pc-miss::marker { content: '＋ '; color: var(--act); }
.pc-list li.pc-wrong::marker { content: '✎ '; color: var(--act); }
.pc-list li.pc-extra::marker { content: '? '; color: var(--act); font-weight: 700; }
.pc-list li.pc-more { list-style: none; color: var(--muted); }
.no-answers .q-model { display: none !important; }

/* figures, tables, cards */
.fig { margin: 1em 0; }
.fig img, .fig svg { max-width: 100%; height: auto; }
.fig figcaption { font-size: 0.84rem; color: var(--muted); margin-top: 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 0.8em 0; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.table th { background: var(--panel-2); font-weight: 650; color: var(--ink-2); }
.next-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 2.2em; padding-top: 1em; border-top: 1px solid var(--line); flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }
.cardlet { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--panel-2); }
.cardlet h4 { margin: 0 0 4px; font-size: 0.95rem; }
.cardlet p { margin: 0; font-size: 0.9rem; }
.name-field { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.name-field input { border: 1px solid var(--line-2); border-radius: var(--radius-s); padding: 6px 9px; min-width: 240px; }
.optional { border-top: 2px dashed var(--line); margin-top: 2em; }

/* symbol table */
.symtab { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 0.8em 0; }
.symtab th, .symtab td { border-bottom: 1px solid var(--line); padding: 5px 6px; vertical-align: middle; text-align: left; }
.symtab th { background: var(--panel-2); font-weight: 650; color: var(--ink-2); }
.symtab td.sym { width: 1%; white-space: nowrap; }
.symtab svg { display: inline-block; vertical-align: middle; max-width: 120px; height: auto; }
.symtab td:nth-child(2) { width: 24%; }
.symtab td:nth-child(3) { font-size: 0.86rem; color: var(--ink-2); }
/* on a phone each symbol becomes a small card: picture and name, then the notes */
@media (max-width: 520px) {
  .symtab thead { display: none; }
  .symtab tr { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
  .symtab td { border: 0; padding: 2px 0; }
  .symtab td.sym { width: auto; }
  .symtab td:nth-child(2) { width: auto; }
  .symtab td:nth-child(3) { grid-column: 1 / -1; }
}

/* interviews */
.interview { border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; margin: 1em 0; overflow: hidden; box-shadow: var(--shadow); }
.iv-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #f3f6f9; border-bottom: 1px solid var(--line); }
.iv-avatar { width: 34px; height: 34px; border-radius: 50%; background: #2a5f7d; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; flex: none; }
.iv-name { font-weight: 700; }
.iv-sub { font-size: 0.8rem; color: var(--muted); }
.iv-log { max-height: 340px; min-height: 120px; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; background: #fbfcfd; }
.iv-msg { max-width: 86%; border-radius: 12px; padding: 6px 10px; font-size: 0.92rem; line-height: 1.45; }
.iv-msg .iv-who { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.7; }
.iv-msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.iv-msg.them { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--ink); }
.iv-msg.typing .iv-text { animation: ivfade 0.45s ease; }
@keyframes ivfade { from { opacity: 0; } to { opacity: 1; } }
.iv-coach { align-self: stretch; background: var(--warn-soft); border: 1px solid #f0dca3; border-radius: 8px; padding: 6px 10px; font-size: 0.86rem; color: #5b4200; }
.iv-note { align-self: stretch; display: flex; gap: 6px; background: var(--accent-soft); border-radius: 8px; padding: 6px 10px; font-size: 0.84rem; color: var(--accent-2); }
.iv-note .ic { width: 16px; height: 16px; margin-top: 2px; }
.iv-ask { border-top: 1px solid var(--line); padding: 8px 12px 6px; }
.iv-asklabel { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 5px; }
.iv-topics { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }
.iv-topic { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 2px 6px 2px 10px; font-size: 0.8rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); }
.iv-topic.on { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.iv-count { min-width: 18px; height: 18px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-2); font-size: 0.7rem; display: inline-grid; place-items: center; padding: 0 4px; }
.iv-topic.on .iv-count { background: rgba(255,255,255,0.25); color: #fff; }
.iv-count.none { background: var(--good-soft); color: var(--good); }
.iv-chips { display: flex; flex-direction: column; gap: 4px; }
.iv-q { text-align: left; border: 1px solid #bfdfe9; background: #f5fbfd; color: var(--accent-2); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 0.9rem; }
.iv-q:hover { background: var(--accent-soft); border-color: var(--accent); }
.iv-empty { margin: 2px 0; font-size: 0.86rem; color: var(--muted); }
.iv-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 12px 8px; font-size: 0.82rem; color: var(--muted); flex-wrap: wrap; }

/* inheritance tab */
.inh-root { overflow-y: auto; padding: 12px 16px 30px; background: #fff; }
.inh { max-width: 640px; margin: 0 auto 18px; }
.inh h3 { margin: 4px 0 8px; font-size: 1.02rem; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg-btn { border: 0; background: #fff; padding: 6px 12px; font-size: 0.86rem; font-weight: 600; cursor: pointer; border-right: 1px solid var(--line); color: var(--ink-2); }
.seg-btn:last-child { border-right: 0; }
.seg-btn.on { background: var(--accent); color: #fff; }
.inh-desc { font-size: 0.9rem; color: var(--ink-2); margin: 8px 0 12px; }
.inh-parents { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.inh-parent { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #eaf2fb; border-radius: 14px; padding: 8px 12px; min-width: 170px; }
.inh-ptitle { font-weight: 700; font-size: 0.86rem; }
.inh-parent select { border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 6px; font-size: 0.84rem; background: #fff; }
.inh-x { font-size: 1.4rem; color: var(--muted); }
.inh-gametes { display: flex; justify-content: center; gap: 40px; margin: 12px 0 4px; flex-wrap: wrap; }
.inh-gt { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); text-align: center; margin-bottom: 4px; }
.inh-gl { display: flex; gap: 12px; justify-content: center; }
.inh-gam { display: flex; flex-direction: column; align-items: center; font-size: 0.72rem; color: var(--muted); }
.inh-gridwrap { margin-top: 10px; overflow-x: auto; }
.inh-grid { border-collapse: separate; border-spacing: 6px; margin: 0 auto; }
.inh-grid th { padding: 0; }
.inh-kid { width: 120px; height: 104px; border-radius: 12px; text-align: center; vertical-align: middle; background: #eaf2fb; border: 2px solid transparent; position: relative; }
.inh-kid.affected { background: #fde7e5; border-color: #f2b8b2; }
.inh-kid.carrier { background: #fff4dc; border-color: #f0dca3; }
.inh-kid.unaffected { background: #e7f5ec; border-color: #c3e4d0; }
.inh-kid.out { opacity: 0.35; }
.inh-kid.out::after { content: ''; position: absolute; inset: 14px; background: linear-gradient(45deg, transparent 47%, #b3261e 47%, #b3261e 53%, transparent 53%), linear-gradient(-45deg, transparent 47%, #b3261e 47%, #b3261e 53%, transparent 53%); }
.inh-lab { display: block; font-size: 0.78rem; font-weight: 700; color: var(--ink-2); }
.inh-cond { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 8px 0 0; font-size: 0.9rem; cursor: pointer; }
.inh-cond input { accent-color: var(--accent); width: 16px; height: 16px; }
.inh-sum { margin: 10px auto 0; max-width: 520px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 0.92rem; }
.inh-sum p { margin: 3px 0; }
.inh-key { font-size: 0.78rem; color: var(--muted); text-align: center; margin: 8px 0 0; }
.inh-key .sw { display: inline-block; width: 10px; height: 10px; border: 1px solid #8a99ad; margin: 0 4px -1px 10px; }
.inh-key .sw.red { background: #d62828; border-color: #d62828; }
.inh-key .sw.white { background: #fff; }
.inh-calc { border-top: 1px solid var(--line); padding-top: 14px; }
.calc-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; font-size: 0.9rem; }
.calc-row > span { flex: 0 0 220px; color: var(--ink-2); }
.calc-row select { flex: 1; min-width: 200px; border: 1px solid var(--line-2); border-radius: 6px; padding: 4px 6px; font-size: 0.86rem; background: #fff; }
.calc-row input { width: 80px; border: 1px solid var(--line-2); border-radius: 6px; padding: 4px 6px; }
.calc-row input.bad { border-color: var(--bad); }
.calc-res { margin-top: 8px; font-size: 1rem; background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; }

/* ---------------- modal, popmenu, toasts ---------------- */
.modal-back { position: fixed; inset: 0; background: rgba(15, 23, 32, 0.45); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 12px; box-shadow: var(--shadow-l); width: min(620px, 100%); max-height: 90vh; display: flex; flex-direction: column; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-h h3 { margin: 0; font-size: 1.05rem; }
.modal-b { padding: 12px 16px 16px; overflow: auto; font-size: 0.92rem; }
.prompt-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.popmenu { position: fixed; z-index: 120; background: #fff; border: 1px solid var(--line-2); border-radius: 9px; box-shadow: var(--shadow-l); padding: 4px; display: flex; flex-direction: column; min-width: 200px; }
.popmenu button { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; text-align: left; font-size: 0.88rem; }
.popmenu button:hover, .popmenu button:focus-visible { background: var(--panel-3); outline: none; }
.popmenu .ic { width: 16px; height: 16px; color: var(--muted); }
.toasts { position: fixed; right: 14px; bottom: 14px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { background: #1f2937; color: #fff; padding: 9px 14px; border-radius: 9px; box-shadow: var(--shadow-l); font-size: 0.86rem; max-width: 440px; opacity: 0; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s; pointer-events: auto; line-height: 1.4; }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #8e1f19; }
.toast.warn { background: #7a5200; }
.toast.ok { background: #10593a; }
.toast b { color: #fff; }

/* ---------------- narrow screens ---------------- */
.bench-fab, .bench-close { display: none; }
@media (max-width: 1000px) {
  .app { height: auto; min-height: 100vh; }
  .main { display: block; }
  .tut { width: 100% !important; max-width: none; min-width: 0; border-right: 0; overflow: visible; }
  .splitter { display: none; }
  .bench { position: fixed; left: 0; right: 0; top: var(--header-h); bottom: 0; z-index: 60; transform: translateX(105%); transition: transform 0.25s ease; box-shadow: var(--shadow-l); }
  body.bench-open .bench { transform: none; }
  body.bench-open { overflow: hidden; }
  .bench-fab { display: inline-flex; position: fixed; right: 14px; bottom: 14px; z-index: 55; align-items: center; gap: 8px; border: 0; border-radius: 99px; padding: 11px 16px; background: var(--accent); color: #fff; font-weight: 700; box-shadow: var(--shadow-l); cursor: pointer; }
  .bench-fab .ic { width: 18px; height: 18px; }
  .bench-close { display: inline-flex; margin-left: auto; align-items: center; gap: 4px; border: 1px solid var(--line-2); background: #fff; border-radius: 8px; padding: 4px 10px; font-weight: 650; font-size: 0.85rem; cursor: pointer; align-self: center; margin-bottom: 5px; }
  .brand-sub, .progress-wrap span { display: none; }
  .topbar { position: sticky; top: 0; z-index: 70; }
  .ch-nav { top: var(--header-h); }
}
@media (max-width: 620px) {
  .chapter { padding: 14px 14px 80px; }
  .topbar { gap: 8px; padding: 0 10px; }
  .topbar .btn span { display: none; }
  .progress { width: 60px; }
  .brand-title { font-size: 0.92rem; white-space: normal; line-height: 1.15; }
  .wb-tab { padding: 7px 10px 8px; font-size: 0.85rem; }
  .ch-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ch-tab { flex: none; }
  .ch-tab .ch-title { display: none; }
  .ch-tab.on .ch-title { display: inline; }
  .calc-row > span { flex-basis: 100%; }
  .inh-kid { width: 96px; height: 96px; }
  .inh-root { padding: 10px 10px 30px; }
  .inh-parents { flex-wrap: nowrap; gap: 6px; }
  .inh-parent { min-width: 0; flex: 1 1 0; max-width: 200px; padding: 8px 6px; }
  .inh-parent select { max-width: 100%; }
  .inh-gametes { gap: 24px; }
  .inh .seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .inh .seg-btn { white-space: normal; padding: 6px; line-height: 1.2; }
}
@media print {
  .topbar, .bench, .splitter, .ch-nav, .do, .q-actions, .interview .iv-ask { display: none !important; }
  .tut { width: 100% !important; overflow: visible; }
  .chapter[hidden] { display: block !important; }
}
.flash-attn { animation: flashattn 1.3s ease; }
@keyframes flashattn { 0%, 100% { box-shadow: none; } 25%, 75% { box-shadow: 0 0 0 3px #ffb347; background: #fff4e0; } }
