/* RATCHeT app prototype. Builds on styles.css tokens (colors, type, buttons). */
body.appmode { height: 100svh; overflow: hidden; display: grid; place-items: center; background: var(--canvas); }
.stage-bg { position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(0deg, var(--canvas) 5%, rgba(6,3,2,.6) 60%, rgba(6,3,2,.85)), url(assets/set-plate.webp) center / cover no-repeat; filter: saturate(1.1); }
.phone { position: relative; z-index: 1; width: min(100vw, 420px); height: min(100svh, 880px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--canvas); }
@media (min-width: 600px) and (min-height: 700px) {
  .phone { border-radius: 38px; box-shadow: 0 0 0 2px var(--ink), 0 0 0 8px #1a0d09, 0 0 0 10px var(--line), 0 40px 120px rgba(0,0,0,.8); }
}
.demo-bar { flex: none; padding: 7px 14px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-align: center; color: var(--ink); background: var(--spark); }
.screen { position: relative; flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; outline: none; scroll-behavior: smooth; }
.screen::-webkit-scrollbar { width: 0; }
.pad { padding: 22px 20px 28px; }
body.appmode.afterhours .phone { --canvas: #030102; --surface: #0c0605; }

/* ---------- Shared screen parts ---------- */
.scr-head { display: grid; gap: 6px; margin-bottom: 20px; }
.scr-title { margin: 0; font-weight: 900; font-style: italic; font-size: 30px; line-height: 1.02; letter-spacing: -.01em; }
.scr-title .w-dating, .scr-title .w-ratchet { -webkit-text-stroke: .035em var(--ink); }
.scr-purpose { margin: 0; color: var(--cream-dim); font-size: 15px; }
.plain { color: var(--cream-dim); font-weight: 600; font-style: normal; font-size: .72em; letter-spacing: 0; text-transform: none; }
.next-line { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.next-line::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--spark); flex: none; }
.dots { display: flex; gap: 6px; margin-bottom: 18px; }
.dots i { width: 22px; height: 4px; border-radius: 3px; background: var(--line); }
.dots i.on { background: var(--spark); }
.cta-bar { position: sticky; bottom: 0; display: grid; gap: 10px; padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, var(--canvas) 70%, transparent); z-index: 5; }
.cta-bar .btn { width: 100%; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.back { background: none; border: 0; color: var(--cream-dim); font-weight: 700; font-size: 14px; padding: 0; margin-bottom: 14px; }
.note { font-size: 12.5px; color: var(--cream-dim); margin: 10px 0 0; }
.r0 { font-style: normal !important; }
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field > span { font-weight: 800; font-size: 14px; }
.field input, .field textarea, .field select { background: var(--surface); border: 2px solid var(--line); border-radius: 14px; color: var(--cream); padding: 13px 14px; font: inherit; font-size: 16px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--spark); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.check input { width: 22px; height: 22px; accent-color: var(--spark); flex: none; margin-top: 2px; }
.choice-grid { display: grid; gap: 10px; }
.choice { text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px 16px; font-weight: 800; font-size: 16px; transition: border-color .12s, background-color .12s; }
.choice small { display: block; font-weight: 500; font-size: 13px; color: var(--cream-dim); margin-top: 2px; }
.choice[aria-pressed="true"] { border-color: var(--spark); background: #2a1a05; }
.chiprow { display: flex; flex-wrap: wrap; gap: 8px; }
.chiprow .chip[aria-pressed="true"] { background: var(--dating); border-color: var(--ink); color: var(--cream); }
.list { display: grid; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: left; width: 100%; }
.row img, .avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; flex: none; box-shadow: 0 0 0 2px var(--ink); }
.row b { display: block; font-weight: 800; }
.row small { display: block; color: var(--cream-dim); font-size: 13px; }
.row .grow { flex: 1; min-width: 0; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--raised); color: var(--cream); }
.pill--spark { background: var(--spark); color: var(--ink); }
.pill--red { background: var(--dating); color: var(--cream); }
.badge-ai { position: absolute; top: 12px; left: 12px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: rgba(1,0,0,.75); color: var(--spark); padding: 5px 8px; border-radius: 6px; }
.section-label { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--cream-dim); margin: 22px 0 10px; }

/* ---------- Tab bar ---------- */
.tabbar { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: #0b0605; padding-bottom: env(safe-area-inset-bottom); }
.tab { position: relative; display: grid; justify-items: center; gap: 3px; padding: 9px 2px 10px; background: none; border: 0; color: var(--cream-dim); font-size: 10.5px; font-weight: 700; }
.tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--spark); }
.tab__dot { position: absolute; top: 6px; left: 58%; min-width: 8px; height: 8px; border-radius: 99px; background: var(--dating); }

/* ---------- Face check ---------- */
.facecheck { position: relative; margin: 10px auto 18px; width: 220px; height: 280px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 40%, #3a2a20, #120a08 70%); box-shadow: 0 0 0 4px var(--line), 0 0 60px rgba(255,235,200,.25); overflow: hidden; }
.facecheck.lit { box-shadow: 0 0 0 4px var(--spark), 0 0 90px rgba(255,240,210,.6); background: radial-gradient(ellipse at 50% 40%, #fff3dc, #6b4a30 75%); }
.facecheck span { font-weight: 800; font-size: 14px; color: var(--cream); text-align: center; padding: 0 20px; }
.facecheck.lit span { color: var(--ink); }
.facecheck .scan { position: absolute; left: 0; right: 0; height: 3px; background: var(--spark); box-shadow: 0 0 14px var(--spark); top: 10%; animation: scan .8s linear infinite alternate; }
@keyframes scan { to { top: 88%; } }

/* ---------- Booth / card preview ---------- */
.booth-card { margin: 4px 0 18px; }
.booth-card .viewfinder { padding: 30px 16px 16px; }
.booth-card .castcard { aspect-ratio: 4/4.6; }
.photo-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot { position: relative; aspect-ratio: 3/4; border-radius: 12px; border: 2px dashed var(--line); background: var(--surface); display: grid; place-content: center; text-align: center; font-size: 11px; font-weight: 700; color: var(--cream-dim); overflow: hidden; }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.recorder { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.rec-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--dating); box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px var(--line); flex: none; display: grid; place-items: center; }
.rec-btn i { width: 18px; height: 18px; border-radius: 50%; background: var(--cream); }
.rec-btn.on i { border-radius: 4px; animation: blink 1s steps(2) infinite; }
.recorder audio { width: 100%; height: 36px; }

/* ---------- Discovery cards ---------- */
.lineup-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.acard { position: relative; border-radius: 24px; overflow: hidden; aspect-ratio: 3/4.2; background: #120806; box-shadow: 0 0 0 2px var(--ink), 0 24px 50px rgba(0,0,0,.6); }
.acard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transition: filter .7s var(--ease-out), transform .9s var(--ease-out); }
.acard.answer-first img { filter: blur(16px) brightness(.35) saturate(.6); transform: scale(1.1); }
.acard__shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(1,0,0,.95) 0%, rgba(1,0,0,.4) 45%, transparent 70%); }
.acard__body { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px; display: grid; gap: 8px; }
.acard__meet { margin: 0; font-weight: 900; font-style: italic; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--spark); }
.acard__quote { margin: 0; font-weight: 800; font-style: italic; font-size: 20px; line-height: 1.25; transition: font-size .5s var(--ease-out); }
.acard.answer-first .acard__quote { font-size: 24px; }
.acard__q { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--cream-dim); }
.acard__name { margin: 4px 0 0; font-weight: 900; font-style: italic; font-size: 26px; text-transform: uppercase; line-height: 1; }
.acard__name small { font-size: 16px; color: var(--cream-dim); margin-left: 6px; }
.acard__why { margin: 0; font-size: 13px; color: var(--cream); background: rgba(1,0,0,.55); border-left: 3px solid var(--spark); padding: 6px 10px; border-radius: 4px; }
.acard__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.acard-actions { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 14px; }
.act-btn { display: grid; justify-items: center; gap: 2px; min-height: 58px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); font-weight: 900; font-style: italic; font-size: 16px; padding: 8px 10px; }
.act-btn small { font-weight: 600; font-style: normal; font-size: 11px; color: var(--cream-dim); }
.act-btn--yes { background: var(--spark); color: var(--ink); border-color: var(--ink); box-shadow: 0 4px 0 var(--spark-lo); }
.act-btn--yes small { color: #3b3000; }
.act-btn--shot { width: 58px; border-radius: 50%; padding: 0; place-content: center; border-color: var(--dating); color: var(--dating); font-size: 12px; }
.act-btn--shot svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.capped { text-align: center; padding: 40px 10px; display: grid; gap: 14px; }
.capped h3 { margin: 0; font-weight: 900; font-style: italic; font-size: 26px; line-height: 1.1; }

/* ---------- Profile view ---------- */
.pv-hero { position: relative; aspect-ratio: 4/4.4; border-radius: 22px; overflow: hidden; box-shadow: 0 0 0 2px var(--ink); }
.pv-hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 16%; }
.block { position: relative; margin-top: 12px; padding: 16px 16px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.block__q { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--spark); }
.block__a { margin: 0; font-weight: 800; font-style: italic; font-size: 19px; line-height: 1.3; padding-right: 64px; }
.block .pullup-on { position: absolute; right: 12px; bottom: 12px; border: 2px solid var(--ink); background: var(--spark); color: var(--ink); font-weight: 900; font-style: italic; font-size: 12px; border-radius: 999px; padding: 7px 11px; }
.block--photo { padding: 0; overflow: hidden; }
.block--photo .pullup-on { bottom: 14px; }
.wave { display: flex; flex-wrap: wrap; gap: 8px; }
.wave span { font-size: 13px; font-weight: 700; padding: 7px 11px; border-radius: 999px; background: #22160a; border: 1px solid #5a4210; color: var(--spark-hi); }
.wave span.diff { background: var(--raised); border-color: var(--line); color: var(--cream-dim); }

/* ---------- Chats ---------- */
.chat { display: flex; flex-direction: column; height: 100%; }
.chat-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #0b0605; }
.chat-head .grow { flex: 1; min-width: 0; }
.chat-head b { display: block; font-weight: 800; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--cream); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn--shield svg { stroke: var(--spark); }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.banner { padding: 11px 13px; border-radius: 14px; font-size: 14px; background: var(--surface); border: 1px solid var(--line); }
.banner b { color: var(--spark); }
.banner--warn { background: #2a0a0a; border-color: #6a1a1a; }
.banner--pin { background: #22160a; border-color: #5a4210; }
.msg { max-width: 80%; padding: 10px 13px; border-radius: 18px; font-size: 15px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.msg--them { align-self: flex-start; background: var(--raised); border-bottom-left-radius: 6px; }
.msg--me { align-self: flex-end; background: var(--dating); color: var(--cream); border-bottom-right-radius: 6px; }
.msg--sys { align-self: center; max-width: 92%; background: none; color: var(--cream-dim); font-size: 13px; text-align: center; padding: 4px; }
.msg small { display: block; font-size: 10.5px; opacity: .6; margin-top: 3px; }
.typing { align-self: flex-start; color: var(--cream-dim); font-size: 13px; font-style: italic; }
.datecard { align-self: stretch; padding: 14px; border-radius: 16px; background: #1e0f0a; border: 2px solid var(--spark); display: grid; gap: 8px; }
.datecard b { font-size: 16px; }
.datecard .btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.composer { flex: none; display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #0b0605; }
.composer input { flex: 1; min-width: 0; background: var(--surface); border: 2px solid var(--line); border-radius: 999px; color: var(--cream); padding: 11px 16px; font: inherit; font-size: 16px; }
.composer input:focus { outline: none; border-color: var(--spark); }
.composer .btn { min-height: 46px; padding: 0 18px; }
.chat-tools { flex: none; display: flex; gap: 8px; overflow-x: auto; padding: 8px 12px; border-top: 1px solid var(--line); background: #0b0605; }
.chat-tools::-webkit-scrollbar { height: 0; }
.tool { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 12px; font-weight: 700; font-size: 13px; }
.closed .composer, .closed .chat-tools { display: none; }

/* ---------- Sheets & overlays ---------- */
.sheet-host { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(1,0,0,.7); pointer-events: auto; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88%; overflow-y: auto; background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: 0 -2px 0 var(--line); padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); pointer-events: auto; animation: rise .22s var(--ease-out); }
.sheet::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 6px; font-weight: 900; font-style: italic; font-size: 24px; }
.sheet h3.r0 { font-style: normal; font-weight: 800; font-size: 21px; }
.sheet p { margin: 0 0 14px; color: var(--cream-dim); }
.sheet .btn { width: 100%; margin-top: 8px; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.safety-list { display: grid; gap: 8px; }
.safety-item { display: grid; gap: 2px; text-align: left; padding: 14px 16px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line); font-weight: 800; font-size: 16px; font-style: normal; }
.safety-item small { font-weight: 500; font-size: 13px; color: var(--cream-dim); }
.safety-item--danger { color: #ff8b8b; }
.toast { position: absolute; left: 14px; right: 14px; top: 40px; z-index: 60; padding: 12px 14px; border-radius: 16px; background: #1b0f0b; border: 1px solid var(--line); box-shadow: 0 20px 40px rgba(0,0,0,.6); font-weight: 700; font-size: 14px; display: flex; gap: 10px; align-items: center; transform: translateY(-140%); transition: transform .3s var(--ease-out); }
.toast.on { transform: none; }
.toast img { width: 26px; height: auto; }

/* coach mark */
.coach { position: absolute; inset: 0; z-index: 50; background: rgba(1,0,0,.72); display: grid; align-content: end; padding: 20px 20px 110px; }
.coach__card { background: var(--spark); color: var(--ink); border-radius: 18px; padding: 16px 18px; box-shadow: 4px 4px 0 var(--ink); display: grid; gap: 10px; }
.coach__card b { font-weight: 900; font-style: italic; font-size: 20px; }
.coach__card p { margin: 0; font-weight: 600; }
.coach__card button { justify-self: end; border: 2px solid var(--ink); background: var(--ink); color: var(--spark); font-weight: 800; border-radius: 999px; padding: 8px 16px; }
.coach__count { font-size: 12px; font-weight: 800; letter-spacing: .08em; }

/* link moment inside the phone */
.link-ov { position: absolute; inset: 0; z-index: 55; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 24px; background: rgba(6,3,2,.96); perspective: 1000px; }
.link-ov .pair { display: flex; transform-style: preserve-3d; }
.link-ov .pc { width: 132px; aspect-ratio: 720/1068; border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px var(--dating); background: #1C0806; display: grid; place-content: center; }
.link-ov .pc img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.link-ov .pc span { font-weight: 900; font-style: italic; font-size: 28px; color: rgba(246,235,221,.3); }
.link-ov .pc--you { transform: rotate(-8deg) translateX(14px); }
.link-ov .pc--them { transform: rotate(8deg) translateX(-14px); }
.link-ov.frozen .pc { filter: grayscale(1) contrast(1.2); }
.link-ov h2 { margin: 6px 0 0; font-weight: 900; font-style: italic; font-size: 44px; line-height: .95; -webkit-text-stroke: .035em var(--ink); paint-order: stroke fill; }
.link-ov h2 span { color: var(--dating); text-shadow: .05em .06em 0 var(--dating-ext); }
.link-ov .why { margin: 0; max-width: 30ch; color: var(--spark); font-weight: 800; font-style: italic; }
.link-ov .rec { position: absolute; top: 16px; left: 16px; font-size: 11px; font-weight: 800; letter-spacing: .12em; display: flex; gap: 6px; align-items: center; }
.link-ov .rec i { width: 9px; height: 9px; border-radius: 50%; background: var(--dating); animation: blink 1s steps(2) infinite; }
.link-ov .btn { min-width: 240px; }

/* events & tickets */
.event { position: relative; display: grid; gap: 6px; padding: 16px; border-radius: 20px; background: linear-gradient(135deg, #2a0c08, #120806 60%); border: 1px solid var(--line); text-align: left; width: 100%; }
.event__kind { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--spark); }
.event b { font-weight: 900; font-style: italic; font-size: 22px; line-height: 1.05; }
.event small { color: var(--cream-dim); font-size: 13px; }
.ticket { position: relative; margin: 10px 0; padding: 20px; border-radius: 20px; background: var(--spark); color: var(--ink); box-shadow: 5px 5px 0 var(--ink); display: grid; gap: 6px; }
.ticket::after { content: ""; position: absolute; left: -10px; right: -10px; top: 58%; border-top: 3px dashed rgba(1,0,0,.35); }
.ticket b { font-weight: 900; font-style: italic; font-size: 24px; }
.band { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px; margin-right: 6px; box-shadow: 0 0 0 2px var(--ink); }

/* receipts, reunion, tracker */
.receipt { padding: 12px 14px; border-radius: 14px; background: #f3e9d6; color: var(--ink); transform: rotate(-1deg); box-shadow: 3px 3px 0 var(--ink); font-weight: 700; }
.receipt small { display: block; font-weight: 600; opacity: .6; font-size: 12px; }
.tracker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.tracker span { font-size: 12px; font-weight: 700; text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--raised); color: var(--cream-dim); }
.tracker span.on { background: var(--spark); color: var(--ink); }
.reunion { position: absolute; inset: 0; z-index: 56; background: radial-gradient(ellipse at 50% 30%, #2a0c08, var(--canvas) 70%); display: grid; align-content: center; gap: 16px; padding: 28px; text-align: center; }
.reunion .lower { text-align: left; background: rgba(1,0,0,.8); border-left: 6px solid var(--dating); border-top: 3px solid var(--spark); padding: 12px 16px; }
.reunion .lower b { display: block; font-weight: 900; font-style: italic; font-size: 26px; text-transform: uppercase; }
.reunion .lower span { color: var(--spark); font-weight: 800; font-style: italic; }
.plus-card { padding: 18px; border-radius: 20px; background: linear-gradient(135deg, #3a2a05, #1a0f05); border: 2px solid var(--spark); }
.plus-card ul { margin: 8px 0; padding-left: 18px; font-size: 14px; }
.blurred { filter: blur(7px); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.toggle-row small { display: block; color: var(--cream-dim); font-size: 13px; }
.switch { width: 50px; height: 30px; border-radius: 99px; background: var(--raised); border: 1px solid var(--line); position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--cream-dim); transition: transform .15s var(--ease-out); }
.switch[aria-checked="true"] { background: var(--spark); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--ink); }

@media (prefers-reduced-motion: reduce) { .acard.answer-first img { filter: none; transform: none; } }
.tabbar[hidden] { display: none; }
@media (min-width: 600px) and (min-height: 700px) { .demo-bar { padding-top: 14px; } }
.pill { white-space: nowrap; }
.toast { visibility: hidden; transform: translateY(-220%); transition: transform .3s var(--ease-out), visibility 0s .3s; }
.toast.on { visibility: visible; transform: none; transition: transform .3s var(--ease-out), visibility 0s; }
/* Prototype marker: every simulated interaction carries it */
.sim { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-style: normal; padding: 3px 7px; border-radius: 5px; background: transparent; color: var(--spark); border: 1px dashed var(--spark); vertical-align: 1px; }
/* Law 1: one yellow button per screen. Secondary interest actions use the outline treatment. */
.block .pullup-on { background: var(--ink); color: var(--spark); border: 2px solid var(--spark); }
.chip--line { background: var(--ink); color: var(--spark); border-color: var(--spark); }
/* Accessibility: 44px touch targets and visible keyboard focus on every app control */
.appmode .chip, .appmode .tool, .appmode .linkbtn { min-height: 44px; }
.appmode .icon-btn { width: 44px; height: 44px; }
.appmode .poll__opt { min-height: 52px; }
.appmode :is(.choice, .row, .event, .tab, .tool, .icon-btn, .acard, .chip, .act-btn, .switch, .pullup-on, .safety-item, .poll__opt, .back, .linkbtn):focus-visible { outline: 3px solid var(--spark); outline-offset: 2px; }
.appmode .field input:focus-visible, .appmode .composer input:focus-visible { outline: 3px solid var(--spark); outline-offset: 1px; }
/* Orchestration (iteration 10): one quiet suggestion per link, and a state-aware Section line */
.beat { align-self: stretch; display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: transparent; border: 1px dashed var(--line); font-size: 14px; }
.beat b { color: var(--cream); }
.beat span { color: var(--cream-dim); }
.beat .btnrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.next-line .grow { flex: 1; }
.next-line .linkbtn { flex: none; font-size: 13px; }
/* State-contract fix D8: in a chat the toast sits below the header, so Back and the safety shield stay tappable */
.phone:has(.chat) .toast { top: 124px; }
/* Discovery Contract: the switch keeps its look but gets a 46px tap area (WCAG 2.5.8) */
.appmode .switch::before { content: ""; position: absolute; inset: -8px -6px; }
/* Every text Back button meets the 44px target too (found by DC-15) */
.appmode .back { min-height: 44px; display: inline-flex; align-items: center; }
.appmode .pullup-on { min-height: 44px; }
/* In answer blocks the Pull up button sits under the answer (in flow), so a 44px target never covers the words */
.appmode .block:not(.block--photo) > .pullup-on { position: static; display: inline-flex; align-items: center; margin-top: 10px; }
/* Partner-demo readiness (iteration 14) */
/* every chat tool is visible without sideways scrolling, including Close it out */
.chat-tools { flex-wrap: wrap; overflow-x: visible; }
/* "feeling you" rows: the words get the width; actions drop under them on narrow screens */
.row:has(> .chip) { flex-wrap: wrap; }
.row:has(> .chip) > .grow { flex: 1 1 calc(100% - 64px); }
.row:has(> .chip) > .chip:first-of-type { margin-left: 60px; }
/* tab labels never wrap to two lines on small phones */
.tab span { white-space: nowrap; }
@media (max-width: 380px) { .tab { font-size: 10px; letter-spacing: -.01em; } }
