:root {
  /* CaseCraft design system (Screen-4) */
  --cc-blue: #2348e8;
  --cc-blue-deep: #0f2ec4;
  --cc-blue-soft: #eef2ff;
  --cc-coral: #ff5a2c;
  --cc-coral-soft: #ffede6;
  --cc-navy: #0f1e46;
  --cc-body: #5b6478;
  --cc-line: #e4e8f2;
  --cc-font: Inter, Poppins, system-ui, sans-serif;
  --cc-card-shadow:
    0 30px 70px -30px rgba(15, 30, 70, 0.4),
    0 6px 16px -8px rgba(15, 30, 70, 0.12);

  --ink: var(--cc-navy);
  --ink-2: var(--cc-body);
  --ink-3: #8a93a6;
  --line: var(--cc-line);
  --line-2: #f1f3f9;
  --bg: #fbfcff;
  --card: #ffffff;
  --p: var(--cc-blue);
  --p-2: var(--cc-blue-deep);
  /* Primary CTA — coral on flow screens (Screen-4 send) */
  --btn-primary-grad: var(--cc-coral);
  --btn-primary-grad-hover: #ff6b42;
  --btn-primary-shadow: 0 12px 26px -10px rgba(255, 90, 44, 0.6);
  --btn-primary-shadow-hover: 0 16px 30px -10px rgba(255, 90, 44, 0.7);
  --p-soft: var(--cc-blue-soft);
  --green: #16a34a;
  --green-soft: #e7f6ec;
  --p-soft-text: var(--cc-blue);
  --amber-soft: #fffbeb;
  --amber-line: #fcd34d;
  --r-md: 12px;
  --r-lg: 22px;
  --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.32, 0.64, 1);
  --dur-fast: 140ms;
  --dur: 240ms;
  --dur-page: 520ms;
  --font: var(--cc-font);
  --font-brand: var(--cc-font);
  --font-display: var(--cc-font);
  /* Clear weight ladder — only use loaded faces (400/500/600/700) */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --max: 860px;

  /* Success / trust palette (Reassurance system) */
  --success-bg: #e7f6ec;
  --success-bg-soft: #f1faf4;
  --success-border: #cdebd6;
  --success-text: #0b7a43;
  --success-ink: #12332a;
  --success-icon: #16a34a;
  --success-radius: 16px;
  --success-pad: 16px 20px;
  --success-gap: 10px;
  --reassurance-stack-gap: 16px;
  --composer-bottom-gap: 16px;

  /* Chips, tags, answer tiles */
  --chip-radius: 12px;
  --chip-gap: 10px;
  --chip-pad-y: 10px;
  --chip-pad-x: 14px;
  --chip-stack-gap: 12px;
  --chip-ic-size: 28px;
  --tag-pill-pad-y: 7px;
  --tag-pill-pad-x: 14px;
  --tag-pill-gap: 8px;
  --tile-gap: 12px;
  --tile-pad-y: 12px;
  --tile-pad-x: 14px;
  --tile-inner-gap: 6px;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: var(--fw-regular);
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body.embed-mode {
  background: transparent;
  height: auto;
  min-height: 0;
}

.hidden {
  display: none !important;
}

/* —— Wizard shell —— */
.wiz {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #fbfcff 0%, #f3f6ff 100%);
  font-family: var(--cc-font);
  color: var(--cc-navy);
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* Soft blue wash — matches JustClaim file-claim */
.story-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  display: none;
}

.story-glow.is-hidden {
  opacity: 0;
}

@keyframes story-glow-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

body.embed-mode .story-glow {
  display: none;
}

.wiz-progress {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px clamp(20px, 4vw, 48px);
  box-sizing: border-box;
  border-bottom: 1px solid rgba(228, 232, 242, 0.7);
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.55);
  font-family: var(--cc-font);
  /* Keep active step rings from being clipped by .wiz overflow */
  overflow: visible;
}

.wiz-brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
  line-height: 0;
  transition: opacity var(--dur) var(--ease-out);
}

.wiz-brand:hover {
  opacity: 0.72;
}

.wiz-brand-logo {
  display: block;
  height: 32px;
  width: auto;
  max-width: min(186px, 42vw);
}

.progress-segments:not(.progress-stepper) {
  display: flex;
  gap: 18px;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 8px 0 0;
}

.progress-stepper {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  left: auto;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  /* Room for the active bead ring (box-shadow) */
  padding: 6px 2px;
  margin: 0;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-padding-inline: 8px;
}

/* Pushes steps right when there’s room; shrinks first so beads 1–2 never clip */
.progress-stepper::before {
  content: '';
  flex: 1 1 auto;
  min-width: 0;
}

.progress-stepper::-webkit-scrollbar {
  display: none;
}

.progress-seg-wrap {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: default;
}

.progress-bead {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: 13px;
  background: #fff;
  border: 2px solid var(--cc-line);
  color: var(--cc-body);
  transition: 0.2s;
  flex: none;
}

.progress-seg-wrap.is-done .progress-bead {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.progress-seg-wrap.is-active .progress-bead {
  background: var(--cc-blue);
  border-color: var(--cc-blue);
  color: #fff;
  box-shadow: 0 0 0 5px rgba(35, 72, 232, 0.12);
}

.progress-connector {
  width: 34px;
  height: 2px;
  border-radius: 2px;
  background: var(--cc-line);
  margin: 0 14px;
  flex: none;
}

.progress-connector.is-fill {
  background: linear-gradient(90deg, var(--green), var(--cc-blue));
}

.progress-seg {
  display: none;
}

.progress-seg-label {
  font-family: var(--cc-font);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  color: var(--cc-body);
  line-height: 1.2;
  white-space: nowrap;
}

.progress-seg-wrap.is-done .progress-seg-label,
.progress-seg-wrap.is-active .progress-seg-label {
  color: var(--cc-navy);
}

.wiz-main {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 0 clamp(16px, 3vw, 32px) max(24px, env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
  font-family: var(--cc-font);
}

/* Chat: transcript scrolls; composer stays visible */
.wiz-main:has(#story-intro:not(.hidden)) {
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wiz-main:has(#story-intro:not(.hidden)) #story-intro {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.story-intro-top {
  width: 100%;
}

.wiz-main:has(#chat-screen:not(.hidden)) {
  overflow: hidden;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wiz-main:has(#chat-screen:not(.hidden)) #chat-screen {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.wiz-main:has(#chat-screen:not(.hidden)) .s-chat {
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: 0;
}

.wiz-main:has(#rights-screen:not(.hidden)),
.wiz-main:has(#draft-screen:not(.hidden)),
.wiz-main:has(#building-screen:not(.hidden)) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wiz-main:has(#rights-screen:not(.hidden)) .ls-screen,
.wiz-main:has(#draft-screen:not(.hidden)) .draft-screen {
  flex: 1 1 auto;
  min-height: 0;
}

/* Shared kicker pill (story, chat phase, resume, rights, draft) */
.cc-kicker,
.phase-eyebrow,
.rs-eyebrow,
.draft-eyebrow,
.ls-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--tag-pill-gap);
  background: var(--cc-blue-soft);
  color: var(--cc-blue);
  font-weight: var(--fw-semibold);
  font-size: 13px;
  line-height: 1.25;
  padding: var(--tag-pill-pad-y) var(--tag-pill-pad-x);
  border-radius: 99px;
  border: 1px solid rgba(35, 72, 232, 0.14);
  text-transform: none;
  letter-spacing: normal;
}

.phase-eyebrow::before,
.rs-eyebrow::before,
.draft-eyebrow::before,
.ls-badge::before {
  display: none;
}

.ls-badge {
  font-weight: var(--fw-semibold);
  margin: 0 auto 20px;
}

/* —— Story intro (Screen-4) —— */
.story-intro {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  min-height: 0;
  padding: 28px 32px 64px;
  font-family: var(--cc-font);
  color: var(--cc-navy);
  animation: chatIn 540ms var(--ease-smooth) both;
}

.story-intro-kicker {
  margin-bottom: 20px;
}

.story-kicker-spark {
  width: 14px;
  height: 14px;
  flex: none;
}

.story-intro-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: 0;
}

.story-intro-title {
  font-family: var(--cc-font);
  font-weight: 800;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--cc-navy);
  margin: 0;
  text-wrap: balance;
}

.story-title-accent {
  color: var(--cc-blue);
}

.story-intro-steps {
  max-width: 540px;
  margin: 12px auto 0;
  font-size: 17px;
  line-height: 1.5;
  font-weight: var(--fw-medium);
  color: var(--cc-body);
  text-wrap: pretty;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  align-content: center;
  gap: var(--chip-stack-gap);
  width: 100%;
}

.story-intro-chips {
  justify-content: center;
  max-width: 780px;
  margin: 28px auto 0;
  padding: 0 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--chip-gap);
  background: #fff;
  border: 1.5px solid var(--cc-line);
  border-radius: var(--chip-radius);
  padding: var(--chip-pad-y) var(--chip-pad-x);
  font-family: var(--cc-font);
  font-size: 15px;
  font-weight: var(--fw-semibold);
  line-height: 1.3;
  color: var(--cc-navy);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 30, 70, 0.04);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    border-color 0.16s,
    transform 0.16s,
    box-shadow 0.16s,
    background 0.16s;
}

.chip-ic {
  width: var(--chip-ic-size);
  height: var(--chip-ic-size);
  border-radius: 8px;
  background: var(--cc-blue-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--cc-blue);
}

.chip-ic svg {
  display: block;
  flex: none;
}

.chip-muted .chip-ic {
  background: #f1f3f9;
  color: var(--cc-body);
}

.chip:hover {
  border-color: rgba(35, 72, 232, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -10px rgba(35, 72, 232, 0.3);
}

.chip:focus {
  outline: 2px solid var(--cc-blue);
  outline-offset: 2px;
}

.chip.sel,
.chip.on {
  border-color: var(--cc-blue);
  background: linear-gradient(180deg, #fff, #f7f9ff);
  box-shadow:
    0 12px 26px -12px rgba(35, 72, 232, 0.45),
    0 0 0 3px rgba(35, 72, 232, 0.1);
}

.chip.sel .chip-ic,
.chip.on .chip-ic {
  background: var(--cc-blue);
  color: #fff;
}

.chip.sel .chip-ic svg,
.chip.on .chip-ic svg {
  stroke: #fff;
}

.story-intro-composer {
  width: 100%;
  margin-top: 24px;
  flex: 0 0 auto;
  background: #fff;
  border-radius: 22px;
  border: 1.5px solid var(--cc-line);
  box-shadow: var(--cc-card-shadow);
  text-align: left;
  overflow: hidden;
}

.story-intro-field {
  padding: 26px 26px 12px;
}

.story-intro-input {
  width: 100%;
  min-height: 112px;
  max-height: 280px;
  overflow-y: auto;
  resize: none;
  border: none;
  background: transparent;
  padding: 0;
  font-family: var(--cc-font);
  font-weight: var(--fw-medium);
  font-size: 19px;
  line-height: 1.5;
  color: var(--cc-navy);
}

.story-intro-input:focus {
  outline: none;
}

.story-intro-input::placeholder {
  color: #9aa3b5;
}

.story-intro-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--cc-line);
  background: #fbfcff;
}

.story-intro-send {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--cc-coral);
  color: #fff;
  font-family: var(--cc-font);
  font-weight: var(--fw-bold);
  font-size: 16px;
  padding: 13px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 12px 26px -10px rgba(255, 90, 44, 0.6);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.story-intro-send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px -10px rgba(255, 90, 44, 0.7);
}

.story-intro-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.story-intro-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
  width: 100%;
}

.story-assure {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: var(--chip-stack-gap);
  flex-wrap: wrap;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.story-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--chip-gap);
  flex: 1 1 200px;
  max-width: 240px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--cc-line);
  border-radius: var(--chip-radius);
  padding: 11px 14px;
  font-weight: var(--fw-semibold);
  font-size: 14px;
  line-height: 1.3;
  color: var(--cc-navy);
  text-align: left;
}

.story-badge-ic {
  width: var(--chip-ic-size);
  height: var(--chip-ic-size);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.story-badge-ic svg {
  display: block;
}

.story-badge--g .story-badge-ic {
  background: var(--green-soft);
  color: var(--green);
}

.story-badge--c .story-badge-ic {
  background: var(--cc-coral-soft);
  color: var(--cc-coral);
}

.story-badge--b .story-badge-ic {
  background: var(--cc-blue-soft);
  color: var(--cc-blue);
}

.story-badge-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.story-badge-copy small {
  display: block;
  font-weight: var(--fw-medium);
  font-size: 12px;
  line-height: 1.35;
  color: var(--cc-body);
  margin-top: 0;
}

.story-intro-note {
  max-width: 560px;
  margin: 30px auto 0;
  font-size: 13.5px;
  line-height: 1.6;
  font-weight: var(--fw-medium);
  color: #8a93a6;
  text-align: center;
}

/* —— Resume screen (welcome back) —— */
.rs-screen {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 28px 0 48px;
  animation: chatIn 540ms var(--ease-smooth) both;
}

.rs-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  width: 100%;
  text-align: center;
}

.rs-root > .rs-prog,
.rs-root > .rs-card,
.rs-root > .rs-law,
.rs-root > .rs-reassurance {
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
}

.rs-eyebrow {
  margin: 0 0 16px;
}

.rs-title {
  font-family: var(--cc-font);
  font-weight: 800;
  font-size: clamp(28px, 4.2vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--cc-navy);
  margin: 0 0 10px;
  text-wrap: balance;
}

.rs-title em {
  font-style: italic;
  color: var(--ink);
}

.rs-sub {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 22px;
}

.rs-prog {
  margin: 2px 0 20px;
  width: 100%;
}

.rs-prog-track {
  height: 8px;
  border-radius: 999px;
  background: var(--line-2);
  overflow: hidden;
}

.rs-prog-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--p-2), var(--p));
  transition: width 420ms var(--ease-smooth);
}

.rs-prog-cap {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 12px;
  color: var(--ink-3);
  font-weight: var(--fw-semibold);
}

.rs-card {
  background: var(--card);
  border: 1.5px solid var(--cc-line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  margin-bottom: var(--reassurance-stack-gap);
  width: 100%;
  text-align: left;
  box-shadow: var(--cc-card-shadow);
}

.rs-sm-l {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  font-weight: var(--fw-bold);
  margin-bottom: 6px;
}

.rs-sm-what {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  white-space: pre-wrap;
}

.rs-law {
  border: 1px solid #dcfce7;
  background: color-mix(in srgb, var(--green) 6%, #fff);
  border-radius: var(--r-lg);
  padding: 15px 17px;
  margin-bottom: var(--reassurance-stack-gap);
  width: 100%;
  text-align: left;
}

.rs-law-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green);
}

.rs-law-head svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.rs-law-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: var(--fw-regular);
  color: var(--ink);
  margin-top: 8px;
}

.rs-law-line {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 4px 0 0;
}

.rs-cta {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.rs-cta-stack {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}

.rs-cta-stack .rs-continue,
.rs-cta-stack .rs-startover-btn {
  width: 100%;
  max-width: none;
  min-height: 56px;
  margin: 0;
  box-sizing: border-box;
  line-height: 1.25;
}

.rs-cta-stack .btn-primary.rs-continue {
  border: 1px solid transparent;
}

.rs-startover-btn {
  border-radius: 12px;
  border: 1.5px solid var(--cc-line);
  background: var(--card);
  color: var(--cc-navy);
  transition: background 0.12s, border-color 0.12s;
  box-shadow: 0 2px 8px rgba(15, 30, 70, 0.04);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  border-radius: 12px;
  font-family: var(--cc-font);
  font-size: 17px;
  font-weight: var(--fw-bold);
  letter-spacing: -0.005em;
  cursor: pointer;
  border: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    background 160ms var(--ease-out),
    transform 80ms var(--ease-out),
    box-shadow 200ms var(--ease-out);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
}

.btn-primary {
  background: var(--btn-primary-grad);
  color: #fff;
  width: 100%;
  border-radius: 12px;
  box-shadow:
    rgba(255, 255, 255, 0.12) 0 1px 0 inset,
    var(--btn-primary-shadow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-grad-hover);
  box-shadow:
    rgba(255, 255, 255, 0.14) 0 1px 0 inset,
    var(--btn-primary-shadow-hover);
}

.rs-startover-btn:hover {
  background: var(--line-2);
  border-color: #c7c7ce;
}

.rs-note {
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  margin: 12px 0 0;
  line-height: 1.4;
}

.wiz.is-resume .wiz-progress {
  opacity: 0;
  pointer-events: none;
  height: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

body.embed-mode #resume-screen {
  display: none !important;
}

/* —— Chat screen —— */
.s-chat {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: min(860px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  animation: fadeUp 300ms var(--ease-smooth) both;
}

.chat-phase-wrap {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 8px 0 0;
}

.phase-eyebrow {
  margin: 0 0 12px;
  animation: riseIn 460ms var(--ease-smooth) 20ms both;
}

.chat-transcript {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0 16px;
  margin: 24px 0 20px;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.messages {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 28px;
  width: 100%;
  text-align: left;
}

.message-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: auto;
  max-width: 100%;
  animation: chatIn 460ms var(--ease-smooth) both;
}

.message-row.user {
  align-self: flex-end;
  align-items: flex-end;
  max-width: 82%;
  min-width: 0;
  animation-name: chatInUser;
}

.message-row.assistant {
  align-self: flex-start;
  align-items: flex-start;
  max-width: 80%;
  min-width: 0;
}

.message {
  font-size: 17px;
  line-height: 1.55;
  overflow-wrap: break-word;
  word-break: normal;
}

.message-row.user .message {
  display: inline-block;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  background: #fff;
  color: var(--cc-navy);
  border: 1.5px solid var(--cc-line);
  border-radius: 16px;
  padding: 12px 18px;
  white-space: pre-wrap;
  text-align: left;
  transform-origin: right bottom;
  box-shadow: 0 2px 8px rgba(15, 30, 70, 0.04);
}

.message-row.assistant .message {
  align-self: stretch;
  max-width: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 4px 0;
  font-weight: var(--fw-regular);
  letter-spacing: -0.005em;
  color: var(--cc-navy);
  text-align: left;
}

.message.assistant p {
  margin: 0 0 0.65rem;
  text-align: left;
}

.message.assistant p:last-child {
  margin-bottom: 0;
}

.message.assistant .msg-heading {
  margin: 0.2rem 0 0.45rem;
  font-size: 0.98rem;
  font-weight: var(--fw-bold);
  text-align: left;
}

.message.assistant .msg-list {
  margin: 0.3rem 0 0.65rem;
  /* Safari/WebKit clips outside markers when an ancestor scrolls (overflow-y:auto).
     Keep markers inside the content box so "1." / "2." are never cut off. */
  padding-left: 0;
  padding-inline-start: 0;
  font-weight: var(--fw-regular);
  text-align: left;
  list-style-position: inside;
}

.message.assistant .msg-list li {
  margin-bottom: 0.3rem;
  padding-left: 0.15rem;
}

.message.assistant ol.msg-list li::marker {
  font-variant-numeric: tabular-nums;
}

.message.assistant strong {
  font-weight: var(--fw-bold);
}

.message.streaming.thinking {
  font-weight: var(--fw-regular);
  text-align: left;
}

.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0 0.15rem;
  min-height: 1.5rem;
}

.thinking-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--p);
  animation: thinking-dot 1.2s infinite ease-in-out;
}

.thinking-dots span:nth-child(1) { animation-delay: 0s; }
.thinking-dots span:nth-child(2) { animation-delay: 0.15s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes thinking-dot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.message-body.fade-in {
  animation: message-fade-in 0.45s ease-out forwards;
}

@keyframes message-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Choice tiles / chips under latest question */
.choice-panel {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 4px 0 12px;
  animation: chatMount 340ms var(--ease-smooth) both;
}

.choice-inline {
  margin: 8px 0 0;
  width: 100%;
  max-width: min(600px, 100%);
  animation: chatMount 340ms var(--ease-smooth) both;
}

.messages > .choice-inline,
.messages > .choice-groups {
  align-self: flex-start;
  max-width: min(600px, 82%);
}

.message-row.assistant + .choice-inline,
.message-row.assistant + .choice-groups {
  margin-top: 8px;
  margin-bottom: 12px;
}

.choice-groups {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  margin: 8px 0 0;
  width: 100%;
  max-width: min(600px, 100%);
  animation: chatMount 340ms var(--ease-smooth) both;
}

.choice-groups-note {
  margin: 0 0 2px;
  padding: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-3);
  text-align: left;
}

.choice-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.choice-group-label {
  margin: 0;
  padding: 0 2px;
  font-size: 13px;
  font-weight: var(--fw-bold);
  line-height: 1.35;
  color: var(--ink-2);
  letter-spacing: -0.01em;
  text-align: left;
}

.choice-group.is-answered .choice-group-label::after {
  content: " ✓";
  color: var(--green);
  font-weight: var(--fw-bold);
}

.choice-group .choice-inline {
  margin: 0;
  animation: none;
}

.chat-tile-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: stretch;
  gap: var(--tile-gap);
  margin: 0;
  width: 100%;
}

.chat-tile-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--tile-gap);
  margin: 0;
  width: 100%;
}

.chat-tile-stack .chat-tile {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: var(--tile-pad-y) var(--tile-pad-x);
}

.chat-tile {
  flex: 1 1 220px;
  min-width: min(220px, 100%);
  max-width: min(280px, 100%);
  text-align: left;
  background: #fff;
  border: 1.5px solid var(--cc-line);
  border-radius: var(--chip-radius);
  padding: var(--tile-pad-y) var(--tile-pad-x);
  cursor: pointer;
  font-family: var(--cc-font);
  color: var(--cc-navy);
  box-shadow: 0 2px 8px rgba(15, 30, 70, 0.04);
  transition:
    border-color 0.16s,
    transform 0.16s,
    box-shadow 0.16s,
    background 0.16s;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--tile-inner-gap);
}

.chat-tile:hover {
  border-color: rgba(35, 72, 232, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -10px rgba(35, 72, 232, 0.3);
}

.chat-tile:active {
  transform: translateY(0);
}

.chat-tile.is-on {
  border-color: var(--cc-blue);
  background: linear-gradient(180deg, #fff, #f7f9ff);
  color: var(--cc-navy);
  box-shadow:
    0 12px 26px -12px rgba(35, 72, 232, 0.45),
    0 0 0 3px rgba(35, 72, 232, 0.1);
}

.chat-tile-opt {
  font-size: 11px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cc-blue);
  margin: 0;
  line-height: 1.2;
}

.chat-tile.is-on .chat-tile-opt {
  color: var(--cc-blue-deep);
}

.chat-tile-t {
  font-weight: var(--fw-bold);
  font-size: 17px;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0;
}

.chat-tile-s {
  font-size: 14px;
  color: var(--cc-body);
  line-height: 1.4;
  margin: 0;
}

.chat-tile.is-on .chat-tile-s {
  color: var(--cc-body);
}

.choice-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--chip-stack-gap);
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

/* Composer */
.chat-composer {
  flex: 0 0 auto;
  margin-top: 8px;
  padding-bottom: calc(var(--composer-bottom-gap) + env(safe-area-inset-bottom, 0px));
  animation: composerSettle 420ms var(--ease-smooth) both;
}

.chat-composer-inner {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 16px 14px 22px;
  background: #fff;
  border: 1.5px solid var(--cc-line);
  border-radius: 22px;
  box-shadow: var(--cc-card-shadow);
  transition: border-color 120ms, box-shadow 120ms;
}

.chat-composer-inner:focus-within {
  border-color: rgba(35, 72, 232, 0.35);
  box-shadow:
    var(--cc-card-shadow),
    0 0 0 3px rgba(35, 72, 232, 0.08);
}

.chat-composer-field {
  flex: 1 1 0%;
  min-width: 0;
}

.chat-input {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  padding: 4px 0;
  min-height: 26px;
  max-height: 180px;
  overflow-y: auto;
  font-family: var(--cc-font);
  font-weight: var(--fw-medium);
  font-size: 17px;
  line-height: 1.45;
  color: var(--cc-navy);
}

.chat-input::placeholder {
  color: #9aa3b5;
}

.chat-input:focus {
  outline: none;
}

.chat-send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: #c5cad6;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 140ms, opacity 140ms, transform 80ms, box-shadow 140ms;
}

.chat-send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--btn-primary-shadow-hover);
}

.chat-send:not(:disabled) {
  background: var(--cc-coral);
  box-shadow: var(--btn-primary-shadow);
}

.chat-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Assessment card */
.assessment {
  align-self: center;
  width: min(560px, 100%);
  margin-top: 0.25rem;
  animation: chatIn 460ms var(--ease-smooth) both;
}

.summary-card {
  border-radius: var(--r-lg);
  padding: 1rem 1.15rem;
  border: 1.5px solid var(--cc-line);
  background: var(--card);
  box-shadow: var(--cc-card-shadow);
}

.summary-top {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.summary-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--green-soft);
  color: var(--green);
  font-weight: var(--fw-bold);
}

.summary-card--review .summary-icon {
  background: var(--amber-soft);
  color: #b45309;
}

.summary-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 12px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.summary-headline {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--cc-navy);
}

.summary-hero {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: var(--cc-blue-soft);
  border: 1px solid rgba(35, 72, 232, 0.12);
  margin-bottom: 0.85rem;
}

.summary-hero-label {
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: var(--p);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-hero-value {
  font-size: 1.35rem;
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
}

.summary-hero-sub {
  font-size: 13px;
  color: var(--ink-3);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.summary-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.summary-stat--wide {
  grid-column: 1 / -1;
}

.summary-label {
  font-size: 12px;
  font-weight: var(--fw-semibold);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.summary-value {
  font-size: 0.95rem;
  font-weight: var(--fw-semibold);
  color: var(--ink);
}

.summary-unlock {
  margin-bottom: 0.85rem;
}

.summary-unlock h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.summary-unlock p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-2);
  line-height: 1.5;
  font-weight: var(--fw-regular);
}

.summary-body--muted p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-2);
  line-height: 1.5;
}

.summary-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.75rem;
  text-align: center;
}

.summary-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.15rem;
  border-radius: 12px;
  background: var(--btn-primary-grad);
  color: #fff;
  text-decoration: none;
  font-weight: var(--fw-bold);
  font-size: 0.95rem;
  box-shadow: var(--btn-primary-shadow);
  transition:
    background 140ms,
    box-shadow 200ms,
    transform 80ms;
}

.summary-cta:hover {
  background: var(--btn-primary-grad-hover);
  box-shadow: var(--btn-primary-shadow-hover);
  transform: translateY(-1px);
}

.summary-cta-note {
  margin: 0.45rem 0 0;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
}

.summary-disclaimer {
  margin: 0;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.45;
  text-align: center;
}

.summary-secondary-actions {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 14px;
}

.summary-new-claim {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--cc-line);
  background: transparent;
  color: var(--cc-body);
  font-family: var(--cc-font);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  line-height: 1.3;
  cursor: pointer;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    color 140ms var(--ease-out),
    border-color 140ms var(--ease-out),
    background 140ms var(--ease-out);
}

.summary-new-claim:hover {
  color: var(--cc-navy);
  border-color: color-mix(in srgb, var(--cc-navy) 22%, var(--cc-line));
  background: rgba(255, 255, 255, 0.7);
}

.summary-new-claim:active {
  transform: translateY(1px);
}

/* Start new claim CTA (when user asks to begin another claim) */
.new-claim-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  max-width: min(420px, 100%);
  margin: 8px 0 4px;
  padding: 0;
}

.new-claim-cta-btn {
  min-height: 52px;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: var(--fw-bold);
}

.new-claim-cta-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-3);
  text-align: left;
}

.continue-rights-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  max-width: min(420px, 100%);
  margin: 8px 0 4px;
  padding: 0;
}

.continue-rights-cta-btn {
  min-width: min(220px, 100%);
  min-height: 52px;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: var(--fw-bold);
}

.continue-rights-cta-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-3);
  text-align: left;
}

/* Claim CTA banner after summary */
.claim-cta-banner {
  margin-top: 0.5rem;
  max-width: 560px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1.5px solid color-mix(in srgb, var(--green) 22%, transparent);
  background: var(--green-soft);
  color: var(--p-soft-text);
  animation: closerIn 720ms var(--ease-spring) both;
}

.claim-cta-banner h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--ink);
}

.claim-cta-banner p {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  line-height: 1.5;
  font-weight: var(--fw-regular);
}

/* Animations */
@keyframes chatIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes chatInUser {
  0% { opacity: 0; transform: translate(8px, 6px); }
  100% { opacity: 1; transform: translate(0, 0); }
}

@keyframes fadeUp {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes riseIn {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes composerSettle {
  0% { opacity: 0; transform: translateY(-22px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes chatMount {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes closerIn {
  0% { opacity: 0; transform: translateY(12px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Embed mode: compact chat-only shell */
/* —— Your Rights splash —— */
.ls-screen {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: min(860px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  animation: fadeUp 360ms var(--ease-smooth) both;
}

.ls-slides {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 12px;
}

.ls-slide {
  display: none;
  width: 100%;
  max-width: 560px;
  text-align: center;
  animation: fadeUp 420ms var(--ease-smooth) both;
}

.ls-slide.ls-active {
  display: block;
}

.ls-h1 {
  font-family: var(--cc-font);
  font-size: clamp(28px, 4.2vw, 40px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  color: var(--cc-navy);
}

.ls-rule {
  width: 48px;
  height: 1px;
  background: var(--ink);
  margin: 0 auto 18px;
  opacity: 0.55;
}

.ls-quote {
  font-size: 17px;
  line-height: 1.5;
  color: var(--cc-blue);
  font-style: italic;
  margin: 0 0 22px;
}

.ls-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--tag-pill-gap);
  margin: 8px auto 0;
  padding: 9px 16px;
  border-radius: 99px;
  background: var(--cc-blue-soft);
  border: 1px solid rgba(35, 72, 232, 0.14);
  color: var(--cc-blue);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  line-height: 1.3;
  text-align: center;
}

.ls-pill span[aria-hidden="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  flex: none;
  font-size: 0.95em;
}

.ls-kicker {
  font-size: 12px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 10px;
}

.ls-body {
  font-size: 17px;
  line-height: 1.55;
  font-weight: var(--fw-regular);
  color: var(--cc-body);
  margin: 0 0 16px;
}

.ls-bottom {
  flex: 0 0 auto;
  padding: 12px 16px 28px;
  width: 100%;
  box-sizing: border-box;
}

.ls-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  align-items: stretch;
}

.ls-actions .wiz-back,
.ls-actions .ls-next,
.draft-actions .wiz-back,
.draft-actions .btn-primary {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  box-sizing: border-box;
  white-space: nowrap;
  line-height: 1.2;
}

.ls-actions--solo {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}

.ls-actions--solo .ls-next {
  width: min(100%, 320px);
}

.wiz-back {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--cc-line);
  background: #fff;
  color: var(--cc-navy);
  border-radius: 12px;
  padding: 16px 24px;
  font-family: var(--cc-font);
  font-size: 17px;
  font-weight: var(--fw-bold);
  letter-spacing: -0.005em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(15, 30, 70, 0.04);
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}

.wiz-back:hover {
  background: var(--line-2);
}

.ls-actions .ls-next,
.draft-actions .btn-primary {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.ls-actions .ls-next.ls-next--long {
  font-size: clamp(13px, 3.35vw, 17px);
  padding-left: 14px;
  padding-right: 14px;
  letter-spacing: -0.02em;
}

.ls-actions:has(.ls-next--long) .wiz-back {
  font-size: clamp(13px, 3.35vw, 17px);
  padding-left: 14px;
  padding-right: 14px;
  letter-spacing: -0.02em;
}

/* —— Draft unlocked bridge —— */
.draft-screen {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: min(860px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeUp 360ms var(--ease-smooth) both;
  font-family: var(--cc-font);
  color: var(--cc-navy);
}

.draft-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.draft-panel {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}

.draft-eyebrow {
  margin: 0;
}

.draft-title {
  font-family: var(--cc-font);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.02em;
  color: var(--cc-navy);
}

.draft-sub {
  margin: 0;
  max-width: 42ch;
  color: var(--cc-body);
  font-size: 16px;
  line-height: 1.5;
}

.draft-card {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1.5px solid var(--cc-line);
  border-radius: var(--r-lg);
  padding: 22px 24px 8px;
  box-shadow: var(--cc-card-shadow);
}

.draft-block {
  padding: 0 0 18px;
}

.draft-label {
  font-size: 11px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 6px;
}

.draft-value {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}

.draft-value strong {
  color: var(--green);
  font-weight: var(--fw-bold);
}

/* —— Building / drafting claim —— */
.building-screen {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: min(560px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  animation: fadeUp 360ms var(--ease-smooth) both;
}

.building-root {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.building-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--cc-line);
  border-top-color: var(--cc-blue);
  animation: buildingSpin 0.85s linear infinite;
}

@keyframes buildingSpin {
  to {
    transform: rotate(360deg);
  }
}

.building-title {
  margin: 8px 0 0;
  font-family: var(--cc-font);
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--cc-navy);
}

.building-sub {
  margin: 0;
  max-width: 36ch;
  font-size: 15px;
  line-height: 1.5;
  color: var(--cc-body);
}

body.embed-mode .wiz {
  position: relative;
  inset: auto;
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.embed-mode .wiz-progress,
body.embed-mode #story-intro,
body.embed-mode #rights-screen,
body.embed-mode #draft-screen,
body.embed-mode #building-screen {
  display: none !important;
}

body.embed-mode #chat-screen {
  display: flex !important;
  flex: 1 1 auto;
  min-height: 0;
  max-width: 100%;
}

body.embed-mode .wiz-main {
  padding: 0;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.embed-mode .chat-phase-wrap {
  display: none;
}

/* Hide step labels before the row starts clipping beads 1–2 */
@media (max-width: 1280px) {
  .progress-stepper .progress-seg-label {
    display: none;
  }

  .progress-connector {
    width: 22px;
    margin: 0 10px;
  }
}

@media (max-width: 980px) {
  .progress-connector {
    width: 16px;
    margin: 0 6px;
  }
}

@media (max-width: 820px) {
  .wiz-progress {
    padding: 20px 24px;
    gap: 24px;
  }

  .story-intro-title {
    font-size: 38px;
  }

  .story-assure {
    flex-wrap: wrap;
  }
}

/* —— Mobile & tablet —— */
@media (max-width: 720px) {
  .wiz-progress {
    align-items: center;
    gap: 16px;
    padding: 16px 16px 14px;
    padding-top: max(16px, env(safe-area-inset-top, 0px));
  }

  .wiz-brand-logo {
    height: 28px;
    max-width: min(160px, 40vw);
  }

  .progress-stepper {
    flex: 1 1 auto;
    min-width: 0;
  }

  .progress-stepper::before {
    flex-basis: 0;
    flex-grow: 1;
  }

  .progress-bead {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .progress-seg-wrap.is-active .progress-bead {
    box-shadow: 0 0 0 4px rgba(35, 72, 232, 0.12);
  }

  .progress-connector {
    width: 14px;
    margin: 0 6px;
    flex-shrink: 0;
  }

  .wiz-main {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }

  .wiz-main:has(#story-intro:not(.hidden)) {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
  }

  .story-intro {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .story-intro-top {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  .story-intro-composer {
    flex-shrink: 0;
    margin-top: 8px;
    margin-bottom: 8px;
    width: 100%;
    border-radius: 18px;
    box-shadow:
      0 -10px 36px -14px rgba(15, 30, 70, 0.12),
      var(--cc-card-shadow);
  }

  .story-intro-foot {
    flex-shrink: 0;
    max-height: min(32vh, 220px);
    overflow-y: auto;
    margin-top: 0;
    padding: 0 0 4px;
  }

  .story-assure {
    display: none;
  }

  .story-intro-note {
    margin-top: 0;
    font-size: 11.5px;
  }

  .story-intro-title {
    font-size: clamp(28px, 8vw, 38px);
  }

  .story-intro-steps {
    font-size: 16px;
    margin-top: 10px;
    padding: 0 4px;
  }

  .story-intro-chips {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--chip-stack-gap);
    margin-top: 22px;
    padding: 0;
  }

  .story-intro-chips .chip {
    width: auto;
    justify-content: flex-start;
    font-size: 14px;
    padding: var(--chip-pad-y) var(--chip-pad-x);
    min-height: 0;
  }

  .story-intro-composer {
    border-radius: 18px;
    margin-top: 20px;
  }

  .story-intro-field {
    padding: 18px 16px 10px;
  }

  .story-intro-input {
    font-size: 17px;
    min-height: 72px;
    max-height: 112px;
  }

  .story-intro-bar {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
  }

  .story-intro-send {
    margin-left: auto;
    width: auto;
    min-height: 48px;
    font-size: 16px;
    padding: 13px 20px;
  }

  .story-intro-foot {
    margin-top: 20px;
    padding: 0 16px;
  }

  .story-assure {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .story-badge {
    width: 100%;
    max-width: none;
    flex: 1 1 100%;
    margin: 0;
  }

  .story-intro-note {
    font-size: 12.5px;
    margin-top: 20px;
    padding: 0 4px;
  }

  .wiz-main:has(#chat-screen:not(.hidden)) {
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
  }

  .cc-kicker,
  .phase-eyebrow,
  .rs-eyebrow,
  .draft-eyebrow,
  .ls-badge,
  .story-intro-kicker {
    font-size: 12px;
    padding: 6px 12px;
    max-width: 100%;
    text-wrap: balance;
    justify-content: center;
    text-align: center;
  }

  .rs-screen {
    padding: 20px 0 32px;
  }

  .rs-title {
    font-size: clamp(26px, 7vw, 36px);
  }

  .rs-card,
  .draft-card {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .rs-cta-stack {
    width: 100%;
  }

  .ls-slides {
    padding: 16px 8px 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .ls-screen {
    min-height: 0;
    overflow: hidden;
  }

  .ls-slide {
    max-width: 100%;
  }

  .ls-h1 {
    font-size: clamp(24px, 6.5vw, 34px);
  }

  .ls-body,
  .ls-quote {
    font-size: 16px;
  }

  .ls-bottom {
    padding: 12px 8px max(20px, env(safe-area-inset-bottom, 0px));
  }

  .ls-actions,
  .draft-actions {
    max-width: none;
    padding: 0;
    gap: 10px;
  }

  .ls-actions .wiz-back,
  .ls-actions .ls-next,
  .draft-actions .wiz-back,
  .draft-actions .btn-primary {
    font-size: 16px;
    padding: 14px 16px;
    min-height: 48px;
  }

  .ls-actions .ls-next.ls-next--long,
  .ls-actions:has(.ls-next--long) .wiz-back {
    font-size: clamp(12px, 3.1vw, 15px);
    padding: 14px 10px;
  }

  .draft-stage {
    padding: 16px 8px 8px;
    align-items: center;
    justify-content: center;
  }

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

  .draft-screen {
    min-height: 0;
    overflow: hidden;
  }

  .draft-title {
    font-size: clamp(24px, 6.5vw, 32px);
  }

  .draft-actions {
    max-width: 100%;
  }

  .building-screen {
    padding: 32px 12px;
  }

  .s-chat {
    max-width: 100%;
  }

  .chat-phase-wrap {
    padding: 4px 0 0;
  }

  .chat-transcript {
    margin: 12px 0 8px;
    padding-bottom: 8px;
  }

  .messages {
    gap: 20px;
  }

  .message {
    font-size: 16px;
  }

  .message-row.user,
  .message-row.assistant {
    max-width: 94%;
  }

  .messages > .choice-inline,
  .messages > .choice-groups {
    max-width: 94%;
  }

  .message-row.user .message {
    max-width: 100%;
    padding: 11px 14px;
    border-radius: 14px;
  }

  .chat-tile-row,
  .chat-tile-stack {
    max-width: 100%;
  }

  .chat-tile {
    min-width: 100%;
    max-width: none;
    flex: 1 1 100%;
  }

  .chat-tile-t {
    font-size: 16px;
  }

  .chat-composer {
    margin-top: 4px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(251, 252, 255, 0) 0%, #fbfcff 28%);
  }

  .chat-composer-inner {
    padding: 12px 12px 12px 16px;
    border-radius: 18px;
    box-shadow:
      0 16px 40px -24px rgba(15, 30, 70, 0.35),
      0 4px 12px -6px rgba(15, 30, 70, 0.1);
  }

  .chat-input {
    font-size: 16px;
  }

  .chat-send {
    width: 48px;
    height: 48px;
  }

  .choice-panel {
    padding-bottom: 6px;
  }

  .assessment {
    width: min(560px, 100%);
  }

  .summary-card {
    padding: 0.95rem 1rem;
    border-radius: 18px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .summary-hero-value {
    font-size: 1.2rem;
  }

  .summary-cta {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    box-sizing: border-box;
  }

  .claim-cta-banner {
    max-width: 100%;
    padding: 14px 14px;
  }

  .reassurance-stack {
    max-width: 100%;
  }

  .reassurance--card {
    padding: 14px 16px;
  }

  .ls-reassurance .reassurance {
    max-width: 100%;
  }

  body.embed-mode .wiz {
    padding: 0;
  }

  body.embed-mode .wiz-main {
    padding: 0 10px max(10px, env(safe-area-inset-bottom, 0px));
  }

  body.embed-mode .chat-composer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    flex-shrink: 0;
  }

  body.embed-mode .chat-transcript {
    flex: 1 1 auto;
    min-height: 0;
  }
}

@media (max-width: 400px) {
  .ls-actions:not(.ls-actions--solo),
  .draft-actions {
    grid-template-columns: 1fr;
  }

  .ls-actions--solo .ls-next {
    width: 100%;
    max-width: none;
  }

  .progress-connector {
    width: 10px;
    margin: 0 4px;
  }

  .progress-bead {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  .chip-ic {
    width: 26px;
    height: 26px;
  }

  .chip-ic svg {
    width: 16px;
    height: 16px;
  }
}

@media (min-width: 600px) {
  .progress-seg-label {
    font-size: 14px;
  }
}

/* —— Reassurance / trust UI —— */
.reassurance-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--reassurance-stack-gap);
  width: 100%;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.reassurance {
  display: flex;
  gap: var(--success-gap);
  align-items: flex-start;
  border-radius: var(--success-radius);
  color: var(--success-ink);
  text-align: left;
}

.reassurance--card {
  background: var(--success-bg-soft);
  border: 1px solid var(--success-border);
  padding: var(--success-pad);
}

.reassurance--pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--tag-pill-gap);
  width: fit-content;
  max-width: 100%;
  background: var(--success-bg);
  padding: var(--tag-pill-pad-y) var(--tag-pill-pad-x);
  border-radius: 999px;
  font-size: 0.875em;
  line-height: 1.35;
  text-align: center;
}

.reassurance__icon {
  color: var(--success-icon);
  flex: 0 0 auto;
  display: flex;
  line-height: 0;
  margin-top: 1px;
}

.reassurance__icon-svg {
  display: block;
}

.reassurance__content {
  min-width: 0;
  flex: 1 1 auto;
}

.reassurance__title {
  color: var(--success-text);
  font-weight: var(--fw-bold);
  margin: 0 0 2px;
  font-size: 0.95em;
  letter-spacing: -0.01em;
}

.reassurance__body {
  margin: 0;
  font-size: 0.9em;
  line-height: 1.45;
  font-weight: var(--fw-regular);
  color: var(--success-ink);
}

.reassurance__body strong {
  color: var(--success-text);
  font-weight: var(--fw-bold);
}

.reassurance--pill .reassurance__body {
  font-size: 1em;
}

.story-intro-foot .reassurance-stack {
  margin-bottom: 4px;
  align-items: center;
}

.summary-trust {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--reassurance-stack-gap);
  margin: 0 0 var(--reassurance-stack-gap);
}

.summary-trust .reassurance--pill {
  align-self: center;
}

.rs-reassurance {
  margin-top: 0;
}

/* Green trust blocks: full width, left-aligned on flow screens (resume + Your Rights) */
.reassurance-stack.ls-reassurance,
.reassurance-stack.rs-reassurance {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  align-items: stretch;
}

.reassurance-stack.ls-reassurance .reassurance,
.reassurance-stack.rs-reassurance .reassurance {
  width: 100%;
  max-width: none;
  align-self: stretch;
  box-sizing: border-box;
}

.reassurance-stack.ls-reassurance .reassurance--pill,
.reassurance-stack.rs-reassurance .reassurance--pill {
  align-self: flex-start;
  justify-content: flex-start;
  text-align: left;
}

.ls-reassurance {
  margin-top: var(--reassurance-stack-gap);
}
