/* =========================================================================
   VOLT · Premium UI · PULSSE
   ========================================================================= */
:root {
  --bg: #06070c;
  --bg-2: #0a0c14;
  --surface: rgba(255, 255, 255, .038);
  --surface-2: rgba(255, 255, 255, .064);
  --surface-3: rgba(255, 255, 255, .095);
  --border: rgba(255, 255, 255, .085);
  --border-2: rgba(255, 255, 255, .16);
  --text: #eef1f9;
  --text-2: #aab2c8;
  --muted: #7d859c;
  --accent: #7c5cff;
  --accent-2: #38e1ff;
  --gold: #ffc76b;
  --good: #34d399;
  --bad: #fb5f7a;
  --warn: #fbbf24;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .85);
  --rail: 92px;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body[data-accent="violet"] { --accent: #7c5cff; --accent-2: #38e1ff; }
body[data-accent="ember"]  { --accent: #ff7a45; --accent-2: #ffd166; }
body[data-accent="mint"]   { --accent: #2dd4bf; --accent-2: #a3e635; }
body[data-accent="rose"]   { --accent: #f472b6; --accent-2: #a78bfa; }
body[data-accent="ice"]    { --accent: #60a5fa; --accent-2: #bae6fd; }

h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: 26px; }
h2 { font-size: 22px; }
h3 { font-size: 16px; letter-spacing: -.01em; }
p { margin: 0; }
button { font-family: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------------------------------------------------------------- ФОН */
.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 620px at 8% -10%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 62%),
    radial-gradient(760px 520px at 100% 0%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 60%),
    radial-gradient(1100px 700px at 50% 118%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 65%),
    linear-gradient(180deg, #06070c 0%, #080a11 45%, #05060a 100%);
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
#app { position: relative; z-index: 2; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- ЛЭЙАУТ */
#app { display: flex; min-height: 100vh; }
.rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px 12px; z-index: 40;
  background: linear-gradient(180deg, rgba(12, 14, 22, .82), rgba(6, 7, 12, .72));
  border-right: 1px solid var(--border);
  backdrop-filter: blur(22px) saturate(140%);
}
.logo { display: flex; flex-direction: column; align-items: center; gap: 7px; margin-bottom: 12px; }
.logo-mark {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px;
  color: #08080f;   /* молния тёмная — как на иконке приложения */
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--accent) 80%, transparent), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .3s cubic-bezier(.2,.9,.25,1);
}
.logo-mark:hover { transform: translateY(-2px) rotate(-4deg); }
.logo-mark .bolt { filter: drop-shadow(0 1px 1px rgba(255,255,255,.35)); }
.logo-word { font-size: 8.5px; font-weight: 800; letter-spacing: .22em; color: var(--muted); text-indent: .22em; }
.nav { display: flex; flex-direction: column; gap: 6px; width: 100%; flex: 1; }
.nav-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 100%; padding: 11px 4px; border: 0; border-radius: 15px; cursor: pointer;
  background: transparent; color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: .01em;
  transition: color .2s, background .2s, transform .2s;
}
.nav-btn .ico { width: 22px; height: 22px; }
.nav-btn:hover { color: var(--text); background: var(--surface); transform: translateY(-1px); }
.nav-btn.on { color: var(--text); background: var(--surface-2); }
.nav-btn.on::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 26px; border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 75%, transparent);
}
.nav-btn .ico { transition: transform .25s cubic-bezier(.2,.9,.25,1); }
.nav-btn:hover .ico { transform: scale(1.08); }
.palette-btn { margin-top: auto; }

.main { flex: 1; margin-left: var(--rail); min-width: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
.main::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-thumb { background: rgba(255,255,255,.09); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
.main::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); background-clip: content-box; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 32px; backdrop-filter: blur(18px) saturate(150%);
  background: linear-gradient(180deg, rgba(6,7,12,.92), rgba(6,7,12,.55) 70%, transparent);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.tb-title { font-size: 25px; }
.tb-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; text-transform: capitalize; }
.tb-right { display: flex; align-items: center; gap: 10px; }
.pill {
  display: flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-weight: 700; font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.pill .pp-ico { font-size: 15px; }
.streak-pill { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 25%, transparent); }
.lvl-pill { cursor: pointer; position: relative; overflow: hidden; }
.pp-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: rgba(255,255,255,.08); }
.pp-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s cubic-bezier(.2,.9,.25,1); }
.xp-pill { color: var(--accent-2); }

.content { padding: 22px 32px 96px; max-width: 1560px; }
.view-enter { animation: viewIn .42s cubic-bezier(.2,.9,.25,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px) scale(.995); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- СЕТКИ */
.grid { display: grid; gap: 18px; align-items: start; }
/* Дашборд «Сегодня»: две независимые колонки, чтобы не было пустых провалов */
.dash { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.quests-grid { grid-template-columns: repeat(2, 1fr); }
.quests-grid > .wide { grid-column: 1 / -1; }
.habits-grid { grid-template-columns: repeat(2, 1fr); }
.habits-grid > .wide { grid-column: 1 / -1; }
.journal-grid { grid-template-columns: repeat(2, 1fr); }
.journal-grid > .wide { grid-column: 1 / -1; }
.progress-grid { grid-template-columns: repeat(3, 1fr); }
.progress-grid > .wide { grid-column: 1 / -1; }
.settings-grid { grid-template-columns: repeat(3, 1fr); }
.settings-grid > .wide { grid-column: 1 / -1; }

/* ---------------------------------------------------------------- КАРТОЧКИ */
.card {
  position: relative; padding: 22px; border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgba(255,255,255,.055), rgba(255,255,255,.018) 42%, rgba(255,255,255,.03));
  border: 1px solid var(--border); box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.card:hover { border-color: var(--border-2); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3 { flex: 1; }
.card-head .btn { margin-left: auto; }
.hint { font-size: 12px; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.sm { font-size: 12.8px; line-height: 1.55; }
.warn-t { color: var(--warn); }
.good-t { color: var(--good); }
.bad-t { color: var(--bad); }
.tiny { padding: 4px !important; }

/* ---------------------------------------------------------------- HERO */
.hero { overflow: hidden; }
.hero-glow {
  position: absolute; inset: -40% -10% auto -10%; height: 260px; pointer-events: none;
  background: radial-gradient(60% 100% at 50% 0%, color-mix(in srgb, var(--accent) 32%, transparent), transparent 70%);
  filter: blur(6px);
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; position: relative; }
.who { display: flex; align-items: center; gap: 16px; min-width: 0; }
.avatar {
  position: relative; display: grid; place-items: center; width: 76px; height: 76px; flex: none;
  border-radius: 24px; background: linear-gradient(140deg, rgba(255,255,255,.14), rgba(255,255,255,.03));
  border: 1px solid var(--border-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 16px 30px -18px #000;
}
.avatar-rank { font-size: 32px; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
.avatar-lvl {
  position: absolute; right: -6px; bottom: -6px; min-width: 26px; height: 26px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 9px; font-size: 12.5px; font-weight: 800;
  background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #08080f;
  border: 2px solid rgba(6,7,12,.9);
}
.who-txt { min-width: 0; }
.who-name { font-size: 27px; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.who-rank { font-size: 13.5px; font-weight: 700; color: var(--accent-2); margin-top: 3px; }
.who-note { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.hero-ring { flex: none; filter: drop-shadow(0 10px 30px color-mix(in srgb, var(--accent) 40%, transparent)); }
.ring-fill { transition: stroke-dashoffset 1s cubic-bezier(.2,.9,.25,1); }
.ring-num { fill: var(--text); font-size: 25px; font-weight: 800; font-family: var(--font); }
.ring-sub { fill: var(--muted); font-size: 10.5px; font-weight: 700; font-family: var(--font); }
.xpbar-wrap { margin-top: 22px; }
.xpbar { height: 10px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.4); }
.xpbar-fill {
  height: 100%; border-radius: 99px; position: relative;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: width 1s cubic-bezier(.2,.9,.25,1);
}
.xpbar-fill::after {
  content: ''; position: absolute; inset: 0; border-radius: 99px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  animation: shimmer 2.6s linear infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.xpbar-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }
.xpbar-meta b { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.chip {
  display: flex; flex-direction: column; gap: 1px; padding: 9px 13px; min-width: 92px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
}
.chip-v { font-size: 14.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.chip-l { font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: lowercase; }
.chip.hot .chip-v { color: var(--gold); }
.chip.accent .chip-v { color: var(--accent-2); }
.chip.good .chip-v { color: var(--good); }
.chip.bad .chip-v { color: var(--bad); }
.rank-track { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); font-size: 12.5px; }
.rank-now { font-weight: 800; }
.rank-next { color: var(--muted); }

/* ---------------------------------------------------------------- ЧЕК-ИН */
.checkin.gentle { border-color: color-mix(in srgb, var(--good) 40%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--good) 22%, transparent), var(--shadow); }
.gentle-banner {
  padding: 11px 14px; border-radius: 14px; margin-bottom: 14px; font-size: 12.8px; line-height: 1.5;
  background: color-mix(in srgb, var(--good) 12%, transparent); border: 1px solid color-mix(in srgb, var(--good) 30%, transparent);
}
.scales { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.scale { display: flex; align-items: center; gap: 12px; }
.scale-label { width: 92px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.scale-dots { display: flex; gap: 6px; }
.dot {
  width: 38px; height: 38px; border-radius: 13px; cursor: pointer; font-size: 17px; line-height: 1;
  background: var(--surface); border: 1px solid var(--border); filter: grayscale(.55) opacity(.7);
  transition: transform .18s, border-color .18s, filter .18s, background .18s;
}
.dot:hover { transform: translateY(-2px) scale(1.05); filter: none; }
.dot.on {
  filter: none; background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 90%, transparent); transform: scale(1.06);
}
.scale-val { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.save-hint { font-size: 11.5px; color: var(--good); }

/* ---------------------------------------------------------------- ПОЛЯ */
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 7px; }
.field-label em { font-style: normal; font-weight: 500; color: var(--muted); }
.input {
  width: 100%; padding: 11px 14px; border-radius: 13px; color: var(--text); font-size: 14px; font-family: inherit;
  background: rgba(255,255,255,.045); border: 1px solid var(--border); outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.input:focus { border-color: color-mix(in srgb, var(--accent) 65%, transparent); background: rgba(255,255,255,.07); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.input::placeholder { color: #5c6479; }
.input.area { resize: vertical; line-height: 1.55; }
.input.sm { padding: 9px 12px; font-size: 13.4px; }
.input.bare { background: transparent; border: 0; padding: 0; font-size: 15.5px; }
select.input { 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, 5px 5px; background-repeat: no-repeat; }
input[type="date"].input { color-scheme: dark; }

/* ---------------------------------------------------------------- КНОПКИ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 17px; border-radius: 13px; border: 1px solid transparent; cursor: pointer;
  font-size: 13.5px; font-weight: 700; letter-spacing: .01em; color: var(--text);
  background: var(--surface-2); transition: transform .18s, background .2s, box-shadow .2s, border-color .2s;
  white-space: nowrap;
}
.btn .ico { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-1px); background: var(--surface-3); }
.btn:active { transform: translateY(0) scale(.985); }
.btn.sm { padding: 8px 13px; font-size: 12.7px; border-radius: 11px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #08080f;
  box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--accent) 95%, transparent), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn-primary:hover { box-shadow: 0 18px 36px -14px color-mix(in srgb, var(--accent) 100%, transparent); }
.btn-ghost { background: var(--surface); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-2); }
.btn-danger { background: color-mix(in srgb, var(--bad) 16%, transparent); border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: #ffd7de; }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 26%, transparent); }
.btn-col { display: flex; flex-direction: column; gap: 9px; }
.icon-btn {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--muted); transition: all .18s;
}
.icon-btn .ico { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.icon-btn.danger:hover { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.switch { width: 50px; height: 28px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; padding: 3px; transition: background .25s; }
.switch i { display: block; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .25s cubic-bezier(.3,1.4,.5,1), background .25s; }
.switch.on { background: color-mix(in srgb, var(--good) 30%, transparent); border-color: color-mix(in srgb, var(--good) 50%, transparent); }
.switch.on i { transform: translateX(22px); background: var(--good); }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.045); border: 1px solid var(--border); }
.seg.full { display: flex; width: 100%; margin-bottom: 16px; }
.seg.full .seg-btn { flex: 1; }
.seg-btn { padding: 9px 15px; border-radius: 11px; border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; transition: all .2s; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #08080f; box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--accent) 90%, transparent); }
.swatches { display: flex; gap: 9px; }
.swatch { width: 40px; height: 40px; border-radius: 13px; cursor: pointer; border: 2px solid transparent; background: linear-gradient(140deg, var(--c1), var(--c2)); transition: transform .2s, border-color .2s; }
.swatch:hover { transform: translateY(-2px) scale(1.05); }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
.progress { height: 8px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.progress.slim { height: 5px; margin-bottom: 14px; }
.progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .8s cubic-bezier(.2,.9,.25,1); }

/* ---------------------------------------------------------------- БЫСТРАЯ ЗАПИСЬ */
.quick-group { margin-bottom: 16px; }
.quick-group:last-child { margin-bottom: 0; }
.qg-title { font-size: 11.5px; font-weight: 800; color: var(--good); text-transform: uppercase; letter-spacing: .09em; margin-bottom: 9px; }
.qg-title.bad { color: var(--bad); }
.qchips { display: flex; flex-wrap: wrap; gap: 9px; }
.qchip {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px;
  border-radius: 14px; cursor: pointer; background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; transition: transform .16s, border-color .2s, background .2s, box-shadow .2s;
  user-select: none;
}
.qchip:hover { transform: translateY(-2px); border-color: var(--border-2); background: var(--surface-2); }
.qchip.buff:hover { box-shadow: 0 12px 26px -16px color-mix(in srgb, var(--good) 90%, transparent); }
.qchip.debuff:hover { box-shadow: 0 12px 26px -16px color-mix(in srgb, var(--bad) 90%, transparent); }
.qchip.on { border-color: color-mix(in srgb, var(--good) 55%, transparent); background: color-mix(in srgb, var(--good) 12%, transparent); }
.qchip.debuff.on { border-color: color-mix(in srgb, var(--bad) 55%, transparent); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.qc-ico { font-size: 16px; }
.qc-xp { font-size: 11.5px; font-weight: 800; color: var(--good); font-variant-numeric: tabular-nums; }
.qc-xp.neg { color: var(--bad); }
.qc-count { font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 7px; background: rgba(255,255,255,.1); }
.qc-mini {
  width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--border); cursor: pointer;
  background: rgba(0,0,0,.28); color: var(--muted); font-size: 11px; font-weight: 800; line-height: 1;
  transition: all .18s;
}
.qc-mini:hover { color: var(--text); background: rgba(0,0,0,.5); border-color: var(--border-2); }
.empty-inline { padding: 14px; border-radius: 14px; border: 1px dashed var(--border); color: var(--muted); font-size: 13px; text-align: center; }

/* ---------------------------------------------------------------- СПИСКИ */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border); transition: all .2s;
}
.list-item:hover { border-color: var(--border-2); background: var(--surface-2); }
.list-item.done { opacity: .62; }
.list-item.done .li-title { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--good) 60%, transparent); }
.check {
  width: 30px; height: 30px; flex: none; border-radius: 10px; cursor: pointer; display: grid; place-items: center;
  background: rgba(255,255,255,.05); border: 1px solid var(--border-2); color: #08080f; transition: all .2s;
}
.check .ico { width: 17px; height: 17px; stroke-width: 2.6; }
.check:hover { border-color: var(--good); transform: scale(1.06); }
.check.sm { width: 24px; height: 24px; border-radius: 8px; }
.list-item.done .check, .ms.done .check { background: linear-gradient(140deg, var(--good), #10b981); border-color: transparent; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 700; font-size: 14.5px; }
.li-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.li-right { display: flex; align-items: center; gap: 6px; }
.attr-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 7px;
  font-size: 11px; font-weight: 700; color: var(--ac); background: color-mix(in srgb, var(--ac) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ac) 28%, transparent);
}
.xp-badge {
  padding: 3px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 800; color: var(--good);
  background: color-mix(in srgb, var(--good) 12%, transparent); font-variant-numeric: tabular-nums;
}
.xp-badge.neg { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.minimal { font-size: 11px; color: var(--muted); font-style: italic; }
.tag.deep { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 14%, transparent); padding: 2px 7px; border-radius: 6px; }
.chip-mini { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- ЦЕЛИ */
.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.goal-card {
  padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--ac); transition: all .25s;
}
.goal-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.goal-card.done { opacity: .7; }
.gc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gc-title { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.gc-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.gc-actions { display: flex; gap: 2px; }
.gc-why { margin-top: 12px; font-size: 13px; font-style: italic; color: var(--text-2); line-height: 1.5; }
.gc-prog { display: flex; align-items: center; gap: 12px; margin: 14px 0; }
.gc-prog .progress { flex: 1; }
.gc-prog span { font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ms-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.ms { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 11px; background: rgba(0,0,0,.22); font-size: 13px; }
.ms.done .ms-title { text-decoration: line-through; opacity: .6; }
.ms-title { flex: 1; }
.ms-xp { font-size: 11px; font-weight: 800; color: var(--good); }
.ms-add { display: flex; gap: 8px; }
.goal-mini { padding: 13px 0; border-bottom: 1px dashed var(--border); cursor: pointer; }
.goal-mini:last-child { border-bottom: 0; }
.goal-mini:hover .gm-title { color: var(--accent-2); }
.gm-top { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.gm-pct { color: var(--muted); font-variant-numeric: tabular-nums; }
.gm-title { transition: color .2s; }
.gm-sub { font-size: 11.5px; color: var(--muted); margin-top: 7px; }
.done-goals { margin-top: 12px; font-size: 12.5px; color: var(--gold); font-weight: 700; }

/* ---------------------------------------------------------------- ИНСАЙТЫ */
.insights .card-head { margin-bottom: 12px; }
.insight {
  display: flex; gap: 12px; padding: 13px 14px; border-radius: 16px; margin-bottom: 9px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--muted);
  animation: fadeUp .5s backwards;
}
.insight:last-child { margin-bottom: 0; }
.insight.good { border-left-color: var(--good); background: color-mix(in srgb, var(--good) 7%, var(--surface)); }
.insight.warn { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); }
.insight.info { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.ins-ico { font-size: 19px; line-height: 1.3; }
.ins-title { font-weight: 800; font-size: 13.8px; margin-bottom: 3px; }
.ins-text { font-size: 12.8px; color: var(--text-2); line-height: 1.55; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- ЖУРНАЛ */
.led-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 330px; overflow-y: auto; }
.led-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; font-size: 13px; transition: background .2s; }
.led-item:hover { background: var(--surface); }
.led-ico { font-size: 15px; }
.led-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.led-xp { font-weight: 800; color: var(--good); font-variant-numeric: tabular-nums; }
.led-item.neg .led-xp { color: var(--bad); }

/* ---------------------------------------------------------------- ПРИВЫЧКИ */
.status-bar { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.status-item { display: flex; align-items: center; gap: 12px; }
.si-ico { font-size: 24px; }
.si-v { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.si-l { font-size: 11.5px; color: var(--muted); }
.status-item.bad .si-v { color: var(--bad); }
.status-item.good .si-v { color: var(--good); }
.status-bar .btn { margin-left: auto; }
.habit {
  padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
  margin-bottom: 12px; border-left: 3px solid var(--ac); transition: all .25s;
}
.habit:last-child { margin-bottom: 0; }
.habit:hover { border-color: var(--border-2); }
.habit.on { background: color-mix(in srgb, var(--ac) 8%, var(--surface)); }
.habit.deb { border-left-color: var(--bad); }
.h-top { display: flex; align-items: center; gap: 12px; }
.h-ico { font-size: 24px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: rgba(0,0,0,.28); border: 1px solid var(--border); flex: none; }
.h-name { flex: 1; min-width: 0; }
.h-name b { font-size: 14.8px; }
.h-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.h-xp { font-size: 15px; font-weight: 800; color: var(--good); font-variant-numeric: tabular-nums; }
.h-xp.neg { color: var(--bad); }
.h-swap { margin-top: 11px; padding: 10px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.5; background: color-mix(in srgb, var(--good) 9%, transparent); border: 1px solid color-mix(in srgb, var(--good) 22%, transparent); color: var(--text-2); }
.h-swap b { color: var(--good); }
.h-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 11px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hdots { display: flex; gap: 3px; margin-top: 10px; }
.hdot {
  width: 100%; max-width: 14px; height: 14px; border-radius: 4px; background: rgba(255,255,255,.06);
  display: grid; place-items: center; font-size: 8px; font-weight: 800; color: #06110c; transition: transform .2s;
}
.hdot.on { background: linear-gradient(140deg, var(--good), #10b981); }
.habit.deb .hdot.on { background: linear-gradient(140deg, var(--bad), #b91c1c); }
.h-actions { display: flex; align-items: center; gap: 8px; margin-top: 13px; }

/* ---------------------------------------------------------------- КАРТА ДНЕЙ */
.hm-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin-bottom: 7px; text-align: center; font-size: 10.5px; color: var(--muted); font-weight: 700; }
.heatmap { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.hm-cell {
  position: relative; aspect-ratio: 1.22; border-radius: 13px; display: grid; place-items: center;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.05);
  font-size: 12.5px; font-weight: 700; color: rgba(255,255,255,.38);
  transition: transform .18s, box-shadow .18s;
}
.hm-cell.empty { background: transparent; border-color: transparent; }
.hm-cell.future { opacity: .4; }
.hm-cell.today { box-shadow: inset 0 0 0 2px var(--accent-2); color: var(--text); }
.hm-cell.l1 { background: color-mix(in srgb, var(--accent) 30%, transparent); color: #ddd8ff; border-color: transparent; }
.hm-cell.l2 { background: color-mix(in srgb, var(--accent) 52%, transparent); color: #efedff; border-color: transparent; }
.hm-cell.l3 { background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 85%, transparent), color-mix(in srgb, var(--accent) 55%, var(--accent-2))); color: #fff; border-color: transparent; }
.hm-cell.l4 { background: linear-gradient(150deg, var(--accent), var(--accent-2)); color: #08080f; border-color: transparent; box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--accent) 90%, transparent); }
.hm-cell:not(.empty):hover { transform: translateY(-2px) scale(1.04); }
.hm-legend { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 14px; font-size: 11px; color: var(--muted); }
.hm-legend .hm-cell { width: 15px; height: 15px; aspect-ratio: auto; border-radius: 5px; box-shadow: none; }
.cal-card { align-self: start; }
.chart { width: 100%; height: 160px; overflow: visible; }
.chart .line { filter: drop-shadow(0 6px 12px color-mix(in srgb, var(--accent-2) 45%, transparent)); }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.legend-row { display: flex; gap: 14px; margin-bottom: 8px; font-size: 11.5px; font-weight: 700; }
.lg { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.lg::before { content: ''; width: 12px; height: 3px; border-radius: 2px; background: var(--accent-2); }
.lg.mood::before { background: var(--accent-2); }
.lg.energy::before { background: var(--accent); }
.review { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 10px; }
.rv-head { font-size: 11.5px; font-weight: 800; color: var(--accent-2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.rv-row { font-size: 12.8px; color: var(--text-2); margin-bottom: 5px; line-height: 1.5; }
.rv-row b { color: var(--text); }
.rv-row.accent { color: var(--text); background: color-mix(in srgb, var(--accent) 10%, transparent); padding: 8px 10px; border-radius: 10px; margin-top: 6px; }
.note { padding: 14px 0; border-bottom: 1px dashed var(--border); }
.note:last-child { border-bottom: 0; }
.note-head { display: flex; align-items: center; gap: 12px; }
.note-date { font-size: 12.5px; font-weight: 800; text-transform: capitalize; }
.note-meta { font-size: 11.5px; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.note-text { margin-top: 8px; font-size: 13.5px; color: var(--text-2); line-height: 1.65; white-space: pre-wrap; }

/* ---------------------------------------------------------------- ПРОГРЕСС */
.stats-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.stat-label { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.stat-value { font-size: 27px; font-weight: 800; letter-spacing: -.03em; margin: 6px 0 3px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11px; color: var(--muted); }
.radar { width: 100%; max-width: 340px; margin: 0 auto; display: block; }
.attr { margin-bottom: 18px; padding-left: 12px; border-left: 2px solid var(--ac); }
.attr:last-child { margin-bottom: 0; }
.attr-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.attr-name { font-weight: 800; font-size: 14.5px; }
.attr-lvl { font-size: 12px; font-weight: 800; color: var(--ac); }
.attr .progress-fill { background: linear-gradient(90deg, var(--ac), color-mix(in srgb, var(--ac) 40%, var(--accent-2))); }
.attr-bottom { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.attr-desc { font-size: 11.5px; color: var(--muted); margin-top: 5px; font-style: italic; }
.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-row {
  display: grid; grid-template-columns: 44px 34px 150px 1fr auto; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 13px; background: rgba(0,0,0,.2); border: 1px solid transparent;
  font-size: 13px; opacity: .45; transition: all .25s;
}
.rank-row.reached { opacity: 1; }
.rank-row.current { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.rr-lvl { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.rr-ico { font-size: 19px; }
.rr-name { font-weight: 800; }
.rr-note { font-size: 12px; color: var(--muted); }
.rr-xp { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.ach {
  display: flex; flex-direction: column; gap: 4px; padding: 15px; border-radius: 16px;
  background: rgba(0,0,0,.24); border: 1px solid var(--border); opacity: .5; transition: all .3s;
}
.ach.on {
  opacity: 1; border-color: color-mix(in srgb, var(--gold) 40%, transparent);
  background: linear-gradient(150deg, color-mix(in srgb, var(--gold) 12%, transparent), rgba(0,0,0,.24));
  box-shadow: 0 16px 34px -22px var(--gold);
}
.ach-ico { font-size: 23px; }
.ach-name { font-weight: 800; font-size: 13.5px; }
.ach-desc { font-size: 11.5px; color: var(--muted); line-height: 1.45; }

/* ---------------------------------------------------------------- МОДЕЛЬ */
.model { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.model-item { display: flex; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.mi-ico { font-size: 20px; }
.mi-title { font-weight: 800; font-size: 13.8px; margin-bottom: 4px; }
.mi-text { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }

/* ---------------------------------------------------------------- ТОСТЫ */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: 372px; max-width: calc(100vw - 36px); }
.toast {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 18px;
  background: linear-gradient(150deg, rgba(22,24,36,.96), rgba(12,14,22,.96));
  border: 1px solid var(--border-2); box-shadow: 0 28px 60px -22px rgba(0,0,0,.95);
  transform: translateX(120%) scale(.96); opacity: 0; transition: all .38s cubic-bezier(.2,.9,.25,1);
  backdrop-filter: blur(16px);
}
.toast.in { transform: none; opacity: 1; }
.toast.good { border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.toast.bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.toast-ico { font-size: 21px; line-height: 1.2; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 800; font-size: 13.8px; }
.toast-text { font-size: 12.3px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.toast-undo {
  align-self: center; padding: 6px 11px; border-radius: 9px; cursor: pointer; font-size: 11.5px; font-weight: 800;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.toast-undo:hover { background: var(--surface-3); }
.toast-x { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 2px; display: grid; place-items: center; }
.toast-x .ico { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- ЭФФЕКТЫ */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 190; }
.float-xp {
  position: fixed; z-index: 195; pointer-events: none; transform: translate(-50%, -50%);
  font-size: 20px; font-weight: 800; color: var(--accent-2); text-shadow: 0 4px 18px color-mix(in srgb, var(--accent) 80%, transparent);
  animation: floatUp 1.05s cubic-bezier(.2,.9,.25,1) forwards;
}
.float-xp.bad { color: var(--bad); }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.7); }
  22% { opacity: 1; transform: translate(-50%, -80%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -190%) scale(1); }
}
.particle {
  position: fixed; width: 7px; height: 7px; border-radius: 50%; pointer-events: none;
  animation: burst var(--dur, .8s) cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes burst {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.3); }
}

/* ---------------------------------------------------------------- LEVEL UP */
.levelup {
  position: fixed; inset: 0; z-index: 300; display: none; place-items: center;
  background: radial-gradient(60% 60% at 50% 45%, rgba(10,10,20,.82), rgba(3,3,7,.96));
  backdrop-filter: blur(10px); opacity: 0; transition: opacity .4s;
}
.levelup.show { display: grid; opacity: 1; }
#lv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.lv-inner { position: relative; text-align: center; animation: lvIn .7s cubic-bezier(.2,1.2,.4,1); }
.lv-inner::before {
  content: ''; position: absolute; left: 50%; top: 42%; width: 620px; height: 620px; transform: translate(-50%, -50%);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 26%, transparent), transparent 62%);
  filter: blur(20px); z-index: -1; pointer-events: none;
}
@keyframes lvIn { from { opacity: 0; transform: scale(.85); } }
.lv-kicker { font-size: 12.5px; font-weight: 800; letter-spacing: .32em; text-transform: uppercase; color: var(--accent-2); }
.lv-num {
  font-size: 132px; font-weight: 800; line-height: .95; letter-spacing: -.05em;
  background: linear-gradient(160deg, #fff, var(--accent-2) 45%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 20px 50px color-mix(in srgb, var(--accent) 60%, transparent));
}
.lv-rank { font-size: 27px; font-weight: 800; margin-top: 6px; }
.lv-note { color: var(--muted); margin-top: 8px; font-size: 14px; }
.lv-btn { margin-top: 30px; padding: 15px 40px; font-size: 15px; border-radius: 16px; }

/* ---------------------------------------------------------------- МОДАЛКИ */
#modal-root { position: relative; z-index: 250; }
.modal-backdrop {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 20px;
  background: rgba(3,4,8,.72); backdrop-filter: blur(8px); opacity: 0; transition: opacity .26s;
  overflow-y: auto;
}
.modal-backdrop.in { opacity: 1; }
.modal {
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; padding: 24px;
  border-radius: 26px; background: linear-gradient(165deg, rgba(24,26,40,.98), rgba(11,12,20,.99));
  border: 1px solid var(--border-2); box-shadow: 0 40px 90px -30px rgba(0,0,0,.95);
  transform: translateY(16px) scale(.97); transition: transform .32s cubic-bezier(.2,.9,.25,1);
}
.modal-backdrop.in .modal { transform: none; }
.modal-backdrop.wide .modal { max-width: 680px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.modal-head h3 { font-size: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.form-grid .field.small { max-width: 120px; }
.toggles { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.tg { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.tg input { width: 17px; height: 17px; accent-color: var(--accent); }
.catalog { margin-bottom: 16px; }
.cat-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--good); margin-bottom: 8px; }
.cat-title.bad { color: var(--bad); margin-top: 14px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.cat-chips.big { max-height: 44vh; overflow-y: auto; padding-right: 4px; }
.cat-chip {
  padding: 8px 12px; border-radius: 12px; cursor: pointer; font-size: 12.5px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); transition: all .18s;
  display: inline-flex; align-items: center; gap: 7px;
}
.cat-chip em { font-style: normal; font-size: 10.5px; font-weight: 800; color: var(--good); }
.cat-chip.bad em { color: var(--bad); }
.cat-chip:hover { transform: translateY(-1px); color: var(--text); border-color: var(--border-2); }
.cat-chip.sel { background: color-mix(in srgb, var(--accent) 20%, transparent); border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--text); }

/* ---------------------------------------------------------------- ПАЛИТРА */
.palette-modal { max-width: 620px; padding: 0; overflow: hidden; }
.pal-input { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.pal-input .ico { width: 19px; height: 19px; color: var(--muted); }
.pal-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.pal-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border-radius: 13px;
  background: transparent; border: 0; cursor: pointer; color: var(--text); font-size: 14px; text-align: left; font-family: inherit;
}
.pal-item.on { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.pal-ico { font-size: 16px; }
.pal-label { flex: 1; }
.pal-hint { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.pal-foot { display: flex; gap: 18px; padding: 12px 22px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }
kbd { font-family: var(--mono); font-size: 10.5px; padding: 2px 5px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); margin-right: 3px; }

/* ---------------------------------------------------------------- ОНБОРДИНГ */
.onb-modal { max-width: 620px; }
.onb-steps { display: flex; gap: 6px; margin-bottom: 22px; }
.onb-steps i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.1); transition: background .3s; }
.onb-steps i.on { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.onb-hero { text-align: center; margin-bottom: 22px; }
.onb-logo {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px; display: grid; place-items: center;
  color: #08080f;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 20px 44px -16px color-mix(in srgb, var(--accent) 90%, transparent);
}
.brand-note {
  display: flex; align-items: flex-start; gap: 9px; margin-top: 16px; padding-top: 14px;
  border-top: 1px dashed var(--border); font-size: 11.5px; color: var(--muted); line-height: 1.5;
}
.brand-note .bolt { flex: none; margin-top: 1px; color: var(--accent-2); }
.brand-note b { color: var(--text); }
.onb-hero h2 { font-size: 25px; margin-bottom: 10px; }
.onb-hero p { font-size: 13.5px; line-height: 1.6; }

/* ---------------------------------------------------------------- МОБИЛЬНЫЙ */
@media (max-width: 1280px) {
  .progress-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-strip { grid-template-columns: repeat(3, 1fr); }
}
/* одна колонка + ручной порядок карточек: сначала ритуалы, потом цели */
@media (max-width: 1180px) {
  .dash { grid-template-columns: 1fr; }
  .dash-col { display: contents; }
  .dash .hero { order: 1; }
  .dash .checkin { order: 2; }
  .dash .quick { order: 3; }
  .dash .dailies-card { order: 4; }
  .dash .goals-card { order: 5; }
  .dash .insights { order: 6; }
  .dash .ledger { order: 7; }
}
@media (max-width: 900px) {
  :root { --rail: 0px; }
  .rail {
    top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: 68px; flex-direction: row;
    padding: 8px 10px; border-right: 0; border-top: 1px solid var(--border); justify-content: space-between;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  .logo { display: none; }
  .nav { flex-direction: row; gap: 2px; }
  .nav-btn { padding: 8px 2px; font-size: 9.5px; }
  .nav-btn.on::before { display: none; }
  .nav-btn.on { background: var(--surface-2); }
  .palette-btn { display: none; }
  .main { margin-left: 0; height: auto; min-height: 100vh; }
  .topbar { padding: 14px 16px; gap: 10px; }
  .tb-left { min-width: 0; flex: 1; }
  .tb-title { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tb-sub { font-size: 11.5px; }
  .tb-right { gap: 6px; flex: none; }
  .pill { padding: 7px 10px; font-size: 12.5px; }
  .lvl-pill .pp-bar { display: none; }
  .content { padding: 16px 16px 110px; }
  .quests-grid, .habits-grid, .journal-grid, .progress-grid, .settings-grid { grid-template-columns: 1fr; }
  .grid { gap: 14px; }
  .card { padding: 18px; border-radius: 20px; }
  .who-name { font-size: 22px; }
  .avatar { width: 62px; height: 62px; border-radius: 20px; }
  .avatar-rank { font-size: 26px; }
  .hero-ring { display: none; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .rank-row { grid-template-columns: 34px 30px 1fr auto; }
  .rr-note { display: none; }
  .toasts { top: auto; bottom: 84px; right: 12px; left: 12px; width: auto; }
  .toast { transform: translateY(120%) scale(.96); }
  .lv-num { font-size: 92px; }
  .scale-label { width: 76px; font-size: 11.5px; }
  .dot { width: 34px; height: 34px; font-size: 15px; }
  .model { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .xp-pill { display: none; }
  .status-bar { gap: 16px; }
  .status-bar .btn { margin-left: 0; width: 100%; }
  .dot { width: 30px; height: 30px; border-radius: 10px; }
  .scale-label { width: 70px; }
  .h-stats { gap: 10px; }
  .hm-legend { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
