/* ===== BuxPro — дизайн-система ===== */
:root {
  --bg: #0a0b14;
  --bg-2: #11131f;
  --card: rgba(255,255,255,.045);
  --card-solid: #151827;
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.14);
  --text: #eef0ff;
  --muted: #8b90ad;
  --primary: #7c5cff;
  --primary-2: #00d4ff;
  --grad: linear-gradient(135deg, #7c5cff 0%, #b14dff 45%, #00d4ff 100%);
  --ok: #22d38a;
  --warn: #ffb547;
  --bad: #ff5c7a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px -20px rgba(0,0,0,.6);
  --tabbar-h: 68px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.02em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
small { font-size: .82em; }
.muted { color: var(--muted); }
.small { font-size: .88em; }
.pre { white-space: pre-line; }
.mt { margin-top: 20px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ico { width: 20px; height: 20px; flex: none; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.link { color: var(--primary-2); }
.break { word-break: break-all; display: block; font-size: .85em; }

.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(600px 400px at 10% -10%, rgba(124,92,255,.25), transparent 60%),
    radial-gradient(500px 400px at 100% 0%, rgba(0,212,255,.14), transparent 60%),
    radial-gradient(700px 500px at 50% 120%, rgba(177,77,255,.12), transparent 60%);
}

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 40px; min-height: calc(100vh - 140px); }
.narrow { max-width: 560px; }

/* ===== Шапка ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,11,20,.72);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 8px 24px -6px rgba(124,92,255,.7); }
.logo-mark .ico { width: 18px; height: 18px; color: #fff; }
.topnav { display: flex; gap: 4px; margin-left: 12px; }
.topnav a { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .92rem; transition: .2s; }
.topnav a .ico { width: 17px; height: 17px; }
.topnav a:hover { color: var(--text); background: var(--card); }
.topnav a.active { color: var(--text); background: rgba(124,92,255,.16); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: .88rem; white-space: nowrap; }
.big-chip { font-size: 1rem; padding: 10px 16px; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; }
.chip-dot.ok { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.chip-dot.ad { background: var(--primary-2); box-shadow: 0 0 10px var(--primary-2); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--text); cursor: pointer; font-size: 1rem; }
.icon-btn:hover { border-color: var(--line-2); }
.inline { display: inline; margin: 0; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: .93rem; cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s; white-space: nowrap; color: var(--text);
}
.btn:active { transform: scale(.97); }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -10px rgba(124,92,255,.8); }
.btn-primary:hover { box-shadow: 0 14px 36px -10px rgba(124,92,255,1); }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { background: var(--card); }
.btn-glass { background: rgba(255,255,255,.08); border-color: var(--line); }
.btn-glass:hover { background: rgba(255,255,255,.12); }
.btn-light { background: #fff; color: #10121f; }
.btn-danger { background: rgba(255,92,122,.14); color: var(--bad); border-color: rgba(255,92,122,.3); }
.btn-lg { padding: 15px 26px; font-size: 1rem; border-radius: 14px; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn-xs { padding: 6px 11px; font-size: .8rem; border-radius: 9px; }
.btn-block { width: 100%; }
.count { background: rgba(255,255,255,.22); padding: 1px 8px; border-radius: 999px; font-size: .8rem; }

/* ===== Карточки и сетки ===== */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.card.soft { background: rgba(255,255,255,.03); margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-head h3 { margin: 0; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.align-start { align-items: start; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; }
.h2 { font-size: clamp(1.3rem, 2.6vw, 1.75rem); font-weight: 800; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(124,92,255,.14); border: 1px solid rgba(124,92,255,.3); font-size: .82rem; font-weight: 700; color: #c9bcff; }
.pill .ico { width: 15px; height: 15px; }

.balance-card { position: relative; overflow: hidden; padding: 24px; }
.balance-card::after { content: ''; position: absolute; width: 220px; height: 220px; right: -60px; top: -80px; border-radius: 50%; filter: blur(10px); opacity: .5; }
.main-bal { background: linear-gradient(135deg, rgba(124,92,255,.35), rgba(177,77,255,.15)); border-color: rgba(124,92,255,.35); }
.main-bal::after { background: radial-gradient(circle, #b14dff, transparent 70%); }
.ad-bal { background: linear-gradient(135deg, rgba(0,212,255,.22), rgba(0,120,255,.1)); border-color: rgba(0,212,255,.3); }
.ad-bal::after { background: radial-gradient(circle, #00d4ff, transparent 70%); }
.balance-card small { color: rgba(255,255,255,.75); position: relative; z-index: 1; }
.balance-card .big { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; letter-spacing: -.03em; margin: 4px 0 14px; position: relative; z-index: 1; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.row-actions form { margin: 0; }

.mini { display: flex; flex-direction: column; gap: 2px; padding: 16px; transition: border-color .2s; }
a.mini:hover { border-color: var(--line-2); }
.mini b { font-size: 1.3rem; font-weight: 800; }
.mini small { color: var(--muted); }
.m-ico { width: 36px; height: 36px; border-radius: 10px; background: rgba(124,92,255,.15); color: #b9a8ff; display: grid; place-items: center; margin-bottom: 8px; }

/* ===== Операции ===== */
.tx-list { list-style: none; margin: 0; padding: 0; }
.tx-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tx-list li:last-child { border-bottom: 0; }
.tx-list li > div { display: flex; flex-direction: column; min-width: 0; }
.tx-list small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.plus { color: var(--ok); font-weight: 800; white-space: nowrap; }
.minus { color: var(--bad); font-weight: 800; white-space: nowrap; }
.empty { color: var(--muted); padding: 10px 0; margin: 0; }
.empty a { color: var(--primary-2); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.badge-ok { background: rgba(34,211,138,.14); color: var(--ok); }
.badge-warn { background: rgba(255,181,71,.14); color: var(--warn); }
.badge-bad { background: rgba(255,92,122,.14); color: var(--bad); }
.badge-muted { background: rgba(255,255,255,.08); color: var(--muted); }

/* ===== Формы ===== */
.form { display: flex; flex-direction: column; gap: 14px; }
.form h3 { margin-bottom: 0; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(0,0,0,.25); border: 1px solid var(--line-2); color: var(--text);
  font: inherit; font-size: 16px; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(124,92,255,.18); }
select option { background: var(--card-solid); }
.form label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }

.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.seg-item { cursor: pointer; position: relative; }
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item span { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.2); color: var(--text); font-weight: 700; transition: .2s; }
.seg-item span small { color: var(--muted); font-weight: 600; }
.seg-item input:checked + span { border-color: var(--primary); background: rgba(124,92,255,.18); box-shadow: 0 0 0 3px rgba(124,92,255,.15); }
.calc-total { padding: 14px; border-radius: 12px; background: rgba(0,212,255,.08); border: 1px dashed rgba(0,212,255,.35); text-align: center; }
.calc-total b { font-size: 1.2rem; }

.alert { padding: 13px 16px; border-radius: 12px; margin-bottom: 14px; font-weight: 600; border: 1px solid; }
.alert-success { background: rgba(34,211,138,.1); border-color: rgba(34,211,138,.3); color: #7af0bf; }
.alert-error { background: rgba(255,92,122,.1); border-color: rgba(255,92,122,.3); color: #ff9db0; }

.bullets { margin: 0; padding-left: 18px; color: var(--muted); }
.bullets li { margin-bottom: 8px; }
.checklist { list-style: none; padding: 0; margin: 0 0 8px; }
.checklist li { padding: 4px 0; font-weight: 600; }
.checklist .ok { color: var(--ok); }
.checklist .bad { color: var(--bad); }

/* ===== Авторизация ===== */
.auth-wrap { display: grid; place-items: center; min-height: 60vh; }
.auth-card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 32px 26px; box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.auth-card .h1 { margin-bottom: 4px; }
.auth-card .form { margin-top: 20px; }
.auth-alt { text-align: center; margin: 18px 0 0; color: var(--muted); }
.auth-alt a { color: var(--primary-2); font-weight: 700; }

/* ===== Лендинг ===== */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 40px 0 30px; }
.display { font-size: clamp(2rem, 5.4vw, 3.6rem); font-weight: 800; letter-spacing: -.035em; margin: 16px 0; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 560px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-visual { position: relative; height: 380px; }
.orb { position: absolute; inset: 30px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #b14dff, #7c5cff 40%, #00d4ff 75%, transparent 76%); filter: blur(2px); opacity: .55; animation: spin 18s linear infinite; }
.float-card { position: absolute; display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 16px; background: rgba(21,24,39,.8); border: 1px solid var(--line-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow); animation: float 6s ease-in-out infinite; }
.float-card div { display: flex; flex-direction: column; }
.float-card small { color: var(--muted); }
.float-card .ico { color: var(--primary-2); width: 26px; height: 26px; }
.fc1 { top: 20px; left: 0; }
.fc2 { top: 150px; right: 0; animation-delay: -2s; }
.fc3 { bottom: 20px; left: 30px; animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-14px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0 40px; }
.stat { text-align: center; padding: 20px 10px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.stat b { display: block; font-size: 1.5rem; font-weight: 800; }
.stat span { color: var(--muted); font-size: .88rem; }
.section { margin-bottom: 40px; }
.feature p { color: var(--muted); margin: 0; }
.f-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--grad); display: grid; place-items: center; margin-bottom: 14px; }
.f-ico .ico { color: #fff; }
.promo { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; padding: 30px; background: linear-gradient(135deg, rgba(124,92,255,.18), rgba(0,212,255,.08)); }
.price-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.price-list li { display: flex; justify-content: space-between; padding: 12px 16px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid var(--line); }

/* ===== Серфинг ===== */
.task-list { display: grid; gap: 10px; }
.task { display: flex; align-items: center; gap: 14px; padding: 14px 16px; transition: border-color .2s, transform .15s; }
.task:hover { border-color: rgba(124,92,255,.5); transform: translateY(-1px); }
.task-ico { width: 46px; height: 46px; flex: none; border-radius: 12px; background: rgba(255,255,255,.07); display: grid; place-items: center; }
.task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.task-body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-body small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.task-meta .ico { width: 14px; height: 14px; }
.task-reward { font-weight: 800; color: var(--ok); white-space: nowrap; padding: 6px 12px; border-radius: 10px; background: rgba(34,211,138,.1); }
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state .f-ico { margin: 0 auto 14px; }

.progress { height: 7px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width .3s linear; }

/* ===== Просмотр ===== */
body.viewer { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.viewer-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bg-2); border-bottom: 1px solid var(--line); flex: none; }
.viewer-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.viewer-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
.viewer-info small { color: var(--muted); }
.viewer-reward { font-weight: 800; color: var(--ok); white-space: nowrap; }
.viewer-check, .viewer-done { padding: 12px 14px; background: linear-gradient(135deg, rgba(124,92,255,.25), rgba(0,212,255,.15)); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; flex: none; font-weight: 700; }
.viewer-check[hidden], .viewer-done[hidden] { display: none; }
.viewer-check b { font-size: 1.2rem; }
.check-btns { display: flex; gap: 8px; }
.check-btns .btn { min-width: 56px; font-size: 1.05rem; }
.viewer-done.ok { background: rgba(34,211,138,.15); color: #7af0bf; }
.viewer-done.bad { background: rgba(255,92,122,.15); color: #ff9db0; }
.viewer-frame { flex: 1; width: 100%; border: 0; background: #fff; }
.viewer-open { flex: none; text-align: center; padding: 8px; font-size: .82rem; color: var(--muted); background: var(--bg-2); }

/* ===== Рекламный кабинет ===== */
.camp-list { display: grid; gap: 12px; }
.camp { padding: 14px; border-radius: 14px; background: rgba(0,0,0,.2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.camp-top, .camp-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.camp-top > div { display: flex; flex-direction: column; min-width: 0; }
.camp small { color: var(--muted); }

/* ===== Рефералы ===== */
.copy-box { display: flex; gap: 8px; }
.copy-box input { flex: 1; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 600; }

.profile-row { display: flex; align-items: center; gap: 16px; }
.profile-row > div:last-child { display: flex; flex-direction: column; }
.avatar { width: 60px; height: 60px; border-radius: 18px; background: var(--grad); display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; color: #fff; }

/* ===== Админка ===== */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 9px 15px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: .88rem; white-space: nowrap; color: var(--muted); }
.tabs a.active { background: rgba(124,92,255,.2); border-color: rgba(124,92,255,.45); color: var(--text); }
.tabs.sub a { padding: 6px 12px; font-size: .82rem; }
.search { display: flex; gap: 8px; margin-bottom: 16px; }
.admin-list { display: grid; gap: 10px; }
.admin-item { padding: 16px; }
.admin-item-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.admin-item-head > div:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.admin-item small { color: var(--muted); }
.admin-bal { display: flex; flex-direction: column; gap: 2px; font-size: .88rem; text-align: right; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.admin-actions form { margin: 0; }
.inline-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.admin-actions .inline-form { margin-top: 0; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 140px; padding: 8px 10px; font-size: 14px; }
.inline-form .w-sm { flex: 0 1 100px; }
.req { display: inline-block; margin-top: 4px; padding: 6px 10px; border-radius: 8px; background: rgba(0,0,0,.35); font-size: .85rem; word-break: break-all; }

/* ===== Подвал и мобильная навигация ===== */
.footer { border-top: 1px solid var(--line); padding: 20px 0; font-size: .85rem; }
.footer-in { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tabbar { display: none; }
.drawer { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.drawer[hidden] { display: none; }
.drawer-panel { position: absolute; bottom: 0; left: 0; right: 0; background: var(--card-solid); border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); animation: up .25s ease; max-height: 85vh; overflow-y: auto; }
@keyframes up { from { transform: translateY(100%); } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.drawer-bal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.drawer-bal div { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.05); display: flex; flex-direction: column; }
.drawer-bal small { color: var(--muted); }
.drawer-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 12px; border-radius: 12px; font: inherit; font-weight: 600; color: var(--text); background: none; border: 0; cursor: pointer; text-align: left; }
.drawer-link:hover { background: rgba(255,255,255,.05); }
.drawer-link.danger { color: var(--bad); }
.drawer form { margin: 0; }

/* ===== Адаптив ===== */
@media (max-width: 1024px) {
  .topnav a span { display: none; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 20px; }
  .hero-visual { height: 260px; }
  .promo { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  body.has-user { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .topnav, .hide-sm { display: none !important; }
  .topbar-in { height: 58px; }
  .grid-2 { grid-template-columns: 1fr; }
  .main { padding-top: 18px; }
  .card { padding: 16px; }
  .seg { grid-template-columns: repeat(2, 1fr); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(17,19,31,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font: inherit; font-size: .7rem; font-weight: 600; color: var(--muted); background: none; border: 0; cursor: pointer; }
  .tabbar a.active { color: var(--text); }
  .tabbar .ico { width: 22px; height: 22px; }
  .admin-bal { text-align: left; }
  .copy-box { flex-direction: column; }
  .footer { padding-bottom: 10px; }
  .btn-lg { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===== v1.1: крипто, модули, задания ===== */
.center { text-align: center; }
.coin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.coin-item { cursor: pointer; position: relative; }
.coin-item input { position: absolute; opacity: 0; pointer-events: none; }
.coin-item span { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.2); transition: .2s; }
.coin-item span small { color: var(--muted); font-size: .72rem; }
.coin-item input:checked + span { border-color: var(--primary-2); background: rgba(0,212,255,.12); box-shadow: 0 0 0 3px rgba(0,212,255,.12); }
.invoice { display: flex; flex-direction: column; gap: 16px; }
.inv-row { display: flex; flex-direction: column; gap: 6px; }
.inv-row > small { color: var(--muted); }
.inv-amount { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.copy-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy-line .req { margin-top: 0; flex: 1 1 200px; }
.warn-text { color: var(--warn); }
.qr { align-self: center; border-radius: 14px; background: #fff; padding: 6px; }
.inv-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: .88rem; }
.code { white-space: pre-wrap; background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: .8rem; overflow-x: auto; color: #c9d1ff; }
.instructions, .report-text { background: rgba(0,0,0,.22); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 8px; font-size: .93rem; word-break: break-word; }
.task-reward.big { font-size: 1.3rem; padding: 10px 16px; }
.task-ico .ico { color: var(--primary-2); }
.tx-list li > a { display: flex; flex-direction: column; min-width: 0; }
.form.narrow { max-width: 520px; }

/* ===== v1.1.1: мобильная оптимизация ===== */
html, body { overflow-x: hidden; }
.form > *, .card { min-width: 0; }
img, iframe, video { max-width: 100%; }
pre, code, .req { overflow-wrap: anywhere; }

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .container { padding: 0 12px; }
  .main { padding-top: 14px; padding-bottom: 24px; }
  .h1 { font-size: 1.45rem; }
  .h2 { font-size: 1.25rem; }
  h3 { font-size: 1rem; }
  .card { padding: 14px; border-radius: 16px; }
  .grid-2, .grid-3, .grid-4 { gap: 10px; }
  .mt { margin-top: 12px; }

  /* Шапка */
  .topbar-in { gap: 8px; }
  .logo { font-size: 1rem; gap: 8px; min-width: 0; }
  .logo span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42vw; }
  .logo-mark { width: 30px; height: 30px; flex: none; }
  .top-right { gap: 6px; }
  .top-right .btn { padding: 8px 12px; font-size: .82rem; }
  .chip { padding: 6px 10px; font-size: .8rem; }

  /* Заголовки страниц */
  .page-head { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 14px; }
  .page-head > .btn, .page-head > form, .page-head > form .btn, .page-head > .chip { width: 100%; justify-content: center; }
  .page-head > .pill { align-self: flex-start; white-space: normal; }

  /* Кнопки: перенос текста, удобные касания */
  .btn { white-space: normal; text-align: center; line-height: 1.25; min-height: 42px; }
  .btn-xs { min-height: 36px; padding: 7px 12px; }
  .btn-sm { min-height: 38px; }
  .row-actions { width: 100%; }
  .row-actions > .btn, .row-actions > form { flex: 1 1 auto; }
  .row-actions > form .btn { width: 100%; }

  /* Балансы */
  .balance-card { padding: 18px; }
  .balance-card .big { font-size: 1.75rem; margin-bottom: 12px; }
  .mini { padding: 12px; }
  .mini b { font-size: 1.1rem; word-break: break-word; }
  .m-ico { width: 32px; height: 32px; margin-bottom: 6px; }

  /* Формы в строку (админка) — в столбик */
  .inline-form, .admin-actions { flex-direction: column; align-items: stretch; }
  .inline-form input, .inline-form select, .inline-form .w-sm { flex: 1 1 auto; width: 100%; font-size: 16px; }
  .admin-actions > form, .admin-actions > a, .inline-form .btn { width: 100%; }
  .admin-actions .btn { width: 100%; }
  .admin-item-head { flex-direction: column; gap: 8px; }
  .admin-item-head > .badge, .admin-item-head > span { align-self: flex-start; }
  .admin-bal { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; }
  .search { flex-direction: column; }

  /* Списки */
  .tx-list li { align-items: flex-start; }
  .tx-list .plus, .tx-list .minus { font-size: .9rem; }
  .task { padding: 12px; gap: 10px; }
  .task-ico { width: 40px; height: 40px; }
  .task-body b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .task-reward { padding: 5px 8px; font-size: .85rem; }
  .camp-top > .badge { align-self: flex-start; }
  .camp-bottom { flex-direction: column; align-items: stretch; }
  .table { font-size: .82rem; }
  .table th, .table td { padding: 8px 6px; }

  /* Лендинг */
  .hero { gap: 16px; padding: 10px 0 0; }
  .display { font-size: 1.9rem; }
  .lead { font-size: .98rem; }
  .hero-visual { height: 220px; }
  .orb { inset: 20px 40px; }
  .float-card { padding: 10px 12px; gap: 8px; font-size: .85rem; }
  .float-card .ico { width: 20px; height: 20px; }
  .fc2 { top: 90px; }
  .stat { padding: 14px 6px; }
  .stat b { font-size: 1.15rem; }
  .promo { padding: 18px; }
  .section { margin-bottom: 26px; }

  /* Авторизация */
  .auth-wrap { min-height: auto; padding-top: 8px; }
  .auth-card { padding: 22px 16px; border-radius: 20px; }

  /* Кошелёк / счёт */
  .coin-grid { grid-template-columns: repeat(3, 1fr); }
  .inv-amount { font-size: 1.25rem; }
  .copy-line { flex-direction: column; align-items: stretch; }
  .copy-line .btn { width: 100%; }
  .qr { width: 180px; height: 180px; }

  /* Просмотр рекламы */
  .viewer-bar { padding: 8px 10px; gap: 8px; }
  .viewer-reward { font-size: .85rem; }
  .viewer-check { flex-direction: column; gap: 8px; }
  .check-btns { width: 100%; }
  .check-btns .btn { flex: 1; min-width: 0; }

  /* Вкладки */
  .tabs { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .tabs a { padding: 8px 12px; font-size: .82rem; }
  .code { font-size: .72rem; }
}

@media (max-width: 380px) {
  .chip { font-size: .74rem; padding: 5px 8px; }
  .chip-dot { display: none; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .seg { grid-template-columns: 1fr 1fr; }
  .coin-grid { grid-template-columns: 1fr 1fr; }
  .tabbar a span, .tabbar button span { font-size: .64rem; }
}

/* ===== v1.2: меню ===== */
.menu-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; }
.menu-btn:hover { background: rgba(255,255,255,.08); }
.menu-btn .ico { width: 18px; height: 18px; }
.drawer { display: flex; justify-content: flex-end; align-items: stretch; }
.drawer-panel { position: relative; width: 400px; max-width: 100%; height: 100%; max-height: 100vh; border-radius: 0; border-top: 0; border-left: 1px solid var(--line-2); animation: slide .22s ease; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 24px; bottom: auto; left: auto; right: auto; }
@keyframes slide { from { transform: translateX(100%); } }
.drawer-grip { display: none; }
.drawer-user { display: flex; align-items: center; gap: 12px; }
.drawer-user > div { display: flex; flex-direction: column; }
.drawer-user small { color: var(--muted); }
.avatar.sm { width: 42px; height: 42px; border-radius: 13px; font-size: 1.1rem; }
.drawer-bal { margin-bottom: 6px; }
.drawer-bal a { padding: 12px; border-radius: 14px; background: linear-gradient(135deg, rgba(124,92,255,.28), rgba(177,77,255,.1)); border: 1px solid rgba(124,92,255,.3); display: flex; flex-direction: column; gap: 2px; }
.drawer-bal a.ad { background: linear-gradient(135deg, rgba(0,212,255,.2), rgba(0,120,255,.08)); border-color: rgba(0,212,255,.3); }
.drawer-bal small { color: rgba(255,255,255,.7); }
.drawer-bal b { font-size: 1.05rem; }
.drawer-bal span { font-size: .75rem; color: var(--primary-2); font-weight: 700; }
.menu-group { margin-top: 14px; }
.menu-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; margin: 0 4px 6px; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 14px; background: none; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.menu-item:hover, .menu-item:active { background: rgba(255,255,255,.06); }
.menu-item.active { background: rgba(124,92,255,.16); }
.menu-item > .ico { width: 16px; height: 16px; color: var(--muted); }
.menu-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; background: rgba(255,255,255,.06); display: grid; place-items: center; color: #b9a8ff; }
.menu-item.active .menu-ico { background: var(--grad); color: #fff; }
.menu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-text b { font-size: .95rem; }
.menu-text small { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.menu-item.danger { color: var(--bad); }
.menu-item.danger .menu-ico { color: var(--bad); background: rgba(255,92,122,.1); }

/* Быстрые действия на главной */
.section-title { margin: 22px 0 10px; font-size: 1rem; color: var(--muted); font-weight: 700; }
.quick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.quick { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); transition: border-color .2s, transform .15s; }
.quick:hover { border-color: rgba(124,92,255,.5); transform: translateY(-2px); }
.quick b { font-size: .92rem; line-height: 1.25; }
.quick small { color: var(--muted); font-size: .78rem; }
.q-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(124,92,255,.18); color: #c3b5ff; margin-bottom: 6px; }
.q-ico.ad { background: rgba(0,212,255,.14); color: #7fe6ff; }
.q-ico.money { background: rgba(34,211,138,.14); color: #6ff0bb; }

/* Режим «новая вкладка» при просмотре */
.viewer-window { flex: 1; display: grid; place-items: center; padding: 20px 16px; overflow-y: auto; }
.viewer-window[hidden] { display: none; }
.vw-card { width: 100%; max-width: 440px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px 20px; }
.vw-card .f-ico { margin: 0 auto 14px; }
.vw-card .h2 { margin-bottom: 6px; }
.vw-steps { text-align: left; color: var(--muted); font-size: .9rem; margin: 18px 0 0; padding-left: 20px; }
.vw-steps li { margin-bottom: 6px; }
button.viewer-open { border: 0; width: 100%; font: inherit; cursor: pointer; color: var(--primary-2); }

@media (max-width: 1100px) {
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  .topnav { display: none; }
}
@media (max-width: 900px) {
  .hide-md { display: none !important; }
}
@media (max-width: 720px) {
  .drawer { align-items: flex-end; }
  .drawer-panel { width: 100%; height: auto; max-height: 88vh; border-radius: 24px 24px 0 0; border-left: 0; border-top: 1px solid var(--line-2); animation: up .25s ease; padding: 8px 14px calc(16px + env(safe-area-inset-bottom)); }
  .drawer-grip { display: block; width: 44px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.2); margin: 0 auto 10px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .quick { padding: 12px; }
  .section-title { margin: 16px 0 8px; }
  .tabbar a.active .ico { color: #b9a8ff; }
  .tabbar a.active { color: var(--text); }
  .tabbar a.active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--grad); }
  .tabbar a { position: relative; }
}
body.no-scroll { overflow: hidden; }

/* ===== v1.3: аватары, профиль, бонус ===== */
.avatar.av-0 { background: linear-gradient(135deg, #7c5cff, #00d4ff); }
.avatar.av-1 { background: linear-gradient(135deg, #ff5c7a, #ffb547); }
.avatar.av-2 { background: linear-gradient(135deg, #22d38a, #00a3ff); }
.avatar.av-3 { background: linear-gradient(135deg, #b14dff, #ff4da6); }
.avatar.av-4 { background: linear-gradient(135deg, #ffb547, #ff6b3d); }
.avatar.av-5 { background: linear-gradient(135deg, #00d4ff, #22d38a); }
.avatar.av-6 { background: linear-gradient(135deg, #3d5afe, #7c5cff); }
.avatar.av-7 { background: linear-gradient(135deg, #434a6b, #1c2033); }
.avatar.xs { width: 26px; height: 26px; border-radius: 8px; font-size: .8rem; }
.avatar.xl { width: 96px; height: 96px; border-radius: 28px; font-size: 2.6rem; border: 4px solid var(--bg); box-shadow: 0 16px 40px -12px rgba(0,0,0,.7); flex: none; }
.user-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }

.profile-hero { position: relative; border-radius: 24px; overflow: hidden; background: var(--card); border: 1px solid var(--line); }
.ph-cover { height: 130px; background: var(--grad); position: relative; }
.ph-cover::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 120%, rgba(255,255,255,.25), transparent 50%), radial-gradient(circle at 90% -20%, rgba(0,0,0,.35), transparent 60%); }
.av-bg-1 .ph-cover { background: linear-gradient(135deg, #ff5c7a, #ffb547); }
.av-bg-2 .ph-cover { background: linear-gradient(135deg, #22d38a, #00a3ff); }
.av-bg-3 .ph-cover { background: linear-gradient(135deg, #b14dff, #ff4da6); }
.av-bg-4 .ph-cover { background: linear-gradient(135deg, #ffb547, #ff6b3d); }
.av-bg-5 .ph-cover { background: linear-gradient(135deg, #00d4ff, #22d38a); }
.av-bg-6 .ph-cover { background: linear-gradient(135deg, #3d5afe, #7c5cff); }
.av-bg-7 .ph-cover { background: linear-gradient(135deg, #434a6b, #1c2033); }
.ph-body { display: flex; align-items: flex-end; gap: 18px; padding: 0 22px; margin-top: -48px; position: relative; }
.ph-info { padding-bottom: 4px; min-width: 0; }
.ph-info .h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.ph-about { margin: 0 0 6px; color: #cfd3ef; }
.ph-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: .85rem; align-items: center; }
.ph-meta span { display: inline-flex; align-items: center; gap: 5px; }
.ph-meta .ico { width: 15px; height: 15px; }
.level-pill { padding: 4px 10px; border-radius: 99px; background: rgba(255,181,71,.14); color: #ffd28a; font-weight: 700; }
.ph-level { padding: 16px 22px 20px; }
.ph-level-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); margin-bottom: 8px; }
.ph-level-top b { color: var(--text); }
.profile-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 14px; }
.pstat { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.pstat small { color: var(--muted); }
.pstat b { font-size: 1.25rem; font-weight: 800; }
.pstat.accent { background: linear-gradient(135deg, rgba(124,92,255,.3), rgba(0,212,255,.12)); border-color: rgba(124,92,255,.4); }
.av-picker { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.av-picker label { cursor: pointer; position: relative; }
.av-picker input { position: absolute; opacity: 0; pointer-events: none; }
.av-picker .avatar { width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; font-size: 1rem; opacity: .65; transition: .15s; }
.av-picker input:checked + .avatar { opacity: 1; outline: 3px solid #fff; outline-offset: 2px; }
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.kv li:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { text-align: right; word-break: break-all; }
.card h3 .ico { width: 18px; height: 18px; vertical-align: -3px; color: #b9a8ff; }
.fold summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: '＋'; color: var(--muted); font-weight: 700; }
.fold[open] summary::after { content: '－'; }
.fold summary h3 { margin: 0; }
.fold[open] summary { margin-bottom: 12px; }

.bonus-wrap { max-width: 620px; margin: 0 auto; }
.bonus-card { text-align: center; padding: 34px 22px; position: relative; overflow: hidden; background: linear-gradient(160deg, rgba(124,92,255,.22), rgba(0,212,255,.06) 60%), var(--card); }
.bonus-gift { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 26px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 18px 40px -12px rgba(124,92,255,.9); animation: float 4s ease-in-out infinite; }
.bonus-gift .ico { width: 42px; height: 42px; color: #fff; }
.bonus-timer { font-size: 3rem; font-weight: 800; letter-spacing: -.03em; margin: 6px 0 10px; font-variant-numeric: tabular-nums; }
.bonus-code { font-size: 1.3rem; color: var(--text); }
.bonus-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.bonus-btns form { margin: 0; }
.bonus-btns .btn { width: 100%; font-size: 1.3rem; }
.bonus-amount { font-size: 3.2rem; font-weight: 800; letter-spacing: -.03em; background: linear-gradient(135deg, #22d38a, #00d4ff); -webkit-background-clip: text; background-clip: text; color: transparent; animation: pop .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.bonus-card.won::before { content: ''; position: absolute; inset: -50%; background: conic-gradient(from 0deg, transparent, rgba(124,92,255,.25), transparent, rgba(0,212,255,.25), transparent); animation: spin 6s linear infinite; z-index: 0; }
.bonus-card > * { position: relative; z-index: 1; }
.quick.glow { border-color: rgba(34,211,138,.6); box-shadow: 0 0 0 3px rgba(34,211,138,.12), 0 10px 30px -12px rgba(34,211,138,.6); }
.q-ico.gift { background: rgba(255,181,71,.16); color: #ffd28a; }

@media (max-width: 900px) {
  .profile-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .profile-hero { border-radius: 20px; }
  .ph-cover { height: 96px; }
  .ph-body { flex-direction: column; align-items: center; text-align: center; padding: 0 16px; margin-top: -46px; gap: 10px; }
  .ph-info .h1 { justify-content: center; }
  .ph-meta { justify-content: center; }
  .avatar.xl { width: 88px; height: 88px; font-size: 2.3rem; }
  .ph-level { padding: 14px 16px 16px; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .pstat { padding: 12px; }
  .pstat b { font-size: 1.05rem; }
  .pstat.accent { grid-column: 1 / -1; }
  .av-picker { grid-template-columns: repeat(4, 1fr); }
  .bonus-card { padding: 26px 16px; }
  .bonus-timer { font-size: 2.5rem; }
  .bonus-btns { grid-template-columns: repeat(2, 1fr); }
}

/* ===== YouTube ===== */
.q-ico.yt { background: rgba(255,60,60,.16); color: #ff7b7b; }
.yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.yt-card { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--card); border: 1px solid var(--line); transition: transform .15s, border-color .2s; }
.yt-card:hover { transform: translateY(-2px); border-color: rgba(255,80,80,.5); }
.yt-thumb { position: relative; aspect-ratio: 16 / 9; background: #000; }
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-time { position: absolute; left: 8px; bottom: 8px; display: inline-flex; gap: 4px; align-items: center; padding: 3px 8px; border-radius: 8px; background: rgba(0,0,0,.75); font-size: .78rem; font-weight: 700; }
.yt-time .ico { width: 13px; height: 13px; }
.yt-play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s; background: rgba(0,0,0,.25); }
.yt-play .ico { width: 54px; height: 54px; color: #fff; }
.yt-card:hover .yt-play { opacity: 1; }
.yt-body { padding: 12px 14px 4px; display: flex; flex-direction: column; gap: 2px; }
.yt-body b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.yt-body small { color: var(--muted); }
.yt-reward { margin: 8px 14px 14px; align-self: flex-start; font-weight: 800; color: var(--ok); padding: 5px 10px; border-radius: 10px; background: rgba(34,211,138,.1); }
.yt-watch { max-width: 860px; margin: 0 auto; }
.yt-title { margin: 6px 0 4px; }
.yt-player-wrap { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #000; margin: 12px 0; box-shadow: var(--shadow); }
.yt-player-wrap iframe, .yt-player-wrap #yt-player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-panel { display: flex; flex-direction: column; gap: 12px; }
.yt-progress-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.progress.big { height: 10px; }
.yt-warn { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(255,181,71,.12); color: var(--warn); font-weight: 700; font-size: .9rem; }
.yt-warn[hidden], .yt-check[hidden], .yt-done[hidden] { display: none; }
.yt-check, .yt-done { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(124,92,255,.25), rgba(0,212,255,.12)); font-weight: 700; text-align: center; }
.yt-check b { font-size: 1.3rem; }
.yt-done.ok { background: rgba(34,211,138,.14); color: #7af0bf; }
.yt-done.bad { background: rgba(255,92,122,.14); color: #ff9db0; }
.yt-rules { margin: 0; padding-left: 18px; color: var(--muted); font-size: .85rem; }
.yt-mini { width: 96px; height: 54px; object-fit: cover; border-radius: 8px; flex: none; }
.yt-camp .camp-top { align-items: flex-start; flex-wrap: nowrap; }
.yt-camp .camp-top > div { flex: 1; }
.yt-admin-row { display: flex; gap: 12px; flex-direction: row !important; }
.yt-admin-row > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.yt-seg { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 720px) {
  .yt-grid { grid-template-columns: 1fr; }
  .yt-player-wrap { border-radius: 14px; margin: 10px -4px; }
  .yt-seg { grid-template-columns: repeat(3, 1fr); }
  .yt-mini { width: 80px; height: 45px; }
  .yt-camp .camp-top { flex-wrap: wrap; }
}
.ph-body { align-items: flex-start; }
.ph-info { padding-top: 56px; }
.profile-stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
@media (max-width: 720px) {
  .ph-body { align-items: center; }
  .ph-info { padding-top: 0; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ===== v1.4: новый кабинет ===== */
.dash { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.avatar.md { width: 46px; height: 46px; border-radius: 15px; font-size: 1.2rem; flex: none; }
.dash-hello { display: flex; align-items: center; gap: 12px; padding: 2px 2px 0; }
.dash-hello > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-hello b { font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; }
.dash-hello small { color: var(--muted); font-size: .85rem; }
.dash-hello > .ico { color: var(--muted); width: 18px; height: 18px; }

.wallet-card { border-radius: 22px; padding: 18px 16px 12px; background:
  radial-gradient(120% 140% at 0% 0%, rgba(124,92,255,.55), transparent 55%),
  radial-gradient(120% 140% at 100% 100%, rgba(0,212,255,.35), transparent 55%), #161a2e;
  border: 1px solid rgba(124,92,255,.35); box-shadow: 0 20px 50px -24px rgba(124,92,255,.7); }
.wc-row { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 14px; align-items: stretch; }
.wc-sep { background: rgba(255,255,255,.14); }
.wc-bal { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 2px 4px; }
.wc-bal small { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.75); font-size: .8rem; font-weight: 600; }
.wc-bal b { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-hint { font-size: .72rem; color: rgba(255,255,255,.5); }
.wc-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.1); }
.wc-actions a { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; color: rgba(255,255,255,.85); padding: 4px 0; border-radius: 12px; }
.wc-actions a:active { background: rgba(255,255,255,.06); }
.wc-actions span { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.1); }
.wc-actions .ico { width: 19px; height: 19px; }

.bonus-strip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.bonus-strip.ready { background: linear-gradient(135deg, rgba(34,211,138,.18), rgba(0,212,255,.08)); border-color: rgba(34,211,138,.45); }
.bs-ico { width: 40px; height: 40px; flex: none; border-radius: 13px; display: grid; place-items: center; background: rgba(255,181,71,.16); color: #ffd28a; }
.bonus-strip.ready .bs-ico { background: rgba(34,211,138,.2); color: #6ff0bb; animation: float 3s ease-in-out infinite; }
.bs-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bs-text small { color: var(--muted); font-size: .8rem; }
.bs-btn { color: var(--muted); }
.bonus-strip.ready .bs-btn { padding: 8px 14px; border-radius: 11px; background: var(--ok); color: #062b1c; font-weight: 800; font-size: .85rem; }

.dash-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; margin: 6px 4px -4px; }
.dash-head-row { display: flex; justify-content: space-between; align-items: flex-end; }
.dash-head-row .link { margin-bottom: -4px; }
.list-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 4px 6px; }
.lc-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 14px; }
a.lc-row:active, a.lc-row:hover { background: rgba(255,255,255,.04); }
.lc-row + .lc-row { border-top: 1px solid var(--line); border-radius: 0; }
.lc-row > .ico { width: 16px; height: 16px; color: var(--muted); flex: none; }
.lc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lc-text b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-text small { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-badge { min-width: 26px; padding: 3px 9px; border-radius: 99px; background: rgba(124,92,255,.22); color: #cfc3ff; font-weight: 800; font-size: .78rem; text-align: center; }
.lc-amount { font-weight: 800; white-space: nowrap; font-size: .92rem; }
.lc-empty { padding: 14px 10px; }
.lc-ico { width: 40px; height: 40px; flex: none; border-radius: 13px; display: grid; place-items: center; }
.lc-ico .ico { width: 19px; height: 19px; }
.lc-ico.sm { width: 34px; height: 34px; border-radius: 11px; }
.lc-ico.sm .ico { width: 16px; height: 16px; }
.lc-ico.violet { background: rgba(124,92,255,.18); color: #c3b5ff; }
.lc-ico.cyan { background: rgba(0,212,255,.14); color: #7fe6ff; }
.lc-ico.red { background: rgba(255,70,70,.15); color: #ff8a8a; }
.lc-ico.amber { background: rgba(255,181,71,.15); color: #ffd28a; }
.lc-ico.green { background: rgba(34,211,138,.14); color: #6ff0bb; }

.ad-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; gap: 8px; }
.ad-tile { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.ad-tile b { font-size: .9rem; }
.ad-tile small { color: var(--muted); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-tile:hover { border-color: rgba(0,212,255,.4); }

.invite-strip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: linear-gradient(135deg, rgba(34,211,138,.1), rgba(124,92,255,.08)); border: 1px solid var(--line); }
.invite-strip > .ico { width: 16px; height: 16px; color: var(--muted); }

@media (max-width: 720px) {
  .dash { gap: 12px; }
  .wc-bal b { font-size: 1.25rem; }
  .wc-row { gap: 10px; }
  .ad-tile { padding: 10px; }
}
@media (max-width: 360px) {
  .wc-bal b { font-size: 1.1rem; }
  .ad-tile small { display: none; }
}
.wallet-page { max-width: 760px; } html { scroll-behavior: smooth; } [id] { scroll-margin-top: 80px; }

/* ===== v1.5: футер, страницы, поддержка, загрузки ===== */
.footer { padding: 22px 0 26px; }
.footer-in { flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--muted); font-weight: 600; font-size: .88rem; }
.footer-links a:hover { color: var(--text); }
.footer-copy { display: flex; flex-direction: column; gap: 2px; font-size: .8rem; color: var(--muted); }
.horizont { letter-spacing: .02em; }
.horizont b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.narrow-page { max-width: 760px; margin: 0 auto; }
.prose h2 { font-size: 1.4rem; margin: 4px 0 14px; }
.prose h3 { font-size: 1.05rem; margin: 20px 0 8px; color: #d9dcf5; }
.prose p { color: #c9cde6; }
.prose ul { padding-left: 20px; margin: 0 0 8px; color: #c9cde6; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--primary-2); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; }

.lc-badge.hot { background: var(--bad); color: #fff; }
.menu-btn, .tabbar button { position: relative; }
.dot { position: absolute; top: 6px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--bg); }
.tabbar .dot { top: 8px; right: calc(50% - 16px); }

.chip-select { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-select label { cursor: pointer; position: relative; }
.chip-select input { position: absolute; opacity: 0; pointer-events: none; }
.chip-select span { display: inline-block; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line-2); font-size: .84rem; font-weight: 600; color: var(--muted); }
.chip-select input:checked + span { background: rgba(124,92,255,.2); border-color: rgba(124,92,255,.6); color: var(--text); }

.file-drop { position: relative; display: flex !important; flex-direction: row !important; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1.5px dashed var(--line-2); background: rgba(0,0,0,.15); cursor: pointer; color: var(--text) !important; }
.file-drop:hover, .file-drop.has-files { border-color: var(--primary); background: rgba(124,92,255,.08); }
.file-drop > .ico { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: rgba(124,92,255,.18); color: #c3b5ff; flex: none; }
.file-drop > span { display: flex; flex-direction: column; min-width: 0; }
.file-drop small { color: var(--muted); font-weight: 500; }
.file-drop em { font-style: normal; color: var(--primary-2); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

.shots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.shots a { display: block; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: #000; }
.shots img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 8px 0 14px; }
.ticket-head .h1 { margin-bottom: 2px; }
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.msg.mine, .msg.user { align-self: flex-end; background: rgba(124,92,255,.16); border-color: rgba(124,92,255,.3); border-bottom-right-radius: 6px; }
.msg.staff { align-self: flex-start; background: rgba(0,212,255,.08); border-color: rgba(0,212,255,.25); border-bottom-left-radius: 6px; }
.msg-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.msg-head b { font-size: .82rem; }
.msg.staff .msg-head b { color: var(--primary-2); }
.msg-head small { color: var(--muted); font-size: .72rem; }
.msg-body { font-size: .93rem; word-break: break-word; }
.reply-box { margin-top: 14px; }
.reply-box textarea { min-height: 80px; }
.tab-count { opacity: .7; margin-left: 4px; }

/* ===== v1.5: компактная админка ===== */
body.admin-mode .main { max-width: 1280px; padding-top: 14px; }
body.admin-mode .page-head, .adm-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
body.admin-mode .page-head .h1, .adm-head h1 { font-size: 1.25rem; margin: 0; }
body.admin-mode .page-head p { font-size: .82rem; }
body.admin-mode .card { padding: 12px 14px; border-radius: 14px; }
body.admin-mode .admin-item { padding: 10px 12px; }
body.admin-mode .admin-list { gap: 6px; }
body.admin-mode .admin-item b { font-size: .92rem; }
body.admin-mode .admin-item small { font-size: .78rem; }
body.admin-mode .admin-actions { margin-top: 8px; gap: 6px; }
body.admin-mode .inline-form { margin-top: 8px; gap: 6px; }
body.admin-mode .inline-form input, body.admin-mode .inline-form select { padding: 7px 10px; font-size: 13px; border-radius: 9px; }
body.admin-mode .btn-xs { padding: 5px 10px; font-size: .76rem; min-height: 0; }
body.admin-mode .form { gap: 10px; }
body.admin-mode .form label { font-size: .8rem; }
body.admin-mode input, body.admin-mode select, body.admin-mode textarea { padding: 9px 11px; font-size: 14px; border-radius: 10px; }
body.admin-mode h3 { font-size: .95rem; }
body.admin-mode .tabs.sub { margin-bottom: 10px; }
body.admin-mode .camp { padding: 10px 12px; }
body.admin-mode .footer { padding: 14px 0; }

.admin-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 0 14px; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); position: sticky; top: 72px; z-index: 20; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a { position: relative; display: flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 10px; font-size: .82rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.admin-nav a .ico { width: 15px; height: 15px; }
.admin-nav a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.admin-nav a.active { color: #fff; background: rgba(124,92,255,.28); }
.nav-badge { font-style: normal; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .68rem; font-weight: 800; display: inline-grid; place-items: center; }

.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 12px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.kpi small { color: var(--muted); font-size: .74rem; }
.kpi b { font-size: 1.05rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi em { font-style: normal; font-size: .72rem; color: var(--ok); }
a.kpi:hover { border-color: var(--line-2); }
.adm-cols { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; align-items: start; }
.adm-box { padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.adm-box h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 6px; }
.adm-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; font-size: .88rem; font-weight: 600; }
.adm-row span { flex: 1; }
.adm-row .ico { width: 16px; height: 16px; color: #b9a8ff; }
a.adm-row:hover { background: rgba(255,255,255,.05); }
.adm-row.static.ok { color: var(--ok); }
.adm-row.static.bad { color: var(--bad); }
.adm-row + .adm-row { border-top: 1px solid var(--line); border-radius: 0; }
.adm-table { display: flex; flex-direction: column; }
.adm-log { display: grid; grid-template-columns: 170px 1fr auto; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: .8rem; align-items: baseline; }
.adm-log:last-child { border-bottom: 0; }
.adm-log span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-log small { color: var(--muted); font-size: .72rem; white-space: nowrap; }

@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .adm-cols { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .admin-nav { top: 62px; margin-left: -4px; margin-right: -4px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .adm-log { grid-template-columns: 1fr auto; }
  .adm-log span { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .msg { max-width: 94%; }
  .shots a { width: 80px; height: 80px; }
  body.admin-mode .admin-actions, body.admin-mode .inline-form { flex-direction: row; flex-wrap: wrap; }
  body.admin-mode .inline-form input, body.admin-mode .inline-form select { flex: 1 1 140px; width: auto; }
  body.admin-mode .admin-actions > form, body.admin-mode .admin-actions .btn, body.admin-mode .inline-form .btn { width: auto; }
  body.admin-mode .btn { min-height: 34px; }
}

/* ===== v1.6: баны и карточка пользователя ===== */
.adm-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.adm-toolbar .tabs { margin: 0; }
.adm-toolbar .search { margin: 0; flex: 1 1 260px; max-width: 420px; }
.adm-toolbar .search input { padding: 8px 12px; }
.user-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); flex-wrap: wrap; }
.user-card.banned { border-color: rgba(255,92,122,.5); background: linear-gradient(135deg, rgba(255,92,122,.1), transparent 60%), var(--card); }
.uc-main { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; }
.uc-main small { color: var(--muted); font-size: .78rem; }
.uc-bal { display: flex; flex-direction: column; gap: 2px; font-size: .85rem; text-align: right; }
.ban-note { margin-top: 6px; padding: 6px 10px; border-radius: 9px; background: rgba(255,92,122,.14); color: #ff9db0; font-size: .82rem; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; align-self: flex-start; }
.ban-note .ico { width: 14px; height: 14px; }
.ban-form .chip-select span { padding: 5px 10px; font-size: .78rem; }
.adm-row form { margin: 0; }
.adm-row .avatar.xs { flex: none; }
.lc-row .avatar.xs { flex: none; }
.badge-warn { background: rgba(255,181,71,.16); color: var(--warn); }
@media (max-width: 720px) { .uc-bal { text-align: left; flex-direction: row; gap: 12px; } }
.adm-row > .badge { flex: none; }
body.admin-mode .lc-text b { white-space: normal; }

/* ===== v1.7: сообщество ===== */
.ph-avatar { position: relative; display: inline-flex; flex: none; }
.online-dot { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; background: var(--ok); border: 3px solid var(--bg); }
.ph-avatar .avatar.xl + .online-dot { width: 22px; height: 22px; right: 2px; bottom: 2px; border-width: 4px; }
.ph-avatar.sm .online-dot { width: 12px; height: 12px; border-width: 2px; }
.avatar.sm { width: 40px; height: 40px; border-radius: 13px; font-size: 1rem; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 22px 0; }
.ph-actions form { margin: 0; }
.act-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.act-card { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.act-card .lc-ico { margin-bottom: 6px; }
.act-card small { color: var(--muted); }
.act-card b { font-size: 1.35rem; font-weight: 800; }
.act-card em { font-style: normal; color: var(--ok); font-size: .76rem; }
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; height: 130px; padding-top: 6px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bar i { display: block; width: 100%; max-width: 22px; border-radius: 6px 6px 3px 3px; background: var(--grad); min-height: 3px; }
.bar i.zero { background: rgba(255,255,255,.08); }
.bar small { font-size: .62rem; color: var(--muted); }
.friend-strip { display: flex; gap: 10px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; scrollbar-width: none; }
.friend-strip a { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 56px; }
.friend-strip small { font-size: .68rem; color: var(--muted); max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank { width: 26px; text-align: center; font-weight: 800; color: var(--muted); flex: none; }
.rank-1 { color: #ffd166; } .rank-2 { color: #d6dbe8; } .rank-3 { color: #e0a36d; }
.row-btns { display: flex; gap: 6px; flex: none; }
.row-btns form { margin: 0; }
.lc-row.unread { background: rgba(124,92,255,.08); }
.lc-row.unread b { color: #fff; }
.dlg-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.dlg-meta small { color: var(--muted); font-size: .72rem; }
.top-msg { position: relative; }
.top-msg .ico { width: 19px; height: 19px; }
.top-msg .nav-badge { position: absolute; top: -6px; right: -6px; }
.my-ref .lc-row { padding: 8px 0; }

/* Чат */
.chat { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; height: calc(100vh - 150px); height: calc(100dvh - 150px); min-height: 420px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: rgba(0,0,0,.15); }
.chat-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat-user > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.chat-user small { color: var(--muted); font-size: .76rem; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.chat-empty { margin: auto; color: var(--muted); }
.chat-date { align-self: center; font-size: .72rem; color: var(--muted); padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.05); margin: 6px 0; }
.bubble { max-width: 78%; padding: 8px 12px 6px; border-radius: 16px; display: flex; flex-direction: column; gap: 2px; word-break: break-word; font-size: .94rem; line-height: 1.4; }
.bubble span { white-space: pre-wrap; }
.bubble small { align-self: flex-end; font-size: .66rem; opacity: .65; }
.bubble.mine { align-self: flex-end; background: linear-gradient(135deg, #7c5cff, #5a8dff); color: #fff; border-bottom-right-radius: 5px; }
.bubble.their { align-self: flex-start; background: rgba(255,255,255,.07); border-bottom-left-radius: 5px; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.chat-form textarea { resize: none; min-height: 44px; max-height: 140px; border-radius: 14px; }
.chat-form .btn { width: 46px; height: 46px; padding: 0; border-radius: 14px; flex: none; }

@media (max-width: 720px) {
  .act-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .act-card { padding: 12px; }
  .act-card b { font-size: 1.15rem; }
  .ph-actions { justify-content: center; padding: 12px 16px 0; }
  body.chat-page .main { padding-bottom: 0; }
  body.chat-page .footer { display: none; }
  .chat { height: calc(100vh - 58px - var(--tabbar-h) - 24px); height: calc(100dvh - 58px - var(--tabbar-h) - env(safe-area-inset-bottom) - 24px); border-radius: 16px; min-height: 0; }
  .bubble { max-width: 86%; }
}

/* ===== v1.8: меню админки по разделам ===== */
.admin-nav { display: none; }
.admin-menu { margin: 0 0 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.admin-menu summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; background: linear-gradient(135deg, rgba(124,92,255,.22), rgba(0,212,255,.08)); }
.admin-menu summary::-webkit-details-marker { display: none; }
.am-cur { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.am-cur > .ico { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--grad); color: #fff; flex: none; }
.am-cur > span { display: flex; flex-direction: column; line-height: 1.2; }
.am-cur small { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.am-cur b { font-size: .98rem; }
.am-chev .ico { width: 18px; height: 18px; color: var(--muted); transform: rotate(90deg); transition: transform .2s; }
.admin-menu[open] .am-chev .ico { transform: rotate(-90deg); }
.am-panel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px 14px; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.am-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; margin: 2px 4px 6px; }
.am-items { display: flex; flex-direction: column; gap: 3px; }
.am-items a { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 10px; font-size: .84rem; font-weight: 600; color: #cdd1ea; border: 1px solid transparent; }
.am-items a .ico { width: 15px; height: 15px; color: #a99bff; flex: none; }
.am-items a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-items a:hover { background: rgba(255,255,255,.05); }
.am-items a.active { background: rgba(124,92,255,.22); border-color: rgba(124,92,255,.45); color: #fff; }
@media (max-width: 1100px) { .am-panel { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) {
  .am-panel { grid-template-columns: 1fr; gap: 10px; }
  .am-items { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .am-items a { border-color: var(--line); background: rgba(255,255,255,.03); padding: 10px; }
}

/* ===== v1.8: категории заданий ===== */
.cat-picker { margin-bottom: 12px; border-radius: 18px; overflow: hidden; border: 1px solid rgba(0,212,255,.35); background: var(--card); }
.cat-picker summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; cursor: pointer;
  background: linear-gradient(135deg, rgba(0,140,200,.55), rgba(124,92,255,.35)); font-size: 1rem; }
.cat-picker summary::-webkit-details-marker { display: none; }
.cat-picker summary b { font-weight: 800; }
.cat-picker[open] .am-chev .ico { transform: rotate(-90deg); }
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px; }
.cat-grid a { display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; min-height: 50px; padding: 8px 10px; border-radius: 12px;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.03); font-size: .88rem; font-weight: 600; color: #d7daf0; line-height: 1.25; }
.cat-grid a:hover { border-color: rgba(0,212,255,.5); }
.cat-grid a.active { border-color: var(--primary-2); background: rgba(0,212,255,.14); color: #fff; }
.cat-grid a.empty-cat { color: var(--muted); }
.cat-grid a i { font-style: normal; font-size: .72rem; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: rgba(124,92,255,.3); color: #e2dcff; }
.type-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.type-tabs::-webkit-scrollbar { display: none; }
.type-tabs a { flex: 1; text-align: center; white-space: nowrap; padding: 10px 14px; border-radius: 10px; font-weight: 700; font-size: .9rem; color: var(--muted); }
.type-tabs a.active { color: #fff; background: rgba(124,92,255,.25); box-shadow: inset 0 -2px 0 var(--primary-2); }
.cat-admin { display: flex; flex-direction: column; }
.cat-row { display: grid; grid-template-columns: 44px 1fr 80px 80px 44px; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.cat-row.head { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }
.cat-row input { padding: 7px 10px; font-size: 14px; }
.cat-row .check input { width: 18px; height: 18px; }
@media (max-width: 900px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) {
  .cat-picker summary { padding: 14px; font-size: .95rem; }
  .cat-grid { gap: 6px; padding: 10px; }
  .cat-grid a { min-height: 46px; font-size: .84rem; }
  .cat-row { grid-template-columns: 30px 1fr 56px 44px; }
  .cat-row > span:nth-child(4) { display: none; }
  .cat-row.head > span:nth-child(4) { display: none; }
}
