/* Self-hosted Figtree (OFL). Served from /fonts — no third-party font CDN. */
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/figtree-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/figtree-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/figtree-latin-ext-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/figtree-latin-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #1c2421;
  --muted: #5c675f;
  --paper: #f4f6f5;
  --card: #ffffff;
  --line: #d5ddd8;
  --stage: #ffffff;
  --accent: #1f4d3a;
  --accent-deep: #16382a;
  --predict-bg: #f8f3e8;
  --predict-edge: #b0893e;
  --notice-bg: #e7f3ee;
  --notice-edge: #1f6b5c;
  --font: "Figtree", system-ui, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.45;
}

body.playing {
  height: 100%;
  overflow: hidden;
}

button,
a { font: inherit; color: inherit; }

button { cursor: pointer; }

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

.catalog {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.catalog.view-gallery { max-width: 72rem; }

.catalog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.catalog h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.view-toggle {
  display: flex;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card);
}

.view-toggle button {
  border: 0;
  background: transparent;
  padding: 0.35rem 0.8rem;
  color: var(--ink);
}

.view-toggle button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

.crumbs {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.crumbs a {
  color: var(--accent-deep);
  font-weight: 650;
  text-decoration: none;
}

.crumbs a:hover { text-decoration: underline; }

.catalog h2 {
  margin: 1.75rem 0 0.6rem;
  font-size: 1.05rem;
  font-weight: 650;
}

.note,
.missing,
.item-id,
.pending {
  color: var(--muted);
  font-size: 0.92rem;
}

.catalog h3 {
  margin: 1.4rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 650;
}

.picks {
  list-style: none;
  margin: 0;
  padding: 0;
}

.view-list .picks li {
  border-top: 1px solid var(--line);
}

.view-gallery .picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.view-gallery .picks li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.pick {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0;
  color: inherit;
  text-decoration: none;
}

.view-gallery .pick {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  height: 100%;
  padding: 0;
}

.thumb {
  width: 3.25rem;
  height: 3.25rem;
  object-fit: cover;
  border-radius: 6px;
  background: var(--stage);
  flex: none;
}

.view-gallery .thumb {
  width: 100%;
  height: 9.5rem;
  border-radius: 0;
}

.pick-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.view-gallery .pick-text { padding: 0.75rem 0.85rem 0.9rem; }

.pick-title {
  color: var(--accent-deep);
  font-weight: 650;
}

.pick-blurb {
  color: var(--muted);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.view-gallery .pick-blurb { -webkit-line-clamp: 4; }

a.pick:hover .pick-title { text-decoration: underline; }

.shell {
  height: 100dvh;
  display: grid;
  grid-template-rows: 3rem minmax(0, 1fr);
  background: var(--paper);
}

.titlebar {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) minmax(0, 2fr) minmax(7rem, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.75rem;
  background: var(--ink);
  color: #fff;
}

.titlebar h1 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.path {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: 0;
}

.path-btn {
  display: inline-block;
  max-width: 12rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.path-btn:hover { background: rgba(255, 255, 255, 0.16); }

#exit { justify-self: start; }

.body { min-height: 0; }

.layout-side .body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(18rem, 22vw, 22rem);
}

.layout-bottom .body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 7.5rem;
}

/* Bottom look + ask: stage size stays put; panel overlays the bottom */
.layout-text .body,
.layout-bottom.layout-ask .body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.layout-text .stage-column,
.layout-bottom.layout-ask .stage-column {
  grid-area: 1 / 1;
  min-height: 0;
  /* Keep room for the step-nav strip so look→ask does not resize the picture */
  padding-bottom: 3.5rem;
}

.stage-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  background: var(--stage);
}

/* Minimal picture presentation (photos / illustrations). No border by default.
   Distinct from .compare-frame / .progress-frame used for pedagogy. */
.pic {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0.6rem 0.6rem 0.75rem;
  gap: 0.55rem;
  background: transparent;
  border: 0;
  container-type: size;
  container-name: pic;
}

.pic-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.pic-stage img,
.pic-stage svg,
.pic-media {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
  border: 0;
}

/* Inlined diagram SVGs: chrome and typography from the player stylesheet */
.pic-stage svg.inline-diagram,
.title-photo svg.inline-diagram {
  font-family: var(--font);
  --svg-label: var(--ink);
  --svg-label-muted: var(--muted);
  --svg-stage-fill: var(--stage);
  --svg-frame-fill: var(--card);
  --svg-frame-stroke: var(--line);
  --svg-frame-stroke-width: 3;
  --svg-panel-fill: #e7eeea;
  --svg-panel-stroke: var(--muted);
  --svg-panel-stroke-width: 2;
}

.pic-stage svg.inline-diagram text,
.title-photo svg.inline-diagram text {
  font-family: inherit;
  stroke: none;
}

.pic-stage svg.inline-diagram text.pic-label,
.title-photo svg.inline-diagram text.pic-label {
  font-weight: 650;
}

.pic-stage svg.inline-diagram .pic-label-plate,
.title-photo svg.inline-diagram .pic-label-plate {
  fill: rgba(255, 255, 255, 0.82);
  stroke: none;
  pointer-events: none;
}

.pic-stage svg.inline-diagram text.pic-label-ink,
.title-photo svg.inline-diagram text.pic-label-ink {
  fill: var(--svg-label);
}

.pic-stage svg.inline-diagram text.pic-label-muted,
.title-photo svg.inline-diagram text.pic-label-muted {
  fill: var(--svg-label-muted);
  font-weight: 400;
}

.pic-stage svg.inline-diagram .svg-stage-bg,
.title-photo svg.inline-diagram .svg-stage-bg {
  fill: var(--svg-stage-fill);
  stroke: none;
}

.pic-stage svg.inline-diagram .svg-frame,
.title-photo svg.inline-diagram .svg-frame {
  fill: var(--svg-frame-fill);
  stroke: var(--svg-frame-stroke);
  stroke-width: var(--svg-frame-stroke-width);
}

.pic-stage svg.inline-diagram .svg-frame-outline,
.title-photo svg.inline-diagram .svg-frame-outline {
  fill: none;
  stroke: var(--svg-frame-stroke);
  stroke-width: var(--svg-frame-stroke-width);
}

.pic-stage svg.inline-diagram .svg-panel,
.title-photo svg.inline-diagram .svg-panel {
  fill: var(--svg-panel-fill);
  stroke: var(--svg-panel-stroke);
  stroke-width: var(--svg-panel-stroke-width);
}

.pic.lights-off .pic-stage img,
.pic.lights-off .pic-stage svg image.photo {
  filter: brightness(0.28);
}

.pic.pair .pic-stage img {
  width: 48%;
  height: 100%;
}

.pic-caption {
  --pic-caption-scale: 1;
  flex: 0 1 auto;
  align-self: stretch;
  width: 100%;
  max-width: none;
  max-height: min(9rem, 22cqh);
  margin: 0;
  padding: 0.1rem clamp(1.25rem, 4vw, 3rem) 0.25rem;
  overflow: hidden;
  text-align: left;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.pic-caption:empty { display: none; }

/* Exit / return statement: centered over the picture */
.exit-statement {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  width: min(63rem, 96%);
  max-height: min(96%, 49rem);
  overflow: auto;
  padding: 2.35rem clamp(1.9rem, 5vw, 3rem);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 32px rgba(28, 36, 33, 0.14);
  text-align: center;
}

.exit-statement-title {
  margin: 0;
  font-size: clamp(2.6rem, 4.9vw, 3.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.exit-statement-body {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 1.4;
  color: var(--ink);
}

.exit-statement-title + .exit-statement-body {
  margin-top: 0.65rem;
}

.exit-statement-body .card-line {
  margin: 0;
}

.exit-statement-body .card-line + .card-line {
  margin-top: 0.45rem;
}

.exit-statement-body .card-list {
  display: inline-block;
  margin: 0.55rem auto 0;
  padding-left: 1.35rem;
  text-align: left;
}

.exit-statement-body .card-list + .card-line,
.exit-statement-body .card-line + .card-list {
  margin-top: 0.55rem;
}

.exit-statement-body strong {
  font-weight: 750;
}

.exit-statement-body em {
  font-style: italic;
}

.exit-statement-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 0;
  padding: 2rem clamp(1rem, 4vw, 3rem);
  background: var(--stage);
}

.exit-statement-stage .exit-statement {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  max-height: none;
}

.pic-title {
  margin: 0;
  padding: 0;
  font-size: calc(clamp(1.45rem, 2.6vw, 2rem) * var(--pic-caption-scale));
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.pic-desc {
  margin: 0.45rem 0 0;
  font-size: calc(clamp(1.35rem, 2.4vw, 1.85rem) * var(--pic-caption-scale));
  line-height: 1.4;
  color: var(--ink);
  text-align: left;
}

.pic-title + .pic-desc { margin-top: 0.5rem; }

.pic-desc .card-line + .card-line { margin-top: 0.45rem; }

.pic-desc:empty { display: none; }

/* Pedagogical frames: comparison / progression. Explicit edge; not for photos. */
.compare-frame,
.progress-frame {
  box-sizing: border-box;
  border: 1px solid var(--ink);
  background: var(--card);
}

.marks {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.marks span {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0.15rem 0.25rem;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ink);
  box-shadow: none;
}

.stage > canvas,
.stage > svg,
.stage > video,
.stage > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.controls,
.explore {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  padding: 0.45rem 0.75rem;
  background: var(--card);
  border-top: 1px solid var(--line);
}

.controls:empty,
.controls[hidden],
.explore[hidden] { display: none; }

.panel {
  min-width: 0;
  min-height: 0;
  background: var(--card);
}

.layout-side .panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-left: 1px solid var(--line);
}

.layout-bottom .panel {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
}

.layout-text .panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
}

/* Ask: compact card at bottom-right (~¼ slide, wide enough for choices) */
.layout-bottom.layout-ask .panel {
  position: absolute;
  left: auto;
  right: 1rem;
  bottom: 1rem;
  z-index: 3;
  width: clamp(17rem, 26vw, 22rem);
  max-width: calc(100% - 2rem);
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  padding: 1.15rem 1rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
  box-shadow: 0 10px 28px rgba(28, 36, 33, 0.14);
  overflow: visible;
  will-change: transform;
}

/* Preserve picture layout on ask; drawer covers the caption */
.layout-ask .pic-caption {
  visibility: hidden;
}

.ask-coach {
  position: absolute;
  top: 0;
  left: 0.75rem;
  right: 0.75rem;
  height: 0;
  z-index: 2;
  pointer-events: none;
}

.ask-buddy {
  position: absolute;
  top: 0;
  left: 0;
  width: 2.75rem;
  height: 2.75rem;
  transform: translateY(-52%);
  filter: drop-shadow(0 2px 4px rgba(28, 36, 33, 0.12));
}

.ask-buddy svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ask-bubble {
  position: absolute;
  left: 0;
  bottom: calc(100% + 1.55rem);
  width: max-content;
  max-width: min(20rem, 42vw, calc(100% + 4rem));
  padding: 0.55rem 0.7rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--predict-bg);
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.4;
  box-shadow: 0 4px 14px rgba(28, 36, 33, 0.1);
  transform-origin: 1.1rem bottom;
}

.ask-bubble::after {
  content: "";
  position: absolute;
  left: 1.05rem;
  bottom: -0.45rem;
  width: 0.7rem;
  height: 0.7rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--predict-bg);
  transform: rotate(45deg);
}

.ask-bubble-copy {
  margin: 0;
}

.ask-bubble-copy .card-line + .card-line {
  margin-top: 0.35rem;
}

.ask-bubble.ask-bubble-pop {
  animation: ask-bubble-in 0.22s ease-out;
}

@keyframes ask-bubble-in {
  from {
    opacity: 0;
    transform: translateY(0.35rem) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ask-bubble.ask-bubble-pop { animation: none; }
}

.layout-ask .card {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  margin: 0;
  padding: 0.55rem 0.15rem 0.15rem;
  border-radius: 0;
  border-left: 0;
  background: transparent;
}

.layout-ask .card.predict,
.layout-ask .card.notice {
  background: transparent;
}

.layout-ask .card.predict {
  border-left: 3px solid var(--predict-edge);
  padding-left: 0.7rem;
}

.layout-ask .card.notice {
  border-left: 3px solid var(--notice-edge);
  padding-left: 0.7rem;
}

.layout-ask .card-text,
.layout-ask .card-text.full {
  display: block;
  max-height: none;
  overflow: visible;
  -webkit-line-clamp: unset;
  font-size: clamp(1.02rem, 1.5vw, 1.15rem);
  line-height: 1.45;
}

.layout-ask .choices {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
}

.layout-ask .choice {
  width: 100%;
  border-radius: 0.65rem;
  white-space: normal;
  text-align: left;
}

.layout-ask .step-nav {
  flex: none;
  margin-top: 0;
  padding-top: 0.15rem;
}

.layout-ask .chapter-jump {
  justify-content: flex-start;
}

@media (max-width: 720px) {
  .layout-bottom.layout-ask .panel {
    right: 0.65rem;
    left: 0.65rem;
    bottom: 0.65rem;
    width: auto;
    max-width: none;
  }
}

.card {
  min-width: 0;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border-left: 3px solid transparent;
}

.layout-side .card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.layout-bottom .card { flex: 1; }

.card.predict {
  background: var(--predict-bg);
  border-left-color: var(--predict-edge);
}

.card.notice {
  background: var(--notice-bg);
  border-left-color: var(--notice-edge);
}

.card-label {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-label:empty { display: none; }

.card-text {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.layout-bottom .card-text { -webkit-line-clamp: 2; }

.layout-bottom.layout-ask .card-text,
.layout-bottom.layout-ask .card-text.full {
  -webkit-line-clamp: unset;
  max-height: none;
  overflow: visible;
}

.layout-side .card-text {
  display: block;
  overflow: auto;
  -webkit-line-clamp: unset;
}

.card-text.full {
  display: block;
  min-height: 0;
  overflow: auto;
  -webkit-line-clamp: unset;
}

.card-line { margin: 0; }

.title-screen {
  position: absolute;
  z-index: 2;
  inset: 3rem 0 0;
  overflow: hidden;
  background: var(--stage);
}

.title-photo,
.title-photo img,
.title-photo svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.title-photo img,
.title-photo svg {
  object-fit: cover;
  display: block;
}

.title-copy {
  position: absolute;
  left: 4vw;
  right: max(4vw, 8rem);
  bottom: 5.5rem;
  max-width: 42rem;
  padding: 1.35rem 1.6rem 1.5rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.show-title {
  margin: 0;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  line-height: 1.1;
  font-weight: 700;
}

.show-subtitle {
  margin: 0.55rem 0 0;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.35;
}

.show-description {
  margin-top: 0.9rem;
  font-size: 1.2rem;
  line-height: 1.45;
}

.show-description .card-line + .card-line { margin-top: 0.45rem; }

.shell.title-open .body { visibility: hidden; }

.shell.title-open .step-nav {
  visibility: visible;
  position: absolute;
  z-index: 3;
  right: 1.25rem;
  bottom: 1.25rem;
  margin: 0;
  padding: 0.35rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(8px);
}

.card-copy .card-line + .card-line,
.card-hint .card-line + .card-line { margin-top: 0.45rem; }

.card-list {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.card-list li + li { margin-top: 0.2rem; }

.card-hint {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.card-answer {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.75rem;
  padding: 0.65rem 0.7rem;
  border-radius: 0.7rem;
  background: var(--notice-bg);
  color: var(--accent-deep);
  border: 1px solid color-mix(in srgb, var(--notice-edge) 35%, transparent);
}

.card-answer-mark {
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.1rem;
  color: var(--notice-edge);
}

.card-answer-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.card-answer-body {
  min-width: 0;
  flex: 1;
  font-weight: 650;
}

.card-answer-body .card-line,
.card-answer-body .card-copy {
  margin: 0;
}

.card-answer-body .card-line + .card-line,
.card-answer-body .card-copy .card-line + .card-line {
  margin-top: 0.35rem;
}

.layout-ask .card-answer {
  background: #e7f3ee;
  color: var(--accent-deep);
}

.card .choices {
  flex-direction: column;
  align-items: stretch;
  margin-top: 0.55rem;
}

.card .choice { text-align: left; }

.card .continue { margin-top: 0.55rem; }

.stage > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.layout-text .panel {
  display: flex;
  justify-content: flex-end;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.layout-text .card { display: none; }

/* Teaching text on the left; picture/model on the right */
.layout-teach-left .body {
  display: grid;
  grid-template-columns: minmax(18rem, 36%) minmax(0, 1fr);
  grid-template-areas: "panel stage";
}

.layout-teach-left .stage-column {
  grid-area: stage;
  min-width: 0;
  min-height: 0;
}

.layout-teach-left .panel {
  grid-area: panel;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  min-height: 0;
  padding: 1.25rem clamp(1rem, 3vw, 2rem) 1rem;
  border-left: none;
  border-right: 1px solid var(--line);
  background: var(--card);
}

.layout-teach-left .card.teach-panel {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: auto;
}

.layout-teach-left .card.teach-panel .card-label { display: none; }

.layout-teach-left .card.teach-panel .card-text,
.layout-teach-left .card.teach-panel .teach-copy {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.layout-teach-left .card.teach-panel .pic-title,
.layout-teach-left .card.teach-panel .pic-desc {
  text-align: left;
}

.layout-teach-left .step-nav { margin-top: auto; }

.layout-teach-left .chapter-jump { justify-content: flex-start; }

@media (max-width: 720px) {
  .layout-teach-left .body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "stage" "panel";
  }

  .layout-teach-left .panel {
    border-right: none;
    border-top: 1px solid var(--line);
    max-height: 40%;
  }
}

.slide-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.8rem;
  height: 100%;
  padding: 2.5rem 8vw;
  background: var(--card);
}

.slide-kicker,
.slide-text .kicker,
.kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
}

.slide-title {
  margin: 0 auto;
  max-width: 38rem;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--ink);
}

.slide-body,
.slide-text > p {
  margin: 0 auto;
  max-width: 38rem;
  font-size: clamp(1.45rem, 2.6vw, 2.15rem);
  line-height: 1.35;
  text-align: center;
}

.slide-kicker + .slide-title,
.slide-kicker + .slide-body,
.kicker + .slide-title,
.kicker + .slide-body { margin-top: 0; }

.slide-title + .slide-body { margin-top: 0.35rem; }

.ask, .follow { margin: 0 0 0.45rem; }

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.choice {
  min-height: 2.25rem;
  padding: 0.2rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}

.choice.is-fit { border-color: var(--accent); }

.choice.is-picked { background: var(--accent-soft, #e6f3ee); }

.term {
  padding: 0;
  border: none;
  border-bottom: 1px dotted var(--accent);
  background: none;
  color: inherit;
  font: inherit;
  cursor: help;
}

.gloss {
  position: fixed;
  z-index: 5;
  max-width: 16rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 0.92rem;
  line-height: 1.35;
}

.paper-view {
  position: absolute;
  z-index: 4;
  inset: 3rem 0 0;
  overflow: auto;
  padding: 1.5rem 8vw 3rem;
  background: var(--paper);
}

.shell { position: relative; }

.paper-view h1 {
  margin: 0 0 0.75rem;
  font-size: 1.6rem;
}

.paper-view h2 {
  margin: 1.4rem 0 0.4rem;
  font-size: 1.15rem;
}

.paper-view p { max-width: 40rem; }

.paper-view img {
  display: block;
  width: min(100%, 40rem);
  height: auto;
  margin: 0.6rem 0 1rem;
  background: var(--card);
  border: 1px solid var(--line);
}

.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.layout-side .step-nav { margin-top: auto; }

.layout-side.layout-text-primary .body {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.layout-side.layout-text-primary .stage-column { display: none; }

.layout-side.layout-text-primary .panel {
  border-left: none;
  justify-content: center;
  padding: 2rem 8vw 1.25rem;
}

.layout-side.layout-text-primary .card {
  flex: 1;
  justify-content: center;
  width: min(100%, 42rem);
  margin: 0 auto;
}

.layout-side.layout-text-primary .card-text {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.45;
}

.chapter-jump {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.chapter-jump[hidden] { display: none; }

.jump-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.35rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(28, 36, 33, 0.08);
}

.jump-btn:hover { background: var(--paper); }

.layout-bottom .step-nav { flex: none; }

.step-nav span {
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.icon-btn {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
}

.icon-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (max-width: 720px) {
  .layout-side .body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) 7.5rem;
  }

  .layout-side .panel {
    border-left: none;
    border-top: 1px solid var(--line);
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1rem;
  }

  .layout-side .step-nav { margin-top: 0; }

  .layout-side.layout-text-primary .body {
    grid-template-rows: minmax(0, 1fr);
  }

  .layout-side.layout-text-primary .panel {
    flex-direction: column;
    align-items: stretch;
    border-top: none;
  }

  .layout-side.layout-text-primary .step-nav { margin-top: auto; }
}

body:has(.catalog.story-home) {
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.catalog.story-home {
  max-width: none;
  width: 100%;
  min-width: 34rem;
  height: 100dvh;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-rows: 3rem auto minmax(0, 1fr);
  overflow-x: auto;
  overflow-y: hidden;
}

.story-home .view-toggle { display: none; }

.story-home .catalog-head {
  grid-row: 1;
  margin: 0;
  padding: 0 0.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  background: var(--ink);
  color: #fff;
}

.story-home .catalog-head h1 {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0;
  text-align: center;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-home .story-bar {
  grid-column: 1;
  grid-row: 1;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.72);
}

.story-home .story-back {
  flex: none;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

.story-home .story-back:hover { background: rgba(255, 255, 255, 0.22); }

.story-home .story-back svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.story-home .story-trail {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.story-home .story-trail a {
  color: #fff;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
}

.story-home .story-trail a:hover { text-decoration: underline; }

.story-home .crumb-sep { flex: none; }

.story-home .here {
  color: #fff;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-lead {
  flex: none;
  margin: 0 0 0.9rem;
  padding: 0.15rem 0 0;
}

.story-question {
  margin: 0;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(31, 77, 58, 0.28);
  color: var(--ink);
  font-size: 1.28rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.story-lead .opening {
  margin: 0.65rem 0 0;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(31, 77, 58, 0.28);
  max-width: 44rem;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.5;
}

.story-home #catalog-list {
  grid-row: 3;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.65rem 1.25rem 1rem;
  overflow: hidden;
}

.story-home .opening {
  flex: none;
  max-width: 44rem;
}

.story-home .story-split {
  flex: 1;
  min-height: 0;
  margin: 0;
  align-items: stretch;
  overflow: hidden;
  grid-template-columns: minmax(15rem, 1.7fr) minmax(16rem, 0.9fr);
}

.story-gallery,
.story-studies {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.story-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  align-items: start;
  gap: 0.75rem;
  padding: 3px;
  min-width: 15rem;
  overflow: auto;
}

.opening {
  max-width: 40rem;
  margin: 0.85rem 0 0;
}

.story-split {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 0.9fr);
  gap: 1.25rem;
  align-items: start;
  margin-top: 1.25rem;
}

.chapter-card {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: min-content;
  height: auto;
  cursor: pointer;
}

.chapter-card.selected {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 3px var(--ink);
}

.thumb-frame {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--stage);
  overflow: hidden;
}

.thumb-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.chapter-card .play {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(28, 36, 33, 0.28);
}

.chapter-card .play svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  margin-left: 0.12rem;
}

.chapter-card .play:hover { background: var(--accent-deep); }

.chapter-card .text {
  padding: 0.7rem 0.8rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.chapter-card h2 {
  margin: 0;
  min-height: 2.5em;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chapter-card .question {
  margin: 0;
  min-height: 4.05em;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-studies h2,
.exit-studies h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 650;
}

.study-group {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.55rem 0.7rem 0.7rem;
  margin: 0 0 0.45rem;
}

.study-group.selected {
  background: var(--card);
  border-color: var(--ink);
}

.study-group h3 { margin: 0; font-size: 1rem; font-weight: 650; }

.study-group h3 button {
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
}

.study-area {
  margin: 0.45rem 0 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.study-group ul,
.exit-studies ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.study-group li,
.exit-studies li { margin: 0.35rem 0 0; }

.study-group a,
.exit-studies a,
.study-row {
  color: inherit;
  line-height: 1.3;
}

.study-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  text-decoration: none;
}

a.study-row:hover .study-title { text-decoration: underline; }

.study-thumb {
  flex: none;
  width: 3.75rem;
  height: 3.75rem;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--card);
}

.study-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.study-title { font-weight: 650; }

.study-question {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.exit-studies { margin-top: 1rem; }

@media (max-width: 860px) {
  .catalog.story-home { min-width: 18rem; }

  .story-home .story-split {
    grid-template-columns: minmax(15rem, 1fr);
    grid-template-rows: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }
}
