/* =========================================================
   基因侦探社 · visual system
   ========================================================= */
:root {
  --bg: #0b1220;
  --bg-2: #0f1929;
  --panel: #152238;
  --panel-2: #1a2a44;
  --panel-3: #203451;
  --paper: #f4efe3;
  --paper-2: #eae2d1;
  --paper-3: #ded3bd;
  --ink: #1b2434;
  --ink-soft: #46536a;
  --text: #e9eef7;
  --muted: #93a4bd;
  --muted-2: #6d7f99;
  --teal: #4fd1c5;
  --teal-2: #2cb7ab;
  --teal-soft: rgba(79, 209, 197, .13);
  --amber: #f4b860;
  --amber-2: #e39b3d;
  --amber-soft: rgba(244, 184, 96, .14);
  --coral: #ff7d7d;
  --coral-soft: rgba(255, 125, 125, .13);
  --green: #6ee7a8;
  --green-soft: rgba(110, 231, 168, .13);
  --violet: #b7a4ff;
  --line: rgba(233, 238, 247, .11);
  --line-strong: rgba(233, 238, 247, .2);
  --shadow: 0 24px 70px rgba(0, 0, 0, .32);
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, .18);
  --radius: 22px;
  --radius-sm: 14px;
  --font-display: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --max: 1380px;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

button,
input,
textarea,
select { font: inherit; }

button { cursor: pointer; }

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

svg { display: block; }

::selection {
  background: var(--teal);
  color: #07110f;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a101b; }
::-webkit-scrollbar-thumb {
  background: #2a3d58;
  border: 2px solid #0a101b;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: #3b5376; }

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

/* ---------- atmosphere ---------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient__grid {
  position: absolute;
  inset: -10%;
  background-image:
    linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 54px 54px;
  transform: perspective(700px) rotateX(18deg) scale(1.15);
  transform-origin: top center;
  mask-image: radial-gradient(ellipse at 50% 12%, #000 0%, transparent 68%);
}

.ambient__glow {
  position: absolute;
  width: 56vw;
  height: 56vw;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .18;
}

.ambient__glow--teal {
  top: -24vw;
  right: -18vw;
  background: radial-gradient(circle, #2dd4bf, transparent 68%);
}

.ambient__glow--amber {
  bottom: -34vw;
  left: -24vw;
  background: radial-gradient(circle, #d9902f, transparent 70%);
  opacity: .12;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 74px;
  padding: 12px clamp(18px, 3.4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(9, 15, 26, .78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar.is-hidden { display: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--teal);
  border: 1px solid rgba(79, 209, 197, .34);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(79, 209, 197, .14), rgba(79, 209, 197, .02));
  box-shadow: inset 0 1px rgba(255, 255, 255, .08);
}

.brand__mark svg { width: 24px; height: 24px; }

.brand__text { display: grid; line-height: 1.16; }
.brand__text strong {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: .08em;
}
.brand__text small {
  margin-top: 3px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .2em;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.topnav__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  transition: .2s ease;
}

.topnav__item svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topnav__item:hover,
.topnav__item.is-active {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, .04);
}

.topnav__item.is-active { color: var(--teal); }

.topbar__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 4px 11px 4px 7px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, .035);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .03em;
  white-space: nowrap;
}

.meta-pill b { color: var(--text); font-weight: 700; }

.meta-pill__icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.meta-pill__icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.meta-pill__icon--amber { color: var(--amber); background: var(--amber-soft); }

.meta-pill--rank { color: var(--teal); }
.rank-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(79, 209, 197, .12);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  transition: .2s ease;
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .05);
}

/* ---------- app shell ---------- */
.app {
  position: relative;
  z-index: 1;
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: clamp(26px, 4vw, 54px) clamp(18px, 4vw, 48px) 90px;
}

.screen { animation: screenIn .45s cubic-bezier(.2, .7, .2, 1) both; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: .6;
}

.hero-title,
.page-title {
  margin: 16px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .015em;
  line-height: 1.06;
}

.hero-title {
  font-size: clamp(52px, 7.3vw, 104px);
}

.page-title {
  font-size: clamp(38px, 4.8vw, 64px);
}

.title-accent {
  position: relative;
  display: inline-block;
  color: var(--amber);
}
.title-accent::after {
  content: "";
  position: absolute;
  left: 1%;
  right: 1%;
  bottom: .08em;
  height: .13em;
  border-radius: 99px;
  background: currentColor;
  opacity: .17;
  transform: rotate(-1.2deg);
}

.lede {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.8;
}

.lede strong { color: var(--text); font-weight: 600; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 21px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  color: #061412;
  background: linear-gradient(135deg, #66e3d5, #34b9ad);
  box-shadow: 0 10px 28px rgba(79, 209, 197, .24), inset 0 1px rgba(255, 255, 255, .4);
}
.btn--primary:hover { box-shadow: 0 14px 34px rgba(79, 209, 197, .32), inset 0 1px rgba(255, 255, 255, .4); }

.btn--ghost {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .035);
}
.btn--ghost:hover { background: rgba(255, 255, 255, .065); }

.btn--amber {
  color: #201405;
  background: linear-gradient(135deg, #ffd28c, #e6a347);
  box-shadow: 0 10px 28px rgba(244, 184, 96, .2);
}

.btn--sm { min-height: 38px; padding: 8px 14px; border-radius: 10px; font-size: 13px; }
.btn--wide { width: 100%; }
.btn:disabled { cursor: not-allowed; opacity: .5; transform: none; box-shadow: none; }
.btn--primary:disabled {
  color: var(--muted-2);
  background: rgba(255, 255, 255, .06);
  border-color: var(--line);
}

/* =========================================================
   LANDING
   ========================================================= */
.landing {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, .94fr);
  align-items: center;
  gap: clamp(32px, 6vw, 90px);
  min-height: calc(100vh - 128px);
  padding-top: 10px;
}

.landing__copy { position: relative; z-index: 2; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  color: var(--amber);
  border: 1px solid rgba(244, 184, 96, .28);
  border-radius: 99px;
  background: rgba(244, 184, 96, .07);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .14em;
}

.hero-badge .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(244, 184, 96, .1);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(244, 184, 96, .09); }
  50% { box-shadow: 0 0 0 8px rgba(244, 184, 96, .02); }
}

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

.hero-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted-2);
  font-size: 12px;
}
.hero-note svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 44px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.hero-stat {
  min-width: 108px;
  padding-right: 26px;
  margin-right: 26px;
  border-right: 1px solid var(--line);
}
.hero-stat:last-child { border-right: 0; margin-right: 0; padding-right: 0; }

.hero-stat strong {
  display: block;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}
.hero-stat span { color: var(--muted-2); font-size: 11px; letter-spacing: .08em; }

/* hero dossier visual */
.hero-visual {
  position: relative;
  min-height: 510px;
  display: grid;
  place-items: center;
  perspective: 1200px;
}

.hero-visual::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(79, 209, 197, .14);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(79, 209, 197, .025), 0 0 0 78px rgba(79, 209, 197, .018);
}

.hero-case {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 26px 24px 22px;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .5), transparent 42%),
    var(--paper);
  border-radius: 7px;
  box-shadow: 0 34px 80px rgba(0, 0, 0, .42), 0 2px 0 rgba(255, 255, 255, .4) inset;
  transform: rotate(-2.2deg);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}

.hero-case:hover { transform: rotate(-.6deg) translateY(-5px); }

.hero-case::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(27, 36, 52, .15);
  border-radius: 3px;
  pointer-events: none;
}

.case-stamp {
  position: absolute;
  top: 17px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  color: rgba(158, 43, 43, .74);
  border: 2px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.35;
  text-align: center;
  transform: rotate(11deg);
  opacity: .82;
}
.case-stamp::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed currentColor;
  border-radius: 50%;
}

.hero-case__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 74px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .13em;
  color: var(--ink-soft);
}

.hero-case__title {
  margin: 22px 0 4px;
  font-family: var(--font-display);
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: .04em;
}

.hero-case__sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: .04em;
}

.mini-pedigree {
  position: relative;
  margin: 16px -4px 0;
  padding: 8px 0 3px;
  border-top: 1px solid rgba(27, 36, 52, .16);
  border-bottom: 1px solid rgba(27, 36, 52, .16);
}
.mini-pedigree svg { width: 100%; height: auto; }
.mini-pedigree .ped-label { font-size: 10px; }
.mini-pedigree .ped-gen { font-size: 12px; }

.hero-case__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 15px;
}
.hero-case__foot small {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .12em;
  line-height: 1.6;
}
.hero-case__qr {
  display: grid;
  grid-template-columns: repeat(5, 4px);
  grid-template-rows: repeat(5, 4px);
  gap: 2px;
  opacity: .72;
}
.hero-case__qr i { background: var(--ink); border-radius: .5px; }
.hero-case__qr i:nth-child(3n) { opacity: .18; }

.hero-float {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(16, 26, 43, .9);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: .04em;
}
.hero-float svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.hero-float--one { top: 7%; left: 0; color: var(--teal); transform: rotate(-4deg); }
.hero-float--two { bottom: 7%; right: 0; color: var(--amber); transform: rotate(3deg); }

/* four-step strip */
.method {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: clamp(38px, 6vw, 70px);
}

.method__item {
  position: relative;
  padding: 18px 18px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
  overflow: hidden;
}

.method__item::after {
  content: attr(data-step);
  position: absolute;
  right: 10px;
  bottom: -16px;
  color: rgba(255, 255, 255, .035);
  font-family: var(--font-mono);
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
}

.method__num {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin-bottom: 12px;
  color: var(--teal);
  border: 1px solid rgba(79, 209, 197, .3);
  border-radius: 8px;
  background: var(--teal-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}
.method__item:nth-child(2) .method__num { color: var(--amber); border-color: rgba(244, 184, 96, .3); background: var(--amber-soft); }
.method__item:nth-child(3) .method__num { color: var(--violet); border-color: rgba(183, 164, 255, .3); background: rgba(183, 164, 255, .1); }
.method__item:nth-child(4) .method__num { color: var(--green); border-color: rgba(110, 231, 168, .3); background: var(--green-soft); }

.method__item strong {
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: .04em;
}
.method__item p { margin: 0; color: var(--muted-2); font-size: 11px; line-height: 1.65; }

/* =========================================================
   MAP
   ========================================================= */
.map-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 34px;
}

.map-head__right {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 6px;
}

.ring-progress {
  --p: 0;
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: conic-gradient(var(--teal) calc(var(--p) * 1%), rgba(255, 255, 255, .09) 0);
}
.ring-progress::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--bg);
}
.ring-progress span {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}
.ring-progress small {
  position: absolute;
  z-index: 1;
  bottom: 16px;
  color: var(--muted-2);
  font-size: 8px;
}

.map-progress-copy { max-width: 160px; }
.map-progress-copy strong { display: block; font-size: 13px; }
.map-progress-copy p { margin: 4px 0 0; color: var(--muted-2); font-size: 11px; line-height: 1.5; }

.chapter { margin-top: 42px; }

.chapter__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.chapter__index {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--teal);
  border: 1px solid rgba(79, 209, 197, .26);
  border-radius: 12px;
  background: var(--teal-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
.chapter:nth-of-type(2) .chapter__index { color: var(--amber); border-color: rgba(244, 184, 96, .26); background: var(--amber-soft); }
.chapter:nth-of-type(3) .chapter__index { color: var(--coral); border-color: rgba(255, 125, 125, .26); background: var(--coral-soft); }

.chapter__title { flex: 1; }
.chapter__title h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: .06em;
}
.chapter__title p { margin: 2px 0 0; color: var(--muted-2); font-size: 11px; }

.chapter__rule { flex: 1; height: 1px; background: var(--line); }

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

.level-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 190px;
  padding: 18px 18px 15px;
  color: var(--text);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .012) 55%),
    var(--panel);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.level-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  opacity: 0;
  transition: .2s ease;
}

.level-card:not(.is-locked):hover {
  transform: translateY(-4px);
  border-color: rgba(79, 209, 197, .3);
  background:
    linear-gradient(150deg, rgba(79, 209, 197, .08), rgba(255, 255, 255, .015) 55%),
    var(--panel);
}
.level-card:not(.is-locked):hover::before { opacity: 1; }

.level-card.is-locked { cursor: not-allowed; opacity: .78; filter: saturate(.8); }
.level-card.is-current { border-color: rgba(244, 184, 96, .38); }
.level-card.is-current::after {
  content: "";
  position: absolute;
  top: 15px;
  right: 15px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(244, 184, 96, .1);
  animation: pulse 2.4s ease-in-out infinite;
}
.level-card.is-done { border-color: rgba(110, 231, 168, .22); }

.level-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
}
.level-card__no { color: var(--muted-2); }
.level-card__tag {
  padding: 2px 6px;
  color: var(--teal);
  border: 1px solid rgba(79, 209, 197, .2);
  border-radius: 5px;
  background: rgba(79, 209, 197, .07);
}
.level-card__tag--hard { color: var(--coral); border-color: rgba(255, 125, 125, .2); background: rgba(255, 125, 125, .07); }

.level-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: .04em;
  line-height: 1.3;
}
.level-card__sub {
  margin: 5px 0 0;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.5;
}
.level-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
}
.level-card__status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-2);
  font-size: 10px;
}
.level-card__status svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.level-card.is-done .level-card__status { color: var(--green); }
.level-card.is-current .level-card__status { color: var(--amber); }

.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 14px; height: 14px; fill: rgba(255, 255, 255, .12); stroke: rgba(255, 255, 255, .22); stroke-width: 1.4; }
.stars .is-on,
.stars .is-on svg { fill: var(--amber); stroke: var(--amber); filter: drop-shadow(0 0 5px rgba(244, 184, 96, .35)); }

.lock-badge {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  color: var(--muted-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
}
.lock-badge svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* =========================================================
   CASE SCREEN
   ========================================================= */
.case-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
}
.breadcrumb button {
  color: var(--muted);
  padding: 0;
  border: 0;
  background: none;
}
.breadcrumb button:hover { color: var(--teal); }
.breadcrumb svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.case-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.1;
  letter-spacing: .03em;
}
.case-head__sub { margin: 7px 0 0; color: var(--muted); font-size: 13px; }

.case-head__meta {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, .03);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
}
.meta-chip svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.meta-chip--level { color: var(--amber); border-color: rgba(244, 184, 96, .25); background: var(--amber-soft); }

.case-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(380px, .82fr);
  align-items: start;
  gap: 20px;
}

.dossier {
  position: relative;
  color: var(--ink);
  border-radius: 15px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, .35), transparent 36%),
    var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dossier::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(27, 36, 52, .055) .7px, transparent .7px);
  background-size: 5px 5px;
  opacity: .45;
}

.dossier__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(27, 36, 52, .14);
  background: rgba(255, 255, 255, .18);
}

.dossier__label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
}
.dossier__label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a43a3a;
  box-shadow: 0 0 0 4px rgba(164, 58, 58, .09);
}

.dossier__actions { display: flex; gap: 7px; }

.paper-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 9px;
  color: var(--ink-soft);
  border: 1px solid rgba(27, 36, 52, .18);
  border-radius: 7px;
  background: rgba(255, 255, 255, .26);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .03em;
  transition: .18s ease;
}
.paper-btn:hover { background: rgba(255, 255, 255, .55); color: var(--ink); }
.paper-btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.dossier__body { position: relative; padding: 22px 22px 20px; }

.case-brief {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  margin-bottom: 18px;
}
.case-brief__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #286c65;
  border: 1px solid rgba(40, 108, 101, .2);
  border-radius: 11px;
  background: rgba(40, 108, 101, .08);
}
.case-brief__icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.case-brief h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: .04em;
}
.case-brief p { margin: 4px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.8; }
.case-brief p strong { color: var(--ink); }

.figure {
  position: relative;
  padding: 10px 10px 0;
  border: 1px solid rgba(27, 36, 52, .15);
  border-radius: 10px;
  background: rgba(255, 255, 255, .24);
}

.figure__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px 7px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .12em;
}
.figure__head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.figure__note-inline {
  overflow: hidden;
  opacity: .65;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 58%;
}
.figure-note {
  margin: 8px 4px 2px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.65;
  opacity: .86;
}

.pedigree-host { width: 100%; }
.pedigree-host svg { width: 100%; height: auto; overflow: visible; }

.ped-person { transition: opacity .2s ease; }
.ped-link {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: square;
  stroke-linejoin: miter;
  vector-effect: non-scaling-stroke;
}
.ped-symbol {
  fill: #fbf7ee;
  stroke: var(--ink);
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}
.ped-symbol--affected { fill: var(--ink); }
.ped-symbol--unknown { fill: #fbf7ee; stroke-dasharray: 4 3; }
.ped-label {
  fill: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .02em;
  text-anchor: middle;
}
.ped-label--strong { fill: var(--ink); font-weight: 700; }
.ped-gen {
  fill: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  text-anchor: middle;
  opacity: .8;
}
.ped-question {
  fill: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  text-anchor: middle;
}
.ped-hit {
  fill: transparent;
  stroke: transparent;
  cursor: pointer;
}
.ped-person.is-selectable .ped-symbol { transition: .18s ease; }
.ped-person.is-selectable:hover .ped-symbol { stroke: var(--teal-2); stroke-width: 2.6; }
.ped-person.is-selected .ped-symbol {
  stroke: var(--teal-2);
  stroke-width: 3;
  filter: drop-shadow(0 0 5px rgba(44, 183, 171, .35));
}
.ped-person.is-selected .ped-label { fill: #1b6d65; font-weight: 700; }
.ped-person.is-target .ped-symbol {
  stroke: var(--amber-2);
  stroke-width: 3;
  filter: drop-shadow(0 0 6px rgba(227, 155, 61, .4));
}
.ped-person.is-dim { opacity: .32; }
.ped-genotype {
  fill: #1b6d65;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 11px 16px;
  padding: 11px 5px 3px;
  color: var(--ink-soft);
  font-size: 9px;
}
.legend__item { display: inline-flex; align-items: center; gap: 5px; }
.legend__swatch { width: 11px; height: 11px; border: 1.3px solid var(--ink); }
.legend__swatch--female { border-radius: 50%; }
.legend__swatch--male { border-radius: 1px; }
.legend__swatch--affected { background: var(--ink); }
.legend__swatch--unknown { transform: rotate(45deg) scale(.8); border-radius: 0; }

.figure-note {
  margin: 9px 4px 11px;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.6;
  opacity: .8;
}

/* gel */
.gel-card {
  position: relative;
  margin: 10px 0 0;
  padding: 13px 14px 12px;
  border: 1px solid rgba(27, 36, 52, .22);
  border-radius: 10px;
  background: #111b2a;
  overflow: hidden;
}
.gel-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(79, 209, 197, .06), transparent 38%);
  pointer-events: none;
}

.gel-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: #9eb2c9;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .12em;
}
.gel-head b { color: var(--teal); font-weight: 600; }

.gel {
  position: relative;
  display: grid;
  grid-template-columns: 48px repeat(var(--lanes, 7), minmax(0, 1fr));
  gap: 4px;
  min-height: 164px;
  padding: 4px 0 0;
}

.gel__scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 0 12px;
}
.gel__scale span {
  color: #8297b0;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1;
  white-space: nowrap;
}

.gel__lane {
  position: relative;
  border-left: 1px solid rgba(255, 255, 255, .07);
  border-right: 1px solid rgba(255, 255, 255, .03);
  background: linear-gradient(180deg, rgba(255, 255, 255, .018), rgba(255, 255, 255, .005));
  border-radius: 2px;
}
.gel__lane:first-of-type { border-left-color: rgba(255, 255, 255, .12); }
.gel__lane.is-blank {
  border: 1px dashed rgba(244, 184, 96, .34);
  background: rgba(244, 184, 96, .035);
}
.gel__lane.is-blank.is-complete { border-color: rgba(110, 231, 168, .45); background: rgba(110, 231, 168, .045); }

.gel__lane-label {
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  color: #c5d4e7;
  font-family: var(--font-mono);
  font-size: 9px;
  text-align: center;
  transform: translateY(-100%);
  padding-bottom: 4px;
  white-space: nowrap;
}

.gel__slot {
  position: absolute;
  left: 0;
  right: 0;
  height: 24px;
  transform: translateY(-50%);
  border: 0;
  padding: 0;
  background: transparent;
}
.gel__slot.is-clickable { cursor: pointer; }
.gel__slot.is-clickable:hover::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 50%;
  height: 1px;
  border-top: 1px dashed rgba(244, 184, 96, .7);
  transform: translateY(-50%);
}

.gel__band {
  position: absolute;
  left: 13%;
  right: 13%;
  top: 50%;
  height: 9px;
  border-radius: 2px;
  background: linear-gradient(90deg, #43c9bd, #7de6da 50%, #43c9bd);
  box-shadow: 0 0 10px rgba(79, 209, 197, .35), inset 0 1px rgba(255, 255, 255, .45);
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
}
.gel__band.is-on { opacity: 1; }
.gel__band.is-strong { height: 11px; }
.gel__band.is-selected {
  background: linear-gradient(90deg, #f0b45c, #ffe0a6 50%, #f0b45c);
  box-shadow: 0 0 13px rgba(244, 184, 96, .55), inset 0 1px rgba(255, 255, 255, .5);
}
.gel__band.is-answer {
  background: linear-gradient(90deg, #6ee7a8, #b8ffd7 50%, #6ee7a8);
  box-shadow: 0 0 14px rgba(110, 231, 168, .5), inset 0 1px rgba(255, 255, 255, .5);
}
.gel__band.is-wrong {
  background: linear-gradient(90deg, #ff7d7d, #ffb1b1 50%, #ff7d7d);
  box-shadow: 0 0 14px rgba(255, 125, 125, .45);
}
.gel__hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  color: rgba(244, 184, 96, .8);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .05em;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
}

.gel-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  color: #8da1b8;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .04em;
}
.gel-legend span { display: inline-flex; align-items: center; gap: 5px; }
.gel-legend i { width: 14px; height: 4px; border-radius: 1px; background: #43c9bd; box-shadow: 0 0 6px rgba(79, 209, 197, .4); }
.gel-legend i.amber { background: #f0b45c; box-shadow: 0 0 6px rgba(244, 184, 96, .4); }
.gel-legend i.green { background: #6ee7a8; box-shadow: 0 0 6px rgba(110, 231, 168, .4); }

/* terminal */
.terminal {
  position: sticky;
  top: 94px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, .045), transparent 42%),
    rgba(17, 28, 46, .9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.terminal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.step-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
}
.step-label b { color: var(--teal); font-weight: 700; }

.step-dots { display: flex; gap: 4px; }
.step-dots i {
  width: 17px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .11);
}
.step-dots i.is-done { background: var(--teal); }
.step-dots i.is-current { background: var(--amber); }

.prompt {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.48;
  letter-spacing: .02em;
}
.prompt em {
  color: var(--amber);
  font-style: normal;
  border-bottom: 1px dashed rgba(244, 184, 96, .5);
}

.prompt-sub { margin: 0 0 16px; color: var(--muted-2); font-size: 11px; line-height: 1.6; }

.options { display: grid; gap: 8px; }

.option {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 9px 12px;
  color: var(--text);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .025);
  transition: .18s ease;
}
.option:hover:not(.is-disabled) { border-color: rgba(79, 209, 197, .3); background: rgba(79, 209, 197, .05); }
.option.is-selected { border-color: rgba(79, 209, 197, .52); background: rgba(79, 209, 197, .09); box-shadow: inset 0 0 0 1px rgba(79, 209, 197, .12); }
.option.is-correct { border-color: rgba(110, 231, 168, .55); background: rgba(110, 231, 168, .09); }
.option.is-wrong { border-color: rgba(255, 125, 125, .5); background: rgba(255, 125, 125, .08); }
.option.is-disabled { cursor: default; opacity: .68; }

.option__key {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}
.option.is-selected .option__key { color: #061412; border-color: transparent; background: var(--teal); }
.option.is-correct .option__key { color: #061412; border-color: transparent; background: var(--green); }
.option.is-wrong .option__key { color: #1c0707; border-color: transparent; background: var(--coral); }

.option__text { font-size: 13px; line-height: 1.5; }
.option__text small { display: block; margin-top: 1px; color: var(--muted-2); font-size: 10px; line-height: 1.45; }

.option__mark {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: transparent;
}
.option__mark svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.option.is-selected .option__mark { color: var(--teal); border-color: rgba(79, 209, 197, .45); background: rgba(79, 209, 197, .1); }
.option.is-correct .option__mark { color: var(--green); border-color: rgba(110, 231, 168, .45); }
.option.is-wrong .option__mark { color: var(--coral); border-color: rgba(255, 125, 125, .45); }

.option--fraction { grid-template-columns: minmax(0, 1fr); text-align: center; min-height: 66px; }
.option--fraction .option__key { display: none; }
.option--fraction .option__text { font-family: var(--font-mono); font-size: 20px; font-weight: 600; }
.option--fraction .option__mark { position: absolute; top: 7px; right: 7px; }

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

/* hints */
.terminal__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  font-size: 10px;
  transition: .18s ease;
}
.tool-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, .04); }
.tool-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tool-btn__count { color: var(--amber); font-family: var(--font-mono); font-size: 9px; }

.hint-box {
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px dashed rgba(244, 184, 96, .3);
  border-radius: 10px;
  background: rgba(244, 184, 96, .05);
  animation: slideDown .25s ease both;
}
.hint-box__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
}
.hint-box p { margin: 0; color: #d9c8a9; font-size: 11px; line-height: 1.7; }
.hint-box p + p { margin-top: 7px; padding-top: 7px; border-top: 1px dashed rgba(244, 184, 96, .16); }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.submit-row { margin-top: 14px; }

.feedback {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  animation: slideDown .28s ease both;
}
.feedback--correct { border: 1px solid rgba(110, 231, 168, .28); background: rgba(110, 231, 168, .06); }
.feedback--wrong { border: 1px solid rgba(255, 125, 125, .26); background: rgba(255, 125, 125, .055); }

.feedback__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: .04em;
}
.feedback--correct .feedback__head { color: var(--green); }
.feedback--wrong .feedback__head { color: var(--coral); }
.feedback__head svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feedback p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.feedback p + p { margin-top: 6px; }
.feedback strong { color: var(--text); }
.feedback .formula {
  display: inline-block;
  margin: 4px 0;
  padding: 4px 8px;
  color: #c7f7f1;
  border: 1px solid rgba(79, 209, 197, .18);
  border-radius: 6px;
  background: rgba(79, 209, 197, .07);
  font-family: var(--font-mono);
  font-size: 10px;
}
.feedback__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* knowledge strip */
.note-card {
  margin-top: 12px;
  padding: 13px;
  border: 1px solid rgba(79, 209, 197, .18);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(79, 209, 197, .07), rgba(79, 209, 197, .015));
}
.note-card__head {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .12em;
}
.note-card__head svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.note-card h3 {
  margin: 6px 0 4px;
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: .04em;
}
.note-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.note-card button {
  margin-top: 7px;
  padding: 0;
  color: var(--teal);
  border: 0;
  background: none;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* =========================================================
   CODEX
   ========================================================= */
.codex-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.codex-head p { max-width: 520px; margin: 10px 0 0; color: var(--muted); font-size: 13px; }

.filter-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.filter-chip {
  padding: 7px 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  font-size: 10px;
  transition: .18s ease;
}
.filter-chip:hover { color: var(--text); border-color: var(--line-strong); }
.filter-chip.is-active { color: #061412; border-color: transparent; background: var(--teal); }

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

.codex-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 168px;
  padding: 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(150deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .012));
  transition: .18s ease;
  overflow: hidden;
}
.codex-card:not(.is-locked):hover { transform: translateY(-3px); border-color: rgba(79, 209, 197, .3); }
.codex-card.is-locked { cursor: not-allowed; }
.codex-card.is-locked > *:not(.codex-card__lock) { opacity: .68; }

.codex-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.codex-card__cat {
  padding: 2px 7px;
  color: var(--teal);
  border: 1px solid rgba(79, 209, 197, .18);
  border-radius: 5px;
  background: rgba(79, 209, 197, .06);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .07em;
}
.codex-card__no { color: var(--muted-2); font-family: var(--font-mono); font-size: 9px; }
.codex-card h3 { margin: 0 0 5px; font-family: var(--font-display); font-size: 18px; letter-spacing: .04em; }
.codex-card p { margin: 0; color: var(--muted-2); font-size: 10px; line-height: 1.65; }
.codex-card__lock {
  position: absolute;
  right: 10px;
  bottom: 10px;
  color: var(--muted);
  z-index: 2;
}
.codex-card__lock span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(10, 17, 29, .78);
  font-size: 8px;
}
.codex-card__lock svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* =========================================================
   MODAL / TOAST / CONFETTI
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 8, 15, .72);
  backdrop-filter: blur(9px);
  animation: fadeIn .2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  width: min(100%, 620px);
  max-height: min(86vh, 820px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, .055), transparent 36%),
    #111c2e;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
  animation: modalIn .28s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.modal--wide { width: min(100%, 900px); }

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .03);
}
.modal__close:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.modal__close svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.modal__eyebrow { color: var(--teal); font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; }
.modal h2 { margin: 8px 34px 8px 0; font-family: var(--font-display); font-size: 28px; letter-spacing: .04em; line-height: 1.25; }
.modal__body { color: var(--muted); font-size: 13px; line-height: 1.8; }
.modal__body p { margin: 0 0 10px; }
.modal__body strong { color: var(--text); }
.modal__body ul { margin: 8px 0 12px; padding-left: 18px; }
.modal__body li { margin: 4px 0; }
.modal__body .callout {
  margin: 12px 0;
  padding: 12px 13px;
  color: #d7e6f5;
  border-left: 2px solid var(--teal);
  border-radius: 0 8px 8px 0;
  background: rgba(79, 209, 197, .06);
  font-size: 12px;
}
.modal__body .callout--amber { border-color: var(--amber); background: rgba(244, 184, 96, .06); }
.modal__body .kbd {
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(255, 255, 255, .04);
  font-family: var(--font-mono);
  font-size: 10px;
}

.image-modal img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: var(--paper);
}
.image-modal p { margin: 10px 0 0; color: var(--muted-2); font-size: 10px; }

.zoom-pedigree {
  margin-top: 12px;
  padding: 12px;
  border-radius: 9px;
  background: var(--paper);
}
.zoom-pedigree svg { width: 100%; height: auto; }
.zoom-note { margin: 10px 0 0; color: var(--muted-2); font-size: 10px; line-height: 1.6; }

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 120;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 9px 15px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: rgba(16, 27, 45, .94);
  box-shadow: var(--shadow-sm);
  font-size: 11px;
  white-space: nowrap;
  animation: toastIn .25s ease both;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.confetti {
  position: fixed;
  inset: 0;
  z-index: 130;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* =========================================================
   REPORT
   ========================================================= */
.report-head { text-align: center; margin-bottom: 26px; }
.report-head .eyebrow { justify-content: center; }
.report-head .eyebrow::before { display: none; }
.report-head h1 { margin: 14px 0 8px; font-family: var(--font-display); font-size: clamp(40px, 6vw, 72px); letter-spacing: .04em; }
.report-head p { max-width: 560px; margin: 0 auto; color: var(--muted); font-size: 13px; }

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
  gap: 18px;
  align-items: start;
}

.certificate {
  position: relative;
  padding: 30px 30px 26px;
  color: var(--ink);
  border-radius: 7px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, .42), transparent 38%),
    var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.certificate::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(27, 36, 52, .24);
  border-radius: 3px;
  pointer-events: none;
}
.certificate::after {
  content: "GENOME DETECTIVE SOCIETY";
  position: absolute;
  left: 50%;
  bottom: 46%;
  color: rgba(27, 36, 52, .035);
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .12em;
  white-space: nowrap;
  transform: translateX(-50%) rotate(-13deg);
  pointer-events: none;
}

.cert-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cert-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.cert-brand svg { width: 24px; height: 24px; }
.cert-no { color: var(--ink-soft); font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; }

.cert-title {
  position: relative;
  margin: 32px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: .12em;
  text-align: center;
}
.cert-sub { position: relative; color: var(--ink-soft); font-family: var(--font-mono); font-size: 8px; letter-spacing: .18em; text-align: center; }
.cert-name {
  position: relative;
  margin: 28px 0 6px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 40px);
  text-align: center;
}
.cert-name::after {
  content: "";
  display: block;
  width: 180px;
  height: 1px;
  margin: 9px auto 0;
  background: rgba(27, 36, 52, .24);
}
.cert-copy { position: relative; max-width: 430px; margin: 13px auto 0; color: var(--ink-soft); font-size: 11px; line-height: 1.9; text-align: center; }
.cert-stats { position: relative; display: flex; justify-content: center; gap: 26px; margin-top: 24px; }
.cert-stat { text-align: center; }
.cert-stat strong { display: block; font-family: var(--font-mono); font-size: 19px; line-height: 1.2; }
.cert-stat span { color: var(--ink-soft); font-size: 8px; letter-spacing: .08em; }
.cert-seal {
  position: absolute;
  right: 28px;
  bottom: 24px;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  color: rgba(158, 43, 43, .78);
  border: 2px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1.3;
  text-align: center;
  transform: rotate(9deg);
}
.cert-seal::after { content: ""; position: absolute; inset: 5px; border: 1px dashed currentColor; border-radius: 50%; }

.report-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 28, 46, .82);
}
.report-panel h2 { margin: 0 0 3px; font-family: var(--font-display); font-size: 22px; letter-spacing: .04em; }
.report-panel__sub { margin: 0 0 18px; color: var(--muted-2); font-size: 10px; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 18px; }
.stat-box { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .025); }
.stat-box strong { display: block; font-family: var(--font-mono); font-size: 22px; line-height: 1.2; }
.stat-box span { color: var(--muted-2); font-size: 9px; letter-spacing: .06em; }
.stat-box:nth-child(1) strong { color: var(--teal); }
.stat-box:nth-child(2) strong { color: var(--amber); }
.stat-box:nth-child(3) strong { color: var(--green); }
.stat-box:nth-child(4) strong { color: var(--violet); }

.mastery-row { margin: 12px 0; }
.mastery-row__head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.mastery-row__head b { color: var(--text); font-family: var(--font-mono); font-size: 9px; font-weight: 500; }
.mastery-bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.mastery-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal-2), var(--teal)); }
.mastery-row:nth-of-type(2) .mastery-bar i { background: linear-gradient(90deg, var(--amber-2), var(--amber)); }
.mastery-row:nth-of-type(3) .mastery-bar i { background: linear-gradient(90deg, #8f7be0, var(--violet)); }
.mastery-row:nth-of-type(4) .mastery-bar i { background: linear-gradient(90deg, #3aa876, var(--green)); }

.report-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

.next-list { display: grid; gap: 7px; margin-top: 18px; }
.next-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}
.next-item svg { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 1px; fill: none; stroke: var(--teal); stroke-width: 1.8; }

/* ---------- mistakes ---------- */
.mistake-list { display: grid; gap: 9px; }
.mistake-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .022);
}
.mistake-item__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.mistake-item__case { color: var(--teal); font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; }
.mistake-item h3 { margin: 0 0 5px; font-family: var(--font-display); font-size: 15px; letter-spacing: .03em; }
.mistake-item p { margin: 0; color: var(--muted-2); font-size: 10px; line-height: 1.6; }
.mistake-item__answer { margin-top: 7px; color: var(--muted); font-size: 10px; }
.mistake-item__answer b { color: var(--green); }
.mistake-item__actions { margin-top: 9px; }

.empty-state { padding: 32px 18px; text-align: center; color: var(--muted-2); }
.empty-state svg { width: 42px; height: 42px; margin: 0 auto 12px; fill: none; stroke: currentColor; stroke-width: 1.2; opacity: .55; }
.empty-state h3 { margin: 0 0 4px; color: var(--text); font-family: var(--font-display); font-size: 18px; }
.empty-state p { margin: 0; font-size: 11px; }

.noscript {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
}

/* ---------- utility ---------- */
.is-hidden { display: none !important; }
.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;
}

/* ---------- small additions ---------- */
.diff-dots { display: inline-flex; gap: 3px; align-items: center; }
.diff-dots i { width: 9px; height: 3px; border-radius: 99px; background: rgba(255, 255, 255, .13); }
.diff-dots i.is-on { background: var(--amber); }

.multi-hint {
  margin: 8px 2px 0;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: .04em;
}

.options--multi .option__mark {
  color: transparent;
  border-style: dashed;
}
.options--multi .option.is-selected .option__mark { color: var(--teal); border-style: solid; }

.selection-summary {
  display: grid;
  gap: 3px;
  margin: 11px 0 2px;
  padding: 12px;
  border: 1px dashed rgba(79, 209, 197, .25);
  border-radius: 10px;
  background: rgba(79, 209, 197, .035);
}
.selection-summary__label {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .1em;
}
.selection-summary strong { color: var(--text); font-size: 12px; font-weight: 500; }

.focus-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 11px;
  padding: 9px 11px;
  color: var(--ink-soft);
  border-left: 2px solid #2c8f86;
  border-radius: 0 7px 7px 0;
  background: rgba(44, 143, 134, .07);
  font-size: 10px;
  line-height: 1.6;
}
.focus-line svg { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 1px; fill: none; stroke: #2c8f86; stroke-width: 1.8; }

.codex-progress { flex: 0 0 auto; text-align: right; padding-bottom: 6px; }
.codex-progress strong { display: block; color: var(--teal); font-family: var(--font-mono); font-size: 28px; line-height: 1.1; }
.codex-progress strong span { color: var(--muted-2); font-size: 14px; font-weight: 400; }
.codex-progress small { color: var(--muted-2); font-size: 9px; letter-spacing: .08em; }

.gel-labels {
  display: grid;
  grid-template-columns: 48px repeat(var(--lanes, 7), minmax(0, 1fr));
  gap: 4px;
  padding: 0 0 5px;
  color: #c5d4e7;
  font-family: var(--font-mono);
  font-size: 9px;
  text-align: center;
}
.gel-labels span:first-child { visibility: hidden; }

.gel__scale { position: relative; min-height: 150px; padding: 0; }
.gel__scale span {
  position: absolute;
  left: 0;
  color: #8297b0;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1;
  white-space: nowrap;
  transform: translateY(-50%);
  transition: color .18s ease;
}
.gel__scale span.is-active { color: var(--amber); }

.gel { min-height: 150px; padding: 0; }

.complete-card {
  position: relative;
  max-width: 780px;
  margin: 16px auto 0;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, .055), transparent 42%),
    rgba(17, 28, 46, .9);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.complete-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 18% 0%, rgba(79, 209, 197, .08), transparent 46%);
  pointer-events: none;
}
.complete-stamp {
  position: absolute;
  top: 24px;
  right: 25px;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  color: rgba(244, 184, 96, .75);
  border: 2px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1.35;
  text-align: center;
  transform: rotate(10deg);
}
.complete-stamp::after { content: ""; position: absolute; inset: 4px; border: 1px dashed currentColor; border-radius: 50%; }
.complete-card h1 {
  position: relative;
  max-width: 560px;
  margin: 15px 0 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.1;
  letter-spacing: .03em;
}
.complete-sub { position: relative; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.complete-stars { position: relative; display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.complete-stars .stars svg { width: 24px; height: 24px; }
.complete-stars > span { color: var(--amber); font-size: 11px; letter-spacing: .08em; }
.complete-stats { position: relative; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.complete-stats div { min-width: 92px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .025); }
.complete-stats strong { display: block; color: var(--teal); font-family: var(--font-mono); font-size: 20px; line-height: 1.2; }
.complete-stats span { color: var(--muted-2); font-size: 9px; }
.complete-review, .complete-cards { position: relative; margin-top: 26px; padding-top: 19px; border-top: 1px solid var(--line); }
.complete-review h3, .complete-cards h3 { margin: 0 0 11px; font-family: var(--font-display); font-size: 16px; letter-spacing: .05em; }
.complete-review ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.complete-review li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 9px; align-items: start; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.complete-review li:last-child { border-bottom: 0; }
.complete-review li span { color: var(--muted-2); font-family: var(--font-mono); font-size: 8px; padding-top: 2px; }
.complete-review li p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.complete-review li b { color: var(--green); font-size: 10px; font-weight: 500; }
.mini-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.mini-card {
  display: block;
  padding: 11px;
  text-align: left;
  color: var(--text);
  border: 1px solid rgba(79, 209, 197, .18);
  border-radius: 9px;
  background: rgba(79, 209, 197, .04);
  transition: .18s ease;
}
.mini-card:hover { border-color: rgba(79, 209, 197, .4); background: rgba(79, 209, 197, .08); }
.mini-card span { color: var(--teal); font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; }
.mini-card strong { display: block; margin: 3px 0 2px; font-family: var(--font-display); font-size: 14px; }
.mini-card small { display: block; color: var(--muted-2); font-size: 9px; line-height: 1.5; }
.complete-actions { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }

.name-row { display: flex; gap: 7px; margin: 0 0 14px; }
.name-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(255, 255, 255, .035);
  font-size: 12px;
}
.name-input:focus { border-color: var(--teal); outline: none; }
.panel-subtitle { margin: 21px 0 5px; font-family: var(--font-display); font-size: 16px; letter-spacing: .04em; }

.modal__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

@media (max-width: 640px) {
  .complete-stamp { width: 58px; height: 58px; top: 15px; right: 14px; font-size: 6px; }
  .complete-card { padding: 22px 17px; }
  .complete-review li { grid-template-columns: 20px minmax(0, 1fr); }
  .complete-review li b { grid-column: 2; }
  .gel-labels { grid-template-columns: 37px repeat(var(--lanes, 7), minmax(0, 1fr)); gap: 2px; font-size: 7px; }
  .gel__scale span { font-size: 7px; }
  .codex-progress { text-align: left; margin-top: 14px; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1120px) {
  .landing { grid-template-columns: 1fr .85fr; gap: 36px; }
  .hero-visual { min-height: 440px; }
  .hero-case { width: 360px; }
  .level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .codex-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-grid { grid-template-columns: minmax(0, 1fr) minmax(340px, .85fr); }
}

@media (max-width: 920px) {
  .topnav__item span { display: none; }
  .topnav__item { padding: 9px; }
  .brand__text small { display: none; }
  .meta-pill--rank { display: none; }
  .hero-float { display: none; }
  .landing { grid-template-columns: 1fr; min-height: auto; padding-top: 20px; }
  .landing__copy { max-width: 700px; }
  .hero-visual { min-height: 400px; margin-top: 14px; }
  .hero-case { width: min(100%, 390px); }
  .hero-float--one { left: 4%; }
  .hero-float--two { right: 4%; }
  .method { grid-template-columns: repeat(2, 1fr); }
  .case-grid { grid-template-columns: 1fr; }
  .terminal { position: relative; top: auto; }
  .map-head { align-items: flex-start; }
  .report-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { gap: 10px; min-height: 64px; padding: 8px 12px; }
  .brand__mark { width: 36px; height: 36px; }
  .brand__text strong { font-size: 15px; }
  .brand__text small { display: none; }
  .topnav { margin-left: auto; gap: 0; }
  .topnav__item { padding: 8px; }
  .topnav__item svg { width: 18px; height: 18px; }
  .topbar__meta { margin-left: 0; }
  .meta-pill { padding: 3px 8px 3px 4px; font-size: 9px; }
  .meta-pill__icon { width: 19px; height: 19px; }
  .icon-btn { width: 32px; height: 32px; }
  .app { padding: 22px 14px 64px; }
  .hero-title { font-size: clamp(46px, 14vw, 72px); }
  .lede { font-size: 15px; }
  .hero-stats { margin-top: 30px; gap: 16px 0; }
  .hero-stat { min-width: 0; flex: 1 1 30%; padding-right: 12px; margin-right: 12px; }
  .hero-stat strong { font-size: 19px; }
  .hero-visual { min-height: 360px; }
  .hero-case { padding: 20px 17px 17px; }
  .hero-case__title { font-size: 22px; }
  .case-stamp { width: 58px; height: 58px; font-size: 7px; top: 14px; right: 13px; }
  .hero-case__top { padding-right: 56px; font-size: 8px; }
  .hero-float { font-size: 9px; padding: 7px 9px; }
  .hero-float--one { top: 2%; left: 0; }
  .hero-float--two { bottom: 2%; right: 0; }
  .method { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 34px; }
  .method__item { padding: 14px; }
  .method__item strong { font-size: 14px; }
  .method__item p { font-size: 10px; }
  .map-head { display: block; }
  .map-head__right { margin-top: 18px; justify-content: flex-start; }
  .ring-progress { width: 62px; height: 62px; }
  .ring-progress small { bottom: 12px; }
  .level-grid { grid-template-columns: 1fr; }
  .level-card { min-height: 164px; }
  .chapter__title h2 { font-size: 19px; }
  .chapter__rule { display: none; }
  .case-head { display: block; }
  .case-head__meta { justify-content: flex-start; margin-top: 14px; padding-bottom: 0; }
  .dossier__head { padding: 13px 15px; }
  .dossier__body { padding: 16px 15px 16px; }
  .case-brief { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
  .case-brief__icon { width: 34px; height: 34px; }
  .case-brief__icon svg { width: 17px; height: 17px; }
  .case-brief h2 { font-size: 16px; }
  .case-brief p { font-size: 11px; }
  .figure { padding: 6px 6px 0; }
  .figure__head { font-size: 7px; gap: 6px; align-items: flex-start; }
  .figure__head-actions { gap: 4px; }
  .figure__note-inline { display: none; }
  .figure-note { margin: 8px 4px 3px; font-size: 10px; line-height: 1.65; }
  .figure__head .paper-btn { min-height: 24px; padding: 3px 7px; font-size: 8px; }
  .gel-card { padding: 10px 8px 9px; }
  .gel { grid-template-columns: 37px repeat(var(--lanes, 7), minmax(0, 1fr)); gap: 2px; }
  .gel__scale span { font-size: 7px; }
  .gel__lane-label { font-size: 7px; }
  .gel__slot { height: 30px; }
  .gel__band { height: 10px; }
  .terminal { padding: 15px; border-radius: 16px; }
  .prompt { font-size: 19px; }
  .option { grid-template-columns: 27px minmax(0, 1fr) 18px; min-height: 50px; padding: 8px 10px; gap: 8px; }
  .option__key { width: 25px; height: 25px; }
  .option__text { font-size: 12px; }
  .fraction-grid { grid-template-columns: repeat(2, 1fr); }
  .codex-grid { grid-template-columns: 1fr; }
  .codex-head { display: block; }
  .codex-head .btn { margin-top: 16px; }
  .modal { padding: 20px 17px; }
  .modal h2 { font-size: 24px; }
  .report-head h1 { font-size: 42px; }
  .certificate { padding: 22px 18px 20px; }
  .cert-title { margin-top: 24px; font-size: 29px; }
  .cert-name { margin-top: 20px; font-size: 25px; }
  .cert-copy { font-size: 10px; }
  .cert-seal { width: 64px; height: 64px; right: 16px; bottom: 16px; font-size: 6px; }
  .cert-stats { gap: 16px; justify-content: flex-start; }
  .report-panel { padding: 16px; }
  .stat-grid { gap: 6px; }
  .stat-box strong { font-size: 19px; }
  .toast { white-space: normal; max-width: 85vw; text-align: center; }
}

@media (max-width: 380px) {
  .hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); }
  .hero-stat { border-right: 0; margin-right: 0; padding-right: 0; }
  .method { grid-template-columns: 1fr; }
  .topnav__item { padding: 7px; }
}

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

@media print {
  body { background: #fff; color: #111; }
  .topbar, .ambient, .report-panel, .report-head, .report-actions, .toast-root, .confetti { display: none !important; }
  .app { max-width: 100%; padding: 0; }
  .report-grid { display: block; }
  .certificate { box-shadow: none; border: 1px solid #333; }
}
