/* ════════════════════════════════════════════════════════════════════════
   Tokens
   ════════════════════════════════════════════════════════════════════════ */
:root {
  --bg: #07080c;
  --bg-2: #0c0e14;
  --surface: rgba(22, 25, 34, 0.72);
  --surface-solid: #151821;
  --surface-2: rgba(255, 255, 255, 0.045);
  --surface-3: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #f3f4f8;
  --text-2: #c2c6d3;
  --muted: #8a90a3;
  --faint: #5b6174;

  --accent: #8b6cff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(139, 108, 255, 0.16);
  --grad: linear-gradient(135deg, #8b6cff 0%, #5b8cff 50%, #22d3ee 100%);
  --grad-fire: linear-gradient(135deg, #ffb547 0%, #ff6a3d 55%, #ff3d77 100%);
  --fire: #ff7a3d;
  --good: #34d399;
  --good-soft: rgba(52, 211, 153, 0.14);
  --bad: #fb5a7a;
  --bad-soft: rgba(251, 90, 122, 0.14);
  --warn: #fbbf24;
  --gold: #ffd166;
  --silver: #c7d2e0;
  --bronze: #e8a26f;

  --heat-0: rgba(255, 255, 255, 0.05);
  --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.75);
  --glass-blur: saturate(160%) blur(22px);

  --r-xl: 24px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --gap: 12px;
  --pad: 16px;
  --nav-h: 66px;
  --safe-b: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
  --safe-t: var(--tg-content-safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f3f4f8;
  --bg-2: #eceef4;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --surface-2: rgba(15, 18, 30, 0.04);
  --surface-3: rgba(15, 18, 30, 0.07);
  --border: rgba(15, 18, 30, 0.07);
  --border-strong: rgba(15, 18, 30, 0.12);
  --text: #0e1018;
  --text-2: #353a4a;
  --muted: #6b7185;
  --faint: #a0a5b5;
  --accent: #6d4dff;
  --accent-2: #0891b2;
  --accent-soft: rgba(109, 77, 255, 0.1);
  --grad: linear-gradient(135deg, #6d4dff 0%, #4f7bff 50%, #0eb5d6 100%);
  --good: #059669;
  --good-soft: rgba(5, 150, 105, 0.1);
  --bad: #e11d48;
  --bad-soft: rgba(225, 29, 72, 0.09);
  --warn: #d97706;
  --gold: #e7a90d;
  --silver: #94a3b8;
  --bronze: #c2733f;
  --heat-0: rgba(15, 18, 30, 0.06);
  --shadow: 0 8px 30px -14px rgba(20, 24, 40, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(20, 24, 40, 0.3);
  color-scheme: light;
}

/* ════════════════════════════════════════════════════════════════════════
   Base
   ════════════════════════════════════════════════════════════════════════ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.45 "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  font-feature-settings: "tnum" 1, "ss01" 1;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
svg { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 24px; height: 24px; }

/* Ambient aurora behind everything */
.aurora { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.aurora i {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5;
  animation: drift 22s var(--ease) infinite alternate;
}
.aurora i:nth-child(1) { width: 380px; height: 380px; left: -140px; top: -170px; background: #6d4dff; }
.aurora i:nth-child(2) { width: 320px; height: 320px; right: -150px; top: -90px; background: #0ea5c6; opacity: .32; animation-delay: -7s; }
.aurora i:nth-child(3) { width: 280px; height: 280px; left: 30%; top: 340px; background: #c026d3; opacity: .12; animation-delay: -13s; }
:root[data-theme="light"] .aurora i { opacity: .18; }
:root[data-theme="light"] .aurora i:nth-child(3) { opacity: .06; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(40px, 30px, 0) scale(1.15); }
}

.view {
  position: relative; z-index: 1;
  max-width: 600px; margin: 0 auto;
  padding: calc(var(--safe-t) + 14px) var(--pad) calc(var(--nav-h) + var(--safe-b) + 32px);
  min-height: 100vh;
}
.page { animation: pageIn .42s var(--ease) both; }
.page.back { animation-name: pageBack; }
@keyframes pageIn { from { opacity: 0; transform: translate3d(18px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes pageBack { from { opacity: 0; transform: translate3d(-18px, 0, 0); } to { opacity: 1; transform: none; } }
.page.fade { animation-name: fadeUp; }
@keyframes fadeUp { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }

.stack > * + * { margin-top: var(--gap); }
.stagger > * { animation: fadeUp .5s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .00s; }
.stagger > *:nth-child(2) { animation-delay: .04s; }
.stagger > *:nth-child(3) { animation-delay: .08s; }
.stagger > *:nth-child(4) { animation-delay: .12s; }
.stagger > *:nth-child(5) { animation-delay: .16s; }
.stagger > *:nth-child(6) { animation-delay: .20s; }
.stagger > *:nth-child(7) { animation-delay: .24s; }
.stagger > *:nth-child(n+8) { animation-delay: .28s; }

/* ════════════════════════════════════════════════════════════════════════
   Header
   ════════════════════════════════════════════════════════════════════════ */
.head { display: flex; align-items: center; gap: 12px; margin: 4px 2px 18px; min-height: 44px; }
.head .titles { flex: 1; min-width: 0; }
.head h1 { margin: 0; font-size: 28px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.head .back-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
}
.head.small h1 { font-size: 24px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  transition: transform .15s var(--ease), background .2s;
}
.icon-btn:active { transform: scale(.92); }

/* ════════════════════════════════════════════════════════════════════════
   Cards
   ════════════════════════════════════════════════════════════════════════ */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.card.flush { padding: 6px; }
.card.tight { padding: 12px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; flex: 1; white-space: nowrap; }
.card-head .hint { color: var(--muted); font-size: 13px; }
.card-head .badge-ic {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.section-label {
  color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  margin: 22px 4px 10px;
}

.pressable { transition: transform .18s var(--ease), background .2s, border-color .2s; cursor: pointer; }
.pressable:active { transform: scale(.975); }

/* ════════════════════════════════════════════════════════════════════════
   Hero (profile)
   ════════════════════════════════════════════════════════════════════════ */
.hero { padding: 22px 18px 18px; overflow: hidden; text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 70% at 50% -10%, color-mix(in srgb, var(--tier) 30%, transparent), transparent 65%);
}
.hero > * { position: relative; }
.hero .name { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-top: 14px; word-break: break-word; }
.hero .uname { color: var(--muted); font-size: 14px; margin-top: 2px; }
.hero .chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

.ring-ava { position: relative; width: 112px; height: 112px; margin: 0 auto; }
.ring-ava svg.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring-ava .ring-track { stroke: var(--surface-3); }
.ring-ava .ring-fill { transition: stroke-dashoffset 1.4s var(--ease); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--tier) 60%, transparent)); }
.ring-ava > .ava, .ring-ava > .fr { position: absolute; inset: 11px; }
.ring-ava > .fr > .ava { width: 100%; height: 100%; }
.ring-ava .lvl-pin {
  position: absolute; right: 2px; bottom: 2px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: 17px;
  background: var(--surface-solid); border: 2px solid var(--tier);
  box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--tier) 70%, transparent);
}

.lvl-progress { margin-top: 18px; text-align: left; }
.lvl-progress .row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.lvl-progress .row b { color: var(--text); font-weight: 700; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 8px 0 6px; }
.bar > i {
  display: block; height: 100%; border-radius: inherit; width: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tier, var(--accent)) 70%, #fff 0%), var(--tier, var(--accent)));
  box-shadow: 0 0 12px color-mix(in srgb, var(--tier, var(--accent)) 55%, transparent);
  transition: width 1.2s var(--ease);
}
.bar.grad > i { background: var(--grad); }
.bar.fire > i { background: var(--grad-fire); box-shadow: 0 0 12px rgba(255, 106, 61, .45); }

/* ════════════════════════════════════════════════════════════════════════
   Chips, badges, pills
   ════════════════════════════════════════════════════════════════════════ */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px;
  border-radius: 99px; font-size: 12.5px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  white-space: nowrap;
}
.chip.tier { background: color-mix(in srgb, var(--tier) 16%, transparent); border-color: color-mix(in srgb, var(--tier) 35%, transparent); color: var(--text); }
.chip.role-super { background: linear-gradient(135deg, rgba(255, 209, 102, .2), rgba(255, 122, 61, .18)); border-color: rgba(255, 209, 102, .4); color: var(--gold); }
.chip.role-admin { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }
.chip.role-moderator { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, transparent); color: var(--good); }
.chip.ok { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.off { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.mini-badge {
  display: inline-grid; place-items: center; height: 18px; padding: 0 6px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em; vertical-align: 2px; margin-left: 6px;
}
.mini-badge.mod { background: var(--good-soft); color: var(--good); }
.mini-badge.adm { background: var(--accent-soft); color: var(--accent); }
.mini-badge.sup { background: rgba(255, 209, 102, .16); color: var(--gold); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.on { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.dot.off { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }

/* ════════════════════════════════════════════════════════════════════════
   Stats grid
   ════════════════════════════════════════════════════════════════════════ */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 14px; min-height: 108px; display: flex; flex-direction: column; }
.stat .top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .top .ic-wrap { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--c, var(--accent)); }
.stat .val { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; margin-top: auto; padding-top: 8px; line-height: 1.05; }
.stat .val small { font-size: 15px; font-weight: 700; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.stat .foot { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.up { color: var(--good) !important; }
.down { color: var(--bad) !important; }
.stat.fire .val { background: var(--grad-fire); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* KPI strip */
.kpi { padding: 14px; }
.kpi .lbl { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .num { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; margin-top: 6px; }
.kpi .delta { font-size: 12px; font-weight: 600; margin-top: 2px; }

/* Big hero number */
.big-hero { padding: 20px 18px; overflow: hidden; }
.big-hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: var(--grad); filter: blur(60px); opacity: .28; pointer-events: none;
}
.big-hero .lbl { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.big-hero .num { font-size: 46px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; margin: 10px 0 8px; }
.big-hero .num.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big-hero .meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-2); font-size: 13.5px; }
.big-hero .meta span { display: inline-flex; gap: 6px; align-items: center; }

/* ════════════════════════════════════════════════════════════════════════
   Streak
   ════════════════════════════════════════════════════════════════════════ */
.streak-card .flame {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 24px;
  background: linear-gradient(135deg, rgba(255, 181, 71, .2), rgba(255, 61, 119, .18));
}
.streak-card .flame.cold { filter: grayscale(1); opacity: .55; }
.streak-card .s-title { font-weight: 700; font-size: 16px; }
.streak-card .s-sub { color: var(--muted); font-size: 13px; }
.days-row { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin-top: 14px; }
.days-row i {
  height: 26px; border-radius: 7px; background: var(--surface-3); position: relative;
}
.days-row i.part { background: rgba(255, 122, 61, .28); }
.days-row i.full { background: var(--grad-fire); box-shadow: 0 2px 10px -2px rgba(255, 106, 61, .5); }
.days-row i.today { outline: 2px solid var(--text); outline-offset: 1.5px; }
.days-lbl { display: flex; justify-content: space-between; color: var(--faint); font-size: 11px; margin-top: 6px; }

/* ════════════════════════════════════════════════════════════════════════
   Segmented control & scroll chips
   ════════════════════════════════════════════════════════════════════════ */
.seg {
  display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
  position: relative;
}
.seg button {
  position: relative; z-index: 1; height: 28px; padding: 0 10px; border-radius: 9px; white-space: nowrap;
  font-size: 13px; font-weight: 600; color: var(--muted); transition: color .2s;
}
.seg button.on { color: var(--text); background: var(--surface-3); box-shadow: 0 1px 6px -2px rgba(0, 0, 0, .35); }
:root[data-theme="light"] .seg button.on { background: #fff; }

.hscroll {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--pad)); padding: 2px var(--pad) 4px;
  scroll-snap-type: x proximity; scroll-padding-inline: var(--pad);
}
.hscroll::-webkit-scrollbar { display: none; }
.hs-wrap { position: relative; margin: 0 calc(-1 * var(--pad)); }
.hs-wrap > .hscroll { margin: 0; }
.hs-arrow {
  position: absolute; top: 0; bottom: 4px; z-index: 2; width: 52px; display: flex; align-items: center;
  color: var(--text); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease);
}
.hs-arrow.on { opacity: 1; pointer-events: auto; }
.hs-arrow.l { left: 0; justify-content: flex-start; padding-left: 8px; }
.hs-arrow.r { right: 0; justify-content: flex-end; padding-right: 8px; }
.hs-wrap.hs-fl > .hscroll { -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 20px, #000 64px); mask-image: linear-gradient(90deg, transparent 0, transparent 20px, #000 64px); }
.hs-wrap.hs-fr > .hscroll { -webkit-mask-image: linear-gradient(270deg, transparent 0, transparent 20px, #000 64px); mask-image: linear-gradient(270deg, transparent 0, transparent 20px, #000 64px); }
.hs-wrap.hs-fl.hs-fr > .hscroll { -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 20px, #000 64px, #000 calc(100% - 64px), transparent calc(100% - 20px)); mask-image: linear-gradient(90deg, transparent 0, transparent 20px, #000 64px, #000 calc(100% - 64px), transparent calc(100% - 20px)); }
.hs-arrow .ic {
  width: 30px; height: 30px; padding: 7px; border-radius: 50%; box-sizing: border-box; stroke-width: 2.4;
  background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  transition: transform .15s var(--ease);
}
.hs-arrow:active .ic { transform: scale(.88); }
.tab-chip {
  flex: none; height: 38px; padding: 0 15px; border-radius: 12px; display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-weight: 600; font-size: 14px;
  scroll-snap-align: start; transition: all .25s var(--ease);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.tab-chip.on { background: var(--text); color: var(--bg); border-color: transparent; }
.tab-chip .cnt { font-size: 12px; opacity: .6; }

/* ════════════════════════════════════════════════════════════════════════
   Charts
   ════════════════════════════════════════════════════════════════════════ */
.chart { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart svg { width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .axis { fill: var(--faint); font-size: 10.5px; font-family: inherit; }
.chart .line { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart .line.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.2s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .area { opacity: 0; animation: fadeIn .9s .25s var(--ease) forwards; }
@keyframes fadeIn { to { opacity: 1; } }
.chart .bar-rect { transform-origin: bottom; transform-box: fill-box; animation: grow .7s var(--ease) both; }
@keyframes grow { from { transform: scaleY(0); } }
.chart .cursor { stroke: var(--border-strong); stroke-width: 1; }
.chart .cursor-dot { stroke: var(--surface-solid); stroke-width: 2.5; }
.tip {
  position: absolute; top: -6px; pointer-events: none; transform: translate(-50%, -100%);
  background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 6px 9px; font-size: 12px; white-space: nowrap; box-shadow: var(--shadow-lg);
  opacity: 0; transition: opacity .15s;
}
.tip.on { opacity: 1; }
.tip b { font-size: 13px; }
.tip .d { color: var(--muted); }
.tip .k { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; vertical-align: 0; }
.chart-sum { display: flex; align-items: baseline; gap: 8px; margin: -4px 0 12px; }
.chart-sum .n { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.chart-sum .d { font-size: 13px; font-weight: 600; }
.chart-sum .l { color: var(--muted); font-size: 13px; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }

/* Heatmap */
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, var(--cell)); gap: var(--hgap); justify-content: start; }
.heat i { width: var(--cell); height: var(--cell); border-radius: 3.5px; background: var(--heat-0); transition: transform .15s; }
.heat i.l1 { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.heat i.l2 { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.heat i.l3 { background: color-mix(in srgb, var(--accent) 80%, transparent); }
.heat i.l4 { background: var(--accent-2); box-shadow: 0 0 8px -1px color-mix(in srgb, var(--accent-2) 70%, transparent); }
.heat i.sel { outline: 2px solid var(--text); outline-offset: 1px; }
.heat i.fut { visibility: hidden; }
.heat-months { display: grid; grid-auto-flow: column; gap: var(--hgap); justify-content: start; color: var(--faint); font-size: 10.5px; height: 16px; }
.heat-months span { width: var(--cell); overflow: visible; white-space: nowrap; }
.heat-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 12.5px; color: var(--muted); min-height: 18px; }
.heat-scale { display: flex; gap: 3px; align-items: center; }
.heat-scale i { width: 11px; height: 11px; border-radius: 3px; }

/* Horizontal distribution bars */
.dist-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; }
.dist-row .e { font-size: 18px; text-align: center; }
.dist-row .t { font-size: 13.5px; font-weight: 600; }
.dist-row .t small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.dist-row .n { font-size: 13px; color: var(--text-2); font-weight: 600; min-width: 42px; text-align: right; }
.dist-row .bar { margin: 5px 0 0; height: 6px; }
.dist-row.me .t { color: var(--accent); }

/* ════════════════════════════════════════════════════════════════════════
   Lists
   ════════════════════════════════════════════════════════════════════════ */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-md); min-height: 58px;
  transition: background .2s, transform .18s var(--ease);
}
.row.pressable:active { background: var(--surface-2); }
.row + .row { position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 62px; right: 10px; height: 1px; background: var(--border); }
.row .main { flex: 1; min-width: 0; }
.row .t1 { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t2 { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row .end { text-align: right; flex: none; }
.row .end .v { font-weight: 700; font-size: 15px; }
.row .end .s { color: var(--muted); font-size: 12px; }
.row .chev { color: var(--faint); }
.row.me { background: var(--accent-soft); }
.row.me::before, .row.me + .row::before { display: none; }
.rank { width: 26px; text-align: center; font-weight: 700; color: var(--muted); font-size: 14px; flex: none; }

.info-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; }
.info-row + .info-row { border-top: 1px solid var(--border); }
.info-row .ii { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--c, var(--accent)); flex: none; font-size: 17px; }
.info-row .il { flex: 1; min-width: 0; }
.info-row .il .a { font-size: 14px; font-weight: 600; }
.info-row .il .b { font-size: 12.5px; color: var(--muted); }
.info-row .iv { font-weight: 700; text-align: right; }
.info-row .iv small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }

/* Avatars */
.ava {
  --s: 42px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; position: relative; overflow: hidden;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: calc(var(--s) * .38);
  background: linear-gradient(135deg, hsl(var(--h) 75% 62%), hsl(calc(var(--h) + 40) 70% 48%));
  letter-spacing: -0.02em;
}
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.ava img.ok { opacity: 1; }

/* Podium */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 8px; align-items: end; margin: 6px 0 14px; }
.pod { text-align: center; padding: 14px 6px 12px; border-radius: var(--r-lg); position: relative; }
.pod .ava { margin: 0 auto; box-shadow: 0 0 0 3px var(--surface-solid), 0 0 0 5px var(--m); }
.pod .medal { position: absolute; left: 50%; transform: translateX(-50%); top: -10px; font-size: 22px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35)); }
.pod .pn { font-weight: 700; font-size: 13.5px; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod .pv { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.pod .pu { font-size: 11.5px; color: var(--muted); }
.pod.p1 { --m: var(--gold); padding-top: 22px; background: linear-gradient(180deg, rgba(255, 209, 102, .16), transparent 80%), var(--surface); }
.pod.p2 { --m: var(--silver); }
.pod.p3 { --m: var(--bronze); }
.pod.p1 .pv { color: var(--gold); }

.me-bar {
  position: fixed; left: 0; right: 0; margin: 0 auto; width: min(568px, calc(100% - 32px));
  bottom: calc(var(--nav-h) + var(--safe-b) + 22px); z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px;
  background: color-mix(in srgb, var(--surface-solid) 85%, transparent); border: 1px solid var(--border-strong);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-lg); animation: fadeUp .45s .2s var(--ease) both;
}
.me-bar .rk { font-weight: 800; font-size: 17px; }
.me-bar .lbl { flex: 1; color: var(--muted); font-size: 13px; }
.me-bar .v { font-weight: 800; }

/* Achievements */
.ach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ach {
  border-radius: 16px; padding: 12px 8px 10px; text-align: center; background: var(--surface-2); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.ach .ai { font-size: 28px; line-height: 1; height: 34px; display: grid; place-items: center; }
.ach .at { font-size: 12px; font-weight: 700; margin-top: 6px; line-height: 1.2; }
.ach .ad { font-size: 10.5px; color: var(--muted); margin-top: 3px; line-height: 1.25; }
.ach.on { background: linear-gradient(160deg, var(--accent-soft), transparent 70%), var(--surface-2); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.ach.off .ai { filter: grayscale(1); opacity: .35; }
.ach.off .at { color: var(--muted); }
.ach .ap { height: 3px; border-radius: 3px; background: var(--surface-3); margin: 8px 6px 0; overflow: hidden; }
.ach .ap i { display: block; height: 100%; background: var(--grad); border-radius: inherit; }

/* Admin tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { padding: 14px; min-height: 104px; display: flex; flex-direction: column; overflow: hidden; }
.tile .ti {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: var(--tg, var(--grad)); box-shadow: 0 8px 18px -8px var(--tc, rgba(139, 108, 255, .7));
}
.tile .tt { font-weight: 700; font-size: 15px; margin-top: auto; padding-top: 12px; }
.tile .ts { color: var(--muted); font-size: 12.5px; margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.tile::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%;
  background: var(--tc, var(--accent)); opacity: .09; filter: blur(14px);
}

/* Search */
.search {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 15px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--text); font-size: 15px; }
.search input::placeholder { color: var(--muted); }
.sticky-top {
  position: sticky; top: 0; z-index: 10; margin: 0 calc(-1 * var(--pad)); padding: 8px var(--pad) 10px;
  background: linear-gradient(var(--bg) 70%, transparent);
}

/* ════════════════════════════════════════════════════════════════════════
   Forms
   ════════════════════════════════════════════════════════════════════════ */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 2px 7px; }
.input, .textarea {
  width: 100%; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border-strong);
  padding: 13px 14px; font-size: 16px; color: var(--text); outline: 0; transition: border-color .2s, box-shadow .2s;
}
.input:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
.input.num { font-size: 28px; font-weight: 800; text-align: center; letter-spacing: -0.02em; padding: 14px; }
.field .help { font-size: 12.5px; color: var(--muted); margin: 7px 2px 0; }

.btn {
  height: 50px; border-radius: 15px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 15.5px; width: 100%;
  background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(109, 77, 255, .8);
  transition: transform .15s var(--ease), opacity .2s, filter .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); box-shadow: none; }
.btn.danger { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.btn.sm { height: 38px; border-radius: 12px; font-size: 14px; width: auto; padding: 0 14px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn.ghost.loading::after, .btn.danger.loading::after { border-color: var(--surface-3); border-top-color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.presets button { height: 34px; padding: 0 13px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; font-size: 13.5px; color: var(--text-2); }
.presets button:active { background: var(--surface-3); }
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: 10px; align-items: center; }
.stepper button { height: 56px; border-radius: 15px; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 22px; font-weight: 700; }
.stepper button:active { transform: scale(.94); }

/* Switch */
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background .25s; }
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .3s var(--spring);
}
.switch input:checked + i { background: var(--good); }
.switch input:checked + i::after { transform: translateX(20px); }

.set-row { display: flex; align-items: center; gap: 12px; padding: 13px 4px; }
.set-row + .set-row { border-top: 1px solid var(--border); }
.set-row .sl { flex: 1; min-width: 0; }
.set-row .sl .a { font-weight: 600; font-size: 15px; }
.set-row .sl .b { color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.35; }
.set-row .pill {
  height: 34px; min-width: 64px; padding: 0 12px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border-strong); font-weight: 700; font-size: 14px;
}
.set-row .pill .ic { width: 14px; height: 14px; color: var(--muted); }

/* Word chips (banwords) */
.words { display: flex; flex-wrap: wrap; gap: 7px; }
.word {
  display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 6px 0 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; font-weight: 500;
  animation: fadeUp .3s var(--ease) both;
}
.word button { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--muted); }
.word button:active { background: var(--bad-soft); color: var(--bad); }
.word.gone { animation: pop .25s var(--ease) forwards; }
@keyframes pop { to { opacity: 0; transform: scale(.6); } }

/* Autoreply cards */
.ar-card .ar-top { display: flex; align-items: center; gap: 10px; }
.ar-card .ar-name { font-weight: 700; font-size: 15.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ar-card .ar-kw { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 8px; }
.ar-card .ar-kw span { font-size: 12px; padding: 3px 8px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ar-card .ar-reply {
  font-size: 13.5px; color: var(--text-2); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word;
  border-left: 3px solid var(--accent); max-height: 5.8em; overflow: hidden;
}
.ar-card.disabled { opacity: .55; }

/* Audit timeline */
.tl { position: relative; padding-left: 4px; }
.tl-item { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.tl-item:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 46px; bottom: -4px; width: 2px; background: var(--border); }
.tl-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); flex: none; font-size: 16px; }
.tl-body { flex: 1; min-width: 0; padding-top: 1px; }
.tl-body .a { font-size: 14px; line-height: 1.35; word-break: break-word; }
.tl-body .a b { font-weight: 700; }
.tl-body .b { color: var(--muted); font-size: 12px; margin-top: 3px; }
.tl-day { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; margin: 14px 0 4px; }

/* ════════════════════════════════════════════════════════════════════════
   Bottom nav
   ════════════════════════════════════════════════════════════════════════ */
.nav {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 12px); width: min(560px, calc(100% - 24px)); height: var(--nav-h);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px; border-radius: 24px;
  background: color-mix(in srgb, var(--surface-solid) 78%, transparent); border: 1px solid var(--border-strong);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-lg);
  animation: navIn .6s .1s var(--spring) both;
}
@keyframes navIn { from { transform: translate(-50%, 120%); } to { transform: translate(-50%, 0); } }
.nav .ind {
  position: absolute; top: 6px; bottom: 6px; left: 6px; border-radius: 18px; background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  transition: transform .45s var(--spring), width .3s var(--ease);
}
.nav button {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 11px; font-weight: 600; transition: color .25s;
}
.nav button .ic { width: 22px; height: 22px; transition: transform .35s var(--spring); }
.nav button.on { color: var(--accent); }
.nav button.on .ic { transform: translateY(-1px) scale(1.08); }
.nav button:active .ic { transform: scale(.85); }

/* ════════════════════════════════════════════════════════════════════════
   Sheet & toast
   ════════════════════════════════════════════════════════════════════════ */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fadeIn .25s forwards; opacity: 0; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 600px; max-height: 88vh; overflow-y: auto;
  background: var(--surface-solid); border-radius: 26px 26px 0 0; border: 1px solid var(--border-strong); border-bottom: 0;
  padding: 10px 18px calc(var(--safe-b) + 18px); box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .6);
  animation: sheetUp .42s var(--ease) both;
}
.sheet-wrap.closing .sheet { animation: sheetDown .28s var(--ease) forwards; }
.sheet-wrap.closing .sheet-bg { animation: fadeOut .28s forwards; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { to { transform: translateY(100%); } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 0 auto 14px; }
.sheet h2 { margin: 0 0 4px; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.sheet .sheet-sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

#toast-root { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 12px); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px; max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 16px;
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent); border: 1px solid var(--border-strong);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600;
  animation: toastIn .4s var(--spring) both;
}
.toast.out { animation: toastOut .25s var(--ease) forwards; }
.toast .ti { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.toast.ok .ti { background: var(--good-soft); color: var(--good); }
.toast.err .ti { background: var(--bad-soft); color: var(--bad); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

/* ════════════════════════════════════════════════════════════════════════
   Empty / error / skeleton
   ════════════════════════════════════════════════════════════════════════ */
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty .ei { font-size: 46px; margin-bottom: 10px; }
.empty .et { color: var(--text); font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.empty .ed { font-size: 14px; max-width: 300px; margin: 0 auto; }
.empty .btn { margin-top: 18px; width: auto; }

.sk { background: var(--surface-2); border-radius: 12px; position: relative; overflow: hidden; }
.sk::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
  animation: shimmer 1.3s infinite;
}
:root[data-theme="light"] .sk::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }

.boot { min-height: 70vh; display: grid; place-items: center; }
.loader { width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(from 0deg, transparent, var(--accent), var(--accent-2)); -webkit-mask: radial-gradient(circle, transparent 55%, #000 57%); mask: radial-gradient(circle, transparent 55%, #000 57%); animation: spin .9s linear infinite; }

.more-btn { display: block; margin: 12px auto 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex1 { flex: 1; min-width: 0; }
.tag-note { font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.45; }
.copy { display: inline-flex; align-items: center; gap: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; padding: 4px 9px; border-radius: 8px; background: var(--surface-2); }

@media (max-width: 400px) {
  .seg button { padding: 0 8px; font-size: 12.5px; }
}
@media (max-width: 360px) {
  .stat .val { font-size: 23px; }
  .head h1 { font-size: 25px; }
  .ach-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Часы активности ─────────────────────────────────────────────────────── */
.chrono { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface-2); margin-bottom: 14px; }
.chrono .ce { font-size: 30px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); }
.chrono .ct { font-weight: 800; font-size: 17px; }
.chrono .cd { color: var(--muted); font-size: 12.5px; }
.chrono .cp { text-align: right; }
.chrono .cp .v { font-weight: 800; font-size: 18px; }
.chrono .cp .s { color: var(--muted); font-size: 11.5px; }
.hgrid { display: grid; grid-template-columns: 20px repeat(24, 1fr); gap: 2px; align-items: center; }
.hgrid .hl { font-size: 9.5px; color: var(--faint); white-space: nowrap; overflow: visible; line-height: 1; }
.hgrid .hl.d { font-size: 10px; }
.hgrid i { aspect-ratio: 1; border-radius: 3px; background: var(--heat-0); cursor: pointer; }
.hgrid i.l1 { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.hgrid i.l2 { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.hgrid i.l3 { background: color-mix(in srgb, var(--accent) 80%, transparent); }
.hgrid i.l4 { background: var(--accent-2); }
.hgrid i.sel { outline: 2px solid var(--text); outline-offset: 1px; }

/* ── Модерация ───────────────────────────────────────────────────────────── */
.modbox { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.mod-head { margin-bottom: 10px; }
.mod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mod-grid .btn.sm { width: 100%; padding: 0 8px; font-size: 13.5px; }
.mod-grid .btn.danger-t { color: var(--bad); }
.btn.danger-solid { background: linear-gradient(135deg, #fb5a7a, #e11d48); box-shadow: 0 10px 24px -10px rgba(225, 29, 72, .8); }
.presets button.on { background: var(--text); color: var(--bg); border-color: transparent; }

/* ── Банворды: режим и проверка ──────────────────────────────────────────── */
.word .wt { display: inline-flex; align-items: center; gap: 3px; height: 100%; font-weight: 500; font-size: 14px; color: inherit; width: auto; }
.word.partial { border-style: dashed; border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.wm { color: var(--warn); font-weight: 800; }
.test-res { margin-top: 12px; padding: 11px 13px; border-radius: 13px; font-size: 14px; font-weight: 600; }
.test-res.ok { background: var(--good-soft); color: var(--good); }
.test-res.bad { background: var(--bad-soft); color: var(--bad); }
.test-text { margin-top: 10px; padding: 11px 13px; border-radius: 13px; background: var(--surface-2); font-size: 14px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.test-text mark { background: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--text); border-radius: 4px; padding: 0 2px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--bad) 50%, transparent); }
.row .mk { flex: none; }
.word .wt:active { background: none; color: inherit; }

/* ── Оформление: рамки ───────────────────────────────────────────────────── */
.fr { position: relative; display: inline-grid; place-items: center; border-radius: 50%; flex: none; width: var(--s); height: var(--s); }
.fr > .ava { position: relative; z-index: 1; }
.fr::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; background: var(--frb, transparent); z-index: 0; }
.fr[class*="fr-"] > .ava { box-shadow: 0 0 0 2px var(--surface-solid); }
.ring-ava > .fr::before { inset: -4px; }

/* ── Оформление: цвет ника и титул ───────────────────────────────────────── */
.nc { -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% auto; }
:root[data-theme="light"] :root[data-theme="light"] @keyframes shine { to { background-position: 200% center; } }
.utitle { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent-soft), rgba(34, 211, 238, .12)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); }
.utitle.big { height: 32px; font-size: 14px; padding: 0 12px; }
.chip.pts { background: rgba(255, 209, 102, .14); border-color: rgba(255, 209, 102, .35); color: var(--gold); }
.hero-day { margin-top: 10px; font-size: 13px; color: var(--text-2); padding: 7px 12px; border-radius: 12px; display: inline-block;
  background: linear-gradient(135deg, rgba(255, 181, 71, .16), rgba(255, 61, 119, .12)); border: 1px solid rgba(255, 181, 71, .3); }

/* ── Игры ────────────────────────────────────────────────────────────────── */
.pts-btn { height: 40px; padding: 0 12px; border-radius: 14px; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 209, 102, .14); border: 1px solid rgba(255, 209, 102, .35); color: var(--gold); font-size: 14px; }
.pts-btn b { color: var(--text); }
.hero-card { overflow: hidden; }
.hero-card::after { content: ""; position: absolute; right: -50px; top: -50px; width: 190px; height: 190px; border-radius: 50%;
  background: var(--grad-fire); filter: blur(55px); opacity: .3; pointer-events: none; }
.hc-lbl { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.hc-main { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.hc-name { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.hc-title { margin-top: 4px; font-size: 15px; font-weight: 700; background: var(--grad-fire); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hc-foot { margin-top: 12px; color: var(--muted); font-size: 12.5px; }
.game-card .g-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--surface-2); flex: none; }
.g-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--surface-2); flex: none; }
.g-name { font-weight: 800; font-size: 16px; }
.g-sub { color: var(--muted); font-size: 12.5px; }
.g-how { color: var(--text-2); font-size: 13.5px; margin: 12px 0; line-height: 1.45; }
.g-foot { display: flex; align-items: center; gap: 10px; }
.g-me { flex: 1; font-size: 13.5px; color: var(--muted); }
.g-me b { color: var(--text); font-size: 15px; }
.g-top { display: flex; }
.g-top > * + * { margin-left: -8px; }
.g-top .ava { box-shadow: 0 0 0 2px var(--surface-solid); }
.rates { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.rates b { color: var(--good); }

/* ── Магазин ─────────────────────────────────────────────────────────────── */
.shop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.shop-item { min-width: 0; padding: 14px 12px 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.shop-item.eq { border-color: color-mix(in srgb, var(--good) 45%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--good) 25%, transparent), var(--shadow); }
.shop-item .sp { height: 66px; display: grid; place-items: center; width: 100%; }
.shop-item .sp-name { font-size: 17px; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-item .si-name { font-weight: 700; font-size: 14px; }
.shop-item .si-desc { color: var(--muted); font-size: 12px; min-height: 16px; margin-bottom: 6px; }
.shop-item .btn.sm { width: 100%; }

/* ── Иконка у ника, фоны ─────────────────────────────────────────────────── */
.uicon { margin-left: 4px; font-size: .95em; -webkit-text-fill-color: initial; }
.hero[class*="bg-"] { border-color: color-mix(in srgb, var(--bg-accent) 40%, transparent); }
.hero[class*="bg-"]::before { background: radial-gradient(120% 70% at 50% -10%, color-mix(in srgb, var(--bg-accent) 25%, transparent), transparent 65%); }
.hero[class*="bg-"] .name, .hero[class*="bg-"] .lvl-progress .row b { color: #fff; }
.hero[class*="bg-"] .uname, .hero[class*="bg-"] .lvl-progress .row { color: rgba(255, 255, 255, .7); }
.bg-swatch { width: 100%; height: 62px; border-radius: 14px; border: 1px solid var(--border-strong); position: relative; overflow: hidden; }
.bg-swatch::after { content: ""; position: absolute; left: 10px; bottom: 9px; width: 26px; height: 26px; border-radius: 50%; background: var(--bg-accent); opacity: .9; box-shadow: 0 0 14px var(--bg-accent); }
.icon-big { font-size: 40px; line-height: 1; }

.how-row { display: flex; gap: 12px; padding: 8px 0; }
.how-row + .how-row { border-top: 1px solid var(--border); padding-top: 12px; }
.how-row .hr-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); font-size: 18px; flex: none; }
.how-row .a { font-weight: 700; font-size: 14.5px; }
.how-row .b { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.big-hero .num .gt { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big-hero .num .coin { font-size: .8em; }

/* ── Задания дня, ачивки, тег ────────────────────────────────────────────── */
.q-sum { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin: -6px 0 6px; color: var(--gold); }
.q-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.q-row + .q-row { border-top: 1px solid var(--border); }
.q-row .q-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); font-size: 17px; flex: none; }
.q-row .a { font-size: 14px; font-weight: 700; }
.q-row .b { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.q-row .q-r { font-weight: 800; color: var(--gold); font-size: 14px; }
.q-row.done .a { color: var(--muted); }
.q-row.done .q-r { color: var(--good); }
.ach .ar { font-size: 10.5px; font-weight: 700; color: var(--gold); margin-top: 5px; }
.ach.off .ar { color: var(--faint); }
.tag-line { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.tag-line .tl-ic { font-size: 22px; }
.tag-line .a { font-weight: 700; }
.tag-line .b { font-size: 12.5px; color: var(--muted); }
.tag-card .tg-top { display: flex; gap: 12px; align-items: center; }
.tag-card .tg-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 28px;
  background: linear-gradient(135deg, rgba(253,224,71,.2), rgba(245,158,11,.15)); }
.tag-card .tg-t { font-size: 18px; font-weight: 800; }
.tag-card .tg-p { color: var(--gold); font-weight: 700; font-size: 14px; margin-top: 2px; }
.tag-card .tg-desc { margin-top: 12px; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.tag-card .tg-cur { margin-top: 12px; padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; }
.tag-card .tg-cur.pending { background: rgba(250,204,21,.12); color: var(--warn); }
.tag-card .tg-cur.active { background: var(--good-soft); color: var(--good); }

/* 6 вкладок в нижнем меню (с админкой) — чуть компактнее подписи */
.nav:has(button:nth-child(7)) button { font-size: 10px; letter-spacing: -0.01em; }
.nav:has(button:nth-child(7)) button .ic { width: 21px; height: 21px; }
