*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--glow), var(--bg); background-attachment: fixed;
  color: var(--text); font: 16px/1.55 var(--font);
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 600; }
h3 { font-size: 1.02rem; font-weight: 600; }
p { margin: 0 0 .75em; }
a { color: var(--accent); }
code { font-family: ui-monospace, monospace; font-size: .85em; }

.muted { color: var(--muted); }
.sm { font-size: .85rem; }
.center { text-align: center; justify-content: center; }
.lead { font-size: 1.08rem; color: var(--text-2); }
.err { color: var(--danger); min-height: 1.2em; margin: .5em 0; }
.ok { color: var(--success); font-weight: 600; }
.req { color: var(--danger); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.loading { padding: 4rem 1rem; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 1rem; }
/* Three bouncing dots + a line that changes every few seconds. */
.bouncer { display: inline-flex; gap: 7px; }
.bouncer i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent, #2bb3a3); animation: bounce 1s infinite ease-in-out; }
.bouncer i:nth-child(2) { animation-delay: .15s; } .bouncer i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-9px); opacity: 1; } }
.fun-line { margin: 0; font-size: .95rem; }
.fun-line.in { animation: fadeUp .4s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* Steps along the top of a flow. */
.steps { list-style: none; display: flex; justify-content: center; gap: .5rem; padding: 0; margin: 0 0 1rem; font-size: .85rem; color: var(--muted); }
.steps li { display: flex; align-items: center; gap: .35rem; }
.steps li + li::before { content: ''; width: 1.4rem; height: 2px; background: currentColor; opacity: .35; margin-inline-end: .2rem; }
.steps .n { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; border: 2px solid currentColor; font-weight: 700; font-size: .75rem; }
.steps .now { color: var(--accent, #2bb3a3); font-weight: 600; }
.steps .done { color: var(--ok, #3aa76d); }
.steps .done .n { background: var(--ok, #3aa76d); color: #fff; border-color: transparent; }
@media (prefers-reduced-motion: reduce) { .bouncer i, .fun-line.in { animation: none; } }

/* ── Layout ── */
#hdr { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.hdr-in { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.brand .logo { height: 28px; width: auto; }
.brand .mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); opacity: .85; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 6px 12px; border-radius: 999px; color: var(--text-2); text-decoration: none; font-weight: 500; }
.nav a.on, .nav a:hover { background: var(--accent-soft); color: var(--accent); }
.hdr-right { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 80px; }
.demo-banner { background: var(--warning); color: #1b1200; text-align: center; padding: 6px 16px; font-size: .85rem; font-weight: 500; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 8px 0 16px; }
.page-head h1, .page-head h2 { margin: 0; }
.back { color: var(--muted); text-decoration: none; font-size: .9rem; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.gap { gap: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.inset { background: var(--surface-2); box-shadow: none; }
.card.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.card.note, .note { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text-2); }
.survey-card { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.survey-card h3 { margin: 0; }

/* ── Controls ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; min-height: 44px; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.sm { padding: 6px 12px; min-height: 34px; font-size: .88rem; }
.btn.lg { padding: 14px 28px; font-size: 1.05rem; min-height: 52px; }
.btn.block { width: 100%; margin-top: 10px; }
.icon-btn { width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer; font-size: 1rem; }
.icon-btn:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
.icon-btn:disabled { opacity: .3; }
.pill { padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.pill.warn { background: var(--warning); color: #1b1200; border: 0; cursor: pointer; }

input, textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px;
}
select { width: auto; max-width: 100%; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus, .btn:focus-visible, .choice:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.field { display: block; margin-bottom: 14px; }
.lbl { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--text-2); }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; margin-top: 2px; accent-color: var(--accent); flex: none; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }

.bi { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1; }
.bi-cell { position: relative; }
.bi-tag { position: absolute; inset-block-start: -8px; inset-inline-start: 8px; font-size: .68rem; font-weight: 700; padding: 0 5px; background: var(--surface); color: var(--muted); border-radius: 4px; }
@media (max-width: 640px) { .bi { grid-template-columns: 1fr; gap: 14px; } }

/* ── Builder ── */
.q-card { border-inline-start: 3px solid var(--accent); }
.q-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .9rem; flex: none; }
.opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.add-bar .chips { margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: inherit; font-size: .88rem; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.static { cursor: default; }

.badge { padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.badge.live, .badge.field { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.badge.closed { background: var(--danger-soft); color: var(--danger); }
.badge.handoff { background: var(--accent-soft); color: var(--accent); }

/* ── Runner ── */
.runner { max-width: 640px; margin: 0 auto; }
.progress { height: 4px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-bottom: 16px; }
.progress > div { height: 100%; background: var(--accent); transition: width .3s; }
.hero h1 { font-size: 1.8rem; }
.eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.eyebrow.warn { color: var(--warning); }
.lang-pick { display: flex; gap: 10px; margin: 18px 0 8px; }
.lang-pick .btn { flex: 1; }
.consent-text { white-space: pre-wrap; background: var(--surface-2); padding: 14px; border-radius: var(--radius-sm); margin-bottom: 12px; max-height: 40vh; overflow: auto; }
.q-page h2 { font-size: 1.35rem; }
.nav-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.nav-row .btn.lg { min-width: 140px; }
.choices { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface-2); min-height: 52px; }
.choice input { width: 20px; height: 20px; min-height: 0; flex: none; accent-color: var(--accent); }
.choice.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.scale-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.scale-btn { flex: 1; min-width: 44px; height: 52px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; font-size: 1.1rem; cursor: pointer; }
.scale-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.big-check { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 12px; background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); font-size: 2.2rem; }
.center-link { display: block; text-align: center; margin-top: 14px; }
.auth { max-width: 420px; margin: 40px auto; }
/* Sign-in: a centred card with a soft accent edge, a friendly icon, the number first and Google below. */
.auth-wrap { min-height: calc(100vh - 150px); display: grid; place-items: center; padding: 12px 0 24px; }
.auth-wrap .auth { width: 100%; margin: 0; padding: 30px 24px 20px; position: relative; overflow: hidden; border-radius: 20px; }
.auth-wrap .auth::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #9be7dc)); }
.auth-hero { text-align: center; margin-bottom: 16px; }
.auth-icon { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; font-size: 32px; background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 7%, transparent); }
.auth-hero h1 { margin: 0 0 6px; font-size: 1.65rem; }
.auth-hero p { margin: 0 auto; max-width: 30ch; }
.auth .steps { margin: 4px 0 20px; }
.auth .phone-input { min-height: 56px; font-size: 1.15rem; border-radius: 14px; }
.auth .phone-input input { font-size: 1.15rem; letter-spacing: .02em; }
.auth .otp { min-height: 64px; border-radius: 14px; }
.auth .hint { text-align: center; }
.auth .btn.lg { min-height: 54px; border-radius: 14px; }
.btn.primary { background: color-mix(in srgb, var(--accent) 82%, #000); color: #fff; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.auth .or-block { margin-top: 14px; }
.auth-privacy { text-align: center; font-size: .78rem; color: var(--muted); margin: 18px auto 0; max-width: 34ch; line-height: 1.5; }

/* ── Recording ── */
.rec { display: grid; gap: 10px; }
.rec-stage { display: grid; place-items: center; gap: 4px; padding: 26px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); }
.rec-icon { font-size: 2.2rem; }
.rec-media { width: 100%; max-height: 360px; border-radius: var(--radius-sm); background: #000; }
audio.rec-media { background: transparent; }
.mirror { transform: scaleX(-1); }
.rec-btn { background: var(--danger); border-color: var(--danger); color: #fff; }
.rec-on { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--danger); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
.pulse { width: 48px; height: 48px; border-radius: 50%; background: var(--danger); animation: pulse 1.4s infinite; }
.rec-time { font-variant-numeric: tabular-nums; }
@keyframes blink { 50% { opacity: .25; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(192, 57, 43, .5); } 70% { box-shadow: 0 0 0 18px rgba(192, 57, 43, 0); } 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); } }
.rec-bar { position: sticky; top: 64px; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin-bottom: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--danger); box-shadow: var(--shadow); }
.rec-bar.paused { border-color: var(--warning); }
.rec-bar.paused .dot { background: var(--warning); animation: none; }
.rec-bar .btn { margin-inline-start: auto; }
.rec-mini { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; background: #000; }
.scan .row input { flex: 1; }
.scan-area { margin-top: 10px; display: grid; gap: 8px; }

/* ── QR ── */
.qr-box { display: grid; gap: 12px; justify-items: center; }
.qr-img { background: #fff; padding: 12px; border-radius: 12px; image-rendering: pixelated; width: min(280px, 70vw); height: auto; }

/* ── Responses ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab { padding: 10px 16px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: start; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; background: var(--surface-2); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--accent-soft); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; inset: 0 0 auto; height: 2px; background: var(--accent); }
.kpi-v { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-l { color: var(--muted); font-size: .85rem; }
.bar-row { display: grid; grid-template-columns: minmax(100px, 220px) 1fr auto; gap: 12px; align-items: center; margin: 8px 0; font-size: .9rem; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 5px; }
.bar-val { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 70px; text-align: end; }
.samples { margin: 0; padding-inline-start: 18px; color: var(--text-2); }
.list-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.upload-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }

/* ── Modal + response detail ── */
.modal-ov { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55); display: grid; place-items: center; padding: 16px; }
.modal { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); width: min(760px, 100%); max-height: 90vh; overflow: auto; padding: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.modal-head h2 { margin: 0; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
.meta { display: grid; font-size: .9rem; }
.answer { padding: 12px 0; border-bottom: 1px solid var(--border); }
.q-label { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.a-value { font-weight: 500; white-space: pre-wrap; }
.interview-rec { margin-bottom: 16px; }
.chapters { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }

#toasts { position: fixed; inset-inline: 0; bottom: 20px; z-index: 60; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 500; box-shadow: var(--shadow); max-width: 100%; }
.toast.err { background: var(--danger); color: #fff; }

@media (max-width: 640px) {
  h1 { font-size: 1.35rem; }
  .card { padding: 16px; }
  .hdr-in { gap: 8px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .bar-row { grid-template-columns: 1fr auto; }
  .bar-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
}

.choices.many { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.choices.many .choice { padding: 10px 12px; min-height: 46px; font-size: .95rem; }

/* ── Sign-in ── */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 6px 0 18px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; }
.seg { border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 600; padding: 9px; border-radius: 999px; cursor: pointer; }
.seg.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong); }
.phone-input { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); overflow: hidden; }
.phone-input .cc { display: grid; place-items: center; padding: 0 12px; font-weight: 600; color: var(--text-2); border-inline-end: 1px solid var(--border); white-space: nowrap; }
.phone-input input { border: 0; border-radius: 0; background: transparent; font-size: 1.1rem; letter-spacing: .03em; }
.phone-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.phone-input input:focus { box-shadow: none; }
.otp { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.linkish { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; width: 100%; }
.step-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 1.3rem; color: var(--text); background: var(--surface-2); margin-bottom: 12px; }
#recaptcha-box { position: fixed; bottom: 0; inset-inline-start: 0; z-index: 70; }

/* ═══════════════ Minimal layer: flat, quiet, one muted accent ═══════════════ */
body { background: var(--bg); }
#hdr { background: var(--bg); backdrop-filter: none; border-bottom: 1px solid var(--border); }
.brand { font-weight: 600; letter-spacing: -.01em; }
.brand .mark { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); opacity: 1; }
.brand .logo { height: 22px; }
.nav a.on, .nav a:hover { background: transparent; color: var(--text); text-decoration: underline; text-underline-offset: 6px; }
.card { box-shadow: none; border-radius: var(--radius); }
.btn { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 500; transition: opacity .15s; }
.btn:hover { filter: none; opacity: .85; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--surface-2); opacity: 1; }
.rec-btn { background: var(--danger); border-color: var(--danger); color: #fff; }
.progress { height: 2px; }
.progress > div { background: var(--text); }
.choice.on { border-color: var(--text); background: var(--surface); font-weight: 500; }
.scale-btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.q-num { background: transparent; color: var(--muted); font-weight: 500; }
.q-card { border-inline-start: 1px solid var(--border); }
.big-check { background: var(--surface-2); color: var(--text); font-size: 1.8rem; }
.eyebrow { color: var(--muted); font-weight: 500; letter-spacing: .02em; text-transform: none; }
.kpi::before { display: none; }
.bar-fill { background: var(--text); opacity: .75; }
.tab.on { color: var(--text); border-bottom-color: var(--text); }
.badge.live, .badge.field, .badge.handoff, .badge.closed { background: var(--surface-2); color: var(--text-2); }
.badge.live::before, .badge.field::before { content: '● '; color: var(--success); }
.chip:hover { border-color: var(--text); color: var(--text); }
.demo-banner { background: var(--surface-2); color: var(--text-2); border-bottom: 1px solid var(--border); }
.pill.warn { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); }
.toast { box-shadow: none; }
.modal-ov { background: rgba(0, 0, 0, .4); }
.modal { box-shadow: none; }
input:focus, textarea:focus, select:focus, .btn:focus-visible, .choice:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; box-shadow: none; }
.phone-input:focus-within { border-color: var(--accent); box-shadow: none; outline: 2px solid var(--accent); outline-offset: 1px; }
h1 { font-weight: 600; letter-spacing: -.02em; }
.choice, .scale-btn, input, textarea, select { background: var(--surface); }
.choice:hover { border-color: var(--text-2); }

/* Referral page */
.refer { max-width: 460px; margin: 24px auto; text-align: center; }
.refer .row.center { justify-content: center; }
.ref-link { display: block; max-width: 100%; overflow-wrap: anywhere; font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.ref-count { font-weight: 600; min-height: 1.4em; }
.qr-slot { width: min(280px, 70vw); aspect-ratio: 1; display: grid; place-items: center; }
.qr-slot .qr-img { width: 100%; }

/* Analytics dashboard */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-v { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid2 > .card, .grid2 > div { min-width: 0; }
.card h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 16px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.bar-k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--text); border-radius: 4px; }
.bar-v { font-variant-numeric: tabular-nums; white-space: nowrap; }
.funnel { display: grid; gap: 8px; margin-bottom: 8px; }
.funnel-step { position: relative; padding: 8px 10px; }
.funnel-bar { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); border-inline-start: 3px solid var(--accent); border-radius: 4px; }
[dir="rtl"] .funnel-bar { inset: 0 0 0 auto; }
.funnel-txt { position: relative; font-size: 14px; }
.cols { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 2px; height: 120px; align-items: end; }
.col { height: 100%; display: flex; align-items: flex-end; }
.col-fill { display: block; width: 100%; background: var(--text); border-radius: 2px 2px 0 0; min-height: 1px; }
.map { height: 360px; border-radius: var(--radius-sm); overflow: hidden; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }

/* Sign in with Google */
.or-block { margin-top: 16px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; }
.g-logo { display: inline-flex; }
.result-card { text-align: start; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 16px 0; display: grid; gap: 10px; }
.result-card h2 { margin: 0; }

/* Segments */
.seg-list { display: grid; gap: 12px; }
.seg-row { display: grid; grid-template-columns: minmax(160px, 1.2fr) 1fr auto; gap: 12px; align-items: center; }
.heat-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.heat-table th, .heat-table td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--border); white-space: nowrap; }
.heat-table thead th { font-weight: 600; color: var(--text-2); white-space: normal; min-width: 70px; }
.heat-table tbody th { text-align: start; font-weight: 600; }
.heat { background: color-mix(in srgb, var(--accent) calc(var(--v, 0) * 45%), transparent); font-variant-numeric: tabular-nums; }
.heat-table tr.total th, .heat-table tr.total td { border-top: 2px solid var(--border-strong); }
@media (max-width: 640px) { .seg-row { grid-template-columns: 1fr; } }
.btn.working { opacity: .75; cursor: progress; }
.btn.working::after { content: ''; width: 14px; height: 14px; margin-inline-start: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; vertical-align: -2px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Respondent screens: phone-first ───────────────────────────── */
.consent-text { max-height: none; overflow: visible; line-height: 1.75; }
.runner .q-page h2, .runner .q-page h1 { line-height: 1.5; }
.choices.agree { gap: 8px; }
.choices.agree .choice { justify-content: flex-start; min-height: 54px; font-size: 1.02rem; }
.choice input[type=radio] { accent-color: var(--text); }
/* Back / Next stay at the bottom of the screen while reading long questions. */
.runner .nav-row { position: sticky; bottom: 0; z-index: 5; background: var(--bg); margin: 24px -20px -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.runner .nav-row .btn.lg { flex: 1; min-width: 0; }
.runner .nav-row .btn.ghost { flex: 0 0 auto; }

@media (max-width: 640px) {
  main:has(.runner) { padding: 8px 18px 0; }
  .runner { min-height: calc(100dvh - 72px); display: flex; flex-direction: column; }
  .runner .card { flex: 1; background: transparent; border: 0; padding: 12px 0 0; margin: 0; display: flex; flex-direction: column; }
  .runner .card > .nav-row { margin: auto -18px 0; }
  .runner .hero h1 { font-size: 1.75rem; line-height: 1.35; }
  .runner .lead { font-size: 1.05rem; }
  .runner .q-page h2 { font-size: 1.3rem; }
  .runner .consent-text { background: transparent; padding: 0; font-size: 1rem; }
  .runner .progress { margin: 0 -18px 4px; border-radius: 0; }
  .choice { min-height: 56px; }
}
.bi.one { grid-template-columns: 1fr; }
/* Result card: full trait name on its own line, bar underneath. */
.result-card .bar-row { grid-template-columns: 1fr auto; row-gap: 6px; }
.result-card .bar-k { white-space: normal; }
.result-card .bar-track { grid-column: 1 / -1; grid-row: 2; }
.danger-zone { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); justify-content: flex-end; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger.armed { background: var(--danger); color: #fff; }

/* Participant home */
.home-surveys { max-width: 460px; margin: 8px auto 24px; display: grid; gap: 10px; }
.home-surveys h1 { font-size: 1.4rem; margin: 0 0 4px; }
.survey-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.survey-row:hover { border-color: var(--text-2); }
.survey-row-title { font-weight: 600; font-size: 1.05rem; }
.survey-row.done { opacity: .7; cursor: default; }

/* Builder: one line per question, tap to edit */
.q-card.collapsed { padding: 0; margin-bottom: 8px; }
.q-card.open { padding-top: 0; }
.q-sum { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: none; border: 0; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.q-card.open .q-sum { padding-inline: 0; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.q-sum-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-sum-tags { display: flex; gap: 6px; flex: none; }
.tag { font-size: .75rem; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.q-chev { color: var(--muted); flex: none; }
.q-tools { margin-bottom: 12px; }
@media (max-width: 640px) { .q-sum-tags .tag.muted { display: none; } }

/* Customer profile + referral log */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .95rem; }
.kv:last-child { border-bottom: 0; }
.seg-badge { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); margin-bottom: 8px; }
.person-link { color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 1px dotted var(--muted); }

/* Live captions and spoken answers */
.live-cap { margin-bottom: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.live-cap .row { gap: 6px; }
.live-cap .chip { padding: 4px 10px; font-size: .8rem; }
.live-cap .chip.on { border-color: var(--accent); color: var(--accent); }
.live-on { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); }
.live-on .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: blink 1.2s infinite; }
.cap { margin: 6px 0 0; font-size: 1rem; }
.cap.interim { color: var(--muted); font-style: italic; }
.cap-tr { display: block; color: var(--muted); font-size: .88rem; }

/* AI analysis of recordings + profile file */
.ai-panel { margin: 10px 0 4px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.ai-panel h4 { margin: 0; font-size: .95rem; }
.ai-panel h5 { margin: 14px 0 6px; font-size: .88rem; }
.ai-panel p { margin: 8px 0; }
.ai-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.ai-row:last-child { border-bottom: 0; }
.chip.ts { padding: 2px 8px; font-size: .78rem; font-variant-numeric: tabular-nums; flex: none; }
.ai-checks h5 { color: var(--warning); }
.sent-positive { border-color: var(--success, #2e9e5b); }
.sent-negative { border-color: var(--danger); }
.sent-mixed { border-color: var(--warning); }
.transcript { margin-top: 10px; }
.transcript summary, details summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.md-file { white-space: pre-wrap; word-break: break-word; max-height: 60vh; overflow: auto; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .82rem; }

/* Video calls (views/call.js) */
.call-panel { padding: .75rem; }
.call-stage { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; max-height: 55vh; margin-bottom: .6rem; }
.call-remote { width: 100%; height: 100%; object-fit: cover; display: block; }
.call-self { position: absolute; inset-inline-end: .5rem; bottom: .5rem; width: 28%; max-width: 140px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; border: 2px solid rgba(255,255,255,.7); background: #222; }
.mirror { transform: scaleX(-1); }
.call-panel[data-state="waiting"] .call-remote { opacity: .15; }
/* Until the other person is there: a friendly overlay instead of a black box. */
.call-wait { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: .9rem; padding: 1rem 32% 1rem 1rem; text-align: center; color: #fff; background: radial-gradient(circle at 50% 40%, #1d3b4a, #0b1418); }
.call-panel:not([data-state="connected"]):not([data-state="ended"]) .call-wait { display: flex; }
.call-wait .w-conn { display: none; }
.call-panel:not([data-state="waiting"]) .call-wait .w-wait { display: none; }
.call-panel:not([data-state="waiting"]) .call-wait .w-conn { display: block; }
.call-wait .fun-line { font-size: 1rem; line-height: 1.4; max-width: 18rem; }
.call-self { z-index: 1; }
/* The status line is calm while waiting; only a live, recording call shows red. */
.call-panel .rec-on { color: var(--muted); }
/* The overlay already says what is going on before the call connects: no second line saying the same. */
.call-panel:not([data-state="connected"]):not([data-state="ended"]) .rec-on { visibility: hidden; }
.call-panel .rec-on .dot { background: var(--muted); animation: none; }
.call-panel[data-state="connected"] .rec-on { color: var(--ok, #3aa76d); }
.call-panel[data-state="connected"] .rec-on .dot { background: var(--danger); animation: blink 1s infinite; }
.call-panel[data-state="ended"] .call-stage { opacity: .4; }
.call-invite { margin-top: .6rem; }
.call-invite input { flex: 1 1 14rem; min-width: 0; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.off { text-decoration: line-through; }

/* Referral tree (views/referrals.js) */
.tree { font-size: .95rem; }
.tree-node > summary { cursor: pointer; padding: .2rem 0; }
.tree-kids { margin-inline-start: 1.1rem; padding-inline-start: .8rem; border-inline-start: 2px solid var(--line, #ddd); }
.tree-leaf { padding: .2rem 0; }
.role-pill { font-weight: 600; }

/* Interview quality, People, Home (views/qa-panel.js, interviews.js, people.js, home.js) */
.score { display: inline-block; min-width: 2.2em; text-align: center; font-weight: 700; padding: .1em .45em; border-radius: 999px; font-size: .9em; }
.score.good { background: color-mix(in srgb, #1e9e5a 18%, transparent); color: #1e9e5a; }
.score.ok { background: color-mix(in srgb, #c98a00 20%, transparent); color: #b07900; }
.score.bad { background: var(--danger-soft, #fde2e2); color: var(--danger, #c0392b); }
.chip.sev-high { border-color: var(--danger, #c0392b); color: var(--danger, #c0392b); }
.chip.sev-med { border-color: #c98a00; color: #b07900; }
.chip.asked-as-written { border-color: #1e9e5a; }
.chip.asked-rephrased { border-color: #888; }
.chip.asked-leading { border-color: #c98a00; color: #b07900; }
.chip.asked-not-asked { border-color: var(--danger, #c0392b); color: var(--danger, #c0392b); }
.qa-panel .ai-row { align-items: baseline; }
.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 1.2em; vertical-align: middle; }
.spark i { width: 4px; border-radius: 1px; background: #999; }
.spark i.good { background: #1e9e5a; } .spark i.ok { background: #c98a00; } .spark i.bad { background: var(--danger, #c0392b); }
tr.click, li.click, a.stat.click { cursor: pointer; }
tr.click:hover td { background: color-mix(in srgb, currentColor 5%, transparent); }
a.stat { text-decoration: none; color: inherit; }
td.warn { color: #b07900; font-weight: 600; }
.chips.tabs { margin-bottom: 1rem; }
.danger-zone { border-color: color-mix(in srgb, var(--danger, #c0392b) 40%, transparent); }

/* Camera/mic popups. */
.access-pop { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.access-pop .row { justify-content: center; }
.access-emoji { font-size: 2.6rem; animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-8deg); } 90% { transform: rotate(8deg); } 95% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .access-emoji { animation: none; } }

.update-bar { position: fixed; inset-inline: 1rem; bottom: 1rem; z-index: 50; display: flex; gap: .75rem; align-items: center; justify-content: space-between; padding: .7rem 1rem; border-radius: 12px; background: var(--accent, #2bb3a3); color: #fff; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.ver-tag { position: fixed; bottom: 4px; inset-inline-start: 6px; font-size: 10px; color: var(--muted); opacity: .6; pointer-events: none; z-index: 40; }

/* Place (governorate, then area) and ranking questions. */
.place { display: flex; flex-direction: column; gap: .7rem; }
.place select { width: 100%; }
.rank { display: flex; flex-direction: column; gap: .6rem; }
.rank-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .5rem .6rem; border: 1px solid var(--line, #2e3946); border-radius: 10px; }
.rank-nums { display: flex; gap: .35rem; flex-shrink: 0; }

/* Skip-logic rules in the survey builder. */
.rules { display: flex; flex-direction: column; gap: .5rem; margin-top: .4rem; }
.rule-body { display: flex; flex-direction: column; gap: .4rem; margin-inline-start: 1.6rem; padding: .5rem .7rem; border-inline-start: 3px solid var(--accent, #2bb3a3); }
.rule-opts { display: flex; flex-direction: column; gap: .15rem; }

/* Participant home: greeting, one obvious next survey, a quiet list, then the invite. */
.home { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; padding-top: 8px; }
.home-hello h1 { font-size: 2rem; line-height: 1.15; margin: 0 0 6px; letter-spacing: -.01em; }
.home-hello p { margin: 0; color: var(--text-2); font-size: 1.02rem; max-width: 40ch; }
.home-surveys { display: flex; flex-direction: column; gap: 22px; }
.next-survey { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border-strong); color: inherit; text-decoration: none; }
.next-survey:hover { border-color: var(--accent); }
.next-survey .kicker { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.next-title { font-size: 1.3rem; font-weight: 700; line-height: 1.3; }
.next-desc { color: var(--text-2); font-size: .95rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.next-survey .btn { margin-top: 6px; }
.all-done { padding: 18px 20px; border-radius: 14px; background: var(--surface-2); color: var(--text-2); margin: 0; }
.more-surveys h2, .invite h2 { font-size: 1rem; margin: 0 0 8px; }
.survey-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 2px; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.survey-line:last-child { border-bottom: 1px solid var(--border); }
.survey-line .go { font-size: .85rem; font-weight: 600; color: var(--accent); white-space: nowrap; }
.survey-line.done { color: var(--muted); }
.survey-line.done .go { color: var(--muted); }
.invite { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); }
.invite-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.invite-head p { margin: 0; font-size: .9rem; }
.ref-stat { display: flex; flex-direction: column; align-items: center; min-width: 76px; }
.ref-stat b { font-size: 2.2rem; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.ref-stat span { font-size: .72rem; color: var(--muted); text-align: center; }
.ref-field { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-strong); }
.ref-field code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; color: var(--text-2); }
.invite-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.invite-actions .btn.primary { flex: 1 1 100%; }
.invite .qr-box { display: grid; place-items: center; padding-top: 4px; }

/* ── Participant look (public surface) ── */
body[data-surface="public"] .btn.primary { background: var(--lime); color: var(--lime-ink); border-color: transparent; border-radius: 999px; font-weight: 700; filter: none; }
body[data-surface="public"] .btn.primary:hover { background: #CBEA45; }
body[data-surface="public"] .btn.lg { border-radius: 999px; }
body[data-surface="public"] .btn.ghost { border-radius: 999px; background: var(--surface); }
body[data-surface="public"] .card { border: none; box-shadow: var(--shadow); }
body[data-surface="public"] input, body[data-surface="public"] select, body[data-surface="public"] textarea { background: var(--surface); border-radius: 12px; }
body[data-surface="public"] .segmented { background: var(--surface-2); border-color: var(--border); }
body[data-surface="public"] .seg.on { background: var(--lime); color: var(--lime-ink); box-shadow: none; }
body[data-surface="public"] .steps .now { color: var(--accent); }
body[data-surface="public"] .steps .done .n { background: var(--accent); }
body[data-surface="public"] .choice { background: var(--surface); border-radius: 14px; }
body[data-surface="public"] .choice.on { border-color: var(--accent); background: var(--accent-soft); }
body[data-surface="public"] .scale-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }

body[data-surface="public"] .auth-wrap .auth { border-radius: 28px; padding: 34px 24px 22px; }
body[data-surface="public"] .auth-wrap .auth::before { display: none; }
body[data-surface="public"] .auth-icon { background: var(--accent); color: #fff; box-shadow: 0 0 0 10px var(--accent-soft); }
.auth-icon svg { width: 30px; height: 30px; }
body[data-surface="public"] .auth .phone-input { background: var(--surface); border-radius: 14px; }
body[data-surface="public"] .auth .phone-input .cc { background: var(--surface-2); }
body[data-surface="public"] .google-btn { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); border-radius: 999px; }

/* The code: six round boxes; the real input sits on top (so phones can autofill it from the text). */
.otp-boxes { position: relative; display: flex; justify-content: center; gap: 10px; direction: ltr; margin: 6px 0 4px; }
.otp-boxes .box { width: 46px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border-strong); font-variant-numeric: tabular-nums; }
.otp-boxes .box.filled { background: var(--surface); }
.otp-boxes .box.now { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.otp-boxes input.otp { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; letter-spacing: 0; caret-color: transparent; }

body[data-surface="public"] .next-survey { border: none; box-shadow: var(--shadow); border-radius: 24px; }
body[data-surface="public"] .next-survey .btn { align-self: stretch; }
body[data-surface="public"] .invite { background: var(--surface); border: none; box-shadow: var(--shadow); border-radius: 24px; }
body[data-surface="public"] .ref-field { background: var(--surface-2); border-color: var(--border); border-radius: 999px; padding-inline-start: 16px; }
body[data-surface="public"] .ref-field .btn { border-radius: 999px; }

/* Phone numbers and codes inside Arabic text keep their own left-to-right order (no stray + at the end). */
[dir="ltr"] { unicode-bidi: isolate; }

.invited-by { display: inline-block; margin: 0 0 10px; padding: 5px 14px; border-radius: 999px; font-size: .85rem; font-weight: 700; background: var(--accent-soft); color: var(--accent); }

/* ── Mobile-first, app-like participant screens ── */
html, body { overscroll-behavior: none; }
body[data-surface="public"] { overflow-x: hidden; }
body[data-surface="public"] .runner { touch-action: pan-y; }
@media (max-width: 640px) {
  body[data-surface="public"] .runner { min-height: calc(100dvh - 72px); display: flex; flex-direction: column; }
  body[data-surface="public"] .runner > .card:last-child { flex: 1; display: flex; flex-direction: column; margin-bottom: 0; }
  body[data-surface="public"] .runner .nav-row { margin-top: auto; }
}
body[data-surface="public"] .runner .nav-row { background: var(--surface); border-top: none; }

/* Pages slide in from where they come from (mirrored for Arabic). */
@keyframes inFwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes inBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.enter-fwd { animation: inFwd .28s cubic-bezier(.2,.7,.3,1); }
.enter-back { animation: inBack .28s cubic-bezier(.2,.7,.3,1); }
[dir="rtl"] .enter-fwd { animation-name: inBack; }
[dir="rtl"] .enter-back { animation-name: inFwd; }

/* Taps you can feel. */
.btn, .choice, .scale-btn, .seg, .survey-line, .next-survey { transition: transform .12s ease, background-color .15s, border-color .15s, box-shadow .15s; }
.btn:active, .scale-btn:active, .seg:active { transform: scale(.97); }
.choice:active, .next-survey:active { transform: scale(.985); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.025); } 100% { transform: scale(1); } }
.choice.on { animation: pop .24s ease; }
.progress > div { transition: width .45s cubic-bezier(.2,.7,.3,1); }

/* Thank-you check mark grows in. */
@keyframes checkIn { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
.big-check { animation: checkIn .5s cubic-bezier(.2,.8,.3,1.2); }

/* Slide to send. */
.nav-row.slide { align-items: center; }
.slide-submit { --fill: 0%; position: relative; flex: 1; height: 58px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); overflow: hidden; display: grid; place-items: center; user-select: none; -webkit-user-select: none; touch-action: none; }
.slide-submit::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--fill); background: var(--lime, var(--accent)); opacity: .55; }
.slide-label { position: relative; font-weight: 700; color: var(--text-2); letter-spacing: .01em; animation: shimmer 2.2s ease-in-out infinite; }
@keyframes shimmer { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.slide-knob { position: absolute; inset-block: 4px; inset-inline-start: 4px; width: 50px; border-radius: 999px; display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; background: var(--lime, var(--accent)); color: var(--lime-ink, #fff); cursor: grab; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
[dir="rtl"] .slide-knob { transform: scaleX(1); }
[dir="rtl"] .slide-knob { font-feature-settings: normal; }
.slide-knob.drag { cursor: grabbing; }
.slide-submit.done .slide-label { opacity: 0; }
.slide-submit.busy .slide-label { animation: none; opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .enter-fwd, .enter-back, .choice.on, .big-check, .slide-label { animation: none !important; }
  .btn, .choice, .scale-btn, .progress > div { transition: none !important; }
}

/* Sign-up illustration: two bubbles drift gently; the dots in the first one "type". */
.talk-art { display: flex; justify-content: center; margin: -6px 0 14px; }
.talk-art .b1 { animation: drift 4s ease-in-out infinite; }
.talk-art .b2 { animation: drift 4s ease-in-out -2s infinite; }
@keyframes drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.talk-art .d { animation: typing 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.talk-art .d2 { animation-delay: .15s; } .talk-art .d3 { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { opacity: .45; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .talk-art .b1, .talk-art .b2, .talk-art .d { animation: none; } }

/* Staff screens: lime for the main action, like the participant side. */
body[data-surface="internal"] .btn.primary { background: var(--lime); color: var(--lime-ink); border-color: transparent; }
body[data-surface="internal"] .card { border-color: var(--border); }

/* Ranking by tapping in order. */
.rank-row { width: 100%; font: inherit; color: inherit; text-align: start; cursor: pointer; justify-content: flex-start; background: var(--surface); }
.rank-row .rank-n { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; font-weight: 700; }
.rank-row.on { border-color: var(--accent); background: var(--accent-soft); }
.rank-row.on .rank-n { background: var(--accent); border-color: var(--accent); color: #fff; animation: pop .24s ease; }
