/* Scene 01. The story supplies the size container; nothing here positions the story. */
.pc-stage {
  --pc-width: min(338px, 46.5cqh, 87cqw);
  --pc-gutter: 0px;
  --pc-leaf: 0px;
  --pc-type: clamp(12px, min(3.45cqw, 2.8cqh), 16px);
  --pc-small: clamp(10px, min(2.6cqw, 2.05cqh), 12px);
  --pc-pad: clamp(6px, min(2.7cqw, 2.35cqh), 17px);
  --pc-gap: clamp(5px, 1.45cqh, 11px);
  --pc-ink: #020817;
  --pc-muted: #64748B;
  --pc-brass: #A38240;
  position: relative;
  display: grid;
  grid-template-columns: var(--pc-width);
  width: calc(var(--pc-width) + var(--pc-gutter) + var(--pc-leaf));
  color: var(--pc-ink);
  font-family: var(--sans, system-ui, sans-serif);
  text-align: start;
}
/* A stable text equivalent, not a live region that interrupts at each turn. */
.pc-readable {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(50%);
  margin: 0;
  font: 12px/1.2 system-ui, sans-serif;
  pointer-events: none;
}
.fd-device.pc-phone {
  width: var(--pc-width);
  height: calc(2 * var(--pc-width));
  min-width: 0;
  min-height: 0;
  color: var(--pc-ink);
  font-size: var(--pc-type);
  line-height: 1.36;
}
.pc-glass {
  background: linear-gradient(155deg, #FFFFFF, #F1F5F9 70%);
}
.pc-phone .fd-status i::after {
  content: "";
  position: absolute;
  right: 15%;
  top: 27%;
  height: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #697d91, #19212e 60%);
}
.pc-phone .fd-status > span::before {
  content: "";
  position: absolute;
  inset: -1px calc(100% + 3px) 0 auto;
  width: 1em;
  background: currentColor;
  clip-path: polygon(0 74%, 16% 74%, 16% 100%, 0 100%, 0 74%, 26% 74%, 26% 52%, 43% 52%, 43% 100%, 26% 100%, 26% 74%, 54% 74%, 54% 27%, 71% 27%, 71% 100%, 54% 100%, 54% 74%, 82% 74%, 82% 0, 100% 0, 100% 100%, 82% 100%, 82% 74%);
}
.fd-phone-body.pc-body {
  justify-content: flex-start;
  gap: var(--pc-gap);
  padding: 0 var(--pc-pad) var(--pc-gap);
}
.pc-head {
  display: flex;
  flex: none;
  align-items: center;
  gap: .48em;
  padding-block: .25em .45em;
  border-bottom: 1px solid #E2E8F0;
}
.pc-head > div { flex: 1; min-width: 0; }
.pc-mark {
  flex: none;
  width: 2.2em;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #FFFFFF url("welta-mark.svg") center / 88% no-repeat;
}
.pc-head small {
  display: block;
  color: var(--pc-muted);
  font-size: var(--pc-small);
  font-weight: 650;
  line-height: 1.2;
}
.pc-head h4 {
  margin: .12em 0 0;
  color: var(--pc-ink);
  font-size: clamp(16px, min(5cqw, 3.85cqh), 26px);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.08;
}
.pc-control {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-inline-end: -3px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--pc-ink);
  cursor: pointer;
}
.pc-control[hidden] { display: none; }
[data-story-screen="0"].active .pc-control:not([hidden]) { pointer-events: auto; }
.pc-control:focus-visible { outline: 2px solid #003366; outline-offset: -3px; }
.pc-control svg {
  box-sizing: content-box;
  width: 15px;
  height: 15px;
  padding: 5px;
  border: 1px solid #E2E8F0;
  border-radius: 50%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}
.pc-control:hover svg, .pc-control:focus-visible svg { background: #F1F5F9; }
.pc-control path { display: none; }
.pc-control[data-profile-control="pause"] .pc-icon-pause,
.pc-control[data-profile-control="resume"] .pc-icon-play,
.pc-control[data-profile-control="repeat"] .pc-icon-replay { display: block; }
.pc-channel {
  display: flex;
  flex: none;
  align-items: center;
  gap: .48em;
  margin: 0;
  color: var(--pc-muted);
  font-size: var(--pc-small);
  font-weight: 600;
  line-height: 1.2;
}
.pc-channel::before {
  content: "";
  width: .48em;
  height: .48em;
  border-radius: 50%;
  background: #C5A059;
}
.pc-log {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--pc-gap);
  min-height: 0;
}
.pc-turns {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: var(--pc-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.pc-turn {
  display: none;
  align-self: flex-start;
  max-width: 92%;
  padding: .5em .7em .6em;
  border: 1px solid #E2E8F0;
  border-radius: 1em 1em 1em .26em;
  background: #FFFFFF;
  color: var(--pc-ink);
  overflow-wrap: break-word;
}
.pc-turn b {
  display: block;
  margin-bottom: .24em;
  color: #003366;
  font-size: var(--pc-small);
  font-weight: 750;
  line-height: 1.15;
}
.pc-turn p { margin: 0; }
.pc-turn[data-profile-speaker="Vos"] {
  align-self: flex-end;
  border-color: #003366;
  border-radius: 1em 1em .26em 1em;
  background: #003366;
  color: #F8FAFC;
}
.pc-turn[data-profile-speaker="Vos"] b { color: #E7CB96; }
.pc-answer { display: block; }
@container (min-width: 310px) and (min-height: 365px) {
  .pc-interpretation { display: block; }
}
.pc-typing {
  display: none;
  flex: none;
  align-items: center;
  gap: 2px;
  color: #64748B;
  font-size: var(--pc-small);
  line-height: 1.2;
  visibility: hidden;
}
.pc-typing span { margin-inline-start: .28em; }
.pc-typing i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.pc-note {
  flex: none;
  margin: 0 var(--pc-pad) var(--pc-gap);
  padding: .72em .85em;
  border: 1px solid #E2E8F0;
  border-radius: .68em;
  background: #FFFFFF;
  color: #020817;
}
.pc-note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35em;
  color: var(--pc-brass);
  font-size: var(--pc-small);
  line-height: 1.2;
}
.pc-note-head strong { font-weight: 750; }
.pc-stitches { display: flex; flex: none; gap: 2px; }
.pc-stitches i { width: .52em; height: 3px; border-radius: 1px; background: #C5A059; }
.pc-facts {
  display: grid;
  grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr);
  gap: .48em .65em;
  margin: .55em 0 0;
}
.pc-facts > div { padding-top: .38em; border-top: 1px solid #E2E8F0; }
.pc-facts > div:first-child { grid-column: 1 / -1; }
.pc-facts dt, .pc-facts dd small {
  color: #64748B;
  font-size: var(--pc-small);
  line-height: 1.25;
}
.pc-facts dd {
  margin: .12em 0 0;
  font-size: 1.06em;
  font-weight: 690;
  letter-spacing: -.025em;
  line-height: 1.22;
}
.pc-facts dd small { display: block; margin-top: .16em; font-weight: 550; letter-spacing: 0; }
.pc-note .pc-pending { margin: .6em 0 0; color: #64748B; line-height: 1.4; }
.pc-pending, .pc-check { display: none; }
.pc-note :is(.pc-signoff, .pc-check) {
  margin: .58em 0 0;
  color: #166534;
  font-size: var(--pc-small);
  font-weight: 650;
  line-height: 1.25;
}
.pc-signoff span { color: #166534; }

/* Unenhanced/static is the finished conversation. Only the local controller
   opts into a reading window; the original facts and all turns stay in HTML. */
.pc-stage[data-profile-mode="live"] .pc-turn,
.pc-stage[data-profile-mode="live"] [data-profile-fact]:not([data-collected]),
.pc-stage[data-profile-mode="live"]:not([data-profile-phase="complete"]) .pc-signoff,
.pc-stage[data-profile-facts="0"] .pc-facts { display: none; }
.pc-stage[data-profile-mode="live"] .pc-turn:is([data-current], [data-context]),
.pc-stage[data-profile-facts="0"] .pc-pending,
.pc-stage[data-profile-turn="7"] .pc-check { display: block; }
.pc-stage[data-profile-facts="0"] .pc-stitches i,
.pc-stage[data-profile-facts="1"] .pc-stitches i:nth-child(n + 2),
.pc-stage[data-profile-facts="2"] .pc-stitches i:last-child { background: #E2E8F0; }
.pc-stage[data-profile-mode="live"]:not([data-profile-phase="complete"]) .pc-typing { display: flex; }
.pc-stage[data-profile-phase="typing"] .pc-typing { visibility: visible; }
.pc-typing[data-next="Vos"] { align-self: flex-end; color: #A38240; }

/* An enhanced host may paint while the deferred controller is in flight.
   The parse-time latch also releases on failure; no-JS and static stay complete. */
@media (prefers-reduced-motion: no-preference) {
  :where([data-story-mode]) .pc-stage[data-profile-loading]:not([data-profile-mode]) {
    & :is(.pc-turn, .pc-facts, .pc-signoff) { display: none; }
    & :is(.pc-turn:first-child, .pc-pending) { display: block; }
    & .pc-stitches i { background: #E2E8F0; }
  }
}

/* Unfold the same notes beside the device when keeping them inside would
   steal reading space, or when a desktop spread has room for both surfaces. */
@container (min-width: 254px) and (max-height: 545px), (min-width: 520px) {
  .pc-stage {
    --pc-width: min(338px, 46.5cqh, 50cqw);
    --pc-gutter: clamp(8px, 3cqw, 28px);
    --pc-leaf: clamp(110px, 34cqw, 201px);
  }
  .pc-note {
    position: absolute;
    inset: 50% auto auto calc(100% + var(--pc-gutter));
    width: var(--pc-leaf);
    margin: 0;
    transform: translateY(-50%);
    border-radius: 3px .8em .8em 3px;
    border-inline-start: 2px solid #C5A059;
    box-shadow: 0 1px 1px #3f443310, 0 6px 16px -12px #403c2d69;
  }
  .pc-facts { grid-template-columns: 1fr; }
}
@container (max-height: 435px), (max-width: 235px) {
  .pc-mark { display: none; }
  .pc-head { gap: .2em; padding-block: 0 .25em; }
  .pc-head h4 { font-size: clamp(14px, 4cqh, 18px); }
  .pc-turn { max-width: 96%; padding: .4em .52em .46em; }
  .pc-note { padding: .6em .66em; }
}
@container (max-height: 335px) {
  .pc-stage { --pc-pad: 5px; --pc-gap: 4px; }
  .pc-head { gap: 0; }
  .pc-turn { max-width: 100%; line-height: 1.25; }
  .pc-turn b { margin-bottom: .2em; }
  .pc-control { margin-inline-end: -4px; }
  .pc-note { padding: .53em .57em; }
}
@container (min-width: 254px) and (max-height: 275px) {
  .pc-stage { --pc-width: min(48.5cqh, 50cqw); }
}
/* A very narrow slice of a short landscape viewport: give the physically
   small screen to the finished dossier, without shrinking copy to fit. */
@container (max-width: 253px) and (max-height: 385px), (max-width: 172px) {
  .pc-stage { --pc-still: 1; --pc-width: min(48cqh, 90cqw); --pc-pad: 4px; --pc-gap: 4px; }
  .fd-phone-body.pc-body { flex: none; padding-bottom: 0; }
  .pc-glass { justify-content: space-between; }
  .pc-log, .pc-note-head { display: none; }
  .pc-note { padding: .38em .45em; }
  .pc-facts { grid-template-columns: 1fr; gap: .2em; margin-top: 0; }
  .pc-facts > div { padding-top: .2em; }
  .pc-facts > div:first-child { padding-top: 0; border: 0; }
  .pc-facts dd, .pc-facts dd small { margin-top: 0; }
  .pc-note .pc-signoff { margin-top: .3em; }
}
@media (prefers-reduced-motion: no-preference) {
  .pc-stage[data-profile-mode="live"] [data-current],
  .pc-stage[data-profile-mode="live"] [data-collected] {
    animation: pc-arrive .28s ease-out backwards;
  }
  .pc-stage[data-profile-phase="typing"] .pc-typing i { animation: pc-dot .75s ease-in-out infinite alternate; }
  .pc-typing i:nth-child(2) { animation-delay: .12s; }
  .pc-typing i:nth-child(3) { animation-delay: .24s; }
  .pc-stage:is([data-profile-playback="paused"], [data-profile-playback="suspended"]) :is([data-current], [data-collected], .pc-typing i) {
    animation-play-state: paused;
  }
}
@keyframes pc-arrive { from { transform: translateY(3px); } }
@keyframes pc-dot { to { transform: translateY(-2px); } }
