/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #eeeae3;
  --text: #1d1b22;
  --muted: #6e6a78;
  --border: #e5dfd6;
  --accent: #5a48f5;
  --accent-ink: #ffffff;
  --accent-soft: #ebe8ff;
  --hot: #ff5d4f;
  --ok: #1f9d55;
  --warn: #a86a12;
  --warn-bg: #fdf1dc;
  --danger: #d33c3c;
  --mine-bg: var(--accent);
  --mine-ink: #ffffff;
  --mine-sub: rgba(255, 255, 255, 0.8);
  --theirs-bg: var(--surface);
  --theirs-ink: var(--text);
  --theirs-sub: var(--muted);
  --shadow: 0 1px 2px rgba(25, 20, 45, 0.06), 0 6px 18px rgba(25, 20, 45, 0.06);
  --radius: 20px;
  --fs-mine: 1.15rem;
  --fs-theirs: 1.45rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101115;
    --surface: #1a1b21;
    --surface-2: #25272f;
    --text: #f3f2f7;
    --muted: #9b99a8;
    --border: #2b2d36;
    --accent: #7564ff;
    --accent-soft: #272350;
    --hot: #ff6a5c;
    --ok: #3ccf7a;
    --warn: #f0b456;
    --warn-bg: #3a2c14;
    --danger: #ff6b6b;
    --theirs-bg: #1f2128;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}
:root[data-size="s"] { --fs-mine: 1rem; --fs-theirs: 1.2rem; }
:root[data-size="l"] { --fs-mine: 1.4rem; --fs-theirs: 1.85rem; }

/* ---------- Base ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

.screen { max-width: 560px; margin: 0 auto; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 14px; background: var(--surface-2);
  font-weight: 600; transition: transform 0.1s, opacity 0.2s;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.big {
  width: 100%; padding: 17px; font-size: 1.1rem; border-radius: 18px;
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 32%, transparent);
}
.btn.ghost { background: transparent; color: var(--muted); }

.input {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1.5px solid transparent;
  background: var(--surface-2); outline: none; font-size: 1rem;
}
.input:focus { border-color: var(--accent); background: var(--surface); }
textarea.input { resize: none; line-height: 1.4; }

.iconBtn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  color: var(--text); flex: none; transition: background 0.15s;
}
.iconBtn svg { width: 22px; height: 22px; }
.iconBtn:active { background: var(--surface-2); }
.iconBtn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.iconBtn.filled { background: var(--accent); color: var(--accent-ink); }

.langPick {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 12px 16px; border-radius: 14px; background: var(--surface-2); text-align: left;
}
.langPick .lpText { display: flex; flex-direction: column; min-width: 0; }
.langPick .native { font-weight: 650; font-size: 1.1rem; }
.langPick .english { color: var(--muted); font-size: 0.82rem; }
.langPick svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.langPick.compact { width: auto; padding: 8px 12px; }
.langPick.compact .native { font-size: 1rem; }

/* ---------- Start & invite ---------- */
.setup {
  min-height: 100dvh; display: flex; flex-direction: column; gap: 16px;
  padding: max(20px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}
.hero { text-align: center; padding: 5vh 0 4px; }
.hero.compact { padding-top: 7vh; }
.logo { width: 76px; height: 76px; display: block; margin: 0 auto 10px; stroke: none; }
.hero h1 { font-size: 2.1rem; letter-spacing: -0.02em; margin: 0; line-height: 1.15; }
.hero h1.wordmark { line-height: 0; }
.hero h1.wordmark img { height: 2.6rem; width: auto; display: block; margin: 4px auto 0; }
.tagline { color: var(--muted); margin: 8px auto 0; font-size: 1.05rem; max-width: 340px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px;
}
.label { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }
.card .label:not(:first-child) { margin-top: 10px; }

.personalBtn { margin-top: -8px; }
.joinAlt { text-align: center; color: var(--muted); }
.joinAlt summary { cursor: pointer; list-style: none; padding: 6px; font-size: 0.95rem; }
.joinAlt summary::-webkit-details-marker { display: none; }
.joinAlt[open] summary { color: var(--text); }
.codeRow { display: flex; gap: 8px; margin-top: 8px; }
.input.code { text-align: center; text-transform: uppercase; letter-spacing: 0.4em; font-size: 1.3rem; font-weight: 700; }

.how { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; color: var(--muted); font-size: 0.95rem; }
.how li { display: flex; gap: 12px; align-items: center; }
.how b {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent); font-size: 0.85rem;
}
.fine { text-align: center; color: var(--muted); font-size: 0.82rem; margin: 0 12px; }
.fine a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.legalLinks { margin-top: auto; padding-top: 8px; }
.note { font-size: 0.9rem; border-radius: 12px; padding: 10px 12px; margin: 0; }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.soft { background: var(--surface); border: 1px solid var(--border); color: var(--muted); margin-top: 12px; }
.inviteLangRow { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.linkLife { font-size: 0.82rem; margin: 2px 0 0; }

/* Card shown inside chat-app browsers, where voice does not work */
.escapeCard {
  background: var(--surface); border: 1.5px solid var(--accent); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow);
}
.escapeCard h3 { margin: 0; font-size: 1.05rem; }
.escapeCard p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.escapeCard ol { margin: 0; padding-left: 20px; color: var(--text); font-size: 0.95rem; display: grid; gap: 4px; }
.escapeCard .row { display: flex; gap: 8px; flex-wrap: wrap; }
.escapeCard .row .btn { flex: 1; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--hot), var(--accent)); color: #fff; font-weight: 700;
}
.avatar.big { width: 84px; height: 84px; font-size: 2rem; margin: 0 auto 16px; box-shadow: var(--shadow); }
.avatar.anon { background: var(--surface-2); color: var(--muted); }
/* One colour per person, from their id, the same on every phone */
.avatar.tinted { background: hsl(var(--hue) 55% 46%); }
.avatar.tinted.anon { background: hsl(var(--hue) 30% 70%); color: #fff; }
.avatar.offline { opacity: 0.4; }
.avatar.mini { width: 18px; height: 18px; font-size: 0.6rem; }
/* Everyone in the header: stacked, newest to the right */
.avatars { display: flex; align-items: center; flex: none; }
.avatars .avatar { width: 36px; height: 36px; font-size: 0.95rem; border: 2px solid var(--bg); }
.avatars .avatar + .avatar { margin-left: -12px; }
.avatars .avatar.more { font-size: 0.72rem; font-weight: 600; }

/* ---------- Room ---------- */
.room { height: 100dvh; display: flex; flex-direction: column; position: relative; }
.topbar {
  display: flex; align-items: center; gap: 6px;
  padding: max(8px, env(safe-area-inset-top)) 8px 8px;
  border-bottom: 1px solid var(--border); background: var(--bg); z-index: 2;
}
.partner { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.partnerText { min-width: 0; }
.partnerName { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.partnerMeta { font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.partnerMeta .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.partnerMeta.offline .dot { background: var(--muted); }
.partnerMeta.pendingPeer .dot { background: var(--warn); animation: blink 1.4s infinite; }
.banner { background: var(--warn-bg); color: var(--warn); text-align: center; font-size: 0.85rem; padding: 6px; }

/* Invite panel */
.waiting {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; padding: 20px 20px max(20px, env(safe-area-inset-bottom));
}
.room.inviting .feed, .room.inviting .composer { display: none; }
.waiting h2 { margin: 0; font-size: 1.5rem; }
.waiting p { margin: 0 0 6px; }
.qrBox { background: #fff; padding: 14px; border-radius: 26px; box-shadow: var(--shadow); }
.qrBox img { width: min(62vw, 250px); aspect-ratio: 1; display: block; }
.codeLine { color: var(--muted); font-size: 0.9rem; }
.codeLine strong { color: var(--text); }
.bigCode { font-size: 2.2rem; font-weight: 800; letter-spacing: 0.3em; padding-left: 0.3em; line-height: 1.1; }
.waitRow { display: flex; gap: 10px; margin-top: 4px; }
.waitStatus { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.9rem; margin-top: 8px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); animation: blink 1.4s infinite; }

/* Feed */
.feed {
  flex: 1; overflow-y: auto; padding: 16px 12px 10px; display: flex; flex-direction: column; gap: 10px;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.msgs { display: flex; flex-direction: column; gap: 10px; }
.msgs:empty { display: none; }
.empty { margin: auto; text-align: center; color: var(--muted); max-width: 300px; padding: 24px 0; }
.empty h2 { color: var(--text); font-size: 1.15rem; margin: 14px 0 6px; }
.empty p { margin: 0; }
.emptyArt {
  width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.emptyArt svg { width: 32px; height: 32px; }

.msg {
  max-width: 86%; padding: 11px 14px 6px; border-radius: 22px; box-shadow: var(--shadow);
  animation: rise 0.22s ease-out; overflow-wrap: anywhere;
}
.msg.theirs { align-self: flex-start; background: var(--theirs-bg); color: var(--theirs-ink); border-bottom-left-radius: 6px; }
.msg.mine { align-self: flex-end; background: var(--mine-bg); color: var(--mine-ink); border-bottom-right-radius: 6px; }
.msg .primary { font-size: var(--fs-mine); line-height: 1.35; white-space: pre-wrap; cursor: zoom-in; }
.msg.theirs .primary { font-size: var(--fs-theirs); font-weight: 500; line-height: 1.3; }
.msg .secondary { font-size: 0.9rem; margin-top: 5px; color: var(--theirs-sub); white-space: pre-wrap; }
.msg.mine .secondary { color: var(--mine-sub); }
/* Who said it, shown once a third person has joined */
.msg .speaker {
  display: flex; align-items: center; gap: 6px; margin: -3px 0 5px;
  font-size: 0.78rem; font-weight: 650; color: hsl(var(--hue) 55% 38%);
}
@media (prefers-color-scheme: dark) { .msg .speaker { color: hsl(var(--hue) 60% 72%); } }
/* My message to several languages: one line each, two shown, the rest behind a tap */
.msg.mine .secondary .lc { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; opacity: 0.85; }
.msg.mine .secondary.extra { display: none; }
.msg.mine.expanded .secondary.extra { display: block; }
.moreLangs { font-size: 0.78rem; margin-top: 4px; padding: 2px 0; color: var(--mine-sub); text-decoration: underline; text-underline-offset: 2px; }
/* Reactions: chips under a line, the strip to add one, "?" for "I didn't get this" */
.reactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; padding: 2px 8px; border-radius: 999px;
  background: rgba(127, 127, 127, 0.14); color: inherit; border: 1.5px solid transparent;
}
.chip.me { border-color: currentColor; }
.chip.ask { font-weight: 700; }
.reactStrip {
  display: flex; gap: 2px; margin-top: 6px; padding: 4px; border-radius: 999px; background: var(--surface);
  box-shadow: var(--shadow); width: max-content; max-width: 100%; animation: rise 0.15s ease-out;
}
.reactStrip button { width: 38px; height: 38px; border-radius: 50%; font-size: 1.25rem; display: grid; place-items: center; }
.reactStrip button:active, .reactStrip button.on { background: var(--surface-2); }
.reactStrip button.ask { font-size: 0.8rem; font-weight: 700; width: auto; padding: 0 12px; color: var(--warn); }
.msg .confused { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.82rem; margin-top: 6px; color: #ffe7b8; }
.msg .confused .btn.tiny { padding: 4px 10px; font-size: 0.8rem; border-radius: 999px; background: rgba(255,255,255,0.18); color: #fff; }
.msg .explain {
  position: relative; margin-top: 8px; padding: 8px 28px 8px 10px; border-radius: 12px; font-size: 0.88rem; line-height: 1.4;
  background: var(--accent-soft); color: var(--text);
}
.msg .explain.loading { font-style: italic; color: var(--muted); }
.msg .explain .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.msg .explain .x svg { width: 14px; height: 14px; }
.live .speakerName { font-size: 0.78rem; color: var(--theirs-sub); margin-right: 6px; vertical-align: top; padding-top: 6px; display: inline-block; }
.live .speakerName:empty { display: none; }
.msg .secondary.status { font-style: italic; }
.msg .secondary.error { color: var(--danger); font-style: normal; }
.msg.mine .secondary.error { color: #ffe1e1; }
.msg .heard { font-size: 0.78rem; margin-top: 5px; font-style: italic; color: var(--theirs-sub); white-space: pre-wrap; }
.msg.mine .heard { color: var(--mine-sub); opacity: 0.85; }
.msg .flagNote { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; margin-top: 6px; color: var(--warn); }
.msg.mine .flagNote { color: #ffe7b8; }
.msg.flagged { box-shadow: inset 0 0 0 2px var(--warn); }
.msg.pending .primary { opacity: 0.9; }
.actions { display: flex; align-items: center; gap: 0; margin: 2px -8px 0; font-size: 0.72rem; color: var(--theirs-sub); }
.msg.mine .actions { color: var(--mine-sub); }
.actions .time { padding: 0 8px; margin-right: auto; }
.actions .badge { padding: 0 4px; }
.act { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: inherit; }
.act svg { width: 17px; height: 17px; }
.act:active { background: rgba(127, 127, 127, 0.2); }
.dots::after { content: "…"; display: inline-block; animation: dots 1.2s steps(4) infinite; width: 1.2em; overflow: hidden; vertical-align: bottom; }

.msg.live { animation: none; }
.msg.mine.live {
  background: transparent; color: var(--text); box-shadow: none;
  border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); padding-bottom: 11px;
}
.msg.mine.live.sending { opacity: 0.55; }
.typing { display: inline-flex; gap: 5px; padding: 6px 2px 10px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

/* Composer */
.composer {
  padding: 10px 16px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); background: var(--bg);
}
.typeRow { display: flex; gap: 8px; margin-bottom: 12px; }
.typeRow input {
  flex: 1; min-width: 0; padding: 11px 16px; border-radius: 24px; border: 1.5px solid var(--border);
  background: var(--surface); outline: none;
}
.typeRow input:focus { border-color: var(--accent); }
.micRow { display: flex; align-items: center; justify-content: space-between; padding: 0 12px; }
.mic {
  position: relative; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 38%, transparent);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.mic svg { width: 32px; height: 32px; position: relative; }
.mic .ring { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.mic[data-mode="hold"] { transform: scale(1.14); background: var(--hot); box-shadow: 0 12px 30px color-mix(in srgb, var(--hot) 45%, transparent); }
.mic[data-mode="toggle"] { background: var(--hot); }
.mic[data-mode] .ring { animation: ripple 1.3s ease-out infinite; }
.mic:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; }
.micHint { text-align: center; font-size: 0.82rem; color: var(--muted); margin-top: 10px; min-height: 1.2em; }
.micHint.live { color: var(--hot); font-weight: 600; }
#btnAloud .on { display: none; }
#btnAloud[aria-pressed="true"] .on { display: inline; }
#btnAloud[aria-pressed="true"] .off { display: none; }

/* ---------- Sheets ---------- */
dialog.sheet {
  border: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 88dvh;
  padding: 6px 20px max(20px, env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0; background: var(--surface); color: var(--text);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
}
dialog.sheet[open] { animation: sheetUp 0.24s cubic-bezier(0.2, 0.9, 0.3, 1); }
dialog.sheet.tall[open] { display: flex; flex-direction: column; height: 80dvh; }
dialog.sheet::backdrop { background: rgba(10, 8, 20, 0.45); }
.sheetHandle { width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 4px auto 8px; flex: none; }
.sheetHead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; flex: none; }
.sheetHead h2 { font-size: 1.2rem; margin: 0; }
.sheetSub { margin: 0 0 12px; font-size: 0.9rem; }
.sheetActions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

.langList { list-style: none; margin: 10px 0 0; padding: 0; overflow-y: auto; flex: 1; }
.langItem {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 6px; border-bottom: 1px solid var(--border); text-align: left;
}
.langItem .native { font-weight: 600; display: block; }
.langItem .english { color: var(--muted); font-size: 0.88rem; display: block; }
.langItem .check { color: var(--accent); width: 20px; height: 20px; visibility: hidden; flex: none; }
.langItem.selected .check { visibility: visible; }
.langItem.selected .native { color: var(--accent); }

.setting {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border); min-height: 60px;
}
.setting.stacked { flex-direction: column; align-items: stretch; gap: 8px; }
.setting.inline { border-bottom: 0; padding: 12px 0 0; min-height: 0; }
.setting span small { display: block; font-weight: 400; font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
/* Audio first: for following by ear, with the phone on the table or earbuds in */
html[data-easy] .mic { width: 96px; height: 96px; }
html[data-easy] .micHint { font-size: 1rem; }
/* Kept conversations on the start screen: one row each, newest first */
.keptRows { display: flex; flex-direction: column; gap: 8px; }
.keptRow {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
}
.keptRow .avatars .avatar { width: 30px; height: 30px; font-size: 0.8rem; }
.keptRow .keptText { flex: 1; min-width: 0; }
.keptRow .keptTitle { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.keptRow .keptMeta { font-size: 0.8rem; color: var(--muted); }
.keptRow:active { transform: scale(0.99); }
.recapText { white-space: pre-wrap; line-height: 1.5; padding: 6px 2px 14px; font-size: 1.02rem; min-height: 80px; }
.recapText.muted { font-style: italic; }
.toast .toastAct { margin-left: 10px; padding: 4px 11px; border-radius: 999px; background: var(--bg); color: var(--text); font-weight: 650; font-size: 0.85rem; }
.setting.stacked label { font-weight: 400; }
.settingHint { font-size: 0.8rem; }
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; }
.seg button { padding: 5px 14px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.seg button[data-size="s"] { font-size: 0.8rem; }
.seg button[data-size="l"] { font-size: 1.3rem; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.switch {
  appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 16px; margin: 0;
  background: var(--surface-2); position: relative; transition: background 0.2s; flex: none; cursor: pointer;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s;
}
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }
/* People sheet: everyone in the room and who they are to me */
.peopleList { list-style: none; margin: 8px 0 0; padding: 0; overflow-y: auto; flex: 1; }
.person { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.person .who { flex: 1; min-width: 0; }
.person .pname { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .pmeta { font-size: 0.82rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.person .pmeta .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.person.offline .pmeta .dot { background: var(--muted); }
.person select {
  font: inherit; font-size: 0.9rem; color: var(--text); background: var(--surface-2); border: 0;
  border-radius: 10px; padding: 8px 10px; max-width: 52%;
}
.person select.unset { color: var(--muted); }
.peopleHint { margin: 10px 0 4px; }
.peopleEmpty { padding: 24px 0; color: var(--muted); text-align: center; }
.seg.words button { font-size: 0.85rem; padding: 5px 10px; }
.partner { text-align: left; }
.settingBtn { width: 100%; text-align: left; padding: 16px 0; border-bottom: 1px solid var(--border); font-weight: 600; }
.settingBtn:last-child { border-bottom: 0; }
.settingBtn.danger { color: var(--danger); }

/* ---------- Enlarged message ---------- */
.bigOverlay {
  position: fixed; inset: 0; z-index: 50; background: var(--bg); cursor: zoom-out;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  padding: max(32px, env(safe-area-inset-top)) 24px max(32px, env(safe-area-inset-bottom));
  animation: fade 0.18s ease-out;
}
.bigLang { color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.85rem; font-weight: 700; }
.bigText { font-size: clamp(2rem, 9vw, 4rem); font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.bigHint { color: var(--muted); font-size: 0.85rem; margin-top: 20px; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; top: calc(max(8px, env(safe-area-inset-top)) + 64px); left: 0; right: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; pointer-events: none;
}
.toast {
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 14px; font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); max-width: 480px; text-align: center;
  opacity: 0; transform: translateY(-8px); transition: opacity 0.25s, transform 0.25s;
}
.toast.in { opacity: 1; transform: none; }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes ripple {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--hot) 50%, transparent); }
  to { box-shadow: 0 0 0 22px color-mix(in srgb, var(--hot) 0%, transparent); }
}
@keyframes dots { from { width: 0; } to { width: 1.2em; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------- Onboarding (first launch) ---------- */
.onboarding { min-height: 100dvh; }
.obPage {
  min-height: 100dvh; box-sizing: border-box; display: flex; flex-direction: column; gap: 18px;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
}
.obPage[data-page="0"] { background: var(--accent); color: #fff; }
.obTop { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.obTop .logo.small { width: 36px; height: 36px; }
.obSkip { font-weight: 600; color: inherit; opacity: 0.85; min-height: 44px; padding: 0 4px; }
.obPage h1 { margin: 0; font-size: 1.85rem; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; }
.obPage p { margin: 0; font-size: 1rem; line-height: 1.45; opacity: 0.85; }
.obArt { flex: 1; position: relative; min-height: 300px; }
.obPhone {
  position: absolute; top: 40px; width: 160px; height: 280px; border-radius: 26px; background: var(--bg); color: var(--text);
  padding: 14px 12px; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 20px 40px rgba(0,0,0,.25);
}
.obPhone.left { left: 0; transform: rotate(-6deg); }
.obPhone.right { right: 0; top: 0; transform: rotate(6deg); }
.obTag { font-size: 11px; font-weight: 700; color: var(--muted); }
.obBubble { border-radius: 14px; padding: 8px 10px; font-size: 13px; line-height: 1.25; }
.obBubble.theirs { background: #fff; font-weight: 600; font-size: 14px; border-bottom-left-radius: 4px; }
.obBubble.mine { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.obMic { margin-top: auto; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); align-self: center; }
.obNav { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.obDots { display: flex; gap: 6px; }
.obDots.center { justify-content: center; padding-top: 4px; }
.obDots i { width: 6px; height: 6px; border-radius: 3px; background: currentColor; opacity: 0.35; transition: width .2s; }
.obDots i.on { width: 20px; opacity: 1; }
.obPage[data-page="0"] .obDots i { color: #fff; }
.obPage:not([data-page="0"]) .obDots i { background: var(--accent); }
.obPage:not([data-page="0"]) .obDots i:not(.on) { background: #c8c2b8; opacity: 1; }
.obNext { min-height: 52px; padding: 0 26px; border-radius: 16px; font-weight: 700; }
.obPage[data-page="0"] .obNext { background: #fff; color: var(--accent); }
.obSteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; flex: 1; justify-content: center; }
.obSteps li { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); }
.obSteps li > span:last-child { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; color: var(--muted); line-height: 1.4; }
.obSteps b { font-size: 1.05rem; color: var(--text); }
.obIcon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none; }
.obIcon svg { width: 26px; height: 26px; }
.obIcon.violet { background: var(--accent-soft); color: var(--accent); }
.obIcon.coral { background: #fde7e4; color: var(--hot); }
.obIcon.green { background: #e3f3ea; color: var(--ok); }
.obMicHero {
  width: 132px; height: 132px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; margin: auto auto 8px;
  box-shadow: 0 0 0 18px color-mix(in srgb, var(--accent) 12%, transparent), 0 0 0 36px color-mix(in srgb, var(--accent) 6%, transparent), 0 14px 34px color-mix(in srgb, var(--accent) 35%, transparent);
}
.obMicHero svg { width: 56px; height: 56px; }
.obChecks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 0.9rem; color: var(--muted); }
.obChecks li { display: flex; gap: 10px; align-items: flex-start; }
.obChecks li::before { content: "✓"; color: var(--ok); font-weight: 800; flex: none; }
.obEnd { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Plan banner on the start screen ---------- */
.planBanner {
  display: flex; align-items: center; gap: 12px; height: 64px; box-sizing: border-box; padding: 0 14px 0 12px;
  border-radius: 18px; background: var(--accent-soft); color: var(--text); text-align: left; width: 100%;
}
.pbIcon { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.pbIcon svg { width: 20px; height: 20px; }
.pbText { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pbText b { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbText span { font-size: 0.82rem; color: var(--accent); font-weight: 600; }
.pbChevron { width: 18px; height: 18px; color: var(--accent); flex: none; }

/* ---------- Floating reactions ---------- */
.room .feed { padding-bottom: 58px; }
.reactFab {
  position: absolute; right: 12px; bottom: calc(var(--composer-h, 130px) + 10px); z-index: 3;
  width: 40px; height: 40px; border-radius: 50%; background: var(--surface); color: var(--accent);
  display: grid; place-items: center; box-shadow: 0 1px 2px rgba(25,20,45,.1), 0 6px 18px rgba(25,20,45,.14);
}
.reactFab[aria-expanded="true"] { background: var(--accent-soft); }
.reactFab svg { width: 20px; height: 20px; }
html[data-easy] .reactFab { width: 44px; height: 44px; }
.reactStrip.floating { position: absolute; right: 12px; bottom: calc(var(--composer-h, 130px) + 60px); z-index: 3; margin: 0; }
.reactStrip.floating button { width: 40px; height: 40px; font-size: 1.35rem; }
.reactStrip.floating button.ask { width: auto; }
.room.inviting .reactFab, .room.inviting .reactStrip.floating, .room.inviting .floats { display: none; }
.floats { position: absolute; right: 16px; bottom: calc(var(--composer-h, 130px) + 8px); width: 120px; height: 360px; pointer-events: none; z-index: 2; overflow: hidden; }
.floatEmoji {
  position: absolute; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  animation: floatUp 2.8s ease-out forwards;
}
.floatEmoji span { font-size: 34px; line-height: 1; }
.floatEmoji small { font-size: 11px; font-weight: 650; padding: 1px 7px; border-radius: 999px; background: rgba(29,27,34,.75); color: #fff; white-space: nowrap; }
@keyframes floatUp {
  0% { transform: translateY(0) scale(.9); opacity: 0; }
  10% { opacity: 1; transform: translateY(-10px) scale(1); }
  100% { transform: translateY(-330px) scale(.8); opacity: 0; }
}

/* ---------- Passes and the add-someone gate (demo) ---------- */
.passList { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 12px; }
.passOpt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; width: 100%;
  background: var(--surface); border: 2px solid transparent; border-radius: 20px; padding: 14px 16px; color: inherit; box-shadow: var(--shadow);
}
.passOpt.selected { border-color: var(--accent); }
.passOpt > span { display: flex; flex-direction: column; gap: 2px; }
.passOpt b { font-size: 1.05rem; }
.passOpt small { font-size: 0.82rem; color: var(--muted); }
.passOpt strong { font-size: 1.35rem; font-weight: 800; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; }
.passOpt strong small { font-weight: 400; }
.passChecks { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; color: var(--muted); }
.passChecks li { display: flex; gap: 8px; }
.passChecks li::before { content: "✓"; color: var(--ok); font-weight: 800; }
.gateWho { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.gateWho > div { display: flex; flex-direction: column; min-width: 0; }
.gateWho .muted { font-size: 0.85rem; }
.gateWho .avatar.more { border: 2px dashed #c8c2b8; background: var(--surface-2); color: var(--muted); }
#gateSheet p { margin: 0 0 14px; line-height: 1.45; }
#gateSheet .btn.ghost, #passSheet .btn.ghost { width: 100%; margin-top: 8px; }

/* ---------- Notices as cards ---------- */
.toast {
  background: var(--surface); color: var(--text); border-radius: 18px; padding: 10px 14px; text-align: left;
  box-shadow: 0 1px 2px rgba(25,20,45,.08), 0 10px 28px rgba(25,20,45,.18); display: flex; align-items: center; gap: 12px;
  width: 100%; max-width: 480px; pointer-events: auto;
}
.toast.error { background: var(--surface); color: var(--text); border-left: 4px solid var(--danger); }
.toast.ok { background: var(--surface); color: var(--text); border-left: 4px solid var(--ok); }
.toast .tIcon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.toast .tIcon.warn { background: var(--warn-bg); color: var(--warn); }
.toast .tIcon svg { width: 22px; height: 22px; }
.toast .tText { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.toast .tText b { font-size: 0.95rem; }
.toast .tText span { font-size: 0.82rem; color: var(--muted); }
.toast .toastAct { margin-left: 0; padding: 8px 13px; background: var(--accent); color: #fff; flex: none; }
.mic.resting { background: var(--surface-2); color: var(--muted); box-shadow: none; }
.mic.resting .ring { display: none; }
.obTop .logo.small { margin: 0; }

/* ---------- After a guest's conversation, and gifts ---------- */
.after { gap: 14px; }
.afterTop { display: flex; justify-content: flex-end; margin: 0 -10px -6px 0; }
.afterHead h1 { margin: 0; font-size: 1.75rem; letter-spacing: -0.01em; line-height: 1.2; }
.afterWith { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.9rem; min-width: 0; }
.afterWith .avatars { flex: none; }
.afterWith .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afterRecap .recapText { margin: 0; font-size: 1.05rem; line-height: 1.5; white-space: pre-wrap; }
.afterShareRow { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 6px; }
.cardThumb {
  width: 48px; height: 60px; object-fit: cover; border-radius: 8px; margin-right: auto;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.hostOwn {
  background: var(--accent-soft); border-radius: var(--radius); padding: 18px 16px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.hostOwn h2 { margin: 0; font-size: 1.25rem; }
.hostOwn p { margin: 0 0 4px; line-height: 1.45; }
.coveredChip {
  align-self: center; margin: 0; padding: 6px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--ok, #1f9d55) 14%, transparent); color: var(--ok, #1f9d55);
  font-size: 0.88rem; font-weight: 650;
}
.coveredChip::before { content: "✓ "; }
