/* Participant client. Tokens and layout ported from the approved mock-up (v5). Fonts: system stack (no third-party font requests). */
:root {
  --bg: #f3effd; --surface: #ffffff; --surface2: #ede8fb; --fg: #1d1640; --muted: #6b6490; --line: #ddd5f5;
  --violet: #7c3aed; --pink: #ec4899; --orange: #fb923c; --teal: #0f8f80; --amber: #f59e0b; --red: #dc2626; --blue: #2563eb;
  --accent-text: #6d28d9; --focus: #5b21b6; --warn-text: #b45309;
  --grad: linear-gradient(120deg, #7c3aed 0%, #ec4899 55%, #fb923c 100%);
  --grad-ok: linear-gradient(120deg, #12b5a2, #4ade80);
  --n1: linear-gradient(135deg, #3b82f6, #7c3aed);
  --n2: linear-gradient(135deg, #7c3aed, #ec4899);
  --n3: linear-gradient(135deg, #ec4899, #fb923c);
  --lock: linear-gradient(135deg, #f59e0b, #ec4899);
  --nextbox: linear-gradient(120deg, rgba(59, 130, 246, .14), rgba(124, 58, 237, .14));
  --on-grad: #ffffff; --shadow: 0 18px 50px rgba(88, 40, 180, .18);
  --help-bg: rgba(239, 68, 68, .1); --help-line: rgba(239, 68, 68, .35);
  --amber-bg: rgba(245, 158, 11, .14); --amber-line: rgba(245, 158, 11, .45);
  --f-display: 'Bricolage Grotesque', 'Trebuchet MS', system-ui, sans-serif;
  --f-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #120d28; --surface: #1c1540; --surface2: #271e57; --fg: #f1ecff; --muted: #a79fd0; --line: #34296b;
    --shadow: 0 18px 50px rgba(0, 0, 0, .5); --accent-text: #b79bff; --focus: #c4b5fd; --warn-text: #fbbf24;
    --teal: #2dd4bf; --red: #f87171; --blue: #60a5fa;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 15px; line-height: 1.45;
  padding-block: 14px 28px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, select:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
.stage { display: flex; justify-content: center; }
.phone {
  width: 100%; max-width: 400px; min-height: min(760px, calc(100dvh - 42px)); background: var(--surface); border-radius: 34px;
  box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; position: relative; display: flex; flex-direction: column;
}
.scr { padding: 20px 20px 26px; display: flex; flex-direction: column; gap: 16px; flex: 1; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.noscript { text-align: center; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.logo { font: 800 17px var(--f-display); letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.logo span { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); display: grid; place-items: center; color: #fff; }
.lang { display: flex; background: var(--surface2); border-radius: 999px; padding: 3px; }
.lang button { border: 0; background: none; border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 700; color: var(--muted); }
.lang button.on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
h1 { font: 800 28px/1.08 var(--f-display); letter-spacing: -.02em; margin: 4px 0 0; text-wrap: balance; }
h2 { font: 700 20px/1.15 var(--f-display); margin: 0; }
h3 { margin: 0; font: 700 18px var(--f-display); }
.h1-s { font-size: 27px; }
.lockc + .center h1 { font-size: 26px; }
p { margin: 0; }
.hint { font-size: 13px; color: var(--muted); }
.hint.lead { margin-top: 8px; font-size: 14.5px; }
.hint.tight2 { margin: 4px 0 10px; }
.hint.tight3 { margin-top: 4px; }
.hint.greet, .greet { font-weight: 700; color: var(--accent-text); margin: 0; }
.center { text-align: center; }
.grow { flex: 1; }
.grow-c { padding-block: 40px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
select { font: inherit; color: var(--fg); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; width: 100%; }
select:disabled { opacity: .6; }
.btn {
  border: 0; border-radius: 16px; padding: 15px 18px; font-weight: 700; font-size: 16px; background: var(--grad); color: var(--on-grad);
  box-shadow: 0 8px 20px rgba(236, 72, 153, .28); display: flex; justify-content: center; align-items: center; gap: 9px; width: 100%;
}
.btn[disabled] { background: var(--surface2); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.btn.ghost { background: var(--surface2); color: var(--fg); box-shadow: none; }
.btn.sm { width: auto; padding: 9px 14px; font-size: 14px; border-radius: 12px; }
.btn.fixed { flex: none; }
.btn.grow1 { flex: 1; }
.btn.grow13 { flex: 1.3; }
.ghostrow { display: flex; gap: 8px; }
.stopbtn { background: none; border: 0; color: var(--muted); font-weight: 700; padding: 8px; display: flex; gap: 7px; align-items: center; justify-content: center; width: 100%; }
.stopbtn.danger { color: var(--red); font-weight: 600; font-size: 13.5px; }
.stopbtn.confirm { background: var(--red); color: #fff; border-radius: 12px; font-weight: 700; }
.delrow { display: flex; flex-direction: column; align-items: center; }
.lvl { display: flex; flex-direction: column; gap: 11px; }
.card {
  border: 2px solid var(--line); border-radius: 18px; padding: 15px; background: var(--bg); display: flex; gap: 14px; align-items: center;
  text-align: left; width: 100%; position: relative; overflow: hidden; transition: transform .15s;
}
.card:active { transform: scale(.985); }
.card.on { background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--grad) border-box; border: 2px solid transparent; }
.card .num { flex: none; width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; font: 800 22px var(--f-display); color: #fff; }
.num.n1 { background: var(--n1); } .num.n2 { background: var(--n2); } .num.n3 { background: var(--n3); }
.card small { color: var(--muted); font-size: 13px; display: block; }
.tag { position: absolute; right: 0; top: 0; background: var(--grad); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-bottom-left-radius: 12px; }
.ring5 {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font: 800 18px var(--f-display);
  background: conic-gradient(var(--violet) calc(var(--p, 0) * 1%), var(--surface2) 0); position: relative;
}
.ring5 b { width: 36px; height: 36px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; }
.ring5.big { width: 132px; height: 132px; margin: 8px auto 14px; font-size: 34px; }
.ring5.big b { width: 106px; height: 106px; }
.ring5.big small { font-size: 14px; color: var(--muted); font-weight: 700; }
.ring5.mid { width: 84px; height: 84px; font-size: 30px; margin: 0 auto 8px; }
.ring5.mid b { width: 68px; height: 68px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; gap: 10px; align-items: center; background: var(--bg); border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 12px; }
.li .n { font: 800 14px var(--f-display); color: var(--accent-text); min-width: 30px; }
.li .n.wide { min-width: 62px; }
.li div { flex: 1; min-width: 0; font-size: 14px; }
.li small { display: block; color: var(--muted); }
.mini { border: 1.5px solid var(--line); background: var(--bg); border-radius: 10px; padding: 5px 10px; font-size: 12.5px; font-weight: 600; }
.bar { height: 12px; background: var(--surface2); border-radius: 999px; overflow: hidden; position: relative; }
.bar.thin { height: 8px; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .6s cubic-bezier(.3, 1.4, .5, 1); position: relative; }
.bar-l { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.saved { background: var(--surface2); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.saved > div { display: flex; gap: 9px; align-items: flex-start; }
.tick { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--grad-ok); color: #fff; animation: pop .4s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes pop { from { transform: scale(0); } }
.tag-r, .st { white-space: nowrap; font-size: 11.5px; font-weight: 700; border-radius: 8px; padding: 2px 8px; }
.tag-r { background: var(--amber-bg); color: var(--warn-text); }
.st { font-size: 12px; border-radius: 999px; padding: 3px 10px; }
.st.a { background: rgba(18, 181, 162, .16); color: var(--teal); }
.st.e { background: var(--surface2); color: var(--muted); }
.big-ok {
  width: 92px; height: 92px; border-radius: 50%; background: var(--grad); background-size: 200% 200%; display: grid; place-items: center; color: #fff; margin: 6px auto 0;
  animation: pop .6s cubic-bezier(.3, 1.7, .5, 1), drift 6s infinite; box-shadow: 0 12px 32px rgba(236, 72, 153, .4);
}
@keyframes drift { 0%, 100% { background-position: 0 50%; } 50% { background-position: 100% 50%; } }
.lockc { width: 92px; height: 92px; border-radius: 50%; background: var(--lock); display: grid; place-items: center; color: #fff; margin: 6px auto 0; box-shadow: 0 12px 32px rgba(245, 158, 11, .35); }
/* microphone test */
.mictest { display: flex; align-items: center; gap: 12px; background: var(--surface2); padding: 12px 14px; border-radius: 14px; }
.sysbox { background: var(--bg); border: 1.5px solid var(--line); border-radius: 18px; padding: 18px 16px; text-align: center; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
.sysbox .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sysbox .row .btn { justify-content: center; }
.sysicon { color: var(--accent-text); display: grid; place-items: center; }
.help { background: var(--help-bg); border: 1.5px solid var(--help-line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.help.amber { background: var(--amber-bg); border-color: var(--amber-line); }
.help ul, .help ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.help b.t { font: 700 16px var(--f-display); display: flex; align-items: center; gap: 6px; }
.playbars { display: flex; gap: 4px; align-items: center; height: 34px; justify-content: center; }
.playbars i { width: 5px; height: 100%; border-radius: 3px; background: var(--grad); }
.playbars.idle i { transform: scaleY(.45); }
.playbars.idle.go i { animation: eq .9s ease-in-out infinite; }
.playbars.idle.go i:nth-child(2n) { animation-delay: .2s; }
.playbars.idle.go i:nth-child(3n) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
.meterbox { display: flex; align-items: center; gap: 12px; }
.meter { flex: 1; display: flex; gap: 3px; align-items: flex-end; height: 38px; }
.meter i { flex: 1; height: 100%; border-radius: 4px; background: var(--surface2); transform-origin: bottom; transition: background .08s, transform .08s; transform: scaleY(.35); }
.meter i.l.on { background: var(--blue); transform: scaleY(.55); }
.meter i.g.on { background: var(--teal); transform: scaleY(.85); }
.meter i.h.on { background: var(--amber); transform: scaleY(.95); }
.meter i.c.on { background: var(--red); transform: scaleY(1); }
.mlab { font-size: 12.5px; font-weight: 700; min-width: 84px; text-align: right; color: var(--muted); }
.mlab.m-quiet { color: var(--blue); } .mlab.m-good { color: var(--teal); } .mlab.m-high { color: var(--warn-text); } .mlab.m-clip, .mlab.m-none { color: var(--red); }
/* recording screen (AMAB-560) */
.rtop { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mic { width: 36px; height: 36px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; color: #fff; flex: none; position: relative; }
.mic::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--pink); animation: ring 1.8s infinite; }
.mic.calm::after { animation: none; border-color: var(--line); }
@keyframes ring { from { transform: scale(.85); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
.sent { min-height: 180px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.cur { font: 700 27px/1.2 var(--f-display); letter-spacing: -.015em; margin: 0; animation: slide .45s cubic-bezier(.2, .9, .3, 1); }
.cur.pause { font-size: 25px; }
@keyframes slide { from { opacity: 0; transform: translateX(34px); } to { opacity: 1; transform: none; } }
.dots span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--violet); margin-right: 4px; animation: bounce 1s infinite; }
.dots span:nth-child(2) { animation-delay: .15s; } .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 50% { transform: translateY(-6px); opacity: .4; } }
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg);
  padding: 11px 18px; border-radius: 14px; font-weight: 600; font-size: 14px; z-index: 20; max-width: 90vw; animation: fade .25s;
}
@media (max-width: 520px) { .phone { border-radius: 24px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* recording screen: status, queue chip, offline banner, pause and playback sheets, reading language */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 700; background: var(--surface2); color: var(--fg); }
.pill.ok { background: rgba(18, 181, 162, .16); color: var(--teal); }
.pill.warn { background: var(--amber-bg); color: var(--warn-text); }
.pill.up { background: var(--grad); color: #fff; background-size: 200%; animation: drift 1.2s linear infinite; }
.pill.bad { background: rgba(220, 38, 38, .14); color: var(--red); }
.banner { display: flex; gap: 10px; align-items: flex-start; background: var(--amber-bg); border-radius: 14px; padding: 11px 13px; font-size: 13.5px; font-weight: 600; }
.banner svg { flex: none; margin-top: 1px; }
.status { min-height: 34px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.status.warn { color: var(--warn-text); }
.status.ok { color: var(--teal); }
.meterbox { display: flex; align-items: center; gap: 12px; }
.again { border: 2px solid var(--line); border-radius: 20px; padding: 18px; font: 700 19px var(--f-display); background: var(--surface2); color: var(--fg); display: flex; gap: 10px; justify-content: center; align-items: center; width: 100%; }
.again:active { background: var(--line); }
.hintrot { font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: center; min-height: 20px; }
.nextbox { background: linear-gradient(120deg, rgba(59, 130, 246, .14), rgba(124, 58, 237, .14)); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.nextbox .nrow { display: flex; gap: 12px; align-items: center; }
.sheet { position: absolute; inset: 0; background: rgba(18, 13, 40, .55); display: flex; align-items: flex-end; z-index: 4; animation: fade .25s; }
.sheet > div { background: var(--surface); width: 100%; border-radius: 26px 26px 0 0; padding: 24px 20px 26px; display: flex; flex-direction: column; gap: 14px; }
.sheet h2 { margin: 0; font: 800 20px var(--f-display); }
.sheet p { margin: 0; }
.btn.danger { color: var(--red); }
.speech { display: flex; flex-direction: column; gap: 8px; }
.speech b { font-size: 13px; color: var(--muted); }
.speech .seg { display: flex; background: var(--surface2); border-radius: 14px; padding: 4px; gap: 4px; }
.speech .seg button { flex: 1; border: 0; background: none; border-radius: 11px; padding: 11px 8px; font-weight: 700; font-size: 15px; color: var(--muted); }
.speech .seg button.on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.speech small { color: var(--muted); font-size: 12.5px; }
.rtop .lang button { font-size: 11px; padding: 4px 9px; }
.scr.rec { gap: 14px; }
.ghostrow.mt { margin-top: 10px; }
