:root {
  --bg: #0e1116;
  --bg2: #151a22;
  --ink: #ece9e1;
  --muted: #8c93a1;
  --accent: #ff6a3d;
  --accent2: #3fb8af;
  --screen: #f5f2ea;
  --card: #fffdf8;
  --line: #e4dfd3;
  --text: #1b1b1f;
  --phone-w: 480px;
  --phone-h: 640px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); overflow: hidden; }
#app { height: 100%; display: flex; flex-direction: column; align-items: center; }

/* presenter bar */
.presenter-bar { width: 100%; display: flex; align-items: center; gap: 18px; padding: 10px 18px; background: var(--bg2); border-bottom: 1px solid #232a35; }
.brand { font-family: var(--serif); font-size: 16px; letter-spacing: .02em; color: var(--ink); white-space: nowrap; }
.scene-picker { display: flex; gap: 6px; flex: 1; }
.scene-btn, .pbtn { background: #1d2430; color: var(--ink); border: 1px solid #2c3544; border-radius: 8px; padding: 7px 12px; font: 600 13px var(--sans); cursor: pointer; }
.scene-btn:hover, .pbtn:hover { border-color: #46526a; }
.scene-btn.active { background: var(--accent); border-color: var(--accent); color: #1a0f0a; }
.controls { display: flex; gap: 8px; align-items: center; }
.act-as { font-size: 13px; color: var(--muted); }
.act-as select { background: #1d2430; color: var(--ink); border: 1px solid #2c3544; border-radius: 6px; padding: 5px; }
.pbtn.resume { background: var(--accent2); border-color: var(--accent2); color: #08201e; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(63,184,175,.25); } }

/* stage */
.stage-wrap { position: relative; margin-top: 4px; }
.stage { width: 1280px; height: 700px; transform-origin: top left; position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center; gap: 28px; padding: 0 20px; }

/* caption */
.caption-bar { width: 100%; padding: 10px 24px 12px; background: var(--bg2); border-top: 1px solid #232a35; display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.caption-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.caption-text { font-family: var(--serif); font-size: 18px; line-height: 1.3; }
.beat-dots { display: flex; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #2c3544; }
.dot.done { background: #5b6678; }
.dot.on { background: var(--accent); }
.mocked { font-size: 12px; color: var(--muted); text-align: right; max-width: 420px; }

/* phone */
.phone { width: var(--phone-w); height: var(--phone-h); background: var(--screen); color: var(--text); border-radius: 30px; border: 8px solid #1f242d; box-shadow: 0 24px 60px rgba(0,0,0,.5); display: flex; flex-direction: column; overflow: hidden; position: relative; flex: none; }
.phone-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card); }
.grp { font-family: var(--serif); font-size: 18px; font-weight: 600; flex: 1; white-space: nowrap; }
.presence { display: flex; gap: 3px; }
.head-slot { display: flex; gap: 6px; align-items: center; }
.you-tag { font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.phone-body { position: relative; flex: 1; min-height: 0; }
.scroll { position: absolute; inset: 0; overflow-y: auto; scrollbar-width: thin; }
.feed { padding: 12px 14px 40px; display: flex; flex-direction: column; gap: 12px; }
.overlay { position: absolute; inset: 0; pointer-events: none; }
.overlay > * { pointer-events: auto; }
.toast-layer { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; z-index: 30; }
.toast-layer > * { pointer-events: auto; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 10px; cursor: pointer; position: relative; }
.card.is-exploration { border-style: dashed; border-color: var(--accent2); }
.card.is-open { box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #6b6b73; margin-bottom: 6px; }
.card-src { font-weight: 700; color: #3a3a42; }
.card-explore { background: #dff4f2; color: #176b65; padding: 2px 7px; border-radius: 10px; font-weight: 600; font-size: 11px; }
.ghost-slot { margin-left: auto; display: flex; gap: 2px; }
.ghost { display: inline-flex; transition: opacity .5s; filter: drop-shadow(0 0 4px rgba(255,106,61,.7)); }
.card-title { font-family: var(--serif); font-size: 19px; line-height: 1.25; margin: 0 0 6px; }
.card-summary { font-size: 14px; line-height: 1.4; color: #4a4a52; margin: 0 0 8px; }
.card-detail p { font-size: 14px; line-height: 1.5; margin: 6px 0; }
.card-more { color: #6b6b73; font-style: italic; }
.card-tags { font-size: 12px; color: #8a8a93; margin-bottom: 8px; }
.card-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.btn { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; font: 600 12px var(--sans); color: #3a3a42; cursor: pointer; }
.btn:hover { border-color: #b9b2a0; }
.btn.react { color: var(--accent); }
.reactors { display: flex; margin-left: auto; }
.reactors .avatar { margin-left: -4px; border: 2px solid var(--card); }
.score { font: 600 11px ui-monospace, Menlo, monospace; color: #8a8a93; margin-left: 6px; }
.card-why { margin-top: 8px; padding: 8px 10px; background: #f1ede1; border-radius: 8px; font-size: 13px; color: #4a4a52; }
[hidden] { display: none !important; }

/* misc */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; font-family: var(--sans); flex: none; }
.newpill { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #1a0f0a; border: 0; border-radius: 16px; padding: 6px 14px; font: 700 12px var(--sans); cursor: pointer; z-index: 20; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.edge { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; align-items: center; background: rgba(27,27,31,.85); color: #fff; padding: 4px 8px; border-radius: 14px; font-size: 12px; z-index: 15; }
.edge-top { top: 8px; }
.edge-bottom { bottom: 8px; }
.toast { background: #1b1b1f; color: #fff; border-radius: 14px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: toast-in .25s ease-out; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }
.toast-text { flex: 1; font-size: 13px; line-height: 1.3; }
.toast-thumb { width: 38px; height: 38px; border-radius: 8px; background: #3a3a42; display: flex; align-items: center; justify-content: center; font-size: 11px; text-align: center; padding: 3px; overflow: hidden; }
.toast-actions { display: flex; gap: 6px; }
.toast-btn { background: #34343c; color: #fff; border: 0; border-radius: 8px; padding: 6px 10px; font: 700 12px var(--sans); cursor: pointer; }
.toast-btn.primary { background: var(--accent); color: #1a0f0a; }

/* scene 1: rail and recipe panel */
.rail { display: flex; flex-direction: column; gap: 10px; width: 84px; }
.rail-btn { background: #1d2430; border: 2px solid transparent; border-radius: 18px; padding: 10px 4px; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-family: var(--sans); }
.rail-btn.active { border-color: var(--accent); background: #2a2420; }
.rail-emoji { font-size: 28px; }
.rail-name { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.15; }
.panel { width: 420px; height: var(--phone-h); background: var(--bg2); border: 1px solid #232a35; border-radius: 22px; padding: 16px 18px; overflow: hidden; position: relative; flex: none; }
.panel-tag { position: absolute; top: 14px; right: 16px; font: 700 10px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--accent2); border: 1px solid var(--accent2); border-radius: 10px; padding: 2px 8px; }
.panel-title { font-family: var(--serif); font-size: 20px; margin-bottom: 8px; }
.panel-h { font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 10px 0 4px; }
.sl { display: grid; grid-template-columns: 130px 1fr 40px; gap: 8px; align-items: center; font-size: 12px; margin: 2px 0; }
.sl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-val { font: 600 11px ui-monospace, Menlo, monospace; color: var(--muted); text-align: right; }
.sl input { accent-color: var(--accent); width: 100%; }
.preview { margin: 0; padding-left: 20px; font-size: 12px; line-height: 1.5; color: #c9ccd4; }
.preview li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview li.up { color: var(--accent); }
.arrow { color: var(--accent); }
.panel-note { position: absolute; left: 18px; bottom: 12px; font-size: 11px; color: var(--muted); }

/* scene 2: incognito, chips */
.btn.incog-btn.on { background: #1b1b1f; color: #fff; border-color: #1b1b1f; }
.phone.is-incognito { outline: 2px dashed #8c93a1; outline-offset: -2px; }
.incog-banner { position: absolute; top: 0; left: 0; right: 0; background: #1b1b1f; color: #fff; font-size: 12px; padding: 6px 12px; text-align: center; z-index: 25; }
.back-chip { position: absolute; top: 34px; left: 10px; background: var(--accent2); color: #08201e; border: 0; border-radius: 16px; padding: 6px 12px; font: 700 12px var(--sans); cursor: pointer; z-index: 24; box-shadow: 0 4px 14px rgba(0,0,0,.25); }

/* scene 2: session UI */
.callbar { position: absolute; top: 0; left: 0; right: 0; background: #1b1b1f; color: #fff; display: flex; align-items: center; gap: 6px; padding: 5px 8px; z-index: 26; flex-wrap: nowrap; }
.call-av { position: relative; display: inline-flex; border-radius: 50%; }
.call-av.speaking { box-shadow: 0 0 0 3px #3fb8af; animation: speak 1s infinite; }
@keyframes speak { 50% { box-shadow: 0 0 0 5px rgba(63,184,175,.35); } }
.mute-badge { position: absolute; right: -6px; bottom: -6px; font-size: 11px; }
.cb-btn { background: #34343c; color: #fff; border: 0; border-radius: 8px; padding: 5px 8px; font: 700 11px var(--sans); cursor: pointer; white-space: nowrap; }
.cb-btn.on { background: var(--accent2); color: #08201e; }
.cb-btn.leave-btn { background: #c0392b; margin-left: auto; }
.ov-tl { position: absolute; top: 44px; left: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; z-index: 24; }
.together-btn { background: var(--accent); color: #1a0f0a; border: 0; border-radius: 16px; padding: 6px 12px; font: 700 12px var(--sans); cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.ov-tl .back-chip { position: static; }
.ctl-chip { position: relative; display: flex; align-items: center; gap: 6px; background: #1b1b1f; color: #fff; border-radius: 18px; padding: 4px 8px 4px 4px; font-size: 12px; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.ctl-av { display: inline-flex; border-radius: 50%; box-shadow: 0 0 0 2px var(--accent); }
.ctl-menu-btn { background: transparent; border: 0; color: #fff; cursor: pointer; font-size: 12px; }
.ctl-menu { position: absolute; top: 34px; left: 0; background: #1b1b1f; border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 4px; z-index: 40; min-width: 170px; }
.ctl-menu button { background: #34343c; color: #fff; border: 0; border-radius: 8px; padding: 6px 10px; font: 600 12px var(--sans); cursor: pointer; text-align: left; }
.ring { position: absolute; inset: 0; background: rgba(14,17,22,.92); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; z-index: 50; text-align: center; padding: 30px; animation: ring-in .3s ease-out; }
@keyframes ring-in { from { opacity: 0; } }
.ring .avatar { box-shadow: 0 0 0 6px rgba(255,106,61,.35); animation: speak 1s infinite; }
.ring-text { font-family: var(--serif); font-size: 22px; line-height: 1.25; }
.ring-btns { display: flex; gap: 14px; }
.ring-accept, .ring-decline { border: 0; border-radius: 26px; padding: 12px 26px; font: 700 15px var(--sans); cursor: pointer; }
.ring-accept { background: #2fb36d; color: #04210f; }
.ring-decline { background: #c0392b; color: #fff; }
.chat-line { position: absolute; left: 10px; right: 10px; bottom: 64px; background: #e9e4d6; color: #3a3a42; border-radius: 12px; padding: 8px 12px; font-size: 12px; z-index: 22; text-align: center; }
.ping-pulse { position: absolute; right: 12px; top: 40px; font-size: 30px; animation: ping-pop 1.8s ease-out forwards; pointer-events: none; }
@keyframes ping-pop { 0% { transform: scale(.4); opacity: 0; } 20% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
.vid-bubble { position: absolute; right: 12px; bottom: 90px; width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: 0 4px 14px rgba(0,0,0,.35); z-index: 21; }
.stage[data-acting="maya"] .phone[data-user="maya"] .you-tag, .stage[data-acting="dev"] .phone[data-user="dev"] .you-tag { text-decoration: underline; }

/* scene 3: highlights and replay */
.tab-btn.on { background: #1b1b1f; color: #fff; border-color: #1b1b1f; }
.hl-panel, .chat-stub { position: absolute; inset: 0; background: var(--screen); overflow-y: auto; padding: 12px 14px 30px; z-index: 12; display: flex; flex-direction: column; gap: 12px; }
.hl-head { display: flex; align-items: center; justify-content: space-between; }
.hl-title { font-family: var(--serif); font-size: 22px; font-weight: 600; }
.hl-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.hl-chip { background: transparent; border: 1px solid var(--line); border-radius: 14px; padding: 4px 10px; font: 600 12px var(--sans); cursor: pointer; color: #4a4a52; }
.hl-chip.on { background: #1b1b1f; color: #fff; border-color: #1b1b1f; }
.hl-panel .btn.react, .hl-panel .btn.why { display: none; }
.hl-panel .card { flex: none; }
.hl-empty { color: #8a8a93; font-size: 14px; padding: 20px; text-align: center; }
.ctx-strip { font-size: 12px; font-weight: 600; border-radius: 8px; padding: 6px 9px; margin-bottom: 8px; line-height: 1.35; }
.ctx-strip.session { background: #ffe9df; color: #8a3414; }
.ctx-strip.solo { background: #eeeadc; color: #5a5640; }
.card.flash { box-shadow: 0 0 0 3px var(--accent); transition: box-shadow .3s; }
.chat-stub { align-items: center; justify-content: center; text-align: center; color: #6b6b73; font-size: 14px; }
.chat-stub-title { font-family: var(--serif); font-size: 22px; color: var(--text); }
.replay-bar { position: absolute; left: 0; right: 0; bottom: 0; background: #1b1b1f; color: #fff; padding: 8px 12px 10px; z-index: 27; display: flex; flex-direction: column; gap: 6px; }
.rp-sub { font-size: 13px; font-weight: 700; min-height: 18px; color: #ffb59c; }
.rp-row { display: flex; align-items: center; gap: 8px; }
.rp-scrub { flex: 1; accent-color: var(--accent); }
.rp-time { font: 600 11px ui-monospace, Menlo, monospace; color: #c9ccd4; }
.rp-note { margin-left: auto; font-size: 11px; color: #8c93a1; }
.replay-marker { position: absolute; left: 12px; top: 8px; background: #1b1b1f; color: #fff; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 12px; animation: ping-pop 2.6s ease-out forwards; z-index: 5; pointer-events: none; }
