:root {
  --ink: #050505;
  --muted: #65676B;
  --faint: #8A8D91;
  --soft: #F0F2F5;
  --line: #E4E6EB;
  --accent: #0866FF;
  --accent-soft: #E7F0FF;
  --danger: #C62828;
  --ok-soft: #E3F4EA;
  --ok-ink: #1E6B3A;
  --gold-ink: #6B4E00;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: #F0F2F5;
  color: var(--ink);
  font: 400 15px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
img { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app {
  max-width: 520px; margin: 0 auto; height: 100dvh; background: #fff;
  position: relative; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.04);
}
.screen { display: flex; flex-direction: column; height: 100dvh; padding-top: var(--safe-top); }
.scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

/* Шапка */
.topbar { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; padding: 12px 12px 8px 16px; min-height: 60px; }
.topbar h1 { margin: 0; text-align: center; font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar.small h1 { font-size: 17px; }
.icon-btn { width: 44px; height: 44px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--ink); border-radius: 22px; text-decoration: none; }
.icon-btn:active { background: var(--soft); }
.icon-btn.accent { color: var(--accent); }

/* Аватар */
.avatar { position: relative; flex: 0 0 auto; border-radius: 50%; color: #fff; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; background-size: cover; background-position: center; text-decoration: none; }
.avatar img.photo { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar .badge { position: absolute; right: -3px; bottom: -3px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; }
.avatar-pair { position: relative; flex: 0 0 auto; }
.avatar-pair .avatar { position: absolute; }
.avatar-pair .avatar:last-child { right: 0; bottom: 0; box-shadow: 0 0 0 2px #fff; }

/* Поиск */
.search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; margin: 0 16px; border-radius: 19px; background: var(--soft); color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--ink); }

/* Ряд статусов */
.status-row { display: flex; gap: 12px; padding: 16px 16px 8px; overflow-x: auto; scrollbar-width: none; }
.status-row::-webkit-scrollbar { display: none; }
.status-item { flex: 0 0 64px; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; padding: 0; font-size: 12px; color: var(--ink); text-decoration: none; }
.status-item span.label { width: 64px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-item.me span.label { color: var(--muted); }
.plus-circle { width: 58px; height: 58px; border-radius: 50%; background: var(--soft); display: flex; align-items: center; justify-content: center; position: relative; }

/* Карточка-подсказка */
.card { margin: 10px 16px 6px; padding: 14px; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06); display: flex; flex-direction: column; gap: 12px; }
.card .head { display: flex; gap: 12px; align-items: flex-start; }
.card .t { font-weight: 700; }
.card .s { font-size: 14px; color: var(--muted); }
.close-btn { width: 28px; height: 28px; border-radius: 14px; border: 0; background: var(--soft); color: var(--muted); display: flex; align-items: center; justify-content: center; padding: 0; flex: 0 0 auto; }

/* Кнопки */
.btn { height: 44px; border-radius: 10px; border: 0; background: var(--accent); color: #fff; font-weight: 600; font-size: 16px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.secondary { background: var(--soft); color: var(--ink); }
.btn.small { height: 34px; font-size: 14px; border-radius: 8px; padding: 0 12px; }
.btn:disabled { opacity: .5; }
.btn.block { width: 100%; }

/* Списки */
.list { display: flex; flex-direction: column; padding: 4px 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; text-decoration: none; color: var(--ink); border: 0; background: none; text-align: left; width: 100%; }
.row:active { background: var(--soft); }
.row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.unread .name { font-weight: 700; }
.row.unread .sub { color: var(--ink); font-weight: 600; }
.dot { width: 12px; height: 12px; border-radius: 6px; background: var(--accent); flex: 0 0 auto; }
.section-title { padding: 16px 16px 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.band { height: 8px; background: var(--soft); flex: 0 0 auto; }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); }

/* Нижнее меню */
.tabbar { flex: 0 0 auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 6px 24px calc(8px + var(--safe-bottom)); background: #fff; border-top: 1px solid #EEF0F3; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500; position: relative; }
.tab.active { color: var(--ink); font-weight: 600; }
.tab .count { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #E41E3F; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Чат */
.chat-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 4px; border-bottom: 1px solid #EEF0F3; min-height: 60px; }
.chat-head .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-head .t { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.messages { padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.day { align-self: center; font-size: 12px; color: var(--muted); padding: 12px 0 6px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.msg.me { justify-content: flex-end; }
.msg .col { display: flex; flex-direction: column; gap: 3px; max-width: 75%; min-width: 0; }
.msg.me .col { align-items: flex-end; }
.msg .who { font-size: 12px; color: var(--muted); padding: 8px 12px 0; }
.msg .spacer { width: 28px; flex: 0 0 auto; }
.bubble { position: relative; border: 0; text-align: left; background: var(--soft); color: var(--ink); border-radius: 18px; padding: 8px 12px; font-size: 15px; line-height: 1.35; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; max-width: 100%; user-select: text; -webkit-user-select: text; }
.msg.me .bubble { background: var(--accent); color: #fff; }
.bubble.big { background: none !important; font-size: 44px; padding: 0 4px; line-height: 1.1; }
.bubble.photo { padding: 0; overflow: hidden; background: none; }
.bubble.photo img { max-width: 240px; max-height: 320px; border-radius: 18px; object-fit: cover; }
.bubble.photo .cap { padding: 8px 12px; }
.msg.me .bubble.photo.with-cap { background: var(--accent); }
.bubble.photo.with-cap { background: var(--soft); }
.msg.has-rx { margin-bottom: 14px; }
.rx-pill { position: absolute; right: 8px; bottom: -16px; display: flex; align-items: center; gap: 1px; height: 22px; padding: 0 6px 0 3px; border-radius: 11px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); font-size: 12px; color: var(--muted); white-space: nowrap; }
.msg.me .rx-pill { right: auto; left: 8px; }
.system { align-self: center; max-width: 85%; text-align: center; font-size: 13px; color: var(--muted); padding: 8px 12px; margin: 6px 0; background: var(--soft); border-radius: 12px; }
.typing { font-size: 12px; color: var(--muted); padding: 2px 16px 6px; min-height: 20px; }

.picker { position: fixed; z-index: 30; display: flex; gap: 2px; padding: 4px 6px; background: #fff; border-radius: 26px; box-shadow: 0 2px 6px rgba(0,0,0,.1), 0 8px 24px rgba(0,0,0,.14); animation: pop .12s ease-out; }
.picker button { width: 44px; height: 44px; border-radius: 22px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; padding: 0; transition: transform .1s; }
.picker button:active { transform: scale(1.25); }
.picker button.on { background: var(--soft); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.scrim { position: fixed; inset: 0; z-index: 25; background: transparent; }

.composer { flex: 0 0 auto; display: flex; align-items: flex-end; gap: 4px; padding: 8px 8px calc(8px + var(--safe-bottom)); border-top: 1px solid #F2F3F5; background: #fff; }
.composer .field { flex: 1; min-width: 0; display: flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 19px; background: var(--soft); }
.composer textarea { flex: 1; border: 0; outline: 0; background: transparent; resize: none; font-size: 16px; line-height: 1.3; padding: 9px 0; max-height: 120px; color: var(--ink); }
.preview-strip { display: flex; align-items: center; gap: 8px; padding: 8px 12px 0; }
.preview-strip img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }

/* Лента */
.composer-row { display: flex; align-items: center; gap: 10px; padding: 4px 16px 12px; }
.pill-input { flex: 1; min-width: 0; height: 40px; border: 0; border-radius: 20px; background: var(--soft); padding: 0 16px; font-size: 16px; text-align: left; color: var(--muted); }
.post { display: flex; flex-direction: column; }
.post .head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 8px; }
.post .head .meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.post .head .n { font-size: 15px; }
.post .head .t { font-size: 13px; color: var(--muted); }
.post .text { padding: 0 16px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.post .thanks { margin: 0 16px 10px; padding: 14px; border-radius: 14px; background: #FFF8E1; display: flex; gap: 10px; align-items: flex-start; white-space: pre-wrap; overflow-wrap: anywhere; }
.post .image { width: 100%; max-height: 420px; object-fit: cover; background: var(--line); }
.post .summary { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; font-size: 13px; color: var(--muted); min-height: 20px; }
.post .summary .icons { display: flex; align-items: center; gap: 6px; }
.rx-stack { display: flex; }
.rx-stack span { width: 20px; height: 20px; border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.rx-stack span + span { margin-left: -4px; }
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 12px; border-top: 1px solid var(--line); }
.actions button { height: 44px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--muted); border-radius: 8px; }
.actions button:active { background: var(--soft); }
.actions button.on { color: #C2560F; }
.comments { padding: 8px 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.comment { display: flex; gap: 8px; align-items: flex-start; }
.comment .b { background: var(--soft); border-radius: 16px; padding: 6px 12px; font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.comment .b b { display: block; font-size: 13px; }
.comment-form { display: flex; gap: 8px; }
.comment-form input { flex: 1; min-width: 0; height: 36px; border: 0; border-radius: 18px; background: var(--soft); padding: 0 14px; font-size: 16px; outline: 0; }

/* Люди и профиль */
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 2px; margin: 12px 16px 0; border-radius: 10px; background: var(--soft); }
.seg button { height: 32px; border-radius: 8px; border: 0; background: transparent; font-size: 13px; font-weight: 500; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.round-btn { width: 40px; height: 40px; border-radius: 20px; border: 0; background: var(--soft); color: var(--ink); display: flex; align-items: center; justify-content: center; padding: 0; flex: 0 0 auto; }
.profile-top { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 16px 18px; text-align: center; }
.profile-top .n { font-size: 22px; font-weight: 700; margin-top: 6px; }
.profile-top .r { font-size: 14px; color: var(--muted); }
.status-pill { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 14px 4px 8px; border-radius: 20px; background: var(--soft); color: var(--ink); text-decoration: none; font-size: 14px; border: 0; }
.info-list { display: flex; flex-direction: column; padding: 0 16px; }
.info-row { display: flex; align-items: center; gap: 12px; min-height: 52px; border: 0; background: none; padding: 0; text-align: left; width: 100%; color: var(--ink); text-decoration: none; font-size: 15px; }
.info-row .ic { width: 36px; height: 36px; border-radius: 18px; color: #fff; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.info-row .lbl { flex: 1; min-width: 0; }
.info-row .val { font-size: 14px; color: var(--muted); text-align: right; }
.divider { height: 1px; background: var(--line); margin: 8px 0; }
.switch { width: 50px; height: 30px; border-radius: 15px; background: #D8DADF; position: relative; flex: 0 0 auto; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 13px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .15s; }
[aria-checked="true"] .switch { background: #31A24C; }
[aria-checked="true"] .switch::after { left: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: 14px; padding: 6px 12px; border-radius: 16px; background: var(--soft); }
.text-field { width: 100%; min-height: 44px; border: 1px solid #D3D6D0; border-radius: 10px; padding: 10px 12px; font-size: 16px; background: #fff; outline: 0; }
.text-field:focus { border-color: var(--accent); }
label.field-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }

/* Шторка */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.42); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { width: 100%; max-width: 520px; max-height: 92dvh; overflow-y: auto; background: #fff; border-radius: 16px 16px 0 0; padding: 8px 16px calc(20px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 4px; animation: up .2s ease-out; }
.sheet .handle { align-self: center; width: 36px; height: 5px; border-radius: 3px; background: #CED0D4; }
.sheet h2 { margin: 0; text-align: center; font-size: 17px; padding: 10px 0 8px; }
.choice { display: flex; align-items: center; gap: 12px; min-height: 52px; border: 0; background: transparent; padding: 0; text-align: left; width: 100%; }
.choice .main { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.choice .main b { font-size: 15px; }
.choice .main span { font-size: 13px; color: var(--muted); }
.check { width: 22px; height: 22px; border-radius: 11px; border: 2px solid #CED0D4; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.choice[aria-pressed="true"] .check { border-color: var(--accent); background: var(--accent); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }

/* Вход */
.auth { padding: 48px 24px; display: flex; flex-direction: column; gap: 14px; }
.auth .logo { width: 64px; height: 64px; border-radius: 18px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.auth h1 { margin: 8px 0 0; font-size: 26px; }
.auth p { margin: 0; color: var(--muted); }
.error { color: var(--danger); font-size: 14px; min-height: 18px; }

/* Админка */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table .muted { color: var(--muted); font-size: 12px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: var(--soft); color: var(--muted); }
.tag.ok { background: #E3F4EA; color: #1E6B3A; }

.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-bottom)); transform: translateX(-50%); z-index: 60; background: #1C1E21; color: #fff; padding: 10px 16px; border-radius: 20px; font-size: 14px; max-width: 90vw; animation: fade .15s; }
.viewer { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 100vw; max-height: 100dvh; object-fit: contain; }

/* Токены, магазин, все реакции */
.coin-chip { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px 0 5px; border-radius: 16px; background: #FFF6D6; color: #6B4E00; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.btn.dark { background: #050505; color: #fff; }
.rx-pill .tok, .summary .tok { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; color: #6B4E00; font-weight: 700; }
.rx-group-title { font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px 0 4px; }
.rx-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.rx-grid button { height: 64px; border: 0; border-radius: 14px; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0; font-size: 11px; color: var(--muted); }
.rx-grid button.on, .rx-grid button:active { background: var(--accent-soft); }
.token-btn { margin-top: 12px; min-height: 56px; border: 0; border-radius: 14px; background: #FFF6D6; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink); padding: 6px 12px; }
.token-btn .tb-text { display: flex; flex-direction: column; align-items: flex-start; font-size: 15px; text-align: left; }
.token-btn .tb-text span { font-size: 12px; color: #6B4E00; }
.amount-btn { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 17px; }
.amount-btn.on { border: 2px solid var(--ink); background: #FFF6D6; }
.amount-btn:disabled { opacity: .35; }
.chip { height: 34px; padding: 0 12px; border-radius: 17px; border: 0; background: var(--soft); font-size: 14px; color: var(--ink); white-space: nowrap; }
.chip.on { background: var(--ink); color: #fff; }
.chips-row { display: flex; gap: 6px; padding: 8px 16px 4px; overflow-x: auto; scrollbar-width: none; }
.chips-row::-webkit-scrollbar { display: none; }
.tok-card { border-radius: 20px; padding: 16px; background: var(--soft); display: flex; flex-direction: column; gap: 10px; }
.tok-card.gold { background: #FFF6D6; }
.tok-bar { height: 8px; border-radius: 4px; background: rgba(107, 78, 0, .15); }
.tok-bar > div { height: 8px; border-radius: 4px; background: #F5B700; }
.num { width: 32px; height: 32px; border-radius: 16px; background: #FFF6D6; color: #6B4E00; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.shop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px 16px 0; }
.shop-card { border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 180px; }
.shop-card b { font-size: 15px; line-height: 1.25; }
.shop-card .d { font-size: 13px; color: var(--muted); line-height: 1.3; }
.shop-ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }

/* Помощь за токены и рейтинг */
.btn.secondary.gold { background: #FFF6D6; box-shadow: inset 0 0 0 2px #F5B700; }
.help-box { border-radius: 14px; background: #FFF6D6; padding: 12px; display: flex; flex-direction: column; gap: 10px; color: #6B4E00; font-size: 14px; }
.reward-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.help-hint { font-size: 12px; color: #5C4A12; line-height: 1.35; }
.help-badge { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px 0 5px; border-radius: 14px; background: #FFF6D6; color: #6B4E00; font-size: 13px; font-weight: 700; white-space: nowrap; flex: 0 0 auto; }
.help-badge.paid, .help-badge.closed { background: #E3F4EA; color: #1E6B3A; }
.help-badge.closed { background: var(--soft); color: var(--muted); }
.help-block { padding: 0 16px 10px; }
.help-offers { border: 1px solid var(--line); border-radius: 14px; padding: 4px 12px 6px; }
.ho-title { font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px 0 4px; }
.ho-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #EEF0F3; }
.ho-row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.ho-row .sub { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); font-weight: 400; }
.link-btn { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 8px 0 2px; }
.help-work { border-radius: 14px; background: #E7F0FF; padding: 12px; display: flex; flex-direction: column; gap: 10px; color: #0B2A5B; font-size: 14px; }
.hw-row { display: flex; align-items: center; gap: 10px; }
.hw-actions { display: flex; gap: 8px; }
.hw-actions .btn.dark { flex: 1; }
.help-done { border-radius: 14px; background: #E3F4EA; padding: 12px; display: flex; align-items: center; gap: 10px; color: #1E4D2E; font-size: 14px; }
.help-closed { border-radius: 14px; background: var(--soft); padding: 10px 12px; color: var(--muted); font-size: 14px; }
.tok-link { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 8px; padding: 20px 16px 0; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pod-name { font-size: 13px; font-weight: 600; text-align: center; }
.pod-base { width: 100%; border-radius: 12px 12px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: #EEF0F3; height: 70px; }
.pod-1 .pod-base { background: #FFF6D6; height: 96px; }
.pod-3 .pod-base { background: #F5E9DF; height: 54px; }
.pod-1 .avatar { box-shadow: 0 0 0 3px #F5B700; }
.pod-2 .avatar { box-shadow: 0 0 0 3px #C0C4CC; }
.pod-3 .avatar { box-shadow: 0 0 0 3px #D6A273; }
.pod-place { font-size: 13px; color: var(--muted); }
.pod-count { font-size: 20px; font-weight: 800; }
.rating-list { display: flex; flex-direction: column; padding: 8px 16px 0; border-top: 1px solid var(--line); }
.rating-row { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.rating-row.me { background: var(--accent-soft); font-weight: 700; }
.rr-place { width: 22px; text-align: center; font-weight: 700; color: var(--muted); font-size: 14px; }
.rr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rr-name { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-bar { height: 4px; border-radius: 2px; background: var(--soft); }
.rr-bar span { display: block; height: 4px; border-radius: 2px; background: #F5B700; }
.rr-count { display: flex; align-items: center; gap: 4px; font-weight: 700; }
.rating-me { margin: 12px 16px 0; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; font-weight: 600; text-align: center; }
.rating-note { font-size: 12px; color: var(--muted); text-align: center; padding: 14px 16px 28px; }
.reward-stepper { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 8px; }
.step-btn { height: 48px; border-radius: 12px; border: 1px solid #E8D9A6; background: #FFFFFF; font: 600 24px/1 inherit; color: #050505; cursor: pointer; }
.step-btn:disabled { opacity: .35; cursor: default; }
.step-val { display: flex; align-items: baseline; justify-content: center; gap: 6px; color: #6B4E00; }
.step-val b { font-size: 30px; font-weight: 800; color: #050505; }
.step-val span { font-size: 14px; }

/* Дни рождения */
.avatar.bday::before { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(from 200deg, #FF7A59, #F5B700, #5BB98C, #0866FF, #8B6CF0, #F25C9A, #FF7A59);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.6px), #000 calc(100% - 2.4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2.6px), #000 calc(100% - 2.4px)); pointer-events: none; }
.avatar .cake { position: absolute; left: -4px; bottom: -4px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.bday-post { background: #fff; }
.bday-card { position: relative; overflow: hidden; margin: 12px 12px 4px; padding: 18px 16px 18px; border-radius: 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: linear-gradient(165deg, #FFF3E3 0%, #FDE6EE 55%, #EEE7FB 100%); color: #3A2A1E; }
.bday-confetti { position: absolute; inset: 0; pointer-events: none; opacity: .9; }
.bday-card > *:not(.bday-confetti) { position: relative; }
.bday-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #A2456A; }
.bday-photo { display: inline-flex; margin: 8px 0 4px; border-radius: 50%; text-decoration: none; }
.bday-photo .avatar { box-shadow: 0 6px 18px rgba(162, 69, 106, .22); }
.bday-photo .avatar.bday::before { inset: -6px; -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.6px), #000 calc(100% - 3.4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3.6px), #000 calc(100% - 3.4px)); }
.bday-title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: #2B1B12; }
.bday-name { font-size: 16px; font-weight: 600; color: #5B4636; }
.zodiac-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 6px; border-radius: 15px; background: rgba(255,255,255,.75); font-size: 13px; font-weight: 600; color: #5B4636; margin-top: 2px; }
.zodiac-chip .zg, .bday-preview .zg { width: 22px; height: 22px; border-radius: 11px; background: #8B6CF0; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; line-height: 1; font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols", sans-serif; }
.bday-text { margin: 8px 4px 0; font-size: 16px; line-height: 1.45; color: #2B1B12; }
.bday-wish { margin: 2px 8px 0; font-size: 14px; line-height: 1.4; font-style: italic; color: #7A5A6A; }
.bday-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 12px; }
.bday-actions .btn { width: 100%; }
.bday-actions .btn.secondary { background: rgba(255,255,255,.8); }
.bday-me { margin-top: 10px; font-size: 14px; color: #7A5A6A; }
.bday-strip { background: linear-gradient(165deg, #FFF3E3, #FDE6EE); }
.bday-strip .btn { text-decoration: none; }
.bday-faces { display: inline-flex; }
.bday-faces .avatar + .avatar { margin-left: -12px; }
.bday-preview { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 15px; }

/* Кружки */
.circle-msg { position: relative; width: 200px; height: 200px; border-radius: 50%; cursor: pointer; transition: width .2s ease, height .2s ease; -webkit-tap-highlight-color: transparent; }
.circle-msg.playing { width: min(270px, 72vw, 60dvh); height: min(270px, 72vw, 60dvh); }
.circle-msg video { position: absolute; inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); border-radius: 50%; object-fit: cover; background: #DADDE1; }
.circle-msg .ring, .rec-stage .ring, .cv-stage .ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.circle-msg .circle-play { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(0,0,0,.42); color: #fff; display: flex; align-items: center; justify-content: center; }
.circle-msg.playing .circle-play { display: none; }
.circle-msg .circle-dur { position: absolute; left: 14px; bottom: 12px; height: 22px; padding: 0 8px; border-radius: 11px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; }
.circle-msg .rx-pill { position: absolute; right: 4px; bottom: 2px; }
.msg.me .circle-msg { margin-left: auto; }

.rec-overlay, .cv-overlay { position: fixed; inset: 0; z-index: 60; align-items: stretch; justify-content: flex-start; background: #12151B; color: #fff; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.rec-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 6px; }
.rec-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rec-title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-title span { font-size: 13px; color: #B8BEC8; }
.rec-round { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 22px; border: 0; background: rgba(255,255,255,.12); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; }
.rec-body { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 0 16px; }
.rec-stage { position: relative; width: min(320px, 82vw, 48dvh); height: min(320px, 82vw, 48dvh); border: 0; padding: 0; background: transparent; border-radius: 50%; }
.rec-stage video.cam { position: absolute; inset: 9px; width: calc(100% - 18px); height: calc(100% - 18px); border-radius: 50%; object-fit: cover; background: #1F242C; }
.rec-stage video.mirror { transform: scaleX(-1); }
.rec-timer { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 16px; background: rgba(255,255,255,.1); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.red-dot { width: 10px; height: 10px; border-radius: 5px; background: #FF4D4F; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.rec-hint { font-size: 14px; color: #B8BEC8; text-align: center; max-width: 300px; line-height: 1.4; }
.rec-caption { width: min(320px, 100%); height: 44px; border-radius: 22px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; padding: 0 16px; font-size: 16px; }
.rec-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 28px 28px; min-height: 96px; }
.rec-controls .big-side { justify-self: center; width: 52px; height: 52px; border-radius: 26px; }
.rec-controls .rec-btn { width: 84px; height: 84px; border-radius: 42px; border: 5px solid #fff; background: transparent; display: flex; align-items: center; justify-content: center; padding: 0; }
.rec-btn .dot { width: 62px; height: 62px; border-radius: 31px; background: #FF4D4F; }
.rec-btn .sq { width: 32px; height: 32px; border-radius: 8px; background: #FF4D4F; }
.rec-review { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; }
.rec-review .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rec-review .btn.secondary { background: rgba(255,255,255,.12); color: #fff; }

.circles-row-wrap { padding: 4px 0 10px; border-bottom: 8px solid var(--soft, #F0F2F5); }
.circles-title { padding: 2px 16px 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.circles-row { display: flex; gap: 12px; padding: 4px 16px; overflow-x: auto; scrollbar-width: none; }
.circles-row::-webkit-scrollbar { display: none; }
.circ-item { flex: 0 0 auto; width: 70px; border: 0; background: transparent; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; color: inherit; font: inherit; }
.circ-item .lbl { font-size: 12px; max-width: 70px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.circ-ring { display: inline-flex; padding: 2.5px; border-radius: 50%; background: #CED0D4; }
.circ-ring .avatar { box-shadow: 0 0 0 2.5px #fff; }
.circ-item.unseen .circ-ring { background: var(--accent); }
.circ-item.unseen .lbl { font-weight: 600; }
.circ-add { position: relative; width: 63px; height: 63px; border-radius: 50%; background: var(--soft, #F0F2F5); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.circ-add .plus { position: absolute; right: -1px; bottom: -1px; width: 22px; height: 22px; border-radius: 11px; background: var(--accent); color: #fff; box-shadow: 0 0 0 2px #fff; display: flex; align-items: center; justify-content: center; }

.cv-bars { display: flex; gap: 4px; padding: 12px 12px 0; }
.cv-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); overflow: hidden; }
.cv-bars span i { display: block; height: 100%; width: 0; background: #fff; }
.cv-bars span.done i { width: 100%; }
.cv-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 0 16px; }
.cv-head .who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cv-head .who span { font-size: 12px; color: #B8BEC8; }
.cv-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.cv-stage { position: relative; width: min(330px, 86vw, 52dvh); height: min(330px, 86vw, 52dvh); border: 0; padding: 0; background: transparent; border-radius: 50%; z-index: 1; }
.cv-stage video { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); border-radius: 50%; object-fit: cover; background: #1F242C; }
.cv-nav { position: absolute; top: 0; bottom: 0; width: 22%; border: 0; background: transparent; z-index: 2; }
.cv-nav.prev { left: 0; } .cv-nav.next { right: 0; }
.cv-cap { font-size: 16px; text-align: center; padding: 0 32px; line-height: 1.4; min-height: 22px; }
.cv-foot { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 24px; }
.cv-rxs { display: flex; justify-content: center; gap: 10px; }
.cv-rx { width: 48px; height: 48px; border-radius: 24px; border: 0; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; padding: 0; }
.cv-reply { display: flex; gap: 8px; align-items: center; }
.cv-reply input { flex: 1; min-width: 0; height: 44px; border-radius: 22px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; padding: 0 16px; font-size: 16px; }
.cv-circle { width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; }
.cv-views { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #D5D9E0; flex: 1; }
.cv-foot:has(.cv-views) { flex-direction: row; align-items: center; }

/* Локации и выбор города */
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.loc-wrap { display: flex; flex-direction: column; gap: 8px; padding: 4px 12px 8px; }
.loc-summary { font-size: 13px; color: var(--muted); padding: 2px 4px 4px; }
.loc-cta { margin: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; border: 0; font: inherit; color: inherit; }
.loc-cta span { font-size: 14px; color: var(--muted); }
.loc-card { border-radius: 16px; border: 1px solid var(--line, #E4E6EB); background: #fff; overflow: hidden; }
.loc-card.mine { background: #F5F9FF; border-color: #CFE0FF; }
.loc-head { width: 100%; border: 0; background: transparent; padding: 12px; display: grid; grid-template-columns: auto 1fr auto auto; grid-template-areas: "ic main n chev" "bar bar bar bar"; align-items: center; column-gap: 10px; row-gap: 8px; text-align: left; font: inherit; color: inherit; }
.loc-ic { grid-area: ic; width: 36px; height: 36px; border-radius: 18px; background: var(--soft); display: flex; align-items: center; justify-content: center; }
.loc-card.mine .loc-ic { background: var(--accent); color: #fff; }
.loc-head .main { grid-area: main; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.loc-head .name { font-size: 16px; font-weight: 700; }
.loc-head .sub { font-size: 13px; color: var(--muted); }
.loc-n { grid-area: n; font-size: 20px; font-weight: 800; }
.loc-chev { grid-area: chev; display: flex; transform: rotate(90deg); transition: transform .15s; }
.loc-chev.open { transform: rotate(-90deg); }
.loc-bar { grid-area: bar; display: block; height: 6px; border-radius: 3px; background: #E4E6EB; overflow: hidden; }
.loc-bar i { display: block; height: 100%; border-radius: 3px; background: #8A9BB3; }
.loc-card.mine .loc-bar i { background: var(--accent); }
.loc-people { padding: 0 12px 12px; }
.loc-person { display: flex; align-items: center; gap: 8px; border-top: 1px solid #EEF0F3; }
.loc-p-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 0; text-decoration: none; color: inherit; }
.loc-p-link .main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.loc-p-link .name { font-size: 15px; font-weight: 600; }
.loc-p-link .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-list { display: flex; flex-direction: column; margin-top: 8px; }
.city-title { font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 2px; }
.city-opt { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border: 0; border-bottom: 1px solid #EEF0F3; background: transparent; text-align: left; font: inherit; color: inherit; }
.city-opt .ic { width: 36px; height: 36px; border-radius: 18px; background: var(--soft); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.city-opt.on .ic { background: var(--accent); color: #fff; }
.city-opt.add { color: var(--accent); }
.city-opt.add .ic { background: #E7F0FF; }
.city-opt.none { color: var(--muted); }
.city-opt .main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.city-opt .name { font-size: 16px; font-weight: 600; }
.city-opt .sub { font-size: 13px; color: var(--muted); }
.city-note { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.4; padding: 12px 8px 0; }
.admin-note { font-size: 14px; color: var(--muted); padding: 0 0 8px; line-height: 1.4; }
.city-admin-list { display: flex; flex-direction: column; }
.city-admin-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #EEF0F3; }
.city-admin-row .main { flex: 1; }

/* Несколько фото и видео в посте */
.media-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mp-item { position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--soft); flex: 0 0 auto; }
.mp-item img, .mp-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-item .close-btn { position: absolute; top: 4px; right: 4px; }
.mp-badge { position: absolute; left: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 6px 0 3px; border-radius: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 600; }
.mp-count { font-size: 13px; color: var(--muted); }
.post-media { display: flex; flex-direction: column; gap: 2px; }
.pm-grid { display: grid; gap: 2px; background: var(--line, #E4E6EB); }
.pm-grid.n1 { grid-template-columns: 1fr; }
.pm-grid.n2 { grid-template-columns: 1fr 1fr; }
.pm-grid.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.pm-grid.n3 .pm-cell:first-child { grid-row: 1 / span 2; }
.pm-grid.n4 { grid-template-columns: 1fr 1fr; }
.pm-cell { position: relative; border: 0; padding: 0; background: #DADDE1; cursor: zoom-in; display: block; overflow: hidden; }
.pm-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-grid.n1 .pm-cell img { height: auto; max-height: 480px; }
.pm-grid.n2 .pm-cell { aspect-ratio: 1 / 1.1; }
.pm-grid.n3 { aspect-ratio: 4 / 3; }
.pm-grid.n4 .pm-cell { aspect-ratio: 1 / 1; }
.pm-more { position: absolute; inset: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 28px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.pm-video { width: 100%; max-height: 520px; background: #000; display: block; }
.viewer.gallery { touch-action: none; overflow: hidden; }
.viewer.gallery .g-count { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; font-weight: 600; }
.viewer.gallery .g-close { position: absolute; top: calc(8px + env(safe-area-inset-top)); right: 10px; width: 44px; height: 44px; border-radius: 22px; border: 0; background: rgba(255,255,255,.14); color: #fff; display: flex; align-items: center; justify-content: center; }
.viewer.gallery .g-nav { position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; border-radius: 22px; border: 0; background: rgba(255,255,255,.14); color: #fff; display: flex; align-items: center; justify-content: center; }
.viewer.gallery .g-nav.prev { left: 8px; transform: scaleX(-1); }
.viewer.gallery .g-nav.next { right: 8px; }

.rec-hint.err { color: #FF8A8A; }

/* Карусель фото и видео в посте */
.carousel { position: relative; }
.car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.car-track::-webkit-scrollbar { display: none; }
.car-slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; aspect-ratio: 1 / 1; max-height: 520px; border: 0; padding: 0; margin: 0; background: #DADDE1; display: block; overflow: hidden; }
.car-slide img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; user-select: none; }
.car-slide.video { background: #000; display: flex; align-items: center; }
.car-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.carousel:has(.car-slide:only-child) .car-slide:not(.video) { aspect-ratio: auto; }
.carousel:has(.car-slide:only-child) .car-slide:not(.video) img { height: auto; max-height: 520px; }
.car-count { position: absolute; top: 10px; right: 10px; height: 24px; padding: 0 9px; border-radius: 12px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; pointer-events: none; }
.car-dots { display: flex; justify-content: center; gap: 5px; padding: 8px 0 2px; }
.car-dots i { width: 6px; height: 6px; border-radius: 3px; background: #CED0D4; transition: background .15s, transform .15s; }
.car-dots i.on { background: var(--accent); transform: scale(1.2); }

/* Согласие и правила */
.screen.consent { background: #fff; }
.consent-head { padding: 28px 20px 4px; }
.consent-badge { width: 56px; height: 56px; border-radius: 18px; background: #E7F0FF; color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.consent-head h1 { margin: 0 0 6px; font-size: 24px; line-height: 1.2; font-weight: 800; }
.consent-head p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.4; }
.policy { padding: 8px 20px 16px; }
.policy section { padding: 12px 0; border-bottom: 1px solid #EEF0F3; }
.policy h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.policy p { margin: 0; font-size: 14px; line-height: 1.45; color: #333; }
.policy .policy-ver { border: 0; color: var(--muted); font-size: 12px; padding-top: 12px; }
.consent-foot { flex: 0 0 auto; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid #EEF0F3; background: #fff; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 -6px 18px rgba(0,0,0,.05); }
.consent-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.4; color: #333; }
.consent-check input { width: 22px; height: 22px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
.consent-foot .btn:disabled { opacity: .45; }
.consent-foot .link-btn { align-self: center; }
.policy-ok { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #1E6B3A; font-weight: 600; }
.row-note { font-size: 12px; color: var(--muted); padding: 0 16px 8px 62px; margin-top: -4px; line-height: 1.35; }

/* Админка: статусы и журнал */
.tag.warn { background: #FDECEC; color: #B42318; }
.btn.danger { color: #B42318; }
.log-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 0; background: transparent; padding: 8px 0; text-align: left; font: inherit; }
.log-list { display: flex; flex-direction: column; }
.log-row { padding: 8px 0; border-bottom: 1px solid #EEF0F3; }
.log-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.log-top span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.log-d { font-size: 13px; color: #444; margin-top: 2px; overflow-wrap: anywhere; }

/* Иконостас */
.ico-wrap { padding: 6px 10px 12px; }
.ico-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px 6px 8px; }
.ico-chip { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid #E4E6EB; background: #fff; color: var(--ink, #050505); font-size: 13px; font-weight: 600; }
.ico-chip.on { background: #050505; border-color: #050505; color: #fff; }
.ico-tiers { position: relative; display: flex; flex-direction: column; }
.ico-tiers::before { content: ''; position: absolute; left: 50%; top: 14px; bottom: 14px; width: 2px; margin-left: -1px; background: linear-gradient(180deg, #E8C35A, #E4E6EB); }
.ico-tier { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 0 8px; }
.ico-label { position: relative; display: inline-flex; align-items: center; height: 20px; padding: 0 10px; border-radius: 10px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: #F0F2F5; color: #4B4F56; }
.ico-tier.t0 .ico-label { background: #FFF3D1; color: #7A5A00; }
.ico-tier.t1 .ico-label { background: #FDECEC; color: #9B2C2C; }
.ico-tier.t2 .ico-label { background: #EFE9F7; color: #5B3D8A; }
.ico-tier.t3 .ico-label { background: #E7F0FF; color: #1D4ED8; }
.ico-tier.t4 .ico-label { background: #E3F4EA; color: #1E6B3A; }
.ico-people { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; max-width: 370px; }
.ico-p { width: 50px; border: 0; padding: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; font: inherit; color: inherit; transition: opacity .15s; }
.ico-p .avatar { box-shadow: 0 0 0 2px #fff; }
.ico-p.gold .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #E8C35A; }
.ico-p.me .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.ico-p.dim { opacity: .22; }
.ico-p .n { font-size: 10px; line-height: 1.1; max-width: 50px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.ico-p.me .n { font-weight: 700; }
.person-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0 8px; text-align: center; }
.pc-name { font-size: 20px; font-weight: 700; margin-top: 4px; }
.pc-sub { font-size: 14px; color: var(--muted); }
.pc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 10px; }
.pc-actions .btn:only-child { grid-column: 1 / -1; }


/* ===== Тёмная тема (переключается в профиле) ===== */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #E8E9EB; --muted: #A8ABB0; --faint: #84878C; --soft: #2E3034; --line: #3A3C40;
  --accent: #3D8BFF; --accent-soft: #1B2A44; --danger: #FF6B6B;
  --ok-soft: #1C3326; --ok-ink: #6FD19A; --gold-ink: #F2C94C;
}
html[data-theme="dark"] body { background: #0F1012; }
html[data-theme="dark"] #app { background: #1E1F22; box-shadow: 0 0 0 1px rgba(255,255,255,.04); }
html[data-theme="dark"] body { background: #2E3034; }
html[data-theme="dark"] #app { background: #1E1F22; }
html[data-theme="dark"] .avatar .badge { background: #1E1F22; }
html[data-theme="dark"] .avatar-pair .avatar:last-child { box-shadow: 0 0 0 2px #1E1F22; }
html[data-theme="dark"] .card { background: #1E1F22; }
html[data-theme="dark"] .tabbar { background: #1E1F22; border-top: 1px solid #2E3034; }
html[data-theme="dark"] .chat-head { border-bottom: 1px solid #2E3034; }
html[data-theme="dark"] .rx-pill { background: #1E1F22; }
html[data-theme="dark"] .picker { background: #1E1F22; }
html[data-theme="dark"] .composer { border-top: 1px solid #2A2C30; background: #1E1F22; }
html[data-theme="dark"] .post .thanks { background: #3A3120; }
html[data-theme="dark"] .rx-stack span { background: #1E1F22; box-shadow: 0 0 0 2px #1E1F22; }
html[data-theme="dark"] .seg button.on { background: #1E1F22; }
html[data-theme="dark"] .switch::after { background: #1E1F22; }
html[data-theme="dark"] .text-field { background: #1E1F22; }
html[data-theme="dark"] .sheet { background: #1E1F22; }
html[data-theme="dark"] .sheet .handle { background: #4A4C50; }
html[data-theme="dark"] .check { border: 2px solid #4A4C50; }
html[data-theme="dark"] .tag.ok { background: #1C3326; color: #6FD19A; }
html[data-theme="dark"] .coin-chip { background: #3A3120; color: #F2C94C; }
html[data-theme="dark"] .rx-pill .tok, html[data-theme="dark"] .summary .tok { color: #F2C94C; }
html[data-theme="dark"] .token-btn { background: #3A3120; }
html[data-theme="dark"] .token-btn .tb-text span { color: #F2C94C; }
html[data-theme="dark"] .amount-btn { background: #1E1F22; }
html[data-theme="dark"] .amount-btn.on { background: #3A3120; }
html[data-theme="dark"] .tok-card.gold { background: #3A3120; }
html[data-theme="dark"] .num { background: #3A3120; color: #F2C94C; }
html[data-theme="dark"] .btn.secondary.gold { background: #3A3120; }
html[data-theme="dark"] .help-box { background: #3A3120; color: #F2C94C; }
html[data-theme="dark"] .help-hint { color: #E8D08A; }
html[data-theme="dark"] .help-badge { background: #3A3120; color: #F2C94C; }
html[data-theme="dark"] .help-badge.paid, html[data-theme="dark"] .help-badge.closed { background: #1C3326; color: #6FD19A; }
html[data-theme="dark"] .ho-row { border-top: 1px solid #2E3034; }
html[data-theme="dark"] .help-work { background: #1B2A44; }
html[data-theme="dark"] .help-done { background: #1C3326; }
html[data-theme="dark"] .pod-base { background: #2E3034; }
html[data-theme="dark"] .pod-1 .pod-base { background: #3A3120; }
html[data-theme="dark"] .pod-3 .pod-base { background: #3A2E25; }
html[data-theme="dark"] .step-btn { border: 1px solid #5A4E2A; background: #1E1F22; color: #E8E9EB; }
html[data-theme="dark"] .step-val { color: #F2C94C; }
html[data-theme="dark"] .step-val b { color: #E8E9EB; }
html[data-theme="dark"] .avatar .cake { background: #1E1F22; }
html[data-theme="dark"] .bday-post { background: #1E1F22; }
html[data-theme="dark"] .bday-card { background: linear-gradient(165deg, #3A2C20 0%, #3A2330 55%, #2B2540 100%); color: #F0E2D4; }
html[data-theme="dark"] .bday-kicker { color: #F29BC0; }
html[data-theme="dark"] .bday-title { color: #F3E6DA; }
html[data-theme="dark"] .bday-name { color: #E0CBB8; }
html[data-theme="dark"] .zodiac-chip { color: #E0CBB8; }
html[data-theme="dark"] .bday-text { color: #F3E6DA; }
html[data-theme="dark"] .bday-wish { color: #D9B9C8; }
html[data-theme="dark"] .bday-me { color: #D9B9C8; }
html[data-theme="dark"] .bday-strip { background: linear-gradient(165deg, #3A2C20, #3A2330); }
html[data-theme="dark"] .circle-msg video { background: #34363A; }
html[data-theme="dark"] .circles-row-wrap { border-bottom: 8px solid var(--soft, #2E3034); }
html[data-theme="dark"] .circ-ring { background: #4A4C50; }
html[data-theme="dark"] .circ-ring .avatar { box-shadow: 0 0 0 2.5px #1E1F22; }
html[data-theme="dark"] .circ-add { background: var(--soft, #2E3034); }
html[data-theme="dark"] .circ-add .plus { box-shadow: 0 0 0 2px #1E1F22; }
html[data-theme="dark"] .loc-card { border: 1px solid var(--line, #3A3C40); background: #1E1F22; }
html[data-theme="dark"] .loc-card.mine { background: #1A2333; border-color: #2A3E66; }
html[data-theme="dark"] .loc-bar { background: #3A3C40; }
html[data-theme="dark"] .loc-person { border-top: 1px solid #2E3034; }
html[data-theme="dark"] .city-opt { border-bottom: 1px solid #2E3034; }
html[data-theme="dark"] .city-opt.add .ic { background: #1B2A44; }
html[data-theme="dark"] .city-admin-row { border-bottom: 1px solid #2E3034; }
html[data-theme="dark"] .pm-grid { background: var(--line, #3A3C40); }
html[data-theme="dark"] .pm-cell { background: #34363A; }
html[data-theme="dark"] .car-slide { background: #34363A; }
html[data-theme="dark"] .car-dots i { background: #4A4C50; }
html[data-theme="dark"] .screen.consent { background: #1E1F22; }
html[data-theme="dark"] .consent-badge { background: #1B2A44; }
html[data-theme="dark"] .policy section { border-bottom: 1px solid #2E3034; }
html[data-theme="dark"] .policy p { color: #C9CCD1; }
html[data-theme="dark"] .consent-foot { border-top: 1px solid #2E3034; background: #1E1F22; }
html[data-theme="dark"] .consent-check { color: #C9CCD1; }
html[data-theme="dark"] .policy-ok { color: #6FD19A; }
html[data-theme="dark"] .tag.warn { background: #3D2323; color: #FF8A80; }
html[data-theme="dark"] .btn.danger { color: #FF8A80; }
html[data-theme="dark"] .log-row { border-bottom: 1px solid #2E3034; }
html[data-theme="dark"] .log-d { color: #BFC2C7; }
html[data-theme="dark"] .ico-chip { border: 1px solid #3A3C40; background: #1E1F22; color: var(--ink, #E8E9EB); }
html[data-theme="dark"] .ico-tiers::before { background: linear-gradient(180deg, #E8C35A, #3A3C40); }
html[data-theme="dark"] .ico-label { background: #2E3034; color: #B0B3B8; }
html[data-theme="dark"] .ico-tier.t0 .ico-label { background: #3D3320; color: #F2C94C; }
html[data-theme="dark"] .ico-tier.t1 .ico-label { background: #3D2323; color: #FF9E9E; }
html[data-theme="dark"] .ico-tier.t2 .ico-label { background: #2C2540; color: #C9B3F2; }
html[data-theme="dark"] .ico-tier.t3 .ico-label { background: #1B2A44; color: #8DB4FF; }
html[data-theme="dark"] .ico-tier.t4 .ico-label { background: #1C3326; color: #6FD19A; }
html[data-theme="dark"] .ico-p .avatar { box-shadow: 0 0 0 2px #1E1F22; }
html[data-theme="dark"] .ico-p.gold .avatar { box-shadow: 0 0 0 2px #1E1F22, 0 0 0 4px #E8C35A; }
html[data-theme="dark"] .ico-p.me .avatar { box-shadow: 0 0 0 2px #1E1F22, 0 0 0 4px var(--accent); }
html[data-theme="dark"] .text-field, html[data-theme="dark"] input, html[data-theme="dark"] textarea, html[data-theme="dark"] select { color-scheme: dark; }
html[data-theme="dark"] .avatar img.photo { background: #2E3034; }
html[data-theme="dark"] .bday-card { background: linear-gradient(165deg, #3A2C22 0%, #3A2330 55%, #2B2540 100%); color: #F3E6DA; }
html[data-theme="dark"] .bday-wish { color: #D9B9C8; }
html[data-theme="dark"] .zodiac-chip, html[data-theme="dark"] .bday-actions .btn.secondary { background: rgba(255,255,255,.1); color: #F3E6DA; }
html[data-theme="dark"] .bday-strip { background: linear-gradient(165deg, #3A2C22, #3A2330); }
html[data-theme="dark"] .card { box-shadow: 0 1px 2px rgba(0,0,0,.4); }
html[data-theme="dark"] .ico-chip.on { background: #E8E9EB; border-color: #E8E9EB; color: #111; }
html[data-theme="dark"] .ico-tiers::before { background: linear-gradient(180deg, #8A6F2A, #3A3C40); }
html[data-theme="dark"] .car-dots i { background: #4A4C50; }
html[data-theme="dark"] .loc-bar i { background: #5B6B82; }

/* Выбор темы */
.theme-list { display: flex; flex-direction: column; gap: 8px; }
.theme-opt { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: transparent; text-align: left; font: inherit; color: inherit; }
.theme-opt.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-opt .main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.theme-opt .main span { font-size: 13px; color: var(--muted); }
.theme-swatch { width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto; border: 1px solid var(--line); }
.theme-swatch.light { background: linear-gradient(135deg, #FFFFFF 50%, #F0F2F5 50%); }
.theme-swatch.dark { background: linear-gradient(135deg, #1E1F22 50%, #2E3034 50%); }
.theme-swatch.system { background: linear-gradient(135deg, #FFFFFF 50%, #1E1F22 50%); }
.theme-opt .radio { width: 22px; height: 22px; border-radius: 11px; border: 2px solid var(--faint); flex: 0 0 auto; }
.theme-opt.on .radio { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--accent); background: transparent; }
html[data-theme="dark"] .theme-opt.on .radio { box-shadow: inset 0 0 0 4px var(--accent); }
html[data-theme="dark"] .chip.on { color: #111; }
html[data-theme="dark"] .btn.dark { background: #E8E9EB; color: #111; }


/* Кружки при горизонтальном телефоне: круг слева, кнопки справа — всё помещается в экран */
@media (orientation: landscape) and (max-height: 560px) {
  .rec-overlay { display: grid !important; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  .rec-head { grid-column: 1 / -1; padding: 8px 16px 0; }
  .rec-body { grid-column: 1; flex-direction: row; gap: 18px; padding: 4px 16px 10px; }
  .rec-stage { width: min(68dvh, 46vw); height: min(68dvh, 46vw); flex: 0 0 auto; }
  .rec-body .rec-timer, .rec-body .rec-hint, .rec-body .rec-caption { align-self: center; }
  .rec-body { flex-wrap: wrap; align-content: center; }
  .rec-hint { max-width: 220px; text-align: left; }
  .rec-controls { grid-column: 2; grid-row: 2; grid-template-columns: auto; grid-template-rows: 1fr auto 1fr; justify-items: center; padding: 8px 20px 12px 8px; min-height: 0; gap: 10px; }
  .rec-review { grid-column: auto; width: 200px; align-self: center; }
  .rec-review .two { grid-template-columns: 1fr; }
  .cv-overlay { overflow-y: auto; }
  .cv-body { flex-direction: row; gap: 18px; padding: 0 60px; }
  .cv-stage { width: min(64dvh, 46vw); height: min(64dvh, 46vw); }
  .cv-cap { text-align: left; max-width: 260px; padding: 0; }
  .cv-foot { flex-direction: row; align-items: center; padding-bottom: 10px; }
  .cv-reply { flex: 1; }
}

/* Просмотр фото с увеличением */
.viewer.gallery .g-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; touch-action: none; user-select: none; -webkit-user-select: none; cursor: zoom-in; }
.viewer.gallery.zoomed .g-stage { cursor: grab; }
.viewer.gallery .g-stage img { max-width: 100vw; max-height: 100dvh; object-fit: contain; transform-origin: center center; will-change: transform; -webkit-user-drag: none; pointer-events: none; }
.viewer.gallery .g-zoom { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); right: 12px; width: 44px; height: 44px; border-radius: 22px; border: 0; background: rgba(255,255,255,.14); color: #fff; display: flex; align-items: center; justify-content: center; z-index: 2; }
.viewer.gallery .g-hint { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.75); font-size: 13px; white-space: nowrap; transition: opacity .4s; pointer-events: none; }
.viewer.gallery .g-hint.hide { opacity: 0; }
.viewer.gallery .g-close, .viewer.gallery .g-nav, .viewer.gallery .g-count { z-index: 2; }
.viewer.gallery.zoomed .g-nav, .viewer.gallery.zoomed .g-count { opacity: 0; pointer-events: none; }

/* Смена камеры при записи кружка */
.rec-controls .rec-flip { position: relative; overflow: visible; }
.rec-controls .rec-flip:disabled { opacity: .5; }
.rec-flip-label { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 6px; font-size: 12px; font-weight: 600; color: #B8BEC8; white-space: nowrap; pointer-events: none; }

/* Свои комментарии: изменить или удалить */
.comment .b.c-own { border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; font-size: 14px; }
.comment .b.c-own:active { filter: brightness(.94); }
.c-edited { font-size: 12px; color: var(--muted, #65676B); }
.c-menu { display: flex; flex-direction: column; gap: 8px; }
.c-quote { background: var(--soft); border-radius: 14px; padding: 10px 14px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 30vh; overflow: auto; margin-bottom: 4px; }
.c-act { display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 14px; border: 0; border-radius: 14px; background: var(--soft); color: inherit; font-size: 16px; font-weight: 600; text-align: left; }
.c-act.danger { color: #E41E3F; }
.feed-note { margin: 16px auto; display: block; width: fit-content; }

/* Предпросмотр загрузки Excel */
.imp-preview { gap: 8px; }
.imp-row { border-radius: 12px; padding: 10px 12px; background: var(--soft); font-size: 14px; line-height: 1.4; }
.imp-row > b { display: block; margin-bottom: 4px; }
.imp-row ul { margin: 0; padding-left: 18px; }
.imp-row.bad { background: #FDECEC; color: #8A1F11; }
.imp-row.new { background: #E7F6EC; color: #14532D; }
.imp-row.warn { background: #FFF6DB; color: #6B4E00; }
.imp-note { margin-top: 6px; font-size: 13px; opacity: .9; }
.btn.danger-btn { background: #D92D20; }
html[data-theme="dark"] .imp-row.bad { background: #3A1E1E; color: #FFB4AB; }
html[data-theme="dark"] .imp-row.new { background: #17301F; color: #A6E3B8; }
html[data-theme="dark"] .imp-row.warn { background: #3A3016; color: #F3D98B; }

/* ---- Ответ, правка, закреп, упоминания, поиск ---- */
.scrim.dim { background: rgba(0,0,0,.28); }
.msg-actions { position: fixed; z-index: 30; min-width: 230px; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.2); display: flex; flex-direction: column; animation: pop .12s ease-out; }
.msg-actions button { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 48px; padding: 0 16px; border: 0; border-bottom: 1px solid #EEF0F3; background: transparent; font-size: 16px; font-weight: 500; color: var(--ink); text-align: left; }
.msg-actions button:last-child { border-bottom: 0; }
.msg-actions button.danger { color: #C62828; }
.msg-actions button:active { background: var(--soft); }
.quote { display: flex; flex-direction: column; gap: 1px; margin: -2px -4px 6px; padding: 4px 8px 4px 10px; border-radius: 10px; background: rgba(0,0,0,.06); border-left: 3px solid var(--accent); cursor: pointer; white-space: normal; max-width: 260px; }
.quote b { font-size: 12px; color: var(--accent); }
.quote span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg.me .bubble .quote { background: rgba(255,255,255,.18); border-left-color: #fff; }
.msg.me .bubble .quote b, .msg.me .bubble .quote span { color: #fff; }
.msg.me .bubble .quote span { opacity: .85; }
.quote.out { margin: 0 0 2px; }
.msg.me .quote.out { align-self: flex-end; }
.quote.gone { font-size: 13px; color: var(--muted); font-style: italic; cursor: default; border-left-color: #BCC0C4; }
.bubble .btext { white-space: pre-wrap; }
.mention { color: var(--accent); font-weight: 600; }
.mention.me { background: rgba(8,102,255,.12); border-radius: 4px; padding: 0 2px; }
.msg.me .mention { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.msg.me .mention.me { background: rgba(255,255,255,.2); }
.edited { font-size: 11px; color: var(--muted); padding: 0 10px; }
.msg.me .edited { text-align: right; }
.msg.flash .bubble, .system.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px rgba(8,102,255,.45); } 100% { box-shadow: 0 0 0 0 rgba(8,102,255,0); } }
.pin-bar { display: flex; align-items: center; gap: 4px; padding: 0 4px 0 0; border-bottom: 1px solid #EEF0F3; background: var(--soft-2, #F7F8FA); }
.pin-main { flex: 1; min-width: 0; display: flex; align-items: stretch; gap: 10px; padding: 8px 4px 8px 14px; border: 0; background: transparent; text-align: left; color: inherit; }
.pin-line { width: 3px; border-radius: 2px; background: var(--accent); flex: 0 0 auto; }
.pin-text { display: flex; flex-direction: column; min-width: 0; }
.pin-text b { font-size: 12px; color: var(--accent); }
.pin-text span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 0 14px; }
.ctx-bar[hidden] { display: none; }
.ctx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ctx-main b { font-size: 12px; color: var(--accent); }
.ctx-main span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mention-pop { margin: 0 8px 4px; background: #fff; border-radius: 16px; box-shadow: 0 6px 20px rgba(0,0,0,.12); overflow: hidden; display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; }
.mention-pop[hidden] { display: none; }
.mp-opt { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 0; background: transparent; text-align: left; color: inherit; min-height: 48px; }
.mp-opt:active, .mp-opt:focus-visible { background: var(--soft); }
.mp-main { display: flex; flex-direction: column; min-width: 0; }
.mp-main b { font-size: 15px; }
.mp-main span { font-size: 12px; color: var(--muted); }
.mp-all { width: 32px; height: 32px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.at-badge { width: 22px; height: 22px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.msg-results .section-title { padding: 14px 16px 4px; }
.search-row { align-items: flex-start; text-align: left; border: 0; background: transparent; width: 100%; color: inherit; }
.search-row .main { display: flex; flex-direction: column; gap: 2px; }
.sr-top { display: flex; justify-content: space-between; gap: 8px; }
.sr-top span { font-size: 12px; color: var(--muted); }
.sr-chat { font-size: 12px; color: var(--muted); }
.sr-text { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.sr-text mark, .search-res mark { background: #FFE58A; color: inherit; border-radius: 3px; padding: 0 1px; }
.search-res { display: flex; flex-direction: column; margin-top: 8px; max-height: 60vh; overflow-y: auto; }
.attach-list { display: flex; flex-direction: column; }
.msg.mentioned:not(.me) .bubble { box-shadow: inset 3px 0 0 var(--accent); }

/* ---- Опросы ---- */
.bubble.poll-bubble { background: var(--soft); color: var(--ink); padding: 10px 12px; min-width: 240px; }
.msg.me .bubble.poll-bubble { background: var(--soft); color: var(--ink); border: 1.5px solid var(--accent); }
.msg.me .bubble.poll-bubble .quote b, .msg.me .bubble.poll-bubble .quote span { color: inherit; }
.poll { display: flex; flex-direction: column; gap: 8px; white-space: normal; }
.post .poll { margin: 4px 16px 8px; }
.poll-q { font-size: 16px; font-weight: 700; line-height: 1.3; }
.poll-meta { font-size: 12px; color: var(--muted); margin-top: -4px; }
.poll-opts { display: flex; flex-direction: column; gap: 6px; }
.poll-opt { position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid #E4E6EB; background: #fff; overflow: hidden; text-align: left; color: var(--ink); font-size: 15px; }
.poll-opt.on { border-color: var(--accent); }
.poll-opt:disabled { opacity: 1; cursor: default; }
.poll-bar { position: absolute; left: 0; top: 0; bottom: 0; background: #EEF1F5; transition: width .3s; }
.poll-opt.on .poll-bar { background: var(--accent-soft); }
.poll-mark { position: relative; width: 20px; height: 20px; border-radius: 10px; border: 2px solid #BCC0C4; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.poll-mark.sq { border-radius: 6px; }
.poll-opt.on .poll-mark { background: var(--accent); border-color: var(--accent); }
.poll-label { position: relative; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.poll-pct { position: relative; font-weight: 700; font-size: 14px; }
.poll-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.poll-foot .link-btn { padding: 4px 0; color: var(--accent); font-weight: 600; }
.poll-hint { font-size: 12px; }
.who-voted { display: flex; flex-direction: column; gap: 14px; }
.wv-t { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 6px; }
.wv-people { display: flex; flex-direction: column; gap: 6px; }
.wv-p { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-size: 14px; }
.wv-none { font-size: 13px; color: var(--muted); }
.pn { display: flex; flex-direction: column; gap: 10px; }
.pn-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.pn-opts { display: flex; flex-direction: column; gap: 8px; }
.pn-opt { display: flex; align-items: center; gap: 6px; }
.pn-opt .text-field { flex: 1; }
.pn-add { height: 44px; border-radius: 12px; border: 1.5px dashed #BCC0C4; background: transparent; font-size: 15px; font-weight: 600; color: var(--accent); }
.pn-switches { display: flex; flex-direction: column; }
.pn-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pn .seg { margin: 0; }

html[data-theme="dark"] .msg-actions { background: #2B2D31; }
html[data-theme="dark"] .msg-actions button { border-bottom-color: #3A3C41; }
html[data-theme="dark"] .msg-actions button.danger { color: #FF8A8A; }
html[data-theme="dark"] .quote { background: rgba(255,255,255,.08); }
html[data-theme="dark"] .mention-pop { background: #2B2D31; }
html[data-theme="dark"] .pin-bar { background: #232427; border-bottom-color: #2E3034; }
html[data-theme="dark"] .poll-opt { background: #1E1F22; border-color: #3A3C41; }
html[data-theme="dark"] .poll-bar { background: #2E3034; }
html[data-theme="dark"] .poll-opt.on .poll-bar { background: #1D3157; }
html[data-theme="dark"] .mention.me { background: rgba(80,140,255,.2); }
html[data-theme="dark"] .sr-text mark, html[data-theme="dark"] .search-res mark { background: #6B5A12; }

/* ---- Знакомьтесь ---- */
.poll-tag { display: inline-flex; align-items: center; gap: 6px; margin: 0 16px 6px; font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.welcome-card { margin: 12px 12px 0; border-radius: 18px; padding: 18px 16px 16px; background: #EAF2FF; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.welcome-kicker { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; border-radius: 13px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.welcome-photo { border-radius: 50%; box-shadow: 0 0 0 4px #fff; text-decoration: none; }
.welcome-name { font-size: 21px; font-weight: 800; line-height: 1.2; }
.welcome-line { font-size: 14px; color: #4B4F56; }
.welcome-about { font-size: 15px; line-height: 1.4; }
.welcome-skills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.welcome-skills span { height: 28px; padding: 0 12px; border-radius: 14px; background: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; }
.welcome-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px 12px 12px; }
.welcome-actions .btn { height: 44px; }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
html[data-theme="dark"] .welcome-card { background: #1B2840; }
html[data-theme="dark"] .welcome-line { color: #B8BEC8; }
html[data-theme="dark"] .welcome-skills span { background: #2B2D31; }
html[data-theme="dark"] .welcome-photo { box-shadow: 0 0 0 4px #1B2840; }
html[data-theme="dark"] .btn.soft { background: #1D3157; color: #8AB4FF; }

/* ---- Первый вход ---- */
.onb { padding: 20px 20px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 16px; }
.onb h1 { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.15; }
.onb .lead { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.4; }
.onb-photo { align-self: center; position: relative; width: 112px; height: 112px; border-radius: 56px; border: 2px dashed #BCC0C4; background: var(--soft); color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0; font-size: 13px; font-weight: 600; overflow: visible; }
.onb-photo.has { border: 0; background: none; }
.onb-photo .plus { position: absolute; right: 2px; bottom: 2px; width: 32px; height: 32px; border-radius: 16px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px var(--bg, #fff); }
.onb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.onb label > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.onb-bday { display: grid; grid-template-columns: 1fr 1.4fr; gap: 6px; }
.onb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.onb-chips button { height: 36px; padding: 0 14px; border-radius: 18px; border: 1.5px solid #E4E6EB; background: transparent; color: var(--ink); font-size: 14px; font-weight: 600; }
.onb-chips button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.onb-foot { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
html[data-theme="dark"] .onb-chips button { border-color: #3A3C41; }
html[data-theme="dark"] .onb-chips button[aria-pressed="true"] { background: #1D3157; color: #8AB4FF; border-color: #8AB4FF; }

/* ---- Аналитика ---- */
.stats { padding: 10px 12px 24px; display: flex; flex-direction: column; gap: 10px; }
.stat-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-tile { background: var(--card, #fff); border-radius: 16px; padding: 12px 14px; }
.stat-tile .k { font-size: 13px; color: var(--muted); }
.stat-tile .v { font-size: 28px; font-weight: 800; margin-top: 2px; }
.stat-tile .v small { font-size: 15px; color: var(--muted); font-weight: 600; }
.stat-tile .d { font-size: 12px; font-weight: 600; color: var(--muted); }
.stat-tile .d.up { color: #1E6B3A; }
.stat-tile .d.down { color: #B42318; }
.stat-card { background: var(--card, #fff); border-radius: 16px; padding: 12px 14px; }
.stat-card h3 { margin: 0 0 8px; font-size: 15px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin-top: 6px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: flex-end; height: 100%; }
.bars .b i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; background: #C9DBFF; min-height: 3px; }
.bars .b.last i { background: var(--accent); }
.bars .b span { font-size: 11px; color: var(--muted); }
.bars-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.stat-row { display: flex; align-items: center; gap: 12px; min-height: 44px; border-bottom: 1px solid var(--soft); font-size: 14px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row .l { flex: 1; }
.stat-row .d { width: 64px; text-align: right; font-size: 12px; font-weight: 600; }
.stat-row .d.up { color: #1E6B3A; } .stat-row .d.down { color: #B42318; }
.stat-note { display: flex; gap: 8px; font-size: 12px; color: var(--muted); line-height: 1.4; padding: 0 4px; }
.stats-wrap { background: var(--soft); min-height: 100%; }
html[data-theme="dark"] .stat-tile, html[data-theme="dark"] .stat-card { background: #232427; }
html[data-theme="dark"] .bars .b i { background: #2F4A7A; }
html[data-theme="dark"] .stat-tile .d.up, html[data-theme="dark"] .stat-row .d.up { color: #7FD69B; }
html[data-theme="dark"] .stat-tile .d.down, html[data-theme="dark"] .stat-row .d.down { color: #FF8A8A; }

/* ---- Ответы и упоминания в комментариях ---- */
.c-quote-in { display: flex; flex-direction: column; margin: 3px 0 4px; padding: 3px 8px; border-left: 3px solid var(--accent); border-radius: 8px; background: rgba(0,0,0,.05); white-space: normal; }
.c-quote-in b { font-size: 12px; color: var(--accent); }
.c-quote-in span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.c-quote-in.gone { font-size: 12px; font-style: italic; color: var(--muted); border-left-color: #BCC0C4; }
.comment .b .c-text { display: block; }
.mention-pop.c-pop { margin: 0 0 0 40px; }
.ctx-bar.c-reply { padding: 0 0 0 40px; }
.post .text .mention, .comment .mention { color: var(--accent); font-weight: 600; }
html[data-theme="dark"] .c-quote-in { background: rgba(255,255,255,.07); }
.composer-row .pill-input { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 auto; }
.composer-row { gap: 6px; }
.composer-row .icon-btn { flex: 0 0 auto; width: 40px; }

/* ---- Реакции на комментарии ---- */
.comment .c-col { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.c-rx { display: inline-flex; align-items: center; gap: 3px; margin: -6px 0 0 10px; height: 24px; padding: 0 7px 0 4px; border-radius: 12px; border: 0; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); font-size: 12px; color: var(--muted); position: relative; z-index: 1; }
.c-rx.on { box-shadow: 0 0 0 1.5px var(--accent), 0 1px 3px rgba(0,0,0,.12); color: var(--accent); font-weight: 600; }
.c-rx-row { display: flex; justify-content: space-between; padding: 4px; border-radius: 24px; background: var(--soft); }
.c-rx-row button { width: 44px; height: 44px; border-radius: 22px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; padding: 0; }
.c-rx-row button.on { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.c-rx-row button:active { transform: scale(1.2); }
html[data-theme="dark"] .c-rx { background: #2B2D31; }
html[data-theme="dark"] .c-rx-row button.on { background: #3A3C41; }

/* ---- Кто отреагировал ---- */
.rx-who { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 0; color: inherit; font: inherit; cursor: pointer; }
.rx-pill[role="button"] { cursor: pointer; }
.wr-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.wr-tabs button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px; border-radius: 18px; border: 0; background: var(--soft); color: var(--ink); font-size: 14px; font-weight: 600; }
.wr-tabs button.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.wr-list { display: flex; flex-direction: column; max-height: 60vh; overflow-y: auto; }
.wr-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: inherit; text-decoration: none; min-height: 52px; }
.wr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wr-main b { font-size: 15px; }
.wr-main span { font-size: 13px; color: var(--muted); }
html[data-theme="dark"] .wr-tabs button.on { background: #1D3157; color: #8AB4FF; box-shadow: inset 0 0 0 1.5px #8AB4FF; }

/* ---- Ссылки в тексте ---- */
a.link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; word-break: break-word; }
.msg.me .bubble a.link { color: #fff; }
html[data-theme="dark"] a.link { color: #8AB4FF; }
html[data-theme="dark"] .msg.me .bubble a.link { color: #fff; }

/* «Спасибо» с токенами */
.create-row { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 6px; padding: 0 12px 12px; }
.create-chip { height: 40px; min-width: 0; border: 0; border-radius: 20px; background: var(--soft); display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 6px; font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.create-chip.thanks { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); font-size: 14px; font-weight: 700; }
.create-chip:active { filter: brightness(.95); }
.thx-sheet { display: flex; flex-direction: column; gap: 10px; }
.thx-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.thx-hint { font-size: 12px; color: var(--muted); }
.thx-hint:empty { display: none; }
.thx-people { display: flex; gap: 4px; overflow-x: auto; padding: 4px 2px 2px; scrollbar-width: none; }
.thx-person { flex: 0 0 66px; border: 0; background: transparent; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12px; color: var(--ink); }
.thx-person .ring { border-radius: 50%; padding: 3px; }
.thx-person.on .ring { box-shadow: 0 0 0 2px var(--accent); }
.thx-person.on .nm { color: var(--accent); font-weight: 700; }
.thx-amounts { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 8px; }
.thx-amounts .amount-btn { display: flex; align-items: center; justify-content: center; gap: 4px; }
.thx-amounts .amount-btn.none { font-size: 14px; font-weight: 600; }
.thx-amounts .amount-btn.none.on { background: var(--accent-soft); border-color: var(--accent); }
.thx-link { border: 0; background: none; padding: 2px 0; display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 14px; font-weight: 600; text-align: left; }
.thx-link[hidden] { display: none; }
.thx-plaque { margin: 0 12px 10px; border-radius: 16px; background: linear-gradient(135deg, #FFF6D6, #FFE8A3); padding: 14px 16px; display: flex; align-items: center; gap: 12px; color: #3D2E00; }
.thx-plaque .pair { display: flex; align-items: center; gap: 2px; color: #6B4E00; }
.thx-plaque .sum { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.thx-plaque .big { display: flex; align-items: center; gap: 6px; font-size: 28px; font-weight: 800; line-height: 1.1; }
.thx-plaque .big.word { font-size: 20px; color: #B42318; }
.thx-plaque .sub { font-size: 12px; color: #6B4E00; }
.actions button.tok-btn { color: var(--gold-ink); }
html[data-theme="dark"] .thx-plaque { background: #3A3120; color: #F6E7B8; }
html[data-theme="dark"] .thx-plaque .sub, html[data-theme="dark"] .thx-plaque .pair { color: var(--gold-ink); }
html[data-theme="dark"] .thx-plaque .big.word { color: #FF8A80; }
.post .head .post-more { flex: 0 0 auto; width: 40px; height: 40px; margin-right: -8px; color: var(--muted); }

/* Фон-узор чатов и ленты: каждый выбирает в профиле (data-wall на <html>) */
html[data-wall="doodle"] .wall, .wp-doodle { background: #EFE9DD url(/bg/doodle.svg) 0 0/300px 300px; }
html[data-theme="dark"][data-wall="doodle"] .wall, html[data-theme="dark"] .wp-doodle { background: #1E1C18 url(/bg/doodle-dark.svg) 0 0/300px 300px; }
html[data-wall="blueprint"] .wall, .wp-blueprint { background: url(/bg/bp-marks.svg) 0 0/400px 400px, #EAF2FB url(/bg/bp-grid.svg) 0 0/100px 100px; }
html[data-theme="dark"][data-wall="blueprint"] .wall, html[data-theme="dark"] .wp-blueprint { background: url(/bg/bp-marks-dark.svg) 0 0/400px 400px, #121D2A url(/bg/bp-grid-dark.svg) 0 0/100px 100px; }
html[data-wall="iso"] .wall, .wp-iso { background: #EEF1F5 url(/bg/iso.svg) 0 0/69.282px 40px; }
html[data-theme="dark"][data-wall="iso"] .wall, html[data-theme="dark"] .wp-iso { background: #1A1D22 url(/bg/iso-dark.svg) 0 0/69.282px 40px; }
html[data-wall="topo"] .wall, .wp-topo { background: #EDF3EA url(/bg/topo.svg) 0 0/320px 320px; }
html[data-theme="dark"][data-wall="topo"] .wall, html[data-theme="dark"] .wp-topo { background: #18201A url(/bg/topo-dark.svg) 0 0/320px 320px; }
html[data-wall="brick"] .wall, .wp-brick { background: #F4EDE6 url(/bg/brick.svg) 0 0/64px 32px; }
html[data-theme="dark"][data-wall="brick"] .wall, html[data-theme="dark"] .wp-brick { background: #1F1B19 url(/bg/brick-dark.svg) 0 0/64px 32px; }
html[data-wall="night"] .wall, .wp-night { background: url(/bg/night.svg) 0 0/300px 300px, #102A47 url(/bg/night-grid.svg) 0 0/100px 100px; }
html[data-theme="dark"][data-wall="night"] .wall, html[data-theme="dark"] .wp-night { background: url(/bg/night.svg) 0 0/300px 300px, #102A47 url(/bg/night-grid.svg) 0 0/100px 100px; }
.wp-none { background: #F0F2F5; }
html[data-theme="dark"] .wp-none { background: #1E1F22; }
/* С узором: входящие сообщения — белые «плашки», служебные строки — на подложке */
html[data-wall]:not([data-wall="none"]) .wall .msg:not(.me) .bubble:not(.photo) { background: #FFFFFF; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
html[data-theme="dark"][data-wall]:not([data-wall="none"]) .wall .msg:not(.me) .bubble:not(.photo) { background: #2E3034; box-shadow: 0 1px 1px rgba(0,0,0,.3); }
html[data-wall]:not([data-wall="none"]) .wall .msg.me .bubble { box-shadow: 0 1px 1px rgba(0,0,0,.12); }
html[data-wall]:not([data-wall="none"]) .wall .day,
html[data-wall]:not([data-wall="none"]) .wall .typing:not(:empty) { align-self: center; background: rgba(255,255,255,.88); color: #4B4F56; font-weight: 600; border-radius: 10px; padding: 3px 10px; margin: 10px 0 4px; }
html[data-wall]:not([data-wall="none"]) .wall .typing:not(:empty) { align-self: flex-start; margin: 0 12px 6px; }
html[data-wall]:not([data-wall="none"]) .wall .system { background: rgba(255,255,255,.9); color: #4B4F56; }
html[data-wall]:not([data-wall="none"]) .wall .msg .who { color: #4B4F56; font-weight: 600; }
html[data-wall="night"] .wall .msg .who { color: #C9D6E6; }
html[data-theme="dark"][data-wall]:not([data-wall="none"]) .wall .day,
html[data-theme="dark"][data-wall]:not([data-wall="none"]) .wall .typing:not(:empty),
html[data-theme="dark"][data-wall]:not([data-wall="none"]) .wall .system { background: rgba(30,31,34,.9); color: var(--muted); }
html[data-theme="dark"][data-wall]:not([data-wall="none"]) .wall .msg .who { color: var(--muted); }
/* Лента с узором: карточки «плавают», узор виден между ними */
html[data-wall]:not([data-wall="none"]) .wall.feed-wall .feed-top { background: #FFFFFF; padding-bottom: 2px; }
html[data-theme="dark"][data-wall]:not([data-wall="none"]) .wall.feed-wall .feed-top { background: #1E1F22; }
html[data-wall]:not([data-wall="none"]) .wall.feed-wall .band { background: transparent; height: 10px; }
html[data-wall]:not([data-wall="none"]) .wall.feed-wall .post { background: #FFFFFF; margin: 0 8px; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
html[data-theme="dark"][data-wall]:not([data-wall="none"]) .wall.feed-wall .post { background: #1E1F22; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
html[data-wall]:not([data-wall="none"]) .wall.feed-wall .post .band { display: none; }
html[data-wall]:not([data-wall="none"]) .wall.feed-wall .post + .post, html[data-wall]:not([data-wall="none"]) .wall.feed-wall .post { margin-bottom: 10px; }
html[data-wall]:not([data-wall="none"]) .wall.feed-wall .empty, html[data-wall]:not([data-wall="none"]) .wall.feed-wall .feed-note { margin: 0 8px 10px; background: rgba(255,255,255,.9); border-radius: 12px; }
/* Выбор фона */
.wall-preview { height: 220px; border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 12px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.wall-preview .pb { max-width: 80%; border-radius: 18px; padding: 8px 12px; font-size: 14px; line-height: 1.35; box-shadow: 0 1px 1px rgba(0,0,0,.1); }
.wall-preview .pb.in { align-self: flex-start; background: #FFFFFF; color: #050505; }
.wall-preview .pb.in b { display: block; font-size: 12px; color: #B5502F; }
.wall-preview .pb.out { align-self: flex-end; background: var(--accent); color: #fff; }
html[data-theme="dark"] .wall-preview .pb.in { background: #2E3034; color: var(--ink); }
.wall-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.wall-opt { border: 0; background: transparent; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12px; color: var(--ink); }
.wall-opt .sw { width: 100%; aspect-ratio: 3 / 4; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.wall-opt.on .sw { box-shadow: 0 0 0 3px var(--bg-sheet, #fff), 0 0 0 5px var(--accent); }
.wall-opt.on { color: var(--accent); font-weight: 700; }
html[data-theme="dark"] .wall-opt.on .sw { box-shadow: 0 0 0 3px #1E1F22, 0 0 0 5px var(--accent); }
/* Внеплановые токены */
.bonus-plaque { margin: 0 12px 10px; border-radius: 16px; background: linear-gradient(135deg, #FFF6D6, #FFE8A3); padding: 14px 16px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; color: #3D2E00; }
.bonus-plaque .big { grid-row: 1 / 3; display: flex; align-items: center; gap: 6px; font-size: 30px; font-weight: 800; color: #6B4E00; }
.bonus-plaque .sub { font-size: 13px; color: #6B4E00; font-weight: 600; }
.bonus-plaque .btn { justify-self: start; margin-top: 6px; height: 36px; }
html[data-theme="dark"] .bonus-plaque { background: #3A3120; color: #F6E7B8; }
html[data-theme="dark"] .bonus-plaque .big, html[data-theme="dark"] .bonus-plaque .sub { color: var(--gold-ink); }
.bonus-ic { width: 40px; height: 40px; border-radius: 12px; background: #FFF3D1; color: #6B4E00; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
html[data-theme="dark"] .bonus-ic { background: #3A3120; color: var(--gold-ink); }
/* Документы */
.post-files { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 10px; }
.post-files[hidden] { display: none; }
.sheet .post-files { padding: 0; }
.doc-card { position: relative; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 12px; border-radius: 14px; background: var(--soft); color: var(--ink); text-decoration: none; min-width: 0; }
.doc-card:active { filter: brightness(.96); }
.doc-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.doc-badge { position: relative; flex: 0 0 auto; width: 36px; height: 44px; border-radius: 5px 12px 5px 5px; color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; }
.doc-badge .fold { position: absolute; top: 0; right: 0; width: 12px; height: 12px; border-radius: 0 10px 0 4px; background: rgba(255,255,255,.35); }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-name { font-size: 14.5px; font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.doc-meta { font-size: 12.5px; color: var(--muted); }
.doc-act { flex: 0 0 auto; color: var(--muted); display: flex; }
.doc-card.pending { padding-right: 40px; }
.doc-card.pending .close-btn { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); }
.bubble.file-bubble { padding: 6px; display: flex; flex-direction: column; gap: 6px; min-width: 230px; max-width: 100%; }
.bubble.file-bubble .btext { padding: 0 6px 2px; }
.msg:not(.me) .bubble.file-bubble .doc-card { background: rgba(255,255,255,.7); }
.msg.me .bubble.file-bubble .doc-card { background: rgba(255,255,255,.95); }
html[data-theme="dark"] .msg .bubble.file-bubble .doc-card { background: rgba(0,0,0,.25); color: var(--ink); }
html[data-theme="dark"] .msg.me .bubble.file-bubble .doc-card { background: rgba(255,255,255,.12); color: #fff; }
html[data-theme="dark"] .msg.me .bubble.file-bubble .doc-meta { color: rgba(255,255,255,.75); }
html[data-wall]:not([data-wall="none"]) .wall .msg:not(.me) .bubble.file-bubble .doc-card { background: var(--soft); }
.preview-strip .doc-card { flex: 1; }
/* Просмотр PDF */
.viewer.pdfv { flex-direction: column; align-items: stretch; justify-content: flex-start; background: #2B2E33; }
.pdf-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; background: #1E1F22; color: #fff; }
.pdf-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pdf-title b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-info { font-size: 12px; color: #B0B3B8; min-height: 15px; }
.pdf-btn { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 22px; border: 0; background: rgba(255,255,255,.14); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; }
.pdf-btn:active { background: rgba(255,255,255,.26); }
.pdf-btn:focus-visible { outline: 3px solid #4D93FF; outline-offset: 2px; }
.pdf-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 8px; }
.pdf-pages { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: max-content; min-width: 100%; }
.pdf-pages { align-items: center; }
.pdf-page { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); flex: 0 0 auto; }
.pdf-page canvas { display: block; }
.pdf-status { color: #E4E6EB; text-align: center; padding: 40px 16px; font-size: 15px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pdf-zoom { position: absolute; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 26px; background: rgba(30,31,34,.9); color: #fff; }
.pdf-zl { min-width: 44px; text-align: center; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* Группы */
.chat-head .head-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-decoration: none; color: inherit; border: 0; background: none; padding: 0; text-align: left; font: inherit; cursor: pointer; border-radius: 12px; }
.chat-head .head-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.new-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px 8px; }
.new-btn { height: 44px; border-radius: 14px; background: var(--soft); color: var(--ink); display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 14.5px; text-decoration: none; }
.new-btn .ic { width: 28px; height: 28px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.new-btn:active { filter: brightness(.95); }
.pick-all { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px; border: 0; background: none; border-radius: 12px; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.pick-all b { flex: 1; color: var(--accent); }
.pick-all .n { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pick-all .check.on { border-color: var(--accent); background: var(--accent); }
.group-info { display: flex; flex-direction: column; gap: 10px; }
.gi-sub { color: var(--muted); font-size: 13px; text-align: center; margin-top: -6px; }
.gi-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.gi-list { max-height: 50dvh; overflow-y: auto; }
.add-members { display: flex; flex-direction: column; gap: 6px; }
.add-list { max-height: 46dvh; overflow-y: auto; margin: 0 -8px; }
/* Чаты: компактный список */
.chats-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px 8px; min-height: 60px; }
.chats-top h1 { flex: 1; margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.01em; }
.plus-btn { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 20px; border: 0; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.plus-btn:active { filter: brightness(.92); }
.plus-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ctabs { display: flex; gap: 22px; padding: 4px 16px 0; border-bottom: 1px solid var(--line); margin-top: 4px; }
.ctabs button { border: 0; background: none; padding: 6px 0 10px; display: flex; align-items: center; gap: 6px; font-size: 15.5px; font-weight: 600; color: var(--faint); box-shadow: inset 0 -3px 0 transparent; cursor: pointer; }
.ctabs button.on { color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
.ctab-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.ctabs button.on .ctab-n { background: var(--accent-soft); color: var(--accent); }
.status-row.compact, .chats-top ~ .scroll .status-row { gap: 8px; padding: 10px 12px 6px; }
.chats-top ~ .scroll .status-item { flex: 0 0 56px; gap: 4px; font-size: 11.5px; }
.chats-top ~ .scroll .status-item span.label { width: 56px; }
.chats-top ~ .scroll .status-item .plus-circle { width: 50px; height: 50px; }
.clist { display: flex; flex-direction: column; padding-top: 4px; }
.crow { display: flex; align-items: center; gap: 12px; padding: 9px 16px; text-decoration: none; color: var(--ink); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.crow:active { background: var(--soft); }
.crow.pinned { background: #F4F6F9; }
.crow:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.cr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cr-top, .cr-bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cr-name { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-mute { color: var(--faint); display: flex; flex: 0 0 auto; }
.cr-tick { color: var(--faint); display: flex; flex: 0 0 auto; }
.cr-tick.read { color: var(--accent); }
.cr-time { font-size: 13px; color: var(--faint); flex: 0 0 auto; }
.crow.unread .cr-time { color: var(--accent); }
.crow.unread.muted .cr-time { color: var(--faint); }
.cr-text { flex: 1; min-width: 0; font-size: 14.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crow.unread .cr-text { color: var(--ink); }
.cr-who { color: var(--ink); font-weight: 500; }
.cr-who.me { color: var(--accent); }
.cr-kind { display: inline-flex; vertical-align: -2px; color: var(--faint); margin-right: 4px; }
.cr-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.crow.muted .cr-badge { background: #B0B3B8; }
.cr-at { width: 22px; height: 22px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cr-pin { color: #B0B3B8; display: flex; flex: 0 0 auto; }
.create-menu { position: fixed; z-index: 81; width: 270px; max-width: calc(100vw - 16px); border-radius: 16px; background: #fff; box-shadow: 0 10px 34px rgba(0,0,0,.2); padding: 6px; display: flex; flex-direction: column; }
.cm-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 0; background: none; border-radius: 10px; font-size: 16px; font-weight: 500; color: var(--ink); text-align: left; cursor: pointer; }
.cm-item:hover, .cm-item:focus-visible { background: var(--soft); outline: none; }
.cm-ic { display: flex; flex: 0 0 auto; }
.cm-txt { display: flex; flex-direction: column; }
.cm-txt span { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.cm-sep { height: 1px; background: var(--line); margin: 4px 8px; }
html[data-theme="dark"] .crow.pinned { background: #24262A; }
html[data-theme="dark"] .create-menu { background: #2A2C30; }

/* ---------- Защита экранов: карточка сбоя ---------- */
.crash { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; }
.crash-ic { width: 88px; height: 88px; border-radius: 44px; background: var(--soft); display: flex; align-items: center; justify-content: center; font-size: 40px; }
.crash h2 { margin: 6px 0 0; font-size: 21px; }
.crash p { margin: 0; max-width: 300px; color: var(--muted, #65676B); font-size: 15px; line-height: 1.4; }
.crash-actions { display: flex; gap: 8px; margin-top: 12px; }
.office-ic { background: #E7F1FF; font-size: 21px; }
html[data-theme="dark"] .office-ic { background: #1F2A3A; }
.office-hours { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Годовщина в компании ---------- */
.anniv-card { background: linear-gradient(165deg, #E9F3FF 0%, #FFF4D6 60%, #FFE9F1 100%); }
.anniv-card .bday-kicker { color: #2F5E9E; }
.anniv-row { display: flex; align-items: center; gap: 14px; margin: 6px 0 2px; }
.anniv-row .bday-photo { margin: 0; }
.anniv-num { width: 96px; height: 96px; border-radius: 50%; background: #F5B700; color: #3D2E00; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; box-shadow: 0 0 0 4px #fff, 0 6px 18px rgba(201, 138, 0, .3); }
.anniv-num b { font-size: 36px; font-weight: 800; }
.anniv-num span { font-size: 12px; font-weight: 600; }
.joined-pick { display: grid; grid-template-columns: .9fr 1.6fr 1.1fr; gap: 8px; }
.joined-hint { font-size: 14px; color: var(--muted); min-height: 20px; }
html[data-theme="dark"] .anniv-card { background: linear-gradient(165deg, #1F2A3A 0%, #3A3120 60%, #3A2330 100%); }
html[data-theme="dark"] .anniv-card .bday-kicker { color: #8FB8F2; }
html[data-theme="dark"] .anniv-num { box-shadow: 0 0 0 4px #1E1F22; }

/* ---------- Админка: сотрудники по одному, права ---------- */
.admin-page { padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.add-person { height: 52px; font-size: 17px; border-radius: 14px; }
.adm-row { cursor: pointer; }
.adm-row:active td { background: var(--soft); }
.tag.owner { background: #FFF3D1; color: #6B4E00; }
html[data-theme="dark"] .tag.owner { background: #3A3120; color: var(--gold-ink); }
.pf-wrap { display: flex; flex-direction: column; gap: 12px; }
.pf { display: flex; flex-direction: column; gap: 10px; }
.pf-field { display: flex; flex-direction: column; gap: 5px; }
.pf-field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.pf-field small { font-size: 12px; color: var(--muted); }
.pf-details { border-top: 1px solid var(--line); padding-top: 10px; }
.pf-details > summary { cursor: pointer; font-weight: 700; font-size: 15px; padding: 4px 0 8px; }
.pf-details[open] > summary { margin-bottom: 4px; }
.pf-details > .btn { margin-top: 10px; }
.invite-box { background: var(--soft); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.invite-url { font-size: 13px; word-break: break-all; color: var(--accent); }
.invite-box .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.added { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.added .invite-box { width: 100%; text-align: left; }
.added-ic { width: 60px; height: 60px; border-radius: 30px; background: #E3F4EA; color: #1E7B45; display: flex; align-items: center; justify-content: center; }
.added-t { font-size: 19px; font-weight: 800; }
.person-head { display: flex; flex-direction: column; gap: 6px; margin-top: -6px; }
.person-head .muted { color: var(--muted); font-size: 14px; }
.person-acts { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.rights { display: flex; flex-direction: column; gap: 2px; }
.rights .info-row { text-align: left; }
.rights .btn { margin-top: 10px; }
.chk { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 7px; box-shadow: inset 0 0 0 2px var(--line); display: flex; align-items: center; justify-content: center; color: #fff; margin-right: 10px; }
.chk.on { background: var(--accent); box-shadow: none; }
.helper-row { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 6px 0; text-align: left; font: inherit; color: inherit; width: 100%; }
.helper-row .main { flex: 1; display: flex; flex-direction: column; }
.excel-box > summary { cursor: pointer; padding: 2px 0; }
.rights .pn-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.invite-box .btn.secondary { background: var(--card, #fff); }
html[data-theme="dark"] .invite-box .btn.secondary { background: #2A2C30; }

/* ---------- Комментарии: открыть и свернуть ---------- */
.c-count { border: 0; background: none; color: inherit; padding: 4px 0; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.c-count svg { transform: rotate(90deg); transition: transform .15s; opacity: .7; }
.c-count.open svg { transform: rotate(-90deg); }
.c-hide { align-self: center; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 600; padding: 10px 12px 2px; display: inline-flex; align-items: center; gap: 4px; }
.c-hide svg { transform: rotate(-90deg); }
