/* ELITE TEAM — чёрный, белый, графит, оранжевый акцент. Светлая и тёмная темы. */
:root {
  --bg: #F4F5F7; --surface: #FFFFFF; --surface-2: #F8F9FA; --surface-3: #ECEEF1;
  --text: #171717; --text-2: #3A3B40; --muted: #6E7078; --border: #E3E5E9; --border-2: #D3D6DC;
  --graphite: #262626; --accent: #F58220; --accent-2: #FFA04D; --accent-ink: #C4620B; --accent-soft: rgba(245, 130, 32, .1);
  --ok: #1E9E5A; --ok-soft: rgba(30, 158, 90, .12); --warn: #C27A00; --warn-soft: rgba(230, 150, 0, .14); --bad: #D23B3B; --bad-soft: rgba(210, 59, 59, .1);
  --gold: #E8B33A; --gold-2: #FFE29A; --silver: #B9BEC7; --silver-2: #EEF1F5; --bronze: #C9824A; --bronze-2: #F2C29A;
  --shadow: 0 1px 2px rgba(15, 15, 20, .04), 0 4px 16px rgba(15, 15, 20, .05);
  --shadow-lg: 0 20px 60px rgba(10, 10, 14, .18);
  --radius: 16px; --radius-sm: 10px;
  --sidebar: 264px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171717; --surface: #1E1E1E; --surface-2: #262626; --surface-3: #2E2E2E;
    --text: #F4F4F2; --text-2: #CFCFD3; --muted: #8D8F97; --border: #2C2C2C; --border-2: #3A3A3A;
    --graphite: #262626; --accent-ink: #FFA04D; --accent-soft: rgba(245, 130, 32, .14);
    --ok: #3CC47C; --warn: #F0B23A; --bad: #F06262;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171717; --surface: #1E1E1E; --surface-2: #262626; --surface-3: #2E2E2E;
  --text: #F4F4F2; --text-2: #CFCFD3; --muted: #8D8F97; --border: #2C2C2C; --border-2: #3A3A3A;
  --graphite: #262626; --accent-ink: #FFA04D; --accent-soft: rgba(245, 130, 32, .14);
  --ok: #3CC47C; --warn: #F0B23A; --bad: #F06262;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.grow > .pill, .grow > .badge { align-self: flex-start; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; }
h4 { font-size: 14px; font-weight: 700; margin: 12px 0 6px; }
p { margin: 0 0 10px; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }
.ic { flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.prewrap { white-space: normal; }
.accent-text { color: var(--accent-ink); }
.danger-text { color: var(--bad) !important; }
.mt { margin-top: 16px; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; }
.row.wrap, .wrap { flex-wrap: wrap; }
.gap { gap: 12px; } .gap-sm { gap: 8px; }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.left { text-align: left; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mobile-only { display: none !important; }

/* ---------- Логотип ---------- */
.logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; background: #121212; color: #fff; font-weight: 800; font-size: 15px; letter-spacing: -.04em; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); flex: none; }
.logo-mark em { font-style: normal; color: var(--accent); }
.logo-mark.big { width: 76px; height: 76px; font-size: 30px; border-radius: 22px; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot .logo-mark { animation: pulse 1.2s ease-in-out infinite; }

/* ---------- Оболочка ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: #121212; color: #E9E9EA; display: flex; flex-direction: column; padding: 18px 14px; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; }
.brand b { display: block; font-size: 15px; letter-spacing: .06em; }
.brand small { display: block; color: #8A8B92; font-size: 11px; letter-spacing: .14em; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #A6A7AE; font-weight: 600; font-size: 14px; transition: background .15s, color .15s; }
.nav a:hover { background: #17171A; color: #fff; }
.nav a.on { background: #1C1C20; color: #fff; }
.nav a.on::before { content: ''; position: absolute; left: -4px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav a.on .ic { color: var(--accent); }
.nav-badge { margin-left: auto; font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.nav-badge:empty, .nav-badge[hidden] { display: none; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: #151518; margin-top: 10px; }
.me-card b { display: block; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.me-card small { color: #8A8B92; font-size: 12px; }
.main-col { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 17px; font-weight: 700; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.bell { position: relative; }
.dot-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; font-style: normal; display: grid; place-items: center; border: 2px solid var(--bg); }
#main { flex: 1; }
.page { padding: 28px; max-width: 1360px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.page.narrow { max-width: 820px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hello { font-size: 28px; }
.section-title { font-size: 15px; margin-top: 8px; }
.bottom-nav { display: none; }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; background: var(--surface-3); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px -6px rgba(245, 130, 32, .6); }
.btn.primary:hover { background: #FF8F33; }
.btn.dark { background: var(--graphite); color: #fff; }
:root[data-theme="dark"] .btn.dark { background: #F4F4F2; color: #121212; }
.btn.ghost { background: transparent; border-color: var(--border-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.lg { height: 50px; font-size: 15px; border-radius: 14px; }
.btn.xl { height: 56px; padding: 0 26px; font-size: 16px; border-radius: 16px; }
.btn.block { width: 100%; }
.btn.icon-only { width: 44px; padding: 0; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ''; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor; border-color: var(--muted) transparent var(--muted) transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.primary.busy::after { border-color: #fff transparent #fff transparent; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-3); }
.icon-btn:disabled { opacity: .35; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.link, .link-btn { color: var(--accent-ink); font-weight: 700; font-size: 13px; background: none; border: 0; padding: 0; }
.link-btn.row { color: inherit; font-weight: 600; font-size: 14px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: -4px; }

/* ---------- Карточки, статистика ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stats.compact { grid-template-columns: repeat(2, 1fr); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); min-width: 0; }
.stats.compact .stat { box-shadow: none; background: var(--surface-2); }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.stat-value small { font-size: 15px; color: var(--muted); font-weight: 700; }
.stat-sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat.accent { background: linear-gradient(135deg, #17171A, #121212); border-color: #121212; color: #fff; }
.stat.accent .stat-value { color: var(--accent); }
:root[data-theme="dark"] .stat.accent { border-color: rgba(245, 130, 32, .35); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stat.accent { border-color: rgba(245, 130, 32, .35); } }
.stat.accent .stat-label, .stat.accent .stat-sub { color: #9C9DA4; }
.stat.warn .stat-value { color: var(--warn); }
.stat.bad .stat-value { color: var(--bad); }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px dashed var(--border-2); font-size: 14px; }
.banner > span { flex: 1; }
.banner.warn { border: 1px solid transparent; background: var(--warn-soft); }
.banner.ok { border: 1px solid transparent; background: var(--ok-soft); }
.banner a:not(.link) { text-decoration: underline; margin-right: 10px; }
.alert-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: var(--accent); color: #fff; box-shadow: 0 10px 30px -10px rgba(245, 130, 32, .7); }
.alert-card span { flex: 1; }
.note { background: var(--surface-2); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 8px; margin: 10px 0; text-align: left; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.pill.sm { padding: 1px 8px; font-size: 11px; margin-bottom: 4px; align-self: flex-start; }
.pill.ok, .pill.confirmed, .pill.done, .pill.b-paid { background: var(--ok-soft); color: var(--ok); }
.pill.warn, .pill.pending, .pill.in_progress, .pill.b-review { background: var(--warn-soft); color: var(--warn); }
.pill.bad, .pill.rejected, .pill.overdue, .pill.urgent, .pill.b-rejected { background: var(--bad-soft); color: var(--bad); }
.pill.accent, .pill.high, .pill.new, .pill.b-approved { background: var(--accent-soft); color: var(--accent-ink); }
.pill.cancelled { text-decoration: line-through; }
.badge.test { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 1px 6px; border-radius: 4px; background: #6D4AFF; color: #fff; vertical-align: middle; }
.count-chip { min-width: 28px; height: 28px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; display: grid; place-items: center; font-size: 13px; }
.delta { font-size: 12px; font-weight: 700; color: var(--muted); }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }

/* ---------- Списки ---------- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list > li + li { border-top: 1px solid var(--border); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; width: 100%; background: none; border: 0; text-align: left; }
a.list-row:hover, button.list-row:hover { color: var(--accent-ink); }
.list-row b { font-weight: 700; font-size: 14px; }
.list-row small { font-size: 12.5px; }
.date-chip { width: 46px; height: 50px; border-radius: 12px; background: var(--surface-3); display: grid; place-content: center; text-align: center; flex: none; line-height: 1.1; }
.date-chip b { font-size: 18px; }
.date-chip small { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.achv { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.achv li { display: flex; gap: 10px; align-items: flex-start; }
.achv li .ic { color: var(--accent); margin-top: 2px; }
.achv span { display: flex; flex-direction: column; }
.achv small { font-size: 12px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 26px 12px; color: var(--muted); }
.empty .ic { opacity: .5; }
.empty p { margin: 0; max-width: 360px; font-size: 14px; }
.loading { display: flex; gap: 6px; justify-content: center; padding: 40px; }
.loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: bounce 1s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: .15s; } .loading span:nth-child(3) { animation-delay: .3s; }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table tr.me td { background: var(--accent-soft); }
.w-progress { min-width: 140px; }
.w-progress .progress { display: inline-block; width: calc(100% - 46px); vertical-align: middle; }
.progress-label { display: inline-block; width: 42px; text-align: right; font-size: 12.5px; font-weight: 700; vertical-align: middle; }
.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; border-radius: 6px; background: var(--graphite); transition: width .6s ease; }
:root[data-theme="dark"] .progress > div { background: #D9D9DD; }
.progress.done > div { background: var(--accent); }
.place { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 800; font-size: 13px; background: var(--surface-3); }
tr.top1 .place { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #3B2A00; }
tr.top2 .place { background: linear-gradient(135deg, var(--silver-2), var(--silver)); color: #2A2D33; }
tr.top3 .place { background: linear-gradient(135deg, var(--bronze-2), var(--bronze)); color: #3A1D05; }

/* ---------- Табы, сегменты, чипы ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; background: none; border: 0; padding: 10px 14px; font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; }
.tab.on { color: var(--text); }
.tab.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tab .count { margin-left: 6px; background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 12px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border-2); background: var(--surface); padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--text-2); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.period { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.month-nav { display: inline-flex; align-items: center; gap: 6px; }
.month-nav b { min-width: 140px; text-align: center; }
.month-nav input { height: 36px; border: 1px solid var(--border-2); border-radius: 10px; padding: 0 10px; background: var(--surface); }

/* ---------- Формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 700; color: var(--text-2); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline input { width: 110px; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px !important; }
.row select, .row.wrap select { width: auto; min-width: 180px; }
input[type=range] { accent-color: var(--accent); width: 100%; }
.check, .radio { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input, .radio input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 2px; flex: none; }
.check a { color: var(--accent-ink); text-decoration: underline; }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch > span { width: 42px; height: 24px; border-radius: 12px; background: var(--border-2); position: relative; flex: none; transition: background .2s; margin-top: 1px; }
.switch > span::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.switch div { display: flex; flex-direction: column; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input { width: auto !important; min-width: 140px; }
.weekdays { display: flex; gap: 6px; flex-wrap: wrap; }
.weekdays .check { padding: 6px 10px; border: 1px solid var(--border-2); border-radius: 10px; align-items: center; }
.pick-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--border-2); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.narrow-form { max-width: 620px; }
.code-input { font-size: 24px !important; letter-spacing: .3em; text-align: center; font-weight: 800; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 15px; padding: 14px; border-radius: 12px; background: var(--surface-3); word-break: break-all; margin: 10px 0; user-select: all; }
pre.code { background: #121212; color: #E6E6E8; padding: 16px; border-radius: 12px; overflow-x: auto; font-size: 12.5px; line-height: 1.55; }

/* ---------- Модальные окна и тосты ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(8, 8, 10, .55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); animation: rise .2s ease; border: 1px solid var(--border); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px; gap: 12px; }
.modal-body { padding: 6px 20px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
#toasts { pointer-events: none; position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px; background: #121212; color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600; animation: slidein .25s ease; }
.toast.ok .ic { color: #4ADE80; } .toast.err .ic { color: #FF7A7A; } .toast.info .ic { color: var(--accent); }
.toast.out { opacity: 0; transform: translateX(20px); transition: all .3s; }
.chart-tip { position: fixed; z-index: 300; background: #121212; color: #fff; font-size: 12.5px; font-weight: 600; padding: 6px 10px; border-radius: 8px; pointer-events: none; max-width: 260px; }

/* ---------- Аватары ---------- */
.avatar { --s: 40px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: inline-grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, hsl(var(--h, 20) 12% 30%), hsl(var(--h, 20) 10% 16%)); color: #fff; font-weight: 800; font-size: calc(var(--s) * .36); letter-spacing: .02em; position: relative; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.ring-accent { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }

/* ---------- Авторизация ---------- */
body.auth-mode { background: var(--bg); }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 44%) 1fr; }
.auth-side { position: sticky; top: 0; height: 100vh; overflow: hidden; background: #121212; color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth-brand b { display: block; letter-spacing: .08em; } .auth-brand small { color: #8A8B92; letter-spacing: .16em; font-size: 11px; }
.auth-motto { position: relative; z-index: 1; max-width: 440px; }
.auth-motto h2 { font-size: 38px; line-height: 1.1; font-weight: 800; margin-bottom: 14px; }
.auth-motto p { color: #A6A7AE; font-size: 17px; }
.auth-glow { position: absolute; width: 520px; height: 520px; right: -200px; bottom: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(245, 130, 32, .55), rgba(245, 130, 32, 0) 65%); filter: blur(10px); animation: float 9s ease-in-out infinite; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }
.auth-card.wide { max-width: 640px; }
.auth-card h1 { font-size: 30px; }
.auth-links { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; color: var(--accent-ink); }
.welcome { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.welcome h1 { font-size: 36px; letter-spacing: .04em; margin-top: 6px; }
.welcome .muted { margin-bottom: 18px; }
.photo-pick { display: flex; align-items: center; gap: 16px; }
.photo-preview { width: 76px; height: 76px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; color: var(--muted); flex: none; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.pending { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.pending-icon { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); animation: pulse 2s ease-in-out infinite; }
.pending-icon.rejected { background: var(--bad-soft); color: var(--bad); animation: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 6px 0 14px; text-align: left; font-size: 14px; width: 100%; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.kv.cols { grid-template-columns: auto 1fr auto 1fr; }

/* ---------- Лидеры: подиум ТОП-3 ---------- */
.card.leaders { position: relative; overflow: hidden; background: radial-gradient(120% 140% at 50% 0%, #26201B 0%, #121214 45%, #121212 100%); color: #fff; border-color: #1B1B1F; padding: 24px; }
.card.leaders::before { content: ''; position: absolute; inset: auto -10% -60% -10%; height: 80%; background: radial-gradient(closest-side, rgba(245, 130, 32, .28), transparent); pointer-events: none; }
.leaders .muted { color: #8E9098; }
.leaders .eyebrow { color: var(--accent); }
.leaders-head { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.leaders-head h2 { font-size: 24px; margin: 4px 0 2px; }
.leaders .seg { background: rgba(255, 255, 255, .08); }
.leaders .seg button { color: #A6A7AE; }
.leaders .seg button.on { background: var(--accent); color: #fff; box-shadow: none; }
.leaders .btn.ghost { border-color: rgba(255, 255, 255, .18); color: #fff; }
.leaders .btn.ghost:hover { background: rgba(255, 255, 255, .06); }
.leaders-empty { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 10px 26px; text-align: center; }
.leaders-empty .ic { color: var(--accent); opacity: .9; }
.leaders-empty b { font-size: 20px; }
.podium { position: relative; display: grid; grid-template-columns: 1fr 1.18fr 1fr; align-items: end; gap: 14px; max-width: 820px; margin: 26px auto 4px; }
.podium-card { --c: var(--accent); --c2: var(--accent-2); position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px 0; background: none; border: 0; color: #fff; text-align: center; opacity: 0; animation: podium-in .8s cubic-bezier(.2, .9, .3, 1.2) forwards; animation-delay: var(--d); }
.podium-card.gold { --c: var(--gold); --c2: var(--gold-2); }
.podium-card.silver { --c: var(--silver); --c2: var(--silver-2); }
.podium-card.bronze { --c: var(--bronze); --c2: var(--bronze-2); }
.podium-photo { position: relative; border-radius: 50%; padding: 4px; background: conic-gradient(from 200deg, var(--c2), var(--c), var(--c2), var(--c), var(--c2)); box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 10px 40px -8px var(--c); transition: transform .3s; }
.podium-photo .avatar { box-shadow: 0 0 0 3px #111; }
.podium-card:hover .podium-photo { transform: translateY(-4px) scale(1.03); }
.place-1 .podium-photo { animation: glow 3s ease-in-out infinite; animation-delay: 1.2s; }
.place-num { position: absolute; bottom: -4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--c2), var(--c)); color: #1A1305; font-style: normal; font-weight: 800; font-size: 14px; display: grid; place-items: center; box-shadow: 0 0 0 3px #111; }
.place-1 .place-num { width: 36px; height: 36px; font-size: 17px; right: 8px; }
.crown { color: var(--gold); filter: drop-shadow(0 0 12px rgba(232, 179, 58, .8)); margin-bottom: -10px; animation: crown 2.6s ease-in-out infinite; animation-delay: 1.2s; z-index: 1; }
.crown .ic { fill: var(--gold); stroke: var(--gold-2); }
.leader-tag { white-space: nowrap; margin-top: 6px; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #2A1E00; box-shadow: 0 6px 20px -6px var(--gold); }
.podium-name { margin-top: 6px; font-size: 15px; line-height: 1.25; }
.place-1 .podium-name { font-size: 18px; }
.podium-points { font-size: 13px; color: #C9CAD0; }
.podium-points b { font-size: 22px; color: var(--accent); margin-right: 2px; }
.place-1 .podium-points b { font-size: 28px; }
.podium-stats { display: flex; gap: 12px; font-size: 12.5px; color: #A6A7AE; }
.podium-stats b { color: #fff; }
.podium-base { margin-top: 12px; width: 100%; border-radius: 14px 14px 0 0; background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .02)); border: 1px solid rgba(255, 255, 255, .07); border-bottom: 0; display: grid; place-items: center; font-size: 28px; font-weight: 800; color: rgba(255, 255, 255, .14); }
.place-1 .podium-base { height: 72px; border-top: 2px solid var(--gold); background: linear-gradient(180deg, rgba(232, 179, 58, .18), rgba(255, 255, 255, .02)); }
.place-2 .podium-base { height: 52px; border-top: 2px solid var(--silver); }
.place-3 .podium-base { height: 38px; border-top: 2px solid var(--bronze); }
.leader-msg { position: relative; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding: 12px 16px; border-radius: 14px; background: rgba(245, 130, 32, .12); border: 1px solid rgba(245, 130, 32, .25); font-weight: 600; }
.leader-msg .ic { color: var(--accent); }
.leader-msg span { flex: 1; }

/* ---------- Главная ---------- */
.workday { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.workday.live { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.workday-info { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.workday-info .big { font-size: 22px; font-weight: 800; }
.done-mark { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 700; }
.grid-hero { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 16px; }
.kpi-hero-body { display: flex; align-items: center; gap: 24px; }
.kpi-lines { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.kpi-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.kpi-line b { font-size: 16px; } .kpi-line small { color: var(--muted); }
.kpi-line .progress { grid-column: 1 / -1; }
.money-card, .place-card { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.money-big { font-size: 32px; font-weight: 800; letter-spacing: -.02em; color: var(--accent-ink); }
.money-rows { display: flex; flex-direction: column; gap: 4px; width: 100%; font-size: 13px; color: var(--muted); }
.money-rows span { display: flex; justify-content: space-between; } .money-rows b { color: var(--text); }
.place-big { font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.place-big small { font-size: 16px; color: var(--muted); }
.ring { position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-bg { stroke: var(--surface-3); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.ring-val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-val b { font-size: 22px; font-weight: 800; }
.ring-val small { font-size: 11px; color: var(--muted); max-width: 80%; line-height: 1.2; }

/* ---------- KPI, графики ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi-main { grid-column: span 2; grid-row: span 2; display: flex; align-items: center; gap: 20px; }
.kpi-card { display: flex; flex-direction: column; gap: 8px; }
.kpi-card .progress-label { width: auto; text-align: left; }
.modal .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-title { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.bars { display: flex; align-items: stretch; gap: 0; padding-bottom: 22px; border-bottom: 1px solid var(--border); position: relative; }
.bar-col { display: flex; flex-direction: column; align-items: center; position: relative; padding: 0 6px; cursor: default; }
.bar-area { position: relative; flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar { width: min(36px, 70%); background: var(--graphite); border-radius: 4px 4px 0 0; transition: height .6s ease, background .15s; }
:root[data-theme="dark"] .bar { background: #8D8F97; }
.bar.hl { background: var(--accent) !important; }
.bar-col:hover .bar { filter: brightness(1.2); }
.bar-plan { position: absolute; left: 12%; right: 12%; height: 0; border-top: 2px dashed var(--text-2); }
.bar-x { position: absolute; bottom: -20px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ---------- Задачи ---------- */
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.task:last-child { border-bottom: 0; }
.task:hover b { color: var(--accent-ink); }
.task.done b, .task.cancelled b { color: var(--muted); text-decoration: line-through; }
.task-check { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--border-2); background: none; display: grid; place-items: center; color: transparent; flex: none; padding: 0; }
button.task-check:hover { border-color: var(--accent); color: var(--accent); }
.task-check.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.task.overdue .task-check { border-color: var(--bad); }
.task-title { margin: 12px 0 10px; }
.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.files a, .file-link { display: inline-flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-weight: 600; }
.comments { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.comments li { background: var(--surface-2); padding: 10px 14px; border-radius: 12px; }
.comments small { margin-left: 8px; }
.comments p { margin: 4px 0 0; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.timeline li { position: relative; display: flex; flex-direction: column; }
.timeline li::before { content: ''; position: absolute; left: -24px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.bulk-bar .check { margin-right: auto; align-items: center; }
.calc-result { display: flex; flex-direction: column; gap: 10px; background: linear-gradient(160deg, #18181B, #121212); color: #fff; border-color: #121212; }
.calc-result .eyebrow { color: #9C9DA4; }
.calc-result .money-big { color: var(--accent); font-size: 40px; }
.calc-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.calc-rows li { display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.calc-rows span { display: flex; flex-direction: column; } .calc-rows .muted { color: #8E9098; }

/* ---------- Команда и профиль ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.person { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.person:hover { border-color: var(--accent); transform: translateY(-1px); }
.person b { font-size: 15px; }
.app-card { display: flex; flex-direction: column; gap: 10px; }
.profile-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-hero h1 { font-size: 24px; }
.photo-edit { position: relative; }
.photo-btn { position: absolute; right: -2px; bottom: -2px; background: var(--accent); color: #fff; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); }
.photo-btn:hover { background: var(--accent-2); }
.sec-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.sec-row .grow small { font-size: 13px; }
.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.award { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 14px 10px; border-radius: 14px; background: linear-gradient(160deg, var(--accent-soft), transparent); border: 1px solid var(--border); }
button.award { cursor: pointer; }
.award .ic { color: var(--accent); }
.award b { font-size: 13px; line-height: 1.25; } .award small { color: var(--muted); font-size: 12px; }
.evals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.evals li { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.evals li:last-child { border-bottom: 0; }
.score { font-size: 20px; font-weight: 800; color: var(--accent-ink); }
.eval-grid { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; font-size: 13px; margin: 10px 0; }
.stars { color: var(--accent); letter-spacing: 1px; } .stars i { color: var(--border-2); font-style: normal; }
.eval-form { display: flex; flex-direction: column; gap: 10px; }
.eval-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rate { display: flex; gap: 6px; }
.rate label { cursor: pointer; }
.rate input { position: absolute; opacity: 0; }
.rate span { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border-2); display: grid; place-items: center; font-weight: 800; }
.rate input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-grid a, .more-grid button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px; border-radius: 14px; background: var(--surface-2); border: 0; text-align: center; font-size: 12.5px; font-weight: 700; }
.weights { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.weight { display: grid; grid-template-columns: 200px 1fr 30px; gap: 12px; align-items: center; font-size: 14px; }
.weight .progress > div { background: var(--accent); }
.weight-row { display: grid; grid-template-columns: 200px 1fr 36px; gap: 12px; align-items: center; font-size: 14px; }
.tb-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.tb-list li { padding: 6px 10px; border-radius: 10px; background: var(--surface-2); }
.tb-list li span { display: inline; }
.tb-list li { display: list-item; }
.tb-list li > * { vertical-align: middle; }
.tb-list .icon-btn { float: right; }
.rule { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--border); }
.rule .switch { flex: 1; min-width: 260px; align-items: center; }

/* ---------- Обучение ---------- */
.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.lib-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.lib-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.lib-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
video, .lib-img { width: 100%; border-radius: 12px; background: #000; margin: 10px 0; max-height: 480px; }
.test fieldset { border: 0; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 8px; }
.test legend { font-weight: 700; margin-bottom: 8px; }
.test .radio { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border-2); }
.test .radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.test-result { text-align: center; padding: 10px; }
.test-result b { font-size: 48px; font-weight: 800; color: var(--accent-ink); }
.test-result.failed b { color: var(--bad); }
.q-block { padding: 12px; border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.q-block .radio { align-items: center; }
.q-block .radio input[type=radio] { margin: 0; }
.test-builder { border-top: 1px solid var(--border); padding-top: 12px; }

/* ---------- Чат ---------- */
.chat { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 64px); }
.chat-list { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.chat-list-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px; }
.chat-list ul { list-style: none; margin: 0; padding: 0 8px 8px; overflow-y: auto; }
.ch { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; }
.ch:hover { background: var(--surface-2); }
.ch.on { background: var(--accent-soft); }
.ch b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.ch-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); font-weight: 800; color: var(--text-2); flex: none; }
.ch-icon.general { background: var(--accent); color: #fff; }
.ch-icon.leaders { background: var(--graphite); color: #fff; }
.unread { font-style: normal; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.chat-main { display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.chat-placeholder { flex: 1; display: grid; place-items: center; }
.conv-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--surface); }
.pinned { display: flex; align-items: center; gap: 10px; padding: 8px 18px; background: var(--accent-soft); font-size: 13px; }
.pinned .grow { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 78%; position: relative; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 16px 16px 16px 4px; padding: 8px 12px 6px; min-width: 80px; }
.msg.mine .bubble { background: var(--graphite); color: #fff; border-color: var(--graphite); border-radius: 16px 16px 4px 16px; }
:root[data-theme="dark"] .msg.mine .bubble { background: #3A2516; border-color: #4A2D18; }
.bubble p { margin: 0; overflow-wrap: anywhere; }
.bubble a { text-decoration: underline; }
.msg-author { display: block; font-size: 12px; color: var(--accent-ink); margin-bottom: 2px; }
.msg-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 11px; opacity: .6; margin-top: 2px; }
.msg-img { max-width: 260px; max-height: 260px; border-radius: 10px; display: block; margin-top: 4px; object-fit: cover; }
.msg-file { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(127, 127, 127, .12); margin-top: 4px; text-decoration: none !important; }
.msg-file small { opacity: .7; }
.reacts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.react { border: 1px solid var(--border-2); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; font-size: 12px; color: var(--text); }
.react.mine { border-color: var(--accent); background: var(--accent-soft); }
.msg-tools { display: none; gap: 2px; align-self: center; }
.msg:hover .msg-tools { display: flex; }
.react-pick { position: absolute; bottom: 100%; z-index: 5; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.react-pick button { border: 0; background: none; font-size: 18px; width: 34px; height: 34px; border-radius: 50%; }
.react-pick button:hover { background: var(--surface-3); }
.msg.deleted .bubble { opacity: .6; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.composer textarea { min-height: 44px; max-height: 140px; resize: none; }
.attach-name { font-size: 12px; color: var(--accent-ink); max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: center; }
.attach-name:empty { display: none; }
.pick-people { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }

/* ---------- Лента, мероприятия, уведомления ---------- */
.post { display: flex; flex-direction: column; gap: 10px; }
.post h2 { font-size: 19px; }
.post.pinned { border-color: var(--accent); }
.post.k-achievement, .post.k-congrats { background: linear-gradient(160deg, var(--accent-soft), var(--surface) 60%); }
.post-subject { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 4px 0; text-align: left; }
.post-subject b { font-size: 16px; }
.pill.k-achievement, .pill.k-congrats { background: var(--accent-soft); color: var(--accent-ink); }
.pill.k-announcement { background: var(--graphite); color: #fff; }
.grid-cal { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 14px; }
.cal-h { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-d { min-height: 92px; border-radius: 10px; background: var(--surface-2); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-d.empty { background: none; }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-n { font-size: 12px; font-weight: 800; color: var(--muted); }
.cal-d.today .cal-n { color: var(--accent-ink); }
.cal-e { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--graphite); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-e.k-training { background: var(--accent); }
.cal-e.k-holiday, .cal-e.k-corporate, .cal-e.k-teambuilding { background: #6D4AFF; }
.cal-b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notifs { list-style: none; margin: 0; padding: 0; }
.notifs li + li { border-top: 1px solid var(--border); }
.notifs li.unread { background: var(--accent-soft); border-radius: 12px; }
.notifs .list-row { padding: 12px 10px; align-items: flex-start; }
.notifs .grow small { font-size: 13px; }
.n-icon { width: 36px; height: 36px; border-radius: 11px; background: var(--surface-3); display: grid; place-items: center; flex: none; color: var(--accent-ink); }
.steps { margin: 0; padding-left: 20px; }
.cropper { position: relative; width: 280px; height: 280px; margin: 0 auto; border-radius: 16px; overflow: hidden; touch-action: none; cursor: grab; }
.cropper canvas { display: block; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 200px rgba(0, 0, 0, .45); pointer-events: none; border: 2px solid rgba(255, 255, 255, .8); }

/* ---------- Анимации ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } }
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-30px, -20px); } }
@keyframes podium-in { 0% { opacity: 0; transform: translateY(40px) scale(.9); } 100% { opacity: 1; transform: none; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 10px 40px -8px var(--c); } 50% { box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 0 60px 4px rgba(232, 179, 58, .55); } }
@keyframes crown { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-5px) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; } .podium-card { opacity: 1; } }

/* ---------- Адаптив ---------- */
@media (max-width: 1200px) {
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-hero { grid-template-columns: 1fr 1fr; }
  .grid-hero .kpi-hero { grid-column: 1 / -1; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-cal { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main-col { margin-left: 0; }
  .desktop-only { display: none !important; }
  .mobile-only { display: inline-flex !important; }
  .topbar { padding: 0 16px; height: 58px; }
  .topbar .brand { padding: 0; gap: 10px; }
  .topbar .brand b { font-size: 14px; letter-spacing: .08em; }
  .page { padding: 18px 16px 100px; gap: 14px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #121212; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid #1C1C20; }
  .bottom-nav a, .bottom-nav button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: #8A8B92; font-size: 10.5px; font-weight: 700; background: none; border: 0; }
  .bottom-nav a.on { color: #fff; }
  .bottom-nav a.on .ic { color: var(--accent); }
  .bottom-nav .nav-badge { position: absolute; top: 0; left: 55%; margin: 0; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { position: relative; height: auto; padding: 22px 20px; min-height: 0; }
  .auth-motto { display: none; }
  .auth-glow { width: 300px; height: 300px; right: -120px; bottom: -200px; }
  .chat { height: calc(100vh - 58px - 64px); grid-template-columns: 1fr; }
  .chat.has-active .chat-list { display: none; }
  .chat:not(.has-active) .chat-main { display: none; }
  .msg { max-width: 90%; }
  .msg-tools { display: flex; }
}
@media (max-width: 640px) {
  h1 { font-size: 22px; } .hello { font-size: 22px; }
  .grid2, .grid3, .grid-hero, .kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi-main { grid-column: auto; grid-row: auto; flex-direction: column; text-align: center; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 21px; }
  .card { padding: 16px; border-radius: 14px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .kv.cols { grid-template-columns: auto 1fr; }
  .page-head { align-items: flex-start; }
  .page-head .row { width: 100%; }
  .page-head .btn { flex: 1; }
  .workday { flex-direction: column; align-items: stretch; }
  .workday .btn.xl { width: 100%; }
  .kpi-hero-body { flex-direction: column; }
  .kpi-lines { width: 100%; }
  .card.leaders { padding: 18px 12px; }
  .leaders-head h2 { font-size: 20px; }
  .podium { gap: 6px; margin-top: 18px; }
  .podium-card .avatar { --s: 64px !important; }
  .podium-card.place-1 .avatar { --s: 88px !important; }
  .podium-name { font-size: 13px !important; }
  .podium-points b { font-size: 18px !important; }
  .podium-stats { flex-direction: column; gap: 0; font-size: 11.5px; }
  .leader-tag { font-size: 9.5px; padding: 3px 8px; letter-spacing: .08em; }
  .place-num { width: 24px; height: 24px; font-size: 12px; }
  .place-1 .place-num { width: 28px; height: 28px; font-size: 14px; }
  .modal-wrap { place-items: end center; padding: 0; }
  .modal { max-width: 100% !important; border-radius: 20px 20px 0 0; max-height: 92vh; }
  .modal-foot .btn { flex: 1; }
  .cal-d { min-height: 54px; padding: 4px; }
  .cal-e { font-size: 0; padding: 0; height: 6px; border-radius: 3px; }
  .cal-b { font-size: 0; } .cal-b::before { content: '🎂'; font-size: 11px; }
  .weight, .weight-row { grid-template-columns: 1fr 1fr 30px; }
  .people { grid-template-columns: 1fr; }
  .row select { min-width: 0; flex: 1; }
  .month-nav b { min-width: 0; }
  #toasts { left: 16px; right: 16px; max-width: none; }
}

/* ===================== v2: главная, медали, лента, альбом, челленджи, профиль ===================== */
.section-h { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.section-h .count, .count { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 8px; font-size: 12px; }
.bad-text { color: var(--bad); }
.logo-mark.sm { width: 28px; height: 28px; font-size: 11px; border-radius: 8px; }
.btn.ghost.light { border-color: rgba(255, 255, 255, .22); color: #fff; background: rgba(255, 255, 255, .04); }
.btn.ghost.light:hover { background: rgba(255, 255, 255, .1); }
.q-count { font-style: normal; background: var(--accent); color: #fff; border-radius: 9px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; display: inline-grid; place-items: center; }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll-x .chip { white-space: nowrap; }
.compact-empty { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.compact-empty > .ic { color: var(--accent); }
.compact-empty > span { flex: 1; min-width: 180px; }
.card.slim { padding: 14px 18px; }
.banner.slim { padding: 8px 14px; font-size: 13px; }

/* Приветствие */
.hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px 30px; border-radius: 20px; color: #fff;
  background: radial-gradient(120% 160% at 100% 0%, rgba(245, 130, 32, .55) 0%, rgba(245, 130, 32, .12) 32%, transparent 55%), linear-gradient(135deg, #262626 0%, #171717 70%); border: 1px solid #2C2C2C; }
.hero::after { content: ''; position: absolute; right: -60px; bottom: -90px; width: 300px; height: 300px; border-radius: 50%; border: 40px solid rgba(245, 130, 32, .08); pointer-events: none; }
.hero-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hero-date { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #F7B37A; }
.hero h1 { font-size: 30px; }
.hero-role { margin: 0; color: #C9CACF; font-weight: 600; }
.hero-motto { margin: 6px 0 0; color: #A3A4AA; font-size: 14px; max-width: 560px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.hero-me { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; flex: none; }
.hero-me .avatar.ring-accent { box-shadow: 0 0 0 3px #1E1E1E, 0 0 0 5px var(--accent), 0 10px 40px -10px rgba(245, 130, 32, .7); }
.hero-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: 12.5px; font-weight: 700; color: #DADADF; }
.hero-status i { width: 8px; height: 8px; border-radius: 50%; background: #8A8B92; }
.hero-status.live i { background: #4ADE80; box-shadow: 0 0 0 4px rgba(74, 222, 128, .2); }
.hero-status.warn i { background: #F0B23A; }
.hero-status.done i { background: var(--accent); }
.hero-link { font-size: 12.5px; color: #F7B37A; font-weight: 700; display: inline-flex; align-items: center; gap: 2px; }
.hero-alert { position: absolute; top: 14px; right: 18px; z-index: 2; display: none; }

/* KPI */
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; min-width: 0; }
.kpi-tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.kt-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 6px; }
.kt-label { font-size: 13px; color: var(--muted); font-weight: 700; }
.kt-value { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kt-value small { font-size: 14px; color: var(--muted); font-weight: 700; }
.kt-sub { font-size: 12.5px; color: var(--muted); }
.kt-sub b { color: var(--text); }
.kt-bar { height: 5px; border-radius: 5px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.kt-bar i { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
.kpi-tile.accent { background: linear-gradient(150deg, #262626, #171717); color: #fff; border-color: #2C2C2C; }
.kpi-tile.accent .kt-value { color: var(--accent); }
.kpi-tile.accent .kt-label, .kpi-tile.accent .kt-sub { color: #A3A4AA; }
.kpi-tile.accent .kt-bar { background: rgba(255, 255, 255, .1); }
.more-stats { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 4px 16px; }
.more-stats summary { cursor: pointer; list-style: none; padding: 10px 0; font-weight: 700; font-size: 14px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.more-stats summary::-webkit-details-marker { display: none; }
.more-stats summary .ic { transition: transform .2s; }
.more-stats[open] summary .ic { transform: rotate(90deg); }
.more-stats .stats { padding-bottom: 14px; }
.more-stats .stat { box-shadow: none; background: var(--surface-2); }
.mini-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.mini-tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.mini-tile .ic { grid-row: span 2; color: var(--accent-ink); }
.mini-tile span { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.mini-tile b { font-size: 20px; }
.mini-tile small { grid-column: 2; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-tile:hover { border-color: var(--accent); }

/* Сетка главной */
.home-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; align-items: start; }
.home-grid > * { min-width: 0; }
.hg-leaders { grid-column: span 4; }
.hg-attention { grid-column: span 2; }
.hg-feed { grid-column: span 4; }
.hg-challenge { grid-column: span 2; }
.hg-today, .hg-ach, .hg-album, .hg-events { grid-column: span 3; }
.attention .list-row { padding: 9px 2px; }
.all-good { display: flex; align-items: center; gap: 10px; color: var(--ok); padding: 6px 0; }
.all-good.big { padding: 18px 20px; font-size: 15px; }

/* Лидеры: компактное пустое состояние */
.card.leaders.is-empty { padding: 20px 22px; }
.leaders-compact { position: relative; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; min-height: 110px; }
.leaders-compact b { font-size: 19px; }
.lc-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: rgba(245, 130, 32, .14); color: var(--gold); box-shadow: 0 0 40px -6px rgba(232, 179, 58, .45); }
.lc-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.podium.n1 { grid-template-columns: 1fr; max-width: 320px; }
.podium.n2 { grid-template-columns: 1fr 1.18fr; max-width: 560px; }
.place-medal { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #1A1305; background: linear-gradient(135deg, var(--c2), var(--c)); }

/* Превью ленты */
.fp-list { display: flex; flex-direction: column; gap: 12px; }
.fp-item { display: flex; gap: 14px; padding: 12px; border-radius: 14px; background: var(--surface-2); transition: background .15s; }
.fp-item:hover { background: var(--surface-3); }
.fp-img { flex: none; width: 150px; height: 112px; border-radius: 12px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; }
.fp-img img { width: 100%; height: 100%; object-fit: cover; }
.fp-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.fp-author { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.fp-title { font-size: 15.5px; line-height: 1.3; }
.fp-text { font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fp-meta { display: flex; gap: 12px; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: auto; }
.fp-meta span { display: inline-flex; align-items: center; gap: 3px; }
.fp-open { margin-left: auto; color: var(--accent-ink); font-weight: 700; }

/* Челлендж */
.ch-banner { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-height: 130px; padding: 14px 16px; border-radius: 14px; overflow: hidden; color: #fff; background-size: cover; background-position: center;
  background-image: radial-gradient(120% 120% at 100% 0%, rgba(245, 130, 32, .75), transparent 60%), linear-gradient(135deg, #2E2E2E, #171717); }
.ch-banner.big { min-height: 200px; padding: 22px; border-radius: 16px; }
.ch-art { position: absolute; right: 16px; top: 14px; opacity: .35; }
.ch-when { align-self: flex-start; font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .45); margin-bottom: auto; }
.ch-title { font-size: 19px; line-height: 1.2; }
.ch-banner.big .ch-title { font-size: 26px; }
.ch-mode { font-size: 12.5px; color: #E5E5E8; }
.challenge-card { display: flex; flex-direction: column; gap: 12px; }
.challenge-card .btn { align-self: flex-start; }
.ch-goal { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.ch-goal b { color: var(--text); }
.progress.big { height: 10px; border-radius: 10px; }
.progress.big > div { background: var(--accent); }
.ch-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.ch-reward { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--accent-ink); }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.ch-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, border-color .15s; }
.ch-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.ch-card .ch-banner { border-radius: 0; min-height: 150px; }
.ch-body { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; }
.ch-detail { padding: 0; overflow: hidden; }
.ch-detail .ch-banner { border-radius: 0; }
.ch-detail .ch-body { padding: 20px; }
.ch-info p { margin: 4px 0 0; }
.ch-leaders { display: flex; gap: 10px; }
.chl { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--surface-2); font-size: 13px; }
.chl.gold { box-shadow: inset 0 0 0 2px var(--gold); } .chl.silver { box-shadow: inset 0 0 0 2px var(--silver); } .chl.bronze { box-shadow: inset 0 0 0 2px var(--bronze); }
.ch-templates { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Сегодня в команде */
.td-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.td-list > li + li { border-top: 1px solid var(--border); }
.td-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
a.td-row:hover b { color: var(--accent-ink); }
.td-row b { font-size: 14px; }
.td-row small { font-size: 12.5px; }
.td-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); flex: none; }
.td-icon.accent { background: var(--accent-soft); color: var(--accent-ink); }
.td-avatar { width: 34px; display: grid; place-items: center; flex: none; }
.stack-avatars { display: flex; margin-top: 4px; }
.stack-avatars .avatar { box-shadow: 0 0 0 2px var(--surface); }
.stack-avatars .avatar + .avatar { margin-left: -8px; }

/* Достижения и медали */
.medal { --ms: 56px; width: var(--ms); height: var(--ms); border-radius: 50%; display: inline-grid; place-items: center; flex: none; position: relative; color: #1A1305;
  background: radial-gradient(circle at 30% 25%, var(--m2), var(--m1) 70%); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), 0 0 0 3px var(--surface), 0 0 0 4px var(--m1), 0 6px 18px -6px var(--m1); }
.medal .ic { stroke-width: 2; }
.medal.c-gold { --m1: #E0A82E; --m2: #FFE7A3; }
.medal.c-silver { --m1: #A7AEB9; --m2: #F2F4F7; }
.medal.c-bronze { --m1: #B9733C; --m2: #F4C9A2; }
.medal.c-orange { --m1: #F58220; --m2: #FFC891; }
.medal.c-violet { --m1: #7C5CFF; --m2: #D5CAFF; color: #fff; }
.medal.c-green { --m1: #22A060; --m2: #A9EBC6; }
.medal.c-blue { --m1: #2F7DE1; --m2: #B5D4FF; color: #fff; }
.medal.locked { filter: grayscale(1); opacity: .35; }
.medal-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.medal-card { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 18px 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.medal-card.got { background: linear-gradient(180deg, var(--accent-soft), var(--surface-2) 70%); }
.medal-card.inactive { opacity: .5; }
.medal-card b { margin-top: 6px; font-size: 14.5px; }
.medal-card small { font-size: 12.5px; }
.medal-cond { font-size: 12px; color: var(--muted); border-top: 1px dashed var(--border-2); padding-top: 6px; margin-top: 2px; }
.medal-summary .big-num { font-size: 30px; font-weight: 800; }
.medal-summary .big-num small { font-size: 15px; color: var(--muted); }
.medal-summary .progress { margin-top: 14px; }
.ach-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ach-list > li + li { border-top: 1px solid var(--border); }
.ach-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.ach-row:hover b { color: var(--accent-ink); }
.ach-medal { display: flex; align-items: center; gap: 8px; max-width: 46%; }
.ach-medal small { font-size: 12.5px; font-weight: 700; }
.ach-list.big .grow small { color: var(--muted); }
.ach-card.slim p { margin: 0; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick input { position: absolute; opacity: 0; }
.icon-pick span { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border-2); display: grid; place-items: center; cursor: pointer; }
.icon-pick input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.medal-toast { position: fixed; left: 50%; bottom: 28px; z-index: 250; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 12px 20px 12px 12px; border-radius: 999px; background: #171717; color: #fff; box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .5), 0 0 0 1px rgba(245, 130, 32, .4); animation: medal-in .7s cubic-bezier(.2, .9, .3, 1.3); }
.medal-toast span { display: flex; flex-direction: column; }
.medal-toast small { color: #A3A4AA; }
.medal-toast .medal { animation: medal-spin 1.2s ease .2s; }
.medal-toast.out { opacity: 0; transform: translate(-50%, 20px); transition: all .4s; }
@keyframes medal-in { from { opacity: 0; transform: translate(-50%, 40px) scale(.8); } }
@keyframes medal-spin { 0% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }

/* Фотоальбом превью */
.ap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ap-grid a { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-3); }
.ap-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.ap-grid a:hover img { transform: scale(1.05); }

/* Лента */
.feed-page { max-width: 760px; }
.composer-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; }
.composer-card > span:nth-child(2) { flex: 1; color: var(--muted); padding: 10px 14px; border-radius: 999px; background: var(--surface-2); }
.post { display: flex; flex-direction: column; gap: 12px; }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-head .grow b { font-size: 15px; }
.post-head .grow small { font-size: 12.5px; }
.pin-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--accent-ink); }
.post-menu { display: flex; gap: 2px; }
.post-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.post-tags .pill.sm { margin: 0; }
.post-title { font-size: 20px; }
.post-title a:hover { color: var(--accent-ink); }
.post-body { margin: 0; white-space: normal; overflow-wrap: anywhere; }
.clamp4 { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post-images { display: grid; gap: 4px; border-radius: 14px; overflow: hidden; }
.post-images.n1 { grid-template-columns: 1fr; }
.post-images.n2 { grid-template-columns: 1fr 1fr; }
.post-images.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.post-images.n3 .post-img:first-child { grid-row: span 2; }
.post-images.n4 { grid-template-columns: 1fr 1fr; }
.post-img { position: relative; border: 0; padding: 0; background: var(--surface-3); cursor: zoom-in; overflow: hidden; aspect-ratio: 4 / 3; }
.post-images.n1 .post-img { aspect-ratio: auto; max-height: 520px; }
.post-images.n3 .post-img:first-child { aspect-ratio: auto; }
.post-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-images.n1 .post-img img { max-height: 520px; object-fit: contain; background: #111; }
.more-count { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .5); color: #fff; font-size: 26px; font-weight: 800; }
.post-subject { display: flex; align-items: center; gap: 14px; background: var(--surface-2); border: 0; border-radius: 14px; padding: 12px 14px; text-align: left; }
.post-subject span { display: flex; flex-direction: column; }
.post-subject b { font-size: 16px; }
.post-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; }
.post-stats { display: flex; align-items: center; gap: 14px; }
.link-btn.plain { color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.reactions { display: flex; gap: 6px; flex-wrap: wrap; }
.reaction { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); font-size: 14px; }
.reaction b { font-size: 12.5px; }
.reaction:hover { border-color: var(--accent); }
.reaction.mine { border-color: var(--accent); background: var(--accent-soft); }
.post-comments:empty { display: none; }
.comments.compact { gap: 10px; margin-bottom: 10px; }
.comments.compact li { display: flex; gap: 10px; background: none; padding: 0; align-items: flex-start; }
.comments.compact li > div { background: var(--surface-2); padding: 8px 12px; border-radius: 12px; flex: 1; min-width: 0; }
.comments.compact p { margin: 2px 0 0; overflow-wrap: anywhere; }
.comment-form { align-items: center; }
.comment-form input { flex: 1; }
.pill.k-results, .pill.k-summary { background: var(--ok-soft); color: var(--ok); }
.pill.k-birthday, .pill.k-photos { background: rgba(124, 92, 255, .14); color: #7C5CFF; }
.pill.k-project { background: rgba(47, 125, 225, .14); color: #2F7DE1; }
.img-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.img-pick [data-new] { display: contents; }
.ip-item, .ip-add { position: relative; width: 88px; height: 88px; border-radius: 12px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; }
.ip-item img { width: 100%; height: 100%; object-fit: cover; }
.ip-item button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; display: grid; place-items: center; padding: 0; }
.ip-add { border: 2px dashed var(--border-2); cursor: pointer; color: var(--muted); background: none; }

/* Лайтбокс */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(8, 8, 8, .94); display: flex; align-items: center; justify-content: center; gap: 16px; padding: 20px; animation: fade .15s; }
.lightbox figure { margin: 0; flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-width: 0; }
.lightbox figure img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; border-radius: 8px; }
.lightbox figcaption { color: #C9CACF; font-size: 13px; }
.lightbox figcaption a { color: var(--accent); }
.lb-close, .lb-prev, .lb-next { position: absolute; z-index: 2; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255, 255, 255, .2); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox:has(.lb-side) .lb-next { right: 396px; }
.lightbox:has(.lb-side) .lb-close { right: 396px; }
.lb-side { width: 360px; flex: none; align-self: stretch; background: var(--surface); color: var(--text); border-radius: 16px; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.lb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }

/* Альбомы */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.album-card { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.album-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.album-cover { position: relative; aspect-ratio: 4 / 3; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-cover i { position: absolute; left: 10px; bottom: 10px; font-style: normal; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .6); padding: 3px 9px; border-radius: 999px; }
.album-cover i.lock { left: auto; right: 10px; display: inline-flex; align-items: center; gap: 4px; }
.album-info { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.photo-cell { position: relative; aspect-ratio: 1; border: 0; padding: 0; overflow: hidden; border-radius: 10px; background: var(--surface-3); cursor: zoom-in; }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.photo-cell:hover img { transform: scale(1.04); }
.photo-cell.is-hidden img { opacity: .35; }
.ph-flag { position: absolute; left: 6px; top: 6px; font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .65); color: #fff; display: inline-flex; gap: 4px; align-items: center; }
.ph-flag.warn { background: var(--warn); }
.dec-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }

/* Профиль */
.profile-hero2 { position: relative; overflow: hidden; display: flex; align-items: center; gap: 28px; padding: 28px; border-radius: 20px; color: #fff; flex-wrap: wrap;
  background: radial-gradient(120% 160% at 0% 0%, rgba(245, 130, 32, .45), transparent 50%), linear-gradient(135deg, #262626, #171717); border: 1px solid #2C2C2C; }
.profile-hero2 .muted { color: #B5B6BC; }
.profile-hero2 h1 { font-size: 28px; }
.ph-photo { position: relative; flex: none; }
.ph-photo .avatar.ring-accent { box-shadow: 0 0 0 4px #1E1E1E, 0 0 0 6px var(--accent); }
.ph-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.ph-info p { margin: 0; }
.ph-stats { display: flex; gap: 22px; flex-wrap: wrap; margin: 8px 0 6px; }
.ph-stats span { display: flex; flex-direction: column; }
.ph-stats b { font-size: 24px; font-weight: 800; color: #fff; }
.ph-stats small { font-size: 12px; color: #A3A4AA; }
.profile-hero2 .btn.ghost { border-color: rgba(255, 255, 255, .22); color: #fff; }
.profile-hero2 .photo-btn { border-color: #1E1E1E; }
.settings-cols { align-items: start; }

/* Заработок */
.earn-hero { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; }
.earn-total { display: flex; flex-direction: column; gap: 10px; background: linear-gradient(150deg, #262626, #171717); color: #fff; border-color: #2C2C2C; }
.earn-total .eyebrow { color: #F7B37A; }
.earn-total .money-big { color: var(--accent); font-size: 38px; }
.earn-total .money-rows { color: #A3A4AA; } .earn-total .money-rows b { color: #fff; }
.earn-total .muted { color: #8E9098; }
.earn-status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.next-premium b { display: block; margin: 4px 0 10px; font-size: 16px; }
.kind-list { list-style: none; margin: 0; padding: 0; }
.kind-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.kind-list li:last-child { border-bottom: 0; }
.kind-list li.zero { color: var(--muted); }

/* Центр управления */
.dec-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.dec-chip { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.dec-chip:hover { border-color: var(--accent); }
.dec-chip b { font-size: 22px; color: var(--accent-ink); min-width: 32px; }
.dec-chip span { flex: 1; font-weight: 600; font-size: 14px; }

@media (max-width: 1200px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: 1fr 1fr; }
  .hg-leaders, .hg-feed { grid-column: 1 / -1; }
  .hg-attention, .hg-challenge, .hg-today, .hg-ach, .hg-album, .hg-events { grid-column: span 1; }
  .earn-hero { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .lightbox { flex-direction: column; padding: 60px 10px 10px; overflow-y: auto; }
  .lightbox figure { flex: none; height: auto; }
  .lightbox figure img { max-height: 60vh; }
  .lb-side { width: 100%; }
  .lightbox:has(.lb-side) .lb-next, .lightbox:has(.lb-side) .lb-close { right: 16px; }
  .lb-prev, .lb-next { top: 30vh; }
}
@media (max-width: 640px) {
  .hero { flex-direction: column-reverse; align-items: flex-start; padding: 20px; gap: 14px; }
  .hero h1 { font-size: 23px; }
  .hero-me { flex-direction: row; text-align: left; }
  .hero-me .avatar { --s: 56px !important; }
  .hero-link { display: none; }
  .hero-actions .btn { flex: 1 1 auto; }
  .kpi-row { gap: 10px; }
  .kpi-tile { padding: 14px; }
  .kt-value { font-size: 22px; }
  .kt-icon { width: 32px; height: 32px; margin-bottom: 2px; }
  .mini-tiles { grid-template-columns: 1fr; gap: 8px; }
  .home-grid { display: flex; flex-direction: column; gap: 14px; }
  .hg-attention { order: 1; } .hg-leaders { order: 2; } .hg-challenge { order: 3; } .hg-feed { order: 4; } .hg-today { order: 5; } .hg-ach { order: 6; } .hg-events { order: 7; } .hg-album { order: 8; }
  .fp-item { flex-direction: column; }
  .fp-img { width: 100%; height: 170px; }
  .leaders-compact { gap: 12px; }
  .profile-hero2 { padding: 20px; gap: 16px; flex-direction: column; align-items: flex-start; }
  .profile-hero2 h1 { font-size: 22px; }
  .ph-photo .avatar { --s: 96px !important; }
  .ph-stats { gap: 14px; }
  .ph-stats b { font-size: 19px; }
  .earn-status { grid-template-columns: 1fr 1fr; }
  .earn-total .money-big { font-size: 30px; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .album-grid, .ch-grid { grid-template-columns: 1fr; }
  .medal-gallery { grid-template-columns: repeat(2, 1fr); }
  .ap-grid { grid-template-columns: repeat(2, 1fr); }
  .post-title { font-size: 18px; }
  .ach-medal { max-width: 50%; }
  .ach-medal small { display: none; }
}
/* ---------- Исправления по итогам QA ---------- */
#toasts { top: 76px; }
.place-medal, .podium-points { white-space: nowrap; }
a[href^="tel:"] { white-space: nowrap; }
.kpi-tile.no-data .kt-value { font-size: 18px; color: var(--muted); font-weight: 700; }
.kpi-tile.accent.no-data .kt-value { color: #A3A4AA; }
@media (max-width: 640px) {
  #toasts { top: 70px; }
  .home-grid { align-items: stretch; }
  .home-grid > * { width: 100%; max-width: 100%; }
  .podium-points { font-size: 12px; }
  .place-medal { font-size: 10px; padding: 2px 7px; }
  /* таблица начислений превращается в карточки */
  .table.mobile-cards thead { display: none; }
  .table.mobile-cards, .table.mobile-cards tbody { display: block; }
  .table.mobile-cards tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .table.mobile-cards td { border: 0; padding: 0; }
  .table.mobile-cards td:empty { display: none; }
  .table.mobile-cards td.muted { flex-basis: 100%; order: 5; font-size: 13px; }
  .table.mobile-cards td.num { margin-left: auto; font-size: 16px; }
  .table.mobile-cards td.nowrap:last-child { flex-basis: 100%; order: 6; display: flex; gap: 6px; flex-wrap: wrap; }
}
/* ---------- Поиск ---------- */
.gsearch { position: relative; flex: 1; max-width: 520px; margin-left: 12px; }
.gs-field { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-2); color: var(--muted); cursor: text; }
.gs-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gs-field input { flex: 1; min-width: 0; border: 0 !important; background: none !important; box-shadow: none !important; min-height: 0 !important; padding: 0 !important; height: 100%; color: var(--text); outline: none; }
.gs-field input::-webkit-search-cancel-button { display: none; }
.gs-field kbd { font-family: var(--font); font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--border-2); border-radius: 6px; padding: 1px 6px; }
.gs-panel { display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: min(70vh, 560px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 50; }
.gsearch.open .gs-panel { display: block; }
.sr-group + .sr-group { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
.sr-head { display: flex; justify-content: space-between; padding: 6px 10px 4px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sr-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px; border: 0; background: none; text-align: left; color: var(--text); }
.sr-item:hover, .sr-item.active { background: var(--surface-2); }
.sr-item.active { box-shadow: inset 3px 0 0 var(--accent); }
.sr-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); flex: none; }
.sr-text { display: flex; flex-direction: column; min-width: 0; }
.sr-text b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-text small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-snippet { white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
mark { background: rgba(245, 130, 32, .28); color: inherit; border-radius: 3px; padding: 0 1px; }
.sr-all { display: flex; justify-content: center; align-items: center; gap: 4px; padding: 10px; margin-top: 6px; border-top: 1px solid var(--border); font-weight: 700; font-size: 13px; color: var(--accent-ink); }
.sr-empty, .sr-hint { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 12px; text-align: center; color: var(--muted); font-size: 13.5px; }
.sr-hint { flex-direction: row; justify-content: center; padding: 12px; font-size: 12.5px; }
.sr-empty b { color: var(--text); }
.sr-loading .loading { padding: 18px; }
.search-page-form { display: flex; gap: 8px; }
.search-page-form input { flex: 1; }
.sr-page { padding: 8px; }
.sr-page .sr-text b, .sr-page .sr-text small { white-space: normal; }

/* ---------- Благодарности ---------- */
.kudos-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.kudos-card { display: flex; flex-direction: column; gap: 10px; }
.kc-people { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kc-person { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.kc-person:hover b { color: var(--accent-ink); }
.kc-arrow { font-size: 20px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); }
.kc-cat { align-self: flex-start; }
.kc-msg { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.kc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.kudos-me .km-stats { display: flex; gap: 24px; margin: 10px 0; }
.kudos-me .km-stats span { display: flex; flex-direction: column; }
.kudos-me .km-stats b { font-size: 28px; font-weight: 800; color: var(--accent-ink); }
.kudos-me .km-stats small { font-size: 12px; color: var(--muted); }
.kudos-top { list-style: none; margin: 0; padding: 0; }
.kudos-top b .ic { color: var(--accent); vertical-align: -2px; }
.kudos-to { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.kudos-people { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin-top: 6px; border: 1px solid var(--border-2); border-radius: 12px; padding: 6px; }
.kp { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.kp input { position: absolute; opacity: 0; }
.kp span { display: flex; flex-direction: column; font-weight: 600; font-size: 14px; }
.kp small { font-weight: 500; color: var(--muted); font-size: 12px; }
.kp:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.kudos-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.kudos-cats input { position: absolute; opacity: 0; }
.kudos-cats span { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.kudos-cats input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.kudos-cats input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }

@media (max-width: 1200px) { .kudos-layout { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .gsearch { position: static; flex: 0; max-width: none; margin: 0; }
  .gsearch .gs-field { display: none; }
  .gsearch.open { position: fixed; inset: 0; z-index: 120; background: var(--bg); display: flex; flex-direction: column; padding: 10px 12px; }
  .gsearch.open .gs-field { display: flex; height: 46px; }
  .gsearch.open .gs-panel { position: static; flex: 1; max-height: none; margin-top: 10px; box-shadow: none; border: 0; padding: 0; background: none; }
}
/* ---------- Праздничные эффекты и подарки ---------- */
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 400; }
body.fx-shake #main { animation: fx-shake .5s ease; }
body { overflow-x: clip; }
@keyframes fx-shake { 0%, 100% { transform: none; } 20% { transform: translate(-6px, 2px); } 40% { transform: translate(6px, -2px); } 60% { transform: translate(-4px, 1px); } 80% { transform: translate(4px, 0); } }
.gift-reveal { position: fixed; inset: 0; z-index: 350; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 50% 38%, rgba(245, 130, 32, .32), rgba(12, 12, 12, .96) 62%); backdrop-filter: blur(8px); animation: fade .2s ease; }
.gift-reveal.out { opacity: 0; transition: opacity .25s; }
.gr-card { width: 100%; max-width: 400px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; color: #fff; }
.gr-stage { position: relative; width: 200px; height: 200px; cursor: pointer; }
.gr-box { position: absolute; left: 50%; bottom: 10px; width: 140px; height: 120px; transform: translateX(-50%); animation: gr-wiggle .25s ease-in-out infinite alternate; }
.gr-body { position: absolute; inset: 30px 0 0; border-radius: 10px; background: linear-gradient(90deg, transparent 43%, #FFE29A 43%, #FFE29A 57%, transparent 57%), linear-gradient(160deg, #FF9A3D, #F58220 60%, #C4620B); box-shadow: 0 20px 40px -10px rgba(245, 130, 32, .6); }
.gr-lid { position: absolute; left: -8px; right: -8px; top: 10px; height: 30px; border-radius: 8px; z-index: 1; background: linear-gradient(90deg, transparent 43%, #FFE29A 43%, #FFE29A 57%, transparent 57%), linear-gradient(160deg, #FFB060, #F58220); transition: transform .5s cubic-bezier(.3, 1.5, .5, 1), opacity .5s; }
.gr-lid::before, .gr-lid::after { content: ''; position: absolute; top: -22px; width: 34px; height: 26px; border: 6px solid #FFE29A; border-radius: 50% 50% 0 50%; }
.gr-lid::before { left: 32%; transform: rotate(-20deg); } .gr-lid::after { right: 32%; transform: scaleX(-1) rotate(-20deg); }
.gr-emoji { position: absolute; left: 50%; top: 50%; font-size: 120px; line-height: 1; transform: translate(-50%, -30%) scale(0); opacity: 0; transition: transform .6s cubic-bezier(.2, 1.6, .4, 1), opacity .3s; filter: drop-shadow(0 10px 30px rgba(245, 130, 32, .6)); }
.gr-text, .gr-actions { opacity: 0; transform: translateY(10px); transition: all .4s .35s; }
.gr-text h2 { font-size: 28px; margin: 4px 0; }
.gr-text .eyebrow { color: #F7B37A; }
.gr-text .muted { color: #C9CACF; margin: 0; }
.gr-msg { margin: 10px 0 0; font-size: 15px; font-style: italic; color: #fff; }
.gr-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.gr-actions .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
.gr-card.opened .gr-box { animation: none; }
.gr-card.opened .gr-lid { transform: translate(40px, -140px) rotate(35deg); opacity: 0; }
.gr-card.opened .gr-body { opacity: 0; transition: opacity .4s .2s; }
.gr-card.opened .gr-emoji { transform: translate(-50%, -50%) scale(1); opacity: 1; animation: gr-float 2.4s ease-in-out .6s infinite; }
.gr-card.opened .gr-text, .gr-card.opened .gr-actions { opacity: 1; transform: none; }
@keyframes gr-wiggle { from { transform: translateX(-50%) rotate(-4deg); } to { transform: translateX(-50%) rotate(4deg); } }
@keyframes gr-float { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -58%) scale(1.04); } }
.gift-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.gift-pick input { position: absolute; opacity: 0; }
.gift-pick span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--border-2); font-size: 12.5px; font-weight: 700; cursor: pointer; text-align: center; transition: transform .15s; }
.gift-pick i { font-style: normal; font-size: 32px; line-height: 1.1; }
.gift-pick small { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.gift-pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.04); }
.gift-pick input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.gift-shelf { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-radius: 14px; background: linear-gradient(180deg, var(--surface-2), var(--surface-3)); border-bottom: 6px solid var(--border-2); }
.gs-item { position: relative; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.gs-item i { font-style: normal; font-size: 30px; }
.gs-item b { position: absolute; right: -4px; bottom: -4px; font-size: 11px; background: var(--accent); color: #fff; border-radius: 9px; padding: 0 5px; }
.gift-list { list-style: none; margin: 12px 0 0; padding: 0; }
.gift-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.gift-row:last-child { border-bottom: 0; }
.gr-e { font-size: 30px; width: 44px; text-align: center; }
.gift-row .grow small { font-size: 12.5px; }
@media (prefers-reduced-motion: reduce) { .gr-box { animation: none; } .gr-card.opened .gr-emoji { animation: none; } }
/* Мобильный поиск: размытие шапки создаёт контейнер для position:fixed и «запирает» экран поиска в её высоте */
@media (max-width: 900px) {
  .topbar { backdrop-filter: none; background: var(--bg); }
  .gsearch.open { height: 100dvh; }
}
@media (max-width: 900px) { body.searching .bottom-nav { display: none; } }

/* ---------- Стикеры чата ---------- */
.composer { position: relative; }
.sticker-btn { font-size: 20px; }
.sticker-pick { position: absolute; bottom: calc(100% + 8px); left: 12px; z-index: 20; display: grid; grid-template-columns: repeat(4, 56px); gap: 4px; padding: 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: rise .15s ease; }
.sticker-pick button { width: 56px; height: 56px; border: 0; border-radius: 14px; background: none; font-size: 32px; display: grid; place-items: center; cursor: pointer; }
.sticker-pick button:hover { background: var(--surface-2); }
.sticker-pick button:hover span { animation-play-state: running; }
.sticker-pick span { display: inline-block; animation-play-state: paused; }
.bubble.is-sticker { background: none !important; border: 0 !important; padding: 0; min-width: 0; }
.msg.mine .bubble.is-sticker .msg-meta { justify-content: flex-end; color: var(--muted); opacity: 1; }
.bubble.is-sticker .msg-author { margin-left: 4px; }
.sticker { font-size: 72px; line-height: 1.1; padding: 4px 6px; user-select: none; }
.sticker span { display: inline-block; transform-origin: 50% 80%; }
/* у каждого стикера своя анимация; несколько циклов, затем покой */
.s-tiger span, .sticker.s-tiger span { animation: st-roar 1.1s ease-in-out 3; }
.s-fire span { animation: st-flicker .5s ease-in-out 8 alternate; }
.s-rocket span { animation: st-launch 1.6s ease-in-out 2; }
.s-party span { animation: st-pop .9s cubic-bezier(.2, 1.6, .4, 1) 3; }
.s-fireworks span { animation: st-glow 1s ease-in-out 3; }
.s-clap span { animation: st-clap .35s ease-in-out 8 alternate; }
.s-heart span { animation: st-beat 1s ease-in-out 4; }
.s-muscle span { animation: st-flex .6s ease-in-out 6 alternate; }
.s-thumbs span { animation: st-bounce .8s ease 3; }
.s-hundred span { animation: st-shake .5s ease-in-out 5; }
.s-trophy span { animation: st-shine 1.4s ease-in-out 3; }
.s-coffee span { animation: st-float 1.6s ease-in-out 3; }
.s-sloth span { animation: st-sway 2.4s ease-in-out 2; }
.s-laugh span { animation: st-laugh .3s ease-in-out 10 alternate; }
.s-handshake span { animation: st-shake-h .4s ease-in-out 6 alternate; }
.s-wow span { animation: st-pop 1s cubic-bezier(.2, 1.6, .4, 1) 3; }
@keyframes st-roar { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.25) rotate(-8deg); } 60% { transform: scale(1.15) rotate(8deg); } }
@keyframes st-flicker { from { transform: scale(1, 1) skewX(-3deg); filter: brightness(1); } to { transform: scale(1.08, 1.15) skewX(3deg); filter: brightness(1.25); } }
@keyframes st-launch { 0% { transform: translate(0, 0); } 40% { transform: translate(18px, -26px) rotate(-6deg); } 50% { transform: translate(18px, -26px) scale(.9); opacity: .2; } 51% { transform: translate(-18px, 26px); opacity: 0; } 100% { transform: translate(0, 0); opacity: 1; } }
@keyframes st-pop { 0% { transform: scale(.6) rotate(-10deg); } 60% { transform: scale(1.2) rotate(6deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes st-glow { 0%, 100% { filter: brightness(1) drop-shadow(0 0 0 transparent); transform: scale(1); } 50% { filter: brightness(1.4) drop-shadow(0 0 18px rgba(245, 130, 32, .8)); transform: scale(1.1); } }
@keyframes st-clap { from { transform: scale(1) rotate(-6deg); } to { transform: scale(.85) rotate(6deg); } }
@keyframes st-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } 45% { transform: scale(1.18); } }
@keyframes st-flex { from { transform: rotate(-8deg) scale(1); } to { transform: rotate(8deg) scale(1.12); } }
@keyframes st-bounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-18px); } 60% { transform: translateY(0) scale(1.1, .9); } }
@keyframes st-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg) scale(1.1); } 75% { transform: rotate(12deg) scale(1.1); } }
@keyframes st-shine { 0%, 100% { transform: rotate(0) scale(1); filter: brightness(1); } 50% { transform: rotate(-6deg) scale(1.12); filter: brightness(1.35) drop-shadow(0 0 14px rgba(232, 179, 58, .9)); } }
@keyframes st-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes st-sway { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }
@keyframes st-laugh { from { transform: rotate(-8deg) translateY(0); } to { transform: rotate(8deg) translateY(-4px); } }
@keyframes st-shake-h { from { transform: translateX(-4px) rotate(-4deg); } to { transform: translateX(4px) rotate(4deg); } }
@media (max-width: 640px) { .sticker { font-size: 60px; } .sticker-pick { grid-template-columns: repeat(4, 52px); left: 6px; } .sticker-pick button { width: 52px; height: 52px; font-size: 28px; } }
@media (prefers-reduced-motion: reduce) { .sticker span, .sticker-pick span { animation: none !important; } }