/* Audiodars – dizayn: docs/UI_SPEC.md */

:root {
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-sheet: 20px; --r-pill: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --shadow-sheet: 0 -8px 32px rgba(0,0,0,.45);
  --shadow-pop: 0 8px 24px rgba(0,0,0,.35);
  --dur-fast: 120ms; --dur-med: 220ms; --dur-slow: 360ms;
  --ease-out: cubic-bezier(.2,.8,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", system-ui, sans-serif;
}

/* Dars xonasi – doim qorong'i (Telegram ovozli chatidek) */
:root[data-theme="room"] {
  --bg: #0F1419; --surface-1: #1A2129; --surface-2: #232C36; --surface-3: #2E3945;
  --divider: rgba(255,255,255,.08);
  --text: #F2F5F7; --text-2: #9AA7B4; --text-3: #6B7885;
  --accent: #3E9BF0; --on-accent: #fff;
  --speak: #34C759; --speak-glow: rgba(52,199,89,.45);
  --muted: #8A96A3; --hand: #FF9F0A; --danger: #FF453A; --warn: #FFD60A;
  --overlay: rgba(0,0,0,.55);
}

/* Bosh sahifa va boshqaruv – Telegram mavzusiga moslashadi */
:root[data-theme="tg"] {
  --bg: var(--tg-theme-bg-color, #fff);
  --surface-1: var(--tg-theme-secondary-bg-color, #F1F3F5);
  --surface-2: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #fff));
  --surface-3: rgba(127,127,127,.16);
  --text: var(--tg-theme-text-color, #0F1419);
  --text-2: var(--tg-theme-hint-color, #707579);
  --text-3: var(--tg-theme-hint-color, #9aa3ab);
  --accent: var(--tg-theme-button-color, #3E9BF0);
  --on-accent: var(--tg-theme-button-text-color, #fff);
  --danger: var(--tg-theme-destructive-text-color, #E53935);
  --divider: rgba(127,127,127,.2);
  --speak: #34C759; --hand: #FF9F0A; --warn: #E8B400;
  --overlay: rgba(0,0,0,.45);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 400 15px/20px var(--font);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
svg.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#app { max-width: 480px; margin: 0 auto; min-height: 100%; position: relative; }

/* ================= Xona ================= */
.room { display: flex; flex-direction: column; height: 100dvh; }
.room-head { padding: var(--sp-2) var(--sp-4) 0; }
.head-row { display: flex; align-items: center; gap: var(--sp-2); min-height: 48px; }
.head-title { flex: 1; min-width: 0; font: 600 17px/22px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 48px; height: 48px; display: grid; place-items: center; border-radius: var(--r-pill); color: var(--text-2); flex: none; }
.icon-btn:active { background: var(--surface-2); }
.meta { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; line-height: 16px; padding-bottom: var(--sp-2); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.signal { position: relative; display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; padding: 0 2px; }
.signal i { width: 3px; border-radius: 1px; background: var(--text-3); }
.signal i:nth-child(1) { height: 4px; } .signal i:nth-child(2) { height: 8px; } .signal i:nth-child(3) { height: 12px; }
.signal::after { content: ""; position: absolute; inset: -18px -14px; }
.signal.good i { background: var(--speak); }
.signal.poor i:nth-child(-n+2) { background: var(--warn); }
.signal.lost i:nth-child(1) { background: var(--danger); }
/* margin -2px: «REC» chiqqanda qator balandlashib, ro'yxat pastga sakramasin (16px qator ichida qoladi).
   Yashirilganda ham joyi saqlanadi (visibility) – hech narsa siljimaydi */
.rec-pill.off, .live-dot.off { visibility: hidden; }
.rec-pill { margin: -2px 0 -2px auto; padding: 2px 8px; border-radius: var(--r-pill); background: rgba(255,69,58,.15); color: var(--danger); font-weight: 600; font-size: 12px; }

.pinned { width: calc(100% - 32px); margin: 0 var(--sp-4) var(--sp-2); padding: var(--sp-2) var(--sp-3); background: var(--surface-1); border-radius: var(--r-md); display: flex; gap: var(--sp-2); align-items: flex-start; font-size: 14px; line-height: 19px; text-align: left; }
.pinned svg.i { width: 18px; height: 18px; margin-top: 1px; color: var(--accent); }
.pinned:not(.static) .txt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pinned.open .txt { -webkit-line-clamp: unset; display: block; }
.pinned.static { width: auto; margin: 0 var(--sp-3) var(--sp-2); }
.pinned b { color: var(--accent); font-weight: 600; }
.pinned .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.room-body { flex: 1; overflow-y: auto; padding: 0 var(--sp-4) var(--sp-6); }
.section-label { color: var(--text-2); font: 500 12px/16px var(--font); text-transform: uppercase; letter-spacing: .04em; margin: var(--sp-3) 0 var(--sp-2); }

.stage { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4) var(--sp-2); }
@media (min-width: 420px) { .stage { grid-template-columns: repeat(4, 1fr); } }
.tile { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 4px 0; border-radius: var(--r-md); }
.tile:active { background: var(--surface-1); }
.tile .name { font: 500 13px/16px var(--font); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .sub { font-size: 12px; line-height: 14px; color: var(--text-2); height: 14px; white-space: nowrap; }
.tile.speaking .sub { color: var(--speak); }

/* Avatar */
.av { --size: 72px; --lvl: 0; position: relative; width: var(--size); height: var(--size); flex: none; }
.av .face {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: calc(var(--size) * .4); overflow: hidden;
  transition: transform var(--dur-fast) linear;
}
.av .face img { width: 100%; height: 100%; object-fit: cover; }
.av::before { /* gapirish halqasi */
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 3px solid var(--speak); opacity: 0; transition: opacity var(--dur-med);
}
.av.speaking::before { opacity: 1; box-shadow: 0 0 calc(8px + var(--lvl) * 16px) var(--speak-glow); }
.av.speaking .face { transform: scale(calc(1 + var(--lvl) * .06)); }
.av .badge {
  position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; border: 2px solid var(--bg); color: #fff;
}
.av .badge svg.i { width: 13px; height: 13px; stroke-width: 2.4; }
.badge.mic-on { background: var(--speak); }
.badge.mic-off { background: var(--surface-3); color: var(--muted); }
.badge.hand { background: var(--hand); animation: pop var(--dur-slow) var(--ease-spring); }
.av .star { position: absolute; right: -2px; top: -2px; font-size: 14px; line-height: 1; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.av.sm { --size: 40px; } .av.xs { --size: 32px; } .av.md { --size: 60px; }
.av.sm .badge:not(.hand), .av.xs .badge:not(.hand) { display: none; }
.av.xs .badge { width: 16px; height: 16px; right: -3px; bottom: -3px; border: 1.5px solid var(--surface-1); }
.av.xs .badge svg.i { width: 9px; height: 9px; }
.av.sm .badge { width: 18px; height: 18px; right: -2px; bottom: -2px; }
.av.sm .badge svg.i { width: 10px; height: 10px; }

/* Qo'l ko'targanlar banneri (faqat boshqaruvchilar) */
.queue-banner {
  width: 100%; margin-top: var(--sp-4); display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg);
  background: rgba(255,159,10,.14); color: var(--hand); font-weight: 600; text-align: left;
}
.queue-banner span { flex: 1; }

/* Zal */
.hall { width: 100%; margin-top: var(--sp-4); background: var(--surface-1); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-4); text-align: left; display: block; }
.hall-top { display: flex; align-items: center; color: var(--text-2); font: 500 12px/16px var(--font); text-transform: uppercase; letter-spacing: .04em; }
.hall-top span { flex: 1; }
.hall-faces { display: flex; align-items: center; margin-top: var(--sp-2); min-height: 32px; }
.hall-faces .av { margin-right: -8px; }
.hall-faces .av .face { border: 2px solid var(--surface-1); }
.hall-faces .more { margin-left: 16px; color: var(--text-2); font-size: 13px; }
.hall-faces .more.none { margin-left: 0; }

/* Uchuvchi reaksiyalar */
.reactions { position: fixed; right: 16px; bottom: calc(130px + var(--safe-b)); width: 120px; height: 260px; pointer-events: none; z-index: 5; }
.reactions .fly { position: absolute; bottom: 0; right: 20px; font-size: 32px; animation: fly 2.2s linear forwards; white-space: nowrap; will-change: transform, opacity; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.reactions .fly small { font-size: 14px; font-weight: 700; color: var(--text); background: var(--surface-3); padding: 1px 6px; border-radius: var(--r-pill); vertical-align: middle; }
@keyframes fly {
  0% { transform: translate3d(0, 0, 0) scale(.4); opacity: 0; animation-timing-function: var(--ease-spring); }
  9% { transform: translate3d(0, -14px, 0) scale(1.15); opacity: 1; }
  16% { transform: translate3d(0, -28px, 0) scale(1); }
  55% { transform: translate3d(var(--sway), -120px, 0) scale(1); opacity: 1; }
  100% { transform: translate3d(0, -200px, 0) scale(.9); opacity: 0; }
}

/* Pastki panel */
.bar {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) 112px repeat(2, minmax(0, 1fr)); align-items: end;
  padding: var(--sp-3) var(--sp-2) calc(var(--sp-3) + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.ctl { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.ctl .circle { width: 52px; height: 52px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; position: relative; transition: transform var(--dur-fast); }
.ctl:active .circle { transform: scale(.94); }
.ctl .lbl { font: 500 12px/14px var(--font); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ctl.danger .circle { background: var(--danger); color: #fff; }
.ctl .count {
  position: absolute; top: -4px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
  border: 2px solid var(--bg);
}
.ctl .count.orange { background: var(--hand); }
.ctl .count.bump { animation: bump var(--dur-slow) var(--ease-spring); }
@keyframes bump { 50% { transform: scale(1.25); } }

.big { --lvl: 0; position: relative; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.big .lbl { max-width: 112px; }
/* translate (transform emas): paydo bo'lish animatsiyasi transform'ni egallaydi – avval yozuv o'ngga sakrab chiqardi */
.qpos { position: absolute; bottom: calc(100% + 6px); left: 50%; translate: -50% 0; white-space: nowrap;
  padding: 2px 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--hand);
  font: 600 12px/16px var(--font); box-shadow: var(--shadow-pop); animation: pop var(--dur-med) var(--ease-out); }
.big.st-staffmuted .circle { background: var(--surface-3); }
.lock-badge { position: absolute; top: -2px; right: -2px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; border: 2px solid var(--bg); }
.lock-badge svg.i { width: 12px; height: 12px; }
.big .circle.nudge { animation: nudge .6s ease-in-out 2; }
@keyframes nudge { 50% { box-shadow: 0 0 0 10px rgba(62,155,240,.35); transform: scale(1.06); } }
.big .circle {
  width: 76px; height: 76px; color: #fff; background: var(--surface-3);
  transition: background var(--dur-med), transform var(--dur-fast), box-shadow 80ms linear;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.big .circle svg.i { width: 32px; height: 32px; }
.big.st-muted .circle { background: var(--accent); }
.big.st-on .circle { background: var(--speak); box-shadow: 0 0 0 calc(var(--lvl) * 18px) var(--speak-glow); }
.big.st-hand-up .circle { background: var(--hand); }
.big.st-hand .circle { background: var(--surface-3); color: var(--hand); }
.big.st-connecting .circle::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 3px solid transparent; border-top-color: var(--accent); animation: spin 1s linear infinite;
}
.big.st-perm .circle::after { content: "!"; position: absolute; top: 0; right: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--danger); font-weight: 700; font-size: 13px; line-height: 20px; }
.big .lbl { color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }
.big.st-hand-up .circle svg { animation: wave .8s ease-in-out 1; transform-origin: 50% 80%; }
@keyframes wave { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }

/* Ogohlantirish banneri */
.banner { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 40; background: var(--surface-3); color: var(--text); padding: 8px 14px; border-radius: var(--r-pill); font-size: 13px; display: flex; gap: 8px; align-items: center; box-shadow: var(--shadow-pop); white-space: nowrap; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--text-3); border-top-color: var(--accent); animation: spin 1s linear infinite; }

/* Ovozni yoqish (iPhone) */
.tap-overlay { position: fixed; inset: 0; z-index: 30; background: var(--overlay); display: grid; place-items: center; text-align: center; }
.tap-overlay button { display: flex; flex-direction: column; align-items: center; gap: var(--sp-4); color: #fff; font-weight: 600; font-size: 17px; }
.tap-overlay .play { width: 96px; height: 96px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; animation: breathe 1.6s infinite; }
.tap-overlay .play svg.i { width: 40px; height: 40px; }
@keyframes breathe { 50% { transform: scale(1.08); } }

/* ================= Varaqlar (sheet) ================= */
.backdrop { position: fixed; inset: 0; background: var(--overlay); z-index: 50; opacity: 0; transition: opacity var(--dur-med); }
.backdrop.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-width: 480px; margin: 0 auto;
  background: var(--surface-1); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: var(--shadow-sheet);
  max-height: 92dvh; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform var(--dur-med) var(--ease-out);
  padding-bottom: var(--safe-b);
}
.sheet.show { transform: none; }
.sheet.tall { height: 85dvh; }
.sheet.full { height: 92dvh; }
.grab { width: 36px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 8px auto 4px; flex: none; }
.sheet-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); min-height: 48px; flex: none; }
.sheet-head h2 { flex: 1; margin: 0; font: 600 17px/22px var(--font); }
.sheet-body { overflow-y: auto; flex: 1; min-height: 0; padding: 0 var(--sp-4) var(--sp-4); }
.text-btn { color: var(--accent); font-weight: 500; padding: 8px 4px; min-height: 44px; }

.person-head { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); padding: var(--sp-2) 0 var(--sp-4); text-align: center; }
.person-head .nm { font: 600 17px/22px var(--font); }
.person-head .rl { color: var(--text-2); font-size: 13px; }
/* Odam varag'idagi to'liq ma'lumot (CRM): Toifa / Yosh / Manzil – hech narsa kesilmaydi */
.person-info { background: var(--surface-2); border-radius: var(--r-md); padding: 4px 14px; margin: 0 0 var(--sp-3); }
.pi-row { display: flex; gap: 12px; padding: 8px 0; font-size: 15px; line-height: 20px; }
.pi-row + .pi-row { border-top: 1px solid var(--surface-3); }
.pi-l { flex: none; width: 100px; color: var(--text-2); }
.pi-v { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pi-none { padding: 10px 0; color: var(--text-2); text-align: center; font-size: 14px; }
/* Holat: Faol – yashil, Arxiv – kulrang (CRM'dagi kabi) */
.pi-st { display: inline-flex; align-items: center; gap: 6px; }
.pi-st::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.pi-st.on::before { background: var(--speak); }
/* Guruhlar: har biri alohida qatorda – nomi va holati; arxivdagilar xira */
.pi-gr { display: flex; flex-wrap: wrap; column-gap: 8px; }
.pi-gr + .pi-gr { margin-top: 4px; }
.pi-gs { color: var(--text-2); font-size: 13px; }
.pi-gr.faol .pi-gs { color: var(--speak); }
.pi-gr.arxiv .pi-gn { color: var(--text-2); }
.menu { display: flex; flex-direction: column; border-top: 1px solid var(--divider); }
.menu button { display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; padding: 0 var(--sp-2); text-align: left; border-radius: var(--r-md); }
.menu button:active { background: var(--surface-2); }
.menu button.danger { color: var(--danger); }
.menu .emoji { width: 24px; height: 24px; display: grid; place-items: center; color: var(--text-2); flex: none; }
.menu button.danger .emoji { color: var(--danger); }
.menu.flat { border-top: 0; }
.sheet-body.pt { padding-top: var(--sp-2); }
.cancel-btn { width: 100%; min-height: 52px; margin-top: var(--sp-2); border-radius: var(--r-md); background: var(--surface-2); font-weight: 600; }

.row { display: flex; align-items: center; gap: var(--sp-3); min-height: 56px; padding: 6px 0; }
.row .grow { flex: 1; min-width: 0; }
.row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.row .sub { color: var(--text-2); font-size: 13px; }
.row .pos { width: 20px; color: var(--text-2); text-align: center; font-weight: 600; }
.row-actions { display: flex; gap: var(--sp-2); padding: 0 0 var(--sp-3) 84px; }
.row-actions .btn { min-height: 48px; }
.person-row { width: 100%; text-align: left; }
.row-ic { color: var(--muted); display: grid; place-items: center; }
.row-ic.on { color: var(--speak); }
.row-ic.hand { color: var(--hand); }
.row-ic svg.i { width: 20px; height: 20px; }
.btn { min-height: 44px; padding: 0 16px; border-radius: var(--r-md); font-weight: 600; background: var(--surface-3); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; min-height: 48px; }
.btn:disabled { opacity: .5; }

.search { position: sticky; top: 0; background: var(--surface-1); padding-bottom: var(--sp-2); z-index: 1; }
.search input, .field input, .field textarea {
  font-size: 16px; width: 100%; height: 48px; border-radius: var(--r-md); border: 1px solid transparent;
  background: var(--surface-2); padding: 0 14px; outline: none;
}
.search input:focus, .field input:focus, .field textarea:focus { border-color: var(--accent); }
.empty { text-align: center; color: var(--text-2); padding: var(--sp-6) var(--sp-4); }
.empty .big-emoji { font-size: 48px; line-height: 56px; height: 56px; display: block; margin: 0 auto var(--sp-3); }
.empty-act { margin-top: var(--sp-4); }
.caption { color: var(--text-2); font-size: 13px; text-align: center; padding: var(--sp-3) 0; }

.emoji-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); padding: var(--sp-2) 0; }
.emoji-grid button { height: 64px; font-size: 32px; border-radius: var(--r-md); background: var(--surface-2); }
.emoji-grid button:active { transform: scale(.92); }

/* Chat */
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 var(--sp-3) var(--sp-2); display: flex; flex-direction: column; gap: 2px; }
.msg { max-width: 82%; align-self: flex-start; background: var(--surface-2); border-radius: 16px; padding: 6px 12px 7px; overflow-wrap: anywhere; user-select: text; }
.msg .txt { white-space: pre-wrap; } /* xabardagi qatorlar saqlanadi */
.msg.first { margin-top: 8px; }
.msg.mine { align-self: flex-end; background: rgba(62,155,240,.22); }
.msg .who { font: 600 13px/16px var(--font); margin-bottom: 2px; display: flex; flex-wrap: wrap; column-gap: 6px; row-gap: 0; align-items: baseline; min-width: 0; white-space: nowrap; }
.msg .who .chip { font-size: 11px; font-weight: 500; color: var(--text-2); }
.msg .tm { float: right; margin: 6px 0 -4px 10px; font-size: 11px; color: var(--text-3); }
.msg.deleted { font-style: italic; color: var(--text-3); }
.new-pill { position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); bottom: calc(132px + var(--safe-b)); background: var(--accent); color: #fff; border-radius: var(--r-pill); padding: 6px 12px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-pop); }
.quick { display: flex; gap: 4px; justify-content: space-between; padding: var(--sp-2) var(--sp-3); flex: none; }
.quick button { position: relative; flex: 1 1 0; min-width: 32px; transition: transform var(--dur-fast) var(--ease-out); max-width: 44px; aspect-ratio: 1 / 1; border-radius: 50%; background: var(--surface-2); font-size: 20px; }
.quick button:active { transform: scale(.9); }
.composer { display: flex; gap: var(--sp-2); padding: 0 var(--sp-3) var(--sp-3); flex: none; align-items: center; }
.composer { align-items: flex-end; }
.composer textarea { flex: 1; min-width: 0; height: 48px; max-height: 132px; resize: none; border-radius: 24px; border: 0; background: var(--surface-2);
  padding: 13px 18px; outline: none; font: 16px/22px var(--font); color: var(--text); overflow-y: auto; display: block; }
.send { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.send:disabled { opacity: .5; }
.locked-bar { margin: 0 var(--sp-3) var(--sp-3); min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); font-size: 14px; flex: none; }

/* Dialog */
.dialog-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: var(--sp-5); background: var(--overlay); }
.dialog { width: 100%; max-width: 320px; background: var(--surface-1); border-radius: var(--r-lg); padding: var(--sp-5) var(--sp-4) var(--sp-4); box-shadow: var(--shadow-pop); animation: pop var(--dur-med) var(--ease-out); }
.dialog h3 { margin: 0 0 var(--sp-2); font: 600 17px/22px var(--font); }
.dialog p { margin: 0 0 var(--sp-4); color: var(--text-2); }
.dialog .acts { display: flex; gap: var(--sp-2); justify-content: flex-end; }

/* Xabarcha (toast) */
#toast { position: fixed; left: 50%; bottom: calc(132px + var(--safe-b)); transform: translate(-50%, 12px); z-index: 70; opacity: 0; pointer-events: none;
  background: var(--surface-3); color: var(--text); padding: 10px 16px; border-radius: var(--r-md); box-shadow: var(--shadow-pop);
  max-width: calc(100vw - 32px); text-align: center; transition: opacity var(--dur-med), transform var(--dur-med); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
:root[data-theme="tg"] #toast { background: #2E3945; color: #fff; }

/* ================= To'liq ekran holatlari ================= */
.state { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: var(--sp-5); gap: var(--sp-3); }
.state .ico { font-size: 64px; line-height: 1; }
.state h1 { margin: 0; font: 600 22px/28px var(--font); }
.state p { margin: 0; color: var(--text-2); max-width: 320px; }
.state .acts { display: flex; flex-direction: column; gap: var(--sp-2); width: 100%; max-width: 280px; margin-top: var(--sp-3); }
.dots { display: flex; gap: 6px; margin-top: var(--sp-2); }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); animation: pulse 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }

/* ================= Bosh sahifa (egasi) ================= */
.home { padding: var(--sp-4) var(--sp-4) calc(var(--sp-6) + var(--safe-b)); }
.home-head { display: flex; align-items: center; margin-bottom: var(--sp-3); }
.home-head h1 { flex: 1; margin: 0; font: 600 22px/28px var(--font); }
.seg { display: flex; background: var(--surface-1); border-radius: var(--r-md); padding: 3px; margin-bottom: var(--sp-4); }
.seg button { flex: 1; height: 36px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.card { background: var(--surface-1); border-radius: var(--r-lg); padding: var(--sp-4); margin-bottom: var(--sp-3); }
.card.flash { animation: flash 1.5s; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 2px var(--accent); } }
.card-top { display: flex; align-items: center; gap: var(--sp-2); }
.card-title { font-weight: 600; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; flex: none; }
.chip.live { background: rgba(255,69,58,.14); color: #FF453A; }
.chip.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
.chip.scheduled { background: rgba(62,155,240,.15); color: var(--accent); }
.chip.ended { background: var(--surface-3); color: var(--text-2); }
.card-meta { color: var(--text-2); font-size: 13px; margin: 6px 0 var(--sp-3); }
.card-acts { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.ended-row { display: flex; gap: var(--sp-2); align-items: center; padding: 10px 0; border-bottom: 1px solid var(--divider); font-size: 14px; }
.ended-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ended-row .m { color: var(--text-2); font-size: 13px; }
.field { margin-bottom: var(--sp-4); }
.field .l { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field .err { color: var(--danger); font-size: 13px; margin-top: 4px; }
.radio { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.radio input { width: 20px; height: 20px; accent-color: var(--accent); }
.radio.disabled { opacity: .5; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .reactions .fly { animation: fade-rm 1.6s linear forwards !important; }
  .spinner, .big.st-connecting .circle::after { animation: spin 1.6s linear infinite !important; }
}
@keyframes fade-rm { 0%, 70% { opacity: 1; transform: translateY(-40px); } 100% { opacity: 0; transform: translateY(-40px); } }

/* ================= Qo'shimchalar ================= */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.head-row > .icon-btn.edge, .sheet-head > .icon-btn.edge { margin-right: -12px; }
.danger-ic { color: var(--danger) !important; }
body.chat-open .reactions { z-index: 52; bottom: var(--react-base, calc(150px + var(--safe-b))); height: 180px; right: 8px; }
.host-off { margin: 0 var(--sp-4) var(--sp-2); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--surface-1); color: var(--text-2); font-size: 14px; display: flex; gap: var(--sp-2); align-items: center; }
.spinner.big-spin { width: 40px; height: 40px; border-width: 4px; }
.spinner.center { margin: auto; }
.wait-count { min-height: 20px; }
.icon-text { display: inline-flex; align-items: center; gap: 6px; }
.grow-btn { flex: 1; }
.help-text { color: var(--text-2); margin-top: 0; }
.ended-label { margin-top: 20px; }
.field textarea { height: auto; padding: 12px 14px; resize: none; }
/* Bosh sahifa kartasidagi tugmalar: ikki ustunli tekis to'r */
.card .card-acts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.card .card-acts .btn { justify-content: center; }
.card .card-acts .wide { grid-column: 1 / -1; }
/* Mikrofon ruxsati tushuntirishi */
.help-text.small { font-size: 13px; line-height: 18px; }

/* ================= Yagona ro'yxat (Telegram uslubi) ================= */
.plist { display: flex; flex-direction: column; margin-top: var(--sp-2); }
.prow { display: flex; align-items: center; gap: var(--sp-3); min-height: 60px; padding: 6px 0; border-radius: var(--r-md); cursor: pointer; will-change: transform; }
.prow:active { background: var(--surface-1); }
.prow .grow { flex: 1; min-width: 0; }
.prow .nm { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .nm .me { color: var(--text-2); font-weight: 400; }
.prow .st { font-size: 13px; line-height: 17px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .st.stage { color: var(--accent); }
.prow .st.hand { color: var(--hand); }
.prow .st.speaking { color: var(--speak); }
.prow .st.none { color: var(--text-2); }
/* Ma'lumot qatori: «Oʻqituvchi, repetitor (41) · Toʻrtkoʻl» – kerak bo'lsa faqat manzil qisqaradi */
.prow .meta, .msg .who-meta { display: flex; gap: 0; min-width: 0; white-space: nowrap; color: var(--text-2); overflow: hidden; }
.prow .meta { font-size: 13px; line-height: 17px; }
.prow .meta .tf, .msg .who-meta .tf { font-weight: 600; flex: none; }
.prow .meta .yosh, .msg .who-meta .yosh { flex: none; font-variant-numeric: tabular-nums; }
.prow .meta .tf:not(:empty) + .yosh:not(:empty), .msg .who-meta .tf:not(:empty) + .yosh:not(:empty) { margin-left: 4px; }
.prow .meta .joy, .msg .who-meta .joy { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.prow .meta span:not(:empty) ~ .joy:not(:empty)::before,
.msg .who-meta span:not(:empty) ~ .joy:not(:empty)::before { content: '·'; margin: 0 5px; color: var(--text-3); font-weight: 400; }
.prow .meta span:empty, .msg .who-meta span:empty { display: none; }
/* Ustozdagi «amal joyi»: har qatorda bir xil kenglik – qo'l ko'tarilsa ham matn siljimaydi */
.prow .act { width: 32px; flex: none; display: flex; justify-content: center; }
.prow .act.big { width: 84px; }
.act-btn { position: relative; width: 32px; height: 32px; border-radius: 50%; border: 0; display: grid; place-items: center; padding: 0; cursor: pointer; }
.act-btn::after { content: ''; position: absolute; inset: -4px; }
.act-btn svg.i { width: 18px; height: 18px; }
.act-btn.up { background: var(--accent); color: var(--on-accent); }
.act-btn.down { background: var(--surface-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--surface-3); }
.msg .who-meta { flex: 0 1 auto; max-width: 100%; font: 400 12px/16px var(--font); color: var(--text-2); } /* sig'masa – keyingi qatorga tushadi, kesilmaydi */
.msg .who-meta .tf { font-weight: 400; }
.msg .who-name { flex: none; max-width: 72%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Chatda joy tor bo'lsa: avval manzil, keyin qavsdagi ma'lumot qisqaradi – ism oxirgi navbatda */
.msg .who-meta .tf { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.msg .who-meta .joy { flex: 0 100 auto; }
.prow .av.sm { --size: 44px; }
.prow .av.sm::before { inset: -4px; border-width: 2px; }
.prow .row-ic.mic { width: 32px; height: 32px; }
.hand-pos { display: inline-flex; align-items: center; gap: 2px; color: var(--hand); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 40px; justify-content: flex-end; }
.hand-pos svg.i { width: 18px; height: 18px; }
.btn.mini { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-pill); }
.more-row { width: 100%; display: flex; align-items: center; gap: var(--sp-2); justify-content: center; min-height: 48px; margin-top: var(--sp-2); border-radius: var(--r-md); background: var(--surface-1); color: var(--text-2); font-size: 14px; }
.more-row svg.i { width: 18px; height: 18px; }

/* Pastki panel: "Jim qilish" yoqilgan va "Yozib olish" ketayotgan holatlar */
.ctl.active .circle { background: var(--hand); color: #fff; }
.ctl.active .lbl { color: var(--hand); }
.ctl.recording .circle { background: rgba(255,69,58,.18); color: var(--danger); animation: pulse 1.6s infinite; }
.ctl.recording .lbl { color: var(--danger); font-variant-numeric: tabular-nums; }

/* Menyu ichidagi ikkinchi qator izoh */
.menu-sub { display: block; font-size: 12px; line-height: 16px; color: var(--text-2); margin-top: 2px; }
.menu button { padding-top: 8px; padding-bottom: 8px; }


/* O'quvchi paneli: 3 ta tugma (Chat · Mikrofon · Chiqish) */
.bar.three { grid-template-columns: minmax(0, 1fr) 112px minmax(0, 1fr); }
.big.st-open .circle { background: var(--accent); } /* o'chiq mikrofon – ko'k, yoqilgach yashil */

/* "Hamma gapira oladi" eslatmasi */
.open-notice { margin: 0 var(--sp-4) var(--sp-2); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md);
  background: rgba(62,155,240,.14); color: var(--accent); font-size: 14px; font-weight: 500; /* yashil faqat "mikrofon yoniq" uchun */ display: flex; gap: var(--sp-2); align-items: center; }
.open-notice svg.i { width: 18px; height: 18px; flex: none; }

/* Sozlamalar va tanlov maydoni */
.select { width: 100%; height: 48px; border-radius: var(--r-md); border: 1px solid transparent; background: var(--surface-2); color: var(--text); padding: 0 12px; font-size: 16px; }
.select:focus { border-color: var(--accent); outline: none; }
.field .hint { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.home-head .icon-btn { margin-right: var(--sp-2); }

/* Ustozning "hammaga xabari" – ekran tepasida */
.notice-pop { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 80; width: calc(100% - 32px); max-width: 448px;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); background: var(--accent); color: #fff; box-shadow: var(--shadow-pop);
  animation: notice-in var(--dur-slow) var(--ease-spring); cursor: pointer; }
.notice-pop.hide { opacity: 0; transform: translate(-50%, -12px); transition: opacity var(--dur-med), transform var(--dur-med); }
.notice-pop .np-from { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; opacity: .85; margin-bottom: 2px; }
.notice-pop .np-from svg.i { width: 14px; height: 14px; }
.notice-pop .np-text { font-size: 16px; font-weight: 600; line-height: 21px; overflow-wrap: anywhere; }
@keyframes notice-in { from { opacity: 0; transform: translate(-50%, -16px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.menu button.on { color: var(--accent); }
.menu button.on .emoji { color: var(--accent); font-weight: 700; }
.host-off svg.i { width: 18px; height: 18px; flex: none; }

/* ================= Reaksiyalar: darhol javob ================= */
.quick button.tap, .emoji-grid button.tap { animation: react-tap 220ms var(--ease-spring); }
@keyframes react-tap { 0% { transform: scale(.86); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.emoji-grid button { position: relative; transition: transform var(--dur-fast) var(--ease-out); }
.fly-own { position: fixed; z-index: 90; width: 34px; height: 34px; font-size: 30px; line-height: 34px; text-align: center; pointer-events: none;
  will-change: transform, opacity; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }
.combo { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); padding: 0 6px; height: 18px; border-radius: 9px;
  background: var(--accent); color: #fff; font: 700 11px/18px var(--font); white-space: nowrap; pointer-events: none; }
.combo.bump { animation: bump var(--dur-slow) var(--ease-spring); }

/* Chatdagi qo'l ko'tarish tugmasi (reaksiyalar qatorining 1-o'rni) */
.quick .sep { display: none; } /* ajratuvchi joy egallamaydi – 8 ta doira teng oraliqda */
.quick .qh.hand { box-shadow: inset 0 0 0 1.5px var(--surface-3); } /* qo'l – emoji emas, tugma ekanini bildiradi */
.quick .qh.hand::after { content: ""; position: absolute; right: -3px; top: 25%; height: 50%; width: 1px; background: var(--surface-3); }
.quick .qh.up { box-shadow: none; }
.quick .qh { color: var(--text-2); display: grid; place-items: center; }
.quick .qh svg.i { width: 20px; height: 20px; }
.quick .qh.up { background: var(--hand); color: #fff; }
.quick .qh .count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--surface-1); color: var(--hand); border: 1.5px solid var(--hand); font: 700 10px/15px var(--font); text-align: center; }
.quick .qh.nudge { animation: react-tap 300ms var(--ease-spring) 2; }
.qpos-pill { flex: none; padding: 2px 10px; border-radius: var(--r-pill); background: rgba(255,159,10,.15); color: var(--hand);
  font: 600 12px/16px var(--font); }
.icon-btn.kbd-pin.on { color: var(--accent); }
/* Sozlamalardagi katakchalar: ikki qatorli (nomi va misoli) */
.radio.check { align-items: flex-start; padding: 6px 0; }
.radio.check input { margin-top: 1px; flex: none; }
.radio.check .menu-sub { margin-top: 2px; }

/* Barmoq bilan bosilganda fokus ramkasi chiqmasin (Android chat yopilgach tugmani ramkalab qo'yardi).
   Ramka faqat haqiqiy klaviatura (Tab) bilan yurilganda ko'rinadi. */
button:focus, [role="button"]:focus, a:focus, .sheet:focus { outline: none; }
html.kbd-nav button:focus-visible, html.kbd-nav [role="button"]:focus-visible, html.kbd-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ✋ reaksiyalar o'rtasida (standart): kattaroq, chetdagi chiziqsiz */
.quick { align-items: center; }
.quick .qh.mid { max-width: 54px; flex-basis: 54px; flex-grow: 1.25; }
.quick .qh.mid.hand::after { display: none; }
.quick .qh.mid.hand { box-shadow: inset 0 0 0 2px var(--hand); color: var(--hand); }
.quick .qh.mid.hand.up { box-shadow: none; color: #fff; }
.quick .qh.mid svg.i { width: 26px; height: 26px; }

/* «Hammaga xabar» tayyor matnlari */
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--sp-3); }
.presets .preset { padding: 7px 12px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text); font-size: 14px; }
.presets .preset:active { transform: scale(.96); }

/* Sozlamalar: «qo'l o'zi tushsin» vaqti – son + birlik bir qatorda */
.dur-row { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px 30px; transition: opacity var(--dur-fast); }
.dur-row input { width: 76px; height: 40px; text-align: center; }
.dur-row .select { width: auto; height: 40px; }
.dur-row.off { opacity: .4; pointer-events: none; }
.field .sub-l { display: block; margin-top: 10px; }

/* Bosh sahifa: aylantirish chizig'i uchun joy doim ajratilgan – uzun «Darslar»dan qisqa
   «Yordamchilar»ga o'tganda chiziq yo'qolib, tablar 5 px sakramasin (kompyuterdagi Telegram) */
html:has(.home) { scrollbar-gutter: stable; }

/* Chatdagi asosiy tugma – pastdagi katta doira bilan bir xil ranglar (qo'l → mikrofon) */
.quick .qh.main { --lvl: 0; color: #fff; background: var(--surface-3); box-shadow: none; transition: background var(--dur-med), box-shadow 80ms linear; }
.quick .qh.main::after { display: none; }
.quick .qh.main.st-hand { color: var(--hand); box-shadow: inset 0 0 0 2px var(--hand); }
.quick .qh.main.st-hand-up { background: var(--hand); color: #fff; }
.quick .qh.main.st-muted { background: var(--accent); }
.quick .qh.main.st-on { background: var(--speak); box-shadow: 0 0 0 calc(var(--lvl) * 8px) var(--speak-glow); }
.quick .qh.main.st-staffmuted { background: var(--surface-3); }
.quick .qh.main.st-connecting::before { content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid transparent; border-top-color: var(--accent); animation: spin 1s linear infinite; }
.quick .qh.main .lock-badge { width: 18px; height: 18px; top: -4px; right: -4px; }
.quick .qh.main .lock-badge svg.i { width: 10px; height: 10px; }
.quick .qh.main:not(.mid) svg.i { width: 20px; height: 20px; }

/* Qo'l ko'tarish/tushirish: rang darhol almashadi. Avval fon sekin o'tib, belgi esa darhol rang
   almashardi – bir lahza to'q sariq fonda to'q sariq qo'l "yo'qolib", tugma yonib-o'chgandek ko'rinardi */
.big.st-hand .circle, .big.st-hand-up .circle,
.quick .qh.main.st-hand, .quick .qh.main.st-hand-up { transition: transform var(--dur-fast); }

/* Ro'yxatning o'ng ustuni: mikrofon va qo'l belgilari bir xil 44px qutida, markazda –
   hamma qatorda (va hamma ko'rinishda) ustma-ust bitta chiziqda turadi */
.prow .row-ic, .prow .hand-pos { width: 44px; min-width: 44px; justify-content: center; flex: none; }

/* Ustoz qator tugmalari: «Ruxsat» va «Zalga» bir xil o'lchamda, bitta ustunda;
   barmoq tegadigan joy 44px (ko'rinishi 34px) */
.prow .btn.mini { width: 84px; flex: none; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.prow .btn.mini::after { content: ""; position: absolute; inset: -5px -4px; }
.btn.mini.zalga { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--surface-3); }
.prow .row-ic.tap { height: 44px; border-radius: 50%; background: var(--surface-1); }
.prow .row-ic.locked { color: var(--danger); }

/* «… · Qaytarish» xabari – tugmasi bosiladi */
#toast.has-act { pointer-events: auto; display: flex; align-items: center; gap: 16px; text-align: left; width: calc(100vw - 32px); max-width: 420px; }
#toast.has-act span { flex: 1; min-width: 0; }
#toast.has-act button { flex: none; color: var(--accent); font-weight: 600; padding: 8px 4px; margin: -8px 0; }

/* Sozlamalar: o'quvchilarga chiqadigan xabarlar (ochiladigan guruhlar) */
.hint.top { margin: 0 0 var(--sp-2); }
.msg-group { border-radius: var(--r-md); background: var(--surface-1); margin-bottom: var(--sp-2); }
.msg-group summary { display: flex; align-items: center; gap: var(--sp-2); padding: 4px 12px 4px 4px; min-height: 48px; cursor: pointer; list-style: none; }
.msg-group summary::-webkit-details-marker { display: none; }
.msg-group summary::after { content: "›"; margin-left: 8px; color: var(--text-2); font-size: 20px; transition: transform var(--dur-fast); }
.msg-group[open] summary::after { transform: rotate(90deg); }
.msg-group summary .radio.check { padding: 0 8px; margin: 0; min-height: 0; }
.field .msg-group summary input { width: 20px; height: 20px; padding: 0; }
.msg-g { flex: 1; font-weight: 600; }
.msg-body { padding: 0 12px 12px; display: grid; gap: 12px; }
.msg-when { min-height: 36px; font-size: 13px; color: var(--text-2); }
.field .msg-when input { width: 20px; height: 20px; padding: 0; flex: none; }
.msg-edit { display: flex; gap: 8px; margin-top: 6px; }
.msg-edit textarea { flex: 1; min-width: 0; resize: none; font-size: 15px; line-height: 20px; }
.msg-reset { flex: none; padding: 0 12px; border-radius: var(--r-md); background: var(--surface-2); color: var(--accent); font-weight: 600; font-size: 13px; }
.msg-group:has(summary input:not(:checked)) .msg-body { opacity: .45; pointer-events: none; }

/* E'lon matnlari oynasi */
.ann-texts { padding: 4px 0 8px; }
.create-chats .radio.check span { min-width: 0; }

/* «Guruhlar» va «Odamlar» tablari: qatorlar tugma – butun qator bosiladi */
.row.grp-row, .row.ppl-row { width: 100%; text-align: left; background: none; border-radius: var(--r-md); color: inherit; font: inherit; }
.row.grp-row:active, .row.ppl-row:active { background: var(--surface-1); }
.row .nm, .row .sub { display: block; }
.row .sub.bad, .help-text.bad, .bad { color: var(--danger); }
.chev { flex: none; color: var(--text-3, var(--text-2)); font-size: 22px; line-height: 1; padding-left: 4px; }
.grp-add { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: var(--sp-2); }
.grp-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; flex: none; }
.grp-ic.ch { background: linear-gradient(135deg, #5AC8FA, #3E9BF0); }
.grp-ic.gr { background: linear-gradient(135deg, #7CDB8A, #34C759); }
.grp-ic.bad { background: linear-gradient(135deg, #C7C7CC, #8A96A3); }
.grp-arch { margin-top: var(--sp-2); border-top: 1px solid var(--surface-2); }
.grp-arch summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; list-style: none; cursor: pointer; color: var(--text-2); font-weight: 500; }
.grp-arch summary::-webkit-details-marker { display: none; }
.grp-arch[open] summary .chev { transform: rotate(90deg); }
.grp-more { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; border-top: 1px solid var(--surface-2); color: var(--text-2); font-weight: 500; background: none; text-align: left; }
.menu button.danger-text, .danger-text { color: var(--danger); }
.ppl-search { display: flex; align-items: center; gap: 8px; height: 44px; border-radius: var(--r-md); background: var(--surface-1); padding: 0 12px; margin-bottom: var(--sp-2); }
.ppl-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--text); font-size: 16px; outline: none; }
.ppl-chips { display: flex; gap: 6px; margin-bottom: var(--sp-2); }
.ppl-chip { flex: 1 1 auto; min-width: 0; padding: 7px 10px; border-radius: var(--r-pill); background: var(--surface-1); color: var(--text-2); font-size: 14px; white-space: nowrap; }
.ppl-chip.on { background: var(--accent); color: #fff; }
.ppl-tag { margin-left: 6px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 600; vertical-align: 2px; }
.ppl-tag.bad { color: var(--danger); }
.ppl-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: var(--sp-2) 0; }
.ppl-stats div { background: var(--surface-1); border-radius: var(--r-md); padding: 10px 6px; text-align: center; }
.ppl-stats b { display: block; font-size: 18px; }
.ppl-stats small { color: var(--text-2); font-size: 12px; }
/* Dars tarixi: nom to'liq (o'raladi), ostida – sana · vaqt · foiz · sahnada */
.ppl-hist { padding: 9px 0; border-bottom: 1px solid var(--surface-2); }
.ppl-hist .t { font-size: 15px; line-height: 20px; overflow-wrap: anywhere; }
.ppl-hist .m { margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--text-2); }
.ppl-live { font-size: 11px; color: var(--danger); font-weight: 600; text-transform: uppercase; margin-left: 4px; }
.ppl-acts { margin-top: var(--sp-3); }

/* Menyu tugmasida izoh bo'lsa – izoh nomning tagida turadi (yonida emas) */
.menu button:has(> small.menu-sub) { display: grid; grid-template-columns: auto 1fr; column-gap: var(--sp-3); row-gap: 0; align-items: center; align-content: center; padding-top: 8px; padding-bottom: 8px; }
.menu button > small.menu-sub { grid-column: 2; margin-top: 2px; }
.menu button > .emoji { grid-row: span 2; }

/* Sarlavhadagi yozib olish tugmasi (Telegram'dagidek): oddiy holatda kulrang halqa, yozayotganda qizil nuqta */
.rec-btn { color: var(--text-2); }
.rec-btn.on { color: var(--danger); animation: pulse 1.6s infinite; }
.rec-btn.on svg.i circle:last-child, .rec-btn.on svg.i * { fill: currentColor; }

/* Dinamik / telefon rejimi tugmasi: telefon rejimida ko'k */
.ctl.on .circle { background: var(--accent); color: var(--on-accent); }
.ctl.on .lbl { color: var(--accent); }
.ctl.off { opacity: .45; } /* zaldagi o'quvchiga chat yopiq */

/* Sozlamalar: o'quvchi ma'lumoti maydonlari – «Telegram'dagidek» tanlanganda xira */
.info-fields { padding-left: 28px; }
.info-fields.off { opacity: .45; pointer-events: none; }

/* Sarlavhasiz oynadagi ✕ – o'ng yuqori burchak, sarlavhali oynalardagi ✕ bilan bir xil joyda */
.sheet-x.float { position: absolute; top: 14px; right: 8px; z-index: 2; }

/* Odam kartasi (Odamlar bo'limi): bosh qism, aloqa tugmalari, 4 ta ko'rsatkich */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pc-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 0 0 var(--sp-3); }
.pc-name { font: 600 19px/24px var(--font); }
.pc-sub { color: var(--text-2); font-size: 13px; line-height: 18px; min-height: 18px; }
.pc-chips { display: flex; gap: 6px; justify-content: center; min-height: 22px; }
.pc-chip { font-size: 12px; line-height: 22px; padding: 0 10px; border-radius: 11px; background: var(--surface-2); color: var(--text-2); }
.pc-chip.ok { background: rgba(52,199,89,.15); color: var(--speak); }
.pc-chip.bad { background: rgba(255,69,58,.12); color: var(--danger); }
.pc-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: var(--sp-3); }
.pc-contact button { height: 44px; border: 0; border-radius: var(--r-md); background: var(--surface-2); color: var(--accent); font: 600 15px var(--font);
  display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.pc-contact button:disabled { color: var(--text-3); opacity: .6; }
.pc-tel { color: var(--accent); text-decoration: none; }
.ppl-stats.four { grid-template-columns: 1fr 1fr; }
.ppl-stats.four b { font-size: 18px; line-height: 24px; }
.ppl-stats.four small { font-size: 12px; line-height: 16px; display: block; }
.pc-seen { text-align: center; margin-top: 4px; }
.sheet-head .sheet-x { margin-left: auto; } /* sarlavha yashirin bo'qlsa ham ✕ o'ngda */

/* Dars tarixi: foiz rangi (80%+ – yashil, 40% dan kam – qizil), faollik qatori */
.ppl-pct { font-weight: 600; color: var(--text); }
.ppl-pct.hi { color: var(--speak); }
.ppl-pct.lo { color: var(--danger); }
.ppl-hist .m.act { color: var(--text); }
