/* «Круг» — индиго, фиолетово-розовый градиент и прозрачные карточки по теме «Дисциплины». */
:root {
  --bg: #1c1269;
  --page-bg: linear-gradient(165deg, #1c1269 0%, #371d74 28%, #5d2b80 55%, #823a8c 78%, #b84fa1 100%);
  --surface: rgba(42, 26, 120, .6);
  --surface-2: rgba(255, 255, 255, .09);
  --surface-3: rgba(255, 255, 255, .17);
  --overlay: #2a1a70;
  --ink: #ffffff;
  --ink-2: #eee3fb;
  --muted: #d3bdeb;
  --line: rgba(255, 255, 255, .16);
  --lavender: #bea5e6;
  --lavender-deep: #a98be0;
  --accent: #ff7cc4;
  --accent-hover: #ff9bd3;
  --accent-fill: #f93fa5;
  --accent-soft: rgba(249, 63, 165, .18);
  --button: linear-gradient(120deg, #c12281, #a82aa8);
  --on-accent: #ffffff;
  --badge-ink: #270b3e;
  --own: linear-gradient(140deg, #9230a5, #662a99);
  --danger: #ffb5bf;
  --danger-soft: rgba(255, 90, 110, .18);
  --ok: #8ee6ba;
  --ok-soft: rgba(61, 190, 123, .16);
  --shadow-sm: 0 2px 8px rgba(16, 6, 48, .12);
  --shadow: 0 10px 30px rgba(16, 6, 48, .22);
  --shadow-lg: 0 24px 60px rgba(16, 6, 48, .4);
  --radius: 24px;
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page-bg) fixed; min-height: 100dvh; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.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; }

/* Знак */
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 750; font-size: 26px; letter-spacing: -1px; }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; display: block; filter: drop-shadow(0 2px 4px rgba(60, 30, 120, .18)); }
.brand.small { font-size: 22px; }
.brand.small .brand-mark { width: 34px; height: 34px; }

/* Поля и кнопки */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 16px 0; }
label small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 6px; }
input, textarea, select {
  width: 100%; margin-top: 7px; padding: 13px 15px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea { resize: vertical; }
.primary {
  width: 100%; border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 650; font-size: 15px;
  background: var(--button); color: var(--on-accent); box-shadow: 0 6px 22px rgba(249, 63, 165, .24);
  transition: background .15s, transform .1s;
}
.primary:hover { filter: brightness(1.12); }
.primary:active { transform: translateY(1px); }
.ghost, .danger {
  border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: 8px 13px; font-size: 13px; font-weight: 550;
}
.ghost:hover { background: var(--surface-2); }
.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.danger:hover { background: var(--danger-soft); }
.danger.solid { background: #af254b; color: #fff; border-color: transparent; }
.link { border: 0; background: none; padding: 6px 0; color: var(--accent); font-weight: 600; font-size: 14px; }
.link.center { display: block; margin: 14px auto 0; }
.icon-button { border: 0; background: none; color: var(--muted); font-size: 24px; line-height: 1; padding: 6px 10px; border-radius: 10px; }
.icon-button:hover { background: var(--surface-2); color: var(--ink); }
.eyebrow { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.muted { color: var(--muted); font-size: 14px; line-height: 1.6; }
.error { color: var(--danger); font-size: 13px; line-height: 1.5; margin: 10px 0; }
.error:empty { display: none; }
.badge { display: inline-block; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 650; border-radius: 7px; padding: 3px 8px; }

/* Вход и регистрация */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.hero {
  position: relative; overflow: hidden; padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background: radial-gradient(ellipse at 75% 25%, rgba(190, 120, 255, .14), transparent 65%); color: var(--ink);
}
.hero-body { max-width: 540px; }
.hero-mark { position: relative; width: min(340px, 70%); aspect-ratio: 1; color: #fff; --dot: #1c1726; margin: 0 0 28px -18px; }
.hero-mark > img { display: block; width: 78%; margin: 11%; filter: drop-shadow(0 24px 40px rgba(60, 30, 120, .3)); transform: rotate(-6deg); }
.bubble {
  position: absolute; background: #fff; color: #1c1726; font-size: 15px; font-weight: 550; padding: 11px 16px; border-radius: 18px;
  box-shadow: 0 12px 30px rgba(60, 30, 120, .2); white-space: nowrap; animation: float 6s ease-in-out infinite;
}
.b1 { left: 62%; top: 40%; border-bottom-left-radius: 6px; }
.b2 { left: 8%; top: 70%; border-bottom-right-radius: 6px; animation-delay: -2s; background: #1c1726; color: #fff; }
.b3 { left: 46%; top: 82%; border-bottom-left-radius: 6px; animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-8px); } }
.hero h1 { font-size: clamp(44px, 5.2vw, 76px); line-height: 1.02; letter-spacing: -3px; font-weight: 750; }
.hero-text { font-size: 18px; line-height: 1.6; margin-top: 18px; max-width: 440px; color: var(--muted); }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-points li { background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(6px); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 48px 28px; }
.auth-card { width: 100%; max-width: 452px; padding: 28px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface); backdrop-filter: blur(16px); box-shadow: var(--shadow); }
.auth-card h2 { font-size: 30px; letter-spacing: -1px; margin: 10px 0 8px; }
.tabs { display: flex; background: var(--surface-2); border-radius: 14px; padding: 4px; margin-top: 24px; }
.tabs button { flex: 1; border: 0; background: none; border-radius: 11px; padding: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.tabs button.selected { background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255, 124, 196, .35); }
.footnote { text-align: center; font-size: 12px; color: var(--muted); margin-top: 24px; }
.telegram-box { display: flex; gap: 12px; background: var(--accent-soft); border-radius: 16px; padding: 14px 16px; margin: 16px 0; font-size: 13px; line-height: 1.5; }
.telegram-box.ok { background: var(--ok-soft); }
.telegram-box.ok .tg-icon { background: var(--ok); }
.telegram-box p { color: var(--ink-2); margin-top: 3px; }
.tg-icon { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: #2aabee; color: #fff; font-size: 15px; }
.telegram-link { display: inline-block; margin-top: 10px; background: #2aabee; color: #fff; border-radius: 10px; padding: 9px 14px; font-weight: 650; }
.telegram-link:hover { background: #1f9bd9; }
#recover h2 { font-size: 26px; letter-spacing: -.8px; margin: 14px 0 8px; }
.recover-wait { text-align: center; margin-top: 22px; }
.big-code { font-size: 64px; font-weight: 800; letter-spacing: 2px; color: var(--accent); background: var(--accent-soft); border-radius: 24px; padding: 14px 0; margin: 14px auto; max-width: 200px; font-variant-numeric: tabular-nums; }

/* Рабочее пространство */
.workspace { height: 100dvh; display: grid; grid-template-columns: 340px minmax(0, 1fr); max-width: 1600px; margin: auto; background: transparent; }
.sidebar { display: flex; flex-direction: column; min-height: 0; padding: 18px 14px 12px; border-right: 1px solid var(--line); background: var(--surface); }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.connection { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 4px 10px; }
.connection.online { color: var(--ok); background: var(--ok-soft); }
.side-title { padding: 20px 6px 0; }
.side-title h2 { font-size: 24px; letter-spacing: -.8px; }
.search-label { margin: 14px 0 10px; }
.search-label input { background: var(--surface-2); border-color: transparent; border-radius: 12px; padding: 11px 14px; font-size: 14px; }
.announcement { display: flex; align-items: flex-start; gap: 10px; margin: 14px 2px 0; padding: 12px 8px 12px 14px; border-radius: 14px; background: var(--accent-soft); font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.announcement p { flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; }
.announcement .icon-button { font-size: 18px; padding: 0 6px; }
.app-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.app-actions button { border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); background: none; color: var(--accent); border-radius: 11px; padding: 8px 12px; font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.sidebar > .eyebrow { padding: 6px 8px 8px; font-size: 10px; }
.chats { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.chat-item { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; background: none; padding: 10px; border-radius: 14px; margin-bottom: 2px; transition: background .12s; }
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--accent-soft); }
.chat-preview { min-width: 0; flex: 1; }
.chat-preview strong { display: block; font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-preview small { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-time { font-size: 11px; color: var(--muted); align-self: flex-start; margin-top: 3px; }
.list-empty { font-size: 14px; color: var(--muted); line-height: 1.7; padding: 12px 10px; }
.my-profile { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; padding: 14px 8px 4px; margin-top: 8px; }
.my-text { flex: 1; min-width: 0; }
.my-text strong { display: block; font-size: 14px; }
.my-text small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.chevron { color: var(--muted); font-size: 22px; }

/* Аватары: цвет зависит от имени */
.avatar { width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 18px; background: #e9e2f7; color: #5b43b0; }
.avatar[data-tone="1"] { background: #fde4d4; color: #a3501b; }
.avatar[data-tone="2"] { background: #d8f0e3; color: #1f7449; }
.avatar[data-tone="3"] { background: #dbe8fb; color: #2c5ea8; }
.avatar[data-tone="4"] { background: #fbe0ea; color: #a33461; }
.avatar[data-tone="5"] { background: #f6efc9; color: #85700f; }
.avatar { background: #3a2f5c; color: #d9ccff; }
.avatar[data-tone="1"] { background: #4a3021; color: #ffc9a6; }
.avatar[data-tone="2"] { background: #1f3d2e; color: #a6e6c3; }
.avatar[data-tone="3"] { background: #22334f; color: #b0cdf7; }
.avatar[data-tone="4"] { background: #4a2333; color: #ffb6cf; }
.avatar[data-tone="5"] { background: #43391a; color: #f0dc8a; }

/* Разговор */
.conversation { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: transparent; }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 14px 24px; min-height: 74px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); flex-shrink: 0; }
.chat-header .avatar { width: 42px; height: 42px; font-size: 16px; }
.chat-header .avatar:empty { display: none; }
.peer-text { min-width: 0; }
.peer-text strong { display: block; font-size: 16px; }
.peer-text small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#back { display: none; font-size: 34px; padding: 0 8px 4px; }
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; }
.empty-mark { width: 150px; height: 150px; margin-bottom: 26px; filter: drop-shadow(0 18px 34px rgba(60, 30, 120, .28)); transform: rotate(-6deg); }
.empty h2 { font-size: 28px; letter-spacing: -1px; margin-bottom: 12px; }
.empty > p { color: var(--muted); line-height: 1.7; font-size: 15px; }
.hint { margin-top: 26px; font-size: 13px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: 11px 16px; border-radius: 12px; }
.thread { flex: 1; overflow-y: auto; padding: 24px 28px; min-height: 0; }
.messages { display: flex; flex-direction: column; gap: 6px; max-width: 860px; margin: 0 auto; }
.message {
  position: relative; max-width: min(72%, 560px); align-self: flex-start; padding: 9px 14px 7px; background: var(--surface);
  border-radius: 20px 20px 20px 6px; box-shadow: var(--shadow-sm); overflow-wrap: anywhere; animation: pop .18s ease-out;
}
.message.own { align-self: flex-end; background: var(--own); color: #fff; border-radius: 20px 20px 6px 20px; }
.message p { font-size: 15px; line-height: 1.45; white-space: pre-wrap; }
.message time { display: block; text-align: right; font-size: 11px; color: var(--muted); margin-top: 3px; }
.message.own time { color: rgba(255, 255, 255, .75); }
/* Галочки: одна — доставлено, две — прочитано */
.ticks::before { content: ' ✓'; letter-spacing: -3px; }
.message.read .ticks::before { content: ' ✓✓'; }
.message.own.read time { color: #fff; }
/* Большие эмодзи без пузыря */
.message.jumbo { background: none; box-shadow: none; padding: 0 4px; }
.message.jumbo p { font-size: 44px; line-height: 1.15; }
.message.jumbo time, .message.own.jumbo time { color: var(--muted); }
.message a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
/* Цитата, на которую отвечают */
.quote { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--ink-2); border-radius: 8px; padding: 5px 9px; margin: 2px 0 6px; font-size: 13px; line-height: 1.35; }
.message.own .quote { background: rgba(255, 255, 255, .18); border-left-color: #fff; color: #fff; }
.quote b { display: block; font-size: 12px; }
.quote span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Реакции */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; }
.reactions:not(:empty) { margin: 6px 0 2px; }
.chip { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: 2px 8px; font-size: 13px; line-height: 1.5; animation: pop .18s ease-out; }
.chip.mine { border-color: var(--accent); background: var(--accent-soft); }
.message.own .chip { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .35); color: #fff; }
.message.own .chip.mine { background: #fff; color: #662a99; }
.message.own.jumbo .chip { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
/* Кнопки у сообщения: ответить, реакция, жалоба */
.tools-row { position: absolute; top: -14px; right: 10px; display: flex; gap: 2px; background: var(--overlay); border: 1px solid var(--line); border-radius: 999px; padding: 2px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 2; }
.message.own .tools-row { right: auto; left: 10px; }
.message:hover .tools-row, .message:focus-within .tools-row { opacity: 1; pointer-events: auto; }
.tools-row button { border: 0; background: none; color: var(--muted); font-size: 14px; width: 28px; height: 26px; border-radius: 999px; }
.tools-row button:hover { background: var(--surface-2); color: var(--ink); }
.tools-row .flag:hover { color: var(--danger); background: var(--danger-soft); }
@media (hover: none) { .tools-row { display: none; } .message.tapped .tools-row { display: flex; position: static; opacity: .9; pointer-events: auto; box-shadow: none; border: 0; background: none; padding: 0; margin-top: 2px; justify-content: flex-end; } .message.own .tools-row button { color: rgba(255, 255, 255, .8); } }
.picker { position: absolute; top: -52px; left: 0; display: flex; gap: 2px; background: var(--overlay); border: 1px solid var(--line); border-radius: 999px; padding: 4px; box-shadow: var(--shadow-lg); z-index: 3; animation: pop .15s ease-out; }
.message.own .picker { left: auto; right: 0; }
.picker[hidden] { display: none; }
.picker button { border: 0; background: none; font-size: 22px; width: 38px; height: 38px; border-radius: 50%; transition: transform .1s; }
.picker button:hover { background: var(--surface-2); transform: scale(1.2); }
.messages { padding-top: 16px; }
/* Ответ над полем ввода */
.reply-bar { display: flex; align-items: center; gap: 10px; max-width: 868px; width: calc(100% - 48px); margin: 0 auto -4px; padding: 8px 6px 8px 14px; background: var(--surface); border-radius: 14px 14px 0 0; border-left: 3px solid var(--accent); font-size: 13px; box-shadow: var(--shadow-sm); }
.reply-bar[hidden] { display: none; }
.reply-bar > div { flex: 1; min-width: 0; }
.reply-bar b { display: block; color: var(--accent); font-size: 12px; }
.reply-bar span:not(.reply-mark) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.reply-mark { color: var(--accent); font-size: 18px; }
/* Статус собеседника и непрочитанные */
.peer-text small.online { color: var(--ok); }
.peer-text small.typing { color: var(--accent); font-style: italic; }
.avatar.is-online { position: relative; }
.avatar.is-online::after { content: ''; position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #3cbf76; border: 2px solid var(--surface); }
.unread { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent-fill); color: var(--badge-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; align-self: center; }
.chat-item.has-unread strong { font-weight: 800; }
.chat-item.has-unread small { color: var(--ink-2); }
@keyframes pop { from { transform: translateY(6px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.older { display: block; margin: 0 auto 18px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 16px; font-size: 13px; color: var(--muted); }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 12px 24px calc(14px + env(safe-area-inset-bottom)); background: transparent; max-width: 916px; width: 100%; margin: 0 auto; }
.composer textarea { flex: 1; margin: 0; resize: none; max-height: 160px; border-radius: 22px; padding: 12px 18px; font-size: 15px; line-height: 1.4; box-shadow: var(--shadow-sm); }
.send { width: 46px; height: 46px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--button); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(249, 63, 165, .28); transition: transform .1s, filter .15s; }
.send:hover { filter: brightness(1.12); }
.send:active { transform: scale(.94); }
.send svg { width: 22px; height: 22px; fill: none; stroke: var(--on-accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Диалоги и уведомления */
dialog { border: 1px solid var(--line); border-radius: 24px; padding: 26px; width: min(440px, calc(100vw - 32px)); background: var(--overlay); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(22, 16, 36, .45); backdrop-filter: blur(4px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-heading h2 { font-size: 22px; letter-spacing: -.6px; }
.password-box { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.password-box summary { cursor: pointer; font-size: 14px; font-weight: 650; color: var(--accent); }
.admin-link { display: block; text-align: center; margin-top: 16px; padding: 12px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: 14px; }
.logout { display: block; margin: 14px auto 0; border: 0; background: none; color: var(--danger); font-size: 14px; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; max-width: calc(100vw - 32px); padding: 13px 20px; border-radius: 14px; background: #1c1726; color: #fff; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .2s ease-out; }

/* Планшеты и телефоны */
@media (max-width: 960px) {
  .hero { padding: 36px; }
  .workspace { grid-template-columns: 300px minmax(0, 1fr); }
  .message { max-width: 85%; }
}
@media (max-width: 720px) {
  .auth { display: block; }
  .hero { padding: 22px 20px 26px; gap: 18px; }
  .hero-mark, .hero-points { display: none; }
  .hero-text { font-size: 15px; margin-top: 10px; }
  .hero h1 { font-size: 34px; letter-spacing: -1.4px; }
  .auth-panel { padding: 28px 16px 36px; align-items: flex-start; }
  .auth-card h2 { font-size: 26px; }
  .workspace { display: block; }
  .sidebar { height: 100dvh; border: 0; padding-top: calc(14px + env(safe-area-inset-top)); }
  .conversation { display: none; height: 100dvh; }
  .workspace.chat-open .sidebar { display: none; }
  .workspace.chat-open .conversation { display: flex; }
  .chat-header { padding: calc(8px + env(safe-area-inset-top)) 10px 8px; min-height: 62px; gap: 8px; }
  #back { display: block; }
  .thread { padding: 14px 12px; }
  .composer { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
  .message { max-width: 86%; }
  .empty h2 { font-size: 24px; }
}

/* Админка */
.admin { background: var(--page-bg) fixed; color: var(--ink); min-height: 100dvh; }
.admin-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.admin-top .brand-name small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.admin-back { font-size: 14px; font-weight: 600; color: var(--accent); }
.admin-main { max-width: 1120px; margin: auto; padding: 24px 16px 64px; }
.admin-main section { margin-top: 30px; }
.admin-main h2 { font-size: 20px; letter-spacing: -.5px; margin-bottom: 12px; }
.admin-note { font-size: 13px; color: var(--ink-2); background: var(--accent-soft); border-radius: 14px; padding: 12px 16px; line-height: 1.6; }
.role-line { font-size: 13px; color: var(--muted); margin-top: 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.stat strong { display: block; font-size: 26px; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.stat span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.chart h3 { font-size: 14px; margin-bottom: 10px; }
.chart svg { width: 100%; height: 140px; display: block; }
.chart .bar { fill: var(--lavender); }
.chart .bar.last { fill: var(--accent); }
.chart .axis { fill: var(--muted); font-size: 9px; }
.chart .value { fill: var(--ink-2); font-size: 9px; font-weight: 600; }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.tools textarea { min-height: 80px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.cards { display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.card .eyebrow { color: var(--danger); }
.who { font-size: 14px; margin: 10px 0; }
.card blockquote { margin: 0; background: var(--danger-soft); border-left: 3px solid var(--danger); border-radius: 10px; padding: 10px 14px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.context { margin-top: 12px; display: grid; gap: 6px; }
.line { font-size: 13px; line-height: 1.5; padding: 7px 11px; border-radius: 10px; background: var(--surface-2); overflow-wrap: anywhere; white-space: pre-wrap; }
.line b { margin-right: 8px; }
.line time { color: var(--muted); font-size: 11px; margin-right: 8px; }
.line.suspect { background: color-mix(in srgb, var(--danger-soft) 60%, var(--surface-2)); }
.line.flagged { outline: 2px solid var(--danger); }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.section-head { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.section-head input { max-width: 300px; margin: 0; padding: 10px 14px; font-size: 14px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 650; }
tr:last-child td { border-bottom: 0; }
tr.banned td { color: var(--muted); }
td.online { color: var(--ok); font-weight: 600; }
td .badge { margin-right: 8px; }
td select.role { width: auto; margin: 0 8px 0 0; padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.log { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 13px; }
.log li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 9px 13px; }
.log time { color: var(--muted); margin-right: 6px; }
.admin-denied { max-width: 440px; margin: 80px auto; text-align: center; padding: 0 16px; }
.admin-denied h2 { font-size: 26px; letter-spacing: -.8px; margin-bottom: 10px; }
.admin-denied .primary { margin-top: 22px; }
.message:not(.own):not(.jumbo) { box-shadow: inset 0 0 0 1px var(--line); }

/* Фото: аватарки, вложения, просмотр */
.avatar { position: relative; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar.big { width: 84px; height: 84px; font-size: 32px; }
.avatar-edit { display: flex; align-items: center; gap: 16px; margin: 6px 0 4px; }
.avatar-edit .row { display: flex; gap: 8px; margin-top: 6px; }
.avatar-edit .muted { margin: 0; }
.photo { display: block; max-width: 100%; max-height: 380px; min-height: 60px; border-radius: 14px; margin: 1px 0 4px; cursor: zoom-in; background: var(--surface-2); }
.message.has-photo { padding: 5px 5px 6px; }
.message.has-photo > p, .message.has-photo > time, .message.has-photo > .reactions, .message.has-photo > .quote { margin-left: 7px; margin-right: 7px; width: auto; }
.attach { width: 46px; height: 46px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--muted); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.attach:hover { color: var(--accent); background: var(--accent-soft); }
.attach svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.attach circle { fill: currentColor; stroke: none; }
.photo-bar img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.viewer { width: auto; max-width: 96vw; max-height: 96dvh; padding: 0; border: 0; background: transparent; box-shadow: none; overflow: hidden; cursor: zoom-out; }
.viewer::backdrop { background: rgba(10, 8, 16, .88); }
.viewer img { display: block; max-width: 96vw; max-height: 96dvh; border-radius: 12px; }
.report-photo { display: block; max-width: min(100%, 320px); max-height: 320px; border-radius: 12px; margin-top: 8px; }
/* Правка, удаление, поиск, блокировка */
.message.deleted { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.message.deleted p { font-style: italic; font-size: 14px; }
.message.own.deleted { background: transparent; color: var(--muted); }
.message.own.deleted time { color: var(--muted); }
.message.found { outline: 3px solid var(--lavender); outline-offset: 3px; transition: outline-color 1s; }
.reply-bar.editing { border-left-color: var(--ok); }
.reply-bar.editing b { color: var(--ok); }
.chat-header { position: relative; }
.menu-button { margin-left: auto; font-size: 22px; }
.chat-menu { position: absolute; right: 16px; top: 62px; z-index: 5; display: flex; flex-direction: column; min-width: 220px; background: var(--overlay); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: var(--shadow-lg); }
.chat-menu[hidden] { display: none; }
.chat-menu button { border: 0; background: none; text-align: left; padding: 11px 12px; border-radius: 10px; font-size: 14px; color: var(--ink); }
.chat-menu button:hover { background: var(--surface-2); }
.chat-menu .danger-text { color: var(--danger); }
.chat-search { border-bottom: 1px solid var(--line); background: var(--surface); padding: 10px 24px; flex-shrink: 0; }
.chat-search[hidden] { display: none; }
.chat-search-row { display: flex; gap: 6px; align-items: center; max-width: 860px; margin: 0 auto; }
.chat-search-row input { margin: 0; flex: 1; border-radius: 12px; padding: 10px 14px; font-size: 14px; background: var(--surface-2); border-color: transparent; }
.chat-search-results { max-width: 860px; margin: 6px auto 0; max-height: 40vh; overflow-y: auto; }
.chat-search-results:empty { display: none; }
.search-hit { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 10px; }
.search-hit:hover { background: var(--surface-2); }
.search-hit b { font-size: 13px; }
.search-hit time { font-size: 12px; color: var(--muted); justify-self: end; }
.search-hit span { grid-column: 1 / -1; font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread { position: relative; }
.latest { position: sticky; bottom: 8px; display: block; margin: 12px auto 0; border: 0; border-radius: 999px; padding: 9px 16px; background: var(--button); color: var(--on-accent); font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
.latest[hidden] { display: none; }
.blocked-note { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 14px 24px calc(16px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--muted); text-align: center; }
.blocked-note[hidden] { display: none; }
.composer.is-blocked { display: none; }
.invite-friend { width: 100%; margin-top: 14px; padding: 11px; }
/* Группы */
.side-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.small-button { padding: 6px 11px; font-size: 12px; border-radius: 10px; }
.avatar.group-avatar { border-radius: 30%; }
.avatar.group-avatar img { border-radius: 30%; }
.message .author { display: block; font-size: 12px; font-weight: 700; margin-bottom: 2px; color: #c9b8ff; }
.message .author[data-tone="1"] { color: #ffc9a6; } .message .author[data-tone="2"] { color: #a6e6c3; }
.message .author[data-tone="3"] { color: #b0cdf7; } .message .author[data-tone="4"] { color: #ffb6cf; } .message .author[data-tone="5"] { color: #f0dc8a; }
.message.has-photo > .author { margin: 2px 7px 4px; }
.pick-list { max-height: 260px; overflow-y: auto; margin: 4px -6px 8px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 12px; margin: 0; font-weight: 500; font-size: 14px; color: var(--ink); cursor: pointer; }
.pick:hover { background: var(--surface-2); }
.pick input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.pick .avatar { width: 36px; height: 36px; font-size: 14px; }
.pick > span:not(.avatar) { flex: 1; min-width: 0; }
.pick small { color: var(--muted); font-weight: 400; }
.found-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.found-list button { text-align: left; }
.row-form { display: flex; gap: 8px; margin: 10px 0 16px; }
.row-form input { margin: 0; flex: 1; }
/* Голосовые */
.voice { display: flex; align-items: center; gap: 10px; min-width: 210px; padding: 2px 0; }
.voice-play { width: 38px; height: 38px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--button); color: var(--on-accent); font-size: 13px; display: grid; place-items: center; }
.message.own .voice-play { background: #fff; color: #662a99; }
.voice-track { flex: 1; height: 6px; border-radius: 999px; background: color-mix(in srgb, currentColor 22%, transparent); cursor: pointer; position: relative; overflow: hidden; }
.voice-track span { position: absolute; inset: 0 auto 0 0; width: 0; background: currentColor; border-radius: inherit; }
.voice-time { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .8; min-width: 32px; }
.voice-button svg rect { fill: none; }
.composer.recording > :not(.record-bar) { display: none; }
.record-bar { flex: 1; display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 22px; padding: 6px 6px 6px 16px; box-shadow: var(--shadow-sm); }
.record-bar[hidden] { display: none; }
.record-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
#record-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.record-hint { flex: 1; color: var(--muted); font-size: 13px; }
.record-bar .primary { width: auto; margin: 0; padding: 9px 16px; }

/* Выбор оформления в профиле. */
.theme-settings { min-width: 0; padding: 18px 0 0; margin: 24px 0 0; border: 0; border-top: 1px solid var(--line); }
.theme-settings legend { padding: 0 8px 0 0; font-size: 14px; font-weight: 650; color: var(--ink); }
.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.theme-option { position: relative; display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 9px 6px; margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; font-size: 11px; color: var(--ink-2); }
.theme-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.theme-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); box-shadow: 0 0 0 1px var(--accent); }
.theme-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 4px; }
.theme-preview { display: block; position: relative; width: 100%; height: 48px; border-radius: 8px; border: 1px solid rgba(128, 128, 128, .3); overflow: hidden; }
.theme-preview::before, .theme-preview::after { content: ''; position: absolute; height: 9px; border-radius: 5px; }
.theme-preview::before { top: 10px; left: 8px; width: 52%; }
.theme-preview::after { bottom: 10px; right: 8px; width: 62%; }
.theme-preview-violet { background: linear-gradient(145deg, #1c1269, #b84fa1); }
.theme-preview-violet::before { background: #5d2b80; }
.theme-preview-violet::after { background: #f93fa5; }
.theme-preview-light { background: #fafafa; }
.theme-preview-light::before { background: #dedede; }
.theme-preview-light::after { background: #252525; }
.theme-preview-dark { background: #101010; }
.theme-preview-dark::before { background: #383838; }
.theme-preview-dark::after { background: #e5e5e5; }
.theme-note { margin-top: 12px; font-size: 11px; line-height: 1.5; color: var(--muted); }

/* Две монохромные темы: цвета фотографий и вложений сохраняются. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f5;
  --page-bg: linear-gradient(#fafafa, #ededed);
  --surface: #ffffff;
  --surface-2: #f0f0f0;
  --surface-3: #e5e5e5;
  --overlay: #ffffff;
  --ink: #171717;
  --ink-2: #333333;
  --muted: #666666;
  --line: #dddddd;
  --lavender: #9b9b9b;
  --lavender-deep: #777777;
  --accent: #242424;
  --accent-hover: #444444;
  --accent-fill: #242424;
  --accent-soft: #e9e9e9;
  --button: #242424;
  --on-accent: #ffffff;
  --badge-ink: #ffffff;
  --own: #292929;
  --own-ink: #ffffff;
  --own-muted: #dedede;
  --own-detail-bg: rgba(255, 255, 255, .18);
  --own-detail-line: rgba(255, 255, 255, .35);
  --own-selected-bg: #ffffff;
  --own-selected-ink: #242424;
  --danger: #555555;
  --danger-soft: #ebebeb;
  --ok: #444444;
  --ok-soft: #ededed;
  --shadow-sm: 0 1px 3px #0000000d;
  --shadow: 0 8px 26px #00000014;
  --shadow-lg: 0 24px 60px #00000030;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101010;
  --page-bg: linear-gradient(#101010, #181818);
  --surface: #1d1d1d;
  --surface-2: #282828;
  --surface-3: #353535;
  --overlay: #242424;
  --ink: #f5f5f5;
  --ink-2: #e0e0e0;
  --muted: #b0b0b0;
  --line: #3b3b3b;
  --lavender: #9b9b9b;
  --lavender-deep: #777777;
  --accent: #eeeeee;
  --accent-hover: #cccccc;
  --accent-fill: #eeeeee;
  --accent-soft: #333333;
  --button: #eeeeee;
  --on-accent: #171717;
  --badge-ink: #171717;
  --own: #dedede;
  --own-ink: #171717;
  --own-muted: #444444;
  --own-detail-bg: rgba(0, 0, 0, .06);
  --own-detail-line: rgba(0, 0, 0, .22);
  --own-selected-bg: #242424;
  --own-selected-ink: #ffffff;
  --danger: #cccccc;
  --danger-soft: #333333;
  --ok: #dddddd;
  --ok-soft: #303030;
  --shadow-sm: 0 1px 3px #00000030;
  --shadow: 0 8px 26px #00000050;
  --shadow-lg: 0 24px 60px #00000080;
}
:root:is([data-theme="light"], [data-theme="dark"]) .hero { background: transparent; }
:root:is([data-theme="light"], [data-theme="dark"]) :is(.brand-mark, .hero-mark > img, .empty-mark) { filter: grayscale(1); }
:root:is([data-theme="light"], [data-theme="dark"]) :is(.primary, .send) { box-shadow: var(--shadow-sm); }
:root:is([data-theme="light"], [data-theme="dark"]) .tabs button.selected { box-shadow: inset 0 0 0 1px var(--line); }
:root:is([data-theme="light"], [data-theme="dark"]) .avatar { background: var(--surface-3); color: var(--ink-2); }
:root:is([data-theme="light"], [data-theme="dark"]) .avatar.is-online::after { background: var(--accent); }
:root:is([data-theme="light"], [data-theme="dark"]) .message .author { color: var(--ink-2); }
:root:is([data-theme="light"], [data-theme="dark"]) .message.own { color: var(--own-ink); }
:root:is([data-theme="light"], [data-theme="dark"]) .message.own .author { color: var(--own-ink); }
:root:is([data-theme="light"], [data-theme="dark"]) .message.own time { color: var(--own-muted); }
:root:is([data-theme="light"], [data-theme="dark"]) .message.own :is(.quote, .chip) { color: var(--own-ink); background: var(--own-detail-bg); border-color: var(--own-detail-line); }
:root:is([data-theme="light"], [data-theme="dark"]) .message.own :is(.chip.mine, .voice-play) { color: var(--own-selected-ink); background: var(--own-selected-bg); }
:root:is([data-theme="light"], [data-theme="dark"]) .message.own .tools-row button { color: var(--muted); }
:root:is([data-theme="light"], [data-theme="dark"]) .message.own.tapped .tools-row button { color: var(--own-ink); }
:root:is([data-theme="light"], [data-theme="dark"]) .message.own.jumbo { color: var(--ink); }
:root:is([data-theme="light"], [data-theme="dark"]) .message.own.jumbo :is(time, .tools-row button) { color: var(--muted); }
:root:is([data-theme="light"], [data-theme="dark"]) .message.own.deleted { color: var(--muted); }
:root:is([data-theme="light"], [data-theme="dark"]) .message.own.deleted time { color: var(--muted); }
:root:is([data-theme="light"], [data-theme="dark"]) :is(.tg-icon, .telegram-link) { color: var(--on-accent); background: var(--button); }
:root:is([data-theme="light"], [data-theme="dark"]) .telegram-link:hover { filter: brightness(.85); }
:root:is([data-theme="light"], [data-theme="dark"]) .danger.solid { color: var(--on-accent); background: var(--button); }
/* Профиль: обложка, крупное фото, разделы настроек */
.profile-dialog { padding: 0; max-height: min(92dvh, 860px); overflow-y: auto; overscroll-behavior: contain; }
.profile-cover { position: relative; height: 112px; background: linear-gradient(135deg, #6a3fd1, #c03fa0); }
[data-cover="sunset"] { background: linear-gradient(135deg, #ffb35c, #ff5e7e 55%, #8f3fbf); }
[data-cover="ocean"] { background: linear-gradient(135deg, #1565c0, #26c6da); }
[data-cover="forest"] { background: linear-gradient(135deg, #1b5e20, #9ccc65); }
[data-cover="night"] { background: radial-gradient(circle at 20% 30%, rgba(255,255,255,.7) 0 1px, transparent 2px), radial-gradient(circle at 70% 20%, rgba(255,255,255,.6) 0 1px, transparent 2px), radial-gradient(circle at 85% 65%, rgba(255,255,255,.5) 0 1px, transparent 2px), linear-gradient(135deg, #0b0c2a, #3a2d7a); }
[data-cover="peach"] { background: linear-gradient(135deg, #ffd3a5, #fd6585); }
[data-cover="violet"] { background: linear-gradient(135deg, #6a3fd1, #c03fa0); }
.cover-close { position: absolute; top: 10px; right: 10px; background: rgba(0, 0, 0, .28); color: #fff; width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 22px; }
.cover-close:hover { background: rgba(0, 0, 0, .45); color: #fff; }
.profile-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 24px 6px; margin-top: -48px; }
.profile-photo { position: relative; }
.avatar.huge { width: 96px; height: 96px; font-size: 38px; box-shadow: 0 0 0 4px var(--overlay); }
.photo-button { position: absolute; right: -2px; bottom: -2px; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--overlay); background: var(--accent-fill, var(--accent)); color: var(--on-accent, #fff); display: grid; place-items: center; padding: 0; cursor: pointer; }
.photo-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.profile-head h2 { margin: 12px 0 2px; font-size: 22px; letter-spacing: -.4px; }
.profile-handle { margin: 0; color: var(--muted); font-size: 14px; }
.profile-status { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.profile-status.online { color: var(--ok); }
.profile-about { margin: 12px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-about.empty-about { color: var(--muted); font-style: italic; font-size: 14px; }
.profile-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0 6px; }
.profile-actions .primary { width: auto; margin: 0; padding: 10px 18px; }
.settings-group { margin: 14px 18px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); }
.settings-group h3, .settings-group .theme-settings legend { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--ink); padding: 0; }
.settings-group .theme-settings { margin: 0; padding: 0; border: 0; }
.settings-group .password-box { margin-top: 0; border-top: 0; padding-top: 0; }
.settings-group label { margin: 10px 0; }
.field-title { margin: 14px 0 6px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; font-size: 14px; font-weight: 500; color: var(--ink); }
.setting-row > span { min-width: 0; flex: 1; }
.setting-row b { display: block; font-size: 14px; }
.setting-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.setting-row select { width: auto; max-width: 52%; margin: 0; padding: 8px 10px; font-size: 13px; }
.settings-list .setting-row { padding: 6px 0; border-bottom: 1px solid var(--line); margin: 0; }
.settings-list .setting-row:last-child { border-bottom: 0; }
.cover-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cover-option { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; margin: 0; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.cover-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cover-swatch { width: 100%; height: 38px; border-radius: 12px; border: 2px solid transparent; }
.cover-option:has(input:checked) .cover-swatch { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cover-option:has(input:focus-visible) .cover-swatch { outline: 2px solid var(--accent); outline-offset: 2px; }
.profile-footer { padding: 6px 18px 22px; }
.profile-footer .invite-friend { margin-top: 14px; }
.clickable { cursor: pointer; }
.message .author { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; text-align: left; }
.message .author:hover { text-decoration: underline; }
.pick.clickable:hover { background: var(--surface-2); }
/* Пересланное, стикеры, закреп, смайлики, статус, настройки группы */
.forwarded { display: block; font-size: 12px; font-weight: 600; opacity: .75; margin-bottom: 3px; }
.message.sticker { background: none; box-shadow: none; padding: 0 4px; }
.message.sticker > p { font-size: 92px; line-height: 1.05; }
.message.sticker time, .message.own.sticker time { color: var(--muted); }
.pin-bar { display: flex; align-items: center; gap: 4px; padding: 6px 12px 6px 18px; border-bottom: 1px solid var(--line); background: var(--surface); flex-shrink: 0; }
.pin-bar[hidden] { display: none; }
.pin-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--ink); text-align: left; padding: 4px 0; cursor: pointer; }
.pin-open > span:last-child { min-width: 0; }
.pin-open b { display: block; font-size: 12px; color: var(--accent); }
.pin-open #pin-text { display: block; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer { position: relative; }
.emoji-panel { position: absolute; left: 12px; right: 12px; bottom: calc(100% + 4px); max-width: 420px; background: var(--overlay); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 6; }
.emoji-panel[hidden] { display: none; }
.emoji-tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.emoji-tabs button { flex: 1; border: 0; border-radius: 10px; padding: 7px; font-size: 13px; font-weight: 650; background: none; color: var(--muted); cursor: pointer; }
.emoji-tabs button.selected { background: var(--surface-3); color: var(--ink); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; max-height: 220px; overflow-y: auto; }
.emoji-grid button { border: 0; background: none; font-size: 24px; height: 40px; border-radius: 10px; cursor: pointer; }
.emoji-grid button:hover { background: var(--surface-3); }
.emoji-grid.stickers { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.emoji-grid.stickers button { font-size: 44px; height: 64px; }
.emoji-button { font-size: 21px; }
.profile-mood { margin: 6px 0 0; padding: 4px 12px; border-radius: 999px; background: var(--surface-3); font-size: 13px; font-weight: 600; color: var(--ink); }
.group-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 4px 0 6px; }
.group-head .avatar.huge { box-shadow: none; }
.group-dialog .settings-group { margin: 12px 0 4px; }
#group-describe-form textarea { min-height: 0; }
#group-describe-form { margin-bottom: 8px; }
.composer.has-text #voice, .composer:not(.has-text) #send { display: none; }

/* Приглашение, состояния, приватность */
.invite-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 14px; border-radius: 18px; background: var(--accent-soft); border: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.invite-card[hidden] { display: none; }
.invite-card b { display: block; font-size: 15px; color: var(--ink); margin-bottom: 2px; }
.invite-wave { font-size: 26px; line-height: 1; }
.small-link { font-size: 12px; padding: 0; display: inline; }
.thread-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.thread-state[hidden] { display: none; }
.thread-state[data-state="loading"] p::before { content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.offline-banner { position: fixed; top: env(safe-area-inset-top); left: 50%; transform: translateX(-50%); z-index: 50; width: min(560px, calc(100vw - 24px)); margin-top: 8px; padding: 10px 16px; border-radius: 14px; background: #b3261e; color: #fff; font-size: 13px; font-weight: 600; text-align: center; box-shadow: var(--shadow); }
.offline-banner[hidden] { display: none; }
.peer-text { min-width: 0; flex: 1; }
.peer-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message .author { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.privacy-page { background: var(--page-bg, var(--bg)); background-attachment: fixed; min-height: 100dvh; }
.privacy { max-width: 720px; margin: 0 auto; padding: 28px 20px 48px; line-height: 1.6; }
.privacy h1 { font-size: 34px; letter-spacing: -1px; margin: 26px 0 8px; }
.privacy-lead { color: var(--muted); font-size: 16px; margin: 0 0 18px; }
.privacy section { margin: 14px 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.privacy h2 { font-size: 18px; margin: 0 0 8px; }
.privacy ul { margin: 0; padding-left: 20px; }
.privacy li { margin: 6px 0; color: var(--ink-2); }
.privacy p { color: var(--ink-2); margin: 8px 0; }
.privacy-back { margin-top: 24px; }
/* Админка по разделам */
.admin-main { max-width: 1240px; padding: 20px 16px 64px; }
.admin-main section { margin-top: 0; }
.admin-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; align-items: start; }
.admin-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); backdrop-filter: blur(14px); box-shadow: var(--shadow-sm); }
.admin-nav button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 650; text-align: left; padding: 11px 12px; border-radius: 14px; cursor: pointer; }
.admin-nav button[hidden] { display: none; }
.admin-nav button span { width: 22px; text-align: center; font-size: 16px; }
.admin-nav button:hover { background: var(--surface-2); color: var(--ink); }
.admin-nav button.selected { background: var(--accent-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent-fill); color: var(--on-accent); font-size: 12px; display: grid; place-items: center; }
.nav-count[hidden] { display: none; }
.admin-nav-foot { margin-top: 8px; padding: 10px 12px 4px; border-top: 1px solid var(--line); }
.admin-nav-foot .role-line { margin: 0 0 6px; }
.nav-hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.admin-content { min-width: 0; }
.panel-head { margin-bottom: 16px; }
.panel-head h2 { font-size: 26px; letter-spacing: -.8px; margin: 0 0 4px; }
.panel-head p { margin: 0; color: var(--muted); font-size: 14px; }
.stats { margin-top: 0; }
.stat { position: relative; }
.stat-icon { position: absolute; top: 14px; right: 16px; font-size: 18px; opacity: .9; }
.stat.ok strong { color: var(--ok); }
.stat.alert { border-color: var(--danger); background: var(--danger-soft); }
.charts { margin-top: 14px; }
.admin-note { margin-top: 14px; }
.panel h3 { font-size: 15px; margin: 0 0 10px; }
.admin-search { max-width: 420px; margin: 0 0 12px; }
.users-table .actions-cell { white-space: nowrap; }
@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; gap: 14px; }
  .admin-nav { position: sticky; top: 66px; z-index: 4; flex-direction: row; overflow-x: auto; padding: 6px; border-radius: 18px; scrollbar-width: none; }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav button { width: auto; flex-shrink: 0; padding: 9px 12px; }
  .admin-nav button.selected { box-shadow: inset 0 -3px 0 var(--accent); }
  .admin-nav-foot { display: none; }
  .panel-head h2 { font-size: 22px; }
}
@media (max-width: 1100px) {
  /* Таблица пользователей — карточками */
  .users-table thead { display: none; }
  .users-table, .users-table tbody, .users-table tr, .users-table td { display: block; width: 100%; }
  .users-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .users-table td { padding: 3px 0; border: 0; }
  .users-table td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); font-size: 12px; }
  .users-table td:first-child { font-weight: 700; font-size: 15px; }
  .users-table td:first-child::before { content: none; }
  .users-table .actions-cell { white-space: normal; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
}
/* Статус отправки */
.message.pending { opacity: .75; }
.send-state { display: block; font-size: 11px; margin-top: 3px; text-align: right; opacity: .9; }
.message.failed { box-shadow: inset 0 0 0 2px var(--danger); }
.message.failed .send-state { color: inherit; font-weight: 600; }
.send-state button { border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; padding: 0; cursor: pointer; }
#new-below[hidden] { display: none; }
/* Меню «Ещё» — снизу на телефоне, по центру на компьютере */
.message-menu { width: min(360px, calc(100vw - 24px)); padding: 8px; }
.message-menu #message-menu-list { display: flex; flex-direction: column; }
.message-menu button { border: 0; background: none; color: var(--ink); text-align: left; font: inherit; font-size: 15px; padding: 13px 14px; border-radius: 12px; cursor: pointer; }
.message-menu button:hover { background: var(--surface-2); }
.message-menu .danger-text { color: var(--danger); }
@media (max-width: 720px) { .message-menu { margin: auto auto 12px; border-radius: 22px; } }
/* Меню скрепки */
.attach-menu { position: absolute; left: 60px; bottom: calc(100% + 4px); display: flex; flex-direction: column; min-width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--overlay); box-shadow: var(--shadow-lg); z-index: 6; }
.attach-menu[hidden] { display: none; }
.attach-menu button { border: 0; background: none; color: var(--ink); text-align: left; font: inherit; font-size: 14px; font-weight: 600; padding: 11px 12px; border-radius: 10px; cursor: pointer; }
.attach-menu button:hover { background: var(--surface-2); }
/* Опрос и план */
.message.interactive { min-width: min(300px, 78vw); }
.poll-card, .plan-card { display: flex; flex-direction: column; gap: 6px; padding: 2px 0 4px; }
.card-title { font-size: 15px; line-height: 1.35; }
.card-foot { font-size: 12px; opacity: .8; }
.poll-option { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; overflow: hidden; border: 1px solid color-mix(in srgb, currentColor 25%, transparent); background: color-mix(in srgb, currentColor 6%, transparent); color: inherit; font: inherit; font-size: 14px; text-align: left; padding: 9px 12px; border-radius: 12px; cursor: pointer; }
.poll-option.mine { border-color: currentColor; font-weight: 700; }
.poll-fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, currentColor 16%, transparent); transition: width .3s; }
.poll-label, .poll-count { position: relative; }
.poll-count { font-size: 12px; opacity: .85; }
.plan-when { font-size: 14px; font-weight: 600; }
.plan-place { font-size: 13px; opacity: .9; }
.plan-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.plan-button { flex: 1 1 0; min-width: 0; white-space: nowrap; border: 1px solid color-mix(in srgb, currentColor 30%, transparent); background: none; color: inherit; font: inherit; font-size: 13px; font-weight: 650; padding: 8px 6px; border-radius: 999px; cursor: pointer; }
.plan-button.mine { background: color-mix(in srgb, currentColor 18%, transparent); border-color: currentColor; }
.poll-inputs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.poll-inputs input { margin: 0; }
#create-dialog form .primary { margin-top: 12px; }
/* Первые шаги */
.first-steps { margin: 12px 2px 4px; padding: 12px 12px 8px; border: 1px solid var(--line); border-radius: 18px; background: var(--accent-soft); }
.first-steps[hidden] { display: none; }
.first-steps-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.first-steps-head b { font-size: 14px; }
.step { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 13px; text-align: left; padding: 7px 4px; border-radius: 10px; cursor: pointer; }
.step:hover { background: var(--surface-2); }
.step-mark { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--muted); }
.step.done { color: var(--muted); text-decoration: line-through; cursor: default; }
.step.done .step-mark { border-color: var(--ok); background: var(--ok); box-shadow: inset 0 0 0 3px var(--overlay); }
/* Участники группы */
.member-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.member-actions .small-button { padding: 5px 9px; font-size: 11px; }
.invite-link { font-size: 13px; word-break: break-all; color: var(--ink-2); background: var(--surface-2); border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; }
#group-invite .row { display: flex; flex-wrap: wrap; gap: 6px; }
/* Дизайн: шапка в одну строку, связь — только при обрыве */
.side-top { gap: 10px; }
.side-top .connection { margin-left: auto; }
.connection.online { display: none; }
.new-group { margin-left: auto; width: 38px; height: 38px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.connection:not(.online) + .new-group { margin-left: 0; }
.new-group:hover { background: var(--accent-soft); color: var(--accent); }
.new-group svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
#list-label[hidden] { display: none; }
#search { margin-top: 4px; }
/* Разделители дней */
.day-divider { display: flex; justify-content: center; margin: 14px 0 6px; position: sticky; top: 4px; z-index: 1; pointer-events: none; }
.day-divider span { font-size: 12px; font-weight: 650; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(10px); padding: 4px 12px; border-radius: 999px; }
/* Подряд идущие сообщения одного человека — плотнее, имя автора один раз */
.message.cont { margin-top: -3px; }
.message.cont > .author { display: none; }
.message:not(.own).has-next { border-bottom-left-radius: 8px; }
.message:not(.own).cont { border-top-left-radius: 8px; }
.message.own.has-next { border-bottom-right-radius: 8px; }
.message.own.cont { border-top-right-radius: 8px; }
/* «печатает…» в списке чатов */
.chat-preview small.typing-preview { color: var(--accent); font-style: italic; }
/* Свайп для ответа */
.message { transition: transform .12s ease-out; touch-action: pan-y; }
.message.swipe-ready::before { content: '↩'; position: absolute; left: -30px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--accent); }
/* Аватарки в фиолетовой теме — мягкие градиенты в тон */
:root[data-theme="violet"] .avatar { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
:root[data-theme="violet"] .avatar[data-tone="0"] { background: linear-gradient(135deg, #8f6cf0, #c25fd6); }
:root[data-theme="violet"] .avatar[data-tone="1"] { background: linear-gradient(135deg, #ff9a6b, #f0568f); }
:root[data-theme="violet"] .avatar[data-tone="2"] { background: linear-gradient(135deg, #3fc79a, #2a9bc4); }
:root[data-theme="violet"] .avatar[data-tone="3"] { background: linear-gradient(135deg, #5f8dff, #7a5cf2); }
:root[data-theme="violet"] .avatar[data-tone="4"] { background: linear-gradient(135deg, #f272b6, #b04fd8); }
:root[data-theme="violet"] .avatar[data-tone="5"] { background: linear-gradient(135deg, #f7c04a, #f08a3c); }
/* Тема «Ночь»: спокойный почти чёрный фон, мягкая сирень, немного розового. Градиент — только на входе и в обложке профиля. */
:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #111018;
  --page-bg: #111018;
  --surface: #1b1924;
  --surface-2: rgba(255, 255, 255, .05);
  --surface-3: rgba(255, 255, 255, .09);
  --overlay: #1e1c28;
  --ink: #f1eef8;
  --ink-2: #d8d3e5;
  --muted: #9a94aa;
  --line: rgba(255, 255, 255, .08);
  --lavender: #b9a6e8;
  --lavender-deep: #9d88dc;
  --accent: #c7b4ff;
  --accent-hover: #d8caff;
  --accent-fill: #8d72e6;
  --accent-soft: rgba(185, 160, 255, .12);
  --button: #8d72e6;
  --on-accent: #ffffff;
  --badge-ink: #1b1530;
  --own: #3a2f5f;
  --own-ink: #f1eef8;
  --own-muted: #b8aed6;
  --own-detail-bg: rgba(255, 255, 255, .08);
  --own-detail-line: rgba(255, 255, 255, .22);
  --own-selected-bg: #f1eef8;
  --own-selected-ink: #2a2148;
  --danger: #ff9aa9;
  --danger-soft: rgba(255, 110, 130, .14);
  --ok: #86dcb0;
  --ok-soft: rgba(80, 200, 140, .14);
  --shadow-sm: none;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
}
:root[data-theme="night"] .auth { background: radial-gradient(120% 80% at 15% 0%, #2a1f5c 0%, #17131f 55%, #111018 100%); }
:root[data-theme="night"] .sidebar { background: #15131d; }
:root[data-theme="night"] .chat-header, :root[data-theme="night"] .pin-bar { background: rgba(21, 19, 29, .92); }
:root[data-theme="night"] .message { box-shadow: none; }
:root[data-theme="night"] .message.own { color: var(--own-ink); }
:root[data-theme="night"] .message.own time, :root[data-theme="night"] .message.own .send-state { color: var(--own-muted); }
:root[data-theme="night"] .message.own :is(.quote, .chip) { color: var(--own-ink); background: var(--own-detail-bg); border-color: var(--own-detail-line); }
:root[data-theme="night"] .message.own :is(.chip.mine, .voice-play) { color: var(--own-selected-ink); background: var(--own-selected-bg); }
:root[data-theme="night"] .message.own .tools-row button { color: var(--muted); }
:root[data-theme="night"] .message.own.tapped .tools-row button { color: var(--own-ink); }
:root[data-theme="night"] .message.own.jumbo, :root[data-theme="night"] .message.own.sticker { color: var(--ink); }
:root[data-theme="night"] .message time { font-size: 10.5px; opacity: .9; }
:root[data-theme="night"] .unread, :root[data-theme="night"] .nav-count { background: #e86fae; color: #fff; }
:root[data-theme="night"] :is(.primary, .send) { box-shadow: none; }
:root[data-theme="night"] .avatar { color: #fff; }
:root[data-theme="night"] .avatar[data-tone="0"] { background: linear-gradient(135deg, #6f58c9, #9a5cb8); }
:root[data-theme="night"] .avatar[data-tone="1"] { background: linear-gradient(135deg, #c77a5a, #b8547a); }
:root[data-theme="night"] .avatar[data-tone="2"] { background: linear-gradient(135deg, #3a9e80, #317e9e); }
:root[data-theme="night"] .avatar[data-tone="3"] { background: linear-gradient(135deg, #5271c9, #6550c0); }
:root[data-theme="night"] .avatar[data-tone="4"] { background: linear-gradient(135deg, #c25d97, #8c48b0); }
:root[data-theme="night"] .avatar[data-tone="5"] { background: linear-gradient(135deg, #c99a3e, #c2713a); }
.theme-preview-night { background: #111018; }
.theme-preview-night::before { background: #2a2636; }
.theme-preview-night::after { background: #8d72e6; }
.theme-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Единый набор контурных значков на кнопках */
.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.tools-row button { display: grid; place-items: center; }
.tools-row .icon { width: 17px; height: 17px; }
#back .icon { width: 26px; height: 26px; }
.menu-button .icon { width: 24px; height: 24px; }
.chat-menu button, .attach-menu button, .message-menu button { display: flex; align-items: center; gap: 12px; }
.chat-menu .icon, .attach-menu .icon, .message-menu .icon { color: var(--muted); }
.message-menu .danger-text .icon { color: var(--danger); }
.emoji-button { display: grid; place-items: center; }
.emoji-button .icon { width: 22px; height: 22px; }
.reply-mark .icon { width: 18px; height: 18px; }
.accent-icon { color: var(--accent); width: 18px; height: 18px; }
.with-icon { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.with-icon .icon { width: 18px; height: 18px; }

/* Настройки отдельным экраном */
.settings-heading { padding: 22px 22px 4px; margin: 0; }
.settings-dialog .settings-group:first-of-type { margin-top: 8px; }
.settings-button { flex-shrink: 0; }
.settings-button .icon { width: 22px; height: 22px; }
.my-profile { flex: 1; min-width: 0; }
.sidebar > .my-profile, .sidebar > .settings-button { margin-top: 8px; }
/* Первые шаги — свёрнуто в одну строку */
.first-steps:not(.open) .step { display: none; }
.first-steps:not(.open) .first-steps-head { margin-bottom: 0; }
.first-steps { padding: 8px 10px; }
.first-steps-toggle { flex: 1; display: flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; padding: 4px; cursor: pointer; }
.first-steps-toggle span { font-size: 12px; color: var(--muted); }
.first-steps-toggle::after { content: '›'; margin-left: auto; color: var(--muted); transition: transform .15s; }
.first-steps.open .first-steps-toggle::after { transform: rotate(90deg); }
/* «Планы круга» */
.plan-head { display: flex; gap: 12px; align-items: flex-start; }
.plan-date { flex-shrink: 0; width: 54px; padding: 6px 0; border-radius: 14px; text-align: center; background: color-mix(in srgb, currentColor 12%, transparent); }
.plan-date b { display: block; font-size: 24px; line-height: 1.1; }
.plan-date span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; opacity: .85; }
.plan-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plan-people { display: flex; align-items: center; gap: 0; margin-top: 4px; }
.avatar.tiny { width: 24px; height: 24px; font-size: 11px; margin-right: -6px; box-shadow: 0 0 0 2px var(--surface); }
.plan-people small { margin-left: 12px; font-size: 12px; opacity: .85; }
.me-row { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; }
.me-row .my-profile { border-top: 0; margin-top: 0; padding-top: 8px; }
/* Выбор темы компактнее: четыре маленькие плитки в ряд */
.theme-options { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.theme-option { padding: 6px 4px; gap: 5px; font-size: 11.5px; border-radius: 12px; }
.theme-preview { height: 28px; border-radius: 7px; }
.theme-preview::before, .theme-preview::after { height: 5px; border-radius: 3px; }
.theme-preview::before { top: 6px; left: 5px; }
.theme-preview::after { bottom: 6px; right: 5px; }
.settings-group .theme-note { margin-top: 6px; }
/* Почта: подтверждение кодом и восстановление */
.notice { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, transparent); font-size: 14px; line-height: 1.45; }
.small-note { margin: 18px 0 6px; font-size: 13px; }
#verify-code { font-size: 22px; letter-spacing: 6px; text-align: center; }
#email-verify-form .link { margin-top: 8px; }
