/* ==================================================================
   Biolite concierge demo
   1. Tokens & base          5. Generic chat layout
   2. Stage layout           6. Channel skins (whatsapp / instagram / webchat)
   3. Brief column & ledger  7. Chips & composer
   4. Topbar & switcher      8. Mobile sheet, a11y, reduced motion
   ================================================================== */

/* ---------- 1. Tokens & base ---------- */

:root {
  --ink: #14231d;
  --paper: #f2f3ef;
  --card: #ffffff;
  --evergreen: #1e4237;
  --evergreen-deep: #142e26;
  --eucalyptus: #8fa99b;
  --gold: #b99a5b;
  --line: #e0e3da;
  --text-soft: #5c6b62;

  --font-display: "Marcellus", "Times New Roman", serif;
  --font-ui: "Figtree", system-ui, sans-serif;
  --font-native: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 85% -10%, #e8ece4 0%, transparent 60%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.6s ease;
}

/* The 2:47 AM toggle dims the room; the phone stays lit. */
body.night {
  background:
    radial-gradient(1100px 600px at 85% -10%, #17251f 0%, transparent 60%),
    #0f1713;
}
body.night .brief-inner { color: #e6e9e2; }
body.night .brief-title { color: #f2f3ef; }
body.night .value-line { color: #a9b6ac; }
body.night .ledger { background: rgba(255, 255, 255, 0.04); border-color: rgba(185, 154, 91, 0.35); }
body.night .ledger-label { color: #d8ddd3; }
body.night .ledger-note { color: #8f9c91; }
body.night .device-footnote { color: #77857a; }
body.night .switcher { background: #1a2620; border-color: #2a382f; }
body.night .switch-opt span { color: #b9c4ba; }
body.night .night-toggle { color: #d8ddd3; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.noscript { text-align: center; padding: 2rem; }

/* ---------- 2. Stage layout ---------- */

/* .stage sets display:grid, which would defeat the hidden attribute
   used by the mode toggle */
.stage[hidden] { display: none; }

.stage {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(340px, 440px) minmax(0, 480px);
  justify-content: center;
  gap: 64px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px;
  align-items: center;
}

.device {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.device-footnote {
  font-size: 12px;
  color: #8b968c;
  margin: 0;
  text-align: center;
  max-width: 420px;
}

/* ---------- 3. Brief column & the concierge ledger ---------- */

.brief-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-right: 12px;
  color: var(--ink);
}

.wordmark {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.34em;
  margin: 0;
}
.wordmark-dot { color: var(--gold); margin: 0 0.35em; }
.wordmark-sub {
  letter-spacing: 0.22em;
  font-size: 12px;
  color: var(--text-soft);
  text-transform: lowercase;
}

.brief-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.2;
  margin: 0;
}

.value-line {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-soft);
  margin: 0;
  max-width: 34ch;
}

/* The ledger — the one place this page spends its boldness. */
.ledger {
  border: 1px solid rgba(185, 154, 91, 0.45);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 4px;
  padding: 20px 22px 16px;
  max-width: 360px;
}

.ledger-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 6px;
}

.ledger-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ledger-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(185, 154, 91, 0.22);
  opacity: 0.4;
  transition: opacity 0.5s ease;
}
.ledger-item:last-child { border-bottom: none; }
.ledger-item.done { opacity: 1; }

.ledger-mark {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 1px solid #c3cbc1;
  position: relative;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}
.ledger-item.done .ledger-mark {
  background: var(--gold);
  border-color: var(--gold);
}
.ledger-item.done .ledger-mark::after {
  content: "";
  position: absolute;
  left: 5.5px; top: 3px;
  width: 5px; height: 8px;
  border: solid #fff;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(42deg);
}

.ledger-label { font-size: 14px; color: var(--ink); }
.ledger-detail { color: var(--gold); font-variant-numeric: tabular-nums; }

.ledger-note {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-soft);
  margin: 14px 0 0;
}

/* ---------- 4. Topbar: switcher + night toggle ---------- */

.topbar {
  width: min(420px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.switcher {
  display: inline-flex;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 3px;
  margin: 0;
}
.switch-opt { position: relative; }
.switch-opt input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.switch-opt span {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.switch-opt input:checked + span {
  background: var(--evergreen);
  color: #fff;
}
.switch-opt input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.night-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
}
.night-toggle input { accent-color: var(--evergreen); cursor: pointer; }
.night-icon { display: inline-flex; color: var(--gold); }

/* ---------- 5. Phone frame & generic chat layout ---------- */

.phone {
  width: min(420px, 100%);
  height: min(720px, calc(100dvh - 150px));
  min-height: 480px;
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow:
    0 24px 60px -24px rgba(20, 35, 29, 0.35),
    0 4px 16px -8px rgba(20, 35, 29, 0.15);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  flex: none;
}

.hdr-back {
  display: inline-flex;
  background: none;
  border: none;
  padding: 2px;
  color: inherit;
}

.avatar {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--eucalyptus);
  color: #fff;
}
.avatar-letter { font-family: var(--font-display); font-size: 17px; }

.hdr-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hdr-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hdr-status { font-size: 12px; opacity: 0.8; }

.hdr-actions { display: inline-flex; gap: 18px; align-items: center; }

.threads {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overscroll-behavior: contain;
}
/* .messages sets display:flex, which would defeat the hidden attribute */
.messages[hidden] { display: none; }

.msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 82%;
}
.msg-bot { align-self: flex-start; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: var(--eucalyptus);
  color: #fff;
  font-size: 12px;
  font-family: var(--font-display);
  display: none; /* shown only by the Instagram skin */
  align-items: center;
  justify-content: center;
}

.bubble {
  padding: 8px 12px;
  font-size: 14.5px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.bubble-meta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  vertical-align: bottom;
  transform: translateY(3px);
}
.msg-time { font-size: 10.5px; opacity: 0.6; font-variant-numeric: tabular-nums; }
.ticks { display: none; line-height: 0; } /* shown only by the WhatsApp skin */

.msg-note {
  align-self: center;
  max-width: 90%;
  font-size: 12px;
  color: var(--text-soft);
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  padding: 6px 12px;
  text-align: center;
  margin: 4px 0;
}

.seen {
  display: none; /* shown only by the Instagram skin */
  align-self: flex-end;
  font-size: 11px;
  color: #737373;
  padding-right: 6px;
  margin-top: -2px;
}

/* Typing indicator */
.typing .bubble { display: inline-flex; padding: 12px 14px; }
.dots { display: inline-flex; gap: 4px; }
.dots i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  animation: dotpulse 1.2s infinite ease-in-out;
}
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotpulse {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-4px); opacity: 0.85; }
}

/* ---------- 6a. WhatsApp skin ---------- */

.channel-whatsapp { font-family: var(--font-native); }

.channel-whatsapp .chat-header {
  background: #075e54;
  color: #fff;
}
.channel-whatsapp .hdr-status { color: #c5e4df; opacity: 1; }
.channel-whatsapp .hdr-actions { color: #fff; }

.channel-whatsapp .messages {
  background-color: #ece5dd;
  background-image: radial-gradient(rgba(88, 74, 58, 0.09) 1px, transparent 1px);
  background-size: 18px 18px;
}

.channel-whatsapp .msg-bot .bubble {
  background: #fff;
  border-radius: 8px;
  border-top-left-radius: 0;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}
.channel-whatsapp .msg-user .bubble {
  background: #d9fdd3;
  border-radius: 8px;
  border-top-right-radius: 0;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}
.channel-whatsapp .msg-time { color: #667781; opacity: 1; }
.channel-whatsapp .ticks { display: inline-flex; color: #8696a0; }
.channel-whatsapp .ticks-read { color: #53bdeb; }

.channel-whatsapp .composer { background: #f0f2f5; }
.channel-whatsapp .composer textarea {
  background: #fff;
  border-radius: 20px;
  border: none;
}
.channel-whatsapp .send { background: #00a884; color: #fff; }
.channel-whatsapp .chips { background: #ece5dd; }
.channel-whatsapp .typing .bubble { background: #fff; color: #667781; }

/* ---------- 6b. Instagram skin ---------- */

.channel-instagram { font-family: var(--font-native); }

.channel-instagram .chat-header {
  background: #fff;
  color: #000;
  border-bottom: 1px solid #dbdbdb;
}
.channel-instagram .hdr-name { font-size: 14px; }
.channel-instagram .hdr-status { color: #737373; opacity: 1; }
.channel-instagram .hdr-actions { color: #000; }

/* IG story-ring around the clinic avatar */
.channel-instagram .avatar {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(45deg, #fed373, #f15245, #d92e7f, #9b36b7, #515bd4) border-box;
  border: 2px solid transparent;
  color: var(--evergreen);
}
.channel-instagram .avatar-letter { color: var(--evergreen); }

.channel-instagram .messages { background: #fff; }

.channel-instagram .msg-avatar { display: inline-flex; }
.channel-instagram .msg-bot .bubble {
  background: #efefef;
  color: #000;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
}
.channel-instagram .msg-user .bubble {
  background: #3797f0;
  color: #fff;
  border-radius: 18px;
  border-bottom-right-radius: 4px;
}
.channel-instagram .bubble-meta { display: none; } /* IG hides in-bubble times */
.channel-instagram .seen { display: block; }

.channel-instagram .composer { background: #fff; border-top: 1px solid #efefef; }
.channel-instagram .composer textarea {
  border: 1px solid #dbdbdb;
  border-radius: 22px;
  background: #fff;
}
.channel-instagram .send {
  background: linear-gradient(45deg, #fed373, #f15245, #d92e7f, #9b36b7, #515bd4);
  color: #fff;
}
.channel-instagram .chips { background: #fff; }
.channel-instagram .typing .bubble { background: #efefef; color: #737373; }

/* ---------- 6c. Biolite web-chat skin ---------- */

.channel-webchat .chat-header {
  background: linear-gradient(135deg, var(--evergreen), var(--evergreen-deep));
  color: #fff;
  border-bottom: 1px solid rgba(185, 154, 91, 0.55);
  padding: 14px 16px;
}
.channel-webchat .hdr-back,
.channel-webchat .hdr-actions { display: none; }
.channel-webchat .hdr-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0.08em;
}
.channel-webchat .hdr-status { color: #a9c3b4; opacity: 1; }
.channel-webchat .avatar {
  background: var(--evergreen-deep);
  border: 1px solid var(--gold);
}
.channel-webchat .avatar-letter { color: var(--gold); }

.channel-webchat .messages {
  background: linear-gradient(180deg, #f7f8f4 0%, #f1f3ec 100%);
}

.channel-webchat .msg-bot .bubble {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}
.channel-webchat .msg-user .bubble {
  background: var(--evergreen);
  color: #fff;
  border-radius: 14px;
  border-bottom-right-radius: 4px;
}
.channel-webchat .msg-user .msg-time { color: #cfdcd2; opacity: 1; }
.channel-webchat .msg-time { color: #93a096; }

.channel-webchat .composer { background: #fff; border-top: 1px solid var(--line); }
.channel-webchat .composer textarea { background: transparent; border: none; }
.channel-webchat .send { background: var(--evergreen); color: #fff; }
.channel-webchat .send:hover { background: var(--evergreen-deep); }
.channel-webchat .chips {
  background: linear-gradient(180deg, transparent, #f1f3ec);
}
.channel-webchat .chip { border-color: rgba(185, 154, 91, 0.5); color: var(--evergreen); }
.channel-webchat .typing .bubble {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--eucalyptus);
}

/* ---------- 7. Chips & composer ---------- */

.chips {
  flex: none;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 12px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
/* After the first message, the suggested prompts retire but the scenario
   switcher stays, so different situations can be tried at any time. */
.chips-hidden .chip-prompt { display: none; }

.chip {
  flex: none;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: inherit;
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.chip:hover { border-color: var(--eucalyptus); }

/* Scenario chips: the live situations, styled as quiet gold controls */
.chip-scenario {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: rgba(185, 154, 91, 0.55);
  background: rgba(185, 154, 91, 0.07);
  color: var(--evergreen);
  font-weight: 500;
}
.chip-scenario::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}
.chip-scenario:hover { border-color: var(--gold); background: rgba(185, 154, 91, 0.14); }

.composer {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
}

.composer textarea {
  flex: 1;
  resize: none;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  padding: 10px 14px;
  color: inherit;
  outline-offset: 2px;
  min-height: 40px;
  max-height: 120px;
}
.composer textarea:focus-visible { outline: 2px solid var(--gold); }
/* Focus ring matches each channel's native accent so the skins stay convincing */
.channel-whatsapp .composer textarea:focus-visible { outline-color: #00a884; }
.channel-instagram .composer textarea:focus-visible { outline-color: #3797f0; }
.composer textarea:disabled { opacity: 0.55; }

.send {
  flex: none;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease;
}
.send:active { transform: scale(0.94); }
.send:disabled { opacity: 0.5; cursor: default; }
.send:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.send svg { transform: translateX(1px); }

/* ---------- 8. Mobile sheet, fab, responsive, a11y ---------- */

.ledger-fab {
  display: none;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(185, 154, 91, 0.6);
  background: rgba(255, 255, 255, 0.92);
  color: var(--evergreen);
  box-shadow: 0 6px 18px -6px rgba(20, 35, 29, 0.3);
  cursor: pointer;
}
body.night .ledger-fab { background: rgba(26, 38, 32, 0.92); color: #d8ddd3; }
.ledger-fab::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  margin-right: 7px;
}
.ledger-fab.nudge { animation: nudge 1.1s ease; }
@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-4px); }
  50% { transform: translateY(0); }
  70% { transform: translateY(-2px); }
}

.sheet-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 19, 0.45);
  z-index: 40;
}

@media (max-width: 999px) {
  .stage {
    grid-template-columns: 1fr;
    padding: 12px 10px 8px;
    gap: 10px;
    align-items: stretch;
  }

  /* Brief becomes a bottom sheet */
  .brief {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    background: var(--paper);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px rgba(15, 23, 19, 0.25);
    padding: 22px 20px calc(env(safe-area-inset-bottom, 0px) + 22px);
    transform: translateY(105%);
    transition: transform 0.32s ease;
    max-height: 82dvh;
    overflow-y: auto;
  }
  body.night .brief { background: #15201a; }
  .brief.sheet-open { transform: translateY(0); }
  .brief-title { display: none; }
  .ledger { max-width: none; }

  .ledger-fab { display: inline-flex; align-items: center; z-index: 30; }

  .phone {
    width: 100%;
    /* Fallback cap; app.js measures the real offset and sets the exact
       height so the composer is always on screen (sizePhoneForViewport). */
    height: calc(100dvh - 190px);
    min-height: 420px;
    max-height: 720px;
    flex: none;
    border-radius: 18px;
  }
  /* Comfortable thumb targets on touch screens */
  .chip-scenario, .chip-prompt { min-height: 38px; }
  .device { flex: 1; min-height: 0; width: 100%; }
  .topbar { width: 100%; justify-content: center; }
  .device-footnote { display: none; }
}

@media (max-width: 379px) {
  .night-text { display: none; } /* icon-only toggle on the narrowest phones */
  .switch-opt span { padding: 7px 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================================================================
   9. Showcase mode: "A night at Biolite"
   ================================================================== */

/* ---------- Mode toggle bar ---------- */

.mode-bar {
  display: flex;
  justify-content: center;
  padding: 16px 12px 0;
}
.mode-switch .switch-opt span { padding: 8px 18px; }

/* ---------- Showcase shell ---------- */

.showcase { min-height: 100dvh; }

.sc-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 72px;
}

.sc-head { margin-bottom: 26px; }

.sc-eyebrow {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sc-tag {
  font-family: var(--font-ui);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  background: #fff;
}

.sc-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 6vw, 36px);
  line-height: 1.18;
  margin: 0 0 10px;
  color: var(--ink);
  outline: none;
}
.sc-sub {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-soft);
  margin: 0 0 18px;
  max-width: 46ch;
}

.sc-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sc-clock {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--evergreen);
  min-width: 96px;
  font-variant-numeric: tabular-nums;
}
.sc-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(185, 154, 91, 0.6);
  background: #fff;
  color: var(--evergreen);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.sc-btn:hover { background: #f4f2ea; }
.sc-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sc-btn .sc-ic-play { display: none; }
.sc-btn.is-paused .sc-ic-play { display: block; }
.sc-btn.is-paused .sc-ic-pause { display: none; }

/* ---------- Timeline ---------- */

.sc-timeline {
  list-style: none;
  margin: 0;
  padding: 6px 0 0 26px;
  position: relative;
}
.sc-timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(rgba(185, 154, 91, 0.55), rgba(185, 154, 91, 0.15));
}

.sc-beat {
  position: relative;
  margin: 0 0 30px;
}
.sc-beat::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--paper);
  transition: background-color 0.4s ease;
}
.sc-beat.revealed::before { background: var(--gold); }

.sc-time {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--text-soft);
  background: none;
  border: none;
  padding: 0 0 10px;
  cursor: pointer;
}
.sc-beat.revealed .sc-time { color: var(--evergreen); }
.sc-time:hover { color: var(--gold); }
.sc-time:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ---------- Event cards ---------- */

.sc-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 34px -22px rgba(20, 35, 29, 0.35);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.sc-beat.revealed .sc-card { opacity: 1; transform: none; }

.sc-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.sc-ch-icon { display: inline-flex; color: var(--evergreen); }
.sc-ch-name { font-weight: 600; color: var(--ink); }
.sc-ch-sub { color: var(--text-soft); }
.sc-moon { margin-left: auto; color: var(--gold); display: inline-flex; }

/* Mini conversation: reuses the channel skins' bubble styling */
.sc-chat {
  padding: 14px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sc-chat.channel-whatsapp {
  background-color: #ece5dd;
  background-image: radial-gradient(rgba(88, 74, 58, 0.09) 1px, transparent 1px);
  background-size: 18px 18px;
}
.sc-chat.channel-instagram { background: #fff; }
.sc-chat.channel-instagram .msg-avatar { display: inline-flex; }
.sc-chat.channel-webchat { background: linear-gradient(180deg, #f7f8f4 0%, #f1f3ec 100%); }
.sc-chat.channel-webchat .msg-bot .bubble { background: #fff; border: 1px solid var(--line); border-radius: 14px; border-bottom-left-radius: 4px; }
.sc-chat.channel-webchat .msg-user .bubble { background: var(--evergreen); color: #fff; border-radius: 14px; border-bottom-right-radius: 4px; }

.sc-chat .msg {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.sc-chat .msg.shown { opacity: 1; transform: none; }
.sc-chat .msg.typing, .sc-typing { opacity: 1; transform: none; }
.sc-chat .bubble { font-size: 13.5px; }

/* Review card (beat 5) */
.sc-review {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  max-width: 300px;
}
.sc-stars { color: #f0a92e; font-size: 15px; letter-spacing: 2px; }
.sc-review-author { font-size: 12px; font-weight: 600; color: var(--ink); }
.sc-review-text { font-size: 13px; line-height: 1.5; color: var(--text-soft); }

/* Outcome chip */
.sc-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 4px 14px 14px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--evergreen);
  border: 1px solid rgba(185, 154, 91, 0.55);
  background: rgba(185, 154, 91, 0.08);
  border-radius: 999px;
  padding: 6px 13px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.sc-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}
.sc-chip.shown { opacity: 1; transform: none; }

/* Night beat (2:47 AM): the flagship moment, dimmed frame, lit screen */
.sc-night .sc-card { background: #15201a; border-color: #2a382f; }
.sc-night .sc-card-head { border-bottom-color: #2a382f; }
.sc-night .sc-ch-icon { color: #a9c3b4; }
.sc-night .sc-ch-name { color: #f2f3ef; }
.sc-night .sc-ch-sub { color: #8f9c91; }
.sc-night .sc-chat { margin: 12px; border-radius: 10px; }
.sc-night .sc-chip { background: rgba(185, 154, 91, 0.14); color: #e6d9be; }

/* ---------- Morning report ---------- */

.sc-report {
  margin: 8px 0 0 26px;
  background: linear-gradient(150deg, var(--evergreen), var(--evergreen-deep));
  color: #fff;
  border-radius: 16px;
  padding: 24px 22px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.sc-report.shown { opacity: 1; transform: none; }

.sc-report-eyebrow {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 8px;
}
.sc-report-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 23px;
  margin: 0 0 2px;
}
.sc-report-range { font-size: 12.5px; color: #a9c3b4; margin: 0 0 16px; }

.sc-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 14px;
}
.sc-stat-label { color: #d8ddd3; }
.sc-stat-n {
  font-family: var(--font-display);
  font-size: 22px;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.sc-revenue {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 14px 0 4px;
  font-size: 14px;
  color: #e6d9be;
}
.sc-revenue strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  color: var(--gold);
  white-space: nowrap;
}

.sc-footnote { font-size: 11.5px; color: #8f9c91; margin: 10px 0 18px; line-height: 1.5; }

.sc-close {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.4;
  color: #f2f3ef;
  margin: 0 0 16px;
}

.sc-cta {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--evergreen-deep);
  background: var(--gold);
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease;
}
.sc-cta:hover { filter: brightness(1.06); }
.sc-cta:active { transform: scale(0.97); }
.sc-cta:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Night page background carries into showcase too */
body.night .showcase { color: #e6e9e2; }
body.night .sc-title { color: #f2f3ef; }
body.night .sc-sub { color: #a9b6ac; }
body.night .sc-tag { background: #1a2620; border-color: #2a382f; }
body.night .sc-clock { color: #c9d8cc; }
body.night .sc-btn { background: #1a2620; color: #d8ddd3; }
body.night .sc-card { border-color: #2a382f; }
body.night .sc-time { color: #8f9c91; }

/* ==================================================================
   10. Owner's view lead card (live-chat mode)
   ================================================================== */

.leadcard {
  margin-top: 16px;
  max-width: 360px;
  border: 1px solid rgba(185, 154, 91, 0.55);
  border-radius: 4px;
  background: linear-gradient(150deg, var(--evergreen), var(--evergreen-deep));
  color: #fff;
  padding: 18px 20px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.leadcard.shown { opacity: 1; transform: none; }

.lead-eyebrow {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 10px;
}
.lead-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
}
.lead-row span { color: #a9c3b4; flex: none; }
.lead-row strong { font-weight: 500; color: #fff; text-align: right; overflow-wrap: anywhere; }
.lead-status { font-size: 12px; color: #e6d9be; margin: 10px 0 4px; letter-spacing: 0.03em; }
.lead-value {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  color: #e6d9be;
  padding-top: 6px;
}
.lead-value strong { font-family: var(--font-display); font-weight: 400; font-size: 19px; color: var(--gold); }
.lead-footnote { font-size: 11px; color: #8f9c91; margin: 8px 0 0; }

/* Desktop refinement */
@media (min-width: 1000px) {
  .mode-bar { padding-top: 26px; }
  .sc-inner { max-width: 680px; padding-top: 30px; }
}

/* Reduced motion: showcase is fully static (handled in JS too) */
@media (prefers-reduced-motion: reduce) {
  .sc-card, .sc-chat .msg, .sc-chip, .sc-report, .leadcard { transition: none; }
}

/* ==================================================================
   11. Brief column: the revenue case
   ================================================================== */

.case {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 40ch;
}
.case li {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-soft);
  padding: 10px 0;
  border-bottom: 1px solid rgba(185, 154, 91, 0.18);
}
.case li:first-child { padding-top: 0; }
.case li:last-child { border-bottom: none; padding-bottom: 0; }
.case strong { color: var(--ink); font-weight: 600; display: block; margin-bottom: 1px; }

.quickstats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 2px 0 0;
  max-width: 360px;
}
.qs {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 4px;
  padding: 12px 10px 10px;
  text-align: center;
}
.qs dd {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--evergreen);
  margin: 0 0 2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.qs dt {
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  line-height: 1.3;
}
.stats-footnote {
  font-size: 11px;
  color: #93a096;
  margin: -8px 0 0;
}

.brief-cta {
  align-self: flex-start;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--evergreen);
  background: none;
  border: 1px solid rgba(185, 154, 91, 0.6);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.brief-cta:hover { background: rgba(185, 154, 91, 0.1); border-color: var(--gold); }
.brief-cta:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

body.night .case li { color: #a9b6ac; }
body.night .case strong { color: #e6e9e2; }
body.night .qs { background: rgba(255, 255, 255, 0.04); border-color: #2a382f; }
body.night .qs dd { color: #c9d8cc; }
body.night .brief-cta { color: #d8ddd3; }

/* ==================================================================
   12. Showcase additions: missed call + gentle follow-up
   ================================================================== */

/* Missed-call marker on the card head icon: red until the rescue text lands */
.sc-ch-icon { position: relative; }
.sc-dot-missed {
  position: absolute;
  top: -2px;
  right: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c4483e;
  border: 1.5px solid #fff;
  transition: background-color 0.5s ease;
}
.sc-ch-icon.resolved .sc-dot-missed { background: #00a884; }
.sc-night .sc-dot-missed { border-color: #15201a; }

/* The missed-call row inside the chat */
.sc-call {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #8a6b60;
  background: rgba(196, 72, 62, 0.08);
  border: 1px solid rgba(196, 72, 62, 0.25);
  border-radius: 999px;
  padding: 6px 14px;
  max-width: 92%;
  transition: color 0.5s ease, background-color 0.5s ease, border-color 0.5s ease;
}
.sc-call-ic { display: inline-flex; color: #c4483e; transition: color 0.5s ease; }
.sc-call.resolved { color: #4d6b58; background: rgba(0, 168, 132, 0.08); border-color: rgba(0, 168, 132, 0.3); }
.sc-call.resolved .sc-call-ic { color: #00a884; }

/* Faded context line ("3 days ago ...") */
.sc-aside {
  align-self: center;
  font-size: 11.5px;
  font-style: italic;
  color: #98a29a;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  padding: 5px 12px;
  max-width: 92%;
  text-align: center;
}

/* ==================================================================
   13. Scenario discoverability: chips label + try-this-live buttons
   ================================================================== */

.chips-label {
  flex: none;
  align-self: center;
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  padding-right: 2px;
  white-space: nowrap;
}

/* Card footer: outcome chip on the left, try-live on the right */
.sc-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 14px 12px;
}
.sc-card-foot .sc-chip { margin: 4px 0 0; }

.sc-try {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: var(--evergreen);
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  margin-top: 4px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease, background-color 0.15s ease;
}
.sc-try.shown { opacity: 1; transform: none; }
.sc-try:hover { background: var(--evergreen-deep); }
.sc-try:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.sc-night .sc-try { background: var(--gold); color: var(--evergreen-deep); }
body.night .chips-label { color: var(--gold); }

/* Live missed-call staging: the phone rings, goes unanswered, then the
   rescue text arrives. Reuses the showcase call-pill styling. */
.sc-call.ringing {
  color: #40584b;
  background: rgba(30, 66, 55, 0.06);
  border-color: rgba(30, 66, 55, 0.28);
}
.sc-call.ringing .sc-call-ic {
  color: var(--evergreen);
  animation: callring 1.1s infinite ease-in-out;
}
@keyframes callring {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-14deg); }
  40% { transform: rotate(11deg); }
  60% { transform: rotate(-7deg); }
  80% { transform: rotate(4deg); }
}

/* ==================================================================
   14. Booking calendar card (owner's view)
   ================================================================== */

.calcard {
  margin-top: 14px;
  max-width: 360px;
  background: #fff;
  border: 1px solid rgba(185, 154, 91, 0.5);
  border-radius: 4px;
  padding: 18px 20px 14px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.calcard.shown { opacity: 1; transform: none; }

.cal-eyebrow {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 4px;
}
.cal-month {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--ink);
  margin: 0 0 10px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px 0;
  text-align: center;
}
.cal-dow {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #a7b0a6;
  padding-bottom: 4px;
}
.cal-day {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 24px;
  height: 24px;
  font-variant-numeric: tabular-nums;
}
.cal-day.cal-hit {
  background: var(--gold);
  color: #fff;
  border-radius: 50%;
  width: 24px;
  margin: 0 auto;
  font-weight: 600;
}
.cal-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 12px;
  background: rgba(30, 66, 55, 0.05);
  border-left: 2px solid var(--evergreen);
  border-radius: 0 8px 8px 0;
  font-size: 12.5px;
  color: var(--ink);
}
.cal-entry-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--evergreen);
}
.cal-footnote { font-size: 11px; color: #93a096; margin: 10px 0 0; }

body.night .calcard { background: #15201a; border-color: rgba(185, 154, 91, 0.4); }
body.night .cal-month { color: #f2f3ef; }
body.night .cal-day { color: #9fb0a3; }
body.night .cal-entry { background: rgba(255, 255, 255, 0.05); color: #e6e9e2; border-left-color: var(--gold); }
body.night .cal-entry-dot { background: var(--gold); }

/* Session lead log inside the owner's-view card */
.lead-log-title { margin-top: 14px; }
.lead-log { list-style: none; margin: 0; padding: 0; }
.lead-log-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
}
.lead-log-row:last-child { border-bottom: none; }
.lead-log-who { color: #fff; font-weight: 500; }
.lead-log-meta { color: #a9c3b4; text-align: right; }

/* Links inside chat bubbles: visible on both bubble colours */
.bubble-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

/* WhatsApp-style location preview card for map links */
.map-card {
  display: block;
  margin-top: 8px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(30, 66, 55, 0.14);
  background: #fff;
  text-decoration: none;
  max-width: 280px;
}
.map-card .map-art { display: block; width: 100%; height: auto; }
.map-card .map-meta { display: block; padding: 8px 11px 9px; }
.map-card .map-meta strong {
  display: block;
  font-size: 13.5px;
  color: var(--evergreen, #1e4237);
}
.map-card .map-addr {
  display: block;
  font-size: 12px;
  color: #5c6b62;
  margin-top: 1px;
}
.map-card .map-domain {
  display: block;
  font-size: 10.5px;
  color: #9aa59c;
  margin-top: 3px;
  letter-spacing: 0.2px;
}
