:root {
  --paper: #f1ebe1;
  --paper-deep: #e9e1d4;
  --surface: #fbf8f2;
  --surface-strong: #fffdf8;
  --ink: #1d2b31;
  --ink-soft: #30434b;
  --muted: #7b7b73;
  --muted-strong: #62665f;
  --line: #ded4c4;
  --line-soft: #e9e1d5;
  --accent: #dd5a3f;
  --accent-deep: #b84029;
  --accent-soft: #f6ded6;
  --navy: #263e4b;
  --teal: #3f8074;
  --gold: #d8a73b;
  --shadow: 0 18px 50px rgba(57, 43, 24, .09);
  --shadow-soft: 0 7px 22px rgba(57, 43, 24, .06);
  --radius: 24px;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", serif;
  --font-num: "Avenir Next", "Helvetica Neue", "PingFang SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at 8% 6%, rgba(221, 90, 63, .075), transparent 28%),
    radial-gradient(circle at 92% 15%, rgba(63, 128, 116, .075), transparent 27%),
    linear-gradient(135deg, #f4efe6 0%, #efe8dc 54%, #f5f0e7 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.app {
  min-height: 100vh;
}

/* ---------- Top bar ---------- */

.topbar {
  position: relative;
  z-index: 5;
  height: 82px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(94, 76, 50, .13);
  background: rgba(248, 243, 235, .76);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid rgba(221, 90, 63, .24);
  border-radius: 13px;
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, .9), transparent 40%),
    var(--accent-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 5px 16px rgba(184, 64, 41, .1);
}

.brand-mark svg {
  width: 29px;
  height: 29px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.05;
}

.brand-eyebrow {
  font-family: var(--font-num);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--accent);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: .06em;
}

.topbar-side {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lesson-tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  color: var(--muted-strong);
  font-size: 12px;
  letter-spacing: .04em;
  border: 1px solid rgba(94, 76, 50, .13);
  border-radius: 999px;
  background: rgba(255, 253, 248, .5);
}

.lesson-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(63, 128, 116, .11);
}

.ghost-btn {
  height: 39px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid rgba(94, 76, 50, .18);
  border-radius: 11px;
  background: rgba(255, 253, 248, .56);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.ghost-btn svg {
  width: 16px;
  height: 16px;
}

.ghost-btn:hover {
  border-color: rgba(221, 90, 63, .45);
  background: #fffdf8;
}

.ghost-btn:active {
  transform: translateY(1px);
}

body.focus-mode .ghost-btn {
  color: var(--accent-deep);
  border-color: rgba(221, 90, 63, .4);
  background: var(--accent-soft);
}

/* ---------- Main layout ---------- */

.layout {
  height: calc(100vh - 82px);
  padding: 20px 28px 24px;
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  gap: 22px;
  max-width: 1880px;
  margin: 0 auto;
}

.sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.sidebar-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 4px 4px 0;
}

.section-eyebrow {
  display: block;
  margin-bottom: 2px;
  font-family: var(--font-num);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--muted);
}

.sidebar-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 21px;
  letter-spacing: .04em;
}

.count-pill {
  margin-bottom: 3px;
  padding: 4px 9px;
  color: var(--accent-deep);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .05em;
  border: 1px solid rgba(221, 90, 63, .23);
  border-radius: 999px;
  background: rgba(246, 222, 214, .55);
}

.net-groups {
  min-height: 0;
  overflow-y: auto;
  padding: 2px 5px 8px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(94, 76, 50, .22) transparent;
}

.net-groups::-webkit-scrollbar {
  width: 5px;
}

.net-groups::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(94, 76, 50, .2);
}

.net-group {
  margin-bottom: 9px;
}

.group-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 1px 6px;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
}

.group-heading .rule {
  flex: 1;
  height: 1px;
  background: rgba(94, 76, 50, .12);
}

.group-heading em {
  color: var(--muted);
  font-style: normal;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .02em;
}

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

.net-card {
  position: relative;
  min-width: 0;
  height: 74px;
  padding: 6px 8px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(94, 76, 50, .13);
  border-radius: 13px;
  background: rgba(255, 253, 248, .56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .58);
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color .22s ease,
    background .22s ease,
    transform .22s ease,
    box-shadow .22s ease;
}

.net-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .28s ease;
}

.net-card:hover {
  transform: translateY(-1px);
  border-color: rgba(221, 90, 63, .34);
  background: rgba(255, 253, 248, .9);
  box-shadow: var(--shadow-soft);
}

.net-card.is-active {
  border-color: var(--accent);
  background: var(--surface-strong);
  box-shadow:
    0 0 0 2px rgba(221, 90, 63, .11),
    0 8px 22px rgba(184, 64, 41, .09);
}

.net-card.is-active::after {
  transform: scaleX(1);
}

.card-number {
  position: absolute;
  top: 5px;
  left: 7px;
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .05em;
}

.net-card.is-active .card-number {
  color: var(--accent-deep);
}

.card-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: scale(.35);
  transition: opacity .2s ease, transform .2s ease;
}

.net-card.is-active .card-check {
  opacity: 1;
  transform: scale(1);
}

.mini-net {
  display: grid;
  gap: 2px;
  margin: 6px auto 0;
}

.mini-cell {
  width: 12px;
  height: 12px;
  border-radius: 2.5px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .34),
    0 1px 1px rgba(47, 34, 16, .12);
}

.mini-cell.blank {
  box-shadow: none;
  background: transparent;
}

.sidebar-note {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px dashed rgba(94, 76, 50, .2);
  border-radius: 13px;
  background: rgba(255, 253, 248, .38);
}

.note-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 15px;
  border-radius: 50%;
  background: var(--accent-soft);
}

.sidebar-note p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 10.5px;
  line-height: 1.65;
}

.sidebar-note strong {
  color: var(--ink-soft);
  font-weight: 600;
}

/* ---------- Workspace ---------- */

.workspace {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.stage-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(94, 76, 50, .14);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: cardIn .7s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.stage-head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 23px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.stage-title {
  min-width: 0;
}

.stage-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--accent-deep);
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.kicker-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(184, 64, 41, .42);
}

.stage-head h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(19px, 1.7vw, 25px);
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.face-legend {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 5px 10px;
  padding-top: 2px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted-strong);
  font-size: 10px;
  white-space: nowrap;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}

.viewport {
  position: relative;
  flex: 1;
  min-height: 330px;
  margin: 13px 13px 0;
  border: 1px solid rgba(94, 76, 50, .1);
  border-radius: 17px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 253, 248, .96) 0%, rgba(248, 242, 232, .82) 44%, rgba(233, 223, 207, .72) 100%),
    #f4ecdf;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .8),
    inset 0 -30px 70px rgba(101, 76, 42, .035);
}

.viewport::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(94, 76, 50, .13) .7px, transparent .7px);
  background-size: 20px 20px;
  opacity: .26;
  mask-image: radial-gradient(circle at 50% 48%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 48%, #000 20%, transparent 75%);
}

.viewport::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .16), transparent 22%, transparent 78%, rgba(94, 76, 50, .035));
}

.viewport.is-dragging {
  cursor: grabbing;
}

.viewport canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

.viewer-glow {
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(72%, 740px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .72), transparent 64%);
  pointer-events: none;
}

.stage-status {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 30px);
  padding: 8px 12px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  border: 1px solid rgba(94, 76, 50, .12);
  border-radius: 999px;
  background: rgba(255, 253, 248, .72);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  box-shadow: 0 4px 14px rgba(57, 43, 24, .055);
  pointer-events: none;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.status-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}

.stage-status.is-cutting {
  color: var(--accent-deep);
  border-color: rgba(221, 90, 63, .3);
  background: rgba(255, 246, 242, .9);
}

.stage-status.is-cutting .status-dot {
  background: var(--accent);
  animation: dotPulse .8s ease-in-out infinite;
}

.stage-status.is-working .status-dot {
  background: var(--gold);
  animation: dotPulse 1.2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(221, 90, 63, .3); }
  50% { box-shadow: 0 0 0 5px rgba(221, 90, 63, 0); }
}

.cut-badge {
  position: absolute;
  z-index: 2;
  left: 15px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  color: var(--muted-strong);
  font-size: 10px;
  border: 1px solid rgba(94, 76, 50, .11);
  border-radius: 9px;
  background: rgba(255, 253, 248, .64);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  transition: opacity .25s ease;
}

.cut-badge > span:first-child {
  color: var(--accent);
  font-size: 12px;
}

.cut-badge b {
  color: var(--ink-soft);
  font-weight: 600;
}

.cut-badge i {
  width: 1px;
  height: 10px;
  margin: 0 2px;
  background: rgba(94, 76, 50, .2);
}

.cut-badge.is-hidden,
.orbit-hint.is-hidden {
  opacity: 0;
}

.orbit-hint {
  position: absolute;
  z-index: 2;
  right: 15px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(48, 67, 75, .6);
  font-size: 9.5px;
  letter-spacing: .02em;
  pointer-events: none;
  transition: opacity .25s ease;
}

.orbit-hint svg {
  width: 14px;
  height: 14px;
}

.process-cue {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.94);
  padding: 11px 18px;
  display: none;
  align-items: center;
  gap: 8px;
  color: #fff7f0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  border-radius: 999px;
  background: rgba(29, 43, 49, .86);
  box-shadow: 0 12px 36px rgba(29, 43, 49, .23);
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.process-cue.is-visible {
  display: inline-flex;
  animation: cueIn .3s ease forwards;
}

@keyframes cueIn {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(.92);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ---------- Controls ---------- */

.controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 13px 19px 15px;
}

.primary-btn {
  position: relative;
  flex-shrink: 0;
  height: 46px;
  min-width: 147px;
  padding: 0 18px 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #fffaf3;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .03em;
  border: 0;
  border-radius: 13px;
  background: var(--navy);
  box-shadow: 0 8px 18px rgba(38, 62, 75, .18);
  cursor: pointer;
  overflow: hidden;
  transition: background .2s ease, transform .18s ease, box-shadow .2s ease;
}

.primary-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .12) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform .5s ease;
}

.primary-btn:hover {
  background: var(--accent-deep);
  box-shadow: 0 9px 22px rgba(184, 64, 41, .2);
}

.primary-btn:hover::after {
  transform: translateX(130%);
}

.primary-btn:active {
  transform: translateY(1px);
}

.play-icon {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
}

.play-icon svg {
  grid-area: 1 / 1;
  width: 19px;
  height: 19px;
  transition: opacity .18s ease, transform .18s ease;
}

.play-icon .icon-fold,
.play-icon .icon-pause {
  opacity: 0;
  transform: scale(.7) rotate(-8deg);
}

.primary-btn.is-fold .icon-play,
.primary-btn.is-pause .icon-play {
  opacity: 0;
  transform: scale(.7);
}

.primary-btn.is-fold .icon-fold,
.primary-btn.is-pause .icon-pause {
  opacity: 1;
  transform: none;
}

.progress-wrap {
  flex: 1;
  min-width: 120px;
}

.progress-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 5px;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: .04em;
}

.progress-labels span:nth-child(2) {
  color: var(--accent-deep);
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 700;
}

.progress {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.progress::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--fill, 0%), rgba(94, 76, 50, .14) var(--fill, 0%), rgba(94, 76, 50, .14) 100%);
}

.progress::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(94, 76, 50, .14);
}

.progress::-moz-range-progress {
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
}

.progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 17px;
  height: 17px;
  margin-top: -6px;
  border: 3px solid #fffdf8;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 6px rgba(85, 48, 30, .28);
  transition: transform .15s ease;
}

.progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 3px solid #fffdf8;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 6px rgba(85, 48, 30, .28);
}

.progress:hover::-webkit-slider-thumb {
  transform: scale(1.1);
}

.control-toggles {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.chip-toggle {
  height: 35px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 10.5px;
  font-weight: 500;
  border: 1px solid rgba(94, 76, 50, .16);
  border-radius: 9px;
  background: rgba(255, 253, 248, .52);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.chip-toggle:hover {
  border-color: rgba(94, 76, 50, .3);
  background: rgba(255, 253, 248, .92);
}

.chip-toggle.is-on {
  color: var(--ink-soft);
  border-color: rgba(38, 62, 75, .28);
  background: rgba(38, 62, 75, .07);
}

.chip-toggle:not(.is-on) {
  opacity: .55;
}

.toggle-swatch {
  width: 11px;
  height: 11px;
  display: grid;
  place-items: center;
  border-radius: 3px;
}

.toggle-swatch.cut {
  background: transparent;
  border-top: 2px dashed var(--accent);
  border-radius: 0;
}

.toggle-swatch.label {
  color: #fff;
  font-family: var(--font-serif);
  font-size: 8px;
  line-height: 1;
  background: var(--navy);
}

.icon-btn {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  color: var(--muted-strong);
  border: 1px solid rgba(94, 76, 50, .16);
  border-radius: 9px;
  background: rgba(255, 253, 248, .52);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  color: var(--accent-deep);
  border-color: rgba(221, 90, 63, .33);
  background: rgba(255, 253, 248, .95);
}

/* ---------- Fact strip ---------- */

.fact-strip {
  flex-shrink: 0;
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 19px;
  padding: 9px 20px;
  border: 1px solid rgba(94, 76, 50, .13);
  border-radius: 17px;
  background: rgba(255, 253, 248, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
  animation: cardIn .7s .08s cubic-bezier(.2, .7, .2, 1) both;
}

.fact-stats {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.fact {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.fact b {
  color: var(--ink);
  font-family: var(--font-num);
  font-size: 21px;
  font-weight: 600;
  line-height: 1;
}

.fact span {
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
}

.fact.accent b {
  color: var(--accent-deep);
}

.fact-divider {
  flex-shrink: 0;
  width: 1px;
  height: 29px;
  background: rgba(94, 76, 50, .13);
}

.fact-copy {
  flex: 1;
  margin: 0;
  color: var(--muted-strong);
  font-size: 10.5px;
  line-height: 1.6;
}

.fact-copy strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.shape-badge {
  flex-shrink: 0;
  min-width: 56px;
  padding: 6px 9px;
  color: var(--accent-deep);
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  letter-spacing: .08em;
  border: 1px dashed rgba(221, 90, 63, .35);
  border-radius: 8px;
  background: rgba(246, 222, 214, .36);
}

/* ---------- Focus / presentation mode ---------- */

body.focus-mode .layout {
  grid-template-columns: minmax(0, 1fr);
  max-width: none;
}

body.focus-mode .sidebar {
  display: none;
}

body.focus-mode .stage-head {
  padding-top: 20px;
  padding-bottom: 17px;
}

body.focus-mode .stage-head h1 {
  font-size: clamp(22px, 2.1vw, 30px);
}

body.focus-mode .viewport {
  min-height: 420px;
}

/* ---------- Responsive ---------- */

@media (max-height: 840px) and (min-width: 901px) {
  .sidebar-note {
    display: none;
  }

  .net-card {
    height: 70px;
  }

  .net-group {
    margin-bottom: 8px;
  }
}

@media (max-height: 760px) and (min-width: 901px) {
  .net-card {
    height: 64px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .mini-net {
    margin-top: 4px;
  }

  .group-heading {
    margin-bottom: 4px;
  }

  .net-group {
    margin-bottom: 6px;
  }
}

@media (max-width: 1240px) {
  .layout {
    grid-template-columns: 286px minmax(0, 1fr);
    padding-left: 20px;
    padding-right: 20px;
    gap: 18px;
  }

  .face-legend {
    grid-template-columns: repeat(2, auto);
  }

  .controls {
    gap: 12px;
  }

  .primary-btn {
    min-width: 132px;
    padding-left: 12px;
    padding-right: 14px;
  }

  .chip-toggle {
    padding: 0 8px;
  }
}

@media (max-width: 1050px) {
  .lesson-tag {
    display: none;
  }

  .face-legend {
    display: none;
  }

  .fact-copy {
    font-size: 9.5px;
  }

  .fact-stats {
    gap: 11px;
  }

  .chip-toggle {
    font-size: 9.5px;
  }
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .topbar {
    height: 72px;
    padding: 0 18px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-title {
    font-size: 20px;
  }

  .layout {
    width: 100%;
    height: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
  }

  .workspace {
    width: 100%;
    min-width: 0;
    min-height: 690px;
  }

  .stage-card {
    width: 100%;
    min-width: 0;
    min-height: 610px;
  }

  .fact-strip {
    width: 100%;
    min-width: 0;
  }

  .sidebar {
    order: 2;
  }

  .net-groups {
    overflow: visible;
  }

  .net-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sidebar-note {
    display: none;
  }

  .net-card {
    height: 84px;
  }

  .fact-copy {
    font-size: 10px;
  }
}

@media (max-width: 720px) {
  .brand-eyebrow {
    display: none;
  }

  .brand-title {
    font-size: 18px;
  }

  .ghost-btn span {
    display: none;
  }

  .ghost-btn {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

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

  .stage-head {
    padding: 14px 15px 12px;
  }

  .stage-head h1 {
    white-space: normal;
    font-size: 19px;
  }

  .viewport {
    min-height: 340px;
    margin: 10px 10px 0;
  }

  .controls {
    flex-wrap: wrap;
    padding: 12px 14px;
    gap: 11px;
  }

  .primary-btn {
    order: 1;
  }

  .control-toggles {
    order: 2;
    margin-left: auto;
  }

  .progress-wrap {
    order: 3;
    flex-basis: 100%;
  }

  .fact-strip {
    gap: 12px;
    padding: 10px 14px;
  }

  .fact-divider,
  .fact-copy {
    display: none;
  }

  .shape-badge {
    margin-left: auto;
  }

  .orbit-hint {
    display: none;
  }
}

@media (max-width: 480px) {
  .layout {
    padding: 9px;
  }

  .workspace {
    min-height: 640px;
  }

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

  .stage-card {
    border-radius: 18px;
  }

  .stage-kicker {
    font-size: 9px;
  }

  .stage-head h1 {
    font-size: 17px;
  }

  .primary-btn {
    min-width: 126px;
    height: 42px;
    padding-left: 11px;
    padding-right: 13px;
    font-size: 12px;
  }

  .chip-toggle {
    height: 32px;
    padding: 0 7px;
    font-size: 9px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }

  .control-toggles {
    gap: 5px;
  }

  .cut-badge {
    display: none;
  }
}

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