:root {
  --navy: #0B2A3A; --navy-2: #133A4D; --teal: #11929B; --teal-2: #7BCDD3;
  --brand: #0F4C5C; --accent: #0EA5A4;
  --line: #E2E8F0; --soft: #F1F5F9; --ink: #1E293B; --mute: #64748B;
  --red: #DC2626; --amber-bg: #FFFBEB; --teal-bg: #F0FDFA;
  --heading: 'Montserrat', ui-sans-serif, system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { display: flex; flex-direction: column; background: var(--navy); color: var(--ink); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; color: #fff; flex: none; }
.back { color: rgba(255,255,255,.65); text-decoration: none; font: 600 13px var(--heading); flex: 1; }
.back:hover { color: #fff; }
.brand { font: 800 17px var(--heading); letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.pill { font: 600 11px var(--heading); letter-spacing: .03em; color: var(--teal-2); background: rgba(17,146,155,.2); border: 1px solid rgba(17,146,155,.45); padding: 3px 10px; border-radius: 999px; }
.top-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex: 1; }
.ghost { background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; padding: 5px 12px; font: 600 12.5px var(--heading); }
.ghost:hover { background: rgba(255,255,255,.1); }
.lang { display: flex; background: rgba(255,255,255,.1); border-radius: 999px; padding: 3px; }
.lang button { border: 0; background: none; color: rgba(255,255,255,.65); font: 700 11.5px var(--heading); padding: 4px 10px; border-radius: 999px; }
.lang button.active { background: var(--teal); color: #fff; }

/* Coach */
.coach { display: flex; align-items: center; gap: 14px; margin: 0 20px 12px; padding: 10px 16px; background: var(--navy-2); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; color: #fff; flex: none; }
.coach-step { font: 700 12px var(--heading); color: var(--teal-2); white-space: nowrap; }
.coach p { flex: 1; font-size: 14.5px; line-height: 1.4; }
.coach-cta { background: var(--teal); color: #fff; text-decoration: none; font: 600 13.5px var(--heading); padding: 9px 16px; border-radius: 8px; white-space: nowrap; }
.coach-cta:hover { background: #0E7B83; }

/* Stage */
.tabs { display: none; }
.stage { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; padding: 0 20px 20px; }
.phone-col, .app-col { min-height: 0; }

/* Phone */
.phone { height: 100%; display: flex; flex-direction: column; background: #ECE5DD; border: 6px solid #020F16; border-radius: 26px; overflow: hidden; }
.phone-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--brand); color: #fff; flex: none; }
.phone-head strong { display: block; font-size: 14.5px; line-height: 1.2; }
.phone-head small { font-size: 11.5px; opacity: .75; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); font: 700 13px var(--heading); }
.chat { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.note { align-self: center; text-align: center; font-size: 11.5px; color: #55636b; background: rgba(255,255,255,.65); padding: 3px 10px; border-radius: 8px; }
.bubble { max-width: 86%; padding: 7px 10px; border-radius: 10px; font-size: 14px; line-height: 1.38; background: #fff; align-self: flex-start; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.bubble.new { animation: pop .22s ease-out; }
.bubble.patient { align-self: flex-end; background: #D9FDD3; }
.bubble.human { background: #FEF3C7; }
.who { display: block; font: 700 10.5px var(--heading); color: var(--brand); margin-bottom: 2px; }
.bubble.human .who { color: #92400E; }
.gloss { display: block; margin-top: 3px; padding-top: 3px; border-top: 1px dashed rgba(0,0,0,.14); font-size: 12px; color: #5b6770; }
.typing { display: flex; gap: 4px; padding: 11px 13px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa5ad; animation: blink 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .35; } 30% { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.options { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 10px; background: #F6F3EE; min-height: 58px; justify-content: center; }
.option { text-align: left; border: 1px solid #0EA5A4; background: #fff; color: var(--brand); border-radius: 10px; padding: 7px 11px; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.option:hover { background: var(--teal-bg); }
.option small { display: block; font-weight: 400; color: var(--mute); font-size: 11.5px; }
.options-note { text-align: center; color: var(--mute); font-size: 12.5px; }

/* App window */
.window { position: relative; height: 100%; display: flex; flex-direction: column; background: #fff; border-radius: 12px; overflow: hidden; }
.window-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--soft); border-bottom: 1px solid var(--line); flex: none; }
.window-bar i { width: 10px; height: 10px; border-radius: 50%; background: #CBD5E1; }
.window-bar span { margin-left: 10px; font-size: 12px; color: var(--mute); }
.app { flex: 1; min-height: 0; display: flex; }
.side { width: 196px; flex: none; padding: 18px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.logo { font: 800 18px var(--heading); color: var(--brand); margin: 0 0 14px 10px; letter-spacing: -.02em; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font-size: 14px; color: #334155; }
.nav-item:hover { background: var(--soft); }
.nav-item.active { background: #E6F6F6; color: var(--brand); font-weight: 600; }
.badge { min-width: 19px; text-align: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--red); padding: 0 5px; border-radius: 999px; }
.role { margin-top: auto; font-size: 12px; color: #94A3B8; padding-left: 10px; }
.view { flex: 1; min-width: 0; overflow-y: auto; padding: 22px 26px; }
.page-head { margin-bottom: 16px; }
.page-head h1 { font: 700 21px var(--heading); color: var(--brand); letter-spacing: -.015em; }
.page-head p { font-size: 14px; color: var(--mute); }
.head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat span { font-size: 14px; color: var(--mute); }
.stat b { display: block; font-size: 30px; font-weight: 700; line-height: 1.2; margin-top: 2px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.row-link { width: 100%; text-align: left; font: inherit; cursor: pointer; }
.row-link:hover { border-color: var(--accent); }
.title { font-weight: 600; }
.sub { font-size: 13.5px; color: var(--mute); }
.btns { display: flex; gap: 6px; flex: none; }
.btn { border: 1px solid #CBD5E1; background: #fff; border-radius: 7px; padding: 4px 11px; font-size: 13px; }
.btn:hover { background: var(--soft); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-solid { border: 0; color: #fff; background: var(--accent); border-radius: 8px; padding: 8px 15px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.btn-dark { background: var(--brand); }
.btn-solid:hover { filter: brightness(.94); }
.flash { animation: flash 2.6s ease-out; }
@keyframes flash { 0%, 55% { background: #CCFBF1; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,165,164,.25); } 100% { background: #fff; } }
.tag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: #E6F6F6; color: var(--brand); margin-left: 6px; }
.state-att { color: var(--red); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.state { color: var(--mute); font-size: 12.5px; white-space: nowrap; }
.filters { margin-bottom: 12px; font-size: 14px; display: flex; gap: 14px; }
.filters button { border: 0; background: none; color: var(--mute); }
.filters button.active { color: var(--ink); font-weight: 600; }
.back-link { border: 0; background: none; color: var(--mute); font-size: 13.5px; margin-bottom: 10px; }
.msg { padding: 7px 10px; border-radius: 8px; font-size: 14px; background: var(--soft); }
.msg.agent { background: var(--teal-bg); }
.msg.human { background: var(--amber-bg); }
.msg.system { background: none; color: #94A3B8; font-size: 12.5px; padding: 1px 10px; }
.msg > span { font-size: 10.5px; text-transform: uppercase; color: #94A3B8; margin-right: 5px; letter-spacing: .03em; }
.reply { display: flex; gap: 8px; margin-top: 12px; }
.input { flex: 1; min-width: 0; border: 1px solid #CBD5E1; border-radius: 8px; padding: 8px 12px; font-size: 14px; background: #fff; }
.new-form { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 8px; margin-bottom: 12px; }
.muted { color: var(--mute); font-size: 14px; }
.cancelled .title { text-decoration: line-through; color: var(--mute); }
.toast { position: absolute; left: 50%; bottom: 16px; transform: translate(-50%, 16px); max-width: 90%; background: var(--navy); color: #fff; font-size: 13px; padding: 8px 14px; border-radius: 9px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast code { font: 600 12.5px ui-monospace, Menlo, Consolas, monospace; color: var(--teal-2); }

/* Mobile: one pane at a time */
@media (max-width: 860px) {
  .topbar { padding: 8px 16px; }
  .back { font-size: 0; flex: 0 0 auto; }
  .back::before { content: '\2190'; font-size: 18px; }
  .brand { font-size: 15px; gap: 6px; }
  .pill { display: none; }
  .ghost { padding: 4px 9px; font-size: 12px; }
  .coach { margin: 0 16px 8px; padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  .coach p { font-size: 13.5px; flex-basis: 100%; order: 2; }
  .coach-cta { order: 3; padding: 7px 12px; font-size: 13px; }
  .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 16px 8px; padding: 3px; background: rgba(255,255,255,.1); border-radius: 10px; flex: none; }
  .tabs button { position: relative; border: 0; background: none; color: rgba(255,255,255,.7); font: 600 13px var(--heading); padding: 7px; border-radius: 8px; }
  .tabs button.active { background: #fff; color: var(--navy); }
  .dot { position: absolute; top: 6px; margin-left: 5px; width: 8px; height: 8px; border-radius: 50%; background: #F87171; }
  .stage { display: block; padding: 0 16px 16px; }
  .stage[data-tab="phone"] .app-col, .stage[data-tab="app"] .phone-col { display: none; }
  .phone-col, .app-col { height: 100%; }
  .phone { border-width: 0; border-radius: 12px; }
  .window-bar { display: none; }
  .app { flex-direction: column; }
  .side { width: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .logo, .role { display: none; }
  .side-nav { flex-direction: row; overflow-x: auto; gap: 2px; }
  .nav-item { width: auto; flex: none; gap: 5px; padding: 6px 9px; font-size: 13px; }
  .view { padding: 14px; }
  .stats { grid-template-columns: 1fr; gap: 8px; }
  .row { flex-wrap: wrap; }
  .new-form { grid-template-columns: 1fr; }
  .input, .new-form select { font-size: 16px; }
}

/* Self-playing tour (used to record the video) */
.tour .topbar, .tour .coach, .tour .tabs { display: none; }
.tour .stage { padding: 24px 28px 96px; grid-template-columns: 330px minmax(0, 1fr); }
.tour .options-note { visibility: hidden; }
html.tour body { background: linear-gradient(160deg, #0B2A3A 0%, #133A4D 100%); }
.cursor { position: fixed; left: 0; top: 0; z-index: 50; transition: transform .75s cubic-bezier(.4, 0, .2, 1); filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); pointer-events: none; }
.cursor.press svg { transform: scale(.85); transform-origin: 20% 10%; }
.caption { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 40; width: max-content; max-width: 1120px; text-align: center; color: #fff; font: 600 21px/1.3 var(--heading); letter-spacing: -.01em; animation: pop .3s ease-out; }
.caption b { color: var(--teal-2); font-weight: 700; margin-right: 8px; }
.card-screen { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; color: #fff; background: var(--navy); background-image: linear-gradient(rgba(17,146,155,.09) 1px, transparent 1px), linear-gradient(90deg, rgba(17,146,155,.09) 1px, transparent 1px); background-size: 64px 64px; }
.card-screen h1 { font: 800 64px/1.05 var(--heading); letter-spacing: -.03em; margin-bottom: 16px; }
.card-screen p { font-size: 25px; color: rgba(255,255,255,.72); max-width: 820px; }
.card-screen small { margin-top: 30px; font: 600 16px var(--heading); color: var(--teal-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
