/* The builder as one chat (chat.js). Three looks to choose from, as switches (body.cx-look-msg / paper / letter);
   brand tokens from styles.css. No fixed bars and nothing sized to the window: the answer area is in the flow, so an
   iPhone keyboard only scrolls the page. */
.cx{padding-top:12px}
.cx-log{display:flex;flex-direction:column;gap:10px}
.cx-m{max-width:86%;padding:10px 14px;font-size:16px;line-height:1.45;border:0;text-align:left;position:relative}
.cx-m.bot{align-self:flex-start}
.cx-m.me{align-self:flex-end;cursor:pointer;font:inherit;display:flex;flex-direction:column;align-items:flex-end;gap:2px}
.cx-m.me small{font-size:12px;opacity:.72;text-decoration:underline}
.cx-m.me .t{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.cx-m.bot.wide{max-width:100%;width:100%;padding:0;background:none!important;box-shadow:none!important;border:0!important;transform:none!important}
.cx-m.bot.wide .filmcard{margin:0}
.cx-m ul{margin:6px 0;padding-left:18px}.cx-m li{margin:3px 0}
.cx-th{width:28px;height:34px;object-fit:cover;border-radius:6px;display:inline-block}
.cx-photo{width:84px;height:104px;object-fit:cover;border-radius:10px;display:block}
.cx-film video{width:100%;border-radius:var(--r);background:var(--ink);aspect-ratio:4/5;object-fit:cover}

/* motion (chat.js play/fly): a line of ours waits (cx-q), a typing bubble shows, then the line arrives from its
   tail; whatever follows waits faded (cx-hold: opacity only, so a focused field keeps the iPhone keyboard) */
.cx-q{display:none!important}
.cx-hold{opacity:0;pointer-events:none}
.cx-show{animation:cx-up .35s var(--ease) both}
.cx-m.bot.cx-arrive{animation:cx-arrive .34s cubic-bezier(.2,.9,.3,1.25) both;transform-origin:0 100%}
.cx-m.me.cx-pop{animation:cx-up .3s var(--ease) both}
.cx-typing{align-self:flex-start;display:inline-flex;align-items:center;gap:5px;padding:13px 15px;border-radius:18px;background:var(--surface);box-shadow:var(--shadow);position:relative;animation:cx-arrive .25s var(--ease) both;transform-origin:0 100%}
.cx-typing i{width:8px;height:8px;border-radius:50%;background:var(--ink-3);opacity:.35;animation:cx-dot 1.2s infinite}
.cx-typing i:nth-child(2){animation-delay:.2s}.cx-typing i:nth-child(3){animation-delay:.4s}
@keyframes cx-up{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes cx-arrive{0%{opacity:0;transform:scale(.35)}60%{opacity:1;transform:scale(1.03)}100%{opacity:1;transform:scale(1)}}
@keyframes cx-dot{0%,60%,100%{opacity:.3;transform:none}30%{opacity:.9;transform:translateY(-2px)}}
@media (prefers-reduced-motion:reduce){.cx *{animation:none!important}}

/* answers: cards with a picture, chips, a text line */
.cx-now{margin:2px 0 6px;display:flex;flex-direction:column;gap:8px}
.cx-cards{display:grid;grid-template-columns:1fr;gap:8px}
.cx-cards.two{grid-template-columns:1fr 1fr}
.cx-cards.three{grid-template-columns:repeat(3,1fr)}
.cx-c{border:1px solid var(--line-2);background:var(--white);border-radius:999px;padding:10px 16px;font-weight:600;font-size:15px;cursor:pointer;text-decoration:none;color:var(--ink);min-height:44px;display:inline-flex;align-items:center;gap:10px;text-align:left}
.cx-c.on{border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.cx-c.go{background:var(--primary);border-color:var(--primary);color:var(--white)}
.cx-c.pic{border-radius:var(--r);padding:6px 12px 6px 6px}
.cx-c.pic img{width:56px;height:70px;object-fit:cover;border-radius:10px;flex:0 0 auto;background:var(--paper-2)}
.cx-c.pic span{display:flex;flex-direction:column;min-width:0}
.cx-c.pic small{font-weight:400;font-size:13px;color:var(--ink-3);line-height:1.35}
.cx-cards.two .cx-c.pic,.cx-cards.three .cx-c.pic{flex-direction:column;align-items:stretch;padding:6px;gap:6px}
.cx-cards.two .cx-c.pic img,.cx-cards.three .cx-c.pic img{width:100%;height:auto;aspect-ratio:4/5}
.cx-cards.two .cx-c.pic span,.cx-cards.three .cx-c.pic span{padding:0 4px 4px}
.cx-cards.three .cx-c.pic b{font-size:13px;line-height:1.25}
.cx-chips{display:flex;flex-wrap:wrap;gap:8px}
.cx-line{display:flex;gap:8px;align-items:center;background:var(--surface);border-radius:var(--r);box-shadow:var(--lift);padding:8px}
.cx-line.col{flex-direction:column;align-items:stretch}
.cx-row{display:flex;gap:8px;align-items:center}
.cx-line input,.cx-line textarea{flex:1;min-width:0;font:inherit;font-size:16px;padding:11px 12px;border:1px solid var(--line-2);border-radius:var(--r-btn);background:var(--white);color:var(--ink)}
.cx-line textarea{resize:vertical;min-height:52px}
.cx-send{flex:0 0 auto;width:46px;height:46px;border-radius:50%;border:0;background:var(--primary);color:var(--white);display:grid;place-items:center;cursor:pointer}
.cx-note{margin:0;font-size:13px;color:var(--ink-3)}
.cx-drop{position:relative;display:flex;align-items:center;gap:12px;padding:16px;border:1.5px dashed var(--line-2);border-radius:var(--r);background:var(--white);cursor:pointer;color:var(--ink-2)}
.cx-drop.again{padding:10px 14px;border-style:solid}
.cx-drop span{display:flex;flex-direction:column}.cx-drop small{color:var(--ink-3);font-size:13px}
/* the file field covers its label: tapped directly, so iOS opens Photos from the tap itself */
.cx-file{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;font-size:0}
.cx-done{gap:10px}
.cx .spin{width:28px;height:28px;flex:0 0 auto}

/* the look switch: only for choosing (localhost, or once ?looks=1 was opened) */
.cx-switch{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 14px;padding:6px;border:1px dashed var(--line-2);border-radius:999px;font-size:13px}
.cx-switch span{color:var(--ink-3);padding:0 6px}
.cx-switch button,.cx-switch a{border:0;background:none;padding:6px 10px;border-radius:999px;cursor:pointer;font-weight:600;color:var(--ink-2);text-decoration:none;font-size:13px}
.cx-switch button.on{background:var(--ink);color:var(--on-dark)}

/* ---------- look 1: Messages. A text conversation: white bubbles from us, Postal blue for them ---------- */
.cx-look-msg .cx-m.bot{background:var(--surface);color:var(--ink);border-radius:18px 18px 18px 4px;box-shadow:var(--shadow)}
.cx-look-msg .cx-m.me{background:var(--primary);color:var(--white);border-radius:18px 18px 4px 18px}
.cx-look-msg .cx-m.bot + .cx-m.bot{margin-top:-6px}

/* ---------- look 2: Paper notes. Our lines on card stock, their answers as stamped tags in the envelope colour ---------- */
.cx-look-paper{background:var(--paper-2)}
.cx-look-paper .cx-m.bot{background:#FCF8EF;border:1px solid #EDE5D3!important;color:var(--ink);font-family:var(--display);font-size:18px;line-height:1.4;border-radius:4px;padding:14px 16px;box-shadow:var(--lift);transform:rotate(-.4deg)}
.cx-look-paper .cx-m.bot:nth-child(even){transform:rotate(.35deg)}
.cx-look-paper .cx-m.me{background:var(--ink);color:var(--on-dark);border-radius:6px;padding:10px 14px;box-shadow:0 0 0 3px var(--paper-2),0 0 0 4px var(--ink);font-weight:600;letter-spacing:.01em}
.cx-look-paper .cx-c{border-radius:6px}
.cx-look-paper .cx-c.pic{border-radius:6px}
.cx-look-paper .cx-line{border-radius:6px}

/* ---------- look 3: Letter. No bubbles: one column being written, our words in serif, theirs underlined in ink ---------- */
.cx-look-letter .cx-log{gap:6px}
.cx-look-letter .cx-m{max-width:100%;padding:4px 0}
.cx-look-letter .cx-m.bot{font-family:var(--display);font-size:22px;line-height:1.3;color:var(--ink)}
.cx-look-letter .cx-m.bot + .cx-m.bot{font-size:17px;font-family:var(--sans);color:var(--ink-2)}
.cx-look-letter .cx-m.me{align-self:flex-start;align-items:flex-start;color:var(--primary);font-size:19px;font-weight:600;margin:0 0 18px;background:none}
.cx-look-letter .cx-m.me .t{justify-content:flex-start;border-bottom:2px solid var(--primary);padding-bottom:2px}
.cx-look-letter .cx-line{box-shadow:none;background:none;padding:0;border-bottom:2px solid var(--ink);border-radius:0}
.cx-look-letter .cx-line input,.cx-look-letter .cx-line textarea{border:0;background:none;padding:10px 0;font-size:19px}
.cx-look-letter .cx-line.col input{border-bottom:1px solid var(--line-2)}
.cx-look-letter .cx-c{border-radius:var(--r-btn)}

/* ---------- look 4: iMessage (Daniel, 2026-11-25: "let's make it look like iMessage"). The default.
   Grey bubbles from us on the left, blue from them on the right, a tail on the last bubble of each run, the
   system font, a contact header. Answer choices sit on the right, as things they are about to say. ---------- */
.cx-head{display:none}
.cx-look-imsg,.cx-look-imsg main{background:#fff}
.cx-look-imsg .cx{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue",var(--sans);--im-blue:#0A84FF;--im-grey:#E9E9EB;--im-bg:#fff}
.cx-look-imsg .cx-head{display:flex;flex-direction:column;align-items:center;gap:2px;padding:4px 0 14px}
.cx-look-imsg .cx-av{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(#A5ABB8,#858994);color:#fff;font-size:24px;font-weight:600}
.cx-look-imsg .cx-head b{font-size:13px;font-weight:500;color:#111}
.cx-look-imsg .cx-head small{font-size:11px;color:#8E8E93;margin-top:8px;font-weight:600}
.cx-look-imsg .cx-log{gap:4px}
.cx-look-imsg .cx-m{font-size:17px;line-height:1.3;max-width:78%}
.cx-look-imsg .cx-m.bot{background:var(--im-grey);color:#000;border-radius:18px;padding:8px 13px}
.cx-look-imsg .cx-m.me{background:none;padding:0;margin:6px 0 4px;gap:3px}
.cx-look-imsg .cx-m.me .t{background:var(--im-blue);color:#fff;border-radius:18px;padding:8px 13px;position:relative}
.cx-look-imsg .cx-m.me small{color:#8E8E93;text-decoration:none;font-size:11px;font-weight:500;opacity:1;margin-right:4px}
.cx-look-imsg .cx-m.bot + .cx-m.me,.cx-look-imsg .cx-now + .cx-m.bot,.cx-look-imsg .cx-m.me + .cx-m.bot{margin-top:6px}
/* the tail: a bubble-coloured curve with the page colour cut out of it, on the last bubble of a run */
.cx-look-imsg .cx-m.bot:not(.wide)::before,.cx-look-imsg .cx-m.me .t::before{content:"";position:absolute;bottom:0;width:20px;height:20px}
.cx-look-imsg .cx-m.bot:not(.wide)::after,.cx-look-imsg .cx-m.me .t::after{content:"";position:absolute;bottom:0;width:26px;height:20px;background:var(--im-bg)}
.cx-look-imsg .cx-m.bot:not(.wide)::before{left:-7px;background:var(--im-grey);border-bottom-right-radius:15px}
.cx-look-imsg .cx-m.bot:not(.wide)::after{left:-26px;border-bottom-right-radius:10px}
.cx-look-imsg .cx-m.me .t::before{right:-7px;background:var(--im-blue);border-bottom-left-radius:15px}
.cx-look-imsg .cx-m.me .t::after{right:-26px;border-bottom-left-radius:10px}
.cx-look-imsg .cx-m.bot:has(+ .cx-m.bot:not(.wide):not(.cx-q))::before,.cx-look-imsg .cx-m.bot:has(+ .cx-m.bot:not(.wide):not(.cx-q))::after{display:none}
/* the typing bubble as in a messaging app: grey, with two small circles trailing from its corner */
.cx-look-imsg .cx-typing{background:var(--im-grey);box-shadow:none;margin:2px 0 2px 4px}
.cx-look-imsg .cx-typing i{background:#7C7C80}
.cx-look-imsg .cx-typing::before{content:"";position:absolute;left:-3px;bottom:-2px;width:12px;height:12px;border-radius:50%;background:var(--im-grey)}
.cx-look-imsg .cx-typing::after{content:"";position:absolute;left:-8px;bottom:-7px;width:6px;height:6px;border-radius:50%;background:var(--im-grey)}
.cx-look-imsg .cx-m.me .cx-st{transition:opacity .2s}
/* a photo goes as a picture of its own, the way a photo is sent, with no bubble or tail round it */
.cx-look-imsg .cx-m.me .t:has(.cx-photo){background:none;color:#8E8E93;padding:0;font-size:13px;flex-direction:column;align-items:flex-end;gap:4px}
.cx-look-imsg .cx-m.me .t:has(.cx-photo)::before,.cx-look-imsg .cx-m.me .t:has(.cx-photo)::after{display:none}
.cx-look-imsg .cx-m.me .cx-photo{width:150px;height:auto;aspect-ratio:4/5;border-radius:18px}
/* the tails reach past the bubbles: keep them from widening the page */
.cx-look-imsg .cx-log{overflow-x:clip;padding:0 8px;margin:0 -8px}
.cx-look-imsg .filmcard b{font-family:inherit;font-weight:600;font-size:17px}
.cx-look-imsg .cx-th{border-radius:5px}
.cx-look-imsg .cx-film video{border-radius:18px}
.cx-look-imsg .filmcard{border-radius:18px;box-shadow:none;background:var(--im-grey)}
/* the answers: not bubbles. A tray at the foot of the conversation, like an iOS picker: grey, its own heading,
   options as white rows or tiles with a selection circle, the main action a full-width blue button. (Daniel,
   2026-11-25: blue pills on their side read as messages already sent.) */
.cx-tray-h,.cx-rad{display:none}
.cx-look-imsg .cx-now{align-items:stretch;background:#F2F2F7;margin:12px -16px 0;padding:12px 16px 18px;border-radius:22px 22px 0 0;box-shadow:0 -1px 0 #E5E5EA;gap:10px}
.cx-look-imsg .cx-tray-h{display:flex;align-items:center;justify-content:center;gap:8px;margin:0 0 2px;font-size:13px;font-weight:600;color:#6C6C70;letter-spacing:.01em}
.cx-look-imsg .cx-chips{flex-direction:column;align-items:stretch;gap:8px}
.cx-look-imsg .cx-c{border:0;background:#fff;color:#000;border-radius:12px;font-weight:500;font-size:17px;min-height:50px;padding:12px 14px;justify-content:flex-start;box-shadow:0 1px 0 rgba(0,0,0,.04)}
.cx-look-imsg .cx-c > span{flex:1}
.cx-look-imsg .cx-c:active{background:#E5E5EA}
.cx-look-imsg .cx-rad{display:block;flex:0 0 auto;width:22px;height:22px;border-radius:50%;border:2px solid #C7C7CC;box-sizing:border-box}
.cx-look-imsg .cx-c.on .cx-rad{border:0;background:var(--im-blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center/14px no-repeat}
.cx-look-imsg .cx-c.on{box-shadow:inset 0 0 0 2px var(--im-blue)}
.cx-look-imsg .cx-c.go{background:var(--im-blue);color:#fff;justify-content:center;font-weight:600;order:-1}
.cx-look-imsg .cx-c.go > span{text-align:center}
.cx-look-imsg .cx-c.go .cx-rad,.cx-look-imsg .cx-c[data-pick="__skip"] .cx-rad,.cx-look-imsg .cx-c[data-pick^="+"] .cx-rad,.cx-look-imsg .cx-c[data-pick^="__"]:not(.go) .cx-rad{display:none}
.cx-look-imsg .cx-c[data-pick="__skip"],.cx-look-imsg .cx-c[data-pick^="+"],.cx-look-imsg .cx-c[data-pick="__one"],.cx-look-imsg .cx-c[data-pick="__two"]{background:none;box-shadow:none;color:var(--im-blue);justify-content:center;min-height:40px}
.cx-look-imsg .cx-c[data-pick="__skip"] > span,.cx-look-imsg .cx-c[data-pick^="+"] > span,.cx-look-imsg .cx-c[data-pick="__one"] > span,.cx-look-imsg .cx-c[data-pick="__two"] > span{flex:0 0 auto}
.cx-look-imsg .cx-cards{width:100%;gap:8px}
.cx-look-imsg .cx-c.pic{border:0;border-radius:14px;background:#fff;padding:8px 14px 8px 8px}
.cx-look-imsg .cx-c.pic small{color:#8E8E93;font-size:14px}
.cx-look-imsg .cx-cards.two .cx-c.pic,.cx-look-imsg .cx-cards.three .cx-c.pic{position:relative;padding:6px}
.cx-look-imsg .cx-cards.two .cx-rad,.cx-look-imsg .cx-cards.three .cx-rad{position:absolute;top:12px;right:12px;background:rgba(255,255,255,.85);border-color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.cx-look-imsg .cx-cards.three .cx-rad{top:10px;right:10px;width:20px;height:20px}
.cx-look-imsg .cx-c.pic b{font-weight:600}
.cx-look-imsg .cx-line{width:100%;background:none;box-shadow:none;padding:0}
.cx-look-imsg .cx-line input,.cx-look-imsg .cx-line textarea{background:#fff;border:1px solid #D1D1D6;border-radius:20px;padding:9px 14px;font-size:17px}
.cx-look-imsg .cx-send{width:34px;height:34px;background:var(--im-blue)}
.cx-look-imsg .cx-send svg{transform:rotate(-90deg)}
.cx-look-imsg .cx-drop{border-radius:14px;border:0;background:#fff;width:100%;color:#000}
.cx-look-imsg .cx-drop svg{color:var(--im-blue)}
.cx-look-imsg .cx-note{align-self:center;color:#8E8E93;font-size:12px}
.cx-look-imsg .cx-done{align-items:stretch}
.cx-look-imsg .cx-done .btn-seal{background:var(--im-blue);border-radius:18px}
.cx-look-imsg .cx-switch{font-family:var(--sans)}
