:root {
  color-scheme: light;
  font-family:
    "Aptos", "Segoe UI Variable", "Segoe UI", ui-sans-serif, -apple-system,
    BlinkMacSystemFont, sans-serif;
  color: #17242b;
  background: #eeeae2;
  font-synthesis: none;
  --ink: #17242b;
  --ink-soft: #2d3d44;
  --muted: #68767b;
  --paper: #faf8f3;
  --paper-strong: #ffffff;
  --warm: #eeeae2;
  --line: rgba(23, 36, 43, 0.12);
  --line-strong: rgba(23, 36, 43, 0.2);
  --coral: #e7603b;
  --coral-dark: #bb4325;
  --coral-soft: #fff0e9;
  --teal: #247c74;
  --teal-soft: #eaf5f2;
  --gold: #b77a20;
  --gold-soft: #fff8ea;
  --shadow-small: 0 10px 34px rgba(23, 36, 43, 0.08);
  --shadow-large: 0 30px 90px rgba(23, 36, 43, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 0%, rgba(231, 96, 59, 0.12), transparent 28rem),
    radial-gradient(circle at 93% 12%, rgba(36, 124, 116, 0.13), transparent 33rem),
    linear-gradient(145deg, #f8f5ef 0%, #eeeae2 55%, #e7e5df 100%);
}

body.modal-open {
  overflow: hidden;
}

button,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(231, 96, 59, 0.28);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  color: #fff;
  background: var(--ink);
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.page-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.atmosphere-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

.atmosphere-orb-one {
  top: 5rem;
  left: -17rem;
  width: 38rem;
  height: 38rem;
  border: 1px solid rgba(231, 96, 59, 0.12);
  box-shadow:
    inset 0 0 0 5rem rgba(255, 255, 255, 0.08),
    inset 0 0 0 10rem rgba(231, 96, 59, 0.03);
}

.atmosphere-orb-two {
  right: -22rem;
  bottom: -17rem;
  width: 55rem;
  height: 55rem;
  border: 1px solid rgba(36, 124, 116, 0.12);
  box-shadow:
    inset 0 0 0 7rem rgba(255, 255, 255, 0.08),
    inset 0 0 0 14rem rgba(36, 124, 116, 0.03);
}

.atmosphere-grid {
  position: absolute;
  inset: 0;
  opacity: 0.23;
  background-image:
    linear-gradient(rgba(23, 36, 43, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 36, 43, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.demo-topbar {
  display: grid;
  width: min(1540px, calc(100% - 52px));
  min-height: 82px;
  margin: 0 auto;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid rgba(23, 36, 43, 0.1);
}

.demo-brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.demo-brand-mark {
  display: grid;
  width: 39px;
  height: 39px;
  overflow: hidden;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  box-shadow: 0 8px 24px rgba(23, 36, 43, 0.16);
}

.demo-brand-mark img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.demo-brand strong,
.demo-brand small {
  display: block;
}

.demo-brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.demo-brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
}

.topbar-story-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.topbar-story-label span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(231, 96, 59, 0.11);
}

.topbar-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.icon-action,
.exit-link {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.48);
}

.icon-action {
  position: relative;
  display: grid;
  width: 42px;
  padding: 0;
  place-items: center;
  cursor: pointer;
}

.mail-glyph {
  font-size: 1rem;
}

.mail-count {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 2px solid #f2eee7;
  border-radius: 50%;
  color: #fff;
  background: var(--coral);
  font-size: 0.62rem;
  font-weight: 800;
}

.exit-link {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
}

.icon-action,
.exit-link,
.control-button,
.chapter-button,
.artifact-button,
.mail-list-item,
.reply-button {
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.icon-action:hover,
.exit-link:hover {
  border-color: var(--line-strong);
  background: #fff;
  transform: translateY(-1px);
}

.demo-main {
  width: min(1540px, calc(100% - 52px));
  margin: 0 auto;
  padding: 44px 0 34px;
}

.story-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.65fr);
  align-items: end;
  gap: 48px;
  margin-bottom: 31px;
}

.story-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-eyebrow span {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--coral-dark);
  background: var(--coral-soft);
}

.story-heading h1 {
  margin: 0;
  color: var(--ink);
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 5vw, 5.6rem);
  font-weight: 500;
  letter-spacing: -0.058em;
  line-height: 0.93;
}

.story-heading h1 em {
  color: var(--coral);
  font-weight: 400;
}

.story-deck {
  max-width: 570px;
  margin: 0 0 5px;
  color: var(--ink-soft);
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: clamp(1.03rem, 1.4vw, 1.28rem);
  line-height: 1.54;
}

.replay-frame {
  display: grid;
  min-height: 670px;
  overflow: hidden;
  grid-template-columns: 230px minmax(560px, 1fr);
  border: 1px solid rgba(23, 36, 43, 0.13);
  border-radius: 25px;
  background: rgba(250, 248, 243, 0.84);
  box-shadow: var(--shadow-large);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.chapter-rail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 24px 14px 18px;
  border-right: 1px solid var(--line);
  background: rgba(239, 235, 227, 0.6);
}

.chapter-rail-heading,
.evidence-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 8px 20px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chapter-rail-heading strong {
  color: var(--ink);
  font-size: 0.66rem;
}

.chapter-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.chapter-button {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 49px;
  grid-template-columns: 29px 1fr;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 6px 9px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.chapter-button::before {
  position: absolute;
  top: 50%;
  left: -14px;
  width: 3px;
  height: 0;
  border-radius: 0 4px 4px 0;
  background: var(--coral);
  content: "";
  transform: translateY(-50%);
  transition: height 180ms ease;
}

.chapter-button:hover {
  background: rgba(255, 255, 255, 0.55);
}

.chapter-button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 7px 22px rgba(23, 36, 43, 0.07);
}

.chapter-button.active::before {
  height: 26px;
}

.chapter-number {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
}

.chapter-button.active .chapter-number {
  border-color: transparent;
  color: #fff;
  background: var(--ink);
}

.chapter-copy strong,
.chapter-copy small {
  display: block;
}

.chapter-copy strong {
  overflow: hidden;
  font-size: 0.73rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.61rem;
}

.chapter-rail-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  margin: 18px 7px 0;
  padding-top: 15px;
  color: var(--muted);
  font-size: 0.62rem;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(36, 124, 116, 0.1);
}

.story-stage {
  display: grid;
  min-width: 0;
  min-height: 670px;
  grid-template-rows: auto 3px minmax(0, 1fr) auto;
  background:
    linear-gradient(rgba(255, 255, 255, 0.81), rgba(255, 255, 255, 0.81)),
    radial-gradient(circle at 50% 0%, rgba(36, 124, 116, 0.11), transparent 28rem);
}

.stage-header {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 25px;
  border-bottom: 1px solid var(--line);
}

.stage-context p {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.stage-context h2 {
  margin: 0;
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.perspective-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(250, 248, 243, 0.9);
}

.perspective-avatar,
.message-avatar {
  flex: 0 0 auto;
  object-fit: cover;
}

.perspective-avatar {
  width: 33px;
  height: 33px;
  border-radius: 10px;
  box-shadow: 0 5px 14px rgba(23, 36, 43, 0.13);
}

.perspective-switch small,
.perspective-switch strong {
  display: block;
}

.perspective-switch small {
  color: var(--muted);
  font-size: 0.56rem;
}

.perspective-switch strong {
  margin-top: 2px;
  font-size: 0.68rem;
}

.stage-progress {
  overflow: hidden;
  background: rgba(23, 36, 43, 0.05);
}

.stage-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--coral), #f3956f);
}

.stage-body {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(23, 36, 43, 0.18) transparent;
}

.stage-scene {
  display: flex;
  width: min(100%, 980px);
  min-height: 100%;
  margin: 0 auto;
  flex-direction: column;
  justify-content: center;
  padding: 26px clamp(22px, 4vw, 52px);
  animation: scene-in 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stage-scene-long {
  justify-content: flex-start;
}

@keyframes scene-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scene-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px 48px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scene-note::before {
  width: 18px;
  height: 1px;
  background: rgba(23, 36, 43, 0.25);
  content: "";
}

.conversation {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message {
  display: flex;
  max-width: 88%;
  align-items: flex-start;
  gap: 10px;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  display: block;
  width: 34px;
  height: 34px;
  overflow: hidden;
  margin-top: 2px;
  border-radius: 11px;
  box-shadow: 0 7px 18px rgba(23, 36, 43, 0.12);
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message.agent .message-avatar {
  padding: 2px;
  background: var(--ink);
}

.message.user .message-avatar {
  border-radius: 50%;
  background: var(--paper);
}

.message.system .message-avatar {
  background: var(--gold);
}

.message-bubble {
  border: 1px solid var(--line);
  border-radius: 5px 17px 17px;
  padding: 14px 16px;
  background: #fff;
  box-shadow: 0 8px 27px rgba(23, 36, 43, 0.055);
}

.message.user .message-bubble {
  border-color: transparent;
  border-radius: 17px 5px 17px 17px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 9px 25px rgba(23, 36, 43, 0.15);
}

.message.system .message-bubble {
  border-color: #f1ddb1;
  background: var(--gold-soft);
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.59rem;
}

.message.user .message-meta {
  color: rgba(255, 255, 255, 0.66);
}

.message-meta strong {
  color: var(--ink);
  font-size: 0.64rem;
}

.message.user .message-meta strong {
  color: #fff;
}

.message-bubble p {
  margin: 0;
  font-size: clamp(0.74rem, 0.85vw, 0.84rem);
  line-height: 1.52;
}

.message-bubble p + p {
  margin-top: 10px;
}

.message-bubble ol,
.message-bubble ul {
  margin: 9px 0 0;
  padding-left: 19px;
}

.message-bubble li {
  margin: 6px 0;
  font-size: clamp(0.72rem, 0.82vw, 0.8rem);
  line-height: 1.45;
}

.message-bubble strong {
  color: inherit;
}

.message-bubble code {
  border-radius: 4px;
  padding: 1px 4px;
  color: inherit;
  background: rgba(23, 36, 43, 0.07);
  font: 0.86em ui-monospace, SFMono-Regular, Menlo, monospace;
}

.message.user .message-bubble code {
  background: rgba(255, 255, 255, 0.1);
}

.message-bubble blockquote {
  margin: 12px 0;
  border-left: 3px solid var(--teal);
  padding: 9px 12px;
  color: var(--ink-soft);
  background: var(--teal-soft);
}

.chat-link {
  color: var(--teal);
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.chat-link:hover {
  color: var(--coral-dark);
}

.chat-attachment {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 11px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.08);
}

.chat-attachment > span {
  display: grid;
  width: 29px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: #2b579a;
  font-size: 0.62rem;
  font-weight: 900;
}

.chat-attachment strong,
.chat-attachment small {
  display: block;
}

.chat-attachment strong {
  max-width: 320px;
  overflow: hidden;
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment small {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.54rem;
}

.rendered-markdown {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.long-response {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfc;
}

.long-response summary {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  color: var(--teal);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
  list-style: none;
}

.long-response summary::-webkit-details-marker {
  display: none;
}

.long-response summary::after {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: var(--ink);
  background: var(--teal-soft);
  content: "+";
  font-size: 0.9rem;
}

.long-response[open] summary {
  border-bottom: 1px solid var(--line);
}

.long-response[open] summary::after {
  content: "−";
}

.long-response summary span,
.long-response summary small {
  display: block;
}

.long-response summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 600;
}

.long-response .rendered-markdown {
  margin: 0;
  border: 0;
  padding: 16px;
}

.rendered-markdown h2,
.rendered-markdown h3,
.rendered-markdown h4,
.rendered-markdown h5 {
  color: var(--ink);
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.rendered-markdown h2 {
  margin: 8px 0 12px;
  font-size: 1.18rem;
}

.rendered-markdown h3 {
  margin: 24px 0 9px;
  font-size: 1rem;
}

.rendered-markdown h4 {
  margin: 19px 0 8px;
  font-size: 0.88rem;
}

.rendered-markdown h5 {
  margin: 16px 0 7px;
  font-size: 0.78rem;
}

.rendered-markdown blockquote {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 0.86rem;
}

.inline-mail-window {
  display: grid;
  width: min(100%, 850px);
  height: min(530px, calc(100vh - 330px));
  min-height: 420px;
  margin: auto;
  overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 1px solid rgba(23, 36, 43, 0.16);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 65px rgba(23, 36, 43, 0.16);
}

.inline-mail-header {
  padding: 15px 19px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.inline-mail-header strong,
.inline-mail-header span {
  display: block;
}

.inline-mail-header strong {
  margin-bottom: 7px;
  font-size: 0.8rem;
}

.inline-mail-header span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.58rem;
}

.inline-mail-window iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #eef2f1;
}

.window-time {
  justify-self: end;
  color: var(--muted);
  font-size: 0.58rem;
}

.citation-row,
.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.citation-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 0.59rem;
  font-weight: 800;
}

.citation-chip::before {
  content: "▤";
}

.inline-action {
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 10px;
  color: var(--ink);
  background: #f7f7f4;
  font-size: 0.62rem;
  font-weight: 800;
  cursor: pointer;
}

.inline-action:hover {
  border-color: rgba(36, 124, 116, 0.35);
  background: var(--teal-soft);
}

.message.user .inline-action {
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.status-event {
  display: flex;
  width: min(490px, 88%);
  align-items: center;
  align-self: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 13px;
  background: rgba(243, 246, 245, 0.88);
  box-shadow: 0 7px 22px rgba(23, 36, 43, 0.045);
}

.status-symbol {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 0.78rem;
  font-weight: 900;
}

.status-event.email .status-symbol {
  color: var(--coral-dark);
  background: var(--coral-soft);
}

.status-event.review .status-symbol {
  color: #8a5a12;
  background: var(--gold-soft);
}

.status-event strong,
.status-event small {
  display: block;
}

.status-event strong {
  font-size: 0.69rem;
}

.status-event small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.6rem;
}

.status-event .inline-action {
  margin-left: auto;
  flex: 0 0 auto;
}

.review-scene {
  display: grid;
  width: min(590px, 100%);
  margin: auto;
  gap: 14px;
}

.review-card {
  overflow: hidden;
  border: 1px solid #f1ddb1;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-small);
}

.review-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  color: #8a5a12;
  background: var(--gold-soft);
}

.review-card-header strong {
  font-size: 0.72rem;
}

.review-card-header span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(183, 122, 32, 0.12);
  font-size: 0.58rem;
  font-weight: 800;
}

.review-card-body {
  padding: 20px;
}

.review-answer {
  margin-bottom: 16px;
  border-left: 3px solid var(--teal);
  padding: 10px 13px;
  color: var(--ink-soft);
  background: var(--teal-soft);
  font: 500 0.84rem/1.5 "Iowan Old Style", Georgia, serif;
}

.review-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.review-check {
  padding: 11px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
}

.review-check.pass {
  color: var(--teal);
  background: var(--teal-soft);
}

.review-check.missing {
  color: #8a5a12;
  background: var(--gold-soft);
}

.email-reply-scene {
  width: min(620px, 100%);
  margin: auto;
  overflow: hidden;
  border: 1px solid rgba(23, 36, 43, 0.16);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 21px 54px rgba(23, 36, 43, 0.14);
}

.email-scene-bar {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 14px;
  color: #fff;
  background: #0f5278;
}

.email-scene-bar strong {
  font-size: 0.7rem;
}

.email-scene-bar span {
  font-size: 0.6rem;
  opacity: 0.78;
}

.email-fields {
  border-bottom: 1px solid var(--line);
  padding: 10px 17px;
}

.email-field {
  display: grid;
  grid-template-columns: 53px 1fr;
  gap: 8px;
  padding: 5px 0;
  color: var(--muted);
  font-size: 0.62rem;
}

.email-field strong {
  overflow: hidden;
  color: var(--ink);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-reply-body {
  min-height: 145px;
  padding: 22px 20px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.62;
}

.email-signature {
  margin-top: 19px;
  color: var(--muted);
}

.email-scene-footer {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: #fafafa;
}

.email-sent {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--teal);
  font-size: 0.64rem;
  font-weight: 800;
}

.email-sent::before {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  content: "✓";
}

.email-scene-footer .inline-action {
  color: #fff;
  background: #0f5278;
}

.knowledge-complete {
  width: min(570px, 100%);
  margin: 4px auto 0;
  overflow: hidden;
  border: 1px solid rgba(36, 124, 116, 0.23);
  border-radius: 16px;
  background: linear-gradient(135deg, #f5fbf9, #fff);
  box-shadow: var(--shadow-small);
}

.knowledge-complete-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 17px;
  border-bottom: 1px solid rgba(36, 124, 116, 0.14);
}

.knowledge-complete-header span {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--teal);
  font-weight: 800;
}

.knowledge-complete-header strong,
.knowledge-complete-header small {
  display: block;
}

.knowledge-complete-header strong {
  font-size: 0.72rem;
}

.knowledge-complete-header small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.59rem;
}

.verified-answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(36, 124, 116, 0.14);
}

.verified-answer-grid > div {
  padding: 16px 17px;
  background: #fff;
}

.verified-answer-grid small,
.verified-answer-grid strong {
  display: block;
}

.verified-answer-grid small {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.58rem;
}

.verified-answer-grid strong {
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 0.92rem;
}

.replay-controls {
  display: flex;
  min-height: 67px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 19px;
  border-top: 1px solid var(--line);
  background: rgba(250, 248, 243, 0.72);
}

.control-button {
  display: inline-flex;
  min-height: 37px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  padding: 0 13px;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
}

.control-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.control-secondary {
  border: 1px solid var(--line);
  background: #fff;
}

.control-secondary:not(:disabled):hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.control-primary {
  min-width: 116px;
  border: 1px solid var(--ink);
  color: #fff;
  background: var(--ink);
  box-shadow: 0 8px 20px rgba(23, 36, 43, 0.16);
}

.control-primary:hover {
  background: #26383f;
  transform: translateY(-1px);
}

.speed-control {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.speed-control label {
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 700;
}

.speed-control select {
  min-height: 33px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 24px 0 9px;
  color: var(--ink);
  background: #fff;
  font-size: 0.62rem;
  font-weight: 700;
}

.evidence-rail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 24px 16px 18px;
  border-left: 1px solid var(--line);
  background: rgba(245, 243, 238, 0.76);
}

.evidence-heading {
  margin-right: 4px;
  margin-left: 4px;
}

.evidence-heading small {
  color: var(--ink);
  font-size: 0.62rem;
  letter-spacing: 0;
  text-transform: none;
}

.project-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 17px;
  border: 1px solid rgba(23, 36, 43, 0.11);
  border-radius: 15px;
  padding: 13px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(23, 36, 43, 0.05);
}

.project-monogram {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, var(--teal), #419990);
  font-family: Georgia, serif;
  font-size: 0.76rem;
  font-weight: 700;
}

.project-card small,
.project-card strong,
.project-card .project-status {
  display: block;
}

.project-card small {
  color: var(--muted);
  font-size: 0.55rem;
}

.project-card strong {
  max-width: 165px;
  overflow: hidden;
  margin-top: 2px;
  font-size: 0.67rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-status {
  margin-top: 5px;
  color: var(--teal);
  font-size: 0.55rem;
  font-weight: 700;
}

.project-status i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 3px;
  border-radius: 50%;
  background: var(--teal);
}

.evidence-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.artifact-button {
  display: grid;
  width: 100%;
  min-height: 62px;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 9px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.artifact-button:hover {
  border-color: var(--line);
  background: #fff;
}

.artifact-icon {
  display: grid;
  width: 34px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #2b579a;
  font-size: 0.67rem;
  font-weight: 900;
}

.artifact-icon.email {
  height: 34px;
  border-radius: 10px;
  background: #0f6cbd;
}

.artifact-icon.answer {
  height: 34px;
  border-radius: 50%;
  background: var(--teal);
}

.artifact-icon.dossier {
  background: var(--coral);
}

.artifact-copy {
  min-width: 0;
}

.artifact-copy strong,
.artifact-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-copy strong {
  font-size: 0.64rem;
}

.artifact-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.55rem;
}

.artifact-open {
  color: var(--muted);
  font-size: 0.8rem;
}

.relay-principle {
  position: relative;
  margin: 18px 4px 0;
  border-top: 1px solid var(--line);
  padding: 18px 4px 0 22px;
  color: var(--ink-soft);
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 0.73rem;
  font-style: italic;
  line-height: 1.45;
}

.relay-principle span {
  position: absolute;
  top: 14px;
  left: 1px;
  color: var(--coral);
  font-size: 1.45rem;
}

.story-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin-top: 23px;
  color: var(--muted);
  font-size: 0.68rem;
}

.story-footnote i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--coral);
}

.story-footnote strong {
  color: var(--ink);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(12, 22, 26, 0.72);
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);
  animation: backdrop-in 180ms ease both;
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mail-window,
.document-window {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: #f5f5f5;
  box-shadow: 0 38px 110px rgba(0, 0, 0, 0.38);
  animation: window-in 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes window-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mail-window {
  width: min(1200px, 96vw);
  height: min(790px, 91vh);
}

.document-window {
  width: min(1060px, 94vw);
  height: min(880px, 92vh);
}

.window-chrome {
  display: grid;
  min-height: 58px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(23, 36, 43, 0.12);
  padding: 0 16px;
  background: #edf0ef;
}

.window-dots {
  display: flex;
  gap: 7px;
}

.window-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.window-dots span:nth-child(1) { background: #ff665d; }
.window-dots span:nth-child(2) { background: #ffbd44; }
.window-dots span:nth-child(3) { background: #00ca4e; }

.window-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.window-title strong,
.window-title small {
  display: block;
}

.window-title strong {
  font-size: 0.72rem;
}

.window-title small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.55rem;
  text-align: center;
}

.outlook-mark,
.document-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: #0f6cbd;
  font-size: 0.68rem;
  font-weight: 900;
}

.document-mark {
  background: #2b579a;
}

.modal-close {
  width: 32px;
  height: 32px;
  justify-self: end;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--ink);
  background: rgba(23, 36, 43, 0.07);
}

.mail-layout {
  display: grid;
  height: calc(100% - 58px);
  grid-template-columns: 255px 1fr;
}

.mail-list {
  padding: 19px 10px;
  border-right: 1px solid var(--line);
  background: #f2f3f3;
}

.mail-list-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 8px 12px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.mail-list-label span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #0f6cbd;
  font-size: 0.56rem;
}

.mail-list-item {
  display: grid;
  width: 100%;
  min-height: 74px;
  grid-template-columns: 33px 1fr;
  align-items: start;
  gap: 9px;
  border: 0;
  border-radius: 11px;
  padding: 10px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.mail-list-item:hover {
  background: rgba(255, 255, 255, 0.7);
}

.mail-list-item.active {
  background: #fff;
  box-shadow: 0 7px 21px rgba(23, 36, 43, 0.07);
}

.sender-avatar {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--coral);
  font-family: Georgia, serif;
  font-weight: 700;
}

.sender-avatar.follow-up {
  background: var(--teal);
}

.mail-list-item strong,
.mail-list-item small,
.mail-list-item em {
  display: block;
}

.mail-list-item strong {
  font-size: 0.67rem;
}

.mail-list-item small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 0.6rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-list-item em {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.53rem;
  font-style: normal;
}

.mail-reader {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto 1fr;
  background: #fff;
}

.mail-message-header {
  display: flex;
  min-height: 98px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 23px;
  border-bottom: 1px solid var(--line);
}

.mail-message-header p {
  margin: 0 0 8px;
  font-size: 1.02rem;
  font-weight: 700;
}

.mail-message-header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.62rem;
}

.mail-message-header span strong {
  color: var(--ink);
}

.reply-button {
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 12px;
  background: #fff;
  font-size: 0.64rem;
  font-weight: 800;
  cursor: pointer;
}

.reply-button:hover {
  border-color: rgba(15, 108, 189, 0.3);
  color: #0f6cbd;
  background: #eef6fd;
}

#mail-frame,
#document-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #eef2f1;
}

#document-frame {
  height: calc(100% - 58px);
}

#document-image {
  display: block;
  width: 100%;
  height: calc(100% - 58px);
  padding: 18px;
  object-fit: contain;
  background: #dfe5e4;
}

.reply-composer {
  position: absolute;
  z-index: 5;
  right: 22px;
  bottom: 20px;
  width: min(640px, calc(100% - 44px));
  overflow: hidden;
  border: 1px solid rgba(23, 36, 43, 0.2);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(23, 36, 43, 0.3);
  animation: window-in 220ms ease both;
}

.reply-composer > header {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  color: #fff;
  background: #0f5278;
}

.reply-composer > header small,
.reply-composer > header strong {
  display: block;
}

.reply-composer > header small {
  opacity: 0.7;
  font-size: 0.52rem;
}

.reply-composer > header strong {
  margin-top: 2px;
  font-size: 0.65rem;
}

.reply-composer > header button {
  border: 0;
  color: #fff;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
}

.compose-field {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 9px 14px;
  color: var(--muted);
  font-size: 0.6rem;
}

.compose-field strong {
  overflow: hidden;
  color: var(--ink);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compose-body {
  min-height: 148px;
  padding: 17px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.55;
}

.compose-body:focus {
  outline: 0;
}

.reply-composer footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}

.send-reply {
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  padding: 0 14px;
  color: #fff;
  background: #0f6cbd;
  font-size: 0.64rem;
  font-weight: 800;
  cursor: pointer;
}

.reply-composer footer small {
  color: var(--muted);
  font-size: 0.55rem;
}

.demo-toast {
  position: fixed;
  z-index: 80;
  right: 22px;
  bottom: 22px;
  max-width: min(370px, calc(100vw - 44px));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 13px;
  padding: 13px 16px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 14px 38px rgba(23, 36, 43, 0.24);
  font-size: 0.68rem;
  font-weight: 700;
}

html.embedded-demo {
  min-width: 0;
  background: var(--paper);
}

html.embedded-demo body {
  min-height: 0;
  background: var(--paper);
}

.embedded-demo .skip-link,
.embedded-demo .page-atmosphere,
.embedded-demo .demo-topbar,
.embedded-demo .story-heading,
.embedded-demo .story-footnote {
  display: none;
}

.embedded-demo .demo-main {
  width: 100%;
  padding: 0;
}

.embedded-demo .replay-frame {
  border: 0;
  border-radius: 0;
  background: var(--paper);
  box-shadow: none;
}

@media (max-width: 1240px) {
  .replay-frame {
    grid-template-columns: 200px minmax(520px, 1fr);
  }

  .stage-scene {
    padding-right: 30px;
    padding-left: 30px;
  }
}

@media (max-width: 1020px) {
  .demo-topbar,
  .demo-main {
    width: min(100% - 32px, 900px);
  }

  .topbar-story-label {
    display: none;
  }

  .demo-topbar {
    grid-template-columns: 1fr 1fr;
  }

  .story-heading {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .story-deck {
    max-width: 650px;
  }

  .replay-frame {
    grid-template-columns: 1fr;
  }

  .chapter-rail {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chapter-rail-heading,
  .chapter-rail-footer {
    display: none;
  }

  .chapter-list {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .chapter-list::-webkit-scrollbar {
    display: none;
  }

  .chapter-button {
    min-width: 47px;
    min-height: 39px;
    grid-template-columns: 1fr;
    padding: 5px;
  }

  .chapter-button::before,
  .chapter-copy {
    display: none;
  }

  .chapter-number {
    margin: auto;
  }

  .story-stage {
    min-height: 660px;
  }
}

@media (max-width: 760px) {
  .demo-topbar,
  .demo-main {
    width: min(100% - 22px, 680px);
  }

  .demo-topbar {
    min-height: 70px;
  }

  .demo-brand small {
    display: none;
  }

  .exit-link {
    display: none;
  }

  .demo-main {
    padding-top: 30px;
  }

  .story-heading h1 {
    font-size: clamp(2.8rem, 15vw, 4.3rem);
  }

  .story-deck {
    font-size: 1rem;
  }

  .replay-frame {
    grid-template-columns: 1fr;
    border-radius: 19px;
  }

  .story-stage {
    min-height: 630px;
  }

  .stage-header {
    min-height: 80px;
    padding: 14px 16px;
  }

  .perspective-switch {
    max-width: 180px;
  }

  .perspective-switch span:last-child {
    min-width: 0;
  }

  .perspective-switch strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stage-scene {
    padding: 22px 15px;
  }

  .message {
    max-width: 96%;
  }

  .inline-mail-window {
    height: 510px;
  }

  .replay-controls {
    padding-right: 10px;
    padding-left: 10px;
  }

  .speed-control {
    display: none;
  }

  .story-footnote {
    flex-wrap: wrap;
    row-gap: 7px;
  }

  .modal-backdrop {
    padding: 8px;
  }

  .mail-window,
  .document-window {
    width: 100%;
    height: calc(100dvh - 16px);
    border-radius: 15px;
  }

  .window-chrome {
    grid-template-columns: auto 1fr auto;
  }

  .window-title {
    justify-content: center;
  }

  .mail-layout {
    grid-template-columns: 1fr;
  }

  .mail-list {
    display: flex;
    min-height: 93px;
    overflow-x: auto;
    gap: 7px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 9px;
  }

  .mail-list-label {
    display: none;
  }

  .mail-list-item {
    min-width: 220px;
    min-height: 70px;
  }

  .mail-reader {
    min-height: 0;
  }

  .mail-message-header {
    min-height: 90px;
    padding: 13px;
  }

  .mail-message-header span {
    max-width: 72vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .reply-composer {
    right: 8px;
    bottom: 8px;
    width: calc(100% - 16px);
  }

  .review-checks,
  .verified-answer-grid {
    grid-template-columns: 1fr;
  }

  .email-reply-body {
    min-height: 120px;
  }
}

@media (max-width: 460px) {
  .topbar-actions {
    gap: 5px;
  }

  .story-eyebrow {
    align-items: flex-start;
    flex-direction: column;
  }

  .stage-context h2 {
    font-size: 1.18rem;
  }

  .perspective-switch small {
    display: none;
  }

  .perspective-switch strong {
    max-width: 90px;
  }

  .control-button {
    padding: 0 10px;
  }

  .control-primary {
    min-width: 98px;
  }

  .story-footnote i {
    display: none;
  }

  .story-footnote span,
  .story-footnote strong {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
