/* Demo player. Desktop: phone left, desk right. ≤860px: one pane at a time with tabs; controls fixed in the thumb zone. */
body.demo { padding-bottom: 88px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.btn.small { min-height: 44px; padding: 6px 14px; font-size: 15px; font-weight: 500; }
.btn.block { display: flex; width: 100%; }

.capbar { background: #fff; border-bottom: 1px solid var(--line); }
.capwrap { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 14px; padding-top: 10px; padding-bottom: 10px; }
.capwrap p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.scene-chip { font-size: 14px; color: var(--muted); }
.caption { font-weight: 700; font-size: 18px; line-height: 1.4; }
.counter { font-size: 14px; color: var(--muted); white-space: nowrap; }
@media (max-width: 860px) {
  .capwrap { grid-template-columns: 1fr auto; }
  .caption { grid-column: 1 / -1; grid-row: 2; font-size: 17px; }
}

.tabs { display: none; }
.stage { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 20px; padding-top: 14px; padding-bottom: 8px; align-items: start; }
.pane-label { margin: 0 0 8px; }
.fictional { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* phone */
.phone { border: 3px solid var(--parent); border-radius: 22px; overflow: hidden; background: #efeae2; display: flex; flex-direction: column; height: min(600px, calc(100dvh - 260px)); min-height: 380px; }
.phone-head { background: #075e54; color: #fff; display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.phone-head p { margin: 0; }
.phone-name { font-weight: 700; }
.phone-sub { font-size: 13px; opacity: .9; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #fff; color: #075e54; display: inline-grid; place-items: center; font-weight: 700; flex: none; }
.avatar.you { background: var(--you); color: #fff; }
.chat { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.chat:focus-visible { outline-offset: -3px; }
.day { align-self: center; background: #fff; color: var(--muted); font-size: 13px; border-radius: 8px; padding: 2px 10px; }
.msg { max-width: 86%; padding: 7px 10px; border-radius: 10px; background: #fff; font-size: 15px; line-height: 1.5; white-space: pre-line; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.msg.parent { align-self: flex-end; background: #d9fdd3; }
.msg .by { display: block; font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.msg.ai .by { color: var(--ai); } .msg.you .by { color: var(--you); }
.msg.new { animation: pop .3s ease-out; }
.msg.typing { color: var(--muted); font-style: italic; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.composer { display: flex; align-items: center; gap: 8px; padding: 8px; background: #f0f0f0; }
.composer .input { flex: 1; margin: 0; min-height: 44px; background: #fff; border-radius: 22px; padding: 10px 14px; font-size: 15px; line-height: 1.4; color: var(--ink); }
.composer .input:empty::before { content: "…"; color: var(--muted); }
.send { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--parent); color: #fff; font-size: 20px; cursor: pointer; flex: none; }
.send[disabled] { background: #9aa3af; cursor: default; }

/* desk */
.desk { background: #fff; border: 3px solid var(--you); border-radius: 18px; padding: 14px 16px 18px; min-height: 380px; }
.desk-head { display: flex; align-items: center; gap: 10px; font-weight: 700; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.desk-head p { margin: 0; }
.desk-h { font-size: 15px; color: var(--muted); margin: 14px 0 8px; font-weight: 600; }
.empty { color: var(--muted); font-size: 15px; background: var(--bg); border-radius: 12px; padding: 14px; margin: 0; }
.dcard { border: 1px solid var(--line); border-left: 5px solid var(--ai); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.dcard.new { animation: pop .3s ease-out; }
.dcard h3 { font-size: 16px; margin: 0 0 6px; }
.dcard ul { margin: 0 0 8px; padding-left: 18px; font-size: 15px; }
.draft { background: var(--ai-bg); border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; font-size: 15px; }
.draft .by { display: block; font-size: 12px; font-weight: 700; color: var(--ai); }
.checks { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--good); font-size: 14px !important; }
.approve { background: var(--you); color: #fff; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.log li { display: flex; gap: 8px; }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.log .new { animation: pop .3s ease-out; }
.tracker { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.bar { height: 10px; background: #dfe4ea; border-radius: 5px; overflow: hidden; margin: 6px 0 4px; }
.bar i { display: block; height: 100%; background: var(--good); transition: width .4s; }

/* the one thing to tap */
.pulse { position: relative; animation: ring 1.4s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(245,158,11,.75); } 100% { box-shadow: 0 0 0 14px rgba(245,158,11,0); } }
.hint { position: absolute; background: #f59e0b; color: #1c2430; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; pointer-events: none; }
.send .hint { right: 0; bottom: 56px; }

/* controls */
.controls { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.97); border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
.ctl { display: flex; justify-content: flex-end; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
#next { min-width: 160px; }
@media (max-width: 860px) {
  .ctl { justify-content: space-between; }
  #next { flex: 1; max-width: 260px; }
}

/* mobile: one pane at a time */
@media (max-width: 860px) {
  .tabs { display: flex; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 60px; z-index: 15; }
  .tabs button { flex: 1; min-height: 48px; border: 0; background: none; font: inherit; font-size: 15px; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; position: relative; }
  .tabs button[aria-selected="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--you); }
  #tab-phone[aria-selected="true"] { border-bottom-color: var(--parent); }
  .tabs .dot { position: absolute; top: 10px; margin-left: 4px; width: 9px; height: 9px; border-radius: 50%; background: #e11d48; }
  .stage { grid-template-columns: 1fr; padding-top: 10px; }
  .pane[hidden] { display: none; }
  .pane-label { display: none; }
  .phone { height: calc(100dvh - 300px); min-height: 340px; }
}

/* dialogs */
dialog { border: 0; border-radius: 18px; padding: 22px; width: min(620px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--ink); }
dialog::backdrop { background: rgba(20,28,40,.55); backdrop-filter: blur(3px); }
dialog h2 { margin: 0 0 8px; }
dialog p { margin: 0 0 14px; color: var(--muted); }
.cast { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cast li { border: 2px solid; border-radius: 14px; padding: 12px 8px; text-align: center; font-size: 14px; }
.cast .ic { font-size: 26px; display: block; }
.cast b { display: block; font-size: 15px; }
.cast .parent { border-color: var(--parent); background: var(--parent-bg); } .cast .parent b { color: var(--parent-ink); }
.cast .ai { border-color: var(--ai); background: var(--ai-bg); } .cast .ai b { color: var(--ai); }
.cast .you { border-color: var(--you); background: var(--you-bg); } .cast .you b { color: var(--you); }
@media (max-width: 480px) {
  .cast { grid-template-columns: 1fr; }
  .cast li { display: grid; grid-template-columns: 36px 1fr; text-align: left; align-items: center; column-gap: 8px; }
  .cast .ic { grid-row: span 2; font-size: 24px; }
}
.points { margin: 0 0 16px; padding-left: 20px; font-size: 17px; }
.points li { margin: 4px 0; }
.end-more { display: flex; gap: 10px; margin-top: 10px; }
.end-more .btn { flex: 1; }
.end-tool { margin: 12px 0 0 !important; text-align: center; }
.end-tool a { display: inline-flex; align-items: center; min-height: 44px; }
