/* Мобильная вёрстка мини-приложения. Ширина рассчитана на телефон, на десктопе — колонка 520px. */
:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --text: #111114;
  --hint: #8a8a96;
  --line: #e5e5ea;
  --accent: #3b6ef5;
  --accent-text: #ffffff;
  --accent-soft: rgba(59, 110, 245, .1);
  --ok: #1f9d55;
  --warn: #e08a1e;
  --danger: #e5484d;
  --radius: 16px;
  --tabbar-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --card: #1c1c1e; --text: #f2f2f7; --hint: #8e8e93; --line: #2c2c2e;
    --accent: #5b8cff; --accent-soft: rgba(91, 140, 255, .16); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --card: #1c1c1e; --text: #f2f2f7; --hint: #8e8e93; --line: #2c2c2e;
  --accent: #5b8cff; --accent-soft: rgba(91, 140, 255, .16); color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; }
main { padding: 0 16px calc(var(--tabbar-h) + var(--safe-b) + 24px); }
main.no-tabbar { padding-bottom: calc(var(--safe-b) + 24px); }
main.has-actionbar { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 96px); }
main.no-tabbar.has-actionbar { padding-bottom: calc(var(--safe-b) + 96px); }
.loader, .empty { color: var(--hint); text-align: center; padding: 40px 12px; font-size: 15px; }
.empty .big { font-size: 40px; display: block; margin-bottom: 8px; }

/* ---------- верхняя панель ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; margin: 0 -16px 8px; padding: 10px 16px 8px;
  display: flex; align-items: center; gap: 8px; min-height: 52px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
}
.topbar h1 { flex: 1; margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { margin-left: -8px; }
.icon-btn {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 20px; display: inline-flex; align-items: center;
  justify-content: center; background: transparent; color: var(--accent); border: 0; padding: 0; cursor: pointer;
}
.icon-btn:active { background: var(--accent-soft); }
.icon-btn svg, .tabbar svg, .ico { width: 24px; height: 24px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px; border-radius: 17px;
  background: var(--accent-soft); color: var(--accent); border: 0; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.pill-btn svg { width: 18px; height: 18px; }

/* ---------- нижняя навигация ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--card) 92%, transparent); border-top: .5px solid var(--line);
  backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  padding-bottom: var(--safe-b);
}
.tabbar-inner { display: flex; width: 100%; max-width: 520px; height: var(--tabbar-h); }
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: 0; color: var(--hint); font: inherit; font-size: 11px; font-weight: 500;
  position: relative; padding: 0; cursor: pointer;
}
.tabbar button.active { color: var(--accent); }
.tabbar .badge-dot {
  position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px;
  border: 2px solid var(--card); box-sizing: content-box;
}

/* ---------- карточки и списки ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.card.tap { cursor: pointer; }
.card.tap:active { opacity: .7; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--hint);
  margin: 22px 4px 8px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.section-title button { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--accent);
  background: none; border: 0; font-weight: 500; padding: 0; font-family: inherit; cursor: pointer; }
.list { background: var(--card); border-radius: var(--radius); overflow: hidden; margin-bottom: 10px; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 52px; position: relative;
  background: var(--card); width: 100%; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--line); }
.row.with-avatar + .row.with-avatar::before { left: 68px; }
.row:active { background: var(--bg); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { color: var(--hint); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .chev { color: var(--hint); opacity: .6; width: 18px; height: 18px; flex: 0 0 18px; }
.row .end { color: var(--hint); font-size: 15px; }
.row .ico-box { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; }
.row .ico-box svg { width: 18px; height: 18px; }
.avatar {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 17px;
}
.avatar.lg { width: 76px; height: 76px; flex-basis: 76px; border-radius: 38px; font-size: 32px; }
.avatar.sm { width: 32px; height: 32px; flex-basis: 32px; border-radius: 16px; font-size: 14px; }

/* ---------- формы ---------- */
textarea, input, select {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--bg);
  border: 1px solid transparent; border-radius: 12px; padding: 12px 14px; outline: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--hint) 50%), linear-gradient(135deg, var(--hint) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
textarea { resize: none; min-height: 120px; line-height: 1.45; }
textarea:focus, input:focus, select:focus { border-color: var(--accent); background: var(--card); }
.card textarea:focus, .card input:focus, .card select:focus { background: var(--bg); }
label.field { display: block; margin-bottom: 12px; }
label.field:last-child { margin-bottom: 0; }
label.field > span { display: block; font-size: 13px; color: var(--hint); margin: 0 0 6px 4px; }
.field-row { display: flex; gap: 8px; }
.field-row > * { flex: 1; min-width: 0; }
.counter { text-align: right; font-size: 12px; color: var(--hint); margin-top: 4px; }
.hint { color: var(--hint); font-size: 13px; }
.note { font-size: 13px; color: var(--hint); padding: 0 4px; margin: 6px 0 10px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; min-height: 52px; }
.switch-row + .switch-row { border-top: .5px solid var(--line); }
.switch-row .hint { display: block; }
.switch { position: relative; width: 51px; height: 31px; flex: 0 0 51px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--line); transition: .2s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(20px); }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 16px;
  font-weight: 600; border: 0; border-radius: 12px; height: 46px; padding: 0 16px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); transition: opacity .15s, transform .1s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: scale(.98); opacity: .85; }
.btn:disabled { opacity: .45; }
.btn.secondary { background: var(--accent-soft); color: var(--accent); }
.btn.plain { background: var(--bg); color: var(--text); }
.btn.danger { background: rgba(229, 72, 77, .12); color: var(--danger); }
.btn.ok { background: rgba(31, 157, 85, .12); color: var(--ok); }
.btn.sm { height: 38px; font-size: 15px; padding: 0 12px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.btn-row > .btn { flex: 1; min-width: 0; }
.btn-row > .btn.icon { flex: 0 0 38px; padding: 0; }

.actionbar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b)); z-index: 25;
  display: flex; justify-content: center; padding: 12px 16px 10px;
  background: linear-gradient(to top, var(--bg) 65%, transparent);
}
.actionbar.bottom { bottom: 0; padding-bottom: calc(10px + var(--safe-b)); }
.actionbar-inner { display: flex; gap: 8px; width: 100%; max-width: 488px; }
.actionbar-inner .btn { flex: 1; height: 50px; border-radius: 14px; }
.actionbar-inner .btn.plain { background: var(--card); }

/* ---------- сегменты и чипы ---------- */
.segmented { display: flex; background: color-mix(in srgb, var(--hint) 18%, transparent); border-radius: 10px; padding: 2px; margin-bottom: 12px; }
.segmented button {
  flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 500;
  height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer;
  white-space: nowrap; padding: 0 4px;
}
.segmented button.active { background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.12); font-weight: 600; }
.segmented .n { font-size: 12px; color: var(--hint); font-weight: 600; }
.segmented .n.hot { color: #fff; background: var(--danger); border-radius: 9px; padding: 0 6px; line-height: 18px; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; height: 34px; padding: 0 14px; border-radius: 17px; border: 0; background: var(--card);
  color: var(--text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.chip.active { background: var(--text); color: var(--bg); }
.card .chip { background: var(--bg); }
.card .chip.active { background: var(--text); color: var(--bg); }

/* ---------- бейджи и статусы ---------- */
.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px;
  background: var(--bg); color: var(--hint); letter-spacing: .02em; white-space: nowrap; }
.badge.tg { color: #229ed9; background: rgba(34, 158, 217, .12); }
.badge.max { color: #7c4dff; background: rgba(124, 77, 255, .12); }
.badge.owner, .badge.admin { color: var(--accent); background: var(--accent-soft); }
.badge.moderator { color: var(--warn); background: rgba(224, 138, 30, .14); }
.badge.danger { color: var(--danger); background: rgba(229, 72, 77, .12); }
.badge.ok { color: var(--ok); background: rgba(31, 157, 85, .12); }
.badge.warn { color: var(--warn); background: rgba(224, 138, 30, .14); }
.status { font-size: 13px; font-weight: 600; }
.status.new { color: var(--hint); }
.status.answered, .status.done { color: var(--ok); }
.status.review { color: var(--warn); }
.status.rejected { color: var(--danger); }

/* ---------- вопросы ---------- */
.q-author { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; background: none; border: 0; padding: 0;
  font: inherit; color: inherit; text-align: left; width: 100%; cursor: pointer; }
.q-author .main { flex: 1; min-width: 0; }
.q-author .name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-author .meta { font-size: 12px; color: var(--hint); display: flex; gap: 6px; align-items: center; }
.q-author .chev { width: 18px; height: 18px; color: var(--hint); opacity: .6; }
.q-text { white-space: pre-wrap; word-break: break-word; font-size: 16px; }
.q-meta { display: flex; gap: 8px; align-items: center; color: var(--hint); font-size: 13px; margin-bottom: 6px; flex-wrap: wrap; }
.answer { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft);
  white-space: pre-wrap; word-break: break-word; font-size: 15px; }
.answer .by { display: block; font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 2px; }

/* ---------- шторка ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.4); opacity: 0; transition: opacity .25s; }
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; margin: 0 auto; max-width: 520px; max-height: 92vh;
  background: var(--bg); border-radius: 18px 18px 0 0; transform: translateY(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column; padding-bottom: var(--safe-b);
}
.sheet.open { transform: translateY(0); }
.sheet-head { display: flex; align-items: center; padding: 8px 8px 4px 16px; position: relative; }
.sheet-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px;
  border-radius: 3px; background: color-mix(in srgb, var(--hint) 40%, transparent); }
.sheet-head h2 { flex: 1; margin: 12px 0 4px; font-size: 18px; }
.sheet-body { overflow-y: auto; padding: 4px 16px 16px; -webkit-overflow-scrolling: touch; }
.quote { border-left: 3px solid var(--accent); padding: 6px 10px; margin-bottom: 12px; color: var(--hint);
  font-size: 15px; white-space: pre-wrap; max-height: 120px; overflow: auto; background: var(--card); border-radius: 0 10px 10px 0; }
.menu { background: var(--card); border-radius: 14px; overflow: hidden; }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; background: none;
  font: inherit; color: var(--text); text-align: left; cursor: pointer; position: relative; }
.menu button + button::before { content: ""; position: absolute; top: 0; left: 52px; right: 0; border-top: .5px solid var(--line); }
.menu button svg { width: 22px; height: 22px; color: var(--accent); flex: 0 0 22px; }
.menu button .sub { display: block; font-size: 13px; color: var(--hint); }
.menu button.danger, .menu button.danger svg { color: var(--danger); }

/* ---------- тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px); transform: translateX(-50%);
  background: color-mix(in srgb, var(--text) 92%, transparent); color: var(--bg); padding: 11px 16px; border-radius: 14px;
  font-size: 15px; max-width: calc(100% - 32px); z-index: 100; box-shadow: 0 6px 24px rgba(0,0,0,.2); text-align: center;
}

/* ---------- пользователь: главная ---------- */
.hello { margin: 12px 4px 14px; }
.hello h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.hello p { margin: 2px 0 0; color: var(--hint); }

.daily { perspective: 1000px; margin-bottom: 10px; }
.daily-inner { position: relative; min-height: 200px; transition: transform .7s cubic-bezier(.3,1.25,.5,1); transform-style: preserve-3d; }
.daily.flipped .daily-inner { transform: rotateY(180deg); }
.daily-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 20px;
  padding: 16px 18px; color: #fff; display: flex; flex-direction: column; overflow: hidden;
}
.daily-front { background: linear-gradient(135deg, #7b5cff, #e25cad 60%, #ff9a6b); cursor: pointer; }
.daily-front::after { content: ""; position: absolute; inset: -40%; pointer-events: none;
  background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,.3) 50%, transparent 60%); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 0% { transform: translateX(-60%); } 60%, 100% { transform: translateX(60%); } }
.daily-back { background: linear-gradient(160deg, #2d2a5a, #4b3b8f); transform: rotateY(180deg); }
.daily-face .top { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; }
.daily-face .mid { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 4px; }
.daily-face .mid .big { font-size: 44px; line-height: 1; }
.daily-face .mid b { font-size: 18px; }
.daily-face .mid span { font-size: 14px; opacity: .85; }
.daily-face .card-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; opacity: .7; margin: 8px 0 4px; }
.daily-face .card-text { font-size: 18px; line-height: 1.35; font-weight: 600; white-space: pre-wrap; flex: 1; overflow: auto; }
.flame { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,.22); border-radius: 12px; padding: 3px 10px; font-size: 13px; }
.week { display: flex; gap: 5px; justify-content: center; margin-top: 10px; }
.week i { width: 24px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.25); }
.week i.on { background: #fff; }
.daily-off { min-height: 0; }

.mk { background: var(--card); border-radius: 20px; overflow: hidden; margin-bottom: 10px; }
.mk-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--line); }
.mk-cover.ph { display: flex; align-items: center; justify-content: center; font-size: 48px;
  background: linear-gradient(135deg, #ffe1c8, #ffd0e4); }
.mk-body { padding: 14px 16px 16px; }
.mk-when { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.mk-when svg { width: 16px; height: 16px; }
.mk h3 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.01em; }
.mk .desc { opacity: .85; font-size: 15px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.mk .desc.open { -webkit-line-clamp: unset; display: block; }
.mk .more { background: none; border: 0; color: var(--accent); font: inherit; font-size: 15px; padding: 2px 0; cursor: pointer; }
.mk .spots { font-size: 13px; color: var(--hint); margin-top: 8px; }
.registered { display: flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; font-size: 15px; }
.registered svg { width: 20px; height: 20px; }

.bonus-hero { text-align: center; padding: 24px 16px 18px; }
.bonus-hero .gift { font-size: 64px; line-height: 1; display: inline-block; }
.bonus-hero.locked .gift { filter: grayscale(.5); opacity: .85; }
.bonus-hero.unlocked .gift { animation: pop .7s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { from { transform: scale(.4) rotate(-12deg); } to { transform: none; } }
.bonus-hero h2 { margin: 10px 0 4px; font-size: 22px; }
.bonus-hero p { margin: 0; color: var(--hint); white-space: pre-wrap; }
.progress { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; margin: 14px 0 6px; }
.progress > div { height: 100%; background: linear-gradient(90deg, #7b5cff, #e25cad); border-radius: 4px; transition: width .4s; }
.reward { background: var(--bg); border-radius: 12px; padding: 14px; font-size: 17px; font-weight: 600; white-space: pre-wrap;
  word-break: break-word; text-align: center; margin: 14px 0 0; }
.bonus-teaser { display: flex; align-items: center; gap: 12px; }
.bonus-teaser .gift { font-size: 34px; }
.bonus-teaser .main { flex: 1; min-width: 0; }
.bonus-teaser .progress { margin: 6px 0 0; height: 6px; }

/* ---------- статистика ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.kpi { background: var(--card); border-radius: var(--radius); padding: 12px 14px; }
.kpi .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .l { color: var(--hint); font-size: 13px; }
.kpi .d { font-size: 12px; margin-top: 2px; color: var(--hint); }
.chart { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding-top: 6px; }
.chart .col { flex: 1; display: flex; align-items: flex-end; gap: 1px; height: 100%; min-width: 0; }
.chart .bar { flex: 1; border-radius: 2px 2px 0 0; min-height: 0; }
.chart-axis { display: flex; justify-content: space-between; color: var(--hint); font-size: 11px; margin-top: 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--hint); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.metrics div { background: var(--bg); border-radius: 10px; padding: 8px 4px; text-align: center; }
.metrics b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.metrics span { font-size: 11px; color: var(--hint); }

/* ---------- рассылки ---------- */
.bc-item { display: flex; gap: 12px; }
.bc-item .thumb { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 10px; object-fit: cover; background: var(--bg); }
.bc-item .main { flex: 1; min-width: 0; }
.bc-item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-item .text { font-size: 14px; color: var(--hint); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bc-item .meta { font-size: 12px; color: var(--hint); margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bar-progress { height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.bar-progress > div { height: 100%; background: var(--accent); transition: width .3s; }

.toolbar { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.toolbar button { height: 34px; min-width: 40px; padding: 0 10px; border-radius: 9px; border: 0; background: var(--bg); color: var(--text);
  font: inherit; font-size: 15px; cursor: pointer; }
.photo-pick { display: flex; align-items: center; justify-content: center; gap: 8px; height: 88px; border-radius: 14px;
  border: 1.5px dashed color-mix(in srgb, var(--hint) 50%, transparent); color: var(--accent); cursor: pointer;
  background: var(--bg); width: 100%; font: inherit; font-size: 16px; font-weight: 600; }
.photo-pick svg { width: 24px; height: 24px; }
.photo-preview { position: relative; border-radius: 14px; overflow: hidden; background: var(--bg); }
.photo-preview img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.photo-preview .x { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.55); color: #fff; }
.photo-preview .busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.4); color: #fff; font-weight: 600; }

.btn-edit { background: var(--bg); border-radius: 14px; padding: 10px; margin-bottom: 8px; }
.btn-edit .head { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; font-size: 13px; color: var(--hint); font-weight: 600; }
.btn-edit .head .sp { flex: 1; padding-left: 4px; }
.btn-edit input { background: var(--card); margin-bottom: 6px; padding: 10px 12px; }
.btn-edit .icon-btn { width: 34px; height: 34px; flex-basis: 34px; }
.btn-edit .icon-btn svg { width: 18px; height: 18px; }
.join { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 2px 2px 0; }
.join input { width: 20px; height: 20px; accent-color: var(--accent); -webkit-appearance: auto; padding: 0; flex: 0 0 20px; }

/* ---------- предпросмотр сообщения ---------- */
.pv { border-radius: 16px; padding: 18px 12px; overflow: hidden; }
.pv-tg { background: linear-gradient(160deg, #b9d39a, #d9e7b5 45%, #9ec58f); }
.pv-max { background: linear-gradient(180deg, #e7e8f6, #f4f1fb); }
.pv-msg { max-width: 90%; }
.pv-bubble { background: #fff; color: #000; border-radius: 16px 16px 16px 4px; overflow: hidden; box-shadow: 0 1px 1px rgba(0,0,0,.12); }
.pv-max .pv-bubble { border-radius: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.pv-bubble img { width: 100%; display: block; max-height: 300px; object-fit: cover; }
.pv-text { padding: 7px 10px 7px; font-size: 15px; line-height: 1.35; white-space: pre-wrap; word-break: break-word; }
.pv-text a { color: #2a7ae2; }
.pv-max .pv-text { padding: 9px 12px; }
.pv-time { float: right; font-size: 11px; color: #8a9aa8; margin: 6px 0 -4px 10px; }
.pv-kb { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.pv-row { display: flex; gap: 4px; }
.pv-btn { flex: 1; min-width: 0; text-align: center; font-size: 14px; font-weight: 500; padding: 9px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-tg .pv-btn { background: rgba(60, 85, 50, .36); color: #fff; border-radius: 10px; }
.pv-tg .pv-btn::after { content: " ↗"; font-size: 11px; opacity: .8; }
.pv-max .pv-bubble.has-kb { border-radius: 18px 18px 0 0; }
.pv-max .pv-kb { background: #fff; margin-top: 0; padding: 2px 8px 8px; border-radius: 0 0 18px 18px; gap: 6px; }
.pv-max .pv-row { gap: 6px; }
.pv-max .pv-btn { background: #f0eefb; color: #6c4cf5; border-radius: 12px; padding: 10px 8px; }
.pv-caption { text-align: center; font-size: 12px; color: var(--hint); margin-top: 6px; }

/* ---------- ссылки ---------- */
.copy-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border: 0; border-top: .5px solid var(--line); background: none;
  width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.copy-row .lbl { flex: 0 0 72px; font-size: 13px; color: var(--hint); }
.copy-row code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.copy-row svg { width: 18px; height: 18px; color: var(--accent); flex: 0 0 18px; }

/* ---------- профиль ---------- */
.profile { text-align: center; padding: 6px 0 14px; }
.profile .avatar { margin: 0 auto 10px; }
.profile h2 { margin: 0; font-size: 22px; }
.profile .sub { color: var(--hint); font-size: 15px; margin-top: 4px; display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; }
.user-mode-banner { display: flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-text);
  margin: 0 -16px; padding: 8px 16px; font-size: 14px; font-weight: 600; }
.user-mode-banner span { flex: 1; }
.user-mode-banner button { background: rgba(255,255,255,.22); color: inherit; border: 0; border-radius: 14px; height: 28px; padding: 0 12px; font: inherit; font-size: 13px; cursor: pointer; }

/* ---------- напоминание о карте, приглашения ---------- */
.remind-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -2px 4px 12px; font-size: 14px; color: var(--hint); }
.switch.sm { width: 42px; height: 26px; flex-basis: 42px; }
.switch.sm i::after { width: 22px; height: 22px; }
.switch.sm input:checked + i::after { transform: translateX(16px); }
.invite-card .copy-row { margin-top: 10px; }
.invite-card .btn { margin-top: 6px; }
.link-box { background: var(--bg); border-radius: 12px; padding: 12px; font-size: 14px; word-break: break-all; margin: 10px 0; }
