:root {
  --ink: #172033;
  --muted: #5f6b7a;
  --paper: #fffef9;
  --paper-edge: #d8d8d1;
  --line-blue: rgba(59, 130, 246, 0.13);
  --margin-red: rgba(180, 39, 29, 0.14);
  --red: #b4271d;
  --blue: #2563eb;
  --green: #15803d;
  --gold: #b45309;
  --slate-1: #f8fafc;
  --slate-2: #eef2f7;
  --slate-3: #dbe3ee;
  --slate-4: #cbd5e1;
  --slate-6: #64748b;
  --slate-7: #475569;
  --slate-8: #334155;
  --red-wash: #fff7ed;
  --red-line: #fdba74;
  --blue-wash: #eff6ff;
  --blue-line: #93c5fd;
  --green-wash: #ecfdf5;
  --green-line: #86efac;
  --shadow: 0 22px 42px rgba(15, 23, 42, 0.13);
  --soft-shadow: 0 5px 10px rgba(15, 23, 42, 0.07);
  --course-index-width: 0px;
  --course-index-expanded-width: 380px;
  --course-index-collapsed-width: 56px;
  --learn-shell-visible-header: 80px;
  --learn-page-index-left: 16px;
  --vsas-rail-width: 92px;
  --vsas-rail-gap: 26px;
}

* { box-sizing: border-box; }
html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}
body {
  min-height: 100vh;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #eceff3;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p, ul { margin: 0; }

.app-shell {
  width: min(1580px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 22px 18px 46px;
  transition: width .26s cubic-bezier(.2,.8,.2,1);
}

body.course-index-open {
  --course-index-width: 0px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 12px;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(8px);
}
.brand-title {
  font-family: "Amatic SC", cursive;
  font-size: 3rem;
  line-height: .9;
  color: var(--red);
}
.brand-sub {
  margin-top: 3px;
  font-size: .82rem;
  color: var(--slate-6);
  font-weight: 800;
}
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill {
  padding: .52rem .9rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: 0;
  border: 1px solid var(--slate-3);
  background: white;
  color: var(--slate-7);
}
.pill.accent { background: var(--red-wash); border-color: var(--red-line); color: var(--red); }
.simple-wording-toggle.is-active {
  background: #ecfeff;
  border-color: #67e8f9;
  color: #0f766e;
}

.course-index-toggle {
  position: fixed;
  left: 7px;
  top: 14px;
  z-index: 38;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid #dbe3ee;
  background: #fff;
  color: var(--slate-8);
  display: inline-grid;
  place-content: center;
  gap: 4px;
}

.course-index-toggle:hover,
.course-index-toggle:focus-visible {
  background: #fff7ed;
  border-color: #fdba74;
}

.course-index-toggle.is-active {
  background: #eff6ff;
  border-color: #93c5fd;
}

.hamburger-line {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform .18s ease, opacity .18s ease;
}

.course-index-toggle.is-active .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.course-index-toggle.is-active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.course-index-toggle.is-active .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.course-index-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  overflow: hidden;
  margin: -4px 0 18px;
  border: 1px solid rgba(148,163,184,.24);
  border-radius: 12px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--soft-shadow);
  transition: grid-template-rows .32s cubic-bezier(.2,.8,.2,1), opacity .22s ease;
}

.course-index-panel.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 0;
}

.course-index-panel > * {
  min-height: 0;
}

.course-index-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #e2e8f0;
}

.course-index-kicker,
.course-unit-kicker {
  font-size: .72rem;
  letter-spacing: 0;
  font-weight: 800;
  color: var(--slate-6);
}

.course-index-head h2 {
  margin-top: 3px;
  font-family: "Amatic SC", cursive;
  font-size: 2.45rem;
  line-height: .96;
  color: var(--red);
  text-wrap: balance;
}

.course-index-units {
  display: grid;
}

.course-unit-accordion {
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255,255,255,.76);
}

.course-unit-accordion:last-child {
  border-bottom: 0;
}

.course-unit-accordion.has-current-topic {
  background: #fff7ed;
}

.course-unit-trigger {
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 15px 20px;
  display: block;
  text-align: left;
  background: transparent;
  color: inherit;
}

.course-unit-trigger:focus-visible {
  outline: 2px solid rgba(37, 99, 235, .48);
  outline-offset: -2px;
}

.course-unit-copy {
  display: grid;
  gap: 4px;
}

.course-unit-title {
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}

.course-unit-body {
  display: block;
  height: 0;
  opacity: 0;
  overflow: clip;
  transition: height .26s cubic-bezier(.2,.8,.2,1), opacity .18s ease;
}

.course-unit-body[hidden] {
  display: none;
}

.course-unit-inner {
  min-height: 0;
  padding: 0 20px 16px;
}

.course-topic-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.course-topic-link {
  min-height: 58px;
  display: grid;
  grid-template-columns: 40px 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--slate-3);
  border-radius: 0;
  text-decoration: none;
  color: var(--slate-8);
  transition: border-color .16s ease;
}

.course-topic-link:hover,
.course-topic-link:focus-visible {
  background: #fff;
  border-color: var(--blue);
}

.course-topic-link.is-current {
  background: #fff;
  border-color: var(--blue);
}

.course-topic-code {
  font-weight: 800;
  color: var(--red);
}

.course-topic-icon {
  position: relative;
  display: block;
  width: 40px;
  height: 40px;
  overflow: hidden;
  background: transparent;
}

.course-topic-icon-static,
.course-topic-icon-motion {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.course-topic-icon-motion {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .16s ease;
}

.course-topic-icon-motion.is-visible {
  opacity: 1;
}

.course-topic-link:hover .course-topic-icon-static,
.course-topic-link:focus-visible .course-topic-icon-static {
  filter: saturate(1.06);
}

.navigation-credit-group {
  margin: 10px 0;
  border: 1px solid var(--slate-3);
  border-radius: 10px;
  background: rgba(255,255,255,.68);
}

.navigation-credit-group summary {
  cursor: pointer;
  padding: 11px 13px;
  font-weight: 800;
  color: var(--ink);
}

.navigation-credit-group summary:focus-visible {
  outline: 2px solid rgba(37, 99, 235, .48);
  outline-offset: -2px;
}

.navigation-credit-group ul {
  margin: 0;
  padding: 0 18px 14px 34px;
}

.navigation-credit-group--parent {
  margin-top: 16px;
  border-color: rgba(37, 99, 235, .24);
  background: rgba(248, 251, 255, .94);
}

.navigation-credit-group--parent > summary {
  color: #0b4fc1;
  font-size: 1.02rem;
}

.navigation-credit-children {
  padding: 0 12px 12px;
}

.navigation-credit-children > .navigation-credit-group {
  margin: 8px 0 0;
  background: #fff;
}

.course-topic-title {
  min-width: 0;
  line-height: 1.35;
  font-size: .92rem;
  font-weight: 700;
}

/* Visual nav contract: keep the course drawer fixed, collapsed to the hamburger rail,
   expandable, and paired with a toggleable moving shadow. */
.course-index-sidebar {
  position: fixed;
  inset: var(--learn-shell-visible-header) auto auto 0;
  z-index: 36;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: var(--course-index-collapsed-width);
  height: calc(100dvh - var(--learn-shell-visible-header));
  margin: 0;
  opacity: 1;
  overflow: visible;
  border: 0;
  border-right: 1px solid rgba(148,163,184,.34);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(180,39,29,.08) 0 2px, transparent 2px),
    rgba(255,254,249,.97);
  box-shadow: 7px 0 12px rgba(15,23,42,.14);
  transition: width .26s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease, transform .26s cubic-bezier(.2,.8,.2,1);
}

body:not(.course-index-shadow-off) .course-index-sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
  z-index: 0;
  width: 42px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, .42) 0,
    rgba(15, 23, 42, .28) 8px,
    rgba(15, 23, 42, .12) 20px,
    rgba(15, 23, 42, 0) 42px
  );
  opacity: .54;
  transform: translateX(-1px);
  transition: width .26s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
}

.course-index-sidebar.is-open {
  grid-template-rows: auto auto minmax(0, 1fr);
  width: var(--course-index-expanded-width);
  box-shadow: 10px 0 16px rgba(15,23,42,.2);
}

body:not(.course-index-shadow-off) .course-index-sidebar.is-open::before {
  width: 72px;
  opacity: .92;
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, .52) 0,
    rgba(15, 23, 42, .34) 12px,
    rgba(15, 23, 42, .16) 32px,
    rgba(15, 23, 42, 0) 72px
  );
}

body.course-index-shadow-off .course-index-sidebar {
  box-shadow: none;
}

.course-index-sidebar .course-index-head {
  width: var(--course-index-expanded-width);
  min-width: 0;
  padding: 16px 14px 18px 66px;
  align-items: flex-start;
  min-height: 118px;
  border-bottom: 0;
}

.course-index-sidebar:not(.is-open) .course-index-head {
  pointer-events: none;
}

.course-index-sidebar .course-index-kicker,
.course-index-sidebar .course-index-head h2,
.course-index-sidebar .course-index-search,
.course-index-sidebar .course-index-units {
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
  transition: opacity .18s ease, transform .22s ease;
}

.course-index-sidebar.is-open .course-index-kicker,
.course-index-sidebar.is-open .course-index-head h2,
.course-index-sidebar.is-open .course-index-search,
.course-index-sidebar.is-open .course-index-units {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.course-index-search {
  width: var(--course-index-expanded-width);
  min-width: 0;
  display: grid;
  padding: 0 18px 14px 66px;
  border-bottom: 1px solid #e2e8f0;
  gap: 6px;
}

.course-index-search label {
  font-size: .76rem;
  font-weight: 800;
  color: #475569;
}

.course-index-search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  padding: 9px 44px 9px 11px;
  font: inherit;
  color: var(--ink);
  background: rgba(255,255,255,.94);
}

.course-index-search-control {
  position: relative;
  display: block;
}

.course-index-search-clear {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #475569;
  font: 700 1.25rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.course-index-search-clear:hover,
.course-index-search-clear:focus-visible {
  background: #eff6ff;
  color: #0754c7;
}

.course-index-search-status {
  min-height: 1.25em;
  margin: 0;
  color: #64748b;
  font-size: .74rem;
  line-height: 1.35;
}

.course-index-sidebar .course-index-units {
  grid-row: 3;
  grid-column: 1;
}

.course-index-search-empty {
  margin: 0;
  padding: 22px 18px 22px 66px;
  color: #64748b;
  font-size: .82rem;
  font-weight: 700;
}

.course-topic-link.is-search-match .course-topic-icon,
.course-topic-link.is-search-match .course-topic-code {
  grid-row: 1 / span 2;
}

.course-topic-link.is-search-match .course-topic-title {
  grid-column: 3;
  grid-row: 1;
  align-self: end;
}

.course-topic-first-match {
  grid-column: 3;
  grid-row: 2;
  min-width: 0;
  align-self: start;
  color: #64748b;
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.3;
}

.course-topic-link.is-search-locked .course-topic-first-match {
  font-style: italic;
}

.course-search-target {
  scroll-margin-top: calc(var(--learn-shell-visible-header, 80px) + 24px);
  border-radius: 5px;
  outline: 2px solid rgba(37, 99, 235, .3);
  outline-offset: 5px;
}

mark.course-search-highlight {
  scroll-margin-top: calc(var(--learn-shell-visible-header, 80px) + 24px);
  border-radius: 3px;
  padding: 0 .08em;
  background: #fef08a;
  color: inherit;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .2);
}

.course-index-sidebar .course-index-units {
  width: var(--course-index-expanded-width);
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: auto;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 39, 29, .48) rgba(255,255,255,.42);
}

.course-index-sidebar .course-index-units::-webkit-scrollbar {
  width: 10px;
}

.course-index-sidebar .course-index-units::-webkit-scrollbar-track {
  background: rgba(255,255,255,.42);
}

.course-index-sidebar .course-index-units::-webkit-scrollbar-thumb {
  background: rgba(180,39,29,.34);
  border: 2px solid rgba(255,255,255,.76);
  border-radius: 999px;
}

.course-index-sidebar .course-index-units::-webkit-scrollbar-thumb:hover {
  background: rgba(180,39,29,.52);
}

.course-index-sidebar .course-topic-list {
  grid-template-columns: 1fr;
}

.course-index-sidebar .course-topic-link {
  border-radius: 8px;
  grid-template-columns: 40px 34px minmax(0, 1fr);
}

@media (prefers-reduced-motion: reduce) {
  .course-unit-body,
  .course-index-sidebar,
  .course-index-sidebar::before,
  .course-index-sidebar .course-index-kicker,
  .course-index-sidebar .course-index-head h2,
  .course-index-sidebar .course-index-search,
  .course-index-sidebar .course-index-units {
    transition-duration: 0ms;
  }

  .course-topic-icon-motion {
    display: none;
  }
}

.course-index-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 34;
  border: 0;
  border-radius: 0;
  background: rgba(15,23,42,.28);
  padding: 0;
}

[data-flow-text].is-flowing-text {
  transition: min-height .26s cubic-bezier(.2,.8,.2,1);
  overflow: visible;
}

.unit-topic-rail {
  position: relative;
  margin-bottom: 18px;
  padding: 12px 54px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 12px;
  box-shadow: var(--soft-shadow);
}

.unit-topic-rail-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.unit-topic-rail-label {
  font-size: .8rem;
  color: var(--slate-6);
  font-weight: 800;
  text-align: center;
}

.topic-rail-btn {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 1.2rem;
  font-weight: 800;
  padding: 4px 8px;
  line-height: 1;
  z-index: 3;
}

.topic-rail-btn:disabled {
  opacity: .42;
  cursor: default;
}

.unit-topic-rail.has-overflow .topic-rail-btn {
  display: block;
}

.topic-rail-btn-left {
  left: 8px;
}

.topic-rail-btn-right {
  right: 8px;
}

.unit-topic-rail-window {
  position: relative;
}

.unit-topic-rail-window::before,
.unit-topic-rail-window::after {
  opacity: 0;
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 34px;
  pointer-events: none;
  z-index: 2;
  transition: opacity .18s ease;
}

.unit-topic-rail-window::before {
  left: 0;
  background: linear-gradient(to right, rgba(255,255,255,.92), rgba(255,255,255,0));
}

.unit-topic-rail-window::after {
  right: 0;
  background: linear-gradient(to left, rgba(255,255,255,.92), rgba(255,255,255,0));
}

.unit-topic-rail.show-left-fade .unit-topic-rail-window::before {
  opacity: 1;
}

.unit-topic-rail.show-right-fade .unit-topic-rail-window::after {
  opacity: 1;
}

.unit-topic-rail-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  justify-content: center;
  padding: 4px 2px 6px;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.unit-topic-rail-track::-webkit-scrollbar {
  display: none;
}

.topic-chip {
  flex: 0 0 auto;
  width: 148px;
  min-width: 148px;
  padding: 10px 12px;
  min-height: 74px;
  border-radius: 12px;
  border: 1px solid var(--slate-3);
  background: rgba(255,255,255,.94);
  color: var(--slate-7);
  text-decoration: none;
  text-align: center;
  display: grid;
  align-content: center;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.topic-chip[type="button"] {
  appearance: none;
}

.topic-chip:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
}

.topic-chip.is-current {
  background: #fff7ed;
  border-color: #fdba74;
}

.topic-chip.is-disabled {
  opacity: .58;
  cursor: default;
}

.topic-chip-code {
  display: block;
  margin-bottom: 4px;
  font-size: .74rem;
  letter-spacing: 0;
  font-weight: 700;
  color: var(--slate-6);
}

.topic-chip-title {
  display: block;
  font-size: .92rem;
  font-weight: 500;
  color: #334155;
  line-height: 1.3;
}

.sticker-lab-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 54;
  width: min(380px, calc(100vw - 28px));
  max-height: min(68vh, 560px);
  overflow: auto;
  background: rgba(255,255,255,.97);
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 18px;
  box-shadow: 0 18px 38px rgba(15,23,42,.18);
  backdrop-filter: blur(8px);
  padding: 14px;
  display: none;
}

.sticker-lab-panel.open {
  display: block;
}

.sticker-lab-panel h3 {
  font-family: "Amatic SC", cursive;
  font-size: 2.3rem;
  line-height: .9;
  color: var(--red);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  touch-action: none;
}

.panel-head h3 {
  margin: 0;
}

.panel-drag-handle {
  cursor: grab;
}

.panel-drag-handle::after {
  content: "move";
  order: 2;
  align-self: center;
  margin-left: auto;
  color: var(--slate-6);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: 0;
}

.panel-close-btn {
  order: 3;
}

.sticker-lab-panel.is-moving,
.layout-editor-panel.is-moving {
  cursor: grabbing;
  user-select: none;
}

.panel-close-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #dbe3ee;
  background: rgba(255,255,255,.96);
  color: #475569;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.panel-close-btn:hover {
  background: #fff7ed;
  border-color: #fdba74;
  transform: translateY(-1px);
}

.sticker-lab-meta,
.sticker-lab-hint {
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
}

.sticker-lab-status {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  color: #334155;
  font-size: .86rem;
  line-height: 1.45;
}

.sticker-lab-status.online {
  border-color: rgba(34,197,94,.28);
  background: rgba(240,253,244,.96);
  color: #166534;
}

.sticker-lab-status.offline {
  border-color: rgba(248,113,113,.24);
  background: rgba(254,242,242,.96);
  color: #991b1b;
}

.sticker-lab-status.busy {
  border-color: rgba(59,130,246,.24);
  background: rgba(239,246,255,.96);
  color: #1d4ed8;
}

.sticker-lab-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.sticker-lab-grid label,
.sticker-lab-box {
  display: grid;
  gap: 6px;
}

.sticker-lab-grid label span,
.sticker-lab-box-label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #475569;
  font-weight: 800;
}

.sticker-lab-grid input,
.sticker-lab-grid select,
.sticker-lab-grid textarea,
.sticker-lab-inline-field select,
.sticker-lab-box textarea {
  width: 100%;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  color: #334155;
  background: rgba(255,255,255,.96);
}

.sticker-lab-wide {
  grid-column: 1 / -1;
}

.sticker-lab-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sticker-lab-box {
  margin-top: 12px;
}

.sticker-lab-inline-field {
  display: grid;
  gap: 6px;
}

.sticker-lab-settings {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 10px 12px;
  color: #475569;
  font-size: .88rem;
  line-height: 1.55;
}

.sticker-lab-existing {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  color: #475569;
}

.sticker-lab-existing li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sticker-library-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.sticker-library-card {
  display: grid;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid #dbe3ee;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 18px rgba(15,23,42,.04);
}

.sticker-library-card-placed {
  background: #fffefb;
}

.sticker-library-thumb {
  height: 108px;
  border-radius: 12px;
  border: 1px dashed #dbe3ee;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
}

.sticker-library-thumb img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
}

.sticker-library-thumb-placeholder {
  font-size: .82rem;
  color: #94a3b8;
  text-align: center;
}

.sticker-library-actions {
  display: flex;
  gap: 8px;
}

.sticker-library-actions .secondary-btn {
  width: 100%;
}

.sticker-library-empty {
  display: grid;
  gap: 4px;
  padding: 10px 2px;
}

.sticker-lab-existing-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sticker-insert-btn {
  flex: 0 0 auto;
}

.sticker-remove-btn {
  flex: 0 0 auto;
}

.sticker-lab-existing span {
  font-size: .78rem;
  color: #64748b;
}

.sticker-lab-advanced summary {
  cursor: pointer;
  list-style: none;
}

.sticker-lab-advanced summary::-webkit-details-marker {
  display: none;
}

.sticker-lab-advanced textarea {
  margin-top: 8px;
}

.injected-sticker-stage {
  position: relative;
  min-height: 180px;
  margin-top: 14px;
}

.page-blur { transition: none; }
.page-blur.is-blurred { pointer-events: none; user-select: none; }

.notebook-spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.topic-document-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1060px);
  gap: 0;
  align-items: start;
  justify-content: start;
  padding: 0;
}

.page {
  position: relative;
  min-height: 1260px;
  padding: 34px 28px 34px 72px;
  background:
    linear-gradient(90deg, transparent 0 42px, var(--margin-red) 42px 44px, transparent 44px),
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--line-blue) 31px 32px),
    var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 26px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.page::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 72px;
  width: 18px;
  height: calc(100% - 144px);
  background: radial-gradient(circle, #cbd5e1 0 6px, transparent 7px) center 0 / 18px 70px repeat-y;
  opacity: .9;
}
.page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,.34), rgba(255,255,255,0));
}
.page-inner { position: relative; z-index: 1; display: grid; gap: 22px; }

.topic-document {
  width: 100%;
  min-height: auto;
  overflow: visible;
}

.topic-document .page-inner {
  gap: 30px;
}

.notebook-section,
section[id] {
  scroll-margin-top: 112px;
}

.section-kicker {
  font-size: .8rem;
  color: var(--slate-6);
  font-weight: 800;
}
.page-title {
  margin-top: 3px;
  font-family: "Amatic SC", cursive;
  font-size: clamp(3.8rem, 6vw, 5.7rem);
  line-height: .9;
  color: var(--red);
}
.page-subtitle {
  max-width: 92%;
  margin-top: 8px;
  line-height: 1.72;
  color: var(--muted);
  font-size: 1rem;
}

.intro-hero,
.topic-hero {
  position: relative;
  min-height: 240px;
}

.topic-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
  min-height: auto;
}

.topic-hero > div:first-child {
  max-width: none;
}

.topic-hero .page-title {
  max-width: 100%;
}

.topic-hero .sticky-note {
  --sticky-art-top: 12px;
  --sticky-art-right: clamp(58px, 8vw, 108px);
  --sticky-art-bottom: clamp(38px, 4.4vw, 58px);
  --sticky-art-left: 12px;
  --sticky-height: clamp(172px, 18vw, 226px);
  --sticky-width: 100%;
  position: relative;
  z-index: 0;
  isolation: isolate;
  justify-self: stretch;
  width: 100%;
  max-width: none;
  margin-top: 0;
  box-shadow: none;
  transform: rotate(var(--sticky-rotate, -.55deg)) scale(var(--sticky-scale, 1));
  transform-origin: center center;
}

.topic-hero .sticky-note::before,
.topic-hero .sticky-note::after {
  content: none;
}

.topic-hero .sticky-note::before {
  left: 13px;
  transform: rotate(-2deg);
}

.topic-hero .sticky-note::after {
  right: 13px;
  transform: rotate(2deg);
}

.sticky-note {
  --sticky-left-image: url("./stickynote-wide-left.png");
  --sticky-mid-image: url("./stickynote-wide-mid.png");
  --sticky-right-image: url("./stickynote-wide-right.png");
  --sticky-height: clamp(168px, 22vw, 244px);
  --sticky-left-cap: clamp(44px, calc(var(--sticky-height) * .237), 72px);
  --sticky-right-cap: clamp(126px, calc(var(--sticky-height) * .726), 176px);
  --sticky-content-top: clamp(28px, calc(var(--sticky-height) * .15), 42px);
  --sticky-content-right: clamp(62px, calc(var(--sticky-height) * .34), 92px);
  --sticky-content-bottom: clamp(30px, calc(var(--sticky-height) * .16), 46px);
  --sticky-content-left: clamp(28px, calc(var(--sticky-height) * .15), 42px);
  width: min(var(--sticky-width, 680px), 100%);
  min-height: var(--sticky-height);
  background-color: transparent;
  background-image:
    var(--sticky-left-image),
    var(--sticky-right-image),
    var(--sticky-mid-image);
  background-position:
    left center,
    right center,
    var(--sticky-left-cap) center;
  background-size:
    var(--sticky-left-cap) 100%,
    var(--sticky-right-cap) 100%,
    calc(100% - var(--sticky-left-cap) - var(--sticky-right-cap)) 100%;
  background-repeat: no-repeat;
  background-clip: border-box;
  border: 0;
  border-radius: 0;
  padding:
    var(--sticky-content-top)
    var(--sticky-content-right)
    var(--sticky-content-bottom)
    var(--sticky-content-left);
  box-shadow: none;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  transform: rotate(var(--sticky-rotate, -1.15deg)) scale(var(--sticky-scale, 1));
  transform-origin: center center;
}

.sticky-note > * {
  position: relative;
  z-index: 1;
}

.sticky-note--wide,
.sticky-note[data-variant="wide"] {
  --sticky-left-image: url("./stickynote-wide-left.png");
  --sticky-mid-image: url("./stickynote-wide-mid.png");
  --sticky-right-image: url("./stickynote-wide-right.png");
  --sticky-left-cap: clamp(44px, calc(var(--sticky-height) * .237), 72px);
  --sticky-right-cap: clamp(126px, calc(var(--sticky-height) * .726), 176px);
}

.sticky-note--square,
.sticky-note[data-variant="square"] {
  --sticky-left-image: url("./stickynote-square-left.png");
  --sticky-mid-image: url("./stickynote-square-mid.png");
  --sticky-right-image: url("./stickynote-square-right.png");
  --sticky-width: min(390px, 100%);
  --sticky-height: clamp(260px, 38vw, 390px);
  --sticky-left-cap: clamp(32px, calc(var(--sticky-height) * .123), 52px);
  --sticky-right-cap: clamp(118px, calc(var(--sticky-height) * .441), 172px);
  --sticky-content-top: clamp(32px, calc(var(--sticky-height) * .12), 48px);
  --sticky-content-right: clamp(58px, calc(var(--sticky-height) * .19), 76px);
  --sticky-content-bottom: clamp(34px, calc(var(--sticky-height) * .12), 50px);
  --sticky-content-left: clamp(28px, calc(var(--sticky-height) * .1), 42px);
}

.sticky-note--long,
.sticky-note[data-variant="long"] {
  --sticky-width: min(820px, 100%);
  --sticky-height: clamp(162px, 18vw, 224px);
  --sticky-content-right: clamp(66px, calc(var(--sticky-height) * .32), 88px);
}

.sticky-note--single-image,
.sticky-note[data-variant="single-image"] {
  background-image: url("./stickynote.png");
  background-position: center;
  background-size: 100% 100%;
}

.sticky-note[data-debug="safe-area"]::after,
body.sticky-note-debug .sticky-note::after {
  content: "";
  position: absolute;
  inset:
    var(--sticky-content-top)
    var(--sticky-content-right)
    var(--sticky-content-bottom)
    var(--sticky-content-left);
  border: 2px dashed rgba(180, 39, 29, .55);
  pointer-events: none;
  z-index: 2;
}
.sticky-note h2,
.sticky-note h3,
.note-block h3,
.mini-label {
  font-size: .78rem;
  letter-spacing: 0;
  color: var(--slate-7);
  font-weight: 800;
}
.sticky-note h2,
.sticky-note h3 { color: #8a4b03; margin-bottom: 10px; }
.sticky-note p {
  font-family: "Caveat", cursive;
  font-size: var(--sticky-font-size, 2rem);
  line-height: 1.15;
}

.note-block {
  padding: 14px 16px 11px;
  border-radius: 12px;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(203,213,225,.8);
}
.note-block h3 { margin-bottom: 10px; }
.handwritten-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.18rem;
  line-height: 1.6;
  font-weight: 500;
  color: #1e293b;
}
.handwritten-list li { position: relative; padding-left: 18px; }
.handwritten-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: .06em;
  color: var(--blue);
  font-size: 1rem;
}

.section-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 7px;
  min-width: 0;
}
.section-title .doodle {
  position: relative;
  flex: 0 0 58px;
  width: 58px;
  height: 18px;
  margin-top: 13px;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.section-title .doodle::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 20px 0 0 var(--blue), 40px 0 0 var(--green);
}
.section-title h2 {
  flex: 1 1 auto;
  min-width: 0;
  font-family: "Amatic SC", cursive;
  font-size: clamp(2.65rem, 4.4vw, 3.35rem);
  line-height: .9;
  color: var(--red);
  letter-spacing: .01em;
}

.section-title.compact-title h2 {
  font-size: clamp(2.4rem, 3.8vw, 3.05rem);
}

.section-caption {
  color: var(--muted);
  line-height: 1.68;
  font-size: .96rem;
  max-width: 68ch;
}

.learning-roadmap {
  display: grid;
  gap: 14px;
}

.roadmap-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
}

.roadmap-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(191, 219, 254, .9);
  border-radius: 12px;
  background: rgba(255,255,255,.76);
}

.roadmap-step {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue-wash);
  border: 1px solid var(--blue-line);
  color: #1d4ed8;
  font-weight: 800;
}

.roadmap-list strong {
  display: block;
  color: #1e293b;
  font-size: 1rem;
  line-height: 1.35;
}

.roadmap-list p {
  margin-top: 5px;
  color: #475569;
  line-height: 1.58;
  font-size: .95rem;
}

.margin-vocab,
.vocabulary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.vocab-card {
  border: 1px solid var(--slate-3);
  border-radius: 10px;
  background: rgba(255,255,255,.78);
  padding: 14px;
  min-height: 124px;
}
.vocab-card h3,
.vocab-card h4 { font-size: .95rem; color: var(--blue); margin-bottom: 6px; }
.vocab-card p { font-size: .92rem; line-height: 1.55; color: #334155; }
.eal,
.vocab-card .eal {
  display: none;
  margin-top: 6px;
  font-size: .82rem;
  color: #64748b;
}

body.simple-wording-on .eal,
body.simple-wording-on .vocab-card .eal {
  display: block;
}

.common-traps {
  display: grid;
  gap: 12px;
}

.md-content-section {
  display: grid;
  gap: 14px;
}

.student-md-content {
  display: grid;
  gap: 14px;
  min-width: 0;
  overflow-x: hidden;
}

.student-md-content p,
.student-md-content li,
.student-md-content td,
.student-md-content th {
  color: var(--slate-8);
  line-height: 1.62;
}

.student-md-content h3,
.student-md-content h4 {
  margin-top: 4px;
  color: var(--ink);
  line-height: 1.25;
}

.student-md-content h3 {
  font-size: 1.08rem;
}

.student-md-content h4 {
  font-size: .98rem;
}

.student-md-content ul,
.student-md-content ol {
  margin: 0;
  padding-left: 24px;
  display: grid;
  gap: 8px;
}

.student-md-content .md-trap-item {
  color: var(--ink);
}

.student-md-content .md-trap-fix {
  margin: 6px 0 2px;
  color: #2f343b;
  font-weight: 600;
  line-height: 1.52;
}

.student-md-content strong {
  color: var(--ink);
  font-weight: 800;
}

.student-md-content hr {
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, .38);
}

.md-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: rgba(255,255,255,.86);
}

.student-md-content table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: .88rem;
}

.student-md-content th,
.student-md-content td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, .28);
  vertical-align: top;
  text-align: left;
}

.student-md-content th {
  color: var(--ink);
  background: rgba(239, 246, 255, .82);
  font-weight: 800;
}

.student-md-content tr:last-child td {
  border-bottom: 0;
}

.quick-check-launch {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.quick-check-readiness {
  max-width: 70ch;
  color: #26313f;
  font-weight: 600;
  line-height: 1.65;
}

.notebook-index-toggle {
  display: none;
}

/* Visual nav contract: keep the on-page index wide enough to avoid cramped labels,
   current-state red without underline, and mobile panel spanning the viewport gutter. */
.notebook-index {
  position: fixed;
  left: max(16px, calc((100vw - 1580px) / 2 + 28px));
  right: auto;
  top: calc(var(--learn-shell-visible-header) + 24px);
  z-index: 35;
  width: clamp(280px, 22vw, 320px);
  max-height: calc(100dvh - var(--learn-shell-visible-header) - 48px);
  overflow-y: auto;
  padding: 14px 14px 12px;
  border: 1px solid rgba(82, 104, 134, .22);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(214, 56, 48, .16) 28px, transparent 29px),
    repeating-linear-gradient(to bottom, #fffdf8 0, #fffdf8 27px, rgba(94, 139, 180, .16) 28px);
  box-shadow: 0 12px 28px rgba(31, 43, 61, .13);
  scrollbar-width: thin;
  scrollbar-color: rgba(82, 104, 134, .36) transparent;
}

.notebook-index::-webkit-scrollbar {
  width: 7px;
}

.notebook-index::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(82, 104, 134, .32);
}

.notebook-index__title {
  margin-left: 28px;
  margin-bottom: 10px;
  font-family: "Amatic SC", cursive;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--red);
  letter-spacing: .03em;
}

.notebook-index__item {
  width: 100%;
  min-height: 30px;
  margin: 2px 0;
  padding: 3px 5px 3px 0;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  color: #26364d;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, color 180ms ease, opacity 180ms ease;
}

.notebook-index__item:hover,
.notebook-index__item:focus-visible {
  transform: translateX(-2px);
}

.notebook-index__label {
  min-width: 0;
  font-size: .87rem;
  line-height: 1.15;
  transition: color 180ms ease;
}

.notebook-index__box {
  width: 17px;
  height: 17px;
  margin-left: 4px;
  display: grid;
  place-items: center;
  border: 1.8px solid #526886;
  border-radius: 4px;
  background: rgba(255, 255, 255, .7);
}

.notebook-index__tick {
  width: 19px;
  height: 19px;
  overflow: visible;
  transform: translateY(-2px);
}

.notebook-index__tick path {
  fill: none;
  stroke: #c7352d;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  transition: stroke-dashoffset 260ms ease-out;
}

.notebook-index__item.is-complete .notebook-index__tick path {
  stroke-dashoffset: 0;
}

.notebook-index__item.is-complete .notebook-index__box {
  border-color: #c7352d;
  background: rgba(255, 248, 214, .9);
}

.notebook-index__item.is-current {
  transform: translateX(-3px);
  background: rgba(255, 248, 214, .7);
}

.notebook-index__item.is-current .notebook-index__box {
  border-color: var(--red);
}

.notebook-index__item.is-current .notebook-index__label {
  color: var(--red);
  font-weight: 800;
}

.vsas-anchor {
  position: relative;
  display: inline-block;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.vsas-rail {
  position: fixed;
  top: 0;
  left: var(--vsas-rail-left, auto);
  display: block;
  z-index: 34;
  width: var(--vsas-rail-width, 92px);
  height: 100vh;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transition: opacity .18s ease, visibility .18s ease;
}

.vsas-rail.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.vsas-rail::before {
  content: "";
  position: absolute;
  top: 118px;
  bottom: 32px;
  left: 6px;
  width: 10px;
  border-radius: 999px;
  background: linear-gradient(to bottom, rgba(0, 74, 198, .48), rgba(0, 74, 198, .86));
  box-shadow: 0 0 0 1px rgba(0, 74, 198, .08), 0 12px 24px rgba(0, 74, 198, .14);
}

.lesson-orientation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 24px;
  padding: 14px 16px;
  border: 1px solid #bfd4f5;
  border-left: 4px solid #0755c9;
  border-radius: 6px;
  background: #f5f9ff;
  color: #334155;
  line-height: 1.45;
}

.lesson-orientation strong {
  color: #10213d;
}

.vsas-rail .vsas-marker {
  --vsas-marker-y: 50vh;
  --vsas-marker-scale: .76;
  --vsas-marker-hover-width: 176px;
  --vsas-marker-hover-height: 76px;
  position: absolute;
  top: var(--vsas-marker-y);
  right: 4px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(0, 74, 198, .18);
  border-radius: 23px 26px 24px 26px;
  background: var(--bc-primary, #004ac6);
  color: #fff;
  box-shadow: 0 12px 24px rgba(0, 74, 198, .18);
  opacity: 0;
  pointer-events: none;
  transform: scale(var(--vsas-marker-scale));
  transform-origin: right center;
  transition: width .18s ease, height .18s ease, border-radius .18s ease, opacity .14s linear, transform .16s ease, filter .16s ease, box-shadow .16s ease;
  will-change: top, opacity, transform;
}

.vsas-rail.is-left-lane .vsas-marker {
  right: auto;
  left: 4px;
  transform-origin: left center;
}

.vsas-rail .vsas-marker::after {
  content: "";
  position: absolute;
  left: 5px;
  bottom: -5px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: inherit;
  transform: rotate(45deg);
  z-index: -1;
}

.vsas-rail .vsas-marker:hover,
.vsas-rail .vsas-marker:focus,
.vsas-rail .vsas-marker:focus-visible {
  width: var(--vsas-marker-hover-width);
  height: var(--vsas-marker-hover-height);
  border-radius: 25px 28px 26px 28px;
  transform: translateY(-2px) scale(calc(var(--vsas-marker-scale) + .04));
  box-shadow: 0 16px 30px rgba(0, 74, 198, .22);
}

.vsas-rail .vsas-marker:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .34);
  outline-offset: 4px;
}

.vsas-rail .vsas-marker.is-active {
  filter: saturate(1.06);
  box-shadow: 0 16px 30px rgba(0, 74, 198, .24), 0 0 0 6px rgba(0, 74, 198, .14);
}

.vsas-rail .vsas-marker--small {
  width: 56px;
  height: 56px;
  border-radius: 20px 22px 21px 22px;
}

.vsas-rail .vsas-marker--large {
  width: 76px;
  height: 76px;
  border-radius: 27px 30px 28px 30px;
}

.vsas-rail .vsas-marker--warning {
  background: #f8b55f;
}

.vsas-rail .vsas-marker--info {
  background: #93c5fd;
}

.vsas-rail .vsas-marker--interactive {
  background: #86efac;
}

.vsas-marker__symbol {
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
  color: #07090c;
  transition: opacity .14s ease, transform .16s ease;
}

.vsas-marker__question {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 2rem;
  line-height: 1;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 34, 90, .22);
  transform: translateY(-1px);
  transition: opacity .14s ease, transform .16s ease;
}

.vsas-marker__label {
  position: absolute;
  inset: 8px 12px 8px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  color: #fff;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: .96;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 34, 90, .24);
  opacity: 0;
  pointer-events: none;
  transform: scale(.92);
  transition: opacity .14s ease, transform .16s ease;
}

.vsas-marker__label-line {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.vsas-rail.is-left-lane .vsas-marker__label {
  inset: 8px 20px 8px 12px;
}

.vsas-rail .vsas-marker:hover .vsas-marker__symbol,
.vsas-rail .vsas-marker:focus .vsas-marker__symbol,
.vsas-rail .vsas-marker:focus-visible .vsas-marker__symbol {
  opacity: 0;
  transform: scale(.86);
}

.vsas-rail .vsas-marker:hover .vsas-marker__question,
.vsas-rail .vsas-marker:focus .vsas-marker__question,
.vsas-rail .vsas-marker:focus-visible .vsas-marker__question {
  opacity: 0;
  transform: translateY(-1px) scale(.86);
}

.vsas-rail .vsas-marker:hover .vsas-marker__label,
.vsas-rail .vsas-marker:focus .vsas-marker__label,
.vsas-rail .vsas-marker:focus-visible .vsas-marker__label {
  opacity: 1;
  transform: scale(1);
}

.vsas-marker__glass {
  position: relative;
  width: 36px;
  height: 36px;
  display: block;
}

.vsas-marker__glass::before,
.vsas-marker__glass::after {
  content: "";
  position: absolute;
  display: block;
  background: transparent;
}

.vsas-marker__glass::before {
  top: 1px;
  left: 1px;
  width: 21px;
  height: 21px;
  border: 7px solid #07090c;
  border-radius: 50%;
}

.vsas-marker__glass::after {
  right: 1px;
  bottom: 1px;
  width: 17px;
  height: 7px;
  border-radius: 999px;
  background: #07090c;
  transform: rotate(45deg);
  transform-origin: center;
}

.info-section { display: grid; gap: 16px; margin-top: 10px; }
.info-section { gap: var(--section-gap, 16px); }
.layout-map { grid-template-columns: 1fr; }
.layout-compare { grid-template-columns: minmax(0, 1.22fr) minmax(280px, .78fr); align-items: start; }
.layout-flow { grid-template-columns: minmax(285px, .85fr) minmax(0, 1.15fr); align-items: start; }

.sticker-card {
  position: relative;
  background: rgba(255,255,255,.82);
  border: 2px dashed #cbd5e1;
  border-radius: 22px;
  padding: var(--card-pad, 18px);
  box-shadow: 0 13px 28px rgba(15,23,42,.07);
  width: min(100%, var(--card-width, 100%));
}
.sticker-card::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 24px;
  width: 96px;
  height: 24px;
  background: rgba(250, 204, 21, .48);
  border-radius: 6px;
  transform: rotate(-3deg);
  z-index: 2;
}
.sticker-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: var(--frame-min-height, auto);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  overflow: hidden;
  cursor: zoom-in;
}
.sticker-frame img {
  width: 100%;
  height: auto;
  max-height: var(--img-max-height, none);
  object-fit: contain;
  transition: transform .18s ease, filter .18s ease;
}
.sticker-card:hover .sticker-frame img { transform: scale(1.018); filter: saturate(1.05); }
.sticker-small .sticker-frame { min-height: var(--frame-min-height, 270px); }
.sticker-medium .sticker-frame { min-height: var(--frame-min-height, 310px); }
.sticker-large .sticker-frame { min-height: var(--frame-min-height, 380px); }
.sticker-small img { max-height: var(--img-max-height, 285px); }
.sticker-medium img { max-height: var(--img-max-height, 340px); }
.sticker-large img { max-height: var(--img-max-height, 430px); }
.sticker-card .caption {
  margin-top: 12px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}

.visual-placement-inline,
.visual-placement-group {
  width: 100%;
  margin: 18px 0;
  background: #fff;
}

.visual-placement-inline {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #fff;
  box-shadow: none;
  overflow: visible;
}

.visual-placement-inline::before {
  content: none;
}

.visual-placement-frame {
  min-height: 0;
  border-radius: 0;
  background: #fff;
  overflow: visible;
}

.visual-placement-inline .visual-placement-frame {
  min-height: 0;
}

.visual-placement-frame img {
  display: block;
  width: 100%;
  max-height: none;
  border-radius: 0;
  background: #fff;
}

.visual-placement-inline:hover .visual-placement-frame img {
  transform: none;
  filter: none;
}

.visual-placement-full .visual-placement-frame img {
  object-fit: contain;
}

/* This portrait mnemonic is useful as a study aid, but its source aspect ratio
   makes a full-width render dominate the lesson. Keep it readable and centered. */
[data-visual-placement-id="visual-u0-1-psychological-perspectives-hand-mnemonic"] {
  width: min(100%, 480px);
  margin-inline: auto;
}

[data-visual-placement-id="visual-u0-1-psychological-perspectives-hand-mnemonic"] .visual-placement-frame img {
  width: auto;
  max-width: 100%;
  max-height: 600px;
  margin-inline: auto;
}

.visual-placement-two-up {
  display: grid;
  gap: 14px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #fff;
  box-shadow: none;
}

.visual-placement-two-up-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.visual-placement-two-up-item {
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #fff;
  box-shadow: none;
}

.visual-placement-two-up-item .visual-placement-frame {
  min-height: 0;
}

.visual-placement-two-up-item img {
  height: auto;
  object-fit: contain;
}

.visual-placement-carousel {
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.visual-placement-swiper {
  display: block;
  width: 100%;
  padding: 0 0 42px;
  --swiper-theme-color: #004ac6;
  --swiper-navigation-size: 26px;
  --swiper-pagination-bottom: 12px;
}

.visual-placement-slide {
  height: auto;
}

.visual-placement-carousel-item {
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: #fff;
  box-shadow: none;
}

.visual-placement-carousel-item .visual-placement-frame {
  min-height: 0;
}

.visual-placement-carousel-item img {
  max-height: min(64vh, 620px);
}

@media (max-width: 720px) {
  .visual-placement-two-up-grid {
    grid-template-columns: 1fr;
  }

  .visual-placement-two-up-item .visual-placement-frame,
  .visual-placement-carousel-item .visual-placement-frame {
    min-height: 0;
  }

  .visual-placement-swiper {
    padding: 0 0 38px;
  }
}

.overlay-layout {
  position: relative;
  min-height: 340px;
  margin-top: 10px;
}

.overlay-layout.compact {
  min-height: 300px;
}

.overlay-layout.notebook-float {
  min-height: 420px;
}

.overlay-layout .compare-card {
  position: relative;
  z-index: 1;
  width: min(100%, var(--card-width, 74%));
}

.overlay-layout .compare-card.overlay-pad-right {
  padding-right: var(--overlay-pad-right, 20px);
}

.overlay-layout .compare-card.overlay-pad-top {
  padding-top: var(--overlay-pad-top, 22px);
}

.overlay-layout .compare-card.overlay-pad-bottom {
  padding-bottom: var(--overlay-pad-bottom, 30px);
}

.overlay-layout .compare-card h3 {
  padding-right: 10px;
}

.overlay-layout.notebook-float .compare-card {
  width: 100%;
  overflow: visible;
}

.overlay-layout.notebook-float .compare-grid {
  max-width: 100%;
  gap: 16px;
}

.overlay-layout.notebook-float .compare-col {
  min-height: 0;
}

.overlay-layout + .overlay-caption,
.overlay-layout + .section-caption,
.compare-card + .section-caption {
  margin-top: 12px;
}

.system-spider-map {
  position: relative;
  display: grid;
  gap: 22px;
  max-width: min(100%, 700px);
  margin: 4px 0 18px;
  padding: 10px 6px 6px;
}

.map-branch {
  position: relative;
  display: grid;
  gap: 20px;
}

.map-branch-main,
.map-branch-secondary,
.map-branch-tertiary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.map-node {
  position: relative;
  min-height: 86px;
  padding: 14px 16px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,.92);
  border: 2px solid rgba(148,163,184,.3);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .06);
  text-align: center;
  font-size: 1.02rem;
  font-weight: 800;
  color: #1e293b;
}

.map-node::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: rgba(148,163,184,.55);
}

.map-node-root {
  width: min(100%, 260px);
  justify-self: center;
  background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
  border-color: rgba(245, 158, 11, .38);
}

.map-node-root::after {
  top: 100%;
  height: 22px;
}

.map-branch-main::before,
.map-branch-secondary::before,
.map-branch-tertiary::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 25%;
  right: 25%;
  height: 2px;
  background: rgba(148,163,184,.55);
}

.map-branch-main .map-node::before,
.map-branch-secondary .map-node::before,
.map-branch-tertiary .map-node::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 2px;
  height: 14px;
  transform: translateX(-50%);
  background: rgba(148,163,184,.55);
}

.map-branch-main .map-node-blue::after,
.map-branch-secondary .map-node-sky::after {
  top: 100%;
  height: 22px;
}

.map-branch-main .map-node-gold::after,
.map-branch-secondary .map-node-green::after,
.map-branch-tertiary .map-node-red::after,
.map-branch-tertiary .map-node-mint::after {
  display: none;
}

.map-node-gold {
  background: linear-gradient(180deg, #fff7ed 0%, #fffbeb 100%);
  border-color: rgba(245, 158, 11, .4);
}

.map-node-blue {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-color: rgba(59, 130, 246, .34);
}

.map-node-green {
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: rgba(34, 197, 94, .34);
}

.map-node-sky {
  background: linear-gradient(180deg, #eff6ff 0%, #e0ecff 100%);
  border-color: rgba(96, 165, 250, .36);
}

.map-node-red {
  background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%);
  border-color: rgba(248, 113, 113, .34);
}

.map-node-mint {
  background: linear-gradient(180deg, #ecfdf5 0%, #dcfce7 100%);
  border-color: rgba(74, 222, 128, .34);
}

.map-sub {
  margin-top: 6px;
  font-size: .84rem;
  line-height: 1.4;
  font-weight: 600;
  color: #64748b;
}

.system-map-support {
  max-width: min(100%, 620px);
}

.interactive-spider-map {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 14px;
  width: 100%;
}

.interactive-spider-map-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.map-sheet { stroke: #d8d8d1; stroke-width: 2.5; }
.map-rules { opacity: .85; }
.map-margin { stroke: rgba(220,38,38,.28); stroke-width: 2.2; }
.map-hole { fill: #cbd5e1; }
.map-tape { fill: rgba(250, 204, 21, .45); }
.map-heading { font: 700 34px "Amatic SC", "Trebuchet MS", sans-serif; fill: #b4271d; letter-spacing: 1px; }
.map-subheading { font: 800 16px "Be Vietnam Pro", Arial, sans-serif; fill: #64748b; letter-spacing: 1.2px; text-transform: uppercase; }
.map-legend { font: 600 15px "Be Vietnam Pro", Arial, sans-serif; fill: #64748b; }
.map-connector-soft { fill: none; stroke: #cbd5e1; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; opacity: .32; }
.map-connector { fill: none; stroke: #94a3b8; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }

.interactive-node rect {
  stroke-width: 2.5;
  transition: transform .16s ease, filter .16s ease;
  transform-box: fill-box;
  transform-origin: center center;
}

.interactive-node {
  cursor: pointer;
  outline: none;
}

.interactive-node:hover rect,
.interactive-node:focus rect,
.interactive-node.is-active rect {
  transform: translateY(-2px);
  stroke-width: 3.5;
}

.interactive-node.node-gold rect { fill: #fff7ed; stroke: #f59e0b; filter: url(#nodeShadow-1-2); }
.interactive-node.node-blue rect { fill: #e8f0ff; stroke: #60a5fa; filter: url(#nodeShadow-1-2); }
.interactive-node.node-green rect { fill: #ecfdf5; stroke: #4ade80; filter: url(#nodeShadow-1-2); }
.interactive-node.node-sky rect { fill: #eff6ff; stroke: #93c5fd; filter: url(#nodeShadow-1-2); }
.interactive-node.node-red rect { fill: #fef2f2; stroke: #fca5a5; filter: url(#nodeShadow-1-2); }
.interactive-node.node-mint rect { fill: #ecfdf5; stroke: #86efac; filter: url(#nodeShadow-1-2); }

.interactive-node.is-active rect,
.interactive-node:hover rect,
.interactive-node:focus rect {
  filter: url(#cardShadow-1-2);
}

.node-title { font: 800 28px "Be Vietnam Pro", Arial, sans-serif; fill: #1e293b; text-anchor: middle; pointer-events: none; }
.node-sub { font: 600 17px "Be Vietnam Pro", Arial, sans-serif; fill: #475569; text-anchor: middle; pointer-events: none; }

.map-quick-panel {
  position: relative;
  border-radius: 22px;
  border: 1px solid #dbe3ee;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.88));
  padding: 18px;
  box-shadow: 0 12px 30px rgba(15,23,42,.08);
  margin-top: 2px;
}

.map-quick-panel-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.map-quick-label {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: #64748b;
}

.map-quick-title {
  margin-top: 4px;
  font-size: 1.2rem;
  color: #1e293b;
}

.map-quick-summary {
  margin-top: 12px;
  color: #334155;
  line-height: 1.65;
}

.map-quick-bullets {
  margin-top: 12px;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: #475569;
  line-height: 1.55;
}

.map-quick-actions {
  margin-top: 14px;
}

.map-quick-sticker {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.map-quick-sticker-btn {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  justify-self: start;
}

.map-quick-sticker-img {
  width: min(100%, 180px);
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 14px rgba(15,23,42,.16));
}

.map-quick-sticker-caption {
  font-size: .85rem;
  line-height: 1.5;
  color: #64748b;
}

.sticker-stage {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.sticker-floating {
  position: absolute;
  left: var(--left, 0);
  top: var(--top, 0);
  width: var(--width, 160px);
  z-index: var(--z, 5);
  transform: rotate(var(--rotate, 0deg));
  border: 0;
  padding: 0;
  background: transparent;
  pointer-events: auto;
  box-shadow: none;
}

.compare-card {
  padding: var(--compare-pad, 24px);
}

body.layout-edit-mode .sticker-card,
body.layout-edit-mode .compare-card,
body.layout-edit-mode .info-section,
body.layout-edit-mode .sticky-note,
body.layout-edit-mode .sticker-floating {
  cursor: pointer;
}

.layout-edit-target {
  outline: 2px dashed rgba(37, 99, 235, .7);
  outline-offset: 6px;
}

.layout-edit-target[data-layout-type="sticker-floating"] {
  cursor: grab;
}

.layout-edit-target.is-dragging[data-layout-type="sticker-floating"] {
  cursor: grabbing;
}

.layout-editor-toggle {
  padding: .52rem .9rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .05em;
  border: 1px solid #dbe3ee;
  background: white;
  color: #475569;
}

.layout-editor-toggle.is-active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.layout-editor-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 55;
  width: min(330px, calc(100vw - 28px));
  max-height: min(64vh, 520px);
  overflow: auto;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 18px;
  box-shadow: 0 18px 38px rgba(15,23,42,.18);
  backdrop-filter: blur(8px);
  padding: 14px;
  display: none;
}

body.layout-edit-mode .layout-editor-panel {
  display: block;
}

.layout-editor-panel h3 {
  font-family: "Amatic SC", cursive;
  font-size: 2.3rem;
  line-height: .9;
  color: var(--red);
}

.layout-editor-meta,
.layout-editor-empty,
.layout-editor-hint {
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
}

.layout-editor-empty {
  padding: 10px 0 2px;
}

.layout-editor-controls {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.layout-editor-field {
  display: grid;
  gap: 5px;
}

.layout-editor-field label {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #475569;
  font-weight: 800;
}

.layout-editor-field input[type="range"] {
  width: 100%;
}

.layout-editor-value {
  font-size: .82rem;
  color: #334155;
  font-weight: 700;
}

.layout-editor-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.layout-editor-save-state {
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  padding: 9px 10px;
  color: #475569;
  font-size: .82rem;
  line-height: 1.45;
}

.layout-editor-save-state.online {
  border-color: rgba(34,197,94,.28);
  background: rgba(240,253,244,.96);
  color: #166534;
}

.layout-editor-save-state.offline {
  border-color: rgba(248,113,113,.24);
  background: rgba(254,242,242,.96);
  color: #991b1b;
}

.layout-editor-save-state.busy {
  border-color: rgba(59,130,246,.24);
  background: rgba(239,246,255,.96);
  color: #1d4ed8;
}

.sticker-floating:hover,
.sticker-floating:focus-visible {
  transform: translateY(-2px) rotate(var(--rotate, 0deg));
  box-shadow: none;
}

.sticker-floating > img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 14px rgba(15,23,42,.16));
}

.sticker-floating .sticker-crop {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.sticker-floating .sticker-crop.crop-left {
  aspect-ratio: 0.92 / 1;
}

.sticker-floating .sticker-crop.crop-right {
  aspect-ratio: 0.78 / 1;
}

.sticker-floating .sticker-crop img {
  width: 180%;
  max-width: none;
  height: auto;
  filter: drop-shadow(0 10px 14px rgba(15,23,42,.16));
}

.sticker-floating .sticker-crop.crop-left img {
  transform: translateX(0%);
}

.sticker-floating .sticker-crop.crop-right img {
  transform: translateX(-44%);
}

.sticker-floating .sticker-hover {
  position: absolute;
  right: -10px;
  top: -10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(203,213,225,.9);
  color: #1f2937;
  font-size: .8rem;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(15,23,42,.13);
  opacity: 0;
  transform: translateY(-4px) scale(.96);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
}

.sticker-floating .sticker-hover::before {
  content: "🔍";
  line-height: 1;
}

.sticker-floating:hover .sticker-hover,
.sticker-floating:focus-visible .sticker-hover {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.overlay-caption {
  margin-top: 8px;
  margin-left: auto;
  max-width: 340px;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.55;
}

.depth-accordion-stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.depth-accordion {
  border: 1px solid rgba(191, 219, 254, .95);
  border-radius: 18px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 10px 20px rgba(15,23,42,.05);
  overflow: clip;
}

.depth-accordion-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.depth-accordion-trigger:focus-visible {
  outline: 2px solid rgba(37, 99, 235, .5);
  outline-offset: -2px;
}

.depth-accordion-copy {
  display: grid;
  gap: 4px;
}

.depth-accordion-kicker {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
  color: #64748b;
}

.depth-accordion-title {
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 700;
  color: #1f2937;
}

.depth-accordion-chevron {
  font-size: 1.3rem;
  line-height: 1;
  color: #64748b;
  transform: rotate(0deg);
  transition: transform .22s ease;
}

.depth-accordion.is-open .depth-accordion-chevron {
  transform: rotate(90deg);
}

.depth-accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  overflow: hidden;
  transition: grid-template-rows .24s ease, opacity .18s ease;
}

.depth-accordion-inner {
  min-height: 0;
  padding: 0 16px 16px;
  display: grid;
  gap: 10px;
}

.depth-accordion-inner p,
.depth-accordion-inner li {
  color: #334155;
  line-height: 1.62;
  font-size: .94rem;
}

.depth-accordion-inner ul {
  margin: 0;
  padding-left: 18px;
}

.depth-accordion-note {
  border: 1px solid rgba(21, 128, 61, .28);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(236,253,245,.66);
  color: #365314;
  font-weight: 600;
}

.overlay-caption.left {
  margin-left: 0;
  margin-right: auto;
}
.sticker-zoom-btn {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border: 1px solid rgba(203,213,225,.9);
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  color: #1f2937;
  font-size: .82rem;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(15,23,42,.13);
  opacity: 0;
  transform: translateY(-4px) scale(.96);
  transition: opacity .16s ease, transform .16s ease, box-shadow .16s ease;
}
.sticker-zoom-btn::before { content: "🔍"; font-size: 1rem; line-height: 1; }
.sticker-frame:hover .sticker-zoom-btn,
.sticker-frame:focus-within .sticker-zoom-btn,
.sticker-zoom-btn:focus-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.sticker-zoom-btn:hover { box-shadow: 0 14px 24px rgba(15,23,42,.18); }

.compare-card {
  background: rgba(255,255,255,.7);
  border: 1px solid color-mix(in srgb, var(--red) 18%, var(--slate-3));
  border-radius: 12px;
  padding: 20px;
}
.compare-card h3 {
  font-size: 1.06rem;
  color: #1e293b;
  margin-bottom: 14px;
}
.compare-grid { display: grid; gap: 14px; align-items: start; }
.compare-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compare-grid.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.compare-col {
  min-width: 0;
  border-radius: 0;
  padding: 12px 0 0;
  align-self: start;
  overflow-wrap: normal;
  word-break: normal;
}
.compare-col.green { border-top: 1px solid #b8e4c5; }
.compare-col.blue { border-top: 1px solid #bed6ff; }
.compare-col.red { border-top: 1px solid #fecaca; }
.compare-col.gold { border-top: 1px solid #fed7aa; }
.compare-col h4 { margin-bottom: 9px; font-size: .98rem; }
.compare-col ul { margin: 0; padding-left: 18px; display: grid; gap: 7px; font-size: .94rem; line-height: 1.58; }
.compare-col li { padding-left: 1px; }

.callout-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.callout {
  border-radius: 12px;
  padding: 14px;
  border: 1px solid var(--slate-3);
  background: rgba(255,255,255,.76);
}
.callout strong { display: block; font-size: .88rem; letter-spacing: 0; color: var(--slate-7); margin-bottom: 6px; }
.callout p { line-height: 1.6; font-size: .94rem; color: #334155; }
.callout.mixup { border-color: color-mix(in srgb, var(--blue) 24%, var(--slate-3)); background: rgba(239,246,255,.72); }
.callout.bridge { border-color: color-mix(in srgb, var(--green) 24%, var(--slate-3)); background: rgba(236,253,245,.72); }

.exam-panel {
  margin-top: 8px;
  border-radius: 12px;
  padding: 18px;
  background: rgba(255,255,255,.76);
  border: 1px solid var(--slate-3);
}
.exam-panel p { color: var(--muted); line-height: 1.65; margin-bottom: 12px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
button {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  font-weight: 800;
  font-size: .95rem;
  padding: 12px 16px;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
button:hover { transform: translateY(-2px); box-shadow: 0 12px 20px rgba(15,23,42,.12); }
.primary-btn { background: var(--red); color: #fff; }
.secondary-btn { background: #fff; color: #0f172a; border: 1px solid #dbe3ee; }
.question-chip { color: #64748b; font-size: .85rem; font-weight: 800; }
.topic-footer-nav {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.topic-footer-link {
  min-width: 180px;
  max-width: 48%;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid #dbe3ee;
  background: rgba(255,255,255,.9);
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(15,23,42,.04);
}

.topic-footer-link.next {
  text-align: right;
}

.topic-footer-link.is-disabled {
  opacity: .52;
  cursor: default;
}

.topic-footer-kicker {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #64748b;
  font-weight: 800;
  margin-bottom: 4px;
}

.topic-footer-title {
  display: block;
  font-size: .95rem;
  line-height: 1.35;
  color: #334155;
  font-weight: 800;
}

.topic-video-section {
  margin-top: 10px;
}

.topic-video-frame {
  position: relative;
  margin-top: 14px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--slate-3);
  background:
    repeating-linear-gradient(to bottom, transparent 0 31px, rgba(59, 130, 246, .12) 31px 32px),
    #fffef9;
}

.topic-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
  background: rgba(15, 23, 42, .42);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility 0s linear .2s;
}
.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
.modal,
.image-lightbox {
  width: min(880px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fffefb;
  border: 1px solid var(--paper-edge);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(15,23,42,.26);
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(.985);
  transform-origin: center;
  contain: layout paint;
  transition: opacity .2s ease, transform .2s cubic-bezier(.16,1,.3,1);
}
.modal-backdrop.open .modal,
.modal-backdrop.open .image-lightbox {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}
.modal-backdrop.is-preparing .modal,
.modal-backdrop.is-preparing .image-lightbox,
.modal-backdrop.open .modal,
.modal-backdrop.open .image-lightbox {
  will-change: opacity, transform;
}
.modal-top,
.image-lightbox-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal h2 {
  font-family: "Amatic SC", cursive;
  font-size: 3.5rem;
  line-height: .92;
  color: var(--red);
}
.modal-label {
  margin-top: 8px;
  display: inline-block;
  padding: .38rem .76rem;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: .78rem;
  font-weight: 800;
}

.modal-label#modalNode,
.save-state {
  display: none;
}
.modal p { margin-top: 14px; line-height: 1.8; }
.modal ul { margin-top: 14px; padding-left: 20px; display: grid; gap: 8px; line-height: 1.6; color: #475569; }
textarea {
  margin-top: 16px;
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border-radius: 16px;
  border: 2px solid #cbd5e1;
  padding: 14px 16px;
  font: inherit;
  line-height: 1.6;
}
.modal-actions { margin-top: 16px; display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }

.quick-check-modal {
  width: min(760px, 100%);
}

.quick-check-progress {
  margin-top: 18px;
  height: 10px;
  border-radius: 999px;
  background: rgba(15,23,42,.12);
  overflow: hidden;
}

.quick-check-progress span {
  display: block;
  width: var(--quick-check-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #10b981, #14b8a6);
  transition: width .22s ease;
}

.quick-check-score {
  margin-top: 14px;
  color: #64748b;
  font-weight: 800;
}

.quick-check-prompt {
  margin-top: 12px;
  color: #172033;
  font-size: 1.08rem;
  line-height: 1.5;
}

.quick-check-choice-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.quick-check-choice {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  text-align: left;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: rgba(255,255,255,.96);
  color: #334155;
  line-height: 1.48;
  box-shadow: none;
  transform: none;
}

.quick-check-choice:hover,
.quick-check-choice:focus-visible {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: none;
  transform: none;
}

.quick-check-choice span {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
}

.quick-check-choice.is-correct {
  border-color: #22c55e;
  background: #f0fdf4;
}

.quick-check-choice.is-wrong {
  border-color: #f97316;
  background: #fff7ed;
}

.quick-check-choice.is-locked {
  cursor: default;
}

.quick-check-feedback {
  min-height: 1.5em;
  margin-top: 14px;
  color: #475569;
  font-weight: 800;
  line-height: 1.5;
}

.image-lightbox { width: min(1080px, calc(100vw - 36px)); }
.image-lightbox-top { justify-content: flex-end; min-height: 38px; }
.image-lightbox #imageModalTitle { display: none; }
.image-lightbox #imageModalCaption { display: none; }
.image-lightbox p { margin: 0; color: var(--muted); line-height: 1.55; }
.image-lightbox p:empty { display: none; }
.image-lightbox-figure {
  position: relative;
  margin-top: 12px;
  display: grid;
  place-items: center;
  min-height: 0;
  border-radius: 0;
  background: #fff;
  border: 0;
  padding: 0;
}
.image-lightbox-figure img {
  display: block;
  width: 100%;
  max-height: min(68vh, 720px);
  object-fit: contain;
  background: #fff;
}
.image-lightbox.has-gallery .image-lightbox-figure {
  padding: 0 clamp(42px, 6vw, 72px);
}
.image-lightbox-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(203, 213, 225, .9);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #10233f;
  box-shadow: 0 14px 28px rgba(15, 23, 42, .16);
  transform: translateY(-50%);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.image-lightbox-arrow[hidden],
.image-lightbox-counter[hidden] {
  display: none;
}
.image-lightbox-arrow::before {
  content: "";
  width: 12px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}
.image-lightbox-arrow--prev {
  left: 8px;
}
.image-lightbox-arrow--prev::before {
  transform: translateX(2px) rotate(-135deg);
}
.image-lightbox-arrow--next {
  right: 8px;
}
.image-lightbox-arrow--next::before {
  transform: translateX(-2px) rotate(45deg);
}
.image-lightbox-arrow:hover,
.image-lightbox-arrow:focus-visible {
  background: #fff;
  box-shadow: 0 18px 34px rgba(15, 23, 42, .22);
  transform: translateY(-50%) scale(1.04);
}
.image-lightbox-counter {
  position: absolute;
  right: clamp(46px, 6vw, 76px);
  bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #475569;
  font-size: .8rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .1);
}

@media (max-width: 720px) {
  .image-lightbox.has-gallery .image-lightbox-figure {
    padding: 0 38px;
  }

  .image-lightbox-arrow {
    width: 34px;
    height: 34px;
  }

  .image-lightbox-arrow::before {
    width: 9px;
    height: 9px;
  }

  .image-lightbox-arrow--prev {
    left: 0;
  }

  .image-lightbox-arrow--next {
    right: 0;
  }

  .image-lightbox-counter {
    right: 42px;
    bottom: 6px;
  }
}

@media (hover: none) {
  .sticker-zoom-btn { opacity: 1; transform: translateY(0) scale(1); }
}

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

  button:hover,
  .topic-chip:hover,
  .notebook-index__item:hover,
  .sticker-floating:hover,
  .sticker-floating:focus-visible {
    transform: none !important;
  }

  .notebook-index__item,
  .notebook-index__tick path {
    transition: none;
  }

  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 1540px) {
  body.course-index-open .notebook-spread {
    grid-template-columns: minmax(0, 1fr);
  }

  body.course-index-open .page {
    min-height: auto;
  }
}

@media (max-width: 1280px) {
  .notebook-spread { grid-template-columns: 1fr; }
  .page { min-height: auto; }
  .topic-document-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1100px) {
  .topic-document-wrap {
    padding-left: 0;
    padding-right: 0;
  }

  .vsas-rail {
    display: none;
  }

  .notebook-index-toggle {
    display: block;
    position: fixed;
    right: 16px;
    bottom: 18px;
    z-index: 37;
    padding: 9px 14px;
    border: 1px solid rgba(82, 104, 134, .25);
    border-radius: 999px;
    background: #fffdf8;
    color: #26364d;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(31, 43, 61, .16);
  }

  .notebook-index {
    top: auto;
    left: 16px;
    right: 16px;
    bottom: 68px;
    width: auto;
    max-height: min(720px, calc(100vh - 104px));
    transform: translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .notebook-index.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}

@media (min-width: 1101px) {
  .vsas-rail {
    display: block;
  }
}

@media (max-width: 900px) {
  :root {
    --course-index-width: 0px;
  }

  body.course-index-open {
    --course-index-width: 0px;
  }

  .app-shell {
    width: auto;
    margin: 0 auto;
  }

  .course-index-sidebar {
    width: min(var(--course-index-expanded-width), calc(100vw - 4px));
    transform: translateX(calc(-100% - 8px));
    pointer-events: none;
  }

  .course-index-sidebar.is-open {
    width: min(var(--course-index-expanded-width), calc(100vw - 4px));
    transform: translateX(0);
    pointer-events: auto;
  }

  .course-index-sidebar .course-index-head,
  .course-index-sidebar .course-index-search,
  .course-index-sidebar .course-index-units {
    width: 100%;
  }

  .course-index-sidebar.is-open .course-index-kicker,
  .course-index-sidebar.is-open .course-index-head h2,
  .course-index-sidebar .course-index-search,
  .course-index-sidebar .course-index-units {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .course-index-sidebar:not(.is-open)::after {
    content: none;
  }

  body.course-index-open .course-index-scrim {
    display: block;
  }

  .intro-hero {
    min-height: auto;
    display: grid;
    gap: 14px;
  }

  .topic-hero {
    grid-template-columns: 1fr;
  }

  .topic-hero .sticky-note {
    justify-self: stretch;
  }

  .intro-hero .sticker-floating {
    position: relative;
    left: auto;
    top: auto;
    width: min(42vw, 180px);
    transform: none !important;
  }

  .overlay-layout {
    min-height: auto;
    display: grid;
    gap: 14px;
  }

  .overlay-layout .compare-card {
    width: 100%;
    padding-right: 20px !important;
    padding-top: 20px !important;
    padding-bottom: 20px !important;
  }

  .sticker-stage {
    position: relative;
    inset: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    pointer-events: auto;
  }

  .sticker-floating {
    position: relative;
    left: auto;
    top: auto;
    width: min(42vw, 180px);
    transform: none !important;
  }

  .sticker-floating:hover,
  .sticker-floating:focus-visible {
    transform: translateY(-2px) !important;
  }

  .overlay-caption,
  .overlay-caption.left {
    margin: 0;
    max-width: none;
  }

  .layout-map,
  .layout-compare,
  .layout-flow,
  .callout-row,
  .compare-grid.two-col,
  .compare-grid.three-col { grid-template-columns: 1fr; }
  .sticker-lab-grid { grid-template-columns: 1fr; }
  .topic-footer-nav { flex-direction: column; align-items: stretch; }
  .topic-footer-link,
  .topic-footer-link.next { max-width: none; min-width: 0; text-align: left; }
  .interactive-spider-map { grid-template-columns: 1fr; }
  .map-quick-panel { position: relative; top: auto; }
  .sticker-small .sticker-frame,
  .sticker-medium .sticker-frame,
  .sticker-large .sticker-frame { min-height: 240px; }
  .sticker-small img,
  .sticker-medium img,
  .sticker-large img { max-height: 330px; }
}

@media (max-width: 720px) {
  .app-shell { padding-inline: 10px; }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    position: relative;
  }
  .top-actions { width: 100%; }
  .course-index-toggle {
    top: 14px;
    left: 7px;
    right: auto;
    margin-left: 0;
  }
  .course-index-head { padding: 16px 14px 12px; }
  .course-index-head h2 { font-size: 2.55rem; }
  .course-unit-trigger { padding: 14px; }
  .course-unit-inner { padding-inline: 14px; }
  .course-topic-list { grid-template-columns: 1fr; }
  .course-topic-link { grid-template-columns: 38px minmax(0, 1fr); }
  .unit-topic-rail { display: none; }
  .unit-topic-rail-top { align-items: center; flex-direction: column; }
  .topic-rail-btn-left { left: 2px; }
  .topic-rail-btn-right { right: 2px; }
  .page { padding: 28px 18px 28px 54px; border-radius: 18px; }
  .page-title { font-size: clamp(3.1rem, 13vw, 4.4rem); }
  .sticky-note p { font-size: 1.7rem; }
  .handwritten-list { font-size: 1.05rem; }
  .roadmap-list li,
  .quick-check-choice {
    grid-template-columns: 1fr;
  }
  .topic-chip,
  .topic-chip-title,
  .topic-chip-code { text-align: center; }
  .topic-chip { width: 136px; min-width: 136px; }
  .section-title .doodle { flex-basis: 46px; width: 46px; }
  .section-title .doodle::before { box-shadow: 16px 0 0 var(--blue), 32px 0 0 var(--green); }
  .section-title h2 { font-size: 2.55rem; }
  .compare-card { padding: 16px; }
  .map-branch-main,
  .map-branch-secondary,
  .map-branch-tertiary { grid-template-columns: 1fr; }
  .map-branch-main::before,
  .map-branch-secondary::before,
  .map-branch-tertiary::before { left: 50%; right: auto; width: 2px; height: 14px; top: -14px; }
  .system-spider-map { gap: 18px; }
}
