/* KB_CHAT: language-exchange chat (phone first) */
.chat-wrap{padding-top:20px;padding-bottom:40px}
.chat-h1{font-size:clamp(1.5rem,5vw,2.2rem);margin:.2em 0 .3em}
.chat-h2{font-size:1.15rem;margin:1.2em 0 .6em}
.chat-lead{font-size:1.05rem;margin:0 0 8px}
.chat-me{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:8px 0 16px}
.chat-talk{padding:16px;margin:0 0 8px;background:linear-gradient(135deg,#eef2ff,#fdf2f8)}
.chat-talk .chat-h2{margin-top:0}
.chat-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:10px 0}
.chat-pair label{display:flex;flex-direction:column;gap:4px;font-weight:600;font-size:.9rem}
.chat-pair select{min-width:0;width:100%}
.chat-go{display:block;width:100%;min-height:var(--tap)}
.chat-rooms{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:10px}
.chat-room{display:grid;grid-template-columns:auto 1fr auto;grid-template-areas:"c n e" "c l e";gap:2px 12px;align-items:center;padding:12px 14px;color:var(--ink);min-height:64px}
.chat-room:hover{text-decoration:none;border-color:var(--brand)}
.chat-codes{grid-area:c;font-weight:800;font-size:.75rem;color:var(--brand-ink);background:var(--brand-soft);border-radius:10px;padding:8px 6px;min-width:56px;text-align:center}
.chat-rname{grid-area:n;font-weight:700;line-height:1.25}
.chat-live{grid-area:l;color:var(--muted)}
.chat-enter{grid-area:e;color:var(--brand);font-weight:700;font-size:.9rem}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#cbd5e1;margin-right:5px;vertical-align:middle}.dot.on{background:#22c55e}
.chat-notes{margin-top:18px}
.chat-list{margin:0;padding-left:1.2em}.chat-list li{margin:.35em 0}
.chat-rules .card{margin:0 0 14px}.chat-rules .chat-h2{margin-top:0}
.chat-sign{max-width:460px;margin:0 auto}
.chat-field{display:flex;flex-direction:column;gap:6px;font-weight:600;margin:12px 0}
.chat-field input{min-width:0;width:100%}
.chat-code{font-size:1.4rem;letter-spacing:.3em;text-align:center}
.chat-opt{display:flex;gap:10px;align-items:flex-start;padding:8px 0;cursor:pointer;line-height:1.4}
.chat-opt input{margin-top:3px}
/* room page: full-height app layout */
.chat-app{display:flex;flex-direction:column;height:calc(100dvh - 62px);max-width:820px;margin:0 auto;background:#fff;border-inline:1px solid var(--line)}
.chat-top{display:flex;align-items:center;gap:8px;padding:8px 10px;border-bottom:1px solid var(--line)}
.chat-back{font-size:1.8rem;line-height:1;padding:0 8px;color:var(--ink);min-width:var(--tap);text-align:center}
.chat-tt{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.3}
.chat-tt strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-flag{min-width:40px}
.chat-voice{display:flex;align-items:center;gap:8px;padding:8px 10px;background:#f5f3ff;border-bottom:1px solid var(--line);flex-wrap:wrap}
.chat-voice[hidden]{display:none}
.chat-vpeople{flex:1;display:flex;gap:6px;flex-wrap:wrap;min-width:0}
.chat-vbtns{display:flex;gap:6px}
.chat-vbtns .btn{min-height:38px}
.vchip{display:inline-flex;align-items:center;gap:6px;background:#fff;border:1.5px solid #ddd6fe;border-radius:999px;padding:3px 10px 3px 6px;font-size:.85rem;max-width:150px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.vchip.me{border-color:var(--brand)}
.vdot{width:10px;height:10px;border-radius:50%;background:#c4b5fd;flex:none;transition:.1s}
.vchip.speaking{border-color:#22c55e;box-shadow:0 0 0 3px #bbf7d0}.vchip.speaking .vdot{background:#22c55e;transform:scale(1.3)}
.vchip.muted .vdot{background:#cbd5e1}
.chat-notice{margin:0;padding:6px 12px;background:#fffbeb;color:#78350f;border-bottom:1px solid #fde68a}
.chat-msgs{flex:1;overflow-y:auto;padding:12px 10px;display:flex;flex-direction:column;gap:8px;overscroll-behavior:contain;background:#f8fafc}
.cm{max-width:85%;align-self:flex-start;background:#fff;border:1px solid var(--line);border-radius:14px 14px 14px 4px;padding:6px 10px 8px}
.cm.mine{align-self:flex-end;background:var(--brand-soft);border-color:#c7d2fe;border-radius:14px 14px 4px 14px}
.cm.pending{opacity:.75;border-style:dashed}
.cm.gone .cm-t{color:var(--muted);font-style:italic}
.cm-h{display:flex;align-items:center;gap:8px;font-size:.78rem}
.cm-n{font-weight:700;color:var(--brand-ink);background:none;border:0;padding:0;font:inherit;font-weight:700;cursor:pointer}
span.cm-n{cursor:default}
.cm-time{color:var(--muted)}
.cm-flag{margin-left:auto;background:none;border:0;color:#94a3b8;cursor:pointer;font-size:.95rem;padding:2px 6px;min-width:32px;min-height:28px}
.cm-flag:hover{color:var(--err)}
.cm-t{white-space:pre-wrap;overflow-wrap:anywhere;font-size:1rem;line-height:1.45}
.cm-p{font-size:.75rem;color:var(--warn);margin-top:3px}
.cm-sys{align-self:center;text-align:center;font-size:.85rem;color:var(--muted);margin:4px 0}
.cm-sys.ok{color:var(--ok);font-weight:600}
.chat-wait{margin:auto;text-align:center;padding:30px 10px}
.spin{width:42px;height:42px;margin:0 auto 12px;border-radius:50%;border:4px solid var(--brand-soft);border-top-color:var(--brand);animation:chatspin 1s linear infinite}
@keyframes chatspin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.spin{animation:none}}
.chat-status{min-height:0;padding:0 12px;color:var(--muted)}
.chat-status:not(:empty){padding:6px 12px;border-top:1px solid var(--line)}
.chat-status.err{color:var(--err);background:var(--err-soft)}.chat-status.ok{color:var(--ok);background:var(--ok-soft)}
.chat-compose{display:flex;gap:8px;padding:8px 10px calc(8px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:#fff}
.chat-compose textarea{flex:1;resize:none;font:inherit;font-size:16px;padding:10px 12px;border:1.5px solid var(--line);border-radius:20px;min-height:44px;max-height:120px;line-height:1.4}
.chat-compose .btn{border-radius:50%;width:46px;height:46px;padding:0;font-size:1.1rem;flex:none}
.chat-dlg{max-width:420px;width:calc(100% - 24px);padding:18px;border:1px solid var(--line)}
.chat-dlg::backdrop{background:rgba(15,23,42,.45)}
.chat-dlg .chat-h2{margin:0 0 6px}
.chat-rq{background:#f1f5f9;border-radius:10px;padding:8px 10px;margin:6px 0;font-size:.9rem;overflow-wrap:anywhere;max-height:90px;overflow:auto}
.chat-rq:empty{display:none}
.chat-dlg .chat-opt{padding:5px 0}
.chat-blk{border-top:1px solid var(--line);margin-top:6px;padding-top:10px!important;font-weight:600}
.chat-blk[hidden]{display:none}
/* admin chat review */
.cr-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:8px;margin:12px 0}
.cr-stats .card{padding:10px 12px;display:flex;flex-direction:column}.cr-stats b{font-size:1.5rem}.cr-stats span{font-size:.8rem;color:var(--muted)}
.cr-item{padding:12px 14px;margin:0 0 10px;border-left:4px solid #94a3b8}
.cr-pending{border-left-color:var(--warn)}.cr-removed{border-left-color:var(--err)}.cr-hidden{border-left-color:#7c3aed}
.cr-h{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.cr-tag{font-size:.75rem;font-weight:700;background:#f1f5f9;border-radius:6px;padding:2px 8px}
.cr-pending .cr-tag{background:#fef3c7;color:#92400e}.cr-removed .cr-tag{background:#fee2e2;color:#991b1b}.cr-hidden .cr-tag{background:#ede9fe;color:#5b21b6}
.cr-rep{font-size:.8rem;color:var(--err);font-weight:600}
.cr-user{margin:6px 0}
.cr-ctx{background:#f8fafc;border-radius:8px;padding:6px 10px;margin:6px 0}
.cr-c{margin:2px 0;font-size:.9rem;overflow-wrap:anywhere}.cr-c b{margin-right:4px}
.cr-this{background:#fef2f2;border-radius:6px;padding:2px 6px}
.cr-acts{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.cr-rooms{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:8px}
.cr-room{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:8px 12px}.cr-room>span:first-of-type{flex:1}
.cr-bans form.inline{display:inline}
@media (max-width:520px){.chat-app{height:calc(100dvh - 62px);border:0}.chat-notice{font-size:.78rem}.chat-vbtns .btn{padding:6px 10px}.cm{max-width:92%}}
