:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #000000);
  --hint: var(--tg-theme-hint-color, #8e8e93);
  --link: var(--tg-theme-link-color, #2481cc);
  --button: var(--tg-theme-button-color, #2481cc);
  --button-text: var(--tg-theme-button-text-color, #ffffff);
  --secondary-bg: var(--tg-theme-secondary-bg-color, #f1f2f6);
  --section-bg: var(--tg-theme-section-bg-color, #ffffff);
  --sep: var(--tg-theme-section-separator-color, #e3e4e8);
  --destructive: var(--tg-theme-destructive-text-color, #e53935);
  --header-bg: var(--tg-theme-header-bg-color, var(--bg));
  --chat-bg: #dfe7d4;
  --bubble-in: #ffffff;
  --bubble-out: #e1fec6;
  --bubble-out-meta: #4fae4e;
}

html.dark {
  --chat-bg: #0e1621;
  --bubble-in: #182533;
  --bubble-out: #2b5278;
  --bubble-out-meta: #7da8d3;
  --bg: var(--tg-theme-bg-color, #17212b);
  --text: var(--tg-theme-text-color, #f5f5f5);
  --hint: var(--tg-theme-hint-color, #708499);
  --secondary-bg: var(--tg-theme-secondary-bg-color, #0e1621);
  --section-bg: var(--tg-theme-section-bg-color, #17212b);
  --sep: var(--tg-theme-section-separator-color, #101921);
}
html.dark .badge.ok { background: rgba(76, 175, 80, 0.2); color: #81c784; }
html.dark .badge.off, html.dark .counter.del { background: rgba(229, 57, 53, 0.2); color: #ef7a77; }
html.dark .badge.warn { background: rgba(255, 193, 7, 0.2); color: #ffd54f; }
html.dark .counter.edit, html.dark .version.current { background: rgba(36, 129, 204, 0.2); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { overflow-x: clip; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--secondary-bg);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 12px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--sep);
}
.header-back { border: none; background: none; color: var(--link); font-size: 30px; line-height: 1; padding: 0 6px 4px 0; cursor: pointer; }
.header-text { flex: 1; min-width: 0; }
.header-title { font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-sub { font-size: 13px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-action { border: none; background: none; font-size: 20px; padding: 4px 6px; cursor: pointer; }

.content {
  padding: 12px 12px calc(84px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body.no-nav .content { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
body.no-nav .bottom-nav { display: none; }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  background: var(--section-bg);
  border-top: 1px solid var(--sep);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav-item { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: none; color: var(--hint); font-size: 11px; padding: 4px 0; cursor: pointer; }
.nav-icon { font-size: 22px; line-height: 1; filter: grayscale(1); opacity: 0.65; }
.nav-item.active { color: var(--button); font-weight: 600; }
.nav-item.active .nav-icon { filter: none; opacity: 1; }

.card { background: var(--section-bg); border-radius: 14px; padding: 14px; }
.card-title { font-weight: 600; font-size: 16px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--hint); margin: 6px 4px -4px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--hint); font-size: 14px; }
.small { font-size: 12px; }
.center { text-align: center; padding: 24px 8px; }
.error { color: var(--destructive); font-weight: 600; }
.title { font-weight: 600; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { font-size: 13px; color: var(--hint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--section-bg); border-radius: 14px; padding: 12px 14px; }
.stat-num { font-size: 24px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--hint); margin-top: 2px; }
.sub-card.active { background: linear-gradient(135deg, #2aabee 0%, #229ed9 100%); color: #fff; }
.sub-card.active .badge { background: rgba(255, 255, 255, 0.25); color: #fff; }
.sub-date { margin-top: 6px; font-size: 15px; }
.revenue { font-size: 20px; font-weight: 700; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: var(--secondary-bg); color: var(--text); white-space: nowrap; }
.badge.ok { background: #d8f5dd; color: #1b7f35; }
.badge.off { background: #fde2e1; color: var(--destructive); }
.badge.warn { background: #fff2cc; color: #8a6d00; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.avatar { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 19px; }
.avatar.big { width: 64px; height: 64px; font-size: 26px; }
.app-header .avatar { width: 38px; height: 38px; font-size: 16px; }

.search { width: 100%; padding: 10px 14px; border-radius: 12px; border: none; background: var(--section-bg); color: var(--text); font-size: 15px; outline: none; }
.chat-search { position: sticky; top: 54px; z-index: 20; }
input[type="number"] { padding: 10px; border-radius: 10px; border: 1px solid var(--sep); background: var(--bg); color: var(--text); font-size: 15px; }

.chat-list { background: var(--section-bg); border-radius: 14px; overflow: hidden; }
.chat-item { display: flex; gap: 12px; align-items: center; padding: 9px 12px; cursor: pointer; }
.chat-item + .chat-item .chat-main { border-top: 1px solid var(--sep); }
.chat-item:active { background: var(--secondary-bg); }
.chat-main { flex: 1; min-width: 0; padding: 4px 0; }
.chat-item + .chat-item .chat-main { padding-top: 9px; margin-top: -5px; }
.chat-top { display: flex; justify-content: space-between; gap: 8px; }
.chat-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-time { font-size: 12px; color: var(--hint); flex: 0 0 auto; }
.chat-username { font-size: 12px; color: var(--link); }
.chat-bottom { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 2px; }
.chat-last { font-size: 14px; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-last.deleted { color: var(--destructive); }
.counters { display: flex; gap: 4px; flex: 0 0 auto; }
.counter { font-size: 11px; padding: 1px 6px; border-radius: 9px; }
.counter.del { background: #fde2e1; color: var(--destructive); }
.counter.edit { background: #e3effc; color: var(--link); }

body.in-chat { background: var(--chat-bg); }
.history-top { text-align: center; font-size: 12px; color: var(--hint); padding: 4px 0; }
.messages { display: flex; flex-direction: column; gap: 3px; }
.day { text-align: center; margin: 10px 0 6px; }
.day span { background: rgba(0, 0, 0, 0.25); color: #fff; font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: 12px; }

.row-msg { display: flex; }
.row-msg.out { justify-content: flex-end; }
.bubble {
  position: relative;
  max-width: 82%;
  min-width: 70px;
  background: var(--bubble-in);
  color: var(--text);
  border-radius: 16px 16px 16px 6px;
  padding: 6px 10px 5px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
  word-break: break-word;
}
.bubble.out { background: var(--bubble-out); border-radius: 16px 16px 6px 16px; }
.bubble.has-media { padding: 4px; }
.bubble.has-media .text, .bubble.has-media .reply { margin: 4px 6px 0; }
.bubble.has-media .meta, .bubble.has-media .deleted-label { padding: 0 6px 2px; }
.bubble.bare { background: transparent; box-shadow: none; padding: 0; }
.bubble.bare .meta { display: inline-block; background: rgba(0, 0, 0, 0.35); color: #fff; padding: 1px 6px; border-radius: 8px; margin-top: 2px; }
.bubble.deleted { box-shadow: 0 0 0 1.5px var(--destructive); }
.bubble.bare.deleted { box-shadow: none; }
.text { white-space: pre-wrap; line-height: 1.35; font-size: 15px; }
.meta { display: flex; justify-content: flex-end; gap: 6px; font-size: 11px; color: var(--hint); margin-top: 2px; }
.bubble.out .meta { color: var(--bubble-out-meta); }
.edited-link { text-decoration: underline; cursor: pointer; }
.deleted-label { color: var(--destructive); font-size: 12px; font-weight: 600; margin-top: 3px; }

.reply { border-left: 3px solid var(--link); background: rgba(36, 129, 204, 0.08); border-radius: 4px; padding: 3px 8px; margin-bottom: 4px; font-size: 13px; }
.bubble.out .reply { border-left-color: var(--bubble-out-meta); background: rgba(79, 174, 78, 0.12); }
.reply-author { color: var(--link); font-weight: 600; }
.bubble.out .reply-author { color: var(--bubble-out-meta); }
.reply-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.media { position: relative; border-radius: 12px; overflow: hidden; max-width: 320px; }
.media img, .media video { display: block; width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.media-photo, .media-video, .media-animation { min-width: 200px; background: rgba(0, 0, 0, 0.06); }
.media-sticker { width: 180px; background: none; }
.media-sticker img { object-fit: contain; }
.media-voice, .media-audio { overflow: visible; }
.media audio { width: 250px; max-width: 100%; display: block; }
.media-loading { display: flex; align-items: center; justify-content: center; min-height: 120px; color: var(--hint); font-size: 14px; }
.media-voice .media-loading, .media-audio .media-loading, .media-document .media-loading { min-height: 44px; }
.media-stub { padding: 12px; background: rgba(0, 0, 0, 0.05); border-radius: 10px; text-align: center; font-size: 14px; min-width: 160px; }
.video-wrap { position: relative; width: 100%; height: 100%; }
.play-btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 48px; height: 48px; border-radius: 50%; background: rgba(0, 0, 0, 0.5); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; pointer-events: none; }
.media-duration { position: absolute; left: 6px; top: 6px; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 12px; padding: 1px 6px; border-radius: 8px; }
.media-video_note { border-radius: 50%; width: 220px; height: 220px; max-width: 70vw; max-height: 70vw; }
.media-video_note .media-loading { min-height: 100%; height: 100%; background: rgba(0, 0, 0, 0.08); border-radius: 50%; }
.round { position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: #000; cursor: pointer; }
.doc { display: flex; gap: 10px; align-items: center; padding: 6px; color: inherit; text-decoration: none; }
.doc-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--button); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 auto; }
.doc-info { min-width: 0; }
.doc-name { font-weight: 600; word-break: break-all; }

.viewer { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.94); display: flex; align-items: center; justify-content: center; }
.viewer img, .viewer video { max-width: 100%; max-height: 100%; }
.viewer-close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 40px; height: 40px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 18px; cursor: pointer; }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: none; background: var(--section-bg); color: var(--text); border-radius: 16px; padding: 7px 13px; font-size: 14px; cursor: pointer; }
.card .chip { background: var(--secondary-bg); }
.chip.active { background: var(--button); color: var(--button-text); }

.list { padding: 0 14px; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--sep); cursor: pointer; }
.list-item:last-child { border-bottom: none; }
.list-item.static { cursor: default; }
.chevron { color: var(--hint); font-size: 22px; }

.profile { display: flex; gap: 14px; align-items: center; }
.profile .title { font-size: 18px; }
.profile .badges { justify-content: flex-start; margin-top: 4px; }
.info-rows { margin-top: 12px; border-top: 1px solid var(--sep); }
.info-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--sep); }
.info-row:last-child { border-bottom: none; }
.info-value { text-align: right; font-weight: 500; }

.actions { display: flex; flex-direction: column; gap: 10px; }
.form-row { display: flex; gap: 8px; align-items: center; }
.days-input { width: 90px; flex: 0 0 auto; }
.form-row .btn { flex: 1; }

.btn { border: none; border-radius: 12px; padding: 11px 14px; font-size: 15px; font-weight: 600; background: var(--button); color: var(--button-text); cursor: pointer; }
.btn.full { width: 100%; }
.btn.secondary { background: var(--section-bg); color: var(--link); }
.card .btn.secondary, .sheet .btn.secondary { background: var(--secondary-bg); }
.btn.danger { background: var(--destructive); color: #fff; }
.btn.danger-outline { background: transparent; color: var(--destructive); box-shadow: inset 0 0 0 1.5px var(--destructive); }
.btn:active { opacity: 0.8; }

.sheet-overlay { position: fixed; inset: 0; z-index: 150; background: rgba(0, 0, 0, 0.45); display: flex; align-items: flex-end; }
.sheet { width: 100%; max-height: 85vh; overflow-y: auto; background: var(--bg); border-radius: 18px 18px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; animation: sheet-up 0.2s ease; }
.sheet h3 { margin: 0; }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--sep); align-self: center; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.versions { display: flex; flex-direction: column; gap: 8px; }
.version { background: var(--secondary-bg); border-radius: 12px; padding: 10px 12px; }
.version.current { background: #e3effc; }
.version-head { font-size: 12px; font-weight: 600; color: var(--hint); margin-bottom: 3px; }
.version-text { white-space: pre-wrap; word-break: break-word; }

.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: rgba(0, 0, 0, 0.85); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; transition: all 0.25s ease; z-index: 300; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error-toast { background: var(--destructive); }

.user-head { display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.user-strip { display: flex; flex-wrap: wrap; gap: 6px; }

.search-results { display: flex; flex-direction: column; gap: 8px; }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; border-radius: 12px; overflow: hidden; }
.gallery-cell { position: relative; aspect-ratio: 1 / 1; background: rgba(0, 0, 0, 0.06); overflow: hidden; }
.gallery-cell .media { width: 100%; height: 100%; max-width: none; min-width: 0; border-radius: 0; aspect-ratio: auto !important; }
.gallery-cell .media-video_note { width: 100%; height: 100%; max-width: none; max-height: none; }
.gallery-cell .media-loading { min-height: 100%; height: 100%; font-size: 12px; }
.gallery-cell .media-duration { display: none; }
.gallery-cell .play-btn { width: 32px; height: 32px; font-size: 14px; }
.gallery-cell.deleted { box-shadow: inset 0 0 0 2px var(--destructive); }
.gallery-del { position: absolute; right: 4px; bottom: 4px; background: var(--destructive); color: #fff; font-size: 11px; border-radius: 8px; padding: 1px 5px; }
.file-list { display: flex; flex-direction: column; gap: 10px; }
.file-row { display: flex; flex-direction: column; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--sep); }
.file-row:last-child { border-bottom: none; padding-bottom: 0; }

.media-btns { display: flex; gap: 6px; margin-top: 6px; }
.media-btn { flex: 1 1 0; border: none; border-radius: 10px; padding: 7px 10px; font-size: 13px; font-weight: 600; background: rgba(36, 129, 204, 0.12); color: var(--link); cursor: pointer; white-space: nowrap; }
.bubble.out .media-btn { background: rgba(79, 174, 78, 0.16); color: var(--bubble-out-meta); }
.media-btn:disabled { opacity: 0.6; }
.media-voice, .media-audio { display: flex; flex-direction: column; }
.doc { cursor: pointer; }
.round-more { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); width: 36px; height: 24px; border: none; border-radius: 12px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; z-index: 2; }
.viewer-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, 0.6)); }
.viewer-bar .media-btns { margin: 0; }
.viewer-bar .media-btn { background: rgba(255, 255, 255, 0.18); color: #fff; padding: 11px; font-size: 15px; }
.gallery-cell .round-more { bottom: 4px; width: 28px; height: 20px; font-size: 13px; }
.counter.muted-icon { background: var(--secondary-bg); }
.btn.left { text-align: left; }
.reply.clickable { cursor: pointer; }
.reply.clickable:active { opacity: 0.7; }
.row-msg.flash .bubble { animation: flash-msg 1.6s ease; }
@keyframes flash-msg { 0%, 40% { box-shadow: 0 0 0 3px var(--button); } 100% { box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12); } }

.admin-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 4px; border: none; border-radius: 14px; background: var(--section-bg); color: var(--text); padding: 12px 4px; font-size: 13px; cursor: pointer; }
.tool span:first-child { font-size: 22px; }
.chart { display: flex; flex-direction: column; gap: 4px; }
.chart-total { font-size: 26px; font-weight: 700; }
.chart-svg { width: 100%; height: auto; margin-top: 8px; overflow: visible; }
.chart-bar { fill: var(--button); opacity: 0.85; }
.chart-bar.active { opacity: 1; }
.chart-base { stroke: var(--sep); stroke-width: 1; }
.chart-hit { cursor: pointer; }
.chart-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--hint); }
.chart-tip { font-size: 13px; color: var(--text); min-height: 18px; }
.chart-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.chart-table th, .chart-table td { text-align: left; padding: 4px 0; border-bottom: 1px solid var(--sep); }
.chart-table td:last-child, .chart-table th:last-child { text-align: right; }
.link-btn { border: none; background: none; color: var(--link); font-size: 13px; cursor: pointer; padding: 0; }
.broadcast-text { width: 100%; border-radius: 12px; border: 1px solid var(--sep); background: var(--bg); color: var(--text); padding: 10px 12px; font: inherit; resize: vertical; }
.payments { display: flex; flex-direction: column; }
.payments .info-row { align-items: center; }
.small-btn { padding: 6px 10px; font-size: 13px; }
.storage { display: flex; flex-direction: column; gap: 8px; }
.storage-bar { height: 8px; border-radius: 4px; background: var(--secondary-bg); overflow: hidden; }
.storage-fill { height: 100%; background: var(--button); border-radius: 4px; }
.storage-fill.warn { background: var(--destructive); }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 80px; color: var(--hint); font-size: 14px; background: var(--secondary-bg); border-radius: 10px; margin-top: 8px; }
.blocked-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 18px; }
.blocked-icon { font-size: 44px; }
.blocked-title { font-size: 22px; font-weight: 700; color: var(--destructive); }

.section { display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; align-items: center; gap: 10px; }
.section-num { width: 24px; height: 24px; border-radius: 50%; background: var(--button); color: var(--button-text); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.status-line { font-weight: 600; }
.status-line.ok { color: #1b7f35; }
.status-line.off { color: var(--destructive); }
html.dark .status-line.ok { color: #81c784; }
.step { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.step-num { width: 20px; height: 20px; border-radius: 50%; background: var(--secondary-bg); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.perks { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.btn.pay { background: linear-gradient(135deg, #f7b500 0%, #f59b00 100%); color: #fff; }
.small-links { justify-content: flex-start; gap: 12px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; font-size: 15px; cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 14px; background: var(--sep); position: relative; cursor: pointer; transition: background 0.2s; flex: 0 0 auto; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.switch:checked { background: #34c759; }
.switch:checked::after { transform: translateX(18px); }
.hint.warn { background: #fff2cc; color: #8a6d00; border-radius: 10px; padding: 8px 10px; font-size: 13px; }
html.dark .hint.warn { background: rgba(255, 193, 7, 0.15); color: #ffd54f; }
.help-item { border-top: 1px solid var(--sep); padding: 8px 0; }
.help-item summary { cursor: pointer; font-weight: 500; }
.help-body { margin-top: 6px; font-size: 14px; color: var(--hint); line-height: 1.4; }
.terms-text { white-space: pre-wrap; font-size: 14px; line-height: 1.45; }
.search.bordered { border: 1px solid var(--sep); }
.profile-card .badges { margin-top: 6px; }
.link-btn { white-space: nowrap; flex: 0 0 auto; }
.video-wrap img { display: block; width: 100%; height: 100%; object-fit: cover; }
.round video { object-fit: cover; }
.doc-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.plan { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px 10px; border-radius: 12px; border: 2px solid var(--sep); background: var(--bg); color: var(--text); cursor: pointer; }
.plan.active { border-color: #f59b00; background: rgba(247, 181, 0, 0.08); }
.plan-days { font-size: 13px; color: var(--hint); }
.plan-price { font-size: 18px; font-weight: 700; }
.plan-month { font-size: 11px; color: var(--hint); }
.plan-badge { position: absolute; top: -9px; right: 6px; background: #e53935; color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
.meta .star { font-size: 11px; }
.counter.star { background: rgba(247, 181, 0, 0.15); color: #a86f00; }
.important-entry { display: flex; justify-content: space-between; align-items: center; width: 100%; border: none; border-radius: 14px; background: var(--section-bg); color: var(--text); padding: 12px 14px; font-size: 15px; font-weight: 500; cursor: pointer; }
.important-hint { padding: 0 4px; }
.menu-preview { white-space: pre-wrap; word-break: break-word; background: var(--secondary-bg); border-radius: 12px; padding: 10px 12px; font-size: 14px; max-height: 160px; overflow: hidden; }
.bubble { cursor: pointer; }

.nav-item { position: relative; }
.nav-badge { position: absolute; top: 0; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--destructive); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.counter.unread { background: var(--button); color: var(--button-text); font-weight: 700; min-width: 20px; text-align: center; }
.chat-last.bold { color: var(--text); font-weight: 600; }
.msg-tag { font-size: 11px; color: var(--hint); margin-bottom: 3px; }
body.with-composer .content { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
.composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); background: var(--section-bg); border-top: 1px solid var(--sep); }
.composer-input { flex: 1; resize: none; border: 1px solid var(--sep); border-radius: 18px; padding: 9px 14px; font: inherit; font-size: 15px; background: var(--bg); color: var(--text); max-height: 140px; outline: none; }
.composer-send { flex: 0 0 auto; width: 40px; height: 40px; border: none; border-radius: 50%; background: var(--button); color: var(--button-text); font-size: 18px; cursor: pointer; }
.composer-send:disabled { opacity: 0.5; }
.ref-link { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--secondary-bg); border-radius: 10px; padding: 10px 12px; word-break: break-all; user-select: all; }
.ref-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ref-stats .stat { padding: 10px; }
.ref-stats .stat-num { font-size: 20px; }
.card .stat { background: var(--secondary-bg); }
