/*
 * Layout for the ten-ring review's text, which the visual lane's stylesheets do
 * not cover yet (they style the ring tabs and banners through the shared
 * tree-rings__* classes). Uses the design tokens only; the visual lane may move
 * or replace these rules at integration.
 */
.ring-panel {
  min-width: 0;
}

.ring-panel__theme,
.ring-memory__theme,
.ring-memory__question {
  font-size: var(--text-small, 0.92rem);
  color: var(--ink-secondary, #485d50);
}

.ring-memory {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md, 16px);
  border: 1px solid var(--border-hairline, rgba(142, 106, 80, 0.22));
  background: var(--surface-card, rgba(253, 251, 245, 0.94));
}

.ring-memory p,
.ring-memory h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.ring-memory__title {
  font-family: var(--font-serif, Georgia, serif);
  font-size: var(--text-h3, 1.2rem);
  font-weight: 500;
  color: var(--ink-heading, #304b3b);
}

.ring-memory__choice {
  font-weight: 600;
}

.ring-memory__context,
.ring-echo {
  font-family: var(--font-serif, Georgia, serif);
  font-style: italic;
}

.ring-memory__echoes {
  margin: 0;
  padding: 0 0 0 0.9rem;
  border-left: 2.5px solid var(--color-dusty-blue-deep, #3f5d64);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
}

.ring-echo__source {
  font-style: normal;
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: var(--text-small, 0.92rem);
  color: var(--ink-muted, #5b5348);
}

.ring-memory__archived-title,
.ring-panel__final-title {
  font-size: var(--text-small, 0.92rem);
  font-weight: 600;
  color: var(--ink-muted, #5b5348);
  margin: 0 0 0.3rem;
}

.ring-panel__final {
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-hairline, rgba(142, 106, 80, 0.22));
}

.ring-panel__reflection {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.78rem 0.98rem;
  border-radius: var(--radius-sm, 10px);
  background: var(--surface-inset, rgba(239, 236, 225, 0.72));
  border-left: 3px solid var(--color-gold, #c3a16a);
}

.ring-panel__reflection-title {
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  color: var(--color-bark-deep, #5e4331);
  margin: 0;
}

.ring-panel__reflection-question {
  font-family: var(--font-serif, Georgia, serif);
  font-style: italic;
  color: var(--ink-heading, #304b3b);
  margin: 0;
}

.ring-memory__disclosure {
  width: 100%;
}

.ring-memory__summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ring-memory__summary::-webkit-details-marker {
  display: none;
}

.ring-memory__summary::after {
  content: '+';
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.2rem;
  color: var(--color-bark-deep, #5e4331);
  flex-shrink: 0;
}

.ring-memory__disclosure[open] > .ring-memory__summary::after {
  content: '−';
}

.ring-memory__body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-hairline, rgba(142, 106, 80, 0.22));
}

.memory-ledger {
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md, 16px);
  border: 1px solid var(--border-hairline, rgba(142, 106, 80, 0.22));
  background: var(--surface-paper, rgba(253, 251, 245, 0.88));
}

.memory-ledger__summary {
  cursor: pointer;
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink-heading, #304b3b);
}

.memory-ledger__chapter {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-hairline, rgba(142, 106, 80, 0.22));
}

.memory-ledger__list {
  margin: 0.6rem 0 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.memory-ledger__when {
  font-weight: 600;
  font-size: var(--text-small, 0.92rem);
  color: var(--ink-heading, #304b3b);
}
/*
 * Seed ritual motion only. Colours come from theme custom properties when the
 * visual lane defines them, with the Production Bible palette as fallback.
 * Layout, typography and buttons are intentionally left to src/styles.
 */
.seed-ritual__art {
  display: block;
  width: min(100%, 18rem);
  height: auto;
  margin-inline: auto;
}

.seed-ritual__soil,
.seed-ritual__soil-line,
.seed-ritual__seed,
.seed-ritual__roots {
  color: var(--gyot-bark, #8e6a50);
}

.seed-ritual__sprout {
  color: var(--gyot-sage, #718c78);
}

.seed-ritual__art[data-animate='true'] .seed-ritual__seed.is-planted {
  animation: seed-ritual-drop 900ms cubic-bezier(0.3, 0.7, 0.4, 1) both;
}

.seed-ritual__art[data-animate='true'] .seed-ritual__roots path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: seed-ritual-draw 900ms ease-out forwards;
}

.seed-ritual__art[data-animate='true'] .seed-ritual__sprout {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: seed-ritual-sprout 900ms ease-out both;
}

.seed-ritual__sequence ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.seed-ritual__sequence-step {
  display: grid;
  gap: 0.25rem;
  justify-items: center;
  text-align: center;
}

@keyframes seed-ritual-drop {
  from {
    transform: translateY(-92px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes seed-ritual-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes seed-ritual-sprout {
  from {
    opacity: 0;
    transform: scaleY(0);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .seed-ritual *,
  .seed-ritual *::before,
  .seed-ritual *::after {
    animation: none !important;
    transition: none !important;
  }

  .seed-ritual__art .seed-ritual__roots path {
    stroke-dashoffset: 0;
  }
}
:root {
  /* Production Bible core palette */
  --color-ivory: #f7f5ed;
  --color-parchment: #fdfbf5;
  --color-linen: #efece1;
  --color-forest: #304b3b;
  --color-forest-deep: #22382b;
  --color-sage: #718c78;
  --color-sage-deep: #486250;
  --color-sage-wash: rgba(113, 140, 120, 0.12);
  --color-gold: #c3a16a;
  --color-gold-deep: #7f6132;
  --color-gold-wash: rgba(195, 161, 106, 0.16);
  --color-dusty-blue: #8fa8ae;
  --color-dusty-blue-deep: #3f5d64;
  --color-dusty-blue-wash: rgba(143, 168, 174, 0.16);
  --color-bark: #8e6a50;
  --color-bark-deep: #5e4331;
  --color-bark-wash: rgba(142, 106, 80, 0.11);

  /* Semantic ink & surface roles */
  --ink-primary: var(--color-forest-deep);
  --ink-heading: var(--color-forest);
  --ink-secondary: #485d50;
  --ink-muted: #5b5348;
  --surface-paper: rgba(253, 251, 245, 0.88);
  --surface-card: rgba(253, 251, 245, 0.94);
  --surface-inset: rgba(239, 236, 225, 0.72);
  --border-hairline: rgba(142, 106, 80, 0.22);
  --border-strong: rgba(48, 75, 59, 0.34);

  /* Local literary serif + readable humanist sans stacks (zero network fonts) */
  --font-serif: 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Avenir Next', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;

  /* Fluid typographic hierarchy */
  --text-display: clamp(2rem, 1.55rem + 2vw, 3.15rem);
  --text-h2: clamp(1.45rem, 1.2rem + 1.05vw, 2.05rem);
  --text-h3: clamp(1.15rem, 1.05rem + 0.45vw, 1.4rem);
  --text-body: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --text-small: 0.92rem;
  --text-eyebrow: 0.78rem;

  /* Reading measure: strictly within 45ch - 68ch */
  --measure-min: 45ch;
  --measure-ideal: 60ch;
  --measure-max: 66ch;

  /* Radii & elevation */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-plate: 0 18px 42px -28px rgba(48, 75, 59, 0.28), 0 2px 10px -4px rgba(94, 67, 49, 0.1);
  --shadow-soft: 0 8px 22px -16px rgba(48, 75, 59, 0.24);

  /* Motion rhythm (Production Bible Section G) */
  --ease-organic: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-mark: 680ms;
  --dur-transition: 820ms;
  --dur-breeze: 5200ms;
}
/* ==========================================================================
   App Shell & Storybook Screen System
   Shared class contract: app-shell, screen, story-layout, story-stage,
   story-panel, choice-list, choice-button, consequence-panel, rings-layout,
   final-tree.
   ========================================================================== */

.app-shell {
  position: relative;
  min-height: 100dvh;
  width: 100%;
  padding: clamp(1rem, 2.5vw, 2.25rem) clamp(0.9rem, 3vw, 2.5rem) clamp(2rem, 4vw, 3.5rem);
  background-color: var(--color-ivory);
  background-image:
    url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='240'%20height='240'%20viewBox='0%200%20240%20240'%3e%3cdefs%3e%3cfilter%20id='paperNoise'%20x='0%25'%20y='0%25'%20width='100%25'%20height='100%25'%3e%3cfeTurbulence%20type='fractalNoise'%20baseFrequency='0.78'%20numOctaves='4'%20seed='17'%20stitchTiles='stitch'%20/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.56%200%200%200%200%200.45%200%200%200%200%200.34%200%200%200%200.055%200'%20/%3e%3c/filter%3e%3c/defs%3e%3crect%20width='240'%20height='240'%20fill='%23F7F5ED'%20fill-opacity='0'%20/%3e%3crect%20width='240'%20height='240'%20filter='url(%23paperNoise)'%20/%3e%3c/svg%3e"),
    url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201200%20800'%20preserveAspectRatio='xMidYMid%20slice'%3e%3cdefs%3e%3cradialGradient%20id='washSage'%20cx='18%25'%20cy='16%25'%20r='48%25'%3e%3cstop%20offset='0%25'%20stop-color='%23718C78'%20stop-opacity='0.13'%20/%3e%3cstop%20offset='65%25'%20stop-color='%23718C78'%20stop-opacity='0.04'%20/%3e%3cstop%20offset='100%25'%20stop-color='%23F7F5ED'%20stop-opacity='0'%20/%3e%3c/radialGradient%3e%3cradialGradient%20id='washBlue'%20cx='84%25'%20cy='18%25'%20r='46%25'%3e%3cstop%20offset='0%25'%20stop-color='%238FA8AE'%20stop-opacity='0.14'%20/%3e%3cstop%20offset='62%25'%20stop-color='%238FA8AE'%20stop-opacity='0.04'%20/%3e%3cstop%20offset='100%25'%20stop-color='%23F7F5ED'%20stop-opacity='0'%20/%3e%3c/radialGradient%3e%3cradialGradient%20id='washGold'%20cx='56%25'%20cy='84%25'%20r='52%25'%3e%3cstop%20offset='0%25'%20stop-color='%23C3A16A'%20stop-opacity='0.14'%20/%3e%3cstop%20offset='60%25'%20stop-color='%23C3A16A'%20stop-opacity='0.04'%20/%3e%3cstop%20offset='100%25'%20stop-color='%23F7F5ED'%20stop-opacity='0'%20/%3e%3c/radialGradient%3e%3cradialGradient%20id='washBark'%20cx='16%25'%20cy='88%25'%20r='40%25'%3e%3cstop%20offset='0%25'%20stop-color='%238E6A50'%20stop-opacity='0.09'%20/%3e%3cstop%20offset='100%25'%20stop-color='%23F7F5ED'%20stop-opacity='0'%20/%3e%3c/radialGradient%3e%3c/defs%3e%3crect%20width='1200'%20height='800'%20fill='%23F7F5ED'%20/%3e%3crect%20width='1200'%20height='800'%20fill='url(%23washSage)'%20/%3e%3crect%20width='1200'%20height='800'%20fill='url(%23washBlue)'%20/%3e%3crect%20width='1200'%20height='800'%20fill='url(%23washGold)'%20/%3e%3crect%20width='1200'%20height='800'%20fill='url(%23washBark)'%20/%3e%3c/svg%3e");
  background-size: 240px 240px, cover;
  background-repeat: repeat, no-repeat;
  background-position: top left, center top;
  display: flex;
  flex-direction: column;
  align-items: center;
  isolation: isolate;
}

.app-shell > header,
.app-shell > nav,
.app-shell > main,
.app-shell > footer,
.app-shell > .screen {
  width: min(1160px, 100%);
}

/* Quiet top navigation bar if rendered inside app-shell */
.app-shell > header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding-bottom: 1rem;
  margin-bottom: clamp(1rem, 2.4vw, 2rem);
  border-bottom: 1px solid var(--border-hairline);
}

.app-shell[data-screen='landing'] > header {
  display: none;
}

.app-brand {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-heading);
  margin: 0;
}

.app-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.app-shell > header a,
.app-shell > header button {
  font-size: var(--text-small);
}

/* Primary storybook screen container */
.screen {
  width: min(1120px, 100%);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vw, 2rem);
  animation: screenSettle var(--dur-transition) var(--ease-organic) both;
}

/* Editorial folio framing for opening, invitation, seed ritual, and chapter passages */
.screen--landing,
.screen--invitation,
.screen--seed {
  width: min(720px, 100%);
  margin-block: auto;
  padding: clamp(2rem, 4.5vw, 3.35rem) clamp(1.4rem, 4.5vw, 3.25rem);
  border-radius: var(--radius-lg);
  background: var(--surface-paper);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-plate);
  align-items: center;
  text-align: center;
}

.screen--landing {
  width: min(760px, 100%);
}

.screen--landing h1,
.screen--invitation h1,
.screen--seed h1,
.screen--passage h1 {
  max-width: 24ch;
}

.landing__subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.18rem, 1.05rem + 0.5vw, 1.48rem);
  line-height: 1.38;
  color: var(--ink-secondary);
}

.landing__tagline {
  font-size: var(--text-small);
  letter-spacing: 0.02em;
  color: var(--color-bark-deep);
}

.landing__thesis {
  text-align: left;
  width: min(100%, var(--measure-ideal));
}

.landing__note {
  font-size: var(--text-small);
  color: var(--ink-secondary);
}

.landing__notice {
  width: min(100%, var(--measure-ideal));
  padding: 0.85rem 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(142, 106, 80, 0.32);
  border-left: 3.5px solid var(--color-bark);
  background: var(--color-bark-wash);
  text-align: left;
  font-size: var(--text-small);
  color: var(--ink-primary);
}

.screen--invitation {
  gap: clamp(1.4rem, 3vw, 2.25rem);
}

.screen--invitation::before {
  content: '';
  display: block;
  width: min(180px, 60%);
  height: 22px;
  background: url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20220%2028'%20fill='none'%3e%3cpath%20d='M12%2014%20C48%2014,%2072%2013,%20110%2014%20C148%2015,%20172%2014,%20208%2014'%20stroke='%238E6A50'%20stroke-opacity='0.38'%20stroke-width='1.2'%20stroke-linecap='round'%20/%3e%3cpath%20d='M96%2014%20C101%208,%20108%206,%20114%208%20C110%2013,%20104%2015,%2096%2014%20Z'%20fill='%23718C78'%20fill-opacity='0.58'%20/%3e%3cpath%20d='M124%2014%20C119%2020,%20112%2022,%20106%2020%20C110%2015,%20116%2013,%20124%2014%20Z'%20fill='%23718C78'%20fill-opacity='0.46'%20/%3e%3ccircle%20cx='110'%20cy='14'%20r='2.6'%20fill='%23C3A16A'%20fill-opacity='0.82'%20/%3e%3ccircle%20cx='82'%20cy='14'%20r='1.4'%20fill='%238FA8AE'%20fill-opacity='0.6'%20/%3e%3ccircle%20cx='138'%20cy='14'%20r='1.4'%20fill='%238FA8AE'%20fill-opacity='0.6'%20/%3e%3c/svg%3e") center / contain no-repeat;
  opacity: 0.85;
}

.invitation__lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
}

.invitation__lines p {
  font-family: var(--font-serif);
  font-size: clamp(1.08rem, 1rem + 0.35vw, 1.24rem);
  line-height: 1.75;
  color: var(--ink-primary);
  max-width: 48ch;
}

.seed-ritual__figure,
.seed-ritual__sequence {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: rgba(253, 251, 245, 0.72);
  border: 1px solid rgba(142, 106, 80, 0.16);
}

.seed-ritual__status {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-secondary);
}

.seed-ritual__skip-row,
.seed-ritual__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.screen--passage {
  width: min(800px, 100%);
  padding: clamp(1.5rem, 3.5vw, 2.75rem) clamp(1.25rem, 4vw, 2.75rem);
  border-radius: var(--radius-lg);
  background: var(--surface-paper);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-plate);
  align-items: center;
  gap: clamp(1rem, 2.2vw, 1.5rem);
}

.chapter-passage__ended {
  font-size: var(--text-small);
  font-style: italic;
  color: var(--ink-muted);
  text-align: center;
}

.chapter-passage__eyebrow {
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--color-bark-deep);
  text-align: center;
}

.chapter-passage__title {
  text-align: center;
}

.chapter-passage__details {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.06rem, 1rem + 0.3vw, 1.22rem);
  color: var(--ink-secondary);
  text-align: center;
}

.chapter-passage__events,
.chapter-passage__memories {
  width: min(100%, var(--measure-max));
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chapter-passage__events h2,
.chapter-passage__memories h2 {
  font-size: var(--text-h3);
}

.chapter-passage__background {
  width: min(100%, var(--measure-ideal));
}

.chapter-passage__theme {
  width: min(100%, var(--measure-ideal));
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-secondary);
  padding-top: 0.35rem;
  border-top: 1px solid var(--border-hairline);
}

.passage-memory-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.passage-memory {
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  font-size: var(--text-small);
  line-height: 1.5;
}

.passage-memory__when {
  font-weight: 600;
  color: var(--ink-heading);
}

/* Alerts & Reset controls */
.app-alerts {
  width: min(1120px, 100%);
  margin: 0 auto 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.app-alert {
  padding: 0.85rem 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(63, 93, 100, 0.32);
  border-left: 3.5px solid var(--color-dusty-blue-deep);
  background: rgba(253, 251, 245, 0.96);
  box-shadow: var(--shadow-soft);
  color: var(--ink-primary);
  font-size: var(--text-small);
  line-height: 1.52;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.app-alert p {
  font-size: var(--text-small);
  line-height: 1.52;
  max-width: var(--measure-max);
}

.app-alert--error {
  border-color: rgba(142, 106, 80, 0.45);
  border-left-color: var(--color-bark-deep);
  background: linear-gradient(155deg, rgba(253, 251, 245, 0.98), rgba(244, 235, 224, 0.94));
}

.app-alert--warning {
  border-color: rgba(195, 161, 106, 0.48);
  border-left-color: var(--color-gold-deep);
  background: linear-gradient(155deg, rgba(253, 251, 245, 0.98), rgba(246, 240, 226, 0.92));
}

.app-alert__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.app-alert__actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background-color: var(--surface-card);
  color: var(--color-forest);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
}

.app-alert__actions button:hover:not(:disabled) {
  background-color: var(--color-linen);
  border-color: var(--color-forest);
  color: var(--color-forest-deep);
}

.reset-control {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}

.reset-control--confirming {
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(142, 106, 80, 0.34);
  background: var(--surface-card);
  box-shadow: var(--shadow-soft);
}

.reset-control__message {
  flex: 1 1 240px;
  font-size: var(--text-small);
  line-height: 1.45;
  color: var(--ink-secondary);
}

/* Typography hierarchy inside storybook screens */
.screen h1,
.app-shell h1 {
  font-family: var(--font-serif);
  font-size: var(--text-display);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.012em;
  color: var(--ink-heading);
  margin: 0;
  max-width: 24ch;
  text-wrap: balance;
}

.screen h2,
.app-shell h2 {
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.008em;
  color: var(--ink-heading);
  margin: 0;
  text-wrap: balance;
}

.screen h3,
.app-shell h3 {
  font-family: var(--font-serif);
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-heading);
  margin: 0;
}

.screen p,
.app-shell p {
  font-size: var(--text-body);
  line-height: 1.72;
  color: var(--ink-primary);
  margin: 0;
  max-width: var(--measure-ideal);
}

.screen blockquote,
.app-shell blockquote {
  margin: 0;
  padding: 1rem 1.25rem;
  max-width: var(--measure-ideal);
  background: linear-gradient(135deg, rgba(253, 251, 245, 0.92), rgba(239, 236, 225, 0.65));
  border-left: 3px solid var(--color-gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-serif);
  font-size: clamp(1.06rem, 1rem + 0.3vw, 1.2rem);
  font-style: italic;
  line-height: 1.65;
  color: var(--ink-heading);
}

.screen hr,
.app-shell hr {
  border: 0;
  height: 24px;
  width: min(220px, 100%);
  margin: 0.75rem 0;
  background: url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20220%2028'%20fill='none'%3e%3cpath%20d='M12%2014%20C48%2014,%2072%2013,%20110%2014%20C148%2015,%20172%2014,%20208%2014'%20stroke='%238E6A50'%20stroke-opacity='0.38'%20stroke-width='1.2'%20stroke-linecap='round'%20/%3e%3cpath%20d='M96%2014%20C101%208,%20108%206,%20114%208%20C110%2013,%20104%2015,%2096%2014%20Z'%20fill='%23718C78'%20fill-opacity='0.58'%20/%3e%3cpath%20d='M124%2014%20C119%2020,%20112%2022,%20106%2020%20C110%2015,%20116%2013,%20124%2014%20Z'%20fill='%23718C78'%20fill-opacity='0.46'%20/%3e%3ccircle%20cx='110'%20cy='14'%20r='2.6'%20fill='%23C3A16A'%20fill-opacity='0.82'%20/%3e%3ccircle%20cx='82'%20cy='14'%20r='1.4'%20fill='%238FA8AE'%20fill-opacity='0.6'%20/%3e%3ccircle%20cx='138'%20cy='14'%20r='1.4'%20fill='%238FA8AE'%20fill-opacity='0.6'%20/%3e%3c/svg%3e") center / contain no-repeat;
}

/* Base storybook buttons (non-choice primary/secondary actions) */
.screen button:not(.choice-button):not(.tree-rings__band-button):not(.tree-rings__memory-toggle),
.app-shell > header button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.68rem 1.35rem;
  border-radius: 999px;
  border: 1.5px solid var(--color-forest);
  background-color: var(--color-forest);
  color: var(--color-ivory);
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition:
    background-color 220ms var(--ease-organic),
    border-color 220ms var(--ease-organic),
    color 220ms var(--ease-organic),
    transform 220ms var(--ease-organic),
    box-shadow 220ms var(--ease-organic);
}

.screen.screen--landing > button:not(.choice-button):not(.tree-rings__band-button):not(.tree-rings__memory-toggle),
.screen.screen--invitation > button:not(.choice-button):not(.tree-rings__band-button):not(.tree-rings__memory-toggle),
.screen.screen--seed button:not(.choice-button):not(.tree-rings__band-button):not(.tree-rings__memory-toggle),
.screen.screen--passage > button:not(.choice-button):not(.tree-rings__band-button):not(.tree-rings__memory-toggle) {
  align-self: center;
}

.screen button:not(.choice-button):not(.tree-rings__band-button):not(.tree-rings__memory-toggle):hover:not(:disabled),
.app-shell > header button:hover:not(:disabled) {
  background-color: var(--color-forest-deep);
  border-color: var(--color-forest-deep);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.screen button.secondary-button:not(.choice-button),
.screen button.reset-button:not(.choice-button),
.screen button[data-variant='secondary']:not(.choice-button),
.screen button[data-variant='ghost']:not(.choice-button),
.app-shell > header button {
  background-color: var(--surface-card);
  color: var(--color-forest);
  border-color: var(--border-strong);
}

.screen button.secondary-button:not(.choice-button):hover:not(:disabled),
.screen button.reset-button:not(.choice-button):hover:not(:disabled),
.screen button[data-variant='secondary']:not(.choice-button):hover:not(:disabled),
.screen button[data-variant='ghost']:not(.choice-button):hover:not(:disabled),
.app-shell > header button:hover:not(:disabled) {
  background-color: var(--color-linen);
  border-color: var(--color-forest);
  color: var(--color-forest-deep);
}

.screen button.reset-button--confirm:not(.choice-button),
.app-shell > header button.reset-button--confirm {
  background-color: var(--color-bark-deep);
  border-color: var(--color-bark-deep);
  color: var(--color-ivory);
}

.screen button.reset-button--confirm:not(.choice-button):hover:not(:disabled),
.app-shell > header button.reset-button--confirm:hover:not(:disabled) {
  background-color: #4a3425;
  border-color: #4a3425;
  color: var(--color-ivory);
}

.screen button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   Story Layout — Illustration & Narrative Side-by-Side (Never Overlapping)
   ========================================================================== */

.story-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.96fr) minmax(0, 1.04fr);
  gap: clamp(1.25rem, 3vw, 2.75rem);
  align-items: start;
  width: 100%;
}

.story-layout > * {
  min-width: 0;
}

.story-stage {
  position: static;
  align-self: start;
  padding: clamp(0.75rem, 1.6vw, 1.25rem);
  border-radius: var(--radius-lg);
  background: var(--surface-paper);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-plate);
  overflow: hidden;
}

/* Sticky only inside the two-column story-layout where column 1 is dedicated to the stage */
.story-layout > .story-stage {
  position: sticky;
  top: 1.5rem;
}

.chapter-passage > .story-stage {
  width: min(520px, 100%);
  position: static;
  align-self: center;
  margin-inline: auto;
}

.story-panel {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 1.45rem);
  padding: clamp(1.25rem, 2.6vw, 2.1rem);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-plate);
  max-width: min(100%, calc(var(--measure-max) + 4.5rem));
}

.story-panel > p,
.story-panel > blockquote,
.story-panel p {
  max-width: var(--measure-ideal);
  overflow-wrap: anywhere;
}

/* Echo line styling if marked with data-echo or class */
.story-panel [data-echo],
.story-panel .story-echo,
.story-panel .scene-echo {
  margin: 0;
  padding: 0.78rem 1rem;
  border-left: 2.5px solid var(--color-dusty-blue-deep);
  background: var(--color-dusty-blue-wash);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-heading);
}

.scene-context {
  padding: 0.65rem 0.95rem;
  border-left: 2.5px solid var(--color-sage);
  background: var(--color-sage-wash);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-primary);
}

.scene-echoes {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.15rem;
}

.scene-echoes__title {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  color: var(--color-dusty-blue-deep);
  margin: 0;
}

.scene-echo__source {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 0.25rem;
}

.scene-echo__text {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-heading);
}

/* Unified title-case literary register for chapter labels (matches title-case chapter names) */
.scene-meta {
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--color-bark-deep);
}

.world-event-note {
  padding: 0.65rem 0.95rem;
  border-left: 2.5px solid var(--color-bark);
  background: var(--color-bark-wash);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: var(--text-small);
  color: var(--ink-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.world-event-note__when {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-bark-deep);
}

.world-event-note__aside {
  font-size: var(--text-small);
  font-style: italic;
  color: var(--ink-muted);
}

.scene-narration {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

/* ==========================================================================
   Choice List & Tactile Storybook Choice Buttons
   ========================================================================== */

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  width: 100%;
  min-width: 0;
  max-width: min(100%, var(--measure-max));
  position: relative;
  z-index: 1;
}

.choice-list__item {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.choice-button {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 52px;
  padding: 0.85rem 2.5rem 0.85rem 1rem;
  text-align: left;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.7rem;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(142, 106, 80, 0.32);
  background: linear-gradient(180deg, var(--color-parchment) 0%, #f6f2e6 100%);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-shadow: 0 2px 8px -5px rgba(48, 75, 59, 0.22);
  transition:
    background-color 220ms var(--ease-organic),
    border-color 220ms var(--ease-organic),
    box-shadow 220ms var(--ease-organic),
    transform 220ms var(--ease-organic);
}

.choice-button__key {
  width: 1.55rem;
  height: 1.55rem;
  flex-shrink: 0;
  margin-top: 0.08rem;
  border-radius: 999px;
  background: var(--color-gold-wash);
  border: 1px solid rgba(142, 106, 80, 0.34);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-bark-deep);
}

.choice-button__label {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Non-color-only decorative affordance indicator (empty alt text excludes arrow from accessible name) */
.choice-button::after {
  content: '→' / '';
  position: absolute;
  right: 1.05rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--color-bark-deep);
  opacity: 0.62;
  transition: transform 220ms var(--ease-organic), opacity 220ms var(--ease-organic);
}

.choice-button:hover:not(:disabled) {
  border-color: var(--color-forest);
  background: linear-gradient(180deg, #fdfbf4 0%, #edf2eb 100%);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.choice-button:hover:not(:disabled)::after {
  opacity: 1;
  transform: translate(3px, -50%);
}

.choice-button[aria-pressed='true'],
.choice-button[aria-selected='true'],
.choice-button.is-selected {
  border-color: var(--color-forest);
  border-width: 2px;
  background: linear-gradient(180deg, #eff4ee 0%, #e5ede5 100%);
  box-shadow: inset 4px 0 0 var(--color-forest);
}

.choice-button:disabled {
  opacity: 0.65;
  cursor: default;
}

/* ==========================================================================
   Consequence & Reflection Inset Panel
   ========================================================================== */

.consequence-panel {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  padding: clamp(1.1rem, 2.2vw, 1.5rem);
  border-radius: var(--radius-md);
  background: linear-gradient(155deg, rgba(253, 251, 245, 0.96), rgba(239, 234, 220, 0.78));
  border: 1px solid rgba(195, 161, 106, 0.42);
  border-left: 4px solid var(--color-gold);
  box-shadow: var(--shadow-soft);
  max-width: var(--measure-max);
  animation: consequenceReveal 540ms var(--ease-organic) both;
}

.consequence-panel p {
  max-width: var(--measure-ideal);
}

.consequence-choice__label,
.wellbeing-theme__label {
  font-weight: 600;
  color: var(--color-bark-deep);
}

.wellbeing-theme,
.tree-mark-note {
  font-size: var(--text-small);
  color: var(--ink-secondary);
}

.reflection-prompt {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.72rem 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  border-left: 3px solid var(--color-gold);
}

.reflection-prompt__title {
  font-family: var(--font-sans);
  font-size: var(--text-eyebrow);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-bark-deep);
  margin: 0;
}

.reflection-prompt__question {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.02rem, 0.96rem + 0.25vw, 1.15rem);
  line-height: 1.5;
  color: var(--ink-heading);
}

/* ==========================================================================
   Rings Review & Final Tree Layouts
   ========================================================================== */

.rings-layout {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

.final-tree {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(340px, 0.98fr) minmax(0, 1.02fr);
  column-gap: clamp(1.5rem, 3vw, 2.75rem);
  row-gap: 1.15rem;
  align-items: start;
  padding: clamp(1.25rem, 2.5vw, 2.15rem);
  border-radius: var(--radius-lg);
  background: var(--surface-paper);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-plate);
}

/* Keep the final portrait in its own non-sticky column so it never overlaps scrolling text */
.final-tree > .story-stage {
  grid-column: 1;
  grid-row: 1 / span 6;
  position: static;
  top: auto;
  align-self: start;
}

.final-tree > :not(.story-stage) {
  grid-column: 2;
  min-width: 0;
}

.final-tree__subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 1.02rem + 0.35vw, 1.32rem);
  color: var(--ink-secondary);
}

.final-tree__closing {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.final-reflection {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.final-reflection__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.final-reflection__actions,
.final-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.final-tree textarea,
.screen textarea,
.screen input[type='text'] {
  width: 100%;
  max-width: var(--measure-ideal);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-hairline);
  background: var(--color-parchment);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  resize: vertical;
  min-height: 112px;
}

.final-tree textarea:hover,
.screen textarea:hover {
  border-color: var(--border-strong);
}

/* ==========================================================================
   Responsive Breakpoints (Tablet & 390px Mobile)
   ========================================================================== */

@media (max-width: 880px) {
  .story-layout,
  .final-tree {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .final-tree > .story-stage,
  .final-tree > :not(.story-stage) {
    grid-column: auto;
    grid-row: auto;
  }

  /* Illustration always sits cleanly above choices on mobile; never sticky/overlapping */
  .story-layout > .story-stage,
  .story-stage {
    position: static;
    top: auto;
    max-width: 520px;
    width: 100%;
    margin-inline: auto;
  }

  .story-panel {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .app-shell {
    padding: 0.5rem 0.75rem 1.35rem;
  }

  .app-shell > header {
    padding-bottom: 0.45rem;
    margin-bottom: 0.55rem;
    gap: 0.5rem;
  }

  .app-brand {
    font-size: 0.9rem;
    line-height: 1.25;
  }

  .app-shell > header button {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
  }

  .screen {
    gap: 0.8rem;
  }

  .screen--landing,
  .screen--invitation,
  .screen--seed,
  .screen--passage {
    padding: 1.35rem 1.05rem;
    border-radius: var(--radius-md);
  }

  .app-alerts {
    margin-bottom: 0.65rem;
  }

  .app-alert {
    padding: 0.65rem 0.8rem;
    gap: 0.45rem;
  }

  .story-layout {
    gap: 0.65rem;
  }

  .story-stage {
    padding: 0.45rem 0.55rem;
    border-radius: var(--radius-md);
  }

  /* Compact botanical vignette on mobile story/consequence screens so narrative + primary action stay reachable above the fold */
  .story-layout > .story-stage .living-tree {
    gap: 0.28rem;
  }

  .story-layout > .story-stage .living-tree__frame {
    display: flex;
    justify-content: center;
  }

  .story-layout > .story-stage .living-tree__svg {
    max-height: 192px;
    width: auto;
  }

  .screen--consequence > .story-stage .living-tree__svg {
    max-height: 178px;
    width: auto;
  }

  .story-layout > .story-stage .living-tree__caption {
    padding-top: 0.05rem;
    gap: 0.2rem 0.5rem;
  }

  .story-layout > .story-stage .living-tree__caption-main {
    font-size: 0.86rem;
  }

  .story-layout > .story-stage .living-tree__caption-season {
    font-size: 0.68rem;
  }

  .story-panel {
    padding: 0.85rem 0.95rem;
    gap: 0.58rem;
    border-radius: var(--radius-md);
  }

  .story-panel .scene-title {
    font-size: 1.28rem;
    line-height: 1.18;
  }

  .story-panel .scene-question {
    font-size: 1.06rem;
    line-height: 1.26;
  }

  .story-panel p {
    font-size: 0.94rem;
    line-height: 1.48;
  }

  .story-panel .scene-echo,
  .story-panel .world-event-note {
    padding: 0.45rem 0.7rem;
    font-size: 0.86rem;
    line-height: 1.4;
  }

  .choice-list {
    gap: 0.55rem;
    margin-top: 0.15rem;
  }

  .choice-button {
    min-height: 48px;
    padding: 0.68rem 2.15rem 0.68rem 0.82rem;
    gap: 0.55rem;
    font-size: 0.92rem;
    line-height: 1.4;
  }

  .choice-button::after {
    right: 0.75rem;
    font-size: 1rem;
  }

  /* Tighter consequence rhythm so tree, consequence, reflection, and primary CTA fit within one 844px phone viewport */
  .consequence-panel {
    padding: 0.8rem 0.92rem;
    gap: 0.46rem;
  }

  .consequence-panel .scene-title {
    font-size: 1.22rem;
  }

  .consequence-panel p {
    font-size: 0.9rem;
    line-height: 1.44;
  }

  .consequence-panel .world-event-note,
  .consequence-panel .tree-mark-note {
    font-size: 0.82rem;
    line-height: 1.36;
  }

  .consequence-panel .reflection-prompt {
    padding: 0.48rem 0.7rem;
    gap: 0.18rem;
  }

  .consequence-panel .reflection-prompt__title {
    font-size: 0.72rem;
  }

  .consequence-panel .reflection-prompt__question {
    font-size: 0.95rem;
    line-height: 1.38;
  }

  /* Keep the primary action in normal document flow so enlarged root fonts (16-24px) or long copy are never covered */
  .consequence-panel .continue-button {
    position: static;
    width: 100%;
    min-height: 44px;
    padding: 0.58rem 1.1rem;
    margin-top: 0.15rem;
  }

  .final-tree {
    padding: 1rem;
    border-radius: var(--radius-md);
  }
}
/* ==========================================================================
   LivingTree & TreeRings Component Styles + Accessible Motion
   ========================================================================== */

/* --- LivingTree --- */
.living-tree {
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.living-tree__frame {
  position: relative;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-ivory);
  border: 1px solid rgba(142, 106, 80, 0.2);
}

.living-tree__svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 620px;
}

.living-tree__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.85rem;
  padding: 0.15rem 0.25rem 0;
  font-size: var(--text-small);
  color: var(--ink-secondary);
}

.living-tree__caption-main {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-heading);
  font-variant-numeric: tabular-nums;
}

.living-tree__caption-season {
  font-size: 0.82rem;
  letter-spacing: 0.025em;
  color: var(--color-bark-deep);
}

/* Organic botanical animations (soft, unhurried, 5-10s cycles — transform & opacity only) */
.lt-mark {
  animation: markBloom var(--dur-mark) var(--ease-organic) both;
}

.lt-sway-gentle {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: gentleBreeze var(--dur-breeze) ease-in-out infinite;
}

.lt-canopy-sway-a {
  transform-box: fill-box;
  transform-origin: 50% 82%;
  animation: canopyBreezeA 6.4s ease-in-out infinite;
}

.lt-canopy-sway-b {
  transform-box: fill-box;
  transform-origin: 48% 85%;
  animation: canopyBreezeB 7.8s ease-in-out infinite;
}

.lt-canopy-sway-c {
  transform-box: fill-box;
  transform-origin: 52% 80%;
  animation: canopyBreezeC 5.6s ease-in-out infinite;
}

.lt-drift-leaf-a {
  animation: elderLeafDriftA 8.5s ease-in-out infinite;
}

.lt-drift-leaf-b {
  animation: elderLeafDriftB 10.2s ease-in-out infinite;
}

.lt-shimmer {
  animation: sunShimmer 5.6s ease-in-out infinite;
}

/* Seed -> Root -> Sprout narrative reveal */
.lt-seed-stage--seed .lt-seed-body {
  animation: seedSettle 760ms var(--ease-organic) both;
}

.lt-seed-stage--seed .lt-seed-roots {
  animation: rootExtend 1100ms var(--ease-organic) 420ms both;
}

.lt-seed-stage--seed .lt-seed-sprout {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: sproutRise 1150ms var(--ease-organic) 960ms both;
}

/* --- TreeRings --- */
.tree-rings {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2.5vw, 1.85rem);
  padding: clamp(1.15rem, 2.5vw, 2rem);
  border-radius: var(--radius-lg);
  background: var(--surface-paper);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-plate);
}

.tree-rings__header {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tree-rings__eyebrow,
.tree-rings__chapter-eyebrow {
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--color-bark-deep);
  margin: 0;
}

.tree-rings__title {
  font-family: var(--font-serif);
  font-size: var(--text-h2);
  font-weight: 500;
  color: var(--ink-heading);
  margin: 0;
}

.tree-rings__lead {
  color: var(--ink-secondary);
  max-width: var(--measure-ideal);
}

.tree-rings__grid {
  display: grid;
  grid-template-columns: minmax(290px, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(1.25rem, 2.8vw, 2.4rem);
  align-items: start;
}

.tree-rings__visual {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.tree-rings__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(253, 251, 245, 0.82);
  border: 1px solid var(--border-hairline);
}

.tree-rings__svg {
  width: min(390px, 100%);
  height: auto;
  display: block;
}

.tree-rings__caption {
  font-size: var(--text-eyebrow);
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-align: center;
}

.tr-band {
  transition: opacity 240ms var(--ease-organic);
}

.tr-numeral-text {
  font-family: var(--font-serif);
  font-size: 10.5px;
  font-weight: 600;
  fill: var(--color-bark-deep);
  letter-spacing: 0.04em;
}

.tr-numeral-text--active {
  fill: var(--color-forest-deep);
  font-size: 12px;
}

/* Ten-age ring band accessible selector grid */
.tree-rings__band-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tree-rings__band-list--ten {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.tree-rings__band-button {
  width: 100%;
  min-height: 46px;
  padding: 0.52rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-hairline);
  background: var(--color-parchment);
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  gap: 0.62rem;
  text-align: left;
  transition:
    border-color 200ms var(--ease-organic),
    background-color 200ms var(--ease-organic),
    box-shadow 200ms var(--ease-organic);
}

.tree-rings__band-button:hover {
  border-color: var(--color-forest);
  background: #f2f4ec;
}

.tree-rings__band-button.is-selected {
  border-color: var(--color-forest);
  border-width: 2px;
  background: linear-gradient(135deg, #eef3ec 0%, #f5efe0 100%);
  box-shadow: inset 4px 0 0 var(--color-forest);
}

.tree-rings__band-numeral {
  width: 1.9rem;
  height: 1.9rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--color-gold-wash);
  border: 1px solid rgba(142, 106, 80, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-bark-deep);
}

.tree-rings__band-button.is-selected .tree-rings__band-numeral {
  background: var(--color-forest);
  border-color: var(--color-forest);
  color: var(--color-ivory);
}

.tree-rings__band-meta {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}

.tree-rings__band-name {
  font-family: var(--font-serif);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.24;
  color: var(--ink-heading);
}

.tree-rings__band-sub {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* Right/Bottom Memory Details Panel */
.tree-rings__details {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.tree-rings__chapter-banner {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-hairline);
}

.tree-rings__chapter-title {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.65rem);
  font-weight: 500;
  color: var(--ink-heading);
  margin: 0;
}

.tree-rings__chapter-subtitle {
  margin: 0.15rem 0 0;
  font-size: var(--text-body);
  color: var(--ink-body);
}

.tree-rings__chapter-focus {
  margin: 0.25rem 0 0;
  font-size: var(--text-small);
  font-style: italic;
  color: var(--ink-secondary);
}

.tree-rings__scar-note {
  padding: 0.95rem 1.1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, rgba(142, 106, 80, 0.12), rgba(195, 161, 106, 0.12));
  border: 1px solid rgba(142, 106, 80, 0.34);
  border-left: 3.5px solid var(--color-bark);
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.tree-rings__scar-heading {
  font-family: var(--font-serif);
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--color-bark-deep);
  margin: 0;
}

.tree-rings__scar-copy {
  font-size: var(--text-small);
  line-height: 1.58;
  color: var(--ink-primary);
  margin: 0;
}

.tree-rings__memory-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tree-rings__memory-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  background: var(--surface-card);
  overflow: hidden;
  transition: border-color 200ms var(--ease-organic), box-shadow 200ms var(--ease-organic);
}

.tree-rings__memory-card.is-highlighted {
  border-color: var(--color-forest);
  box-shadow: 0 0 0 2px rgba(143, 168, 174, 0.45);
}

.tree-rings__memory-toggle {
  width: 100%;
  min-height: 50px;
  padding: 0.85rem 1.05rem;
  border: 0;
  background: transparent;
  color: var(--ink-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
}

.tree-rings__memory-toggle:hover {
  background: var(--color-sage-wash);
}

.tree-rings__memory-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.7rem;
}

.tree-rings__memory-age {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: var(--color-linen);
  border: 1px solid var(--border-hairline);
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-forest);
}

.tree-rings__memory-scene {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink-heading);
}

.tree-rings__memory-chevron {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  line-height: 1;
  color: var(--color-bark-deep);
  flex-shrink: 0;
}

.tree-rings__memory-body {
  padding: 0 1.05rem 1.05rem;
  border-top: 1px solid rgba(142, 106, 80, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.tree-rings__memory-dl {
  margin: 0.85rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tree-rings__memory-row {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.tree-rings__memory-row dt {
  font-size: var(--text-eyebrow);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-bark-deep);
}

.tree-rings__memory-row dd {
  margin: 0;
  font-size: var(--text-body);
  line-height: 1.62;
  color: var(--ink-primary);
  max-width: var(--measure-ideal);
}

.tree-rings__memory-row--reflection {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  border-left: 3px solid var(--color-gold);
}

.tree-rings__memory-row--reflection dd {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-heading);
}

.tree-rings__memory-mark {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.tree-rings__memory-mark span {
  font-weight: 600;
  color: var(--color-sage-deep);
}

.tree-rings__chapter-empty,
.tree-rings__empty-text {
  color: var(--ink-secondary);
  font-style: italic;
  max-width: var(--measure-ideal);
}

.tree-rings__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 1.5rem 1rem;
}

.tree-rings__empty-svg {
  width: 170px;
  height: 170px;
}

/* Responsive TreeRings */
@media (max-width: 880px) {
  .tree-rings__grid {
    grid-template-columns: 1fr;
  }

  .tree-rings__svg {
    width: min(320px, 100%);
  }
}

@media (max-width: 480px) {
  .tree-rings {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .tree-rings__band-list--ten {
    grid-template-columns: 1fr;
  }

  .tree-rings__figure {
    padding: 0.55rem;
  }

  .tree-rings__memory-toggle {
    padding: 0.8rem 0.85rem;
  }

  .tree-rings__memory-body {
    padding: 0 0.85rem 0.9rem;
  }
}

/* ==========================================================================
   Keyframes & Reduced Motion Alternatives
   ========================================================================== */

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

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

@keyframes markBloom {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes gentleBreeze {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(1.6deg);
  }
}

@keyframes canopyBreezeA {
  0%,
  100% {
    transform: rotate(0deg) translateY(0px);
  }
  50% {
    transform: rotate(1.3deg) translateY(-1.4px);
  }
}

@keyframes canopyBreezeB {
  0%,
  100% {
    transform: rotate(0deg) translateX(0px);
  }
  50% {
    transform: rotate(-1.15deg) translateX(1.5px);
  }
}

@keyframes canopyBreezeC {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(1.65deg) scale(1.01);
  }
}

@keyframes elderLeafDriftA {
  0%,
  100% {
    transform: translate(0px, 0px) rotate(0deg);
    opacity: 0.72;
  }
  50% {
    transform: translate(8px, 12px) rotate(15deg);
    opacity: 0.94;
  }
}

@keyframes elderLeafDriftB {
  0%,
  100% {
    transform: translate(0px, 0px) rotate(0deg);
    opacity: 0.65;
  }
  50% {
    transform: translate(-9px, 13px) rotate(-16deg);
    opacity: 0.88;
  }
}

@keyframes sunShimmer {
  0%,
  100% {
    opacity: 0.78;
  }
  50% {
    opacity: 1;
  }
}

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

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

@keyframes sproutRise {
  from {
    opacity: 0;
    transform: scaleY(0.25);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

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

  .lt-mark,
  .lt-sway-gentle,
  .lt-shimmer {
    animation: none !important;
    opacity: 1 !important;
  }

  .lt-canopy-sway-a,
  .lt-canopy-sway-b,
  .lt-canopy-sway-c,
  .lt-drift-leaf-a,
  .lt-drift-leaf-b {
    animation: none !important;
    opacity: 1 !important;
  }

  .screen,
  .consequence-panel,
  .lt-seed-stage--seed .lt-seed-body,
  .lt-seed-stage--seed .lt-seed-roots,
  .lt-seed-stage--seed .lt-seed-sprout {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

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

html {
  color: var(--ink-primary);
  background-color: var(--color-ivory);
  font-family: var(--font-sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background-color: var(--color-ivory);
  color: var(--ink-primary);
  line-height: 1.65;
}

img,
svg {
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

a {
  color: var(--color-dusty-blue-deep);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-forest-deep);
}

/* High-visibility accessible focus indicator across all interactive elements */
:focus-visible {
  outline: 3px solid var(--color-dusty-blue-deep);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(195, 161, 106, 0.35);
}

/* Screen-reader-only utility for accessible figure descriptions */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
