/* The demo player, as its approved mockup laid it out: a bar across the top with who is showing the
   demo and the controls for the whole demo (the guide's voice, a pause, and the rest in ⋯), then the
   conversation beside the app (the handle between them resizes it) or floating over it. */

/* ---- The bar at the top ------------------------------------------------------------------------- */

.demo-top {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.demo-top .orb { width: 34px; height: 34px; }
.demo-top .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.demo-top .who p { margin: 0; }
.who-line { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .who-line strong { font-size: 14px; font-weight: 650; letter-spacing: 0; }
.who .who-line span { font-size: 13.5px; }
.who-sub { display: flex; align-items: baseline; gap: 4px; font-size: 11.5px; color: var(--ink-soft); }
.who .who-sub .notice { margin: 0; }
.who-sub .notice-tag { font-size: 11.5px; }

.top-actions { flex: none; display: flex; align-items: center; gap: 8px; }
.top-actions .book { display: inline-flex; align-items: center; min-height: 38px; margin: 0; padding: 0 14px; border-radius: 10px; font-size: 13.5px; }
.top-actions .sound, .top-actions .pause-guide, .top-actions .more-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto;
  min-width: 38px;
  height: 38px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
}
.top-actions .more-button { padding: 0; width: 38px; }
.top-actions .sound:hover, .top-actions .pause-guide:hover, .top-actions .more-button:hover { border-color: #9fb8bb; }
.top-actions .sound[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 9%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); color: var(--accent); }
/* Off and paused are the states to notice: amber, not grey. */
.top-actions .sound[aria-pressed="false"], .top-actions .pause-guide[data-paused="true"] { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber-ink); }
.pause-guide[data-paused="true"] .to-pause, .pause-guide[data-paused="false"] .to-resume { display: none; }
.top-actions .more-button[aria-expanded="true"] { background: color-mix(in srgb, var(--line) 50%, var(--panel)); }
.top-actions :is(.book, .sound, .pause-guide, .more-button):focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

/* ---- The ⋯ menu --------------------------------------------------------------------------------- */

.more-wrap { position: relative; }
.more-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 320px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 14px 40px rgba(18, 38, 50, 0.18);
}
.layout-pick { margin-bottom: 6px; padding: 8px 10px 12px; border-bottom: 1px solid var(--line); }
.layout-pick p { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; }
.layout-choices { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: color-mix(in srgb, var(--line) 55%, var(--panel)); }
.layout-choices button { flex: 1; min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); font: inherit; font-size: 13px; cursor: pointer; }
.layout-choices button[aria-pressed="true"] { background: var(--panel); color: var(--accent); font-weight: 600; box-shadow: 0 1px 3px rgba(18, 38, 50, 0.15); }
.layout-choices button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.more-menu .more-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.more-item svg { flex: none; color: var(--ink-soft); }
.more-item small { display: block; margin-top: 1px; font-size: 12px; color: var(--ink-soft); }
.more-menu .more-item:hover, .more-menu .more-item:focus-visible { background: color-mix(in srgb, var(--line) 45%, var(--panel)); outline: none; }
.more-menu .more-item:disabled { opacity: 0.55; cursor: default; }
.more-menu .more-item.end-demo { position: relative; margin-top: 9px; color: var(--danger); }
.more-menu .more-item.end-demo svg { color: currentColor; }
.more-menu .more-item.end-demo::before { content: ""; position: absolute; top: -5px; left: 4px; right: 4px; height: 1px; background: var(--line); }

/* The microphone and speaker panel opens under the bar, where the menu was. */
.demo-top .devices-panel { top: calc(100% + 8px); right: 16px; bottom: auto; z-index: 41; }

/* ---- The conversation's own header -------------------------------------------------------------- */

.chat .chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 9px 12px 9px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.chat-head strong { flex: 1; min-width: 0; font-size: 14px; font-weight: 650; }
.chat-head .grip { display: none; flex: none; color: #9fb8bb; }
.chat-head .shrink, .chat-head .dock {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink-soft);
  cursor: pointer;
}
.chat-head .dock[aria-pressed] { border-color: var(--line); color: var(--ink-soft); }
.chat-head .shrink:hover, .chat-head .dock:hover { border-color: #9fb8bb; color: var(--ink); }
.dock[aria-pressed="true"] .to-dock, .dock[aria-pressed="false"] .to-float { display: none; }

/* ---- One short word under the message box ------------------------------------------------------- */

.chat .guide-pace {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 7px;
  margin: -8px 0 0;
  padding: 0 20px 12px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
}
.pace-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #9fb8bb; }
.guide-pace[data-state="listening"] .pace-dot { background: var(--accent); animation: pace 1.6s ease-in-out infinite; }
.guide-pace[data-state="paused"] .pace-dot { background: #e0861a; }
@keyframes pace { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .guide-pace[data-state="listening"] .pace-dot { animation: none; } }

/* ---- Wide screens: the bar on top, the conversation beside the app or floating over it ---------- */

@media (min-width: 821px) {
  .pl-demo, .pl-demo.docked, .pl-demo:not(.docked) {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    height: 100dvh;
    padding: 0;
  }
  .demo-top { grid-row: 1; grid-column: 1 / -1; }
  .pl-demo.docked { grid-template-columns: calc(var(--guide-width) + 16px) 16px minmax(0, 1fr); }
  .pl-demo.docked .chat { grid-row: 2; grid-column: 1; height: auto; margin: 16px 0 16px 16px; }
  .pl-demo.docked .guide-resizer { grid-row: 2; grid-column: 2; }
  .pl-demo.docked .product, .pl-demo:not(.docked) .product { grid-row: 2; height: auto; min-height: 0; }
  .pl-demo.docked .product { grid-column: 3; margin: 16px 16px 16px 0; }
  .pl-demo:not(.docked) .product { grid-column: 1; margin: 16px; }

  /* Floating, the header is the handle it is dragged by. */
  .pl-demo:not(.docked) .chat .chat-head { background: color-mix(in srgb, var(--line) 25%, var(--panel)); }
  .pl-demo:not(.docked) .chat-head .grip { display: block; }
}

/* Narrower windows keep the words on the buttons short: the icons and their names remain. */
@media (min-width: 821px) and (max-width: 1080px) {
  .sound-word, .pause-word { display: none; }
  .top-actions .sound, .top-actions .pause-guide { padding: 0; width: 38px; }
}

/* ---- Phone: the bar on top, then the app, then the conversation --------------------------------- */

@media (max-width: 820px) {
  .pl-demo, .pl-demo.docked { grid-template-rows: auto auto minmax(0, 1fr); padding: 0 12px 12px; }
  .pl-demo.expanded { grid-template-rows: auto minmax(0, 1fr); }
  .demo-top { grid-row: 1; min-height: 56px; margin: 0 -12px; padding: 8px 12px; gap: 10px; }
  .product, .pl-demo.expanded .product { grid-row: 2; }
  .chat { grid-row: 3; }
  .demo-top .orb { width: 30px; height: 30px; }
  .who .who-line span { display: none; }
  .sound-word, .pause-word { display: none; }
  .top-actions .sound, .top-actions .pause-guide, .top-actions .more-button { width: 40px; height: 40px; padding: 0; }
  .top-actions .book { min-height: 40px; padding: 0 12px; font-size: 13px; }
  .chat .chat-head, .layout-pick { display: none; }
  /* The recording notice opens across the screen, under the bar, so it never runs off the side. */
  .demo-top .who .notice-tip { position: fixed; top: 60px; right: 12px; left: 12px; width: auto; max-width: none; }
  .chat .guide-pace { padding: 0 18px 12px; }

  /* The menu and the microphone panel come up from the bottom, in reach of a thumb. */
  .more-menu, .demo-top .devices-panel {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    padding: 10px 12px 22px;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 30px rgba(18, 38, 50, 0.22);
  }
}

/* A demo that failed to load: Retry and Contact the team, side by side under the words. */
.messages .note[role="alert"] button { margin: 6px 4px 0; }

/* ---- The guide's words over the app (client/saybar.ts) ------------------------------------------ */

.say-bar {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 3;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(720px, calc(100% - 40px));
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--say-bg);
  border: 1px solid var(--say-line);
  color: #fff;
  box-shadow: 0 12px 34px rgba(13, 29, 42, 0.3);
  transition: opacity 0.3s ease;
}
.say-top { display: flex; gap: 14px; align-items: flex-start; }
.say-orb { flex: none; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #7fd3d6, #3d7fb8 55%, #6b4fa8); }
.say-body { flex: 1; min-width: 0; }
.say-words { max-height: 7.5em; margin: 0; overflow-y: auto; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.say-state { margin: 6px 0 0; font-size: 12px; color: #b7cbd2; }
.say-words[hidden] + .say-state { margin-top: 4px; }

/* With the conversation hidden: the answers, the mic and a way back, under the words. */
.say-answers { display: none; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.15); }
.pl-demo.chat-hidden .say-answers { display: flex; }
.say-answers .chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; }
.say-answers .chips:empty { display: none; }
.say-answers .chip { min-height: 40px; background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, 0.6); }
.say-answers .chip:hover { background: rgba(255, 255, 255, 0.1); }
.say-answers .chip:focus-visible, .say-answers button:focus-visible { outline: 3px solid #7fd3d6; outline-offset: 2px; }
.say-answers .mic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #536772; color: #fff; cursor: pointer; }
.say-answers .mic[aria-pressed="true"] { background: var(--accent-bright); box-shadow: 0 0 0 4px rgba(127, 211, 214, 0.35); }
.say-answers .show-chat { margin-left: auto; min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }

/* ---- The conversation hidden: the app has the whole width --------------------------------------- */

.chat-head .hide-chat { display: grid; place-items: center; width: 34px; min-width: 34px; height: 34px; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink-soft); cursor: pointer; }
.chat-head .hide-chat:hover { border-color: #9fb8bb; color: var(--ink); }
.chat-head .hide-chat:focus-visible, .chat-head .shrink:focus-visible, .chat-head .dock:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
@media (min-width: 821px) {
  .pl-demo.chat-hidden .chat, .pl-demo.chat-hidden .guide-resizer { display: none; }
  .pl-demo.chat-hidden.docked { grid-template-columns: minmax(0, 1fr); }
  .pl-demo.chat-hidden.docked .product { grid-column: 1; margin: 16px; }
}

/* A phone shows the conversation under the app: no bar over it, and nothing to hide. */
@media (max-width: 820px) {
  .say-bar { display: none !important; }
  .chat-head .hide-chat { display: none; }
}

/* ---- How far the demo has come (client/steps.ts) ------------------------------------------------ */

/* The steps sit in the middle of the bar: the guide's name and the buttons share the room either side. */
.demo-top .who { flex: 1 1 0; }
.demo-top .top-actions { flex: 1 1 0; min-width: max-content; justify-content: flex-end; }
.demo-steps { flex: none; display: flex; align-items: center; margin: 0; padding: 0; list-style: none; }
.demo-steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.demo-steps li + li::before { content: ""; width: 24px; height: 2px; margin: 0 10px; border-radius: 1px; background: var(--line); }
.demo-steps .dot { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, var(--line) 70%, var(--panel)); color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.demo-steps li.done { color: var(--accent); }
.demo-steps li.done .dot { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); color: var(--accent); font-size: 0; }
.demo-steps li.done .dot::after { content: "✓"; font-size: 12px; }
.demo-steps li.now { color: var(--ink); font-weight: 600; }
.demo-steps li.now .dot { background: var(--accent); color: var(--accent-ink); }
/* Read out, never shown: "(done)" after a finished step. */
.demo-steps .step-state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.steps-now { display: none; }

/* A narrower window names only the step the demo is on; the others stay numbered, and read out. */
@media (min-width: 821px) and (max-width: 1280px) {
  .demo-steps li:not(.now) .step-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .demo-steps li + li::before { width: 14px; margin: 0 6px; }
}

/* A phone: a bar of four parts under the guide's name, and the step named under it. */
@media (max-width: 820px) {
  .demo-top { flex-wrap: wrap; row-gap: 6px; }
  .demo-steps { order: 10; flex: 1 0 100%; gap: 4px; }
  .demo-steps li { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
  .demo-steps li + li::before, .demo-steps .dot { display: none; }
  .demo-steps li.done, .demo-steps li.now { background: var(--accent); }
  .demo-steps .step-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .steps-now { display: block; order: 11; flex: 1 0 100%; margin: 0 0 2px; color: var(--ink-soft); font-size: 12px; }
}
/* Full screen on a phone, the app has the room: the steps wait until the conversation is back. */
@media (max-width: 820px) {
  .pl-demo.expanded .demo-steps, .pl-demo.expanded .steps-now { display: none; }
}

/* ---- The conversation pane, as its mockup drew it ----------------------------------------------- */

.chat-time { flex: none; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }

/* The guide's lines are the page's text, not bubbles: the newest reads first, earlier ones step back.
   The prospect's own words are the dark bubbles on the right. */
.chat .messages { gap: 2px; padding: 10px 18px 14px; }
.chat .messages .guide {
  align-self: stretch;
  max-width: none;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, var(--panel));
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}
.chat .messages .guide.earlier { color: var(--ink-soft); font-size: 13px; }
.chat .messages .you {
  align-self: flex-end;
  max-width: 85%;
  margin: 8px 0;
  padding: 7px 12px;
  border: 0;
  border-radius: 12px 12px 4px 12px;
  background: var(--you);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.45;
}
.chat .messages .note { margin: 4px 0; }
.chat .messages .contact { margin: 8px 0; }
.show-earlier { display: none; }

/* Answering: the answers to tap, then the mic, which mic, and a box to type in. */
.answer-area {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--line) 14%, var(--panel));
}
.answers-label { display: none; margin: 0; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.answer-area:has(.chips > .chip:not([hidden])) .answers-label { display: block; }
.answer-area .chips { gap: 8px; padding: 0; }
.answer-area .chip {
  min-height: 40px;
  padding: 8px 15px;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: var(--panel);
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}
.answer-area .chip:hover { background: color-mix(in srgb, var(--accent) 9%, var(--panel)); }
.answer-area .chip.more { border-style: dashed; }
.answer-area .chip:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

.chat .compose { min-height: 0; margin: 0; padding: 0; gap: 8px; align-items: center; border: 0; border-radius: 0; background: none; }
.chat .compose .mic {
  flex: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  color: var(--accent);
}
.chat .compose .mic[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.chat .compose .mic-devices {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink-soft);
  cursor: pointer;
}
.chat .compose .mic-devices:hover { border-color: #9fb8bb; color: var(--ink); }
.chat .compose .mic[hidden] + .mic-devices { display: none; }
.chat .compose .mic:focus-visible, .chat .compose .mic-devices:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.ask {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.ask:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.chat .ask input { flex: 1; min-width: 0; align-self: stretch; padding: 0; border: 0; border-radius: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; outline: none; }
.chat .ask button[type="submit"] { flex: none; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 9px; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.chat .ask button[type="submit"]:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.chat .answer-area .guide-pace { margin: -2px 0 0; padding: 0 2px; }

/* Opened from the ^ by the mic, the microphone panel sits just above it. */
.demo-top .devices-panel.by-mic { position: fixed; top: auto; right: auto; }

/* Shrunk to the message box, floating: only the mic, the box and the word under them. */
@media (min-width: 821px) {
  .pl-demo:not(.docked) .chat.shrunk .answers-label, .pl-demo:not(.docked) .chat.shrunk .show-earlier { display: none; }
  .pl-demo:not(.docked) .chat.shrunk .answer-area { border-top: 0; }
}
.full-screen { display: none; }

/* ---- A phone: the newest exchange under the app, and the app full screen at a tap ---------------- */

@media (max-width: 820px) {
  .pl-demo:not(.expanded) .product-bar .full-screen {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
  }
  .show-earlier:not([hidden]) {
    display: block;
    flex: none;
    align-self: center;
    margin: 6px auto 0;
    padding: 6px 12px;
    border: 0;
    background: none;
    color: var(--ink-soft);
    font: inherit;
    font-size: 12.5px;
    cursor: pointer;
  }
  .chat .messages:not(.all) li.earlier { display: none; }
  .chat .messages { padding: 8px 14px 12px; }
  /* The guide's newest line is the one thing to read: a card of its own. */
  .chat .messages .guide.latest {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px 16px 16px 4px;
    background: var(--panel);
    font-size: 15px;
    line-height: 1.5;
  }
  .answer-area { padding: 10px 12px 12px; }
  .chat .ask input { font-size: 16px; } /* 16px keeps a phone from zooming in on the box */
  .demo-top .devices-panel.by-mic { left: 0 !important; bottom: 0 !important; }
}

/* ---- The poster the demo starts from (startCard in client/main.ts) ------------------------------ */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pl-demo.starting .chat > :not(.start-poster) { display: none; }
.pl-demo.starting .chat { border: 0; background: #0d1d2a; }
.start-poster {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: radial-gradient(120% 60% at 50% 0%, #1f5866 0%, rgba(31, 88, 102, 0) 60%), linear-gradient(180deg, #13293a 0%, #0d1d2a 100%);
}
.start-poster form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.poster-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; padding: 30px 26px 14px; }
.poster-who { display: flex; align-items: center; gap: 14px; }
.poster-face { flex: none; width: 60px; height: 60px; line-height: 0; border-radius: 50%; box-shadow: 0 0 0 6px rgba(127, 211, 214, .14), 0 0 40px rgba(127, 211, 214, .35); }
.poster-who p { margin: 0; color: #b8ccd3; font-size: 13px; line-height: 1.4; }
.poster-who b { display: block; color: #fff; font-size: 15px; }
.poster-who .ready { color: #7fd3d6; }
.start-poster h1 { margin: 0; color: #fff; font-size: 32px; font-weight: 800; line-height: 1.08; letter-spacing: -0.025em; }
.start-poster h1 .accent { display: block; color: #7fd3d6; }
.poster-lead { color: #c9d9de; font-size: 15px; line-height: 1.55; }
.poster-lead > * { margin: 0 0 6px; }
.poster-lead > :last-child { margin-bottom: 0; }
.poster-lead ul { padding-left: 20px; }
.poster-lead a { color: #bfe9ea; font-weight: 600; text-underline-offset: 2px; }
.poster-promises { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.poster-promises li { display: flex; align-items: center; gap: 12px; color: #e6f0f2; font-size: 14.5px; line-height: 1.35; }
.poster-promises .ic { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: rgba(127, 211, 214, .12); color: #7fd3d6; box-shadow: inset 0 0 0 1px rgba(127, 211, 214, .22); }
.poster-label { margin: 0 0 10px; color: #8fb0ba; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.poster-topics .list { display: flex; flex-wrap: wrap; gap: 8px; }
.poster-topic { min-height: 38px; padding: 7px 13px; border: 1.5px solid rgba(191, 233, 234, .35); border-radius: 999px; background: transparent; color: #dbeef0; font: inherit; font-size: 13.5px; cursor: pointer; }
.poster-topic:hover { border-color: #7fd3d6; }
.poster-topic[aria-pressed="true"] { border-color: #7fd3d6; background: #7fd3d6; color: #0d1d2a; font-weight: 600; }
.poster-questions { display: flex; flex-direction: column; gap: 12px; }
.poster-questions label { display: flex; flex-direction: column; gap: 6px; color: #c9d9de; font-size: 13px; font-weight: 600; }
.poster-questions input[type="text"], .poster-questions select { height: 40px; padding: 0 12px; border: 1px solid rgba(191, 233, 234, .35); border-radius: 10px; background: rgba(255, 255, 255, .06); color: #fff; font: inherit; font-size: 14px; }
.poster-questions select option { color: #122632; }
.poster-questions .start-many { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; border: 0; }
.poster-questions .start-many legend { width: 100%; margin-bottom: 4px; padding: 0; color: #c9d9de; font-size: 13px; font-weight: 600; }
.poster-questions .start-many label { flex-direction: row; align-items: center; gap: 6px; color: #e6f0f2; font-weight: 400; font-size: 14px; }
.poster-questions .start-many input { accent-color: #7fd3d6; }

.poster-foot { flex: none; display: flex; flex-direction: column; gap: 12px; padding: 14px 22px 20px; }
.poster-email { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 18px; border-radius: 999px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1.5px rgba(191, 233, 234, .55); }
.poster-email:focus-within { box-shadow: inset 0 0 0 2px #7fd3d6; }
.poster-email input { flex: 1; min-width: 0; height: 40px; padding: 0; border: 0; outline: none; background: none; color: #fff; font: inherit; font-size: 15px; }
.poster-email input::placeholder { color: #9cb3bb; }
.poster-email input[aria-invalid="true"] { color: #ffd6cf; }
.poster-go { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: #7fd3d6; color: #0d1d2a; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.poster-go:disabled { opacity: .6; cursor: progress; }
.poster-go .go-words { display: none; }
/* Not recorded, no email is asked: the box is the go button alone. */
.poster-email.no-email { padding: 6px; }
.poster-email.no-email input { display: none; }
.poster-email.no-email .poster-go { flex: 1; width: auto; }
.poster-email.no-email .go-words { display: inline; }
.poster-problem { margin: 0; color: #ffc2b8; font-size: 13px; text-align: center; }
.poster-fine { margin: 0; color: #9db6be; font-size: 12px; line-height: 1.55; text-align: center; }
.poster-fine .link { padding: 0; border: 0; background: none; color: #bfe9ea; font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.poster-fine .notice-full { display: block; margin-top: 6px; color: #e6f0f2; text-align: left; }
.start-poster :focus-visible { outline: 3px solid #7fd3d6; outline-offset: 2px; }

/* A phone: the poster is the page until the demo starts. */
@media (max-width: 820px) {
  .pl-demo.starting .product { display: none; }
  .pl-demo.starting .chat { grid-row: 2 / span 2; border-radius: 16px; }
  .poster-body { padding: 24px 20px 12px; }
  .start-poster h1 { font-size: 30px; }
  .poster-email input { font-size: 16px; }
}
.start-poster .poster-email input:focus-visible { outline: none; } /* the box shows its own ring */

/* ---- Page colors (Look and voice → Page colors) --------------------------------------------------
   Light, the default: white panels with the start poster's navy and teal as the accents. Dark: navy
   all around the app, as the poster is; the app itself stays as it was captured. The tokens sit on
   body (DemoPage.razor puts theme-dark there), so everything under it, the booking sheet included,
   follows; a component with a color of its own takes it from these tokens too. */

body {
  --bg: #eef3f5;
  --panel: #ffffff;
  --ink: #13293a;
  --ink-soft: #4f6672;
  --line: #dde6ea;
  --accent: #0e7c83;
  --accent-bright: #0e7c83;
  --accent-ink: #ffffff;
  --ring: #0e7c83;
  --guide-bubble: #f0f6f7;
  --you-bubble: #13293a;
  --you: #13293a;
  --top: #ffffff;
  --title-bar: linear-gradient(#f7fafb, #edf2f4);
  --grip: #c3d3d9;
  --say-bg: radial-gradient(120% 160% at 50% 0%, #1f5866 0%, rgba(31, 88, 102, 0) 60%), linear-gradient(180deg, #13293a 0%, #0d1d2a 100%);
  --say-line: rgba(127, 211, 214, .2);
  --say-state: #7fd3d6;
  --face-glow: 0 0 0 4px rgba(127, 211, 214, .18), 0 0 18px rgba(127, 211, 214, .45);
  --amber-bg: #fdf1dc;
  --amber-line: #f0d3a2;
  --amber-ink: #8a5200;
  --danger: #9a3a00;
  --problem: #b3261e;
  --shadow: 0 6px 20px rgba(19, 41, 58, .07);
  --float-shadow: 0 18px 44px rgba(18, 38, 50, .24);
  color-scheme: light;
}

body.theme-dark {
  --bg: #0a1620;
  --panel: #13293a;
  --ink: #e6f0f2;
  --ink-soft: #9db6be;
  --line: #27404f;
  --accent: #7fd3d6;
  --accent-bright: #7fd3d6;
  --accent-ink: #0d1d2a;
  --ring: #7fd3d6;
  --guide-bubble: #183344;
  --you-bubble: #1f5866;
  --you: #1f5866;
  --top: #0f2231;
  --title-bar: #16303f;
  --grip: #3b5868;
  --say-bg: linear-gradient(180deg, #16303f 0%, #0f2231 100%);
  --say-line: rgba(127, 211, 214, .3);
  --amber-bg: rgba(240, 180, 90, .16);
  --amber-line: rgba(240, 180, 90, .5);
  --amber-ink: #f6c98a;
  --danger: #ffb59a;
  --problem: #ffb4a8;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .6);
  --float-shadow: 0 24px 60px -16px rgba(0, 0, 0, .7), 0 0 0 1px rgba(191, 233, 234, .1);
  color-scheme: dark;
}

/* The parts that had a light color of their own now take it from the tokens. */
.demo-top { background: var(--top); }
.demo-top .orb, .say-orb { border-radius: 50%; box-shadow: var(--face-glow); }
.say-state { color: var(--say-state); }
.pl-demo .chat, .pl-demo .product, .pl-demo.docked .chat, .pl-demo:not(.docked) .chat { border-color: var(--line); }
.pl-demo .product { background: var(--panel); box-shadow: var(--shadow); }
.pl-demo .product-bar, .pl-demo.expanded .product-bar { background: var(--title-bar); border-bottom-color: var(--line); }
.pl-demo .window-title .screen-title { color: var(--ink); }
.pl-demo .window-app { color: var(--ink-soft); }
.pl-demo .guide-resizer::after { background: var(--grip); }
.chat .messages .note { color: var(--ink-soft); }
.pl-demo .accessible-controls { background: var(--panel); color: var(--ink); }
.contact .problem { color: var(--problem); }
.closing input { background: var(--bg); color: var(--ink); }

/* Dark: the few places a light panel color would be wrong. */
body.theme-dark .layout-choices button[aria-pressed="true"] { background: rgba(127, 211, 214, .16); }
body.theme-dark .more-menu, body.theme-dark .devices-panel { box-shadow: 0 16px 44px rgba(0, 0, 0, .5); }
body.theme-dark .chat .answer-area { background: #0f2231; }
body.theme-dark .answer-area .chip { background: transparent; border-color: rgba(127, 211, 214, .55); color: #bfe9ea; }
body.theme-dark .answer-area .chip:hover { background: rgba(127, 211, 214, .12); }
body.theme-dark .chat .compose .mic { background: rgba(127, 211, 214, .14); }
body.theme-dark .chat .compose .mic[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
body.theme-dark .ask { background: rgba(255, 255, 255, .05); border-color: rgba(191, 233, 234, .25); }
body.theme-dark .chat .messages .guide { border-bottom-color: rgba(191, 233, 234, .1); }
body.theme-dark .pl-demo .chat { background: radial-gradient(120% 40% at 50% 0%, #1a4655 0%, rgba(26, 70, 85, 0) 60%), var(--panel); }
body.theme-dark .chat .chat-head { background: transparent; }
body.theme-dark .say-bar { box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
/* The conversation's list has no color of its own: the panel's shows through, in both themes. */
.pl-demo .chat .messages { background: transparent; }
.layout-choices button { white-space: nowrap; padding: 0 6px; }

/* The microphone and speaker panel keeps its width: a long device name shortens in its list, never
   pushes the lists and buttons past the panel's edge. */
.devices-panel { grid-template-columns: minmax(0, 1fr); box-sizing: border-box; }
.devices-panel label, .devices-panel select, .devices-panel meter { min-width: 0; width: 100%; box-sizing: border-box; }
.devices-panel select { text-overflow: ellipsis; }
.devices-panel .row { flex-wrap: wrap; }

/* The bot check (Cloudflare Turnstile): seen only when Cloudflare asks the visitor to tick a box. */
.bot-check { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 1000; }
.bot-check:empty { display: none; }


/* A person's face above the conversation (client/main.ts faceCard): the loops, labeled as an AI guide. */
.face-card { position: relative; margin: 12px 14px 0; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; max-height: 240px; background: #dfe9e7; flex: none; }
.face-card .face-view { position: absolute; inset: 0; border-radius: 0; }
.face-card .face-view .pl-loop { object-position: 50% 35%; }
.face-card .face-ai { position: absolute; right: 8px; top: 8px; font: 600 11px/1 system-ui, "Segoe UI", sans-serif; color: #173449; background: #ffffffe6; padding: 5px 8px; border-radius: 999px; }
.face-card .face-hide { position: absolute; right: 8px; bottom: 8px; font: 500 11px/1 system-ui, "Segoe UI", sans-serif; color: #173449; background: #ffffffe6; border: 0; padding: 6px 9px; border-radius: 999px; cursor: pointer; }
.face-card .face-hide:focus-visible { outline: 2px solid var(--accent, #0e7c72); outline-offset: 2px; }
.demo-top .orb.pl-person { cursor: pointer; }
/* Shrunk, floating small, or on a phone: the top bar's face only. */
.chat.shrunk .face-card, .pl-demo.chat-hidden .face-card { display: none; }
@media (max-width: 700px) { .face-card { display: none; } }

/* "Powered by PitchLogix" (Components/DemoPage.razor): a small pill in the app's corner when the window is
   wide; under the answer box when it is narrow (the same width at which the page stacks, client/main.ts). */
.powered-by { display: inline-flex; align-items: center; gap: 5px; font: 500 11.5px/1 system-ui, "Segoe UI", sans-serif; color: #5f7280; text-decoration: none; white-space: nowrap; }
.powered-by b { font-weight: 650; color: #3c5260; }
.powered-by:hover b, .powered-by:focus-visible b { color: var(--accent, #0e7c72); }
.powered-by:focus-visible { outline: 2px solid var(--accent, #0e7c72); outline-offset: 2px; }
.powered-corner { position: absolute; right: 10px; bottom: 10px; z-index: 6; padding: 6px 10px; border-radius: 999px; background: #ffffffeb; border: 1px solid #d6e2e1; box-shadow: 0 1px 6px rgb(15 42 48 / .1); }
.powered-under { display: none; justify-content: center; margin: 6px auto 0; }
/* With the conversation hidden, the guide's words run along the app's foot: the pill moves to the top corner. */
.pl-demo[data-layout=hidden] .powered-corner { bottom: auto; top: 10px; }
@media (max-width: 820px) {
  .powered-corner { display: none; }
  .powered-under { display: flex; }
}
@media print { .powered-by { display: none; } }

/* The bot check on a customer's own domain runs in a frame from the demo's address (client/botcheck.ts):
   out of sight and out of the way until Cloudflare wants a person to tick it. */
.bot-check.bot-frame { display: block; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; background: transparent; color-scheme: normal; }
.bot-check.bot-frame.shown { width: 320px; height: 80px; opacity: 1; pointer-events: auto; }

