/**
 * Stories — comp layer for design_handoff_story_mode 2 / story-mode.html.
 *
 * This file is the source of truth for Story step layout. Selectors start with
 * `html[data-kouli-theme] body.is-story-step` so they out-rank story-card.css and
 * light-theme/story-card.light.css without !important.
 *
 * Frames:  1a·1 picker · 2a live (KoLi asking / you answering) · 1a·3 ended
 *          1a·4 drawer · 1a·5a/5b saved · 1b desktop · 1c voice dock states
 *
 * Tokens: canvas #F4F0EB · surface #FAF8F5 · hairline #E8E3DC / #E2DCD3
 *         ink #1E2224 · body #4A4743 · muted #6B6762 · graphite #8C857C · faint #B8B0A5
 *         one teal #0F6B5C per view · amber #F3E6CF / #8A5A1E (cap only)
 */

/* ======================================================================
   Step chrome (all Story states)
   ====================================================================== */

body.is-story-step .bottom-nav { display: none !important; }

/* Top bar: bold KoLi wordmark + 40px back disc (comp 1a·1) */
html[data-kouli-theme] body.is-story-step .precoach-topbar .precoach-wordmark-home {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #1E2224;
}

html[data-kouli-theme] body.is-story-step .precoach-topbar .kouli-ingest-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #E2DCD3;
  background: #FAF8F5;
  color: #1E2224;
}

/* Ended: "Session ended · 9 min" replaces Back on the right */
html[data-kouli-theme] body.is-story-ended .precoach-topbar .kouli-ingest-back { display: none; }

html[data-kouli-theme] body.is-story-step .precoach-topbar .precoach-phase-label.story-phase-label {
  flex: none;
  margin: 0 0 0 auto;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #6B6762;
}

/* The bottom nav is hidden for the whole step, so drop the space it reserved */
html[data-kouli-theme] body.is-story-step .precoach-shell { padding-bottom: 0; }

/* Prep leftovers that never belong on the Story step */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell #precoach-story-focus-banner,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell #precoach-story-end-status:empty,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell #precoach-story-end-talk,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell #precoach-story-end-end,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .kouli-voice-stage-inner {
  display: none !important;
}

html[data-kouli-theme] body.is-story-step .precoach-pack-prompt:empty { display: none; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell #precoach-story-end-status {
  margin: 12px 4px 0;
  font-size: 13px;
  line-height: 1.45;
  color: #6B6762;
  text-align: left;
}

/* ======================================================================
   Sticky footer (picker / ended / saved) — comp: border-top, 54px teal, caption
   ====================================================================== */

html[data-kouli-theme] body.is-story-step #precoach-arrive-sticky.precoach-step-sticky {
  background: #F4F0EB;
  border-top: 1px solid #E8E3DC;
  box-shadow: none;
  padding: 14px 16px max(20px, calc(env(safe-area-inset-bottom, 0px) + 12px));
}

html[data-kouli-theme] body.is-story-saved #precoach-arrive-sticky.precoach-step-sticky { border-top-color: transparent; }

html[data-kouli-theme] body.is-story-step #precoach-arrive-sticky.precoach-step-sticky .precoach-step-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

html[data-kouli-theme] body.is-story-step #precoach-arrive-sticky.precoach-step-sticky .precoach-step-primary {
  order: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: none;
  height: 54px;
  min-height: 54px;
  margin: 0;
  padding: 0 20px;
  border: none;
  border-radius: 999px;
  /* !important only to beat pre-interview-coach.css's !important #00C4A0 on .precoach-cta */
  background: #0F6B5C !important;
  color: #fff !important;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: none !important;
  opacity: 1;
  transition: opacity 160ms ease;
}

html[data-kouli-theme] body.is-story-step #precoach-arrive-sticky.precoach-step-sticky .precoach-step-primary:disabled:not(.is-busy),
html[data-kouli-theme] body.is-story-step #precoach-arrive-sticky.precoach-step-sticky .precoach-step-primary.is-disabled:not(.is-busy) {
  opacity: 0.38 !important; /* pre-interview-coach.css sets 0.45 !important */
  cursor: default;
}

html[data-kouli-theme] body.is-story-step #precoach-arrive-sticky.precoach-step-sticky .precoach-step-primary.is-busy {
  opacity: 0.85 !important;
  cursor: progress;
}

html[data-kouli-theme] body.is-story-step #precoach-arrive-sticky.precoach-step-sticky .precoach-step-primary.is-busy::before,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell #precoach-story-end-save.is-busy::before {
  content: '';
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: story-spin 0.8s linear infinite;
  flex: none;
}

html[data-kouli-theme] body.is-story-step #precoach-arrive-sticky.precoach-step-sticky .story-talk-caption {
  order: 1;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #6B6762;
  text-align: center;
}

html[data-kouli-theme] body.is-story-step #precoach-arrive-sticky.precoach-step-sticky .precoach-step-secondary,
html[data-kouli-theme] body.is-story-step #precoach-arrive-sticky.precoach-step-sticky .precoach-step-tertiary {
  order: 2;
  width: auto;
  min-height: 32px;
  margin: 2px 0 0;
  padding: 4px 12px;
  border: none;
  background: none;
  box-shadow: none;
  font-size: 14px;
  font-weight: 600;
  color: #4A4743;
  text-decoration: none;
}

html[data-kouli-theme] body.is-story-step #precoach-arrive-sticky.precoach-step-sticky .precoach-step-secondary:disabled {
  color: #C4BDB3;
}

/* Drawer open: its own footer is the only action */
html[data-kouli-theme] body.is-story-drawer-open #precoach-arrive-sticky.precoach-step-sticky { visibility: hidden; }

/* ======================================================================
   Picker (comp 1a·1, desktop 1b)
   ====================================================================== */

html[data-kouli-theme] body.is-story-step .precoach-pack-prompt.is-story-slim {
  margin: 4px 0 12px;
  padding: 10px 12px 10px 14px;
  border-radius: 14px;
  border: 1px solid #E8E3DC;
  background: #FAF8F5;
  box-shadow: none;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-ready > .precoach-step-eyebrow {
  margin: 4px 4px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6B6762;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-lines {
  display: flex;
  flex-direction: column;
  margin: 0;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-lines.hidden { display: none; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-lines-q {
  margin: 0 4px 8px;
  font-family: Newsreader, Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
  color: #1E2224;
  text-wrap: balance;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-lines-sub {
  margin: 0 4px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: #4A4743;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-lines-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid #E8E3DC;
  background: #FAF8F5;
  box-shadow: none;
  text-align: left;
  color: #1E2224;
  cursor: pointer;
  transition: border-color 160ms ease;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-line:hover { border-color: #CFC7BC; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-line.is-active {
  border: 1.5px solid #1E2224;
  padding: 11.5px 13.5px;
  background: #FAF8F5;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-line-radio {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 1.5px solid #C4BDB3;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-line.is-active .story-line-radio { border-color: #1E2224; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-line.is-active .story-line-radio::after {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1E2224;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-line-text {
  flex: 1;
  font-size: 15px;
  line-height: 1.45;
  color: #1E2224;
  text-wrap: pretty;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-line-src { display: none; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-start-from {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 4px 0;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-start-from-label {
  flex: 0 0 100%;
  font-size: 13px;
  color: #6B6762;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-start-chip {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #E2DCD3;
  background: #FAF8F5;
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
  color: #1E2224;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-start-chip.is-active {
  border: 1.5px solid #1E2224;
  background: #FAF8F5;
  color: #1E2224;
}

/* ======================================================================
   Live (comp 2a) — fixed full-viewport column, no page scroll
   ====================================================================== */

body.is-story-live #precoach-arrive-sticky,
body.is-story-live .precoach-topbar { visibility: hidden; }

body.is-story-live .precoach-arrive-scroll { overflow: hidden; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #F4F0EB;
  box-sizing: border-box;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live > .precoach-step-eyebrow,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live > .precoach-story-lib,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live > #precoach-story-handoff,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live > #precoach-story-end-status,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live > .story-ended-head {
  display: none !important;
}

/* 1 · End | Story · 07:48 left */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-live-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: max(12px, calc(env(safe-area-inset-top, 0px) + 8px)) 16px 0;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-live-end {
  appearance: none;
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #E2DCD3;
  background: #FAF8F5;
  box-shadow: none;
  color: #1E2224;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-live-bar-meta {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
  color: #1E2224;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-live-bar-meta.is-low { color: #8A5A1E; }

/* 2 · Focus reminder */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-live-focus {
  flex: none;
  margin: 0;
  padding: 14px 20px 0;
  font-size: 12px;
  line-height: 1.4;
  color: #6B6762;
  text-align: left;
}

/* 3 · KoLi caption — flex:1 absorbs the leftover height */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-live-caption {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  max-width: none;
  margin: 0;
  padding: 20px 24px 12px;
  overflow: hidden;
  text-align: left;
  background: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 10px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 10px), transparent 100%);
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-caption-eyebrow {
  flex: none;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6B6762;
}

/* Fresh session: no KOLI label until KoLi has said something */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-live-caption:has(.story-caption-prev.hidden):has(.story-caption-current:empty) .story-caption-eyebrow { visibility: hidden; }

/* The finished line gives up space first; the growing line never gets cut */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-caption-prev {
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
  margin: 0;
  font-family: Newsreader, Georgia, serif;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.35;
  color: #8C857C;
  text-wrap: pretty;
  transition: color 200ms ease;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-caption-prev.hidden { display: none; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-caption-current {
  flex: none;
  margin: 0;
  font-family: Newsreader, Georgia, serif;
  font-size: 27px;
  font-weight: 500;
  line-height: 1.3;
  color: #1E2224;
  text-wrap: pretty;
  white-space: pre-wrap;
  transition: color 200ms ease;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-caption-current:empty { display: none; }

/* You answering: KoLi's last line stays as the question, 24px muted (comp 2a "You answering") */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-live-caption.is-user-turn .story-caption-prev {
  font-size: 24px;
  line-height: 1.3;
  color: #6B6762;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-live-caption.is-user-turn .story-caption-current {
  font-size: 24px;
  color: #6B6762;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-live-caption:has(.story-caption-current:empty) .story-caption-prev {
  font-size: 24px;
  line-height: 1.3;
  color: #6B6762;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-caption-current.is-live::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 0.9em;
  margin-left: 3px;
  vertical-align: -2px;
  background: #1E2224;
  animation: story-caret 1.1s steps(1) infinite;
}

/* 4 · Card — 236px target, tabs + one part */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-card {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: auto;
  max-width: none;
  height: min(236px, 32dvh);
  min-height: 168px;
  margin: 0 16px 14px;
  padding: 0;
  box-sizing: border-box;
  border-radius: 20px;
  border: 1px solid #E8E3DC;
  background: #FAF8F5;
  box-shadow: none;
  overflow: hidden;
}

/* ======================================================================
   Card internals (live tabs, desktop columns, ended stacked)
   ====================================================================== */

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-tabs {
  flex: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 8px;
  border-bottom: 1px solid #E8E3DC;
  background: none;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-tab {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  min-height: 0;
  padding: 0 6px;
  border: none;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: #1E2224;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-tab.is-filled:not(.is-active) {
  background: transparent;
  color: #1E2224;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-tab.is-active {
  background: #1E2224;
  color: #fff;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-tab svg { flex: none; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 14px 16px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card.is-mobile-tabs .story-card-slot {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  -webkit-mask-image: none;
  mask-image: none;
}

/* With quotes: they build from the bottom and fade at the top (comp 2a answering) */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card.is-mobile-tabs .story-card-slot:not(.is-empty) {
  justify-content: flex-end;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 40px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 40px);
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6B6762;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card.is-mobile-tabs .story-card-slot.is-empty .story-card-body { flex: 1; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-ink-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-ink {
  margin: 0;
  padding: 0;
  font-size: 15px;
  line-height: 1.45;
  color: #1E2224;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-ink.is-new {
  animation: story-ink-settle 400ms ease-out both;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  color: #8C857C;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-empty::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8C857C;
}

/* Pencil hint (KOLI label, dashed, italic serif, graphite ×) */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-pencil {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: auto 0 0;
  padding: 9px 4px 9px 12px;
  border: 1px dashed #CFC7BC;
  border-radius: 12px;
  background: transparent;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-pencil-kind {
  flex: none;
  padding-top: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8C857C;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-pencil-text {
  flex: 1;
  font-family: Newsreader, Georgia, serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.35;
  color: #6B6762;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-pencil-erase {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: -5px 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: #8C857C;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

/* 44px hit area */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-pencil-erase::after {
  content: '';
  position: absolute;
  inset: -8px;
}

/* Header: YOUR STORY ●●○ 2 of 3 in your words */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #E8E3DC;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-head-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6B6762;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-count {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #4A4743;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-dots {
  display: flex;
  gap: 4px;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-dots > i {
  display: block;
  width: 7px;
  height: 7px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 1px solid #C4BDB3;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card-dots > i.is-on {
  border-color: #1E2224;
  background: #1E2224;
}

/* Busy (Review): shimmer bar under each part's last quote */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card.is-busy .story-card-slot::after {
  content: '';
  position: static;
  display: block;
  width: 70%;
  height: 10px;
  margin: 2px 0 0;
  border-radius: 5px;
  background: linear-gradient(90deg, #EDE8E1, #F7F4F0 50%, #EDE8E1);
  background-size: 200% 100%;
  animation: story-shimmer 1.2s linear infinite;
  opacity: 1;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card.is-busy .story-card-slot[data-slot="did"]::after { width: 85%; }
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card.is-busy .story-card-slot[data-slot="changed"]::after { width: 62%; }

/* ======================================================================
   Voice dock (comp 2a / 1c): absolute mist wash + floating pill
   ====================================================================== */

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .sb-mist-stage,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .sb-mist {
  position: static;
  flex: none;
  width: auto;
  max-width: none;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-mist-wash {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  height: 150px;
  pointer-events: none;
  background:
    radial-gradient(40% 70% at 15% 120%, rgba(150, 205, 205, 0.45), transparent 70%),
    radial-gradient(35% 65% at 55% 115%, rgba(210, 215, 160, 0.45), transparent 70%),
    radial-gradient(40% 70% at 90% 110%, rgba(150, 210, 205, 0.4), transparent 70%);
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-voice-dock {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 56px;
  padding: 0 16px max(20px, calc(env(safe-area-inset-bottom, 0px) + 14px));
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  max-width: none;
  margin: 0;
  padding: 0 18px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1px solid #E8E3DC;
  background: #FAF8F5;
  box-shadow: none;
  color: #1E2224;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.hidden { display: none; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 14px;
  flex: none;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-bars > i {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: #1E2224;
  transform-origin: center;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-bars > i:nth-child(1) { height: 7px; }
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-bars > i:nth-child(2) { height: 14px; animation-delay: -0.3s; }
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-bars > i:nth-child(3) { height: 10px; animation-delay: -0.6s; }
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-bars > i:nth-child(4) { height: 13px; animation-delay: -0.15s; }
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-bars > i:nth-child(5) { height: 6px; animation-delay: -0.45s; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-speaking .story-voice-bars > i,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-you-talking .story-voice-bars > i {
  animation-name: story-bar;
  animation-duration: 0.9s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-disc { display: none; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: #1E2224;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-sub {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  color: #4A4743;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-sub.hidden { display: none; }

/* You talking: 56px pill, teal disc + white bars (the one teal in Live) */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-you-talking,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-connecting {
  height: 56px;
  padding: 0 20px 0 6px;
  gap: 12px;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-you-talking .story-voice-disc,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-connecting .story-voice-disc {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #0F6B5C;
  box-shadow: 0 0 0 4px rgba(15, 107, 92, 0.14);
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-you-talking .story-voice-bars { height: 16px; }
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-you-talking .story-voice-bars > i { background: #fff; }
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-you-talking .story-voice-bars > i:nth-child(1) { height: 8px; }
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-you-talking .story-voice-bars > i:nth-child(2) { height: 16px; }
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-you-talking .story-voice-bars > i:nth-child(3) { height: 11px; }
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-you-talking .story-voice-bars > i:nth-child(4) { height: 14px; }
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-you-talking .story-voice-bars > i:nth-child(5) { height: 6px; }

/* Connecting: grey disc + spinner, no teal (comp 1c) */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-connecting .story-voice-disc {
  background: #EDE8E1;
  box-shadow: none;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-connecting .story-voice-bars { display: none; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-connecting .story-voice-disc::after {
  content: '';
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid rgba(30, 34, 36, 0.18);
  border-top-color: #6B6762;
  animation: story-spin 0.8s linear infinite;
}

/* Cap: amber chip, no bars */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-cap {
  height: 32px;
  padding: 0 12px;
  border-color: #F3E6CF;
  background: #F3E6CF;
  color: #8A5A1E;
  font-size: 13px;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-cap .story-voice-bars,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-error .story-voice-bars { display: none; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-voice-status.is-cap .story-voice-title { color: #8A5A1E; font-size: 13px; }

/* ======================================================================
   Ended (comp 1a·3)
   ====================================================================== */

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-ended > .precoach-step-eyebrow,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-ended .story-live-caption,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-ended .sb-mist-stage,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-ended .story-live-bar,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-ended .story-live-focus {
  display: none !important;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-ended-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 4px 16px;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-ended-head.hidden { display: none; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-ended-title {
  margin: 0;
  font-family: Newsreader, Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
  color: #1E2224;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-ended-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #4A4743;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card.is-stacked {
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  border-radius: 20px;
  border: 1px solid #E8E3DC;
  background: #FAF8F5;
  box-shadow: none;
  overflow: hidden;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-card.is-stacked .story-card-slot + .story-card-slot {
  border-top: 1px solid #E8E3DC;
}

/* ======================================================================
   Review drawer (comp 1a·4a/4b mobile sheet · 1b desktop side sheet)
   ====================================================================== */

html[data-kouli-theme] body.is-story-step .story-drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(30, 34, 36, 0.32);
  animation: story-fade-in 280ms ease-out both;
}

html[data-kouli-theme] body.is-story-step .story-drawer-scrim.hidden { display: none; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell #precoach-story-end-drawer.sb-save-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  z-index: 91;
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: none;
  max-height: calc(100dvh - 72px);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border: none;
  border-radius: 28px 28px 0 0;
  background: #F4F0EB;
  box-shadow: 0 -12px 40px rgba(30, 34, 36, 0.12);
  overflow: hidden;
  opacity: 1;
  animation: story-sheet-up 280ms ease-out both;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell #precoach-story-end-drawer.sb-save-drawer.hidden { display: none; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-grab {
  flex: none;
  align-self: center;
  width: 40px;
  height: 4px;
  margin: 10px 0 0;
  border-radius: 2px;
  background: #D9D2C8;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-header {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 14px 20px 12px;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-title {
  margin: 0 0 4px;
  font-family: Newsreader, Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.15;
  color: #1E2224;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #4A4743;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-close {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #E2DCD3;
  background: #FAF8F5;
  box-shadow: none;
  color: #1E2224;
  cursor: pointer;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-close svg { width: 16px; height: 16px; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 16px 20px;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 4px 6px;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-label-row label,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-evidence-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #4A4743;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-draft-tag,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-kept-mark,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-tell-meta {
  margin-left: auto;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  color: #8C857C;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-kept-mark { color: #1E2224; font-weight: 600; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-kept-mark.hidden,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-field.is-kept .story-drawer-draft-tag,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-field.is-empty .story-drawer-draft-tag { display: none; }

/* Ink field: Title, Your tell, kept parts */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-plain input,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-plain textarea,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-box {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  border-radius: 14px;
  border: 1px solid #E2DCD3;
  background: #FFFDFA;
  box-shadow: none;
  color: #1E2224;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-plain input {
  height: 44px;
  padding: 0 14px;
  font-weight: 600;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-plain textarea {
  min-height: 44px;
  padding: 11px 14px;
  resize: none;
  overflow: hidden;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-box { padding: 11px 14px; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-box textarea {
  display: block;
  width: 100%;
  min-height: 22px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  outline: none;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  resize: none;
  overflow: hidden;
  transition: color 400ms ease;
}

/* Pencil part: dashed, italic, Keep + × inside */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-field.is-pencil .story-drawer-box {
  border: 1px dashed #CFC7BC;
  background: transparent;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-field.is-pencil .story-drawer-box textarea {
  font-style: italic;
  color: #4A4743;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-field-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 10px 0 0;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-field.is-kept .story-drawer-field-tools,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-field.is-empty .story-drawer-field-tools { display: none; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-keep {
  display: inline-flex;
  align-items: center;
  height: 28px;
  min-width: 0;
  padding: 0 12px;
  border-radius: 999px;
  border: 1.5px solid #1E2224;
  background: transparent;
  box-shadow: none;
  color: #1E2224;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-erase {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: #8C857C;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-erase::after {
  content: '';
  position: absolute;
  inset: -8px;
}

/* Evidence: dashed row, Confirm only */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-evidence {
  display: block;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-evidence.hidden { display: none; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-evidence-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border-radius: 14px;
  border: 1px dashed #CFC7BC;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-evidence.is-confirmed .story-drawer-evidence-box {
  border-style: solid;
  border-color: #E2DCD3;
  background: #FFFDFA;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-evidence-text {
  flex: 1;
  margin: 0;
  font-size: 14px;
  font-style: italic;
  line-height: 1.45;
  color: #4A4743;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-evidence.is-confirmed .story-drawer-evidence-text {
  font-style: normal;
  color: #1E2224;
}

/* Footer: teal Save + Not now · Back to lines */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-footer {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 14px 16px max(16px, calc(env(safe-area-inset-bottom, 0px) + 10px));
  border-top: 1px solid #E8E3DC;
  background: #F4F0EB;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell #precoach-story-end-save.precoach-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: none;
  height: 54px;
  min-height: 54px;
  margin: 0;
  padding: 0 20px;
  border: none;
  border-radius: 999px;
  background: #0F6B5C !important;
  color: #fff !important;
  font-size: 16px;
  font-weight: 600;
  box-shadow: none !important;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell #precoach-story-end-save.precoach-cta.is-busy { opacity: 0.85 !important; cursor: progress; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-not-now,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-back-lines {
  display: inline-flex;
  align-items: center;
  width: auto;
  min-height: 32px;
  margin: 0;
  padding: 0 4px;
  border: none;
  background: none;
  box-shadow: none;
  color: #4A4743;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-not-now:disabled,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-back-lines:disabled { color: #C4BDB3; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-dot { color: #C4BDB3; }

/* Save busy: fields at 60% and locked */
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell #precoach-story-end-drawer.is-busy .story-drawer-scroll,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell #precoach-story-end-drawer.is-busy .story-drawer-close {
  opacity: 0.6;
  pointer-events: none;
}

/* ======================================================================
   Saved (comp 1a·5a told / 5b draft)
   ====================================================================== */

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-saved > .precoach-step-eyebrow,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-saved > .precoach-story-lib,
html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-saved > #precoach-story-end-status {
  display: none !important;
}

html[data-kouli-theme] body.is-story-saved .precoach-pack-prompt { display: none; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: calc(100dvh - 300px);
  margin: 0;
  padding: 12px 4px;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved.hidden { display: none; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  border-radius: 50%;
  background: #1E2224;
  color: #fff;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved.is-draft .story-saved-check {
  background: transparent;
  border: 1.5px solid #1E2224;
  color: #1E2224;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved-check svg { width: 18px; height: 18px; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved-title {
  margin: 0;
  font-family: Newsreader, Georgia, serif;
  font-size: 32px;
  font-weight: 500;
  line-height: 1.1;
  color: #1E2224;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved-sub {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.45;
  color: #4A4743;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid #E8E3DC;
  background: #FAF8F5;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved-card-title {
  margin: 0;
  font-family: Newsreader, Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
  color: #1E2224;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1px solid #1E2224;
  font-size: 12px;
  font-weight: 600;
  color: #1E2224;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved-chip.is-draft {
  border: 1px dashed #A8A097;
  color: #6B6762;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 2px 0;
  font-size: 13px;
  line-height: 1.45;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved.is-draft .story-saved-row {
  align-items: center;
  padding: 8px 12px;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved-row-label {
  flex: 0 0 72px;
  color: #6B6762;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved.is-draft .story-saved-row-label { flex-basis: 58px; font-size: 12px; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved-row-text { flex: 1; color: #1E2224; }

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved-row.is-pencil {
  border: 1px dashed #CFC7BC;
  border-radius: 12px;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved-row.is-pencil .story-saved-row-text {
  font-style: italic;
  color: #4A4743;
}

html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-saved-row.is-untold .story-saved-row-text { color: #8C857C; }

/* ======================================================================
   Desktop (comp 1b): picker centred · live = card on top, caption in the mist
   ====================================================================== */

@media (min-width: 900px) {
  /* The evidence bank column is suppressed on this step — give the step the full width */
  html[data-kouli-theme] body.is-story-step .precoach-shell { grid-template-columns: minmax(0, 1fr); }

  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-ready,
  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-ended {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
  }

  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-lines-q { font-size: 44px; line-height: 1.1; }
  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-lines-sub { font-size: 16px; }
  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-line { padding: 18px 20px; }
  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-line.is-active { padding: 17.5px 19.5px; }
  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-line-text { font-size: 17px; }
  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-start-from-label { flex-basis: auto; margin-right: 6px; }

  /* Picker footer: caption left of the button */
  html[data-kouli-theme] body.is-story-step:not(.is-story-saved) #precoach-arrive-sticky.precoach-step-sticky .precoach-step-actions {
    flex-direction: row;
    justify-content: center;
    gap: 20px;
  }

  html[data-kouli-theme] body.is-story-step:not(.is-story-saved) #precoach-arrive-sticky.precoach-step-sticky .precoach-step-primary {
    order: 2;
    width: auto;
    min-width: 188px;
    height: 56px;
    font-size: 18px;
  }

  html[data-kouli-theme] body.is-story-step:not(.is-story-saved) #precoach-arrive-sticky.precoach-step-sticky .story-talk-caption,
  html[data-kouli-theme] body.is-story-step:not(.is-story-saved) #precoach-arrive-sticky.precoach-step-sticky .precoach-step-secondary { order: 1; margin: 0; }

  html[data-kouli-theme] body.is-story-saved #precoach-arrive-sticky.precoach-step-sticky .precoach-step-actions { max-width: 420px; }

  /* Live */
  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-live-bar {
    order: 0;
    padding: 18px 32px 0;
  }

  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-live-bar-meta { order: -1; }

  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-live-focus {
    order: 1;
    width: min(1120px, calc(100% - 64px));
    margin: 0 auto;
    padding: 18px 0 0;
    font-size: 15px;
    color: #4A4743;
  }

  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-card {
    order: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
    width: min(1120px, calc(100% - 64px));
    height: auto;
    min-height: 0;
    max-height: 52dvh;
    margin: 16px auto 0;
    border: none;
    border-radius: 0;
    background: none;
    overflow: visible;
  }

  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-card .story-card-head {
    grid-column: 1 / -1;
    padding: 0 2px;
    border: none;
  }

  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-card .story-card-slot {
    max-height: 46dvh;
    overflow: hidden;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid #E8E3DC;
    background: #FAF8F5;
  }

  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-live-caption {
    order: 3;
    flex: 1 1 0;
    position: relative;
    z-index: 1;
    /* Sit under the story cards — flex-end left a huge empty band above the line. */
    justify-content: flex-start;
    align-items: center;
    padding: 72px 40px 14px;
    text-align: center;
  }

  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-caption-eyebrow,
  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-caption-prev { display: none; }

  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-live-caption.is-user-turn .story-caption-prev,
  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-live-caption:has(.story-caption-current:empty) .story-caption-prev {
    display: block;
    max-width: 820px;
    font-size: 24px;
    color: #4A4743;
  }

  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-caption-current {
    max-width: 820px;
    font-size: 32px;
  }

  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .sb-mist-stage { order: 4; }
  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-mist-wash { height: 200px; }
  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell.is-story-live .story-voice-dock { padding-bottom: 32px; }

  /* Drawer: 560px side sheet */
  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell #precoach-story-end-drawer.sb-save-drawer {
    left: auto;
    top: 0;
    width: 560px;
    max-height: none;
    border-radius: 0;
    box-shadow: -12px 0 40px rgba(30, 34, 36, 0.12);
    animation-name: story-sheet-in;
  }

  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-grab { display: none; }
  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-header { padding: 32px 32px 12px; }
  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-scroll { padding: 4px 32px 24px; }

  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell .story-drawer-footer {
    flex-direction: row-reverse;
    justify-content: space-between;
    padding: 18px 32px 24px;
  }

  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell #precoach-story-end-save.precoach-cta { width: auto; min-width: 220px; }
}

/* ======================================================================
   Motion
   ====================================================================== */

@keyframes story-caret { 50% { opacity: 0; } }
@keyframes story-spin { to { transform: rotate(360deg); } }
@keyframes story-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes story-ink-settle { from { color: #B8B0A5; } to { color: #1E2224; } }
@keyframes story-bar { 0%, 100% { transform: scaleY(0.55); } 50% { transform: scaleY(1); } }
@keyframes story-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes story-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes story-sheet-in { from { transform: translateX(100%); } to { transform: translateX(0); } }

@media (prefers-reduced-motion: reduce) {
  html[data-kouli-theme] body.is-story-step .precoach-story-end-shell *,
  html[data-kouli-theme] body.is-story-step .story-drawer-scrim {
    animation: none !important;
    transition: none !important;
  }
}
