:root {
  --teal: #4a9b9e;
  --teal-2: #3e8b8e;
  --teal-3: #2f7275;
  --teal-soft: #e6f2f2;
  --ink: #0f1414;
  --text: #1d2728;
  --muted: #6f7f80;
  --row: #f3f3f3;
  --row-hover: #ebeeee;
  --line: #e2e7e7;
  --chat-bg: #f1f5f4;
  --danger: #c4473f;
  --radius: 22px;
  --header-h: 92px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Hind', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

#app { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.boot { margin: auto; display: flex; align-items: center; gap: 12px; font-size: 32px; font-weight: 700; color: var(--teal); }
.boot img { width: 64px; }

/* ---------- top bar ---------- */
.topbar {
  flex: none;
  height: var(--header-h);
  background: var(--teal);
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 44px);
  padding-top: env(safe-area-inset-top);
  box-sizing: content-box;
  position: relative; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand img { width: 70px; height: auto; }
.brand span { font-size: 42px; font-weight: 700; letter-spacing: -.5px; line-height: 1; padding-top: 6px; }
.burger { width: 54px; height: 44px; display: flex; flex-direction: column; justify-content: space-between; padding: 6px 0; position: relative; }
.burger span { display: block; height: 4px; border-radius: 3px; background: #fff; }
.burger .badge-dot { position: absolute; top: -2px; right: -6px; }

/* ---------- layout ---------- */
.layout { flex: 1; min-height: 0; display: flex; }
.pane { min-height: 0; min-width: 0; display: flex; flex-direction: column; }
.list-pane { flex: 1; overflow-y: auto; position: relative; }
.chat-pane { flex: 1; background: var(--chat-bg); }
body[data-view="list"] .chat-pane { display: none; }
body[data-view="chat"] .list-pane { display: none; }
@media (min-width: 900px) {
  .list-pane { flex: 0 0 400px; border-right: 1px solid var(--line); }
  body[data-view] .chat-pane, body[data-view] .list-pane { display: flex; }
  .chat-head .back { display: none; }
}

/* ---------- chats list ---------- */
.page-title { text-align: center; font-size: 46px; font-weight: 700; color: var(--ink); margin: 26px 0 18px; line-height: 1.1; }
.chat-list { display: flex; flex-direction: column; gap: 12px; }
.chat-row {
  display: flex; align-items: center; gap: 18px; width: 100%; text-align: left;
  background: var(--row); padding: 14px 18px 14px 22px; min-height: 92px;
  border-radius: 0 18px 18px 0; transition: background .15s;
}
.chat-row:hover { background: var(--row-hover); }
.chat-row.active { background: var(--teal-soft); }
.chat-row .meta { flex: 1; min-width: 0; }
.chat-row .name { font-weight: 600; font-size: 19px; color: var(--ink); display: flex; align-items: center; gap: 6px; line-height: 1.3; }
.chat-row .preview { display: flex; align-items: center; gap: 8px; color: var(--teal); font-size: 17px; margin-top: 2px; }
.chat-row .preview span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row.unread .preview { color: var(--teal-3); font-weight: 600; }
.chat-row .right { align-self: flex-start; padding-top: 6px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.chat-row .time { font-weight: 600; font-size: 20px; color: var(--ink); }
.chat-row.unread .time { color: var(--teal-2); }
.count { background: var(--teal); color: #fff; font-size: 13px; font-weight: 600; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; padding: 1px 6px 0; }
.dot { width: 18px; height: 18px; border-radius: 50%; background: #c6d2d2; flex: none; }
.dot.on { background: var(--teal); }
.verified { width: 17px; height: 17px; flex: none; }

.info-pill {
  margin: 36px auto 120px; max-width: 380px; width: calc(100% - 40px);
  background: var(--teal); border-radius: 50px; padding: 14px 22px 14px 16px;
  display: flex; align-items: center; gap: 14px;
}
.info-pill .i { flex: none; width: 50px; height: 50px; border-radius: 50%; background: #161616; color: #fff; display: grid; place-items: center; font: 700 30px Georgia, serif; }
.info-pill p { margin: 0; font-size: 13px; line-height: 1.45; text-align: center; color: #10292a; }
.empty-note { text-align: center; color: var(--muted); padding: 10px 24px 0; font-size: 16px; }

.new-chat-fab {
  position: fixed; bottom: calc(26px + env(safe-area-inset-bottom)); left: 22px;
  background: var(--teal); color: #fff; font-size: 19px; padding: 12px 18px 9px; border-radius: 30px; z-index: 2;
  box-shadow: 0 6px 18px rgba(47, 114, 117, .28);
}
.new-chat-fab::after {
  content: ''; position: absolute; left: 16px; bottom: -16px; width: 26px; height: 18px; background: var(--teal);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.new-chat-fab:active { transform: scale(.97); }

/* ---------- avatars ---------- */
.avatar { flex: none; width: 76px; height: 76px; border-radius: 6px; object-fit: cover; background: #dfe7e7; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 28px; overflow: hidden; position: relative; }
.avatar.sm { width: 52px; height: 52px; font-size: 20px; }
.avatar.lg { width: 112px; height: 112px; font-size: 42px; border-radius: 14px; }
.avatar.sys { background: #e8f3f4; padding: 8px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sys img { object-fit: contain; }

/* ---------- sub header (new chat etc.) ---------- */
.sub-head { display: flex; align-items: center; gap: 16px; padding: 22px 22px 8px; }
.sub-head h2 { margin: 0; font-size: 32px; color: var(--ink); line-height: 1; padding-top: 4px; }
.circle-btn { width: 52px; height: 52px; border-radius: 50%; background: var(--teal); color: #111; display: grid; place-items: center; flex: none; }
.circle-btn svg { width: 26px; height: 26px; }
.searchbox { margin: 12px 22px; position: relative; }
.searchbox input {
  width: 100%; border: 2px solid var(--line); border-radius: 30px; padding: 14px 18px 11px 50px; font-size: 17px; outline: none; background: #fff;
}
.searchbox input:focus { border-color: var(--teal); }
.searchbox svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; color: var(--muted); }
.section-label { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 22px 8px; font-weight: 600; }
.hint { margin: 0 22px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.user-row { display: flex; align-items: center; gap: 14px; padding: 10px 22px; }
.user-row .meta { flex: 1; min-width: 0; cursor: pointer; }
.user-row .name { font-weight: 600; font-size: 18px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-row .uname { color: var(--teal-2); font-size: 15px; }
.user-row .acts { display: flex; gap: 8px; }
.pill-btn { border-radius: 20px; padding: 8px 14px 5px; font-weight: 600; font-size: 15px; background: var(--teal); color: #fff; white-space: nowrap; }
.pill-btn.ghost { background: var(--teal-soft); color: var(--teal-3); }
.pill-btn:disabled { opacity: .55; cursor: default; }

/* ---------- chat pane ---------- */
.chat-empty { margin: auto; text-align: center; color: var(--muted); padding: 24px; }
.chat-empty img { width: 120px; margin: 0 auto 14px; opacity: .9; }
.chat-empty h3 { color: var(--ink); font-size: 26px; margin: 0 0 6px; }
.chat-head { flex: none; background: #fff; display: flex; align-items: center; gap: 18px; padding: 16px clamp(14px, 3vw, 40px) 14px; position: relative; z-index: 3; }
.chat-head .who { flex: 1; min-width: 0; cursor: pointer; }
.chat-head .who .name { font-size: 40px; font-weight: 700; color: var(--ink); line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-top: 4px; display: flex; align-items: center; gap: 8px; }
.chat-head .who .status { color: var(--teal); font-size: 17px; margin-left: clamp(0px, 7vw, 130px); }
.chat-head .who .status.typing { font-style: italic; }
.chat-head .back { width: 62px; height: 62px; }
.chat-head .back svg { width: 34px; height: 34px; }
.kebab { display: flex; flex-direction: column; gap: 10px; padding: 4px 8px; }
.kebab span { width: 22px; height: 22px; border-radius: 50%; background: var(--teal); }

.menu {
  position: absolute; right: 18px; top: calc(100% - 6px); background: #fff; border-radius: 14px; min-width: 210px; padding: 6px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .16); z-index: 20;
}
.menu button { display: block; width: 100%; text-align: left; padding: 11px 14px 9px; border-radius: 9px; font-size: 16px; }
.menu button:hover { background: var(--row); }
.menu button.danger { color: var(--danger); }

.messages {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  background: var(--chat-bg) url(pattern.svg) repeat; background-size: 340px;
  padding: 18px clamp(12px, 3vw, 40px) 22px;
  display: flex; flex-direction: column;
}
.e2e-pill {
  align-self: center; display: flex; align-items: center; gap: 10px; background: var(--teal); border-radius: 18px;
  padding: 10px 26px 8px 16px; font-weight: 600; font-size: 17px; color: #0f1414; margin-bottom: 14px;
}
.e2e-pill svg { width: 30px; height: 34px; margin-top: -3px; }
.day-pill { align-self: center; background: #d4d9d9; color: #fff; font-weight: 700; font-size: 20px; border-radius: 20px; padding: 6px 30px 3px; margin: 8px 0 18px; }
.load-more { align-self: center; color: var(--teal-3); font-weight: 600; padding: 6px 14px; margin-bottom: 8px; }

.msg { display: flex; flex-direction: column; max-width: min(78%, 560px); margin-bottom: 5px; }
.msg.in { align-self: flex-start; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.msg.tail { margin-bottom: 22px; }
.bubble {
  position: relative; background: var(--teal); color: #fff; border-radius: 26px; padding: 12px 18px 8px;
  font-weight: 600; font-size: 18px; line-height: 1.3; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 90px;
}
.msg.out .bubble { background: var(--teal-2); }
.msg.tail .bubble::after {
  content: ''; position: absolute; bottom: -15px; width: 30px; height: 18px; background: inherit;
}
.msg.in.tail .bubble::after { left: 26px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.msg.out.tail .bubble::after { right: 26px; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.bubble a { color: #fff; text-decoration: underline; }
.bubble .stamp { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 13px; font-weight: 400; opacity: .92; margin-top: 2px; white-space: nowrap; }
.bubble .ticks { width: 17px; height: 12px; }
.bubble .ticks.read { color: #bff3ff; }
.msg.pending .bubble { opacity: .7; }
.msg.failed .bubble { background: var(--danger); }
.msg.locked .bubble { background: #9fb3b4; font-style: italic; font-weight: 500; }
.msg.system .bubble { background: #fff; color: var(--text); border: 2px solid var(--teal); font-weight: 500; }
.msg.system.tail .bubble::after { background: var(--teal); }
.msg.system .stamp { color: var(--muted); }

.audio { display: flex; align-items: center; gap: 12px; min-width: 210px; padding: 2px 0; }
.audio .play { width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--teal-3); display: grid; place-items: center; flex: none; }
.audio .play svg { width: 18px; height: 18px; }
.audio .track { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .35); position: relative; cursor: pointer; }
.audio .track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: #fff; width: 0; }
.audio .dur { font-size: 13px; font-weight: 500; min-width: 34px; }

/* ---------- composer ---------- */
.composer {
  flex: none; background: var(--teal); border-radius: var(--radius) var(--radius) 0 0;
  padding: 12px clamp(10px, 2vw, 22px) calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 12px;
}
.composer .field { flex: 1; background: #fff; border-radius: 30px; display: flex; align-items: center; min-height: 58px; padding: 0 26px; }
.composer textarea {
  flex: 1; border: 0; outline: none; resize: none; background: transparent; font-size: 22px; line-height: 1.3;
  max-height: 140px; padding: 15px 0 11px; min-height: 58px;
}
.composer .send { width: 58px; height: 58px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; color: #111; }
.composer .send svg { width: 28px; height: 28px; }
.composer .send.rec { background: #ffe9e7; color: var(--danger); }
.composer .recording { flex: 1; display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 19px; }
.composer .recording .red { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
.composer .recording .cancel { margin-left: auto; color: var(--danger); font-weight: 600; font-size: 16px; padding: 6px 4px; }
.composer.readonly { justify-content: center; color: #fff; font-size: 16px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); padding-top: 18px; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- drawer & modals ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10, 30, 30, .38); z-index: 50; animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 88vw); background: #fff; z-index: 51;
  display: flex; flex-direction: column; animation: slide .22s ease-out; padding-top: env(safe-area-inset-top);
  border-radius: var(--radius) 0 0 var(--radius); overflow-y: auto;
}
@keyframes slide { from { transform: translateX(100%); } }
.drawer .me { background: var(--teal); color: #fff; padding: 28px 22px 22px; border-radius: 0 0 var(--radius) var(--radius); }
.drawer .me .avatar { margin-bottom: 12px; border: 3px solid rgba(255, 255, 255, .6); }
.drawer .me .nm { font-size: 24px; font-weight: 700; line-height: 1.15; }
.drawer .idchip { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .18); border-radius: 20px; padding: 6px 12px 4px; font-size: 15px; color: #fff; }
.drawer .idchip svg { width: 15px; height: 15px; }
.drawer nav { padding: 12px 10px; display: flex; flex-direction: column; }
.drawer nav button { display: flex; align-items: center; gap: 14px; text-align: left; padding: 13px 14px 10px; border-radius: 12px; font-size: 18px; font-weight: 500; }
.drawer nav button:hover { background: var(--row); }
.drawer nav button svg { width: 22px; height: 22px; color: var(--teal-2); flex: none; }
.drawer nav button.danger, .drawer nav button.danger svg { color: var(--danger); }
.drawer .foot { margin-top: auto; padding: 18px 22px calc(18px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.drawer .foot svg { width: 16px; color: var(--teal); }

.modal {
  position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 28px));
  max-height: calc(100dvh - 40px); overflow-y: auto; background: #fff; border-radius: 24px; padding: 26px 24px 22px; animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translate(-50%, -46%); opacity: 0; } }
@media (max-width: 560px) {
  .modal { top: auto; bottom: 0; transform: translateX(-50%); width: 100vw; border-radius: 24px 24px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
  @keyframes up { from { transform: translate(-50%, 100%); } }
}
.modal h3 { margin: 0 0 16px; font-size: 26px; color: var(--ink); }
.modal .profile { text-align: center; }
.modal .profile .avatar { margin: 0 auto 12px; }
.modal .profile .nm { font-size: 26px; font-weight: 700; color: var(--ink); display: flex; justify-content: center; gap: 8px; align-items: center; }
.modal .profile .un { color: var(--teal-2); font-size: 17px; }
.modal .profile .ab { margin: 12px 0 0; color: var(--muted); }
.modal .row-btns { display: flex; gap: 10px; margin-top: 20px; }
.modal .row-btns > * { flex: 1; }
.avatar-edit { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.avatar-edit .links { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.link { color: var(--teal-2); font-weight: 600; }
.link.danger { color: var(--danger); }

/* ---------- forms / auth ---------- */
.auth { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 28px 18px 40px; }
.auth-card { width: 100%; max-width: 440px; }
.auth h1 { font-size: 38px; line-height: 1.1; margin: 8px 0 8px; color: var(--ink); text-align: center; }
.auth .lead { color: var(--muted); text-align: center; margin: 0 0 26px; font-size: 17px; line-height: 1.45; }
.auth .lead b { color: var(--text); }
.field-label { display: block; font-weight: 600; font-size: 15px; margin: 0 0 6px 6px; color: var(--text); }
.input {
  display: flex; align-items: center; border: 2px solid var(--line); border-radius: 18px; background: #fff; margin-bottom: 16px; overflow: hidden;
  transition: border-color .15s;
}
.input:focus-within { border-color: var(--teal); }
.input input { flex: 1; min-width: 0; border: 0; outline: none; padding: 15px 16px 12px; font-size: 18px; background: transparent; }
.input .affix { padding: 0 16px; color: var(--muted); font-size: 17px; white-space: nowrap; background: var(--row); align-self: stretch; display: flex; align-items: center; padding-top: 3px; }
.input .affix.pre { padding: 3px 0 0 16px; background: none; color: var(--teal-2); font-weight: 600; }
.input .eye { padding: 0 14px; color: var(--muted); align-self: stretch; }
.input .eye svg { width: 22px; }
.input.code input { text-align: center; letter-spacing: 14px; font-size: 30px; font-weight: 700; padding-left: 28px; }
.field-note { margin: -10px 0 14px 8px; font-size: 14px; color: var(--muted); min-height: 18px; }
.field-note.ok { color: #2f8a5a; }
.field-note.err { color: var(--danger); }
.btn {
  width: 100%; background: var(--teal); color: #fff; font-weight: 600; font-size: 19px; border-radius: 30px; padding: 15px 20px 12px;
  display: flex; align-items: center; justify-content: center; gap: 10px; transition: background .15s;
}
.btn:hover { background: var(--teal-2); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.secondary { background: var(--teal-soft); color: var(--teal-3); }
.btn.danger { background: var(--danger); }
.spinner { width: 20px; height: 20px; border: 3px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth .alt { text-align: center; margin-top: 20px; color: var(--muted); font-size: 16px; display: flex; flex-direction: column; gap: 10px; }
.auth .alt button { color: var(--teal-2); font-weight: 600; }
.steps { display: flex; justify-content: center; gap: 8px; margin-bottom: 18px; }
.steps i { width: 34px; height: 6px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--teal); }
.notice { background: var(--teal-soft); color: var(--teal-3); border-radius: 14px; padding: 12px 14px 10px; font-size: 14px; line-height: 1.45; margin-bottom: 16px; display: flex; gap: 10px; }
.notice svg { width: 18px; flex: none; margin-top: 1px; }
.notice.warn { background: #fff4e5; color: #8a5300; }

/* ---------- toasts ---------- */
#toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast { background: #1d2b2c; color: #fff; padding: 11px 18px 9px; border-radius: 14px; font-size: 15px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); animation: pop2 .2s; max-width: 440px; text-align: center; }
.toast.err { background: var(--danger); }
@keyframes pop2 { from { transform: translateY(10px); opacity: 0; } }

/* ---------- mobile sizing ---------- */
@media (max-width: 700px) {
  :root { --header-h: 68px; --radius: 18px; }
  .brand img { width: 50px; }
  .brand span { font-size: 30px; }
  .burger { width: 38px; height: 32px; padding: 4px 0; }
  .burger span { height: 3px; }
  .page-title { font-size: 34px; margin: 20px 0 14px; }
  .chat-row { gap: 14px; padding: 12px 14px 12px 16px; min-height: 76px; }
  .chat-row .avatar { width: 56px; height: 56px; font-size: 22px; }
  .chat-row .name { font-size: 17px; }
  .chat-row .preview { font-size: 15.5px; }
  .chat-row .time { font-size: 16px; }
  .dot { width: 14px; height: 14px; }
  .chat-head { gap: 12px; padding: 10px 12px; }
  .chat-head .back { width: 44px; height: 44px; }
  .chat-head .back svg { width: 24px; height: 24px; }
  .chat-head .avatar { width: 48px; height: 48px; font-size: 19px; }
  .chat-head .who .name { font-size: 24px; }
  .chat-head .who .status { font-size: 14px; margin-left: 0; }
  .kebab { gap: 5px; }
  .kebab span { width: 9px; height: 9px; }
  .e2e-pill { font-size: 14px; padding: 7px 18px 5px 12px; border-radius: 14px; }
  .e2e-pill svg { width: 22px; height: 26px; }
  .day-pill { font-size: 15px; padding: 4px 22px 2px; }
  .bubble { font-size: 16px; padding: 10px 15px 6px; border-radius: 22px; }
  .composer { gap: 8px; }
  .composer .field { min-height: 48px; padding: 0 18px; }
  .composer textarea { font-size: 17px; min-height: 48px; padding: 13px 0 9px; }
  .composer .send { width: 48px; height: 48px; }
  .composer .send svg { width: 22px; height: 22px; }
  .new-chat-fab { font-size: 17px; }
  .auth h1 { font-size: 30px; }
}
@media (min-width: 900px) {
  .page-title { font-size: 38px; }
  .chat-row .avatar { width: 60px; height: 60px; font-size: 24px; }
  .chat-head .who .name { font-size: 32px; }
  .chat-head .back { display: none; }
}

/* ---------- admin panel ---------- */
.admin { flex: 1; overflow-y: auto; padding-bottom: 40px; }
.admin > * { max-width: 860px; margin-left: auto; margin-right: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding: 10px 22px; }
.stat { background: var(--teal); color: #fff; border-radius: 18px; padding: 14px 16px 10px; display: flex; flex-direction: column; }
.stat b { font-size: 30px; line-height: 1.1; }
.stat span { font-size: 14px; opacity: .92; }
.card { background: var(--row); border-radius: 20px; margin: 14px 16px; padding: 18px 18px 16px; }
.card h3 { margin: 0 0 6px; font-size: 22px; color: var(--ink); }
.card textarea { width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 16px; line-height: 1.45; resize: vertical; outline: none; background: #fff; margin-top: 10px; }
.card textarea:focus { border-color: var(--teal); }
.card-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.hint.flat, .searchbox.flat, .user-row.flat { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
.admin-users { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.admin-row { background: #fff; border-radius: 16px; padding: 4px 14px 12px; }
.admin-row.banned { opacity: .7; }
.admin-row .sub { color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 2px; overflow-wrap: anywhere; }
.admin-row .name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; white-space: normal; }
.tag { background: var(--teal-soft); color: var(--teal-3); font-size: 12px; font-weight: 600; border-radius: 8px; padding: 2px 8px 0; }
.tag.red { background: #fde8e6; color: var(--danger); }
.toggles { display: flex; gap: 18px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.toggles > div { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 13px; background: #cfd8d8; transition: background .15s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--teal); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:disabled { cursor: default; }
.switch input:disabled + i { opacity: .45; }
