@import url("/fonts/fonts.css");

/* Tokens — mirror of the Tıldesu design system (tokens.json) */
:root {
  --surface: #FFFFFF;
  --surface-sunk: #F6F3F0;
  --line: #E8E2DC;
  --ink: #1F1A16;
  --ink-muted: #6E645C;
  --primary: #C9441C;
  --on-primary: #FFFFFF;
  --primary-soft: #FFE7DC;
  --brand-night: #2E1660;
  --sun: #FFC23D;
  --on-sun: #1F1A16;
  --sage: #2B7656;
  --live: #13843F;      /* "someone is waiting" pill: white text 5:1 */
  --on-live: #FFFFFF;
  --danger: #B3261E;
  --on-danger: #FFFFFF;
  --focus-ring: var(--ink);
  --shadow-card: 0 1px 2px rgba(31,26,22,.06), 0 6px 20px rgba(31,26,22,.06);
  --shadow-dice: 0 5px 0 #C8901A;

  --font-display: "Geologica", system-ui, sans-serif;
  --font-text: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --radius-sm: 10px; --radius-md: 14px; --radius-lg: 20px; --radius-tail: 6px;
  --radius-xl: 28px; --radius-full: 999px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #141110;
    --surface-sunk: #1F1A17;
    --line: #332B26;
    --ink: #F5EFE9;
    --ink-muted: #A89C92;
    --primary: #FF7A4F;
    --on-primary: #2A0E04;
    --primary-soft: #3A2218;
    --brand-night: #4A2A8C;
    --sun: #FFC94F;
    --on-sun: #141110;
    --sage: #5CC795;
    --live: #3FD47F;
    --on-live: #06210F;
    --danger: #FF6B5E;
    --on-danger: #2A0705;
    --shadow-card: none;
    --shadow-dice: 0 5px 0 #9A6C12;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--surface);
  color: var(--ink);
  font: 400 16px/24px var(--font-text);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

.ico { width: 24px; height: 24px; flex: none; display: inline-block; vertical-align: middle;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 18px; height: 18px; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: max(12px, env(safe-area-inset-top)) var(--space-4) 12px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; height: 32px; }
.brand img { height: 32px; width: auto; display: block; }
.topbar-actions { display: flex; gap: var(--space-2); }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-full); padding: 6px 12px; font: 600 13px/18px var(--font-text);
  text-decoration: none; cursor: pointer;
}

main { max-width: 480px; margin: 0 auto; padding: var(--space-2) var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom)); }
.screen { display: flex; flex-direction: column; gap: var(--space-4); animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1 { font: 800 40px/44px var(--font-display); letter-spacing: -.01em; margin: var(--space-5) 0 0; text-wrap: balance; }
h2 { font: 800 30px/34px var(--font-display); margin: var(--space-1) 0 0; text-wrap: balance; }
.lead { font-size: 17px; line-height: 25px; color: var(--ink-muted); margin: 0; }
.muted { color: var(--ink-muted); margin: 0; }
.small { font-size: 13px; line-height: 18px; }
.center { text-align: center; }
.step { margin: var(--space-2) 0 0; font: 700 12px/16px var(--font-text); color: var(--primary); text-transform: uppercase; letter-spacing: .06em; }
.label { margin: 0 0 var(--space-3); font: 600 14px/20px var(--font-text); }
.hero-mark { width: 72px; height: 72px; margin-top: var(--space-5); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4); }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font: 600 14px/20px var(--font-text); }
.form small { color: var(--ink-muted); font-weight: 400; }
input, textarea {
  font: 400 16px/24px var(--font-text); color: var(--ink); background: var(--surface-sunk);
  border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.form label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--primary); }
.form label.check.consent { align-items: flex-start; font-size: 14px; line-height: 20px; }
.error { color: var(--danger); margin: 0; min-height: 1em; font-size: 14px; }
.ok { color: var(--sage); }

.tabs { display: flex; background: var(--surface-sunk); border-radius: var(--radius-md); padding: 4px; }
.tab { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: var(--radius-sm); font: 700 15px/20px var(--font-text); color: var(--ink-muted); cursor: pointer; }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; border: 0; border-radius: var(--radius-md); padding: 0 var(--space-5);
  font: 600 16px/24px var(--font-text); cursor: pointer; transition: transform .08s ease, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.danger { background: var(--danger); color: var(--on-danger); }
.btn.big { min-height: 64px; border-radius: var(--radius-xl); font: 800 20px/24px var(--font-display); }
.btn.big .ico { width: 26px; height: 26px; }
.btn.on { background: var(--ink); color: var(--surface); }
.link { background: none; border: 0; color: var(--primary); font: 600 15px/20px var(--font-text); cursor: pointer; padding: 4px; }
.center-block { display: block; margin: 0 auto; }
.danger-text { color: var(--danger); }

.seg { display: flex; gap: var(--space-2); }
.seg button, .seg label {
  position: relative; flex: 1; text-align: center; border: 1px solid var(--line); background: var(--surface-sunk);
  border-radius: var(--radius-sm); padding: 12px 6px; font: 700 15px/20px var(--font-text); cursor: pointer; color: var(--ink);
}
.seg button.on, .seg button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
#durationSeg button { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.seg-wait { display: inline-flex; align-items: center; gap: 5px; margin-top: 2px; padding: 2px 9px 2px 7px; border-radius: var(--radius-full);
  background: var(--live); color: var(--on-live); font: 700 12px/16px var(--font-text); }
.seg-wait::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: live-pulse 1.6s ease-in-out infinite; }
.seg button.on .seg-wait { box-shadow: 0 0 0 2px var(--on-primary); }
@keyframes live-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .seg-wait::before { animation: none; } }
.wait-banner { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; cursor: pointer; text-align: left;
  border-radius: var(--radius-lg); background: var(--live); color: var(--on-live); font: inherit; animation: pop .3s ease; }
.unlock-banner { background: var(--sun); color: var(--on-sun); margin-bottom: 4px; }
.unlock-banner .wait-go { background: var(--on-sun); color: var(--sun); }
.unlock-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; }
.unlock-icon .ico { width: 26px; height: 26px; }
.wait-banner:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.wait-pulse { position: relative; width: 12px; height: 12px; flex: none; border-radius: 50%; background: currentColor; }
.wait-pulse::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid currentColor; animation: wait-ring 1.6s ease-out infinite; }
@keyframes wait-ring { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
.wait-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wait-text b { font: 700 15px/20px var(--font-text); }
.wait-text .small { opacity: .85; }
.wait-go { flex: none; padding: 8px 14px; border-radius: var(--radius-full); background: var(--on-live); color: var(--live); font: 700 14px/18px var(--font-text); }
@media (prefers-reduced-motion: reduce) { .wait-pulse::after, .wait-banner { animation: none; } }
.presence { display: flex; align-items: center; gap: 8px; margin: 0; font: 500 14px/20px var(--font-text); color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.presence b { color: var(--ink); font-weight: 700; }
.presence .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 22%, transparent); }
.presence.invite .dot { background: var(--primary); box-shadow: none; }
.presence-invite { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 600 14px/20px var(--font-text); color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.presence-invite:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }
.share-sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(20, 17, 16, .45); padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.share-card { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: var(--space-2);
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-5) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow-card); }
.share-card a.btn { text-decoration: none; justify-content: center; }
.share-wa { background: #1F8F4E; color: #FFFFFF; border-color: #1F8F4E; }
.share-tg { background: #1E88D3; color: #FFFFFF; border-color: #1E88D3; }
.seg.four label { padding: 10px 4px; font-size: 14px; }
.seg label input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
fieldset.q { margin: 0; }
fieldset.q legend { font: 700 16px/22px var(--font-text); padding: 0; margin-bottom: var(--space-3); float: left; width: 100%; }
fieldset.q legend small { display: block; font-weight: 400; color: var(--ink-muted); font-size: 13px; }
fieldset.q .seg { clear: both; }

.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.topic {
  display: flex; align-items: center; gap: var(--space-3); text-align: left;
  background: var(--surface-sunk); border: 2px solid transparent; border-radius: var(--radius-lg);
  padding: 14px 12px; font: 600 15px/20px var(--font-text); color: var(--ink); cursor: pointer;
}
.topic.on { border-color: var(--primary); background: var(--primary-soft); }

.hello { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-2); }
.hello h2 { font-size: 24px; line-height: 30px; }
.level { display: inline-flex; align-items: center; gap: var(--space-2); padding: 4px 12px 4px 4px; border-radius: var(--radius-full); background: var(--surface-sunk); font: 700 13px/18px var(--font-text); white-space: nowrap; }
.level img { width: 28px; height: 28px; display: block; }
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft); border-radius: var(--radius-full); padding: 6px 12px; font: 600 14px/20px var(--font-text); }
.row-between { display: flex; align-items: baseline; justify-content: space-between; }
.row-between .label { margin: 0 0 var(--space-3); }

/* Searching */
.pulse { position: relative; width: 140px; height: 140px; margin: var(--space-7) auto var(--space-2); }
.pulse span { position: absolute; inset: 0; border-radius: 50%; background: var(--primary); opacity: .22; animation: ripple 2.4s infinite ease-out; }
.pulse span:nth-child(2) { animation-delay: .8s; }
.pulse span:nth-child(3) { animation-delay: 1.6s; }
.pulse img { position: absolute; inset: 38px; width: 64px; height: 64px; border-radius: 16px; }
@keyframes ripple { from { transform: scale(.45); opacity: .5; } to { transform: scale(1.2); opacity: 0; } }

/* Call */
.call-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-2); }
.partner { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font: 800 22px/1 var(--font-display); flex: none; }
.partner-name { font: 800 20px/26px var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.partner-meta { display: flex; align-items: center; gap: 6px; }
.partner-meta img { width: 18px; height: 18px; }
.timer { font: 800 28px/32px var(--font-display); font-variant-numeric: tabular-nums; }
.timer.ending { color: var(--danger); }
.status { margin: 0; color: var(--ink-muted); font-size: 14px; }

.voices { display: flex; gap: 10px; }
.voice { flex: 1; display: flex; align-items: center; gap: var(--space-2); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--radius-md); padding: 10px 12px; font: 600 14px/20px var(--font-text); }
.voice .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); transition: background .1s, box-shadow .1s; }
.voice.talking .dot { background: var(--sage); box-shadow: 0 0 0 5px color-mix(in srgb, var(--sage) 25%, transparent); }

.prompt { border: 2px solid var(--sun); border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-tail); box-shadow: var(--shadow-card); }
.prompt.pop { animation: pop .3s ease; }
@keyframes pop { 0% { transform: scale(.94); opacity: 0; } 100% { transform: none; opacity: 1; } }
.prompt-topic { display: flex; align-items: center; gap: 6px; font: 700 12px/16px var(--font-text); color: var(--ink-muted); text-transform: uppercase; letter-spacing: .06em; }
.prompt-topic .ico { width: 16px; height: 16px; }
.prompt-kz { font: 700 22px/28px var(--font-display); margin: var(--space-2) 0 var(--space-1); }
.prompt-ru { margin: var(--space-1) 0 0; color: var(--ink-muted); font-size: 13px; line-height: 18px; }

.dice-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); margin-top: var(--space-1); }
.dice { width: 88px; height: 88px; border-radius: var(--radius-xl); border: 0; cursor: pointer; background: var(--sun); color: var(--on-sun); box-shadow: var(--shadow-dice); display: grid; place-items: center; transition: transform .1s; }
.dice .ico { width: 40px; height: 40px; }
.dice:active { transform: translateY(3px); box-shadow: 0 2px 0 #C8901A; }
.dice:disabled { opacity: .7; cursor: default; }
.dice.rolling { animation: roll .5s infinite linear; opacity: 1; }
@keyframes roll { 0% { transform: rotate(0) scale(1); } 25% { transform: rotate(90deg) scale(.92); } 50% { transform: rotate(180deg) scale(1.05); } 75% { transform: rotate(270deg) scale(.95); } 100% { transform: rotate(360deg) scale(1); } }

.call-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: var(--space-2); }

/* After call */
.vote { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.vote-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px; border-radius: 16px;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.vote-btn .ico { width: 32px; height: 32px; }
.vote-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
#likeBtn[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
#dislikeBtn[aria-pressed="true"] { border-color: var(--ink-muted); background: var(--surface-sunk); }
#screen-after h2 { margin-top: var(--space-6); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--surface); padding: 12px 16px; border-radius: var(--radius-md); font-weight: 600;
  max-width: calc(100% - 32px); z-index: 10; text-align: center;
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.call-actions .btn { padding: 0 var(--space-3); white-space: nowrap; font-size: 15px; }
.tg-card { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.tg-login-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; background: #2AABEE; color: #FFFFFF; text-decoration: none; font-weight: 700; }
.tg-login-btn .ico { width: 22px; height: 22px; }

/* Home: level + ұпай */
.hello { flex-wrap: wrap; row-gap: var(--space-2); }
.me-chips { display: flex; align-items: center; gap: var(--space-2); flex-wrap: nowrap; }
.upai-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px 6px 8px; border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--sun) 28%, var(--surface)); color: var(--ink); font: 700 13px/18px var(--font-text); font-variant-numeric: tabular-nums; }
.upai-chip .ico { color: #B97800; }

/* Level choice at sign-up */
.level-choices { display: flex; flex-direction: column; gap: var(--space-2); }
.level-choice { display: flex; align-items: center; gap: var(--space-3); width: 100%; text-align: left; padding: 14px 16px;
  border: 2px solid var(--line); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); cursor: pointer;
  font: 600 16px/22px var(--font-text); }
.level-choice img { width: 40px; height: 40px; flex: none; }
.level-choice small { display: block; color: var(--ink-muted); font-weight: 500; font-size: 13px; line-height: 18px; }
.level-choice[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); }
.level-choice:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* After call */
.after-extra { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); }
.seg.three button { padding: 10px 4px; font-size: 14px; }
.toggle-row { display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-sunk); color: var(--ink); font: 600 15px/20px var(--font-text); cursor: pointer; text-align: left; }
.toggle-row span { flex: 1; }
.toggle-row .check { opacity: 0; color: var(--primary); }
.toggle-row[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); }
.toggle-row[aria-pressed="true"] .check { opacity: 1; }
.after-links { display: flex; justify-content: center; align-items: center; gap: var(--space-5); flex-wrap: wrap; }

/* Personal invites */
/* Text on the left, button on the right at any width; long lines wrap inside the text column */
.invite-card { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.invite-text { min-width: 0; flex: 1 1 0; overflow-wrap: anywhere; }
.invite-text .label { margin-bottom: 2px; }
.invite-text p { margin: 0; }
.invite-card .btn { width: auto; flex: none; padding: 0 var(--space-4); font-size: 15px; white-space: nowrap; }
.invited-banner { margin: 0 0 var(--space-3); padding: 10px 14px; border-radius: var(--radius-md); background: var(--primary-soft);
  font: 600 15px/21px var(--font-text); text-align: center; }

/* Donations */
.support-card { display: flex; flex-direction: column; gap: var(--space-2); }
.support-card p { margin: 0; }
.support-uses { margin: 0; padding-left: 20px; display: grid; gap: 2px; color: var(--ink); }
.support-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-2); }
.support-actions .btn { text-decoration: none; justify-content: center; }
.supporter-chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius-full);
  background: var(--brand-night); color: #FFFFFF; font: 700 12px/16px var(--font-text); white-space: nowrap; }
.partner-meta .supporter-chip { margin-left: 6px; }

/* Speech balance */
.balance { display: flex; flex-direction: column; gap: 4px; }
.balance-bar { display: flex; height: 8px; border-radius: var(--radius-full); overflow: hidden; background: var(--surface-sunk); }
.balance-bar i { display: block; height: 100%; transition: width .6s; }
#balanceMe { background: var(--primary); }
#balanceThem { background: var(--sage); }
.balance-legend { display: flex; justify-content: space-between; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.balance-hint { margin: 0; padding: 10px 14px; border-radius: var(--radius-md); background: color-mix(in srgb, var(--sun) 30%, var(--surface));
  font: 600 14px/20px var(--font-text); text-align: center; }
.prompt-who { margin: 2px 0 0; font: 700 13px/18px var(--font-text); color: var(--primary); }
@media (prefers-reduced-motion: reduce) { .balance-bar i { transition: none; } }

/* Rules & privacy pages */
.legal-main { max-width: 680px; }
.legal-main h1 { font: 700 28px/34px var(--font-display); margin: var(--space-4) 0 var(--space-2); text-wrap: balance; }
.legal-main h2 { font: 700 18px/24px var(--font-display); margin: var(--space-5) 0 var(--space-2); }
.legal-main p, .legal-main li { font: 400 16px/25px var(--font-text); max-width: 65ch; }
.legal-main ul { padding-left: 20px; margin: 0; display: grid; gap: 6px; }
.legal-main a { color: var(--primary); }
.legal-langs .chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.consent a, .legal-links a { color: var(--primary); }
.legal-links { display: flex; justify-content: center; gap: var(--space-4); margin: var(--space-2) 0 0; }

/* «Подскажи»: hold to speak Russian, get Kazakh variants (only you see them) */
.hint-wrap { display: flex; flex-direction: column; gap: var(--space-2); }
.hint-tip { margin: 0; padding: 8px 12px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--ink);
  font: 600 13px/18px var(--font-text); text-align: center; text-wrap: balance; }
.hint-btn { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: 12px 16px; border-radius: var(--radius-md);
  border: 2px dashed var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-align: left;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.hint-btn .ico { width: 28px; height: 28px; color: var(--primary); flex: none; }
.hint-text { display: flex; flex-direction: column; }
.hint-text b { font: 700 16px/22px var(--font-text); }
.hint-text small { font: 500 13px/18px var(--font-text); color: var(--ink-muted); }
.hint-btn.listening { border-style: solid; border-color: var(--primary); background: var(--primary-soft); }
.hint-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.hint-form { display: flex; gap: var(--space-2); }
.hint-form input { flex: 1; min-width: 0; }
.hint-form .btn { width: auto; flex: none; }
.hint-card { border-radius: var(--radius-md); background: var(--surface-sunk); padding: 12px 14px; }
.hint-card p { margin: 0 0 6px; }
.hint-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.hint-list b { font: 700 17px/23px var(--font-text); }
.hint-list span { display: block; font: 500 13px/18px var(--font-text); color: var(--ink-muted); }

/* Search screen: headphones tip */
.headphones-tip { display: flex; align-items: center; gap: var(--space-3); margin: 0; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--surface-sunk); font: 600 14px/20px var(--font-text); }
.headphones-tip .ico { width: 28px; height: 28px; flex: none; color: var(--primary); }

/* Сұхбаттастар */
.pals-card { display: flex; flex-direction: column; gap: var(--space-3); }
.pals-title { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.pals-title .ico { color: var(--primary); }
.pals-card p { margin: 0; }
.btn.sm { min-height: 40px; padding: 0 var(--space-3); font-size: 14px; border-radius: var(--radius-sm); width: auto; }
.btn.icon-btn { width: 44px; min-width: 44px; padding: 0; flex: none; }
.btn.icon-btn .ico { width: 22px; height: 22px; }
.avatar.sm { width: 40px; height: 40px; font-size: 17px; position: relative; }
.avatar.is-online::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--live); box-shadow: 0 0 0 2px var(--surface); }
.pal-list, .history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.pal-row, .history-row { display: flex; align-items: center; gap: var(--space-3); }
.history-row { padding: 8px 0; border-top: 1px solid var(--line); }
.pal-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pal-info b { font: 700 16px/22px var(--font-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-status.online { color: var(--sage); font-weight: 600; }
.pal-status.busy { color: var(--primary); font-weight: 600; }
.pal-chip { display: inline-flex; align-items: center; gap: 4px; flex: none; max-width: 52%; white-space: normal; text-align: left; }
.pal-chip[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.history-row .ok { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.history-toggle { align-self: flex-start; padding: 4px 0; text-align: left; }
.meetings { display: flex; flex-direction: column; gap: var(--space-2); }
.meetings:empty { display: none; }
/* Incoming «add me» request: a soft violet tint so it stands apart from the orange screen */
.req-card { background: #EEE9F8; border-color: #DCD3F0; }
.req-card .pals-title .ico { color: #5B3FA8; }
.req-card .meetings { display: flex; flex-direction: column; gap: var(--space-3); margin-top: 12px; }
.pal-req { display: grid; grid-template-columns: 40px 1fr; align-items: center; column-gap: 10px; row-gap: 10px; }
.pal-req-info { min-width: 0; }
.pal-req-text { margin: 0; font: 600 14px/20px var(--font-text); }
.pal-req-level { margin: 0; font: 500 13px/18px var(--font-text); color: var(--ink-muted); }
.pal-req-actions { grid-column: 1 / -1; display: flex; gap: var(--space-2); }
.pal-req-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .req-card { background: #241D33; border-color: #352A4A; }
  :root:not([data-theme="light"]) .req-card .pals-title .ico { color: #B9A4F0; }
}
:root[data-theme="dark"] .req-card { background: #241D33; border-color: #352A4A; }
:root[data-theme="dark"] .req-card .pals-title .ico { color: #B9A4F0; }
.meeting { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-sunk); }
.meeting.incoming { background: var(--primary-soft); }
.meeting.accepted { box-shadow: inset 0 0 0 2px var(--sage); }
.meet-card .meetings { margin-top: 12px; }
.meeting-when, .meeting-who { margin: 0; }
.meeting { gap: 8px; }
.meet-cal { display: flex; flex-wrap: wrap; gap: var(--space-2); width: 100%; }
.meet-cal.hidden { display: none; }
.meeting-when { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.meeting-when .ico { color: var(--primary); }
.meeting-when span { color: var(--ink-muted); }
.meeting-who { font: 600 14px/20px var(--font-text); }
.meeting-actions a.btn { text-decoration: none; }
.meeting-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-top: 4px; }
.pal-note { margin: 0; text-align: center; }
.pal-note.ok { color: var(--sage); font-weight: 600; }
.pulse-avatar { position: absolute; inset: 38px; width: 64px; height: 64px; border-radius: 50%; background: var(--primary); color: var(--on-primary);
  display: grid; place-items: center; font: 800 28px/1 var(--font-display); }
.ring-card { align-items: center; text-align: center; }
.ring-card .btn { width: 100%; }
.ring-card .avatar { width: 64px; height: 64px; font-size: 28px; }
.ring-title { margin: var(--space-2) 0 0; font: 800 22px/28px var(--font-display); text-wrap: balance; }
#meetForm .seg button { display: flex; align-items: center; justify-content: center; gap: 4px; }
#meetForm .btn { width: 100%; }

/* Sign-in screen: rotating Kazakh phrase */
.motto { margin: 0; padding: 14px 16px; border-left: 4px solid var(--primary); border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--primary-soft); font: 600 17px/24px var(--font-text); color: var(--ink); text-wrap: pretty; }

.pals-all { align-self: flex-start; padding: 4px 0; }
.back-link { align-self: flex-start; padding: 4px 0; margin-top: var(--space-2); }
#screen-pals .pal-list { gap: var(--space-3); }

.home-links { display: flex; justify-content: center; gap: var(--space-5); flex-wrap: wrap; }

/* Avatars: drawn Kazakh symbols */
.avatar.has-av { background: none; overflow: hidden; }
.av-img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 50%; background: #F2EDE6; }
.av-tile { overflow: visible; }
.hello-name { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.me-avatar { width: 48px; height: 48px; border: 0; padding: 0; cursor: pointer; font: 800 20px/1 var(--font-display);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary-soft); flex: none; }
.me-avatar:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.av-info { display: flex; align-items: center; gap: var(--space-4); position: sticky; top: 64px; z-index: 2; box-shadow: var(--shadow-card); }
.av-info b { font: 800 20px/26px var(--font-display); }
.av-info p { margin: 2px 0 0; }
.av-big { width: 72px; height: 72px; font-size: 30px; flex: none; }
.av-group { margin-top: var(--space-2); }
.av-group .label { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.av-need { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--sun) 28%, var(--surface)); font: 700 12px/18px var(--font-text); }
.av-need.open { background: color-mix(in srgb, var(--sage) 18%, var(--surface)); color: var(--sage); }
.av-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.av-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border: 2px solid transparent;
  border-radius: var(--radius-md); background: none; color: var(--ink); font: 600 13px/17px var(--font-text); cursor: pointer; text-align: center; }
.av-pick.on { border-color: var(--primary); background: var(--primary-soft); }
.av-pick:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.av-tile { position: relative; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; }
.av-pick .avatar.av-tile { font-size: 28px; }
.av-pick.locked .av-img { opacity: .35; filter: grayscale(.6); }
.av-lock { position: absolute; width: 26px; height: 26px; color: var(--ink); background: var(--surface); border-radius: 50%; padding: 4px; box-shadow: var(--shadow-card); }

/* ---------- Call screen v2 (19.10.2026) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* During a call the top bar (language, sign-out) is hidden: one stray tap must not end the session */
body:has(#screen-call:not(.hidden)) .topbar { display: none; }
#screen-call { min-height: calc(100dvh - var(--space-2) - var(--space-6) - env(safe-area-inset-bottom)); padding-top: var(--space-2); }
.call-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 44px; }
.call-status { margin: 0; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-full);
  background: var(--surface-sunk); color: var(--ink-muted); font: 600 13px/18px var(--font-text); }
.call-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }
.call-stage { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); margin-top: var(--space-4); text-align: center; }
.voice-ring { position: relative; width: 168px; height: 168px; display: grid; place-items: center; }
.voice-ring .ring { position: absolute; border-radius: 50%; opacity: 0; transition: opacity .15s, transform .15s; transform: scale(.92); }
.voice-ring .r1 { inset: 0; background: color-mix(in srgb, var(--sage) 9%, transparent); }
.voice-ring .r2 { inset: 14px; background: color-mix(in srgb, var(--sage) 18%, transparent); box-shadow: inset 0 0 0 3px var(--sage); }
.voice-ring.talking .ring { opacity: 1; transform: none; }
.avatar.call-avatar { width: 120px; height: 120px; font-size: 48px; position: relative; }
.call-stage .partner-name { font: 800 22px/28px var(--font-display); max-width: 100%; }
.call-stage .partner-meta { justify-content: center; }
#screen-call .balance { margin-top: var(--space-2); }

.prompt-zone { padding: var(--space-4); border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-tail);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: var(--space-2); }
.dice-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.dice-row p { margin: 0; }
.prompt-zone .dice { width: 48px; height: 48px; border-radius: var(--radius-md); flex: none; box-shadow: 0 3px 0 #C8901A; }
.prompt-zone .dice .ico { width: 26px; height: 26px; }
.prompt-zone .dice:active { box-shadow: 0 1px 0 #C8901A; }
.prompt { border: 0; box-shadow: none; padding: 0; background: none; }
.prompt-kz { margin: var(--space-1) 0; }

.call-actions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: var(--space-5); margin-top: auto; padding-top: var(--space-4); }
.ctl { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); min-width: 0; }
.ctl:first-child { justify-self: end; }
.ctl:last-child { justify-self: start; }
.ctl-label { font: 500 13px/18px var(--font-text); color: var(--ink-muted); text-align: center; max-width: 96px; }
.ctl-label.danger-text { color: var(--danger); font-weight: 600; }
.ctl-btn { width: 60px; height: 60px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--surface-sunk); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .1s, transform .1s; }
.ctl-btn .ico { width: 26px; height: 26px; }
.ctl-btn:active { transform: scale(.96); }
.ctl-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.ctl-btn.end { width: 76px; height: 76px; background: var(--danger); color: var(--on-danger); box-shadow: none; }
.ctl-btn.end .ico { width: 30px; height: 30px; }
.ctl-btn.on { background: var(--ink); color: var(--surface); box-shadow: none; }
#voiceMe.talking .ctl-btn:not(.on) { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 4px color-mix(in srgb, var(--sage) 35%, transparent); }
.ctl-btn.hint-btn { background: var(--primary-soft); color: var(--primary); width: 60px; padding: 0; border-radius: 50%;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.ctl-btn.hint-btn.listening { background: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 25%, transparent); }
.ctl-btn.hint-btn .ico { color: inherit; width: 26px; height: 26px; }

/* ---------- After call v2 ---------- */

.after-top { display: flex; justify-content: flex-end; min-height: 44px; }
#screen-after .after-links { margin-bottom: var(--space-2); }
.after-head { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.avatar.after-avatar { width: 88px; height: 88px; font-size: 36px; }
#screen-after h2 { margin-top: var(--space-2); }
.after-head p { margin: 0; }
#rateBlock { margin-top: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); }
.vote-btn { flex-direction: row; justify-content: center; gap: var(--space-2); padding: 0 var(--space-3); min-height: 60px; border-radius: var(--radius-lg); }
.vote-btn .ico { width: 24px; height: 24px; }
.like-reasons { display: flex; flex-direction: column; gap: var(--space-2); }
.like-reasons p { margin: 0; }
.reason-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.reason-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--radius-full);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 14px/18px var(--font-text); cursor: pointer; text-align: left; }
.reason-chip .check { display: none; color: var(--primary); }
.reason-chip[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.reason-chip[aria-pressed="true"] .check { display: block; }
.reason-chip:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
#screen-after .after-extra { margin-top: 0; gap: var(--space-2); }
.pal-offer { padding: var(--space-4); border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-tail); background: var(--surface-sunk);
  display: flex; flex-direction: column; gap: var(--space-3); margin-bottom: var(--space-2); }
.pal-offer-title { margin: 0; font: 800 18px/24px var(--font-display); }
.pal-offer .btn { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.pal-offer .btn .check { display: none; color: var(--primary); }
.pal-offer .btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--primary); }
.pal-offer .btn[aria-pressed="true"] .check { display: block; }
.pal-offer .pal-note { margin: 0; }
.after-bottom { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-5); }
.after-bottom p { margin: 0; }
.home-link { color: var(--ink-muted); min-height: 44px; }
/* Once a question is on screen the dice moves into its corner; the topic is already in the question */
.prompt-zone { position: relative; }
.prompt-zone:has(#promptCard:not(.hidden)) .dice-row,
.prompt-zone:has(#taskCard:not(.hidden)) .dice-row { position: absolute; top: var(--space-4); right: var(--space-4); }
.prompt-zone:has(#promptCard:not(.hidden)) #diceCaption,
.prompt-zone:has(#taskCard:not(.hidden)) #diceCaption { display: none; }
/* Only the top lines make room for the two buttons in the corner; the rest of the card uses the full width */
.prompt-zone .prompt-topic, .prompt-zone .prompt-who { padding-right: 116px; }
.prompt-zone .prompt-who + .prompt-kz, .prompt-zone .prompt-topic + .prompt-kz { margin-top: var(--space-3); }
/* «Тапсырма»: the card button sits next to the dice, in the brand purple */
.dice-btns { display: flex; gap: var(--space-2); flex: none; }
.prompt-zone .dice.task-btn { background: var(--primary); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--primary) 60%, #000); }
.prompt-zone .dice.task-btn:active { box-shadow: 0 1px 0 color-mix(in srgb, var(--primary) 60%, #000); }
.task-card .prompt-who { margin-top: var(--space-1); }
.task-goal { margin: var(--space-1) 0 0; font-weight: 700; }
.task-partner { margin: 2px 0 var(--space-1); }
.task-card .prompt-ru p { margin: 0 0 4px; }
.task-suggest { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; cursor: pointer;
  border-radius: var(--radius-md); background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); font: 700 13px/18px var(--font-text); text-align: left; }
.task-suggest.pop { animation: pop .3s ease; }
#screen-call .hint-wrap { margin-top: auto; }
#screen-call .call-actions { margin-top: 0; }
#hintTypeBtn { color: var(--ink-muted); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
#screen-call .hint-wrap.hidden + .call-actions { margin-top: auto; }
/* Speech balance: visible all call long; faded until enough speech is counted */
#screen-call .balance-bar { height: 10px; gap: 3px; background: none; }
#screen-call .balance-bar i { border-radius: var(--radius-full); }
#screen-call .balance-legend { font-weight: 600; }
#screen-call .balance.pending .balance-bar i { opacity: .3; }
#screen-call .balance.pending .balance-legend { color: var(--ink-muted); font-weight: 500; }

/* Home: progress */
.progress-card { display: grid; gap: var(--space-2); }
.progress-card .label { margin: 0; }
.progress-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
@media (max-width: 420px) { .progress-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.prog-btn { border: 0; cursor: pointer; font: inherit; color: inherit; }
.prog-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.learn-list { max-height: 50vh; overflow: auto; }
.prog { display: grid; gap: 2px; text-align: center; padding: 10px 6px; border-radius: var(--radius-md); background: var(--surface-sunk); }
.prog b { font: 800 26px/30px var(--font-display); color: var(--primary); font-variant-numeric: tabular-nums; }
.prog span { font: 500 12px/16px var(--font-text); color: var(--ink-muted); }

/* Call: five words of the shared topic */
.words { display: grid; gap: 6px; }
.words-head { margin: 0; font: 700 13px/18px var(--font-text); text-align: center; }
.words-head .muted { font-weight: 500; }
.word-chips { display: flex; flex-wrap: nowrap; justify-content: safe center; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 1px 2px 2px; }
.word-chips::-webkit-scrollbar { display: none; }
.word-chip { flex: none; }
.word-chip { display: inline-grid; justify-items: center; gap: 0; padding: 6px 12px; border-radius: var(--radius-md); border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.word-chip b { font: 700 15px/20px var(--font-text); }
.word-chip span { font: 500 11px/14px var(--font-text); color: var(--ink-muted); }
.word-chip[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); }
.word-chip[aria-pressed="true"] b::before { content: '✓ '; color: var(--primary); }
.words-done { margin: 4px 0 0; font: 600 14px/20px var(--font-text); color: var(--primary); }

/* With the topic words on screen the partner block gets smaller, so the call buttons stay on screen */
#screen-call:has(#wordsBox:not(.hidden)) .call-stage { margin-top: var(--space-2); gap: 4px; }
#screen-call:has(#wordsBox:not(.hidden)) .voice-ring { width: 104px; height: 104px; }
#screen-call:has(#wordsBox:not(.hidden)) .avatar.call-avatar { width: 76px; height: 76px; font-size: 30px; }
#screen-call:has(#wordsBox:not(.hidden)) .call-stage .partner-name { font-size: 19px; line-height: 24px; }

/* First visit: how to use */
.onb { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(20, 17, 16, .5);
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.onb-card { width: 100%; max-width: 420px; max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-3);
  background: var(--surface); border-radius: var(--radius-lg); padding: var(--space-4); box-shadow: var(--shadow-card); }
.onb-top { display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
.onb-top-right { display: flex; align-items: center; gap: var(--space-3); }
.onb-lang { min-height: 32px; padding: 4px 12px; font: 700 13px/18px var(--font-text); cursor: pointer; }
.onb-media { display: flex; justify-content: center; }
/* Screenshot sits on its own, sized to itself, so no backdrop shows at its sides (dark theme) */
.onb-media > img { border-radius: var(--radius-md); border: 1px solid var(--line); overflow: hidden; }
.onb-media:has(.onb-pair) { min-height: 180px; align-items: center; border-radius: var(--radius-md); background: var(--surface-sunk); }
.onb-media > img { display: block; width: auto; max-width: 100%; height: auto; max-height: min(320px, 38vh); margin: 0 auto; }
.onb-pair { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-5) 0; }
.onb-pair img { width: 96px; height: 96px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-card); }
.onb-wave { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); }
.onb-title { margin: 0; font: 800 22px/28px var(--font-display); text-wrap: balance; }
.onb-text { margin: 0; font: 400 16px/24px var(--font-text); color: var(--ink); }
.onb-dots { display: flex; justify-content: center; gap: 6px; }
.onb-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.onb-dots i.on { width: 22px; border-radius: 4px; background: var(--primary); }
.onb-actions { display: grid; grid-template-columns: 1fr 2fr; gap: var(--space-2); }
.invisible { visibility: hidden; }

/* AI practice while waiting */
.coach-offer { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface-sunk); text-align: center; }
.coach-offer p { margin: 0; }
.coach-offer .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
#screen-coach { gap: var(--space-3); }
.coach-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.coach-top h2 { margin: 0; }
.coach-timer { font: 700 18px/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.coach-voices button.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.coach-bubble { padding: var(--space-4); border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-tail); background: var(--surface); box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 6px; }
.coach-who { margin: 0; font: 700 12px/16px var(--font-text); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); }
.coach-kz { margin: 0; font: 700 20px/27px var(--font-display); }
.coach-ru { margin: 0; color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.coach-heard { margin: 0; align-self: flex-end; max-width: 85%; padding: 10px 14px; border-radius: var(--radius-lg) var(--radius-lg) var(--radius-tail) var(--radius-lg); background: var(--primary-soft); font-size: 15px; }
.coach-mic-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.coach-mic { width: 80px; height: 80px; border-radius: 50%; background: var(--surface-sunk); color: var(--ink-muted); display: grid; place-items: center; transition: background .2s, color .2s; }
.coach-mic .ico { width: 34px; height: 34px; }
.coach-mic.rec { background: var(--primary-soft); color: var(--primary); box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 35%, transparent); animation: coach-listen 2.4s ease-out infinite; }
.coach-mic.hearing { background: var(--primary); color: var(--on-primary); animation: coach-pulse 1.2s ease-in-out infinite; }
.coach-mic.busy { opacity: .6; }
.coach-mic.paused { background: var(--surface-sunk); color: var(--ink-muted); animation: none; }
#coachPause { color: var(--ink-muted); }
@keyframes coach-listen { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 30%, transparent); } 100% { box-shadow: 0 0 0 18px transparent; } }
.coach-state { margin: 0; min-height: 20px; color: var(--ink-muted); font-size: 14px; text-align: center; }
@keyframes coach-pulse { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--primary) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .coach-mic.hearing, .coach-mic.rec { animation: none; } }

/* Review after the AI practice */
#screen-review { gap: var(--space-3); }
.review-body { display: flex; flex-direction: column; gap: var(--space-4); }
.review-praise { margin: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--sage) 18%, var(--surface)); font-weight: 600; }
.review-block { display: flex; flex-direction: column; gap: var(--space-2); }
.review-block .label { margin: 0; }
.review-fixes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-2); counter-reset: fix; }
.review-fixes li { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 4px; }
.review-said { margin: 0; color: var(--ink-muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 60%, transparent); }
.review-better { margin: 0; display: flex; gap: 6px; align-items: flex-start; font: 700 17px/24px var(--font-text); }
.review-better .ico { color: var(--sage); margin-top: 4px; flex: none; }
.review-why { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.review-words { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.review-words li { display: flex; flex-direction: column; padding: 8px 12px; border-radius: var(--radius-md); background: var(--surface-sunk); }
.review-words li span { font-size: 13px; color: var(--ink-muted); }
.review-tips { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* Countdown before a phrase is sent: a ring fills around the mic; speaking again stops it */
.coach-mic { position: relative; }
.coach-mic.sending::after { content: ""; position: absolute; inset: -7px; border-radius: 50%;
  background: conic-gradient(var(--primary) calc(var(--p, 0) * 1turn), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  animation: coach-send var(--send-ms, 2000ms) linear forwards; }
@property --p { syntax: '<number>'; inherits: false; initial-value: 0; }
@keyframes coach-send { from { --p: 0; } to { --p: 1; } }
@media (prefers-reduced-motion: reduce) { .coach-mic.sending::after { animation: none; --p: 1; opacity: .6; } }

.coach-live { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--ink-muted); }
.coach-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 22%, transparent); }

.onb-new { display: inline-block; padding: 3px 10px; border-radius: var(--radius-full); background: var(--primary); color: var(--on-primary);
  font: 700 12px/16px var(--font-text); letter-spacing: .02em; margin-right: 6px; }
.icon-chip { display: inline-grid; place-items: center; min-width: 36px; padding-left: 8px; padding-right: 8px; }

/* «Partner found»: a short countdown with «Өткізу» before the talk starts */
.match-gate { display: none; flex-direction: column; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-4) var(--space-5); }
#screen-call.gating .match-gate { display: flex; }
#screen-call.gating .prompt-zone,
#screen-call.gating .words,
#screen-call.gating .balance,
#screen-call.gating .balance-hint,
#screen-call.gating .hint-wrap,
#screen-call.gating .call-actions,
#screen-call.gating .timer { display: none !important; }
.gate-title { margin: 0; font: 800 20px/26px var(--font-display); text-align: center; }
.gate-count {
  --gate-ms: 4000ms;
  position: relative; width: 76px; height: 76px; border-radius: var(--radius-full);
  display: grid; place-items: center; font: 800 32px/1 var(--font-display); color: var(--primary);
  background: conic-gradient(var(--primary) var(--gate-p, 360deg), var(--primary-soft) 0);
}
.gate-count::before { content: ""; position: absolute; inset: 6px; border-radius: inherit; background: var(--surface); }
.gate-count { isolation: isolate; }
.gate-count::before { z-index: -1; }
@property --gate-p { syntax: "<angle>"; inherits: false; initial-value: 360deg; }
.gate-count.run { animation: gate-drain var(--gate-ms) linear forwards; }
@keyframes gate-drain { from { --gate-p: 360deg; } to { --gate-p: 0deg; } }
.gate-skip { width: auto; min-width: 180px; }
#gateNote { max-width: 300px; margin: 0; }
@media (prefers-reduced-motion: reduce) { .gate-count.run { animation: none; } }
#screen-call .match-gate { margin-top: auto; }
.tg-bot-login { display: block; margin-top: var(--space-2); text-align: center; text-decoration: underline; }

/* Practice with the AI before the first call */
.train-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.train-ico { width: 28px; height: 28px; flex: none; border-radius: 7px; }
.tour { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.tour.dim { background: rgba(20, 17, 16, .55); }
.tour-target { position: relative; z-index: 71 !important; box-shadow: 0 0 0 4px var(--primary), 0 0 0 9999px rgba(20, 17, 16, .55) !important; border-radius: 14px; }
.tour-tip { position: fixed; left: 16px; right: 16px; max-width: 420px; margin: 0 auto; z-index: 72; pointer-events: auto;
  background: var(--surface); color: var(--ink); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  display: flex; flex-direction: column; gap: 8px; }
.tour-count { margin: 0; }
.tour-text { margin: 0; font: 600 16px/22px var(--font-text); }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Practice review: numbers, and Russian words with their Kazakh */
.review-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.review-stats .prog { background: var(--surface-sunk); border-radius: var(--radius-md); padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.review-stats .prog b { font: 800 22px/1.1 var(--font-display); color: var(--primary); font-variant-numeric: tabular-nums; }
.review-stats .prog span { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.review-ru .ru-said { color: var(--ink-muted); text-decoration: line-through; text-decoration-thickness: 1px; }

.call-review-btn { display: flex; align-items: center; justify-content: center; gap: 8px; align-self: center; margin-top: var(--space-2); }
