/* Executive Assistant — дизайн-система.
   Тёмная тема: глубокий «ночной» фон с живым сиянием; светлая — фарфор с пастельным сиянием.
   Цвета задаются ролями (токенами) и переключаются атрибутом data-theme. */

/* Inter (OFL) хранится рядом с приложением — без внешних запросов */
@font-face { font-family: "InterEA"; src: url("fonts/inter-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "InterEA"; src: url("fonts/inter-cyrillic.woff2") format("woff2"); font-weight: 400 800; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "InterEA"; src: url("fonts/inter-cyrillic-ext.woff2") format("woff2"); font-weight: 400 800; font-display: swap;
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

:root {
  --font: "InterEA", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --sat: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  --sab: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --ease: cubic-bezier(.2, .9, .25, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --tab-h: 66px;

  /* Цвета разделов (r g b) — одинаковые в обеих темах */
  --task: 91 140 255;
  --meet: 167 139 250;
  --call: 251 146 60;
  --lunch: 245 182 66;
  --visit: 34 211 238;
  --exp: 244 114 182;
  --note: 52 211 153;
  --rep: 148 163 184;
  --ok: 52 211 153;
  --warn: 251 191 36;
  --bad: 248 113 113;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07080f;
  --text: #f4f6ff;
  --text-2: rgba(226, 232, 255, .68);
  --text-3: rgba(226, 232, 255, .42);
  --card: rgba(255, 255, 255, .045);
  --card-hi: rgba(255, 255, 255, .075);
  --card-line: rgba(255, 255, 255, .075);
  --card-top: rgba(255, 255, 255, .09);
  --glass: rgba(18, 20, 34, .62);
  --glass-line: rgba(255, 255, 255, .1);
  --sheet: rgba(16, 18, 30, .92);
  --field: rgba(255, 255, 255, .055);
  --field-line: rgba(255, 255, 255, .08);
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .7);
  --accent: #6d95ff;
  --accent-2: #a07bff;
  --accent-ink: #ffffff;
  --grad: linear-gradient(135deg, #5b8cff 0%, #8b6dff 55%, #c06bff 100%);
  --scrim: rgba(2, 3, 8, .55);
  --aur-1: rgba(64, 104, 255, .42);
  --aur-2: rgba(150, 82, 255, .32);
  --aur-3: rgba(20, 184, 220, .22);
  --grain: .05;
  --skel: rgba(255, 255, 255, .06);
  --skel-hi: rgba(255, 255, 255, .12);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f4fa;
  --text: #0b1020;
  --text-2: rgba(16, 24, 48, .64);
  --text-3: rgba(16, 24, 48, .42);
  --card: rgba(255, 255, 255, .82);
  --card-hi: #ffffff;
  --card-line: rgba(20, 30, 70, .07);
  --card-top: rgba(255, 255, 255, .9);
  --glass: rgba(255, 255, 255, .72);
  --glass-line: rgba(20, 30, 70, .08);
  --sheet: rgba(250, 251, 255, .96);
  --field: rgba(20, 30, 70, .045);
  --field-line: rgba(20, 30, 70, .07);
  --shadow: 0 16px 36px -20px rgba(30, 40, 90, .35);
  --accent: #3d6bff;
  --accent-2: #7a4dff;
  --accent-ink: #ffffff;
  --grad: linear-gradient(135deg, #3d6bff 0%, #7a4dff 60%, #b14dff 100%);
  --scrim: rgba(10, 14, 30, .32);
  --aur-1: rgba(91, 140, 255, .28);
  --aur-2: rgba(167, 139, 250, .26);
  --aur-3: rgba(34, 211, 238, .16);
  --grain: .035;
  --skel: rgba(20, 30, 70, .06);
  --skel-hi: rgba(20, 30, 70, .11);
  --ok: 5 150 105;
  --warn: 217 119 6;
  --bad: 220 38 38;
  --lunch: 217 140 20;
  --visit: 8 145 178;
  --note: 5 150 105;
  --call: 234 108 20;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 var(--font);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: 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: rgb(var(--task) / .35); }

/* ---------------------------------------------------------------- фон */
.aurora { position: fixed; inset: -20vh -20vw; z-index: 0; pointer-events: none; filter: blur(60px); }
.aurora i { position: absolute; border-radius: 50%; will-change: transform; }
.aurora i:nth-child(1) { width: 70vw; height: 70vw; left: 0; top: 5vh; background: radial-gradient(circle, var(--aur-1), transparent 65%); animation: drift1 26s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { width: 65vw; height: 65vw; right: 0; top: 0; background: radial-gradient(circle, var(--aur-2), transparent 65%); animation: drift2 32s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { width: 80vw; height: 80vw; left: 20vw; bottom: -10vh; background: radial-gradient(circle, var(--aur-3), transparent 65%); animation: drift3 38s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(18vw, 22vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-16vw, 30vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(-14vw, -26vh) scale(1.1); } }
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- загрузка */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 28px; }
.boot-logo { animation: breathe 2.4s ease-in-out infinite; filter: drop-shadow(0 12px 30px rgba(91, 140, 255, .45)); }
.boot-bar { width: 120px; height: 3px; border-radius: 3px; background: var(--skel); overflow: hidden; }
.boot-bar i { display: block; width: 40%; height: 100%; border-radius: 3px; background: var(--grad); animation: load 1.2s var(--ease) infinite; }
@keyframes breathe { 50% { transform: scale(1.06); } }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------------------------------------------------------------- страница */
#app { position: relative; z-index: 2; min-height: 100vh; padding: calc(var(--sat) + 14px) 16px calc(var(--tab-h) + var(--sab) + 110px); max-width: 640px; margin: 0 auto; }
.page { animation: pageIn .42s var(--ease) both; }
.page > * + * { margin-top: 18px; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } }
.page.back-anim { animation-name: pageBack; }
@keyframes pageBack { from { opacity: 0; transform: translateX(-14px); } }

.hdr { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 6px; }
.hdr h1 { margin: 0; font-size: 32px; line-height: 1.08; font-weight: 800; letter-spacing: -.035em; }
.hdr .sub { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.hdr-actions { display: flex; gap: 8px; flex: none; }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.topbar .back { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 600; font-size: 16px; padding: 8px 8px 8px 0; }
.topbar .back svg { width: 22px; height: 22px; }
.topbar .sp { flex: 1; }

.ibtn {
  width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: var(--card); border: 1px solid var(--card-line); color: var(--text);
  transition: transform .2s var(--ease), background .2s;
}
.ibtn svg { width: 20px; height: 20px; }
.ibtn:active { transform: scale(.92); background: var(--card-hi); }
.ibtn.accent { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 10px 24px -10px rgb(var(--task) / .8); }

/* ---------------------------------------------------------------- иконки */
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 26px; height: 26px; }

/* ---------------------------------------------------------------- карточки */
.card {
  position: relative; background: var(--card); border: 1px solid var(--card-line); border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 var(--card-top), var(--shadow);
}
.card.pad { padding: 16px; }
.glass { background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%); border: 1px solid var(--glass-line); }
.pressable { transition: transform .22s var(--ease), background .22s; cursor: pointer; }
.pressable:active { transform: scale(.975); }

.shd { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 10px; }
.shd h2 { margin: 0; font-size: 20px; font-weight: 750; letter-spacing: -.025em; }
.shd .link { font-size: 14px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 2px; }
.shd .link svg { width: 16px; height: 16px; }
.cap { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin: 22px 4px 8px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.tnum { font-variant-numeric: tabular-nums; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grow { flex: 1; min-width: 0; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack > * + * { margin-top: 10px; }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }

/* ---------------------------------------------------------------- главная: герой */
.greet { display: flex; align-items: center; gap: 12px; }
.greet .hello { font-size: 13px; color: var(--text-2); font-weight: 500; }
.greet .name { font-size: 26px; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.greet .grow { min-width: 0; }

.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 20px; color: #fff; isolation: isolate;
  background:
    radial-gradient(120% 140% at 0% 0%, #4b7bff 0%, transparent 52%),
    radial-gradient(90% 120% at 100% 0%, #a35cff 0%, transparent 55%),
    radial-gradient(100% 120% at 100% 100%, #19c3e6 0%, transparent 50%),
    radial-gradient(80% 90% at 0% 100%, #ff6fb1 0%, transparent 55%),
    #3a2fa8;
  box-shadow: 0 30px 60px -28px rgba(80, 90, 255, .75), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .18; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.hero::after { content: ""; position: absolute; top: -50%; left: -60%; width: 50%; height: 200%; z-index: -1;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent); transform: rotate(18deg);
  animation: shine 1.6s .4s var(--ease) both; }
@keyframes shine { from { left: -60%; } to { left: 130%; } }
.hero-top { display: flex; gap: 18px; align-items: center; }
.hero h3 { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; opacity: .82; }
.hero .big { font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin-top: 6px; }
.hero .hint { font-size: 13px; opacity: .85; margin-top: 6px; }
.ring { position: relative; width: 96px; height: 96px; flex: none; }
.ring svg { width: 96px; height: 96px; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255, 255, 255, .22); }
.ring .val { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); filter: drop-shadow(0 0 6px rgba(255, 255, 255, .7)); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .lbl b { font-size: 24px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.ring .lbl span { font-size: 11px; opacity: .8; margin-top: 3px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.hero-stat { border-radius: 16px; padding: 10px 12px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .18); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); text-align: left; color: #fff; }
.hero-stat b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.hero-stat span { font-size: 12px; opacity: .85; }
.hero-stat.alert b { color: #ffe1e1; }

/* быстрые действия */
.qa { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.qa::-webkit-scrollbar { display: none; }
.qa-item { flex: none; width: 82px; scroll-snap-align: start; display: grid; justify-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); text-align: center; line-height: 1.2; }
.qa-item .sq { width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; position: relative; transition: transform .25s var(--spring);
  background: linear-gradient(160deg, rgb(var(--c) / .26), rgb(var(--c) / .1)); border: 1px solid rgb(var(--c) / .28); color: rgb(var(--c));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 12px 24px -16px rgb(var(--c) / .9); }
.qa-item .sq svg { width: 24px; height: 24px; }
.qa-item:active .sq { transform: scale(.88); }

/* ---------------------------------------------------------------- лента дня */
.tl { padding: 16px 0 8px; }
.tl-row { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 10px 16px 10px 14px; align-items: start; }
.tl-row::before { content: ""; position: absolute; left: 74px; top: 0; bottom: 0; width: 2px; background: var(--card-line); }
.tl-row:first-child::before { top: 22px; }
.tl-row:last-child::before { bottom: calc(100% - 22px); }
.tl-time { font-size: 14px; font-weight: 700; padding-top: 2px; font-variant-numeric: tabular-nums; }
.tl-time small { display: block; font-size: 11px; font-weight: 500; color: var(--text-3); }
.tl-body { position: relative; padding-left: 16px; min-width: 0; }
.tl-body::before { content: ""; position: absolute; left: -9px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: rgb(var(--c)); box-shadow: 0 0 0 4px var(--bg), 0 0 14px rgb(var(--c) / .8); }
.tl-title { font-weight: 650; }
.tl-meta { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.tl-row.past { opacity: .5; }
.tl-now { position: relative; height: 0; margin: 2px 16px 2px 66px; border-top: 2px dashed rgb(var(--bad) / .7); }
.tl-now span { position: absolute; left: -2px; top: -11px; font-size: 11px; font-weight: 700; color: rgb(var(--bad)); background: var(--bg); padding: 2px 6px; border-radius: 8px; transform: translateX(-100%); }
.tl-now::before { content: ""; position: absolute; left: 6px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: rgb(var(--bad)); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(var(--bad) / .6); } 100% { box-shadow: 0 0 0 12px rgb(var(--bad) / 0); } }

/* ---------------------------------------------------------------- списки */
.group { overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 56px; position: relative; width: 100%; text-align: left; transition: background .15s; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; height: 1px; background: var(--card-line); }
.row.nosep + .row::before, .row.nosep::before { left: 16px; }
.row:active { background: var(--card-hi); }
.row .chev { color: var(--text-3); width: 18px; height: 18px; }
.row .val { color: var(--text-2); font-size: 14px; text-align: right; }
.row-title { font-weight: 600; }
.row-sub { font-size: 13px; color: var(--text-2); margin-top: 1px; }
.sq-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff;
  background: linear-gradient(150deg, rgb(var(--c)), rgb(var(--c) / .72)); box-shadow: 0 6px 14px -8px rgb(var(--c)); }
.sq-ic svg { width: 19px; height: 19px; }
.sq-ic.soft { background: rgb(var(--c) / .15); color: rgb(var(--c)); box-shadow: none; }

/* элемент списка — отдельная карточка */
.items > * + * { margin-top: 8px; }
.item { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--card-line); box-shadow: inset 0 1px 0 var(--card-top); width: 100%; text-align: left; transition: transform .22s var(--ease), opacity .35s, background .2s; }
.item:active { transform: scale(.985); }
.item-title { font-weight: 650; line-height: 1.3; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 5px; font-size: 13px; color: var(--text-2); }
.item-meta .m { display: inline-flex; align-items: center; gap: 4px; }
.item-meta .m svg { width: 14px; height: 14px; }
.item.done .item-title { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--text-3); }
.item.leaving { opacity: 0; transform: translateX(30px) scale(.96); }
.item .side { text-align: right; flex: none; }
.amount { font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }

/* чекбокс задачи */
.chk { width: 26px; height: 26px; border-radius: 50%; flex: none; position: relative; margin-top: -1px;
  border: 2px solid rgb(var(--c, var(--task)) / .55); display: grid; place-items: center; transition: all .3s var(--ease); }
.chk svg { width: 15px; height: 15px; stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .35s .1s var(--ease); }
.chk.on { background: var(--grad); border-color: transparent; box-shadow: 0 6px 16px -6px rgb(var(--task)); }
.chk.on svg { stroke-dashoffset: 0; }
.chk.pop { animation: chkpop .45s var(--spring); }
@keyframes chkpop { 40% { transform: scale(1.25); } }
.burst { position: fixed; z-index: 90; pointer-events: none; width: 6px; height: 6px; border-radius: 50%; animation: burst .7s var(--ease) forwards; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

/* значки */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 650; white-space: nowrap;
  color: rgb(var(--c)); background: rgb(var(--c) / .14); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.nodot::before { display: none; }
.prio { display: inline-flex; align-items: center; gap: 3px; color: rgb(var(--bad)); font-weight: 650; }
.prio svg { width: 13px; height: 13px; }

/* ---------------------------------------------------------------- переключатели и поиск */
.seg { position: relative; display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--field); border: 1px solid var(--field-line); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { position: relative; z-index: 1; flex: 1 0 auto; height: 34px; padding: 0 12px; border-radius: 12px; font-size: 13.5px; font-weight: 650; color: var(--text-2); white-space: nowrap; transition: color .25s; }
.seg button.on { color: var(--text); }
.seg button .n { margin-left: 5px; font-size: 11.5px; color: var(--text-3); font-weight: 700; }
.seg button.on .n { color: var(--accent); }
.seg .thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: 12px; background: var(--card-hi); box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .45), inset 0 1px 0 var(--card-top); transition: transform .38s var(--ease), width .38s var(--ease); }
[data-theme="dark"] .seg .thumb { background: rgba(255, 255, 255, .11); }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 17px; display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600;
  background: var(--field); border: 1px solid var(--field-line); color: var(--text-2); transition: all .2s var(--ease); }
.chip svg { width: 15px; height: 15px; }
.chip.on { background: var(--text); color: var(--bg); border-color: transparent; }
.chip:active { transform: scale(.94); }

.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 15px; background: var(--field); border: 1px solid var(--field-line); }
.search svg { color: var(--text-3); }
.search input { flex: 1; border: 0; background: none; outline: none; font-size: 15.5px; min-width: 0; }
.search input::placeholder { color: var(--text-3); }

/* ---------------------------------------------------------------- кнопки */
.btn { height: 50px; padding: 0 20px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 15.5px;
  background: var(--grad); color: #fff; box-shadow: 0 14px 28px -14px rgb(var(--task) / .9), inset 0 1px 0 rgba(255, 255, 255, .25); transition: transform .2s var(--ease), opacity .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }
.btn.busy::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.block { width: 100%; }
.btn.sm { height: 38px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn.sec { background: var(--card-hi); color: var(--text); box-shadow: inset 0 0 0 1px var(--card-line); }
[data-theme="dark"] .btn.sec { background: rgba(255, 255, 255, .08); }
.btn.ghost { background: transparent; color: var(--accent); box-shadow: none; }
.btn.danger { background: rgb(var(--bad) / .12); color: rgb(var(--bad)); box-shadow: none; }
.btn.ok { background: linear-gradient(135deg, rgb(var(--ok)), #10b981); }
.btn svg { width: 19px; height: 19px; }
.btns { display: flex; gap: 10px; }
.btns > * { flex: 1; min-width: 0; }
.btns > .btn { padding: 0 12px; }

/* ---------------------------------------------------------------- нижняя панель и «+» */
.tabbar { position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(10px + var(--sab)); height: var(--tab-h); max-width: 616px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; border-radius: 24px; box-shadow: 0 20px 40px -14px rgba(0, 0, 0, .5), inset 0 1px 0 var(--card-top); }
.tab { position: relative; z-index: 1; display: grid; justify-items: center; align-content: center; gap: 3px; font-size: 10.5px; font-weight: 650; color: var(--text-3); transition: color .25s; }
.tab svg { width: 23px; height: 23px; transition: transform .35s var(--spring); }
.tab.on { color: var(--accent); }
.tab.on svg { transform: translateY(-1px) scale(1.06); }
.tab .dot { position: absolute; top: 6px; right: calc(50% - 18px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 10px; line-height: 16px; color: #fff; background: rgb(var(--bad)); box-shadow: 0 0 0 2px var(--bg); }
.tab-ind { position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 6px; border-radius: 18px; background: rgb(var(--task) / .13); transition: transform .45s var(--ease); }

.fab { position: fixed; z-index: 41; right: 18px; bottom: calc(var(--tab-h) + 24px + var(--sab)); width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center;
  background: var(--grad); color: #fff; box-shadow: 0 18px 34px -12px rgb(var(--task) / .95), inset 0 1px 0 rgba(255, 255, 255, .35); transition: transform .35s var(--spring); }
.fab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; transition: transform .35s var(--spring); }
.fab:active { transform: scale(.9); }
.fab.open svg { transform: rotate(135deg); }
@media (min-width: 680px) { .fab { right: calc(50% - 320px + 18px); } }

/* ---------------------------------------------------------------- шторки */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; }
.sheet-back { position: absolute; inset: 0; background: var(--scrim); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .35s var(--ease); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; max-height: calc(100% - var(--sat) - 18px); display: flex; flex-direction: column;
  background: var(--sheet); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  border-radius: var(--r-xl) var(--r-xl) 0 0; border: 1px solid var(--glass-line); border-bottom: 0;
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .6); transform: translateY(100%); transition: transform .48s var(--ease); }
.sheet-wrap.open .sheet-back { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-wrap.closing .sheet { transition-duration: .3s; }
.sheet-handle { padding: 8px 0 2px; display: grid; place-items: center; touch-action: none; }
.sheet-handle i { width: 38px; height: 5px; border-radius: 3px; background: var(--text-3); opacity: .5; }
.sheet-hdr { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 2px 12px 10px; touch-action: none; }
.sheet-hdr h3 { margin: 0; font-size: 16.5px; font-weight: 750; text-align: center; letter-spacing: -.02em; }
.sheet-hdr .l { justify-self: start; }
.sheet-hdr .r { justify-self: end; }
.sheet-hdr .tbtn { height: 36px; padding: 0 8px; font-size: 16px; font-weight: 600; color: var(--accent); }
.sheet-hdr .tbtn.strong { font-weight: 750; }
.sheet-hdr .tbtn.muted { color: var(--text-2); }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 6px 16px calc(var(--sab) + 22px); }
.sheet-body > * + *, .sheet-body > form > * + * { margin-top: 16px; }
.sheet-body > form > .title-inp + * { margin-top: 10px; }

/* меню «Создать» */
.create-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; padding: 6px 0 4px; }
.create-grid .qa-item { width: auto; animation: popIn .45s var(--spring) both; }
.create-grid .qa-item:nth-child(2) { animation-delay: .03s; } .create-grid .qa-item:nth-child(3) { animation-delay: .06s; }
.create-grid .qa-item:nth-child(4) { animation-delay: .09s; } .create-grid .qa-item:nth-child(5) { animation-delay: .12s; }
.create-grid .qa-item:nth-child(6) { animation-delay: .15s; } .create-grid .qa-item:nth-child(7) { animation-delay: .18s; }
.create-grid .qa-item:nth-child(8) { animation-delay: .21s; }
@keyframes popIn { from { opacity: 0; transform: translateY(16px) scale(.8); } }

/* ---------------------------------------------------------------- формы */
.fld { display: block; }
.fld > .lbl { display: flex; justify-content: space-between; font-size: 13px; font-weight: 650; color: var(--text-2); margin: 0 4px 7px; }
.fld > .lbl .opt { font-weight: 500; color: var(--text-3); }
.inp, .fld input:not([type=checkbox]):not([type=file]), .fld textarea, .fld select {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--field-line); background: var(--field);
  outline: none; font-size: 16px; transition: border-color .2s, box-shadow .2s, background .2s; -webkit-appearance: none; appearance: none;
}
.fld textarea { min-height: 92px; resize: none; line-height: 1.45; }
.fld input:focus, .fld textarea:focus, .fld select:focus { border-color: rgb(var(--task) / .7); box-shadow: 0 0 0 4px rgb(var(--task) / .16); background: var(--card-hi); }
[data-theme="dark"] .fld input:focus, [data-theme="dark"] .fld textarea:focus, [data-theme="dark"] .fld select:focus { background: rgba(255, 255, 255, .08); }
.fld input::placeholder, .fld textarea::placeholder { color: var(--text-3); }
.fld select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238891b0' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 38px; }
.fld input[type=date], .fld input[type=time], .fld input[type=datetime-local] { min-width: 0; display: flex; align-items: center; }
.fld input::-webkit-date-and-time-value { text-align: left; }
.fld.err input, .fld.err textarea, .fld.err select { border-color: rgb(var(--bad) / .8); box-shadow: 0 0 0 4px rgb(var(--bad) / .14); }
.fld .help { font-size: 12.5px; color: var(--text-3); margin: 6px 4px 0; }
.fld .msg { font-size: 12.5px; color: rgb(var(--bad)); margin: 6px 4px 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two > .fld { min-width: 0; }

.title-inp { width: 100%; border: 0; background: none; outline: none; font-size: 22px; font-weight: 750; letter-spacing: -.025em; padding: 4px 2px; }
.title-inp::placeholder { color: var(--text-3); }

.money { display: grid; justify-items: center; gap: 6px; padding: 14px 0 4px; }
.money .amt { display: flex; align-items: baseline; justify-content: center; gap: 8px; width: 100%; }
.money input { width: 100%; max-width: 280px; border: 0; background: none; outline: none; text-align: center; font-size: 42px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.money input::placeholder { color: var(--text-3); }
.money .cur { font-size: 18px; font-weight: 700; color: var(--text-2); }

.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-btn { height: 40px; padding: 0 14px; border-radius: 13px; display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px;
  background: var(--field); border: 1px solid var(--field-line); color: var(--text-2); transition: all .2s var(--ease); }
.opt-btn svg { width: 17px; height: 17px; }
.opt-btn.on { color: rgb(var(--c, var(--task))); background: rgb(var(--c, var(--task)) / .14); border-color: rgb(var(--c, var(--task)) / .45); }
.opt-btn:active { transform: scale(.95); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 6px 16px; }
.switch input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.switch .tg { width: 51px; height: 31px; border-radius: 16px; background: var(--field-line); position: relative; flex: none; transition: background .25s; }
[data-theme="dark"] .switch .tg { background: rgba(255, 255, 255, .14); }
.switch .tg::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .25); transition: transform .3s var(--spring); }
.switch input:checked + .tg { background: rgb(var(--ok)); }
.switch input:checked + .tg::after { transform: translateX(20px); }
.switch input[type=time] { width: auto; min-height: 36px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--field-line); background: var(--field); font-size: 15px; }

.stepper { display: flex; align-items: center; border-radius: 14px; background: var(--field); border: 1px solid var(--field-line); height: 48px; overflow: hidden; }
.stepper button { width: 48px; height: 100%; display: grid; place-items: center; color: var(--accent); }
.stepper button svg { width: 20px; height: 20px; }
.stepper input { flex: 1; min-width: 0; text-align: center; border: 0 !important; background: none !important; box-shadow: none !important; font-weight: 750; font-size: 18px; padding: 0 !important; min-height: 0 !important; }

.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick button { height: 30px; padding: 0 11px; border-radius: 10px; font-size: 12.5px; font-weight: 650; color: var(--accent); background: rgb(var(--task) / .1); }
.quick button:active { transform: scale(.94); }

.sum-box { border-radius: 16px; padding: 14px 16px; background: linear-gradient(135deg, rgb(var(--task) / .14), rgb(var(--meet) / .12)); border: 1px solid rgb(var(--task) / .2); }
.sum-box .between + .between { margin-top: 6px; }
.sum-box .total { font-size: 22px; font-weight: 800; letter-spacing: -.03em; }

.upload { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1.5px dashed var(--field-line); background: var(--field); width: 100%; text-align: left; }
.upload img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.upload input { display: none; }

/* ---------------------------------------------------------------- детали */
.detail-hero { padding: 20px; border-radius: var(--r-xl); position: relative; overflow: hidden; }
.detail-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 100% at 0% 0%, rgb(var(--c) / .28), transparent 60%), radial-gradient(100% 100% at 100% 100%, rgb(var(--c) / .12), transparent 60%); pointer-events: none; }
.detail-hero > * { position: relative; }
.detail-hero h2 { margin: 12px 0 0; font-size: 25px; line-height: 1.18; font-weight: 800; letter-spacing: -.03em; word-break: break-word; }
.detail-hero .big-amount { font-size: 38px; font-weight: 850; letter-spacing: -.045em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.kv { padding: 4px 0; }
.kv .r { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; align-items: baseline; }
.kv .r + .r { border-top: 1px solid var(--card-line); }
.kv .k { color: var(--text-2); font-size: 14px; flex: none; }
.kv .v { text-align: right; font-weight: 600; min-width: 0; word-break: break-word; }
.text-block { padding: 14px 16px; white-space: pre-wrap; line-height: 1.5; word-break: break-word; }

.actions-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.act { display: grid; justify-items: center; gap: 7px; padding: 14px 6px 12px; border-radius: 18px; font-size: 12.5px; font-weight: 650; color: var(--text); background: var(--card); border: 1px solid var(--card-line); box-shadow: inset 0 1px 0 var(--card-top); transition: transform .2s var(--ease); }
.act .ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: rgb(var(--c, var(--task))); background: rgb(var(--c, var(--task)) / .15); }
.act .ico svg { width: 21px; height: 21px; }
.act:active { transform: scale(.94); }
.act.disabled { opacity: .4; pointer-events: none; }

/* шаги статуса */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.step { display: grid; justify-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; color: var(--text-3); text-align: center; line-height: 1.15; }
.step .bar { width: 100%; height: 6px; border-radius: 3px; background: var(--field-line); overflow: hidden; }
[data-theme="dark"] .step .bar { background: rgba(255, 255, 255, .1); }
.step .bar i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 3px; transition: width .6s var(--ease); }
.step.on { color: var(--text); }
.step.on .bar i { width: 100%; }

/* ---------------------------------------------------------------- аватары */
.av { width: 44px; height: 44px; border-radius: 15px; flex: none; display: grid; place-items: center; font-weight: 750; font-size: 15px; color: #fff; letter-spacing: 0;
  background: linear-gradient(140deg, hsl(var(--h) 78% 64%), hsl(calc(var(--h) + 32) 72% 50%)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 8px 18px -10px hsl(var(--h) 80% 50%); overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.lg { width: 84px; height: 84px; border-radius: 28px; font-size: 30px; }
.av.sm { width: 32px; height: 32px; border-radius: 11px; font-size: 12px; }
.av.round { border-radius: 50%; }
.call-btn { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: rgb(var(--ok)); background: rgb(var(--ok) / .14); flex: none; transition: transform .2s var(--ease); }
.call-btn svg { width: 19px; height: 19px; }
.call-btn:active { transform: scale(.88); }
.sel-mark { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--text-3); flex: none; display: grid; place-items: center; transition: all .25s var(--ease); }
.sel-mark svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 3; opacity: 0; }
.on .sel-mark { background: var(--grad); border-color: transparent; }
.on .sel-mark svg { opacity: 1; }
.selbar { position: fixed; z-index: 45; left: 12px; right: 12px; bottom: calc(var(--tab-h) + 22px + var(--sab)); max-width: 616px; margin: 0 auto; padding: 10px 10px 10px 18px; border-radius: 20px; display: flex; align-items: center; gap: 10px; animation: popIn .4s var(--spring); }

/* ---------------------------------------------------------------- пустые состояния */
.empty { display: grid; justify-items: center; text-align: center; padding: 34px 20px; gap: 6px; }
.empty .orb { width: 86px; height: 86px; border-radius: 30px; display: grid; place-items: center; margin-bottom: 10px; position: relative;
  background: linear-gradient(150deg, rgb(var(--c, var(--task)) / .3), rgb(var(--c, var(--task)) / .08)); color: rgb(var(--c, var(--task)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 20px 40px -20px rgb(var(--c, var(--task))); animation: float 4s ease-in-out infinite; }
.empty .orb::after { content: ""; position: absolute; inset: -10px; border-radius: 36px; border: 1px dashed rgb(var(--c, var(--task)) / .3); }
.empty .orb svg { width: 36px; height: 36px; }
.empty b { font-size: 17px; font-weight: 750; letter-spacing: -.02em; }
.empty p { margin: 0; color: var(--text-2); font-size: 14px; max-width: 280px; }
.empty .btn { margin-top: 12px; }
@keyframes float { 50% { transform: translateY(-6px); } }
.empty.sm { padding: 18px 16px; }
.empty.sm .orb { width: 56px; height: 56px; border-radius: 20px; margin-bottom: 4px; animation: none; }
.empty.sm .orb::after { display: none; }
.empty.sm .orb svg { width: 24px; height: 24px; }

/* ---------------------------------------------------------------- уведомления */
#toasts { position: fixed; z-index: 100; top: calc(var(--sat) + 10px); left: 0; right: 0; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; max-width: 420px; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 18px; font-size: 14.5px; font-weight: 600; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .5); animation: toastIn .5s var(--spring); }
.toast .ic { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: rgb(var(--c)); flex: none; }
.toast .ic svg { width: 16px; height: 16px; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-24px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-16px) scale(.95); } }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; font-size: 13.5px; background: rgb(var(--c) / .12); border: 1px solid rgb(var(--c) / .25); }
.banner svg { color: rgb(var(--c)); }
.banner b { font-weight: 700; }

/* ---------------------------------------------------------------- скелеты */
.skel { border-radius: 14px; background: linear-gradient(90deg, var(--skel) 0%, var(--skel-hi) 50%, var(--skel) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- лента дней (встречи) */
.days { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 6px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.days::-webkit-scrollbar { display: none; }
.day { flex: none; width: 52px; height: 72px; border-radius: 18px; display: grid; justify-items: center; align-content: center; gap: 2px; scroll-snap-align: center;
  background: var(--card); border: 1px solid var(--card-line); transition: all .25s var(--ease); position: relative; }
.day small { font-size: 11px; font-weight: 650; color: var(--text-3); text-transform: uppercase; }
.day b { font-size: 20px; font-weight: 800; letter-spacing: -.03em; }
.day .dots { display: flex; gap: 3px; height: 5px; }
.day .dots i { width: 5px; height: 5px; border-radius: 50%; background: rgb(var(--meet)); }
.day.today b { color: var(--accent); }
.day.on { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 12px 24px -12px rgb(var(--task)); transform: translateY(-2px); }
.day.on small, .day.on b { color: #fff; }
.day.on .dots i { background: #fff; }

.meet { display: grid; grid-template-columns: 4px 1fr; gap: 12px; padding: 14px 14px 14px 12px; }
.meet .rail { border-radius: 2px; background: linear-gradient(rgb(var(--c)), rgb(var(--c) / .4)); }
.meet .when { font-size: 13px; font-weight: 700; color: rgb(var(--c)); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- графики */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--card-line); box-shadow: inset 0 1px 0 var(--card-top); min-width: 0; }
.kpi span { font-size: 12.5px; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi span svg { width: 15px; height: 15px; color: rgb(var(--c)); }
.kpi b { display: block; margin-top: 6px; font-size: 20px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.wide { grid-column: 1 / -1; }
.kpi.accent { background: linear-gradient(140deg, rgb(var(--exp) / .2), rgb(var(--meet) / .14)); border-color: rgb(var(--exp) / .25); }

.viz { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --grid: #e1e0d9; --base: #c3c2b7; }
[data-theme="dark"] .viz { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --grid: #2c2c2a; --base: #383835; }
.propbar { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; margin: 4px 0 14px; }
.propbar i { display: block; height: 100%; min-width: 3px; transition: flex-grow .8s var(--ease); }
.propbar i:first-child { border-radius: 4px 0 0 4px; } .propbar i:last-child { border-radius: 0 4px 4px 0; }
.legend .li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; }
.legend .li + .li { border-top: 1px solid var(--card-line); }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .pct { color: var(--text-3); font-size: 12.5px; width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.bars { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 18px; border-bottom: 1px solid var(--base); }
.bars .b { flex: 1; position: relative; height: 100%; display: flex; align-items: flex-end; cursor: pointer; }
.bars .b i { display: block; width: 100%; max-width: 26px; margin: 0 auto; border-radius: 4px 4px 0 0; background: var(--s1); min-height: 2px; transition: height .7s var(--ease), opacity .2s; }
.bars .b.zero i { background: var(--grid); }
.bars:hover .b i, .bars.touched .b i { opacity: .45; }
.bars .b.hl i { opacity: 1; }
.bars .gl { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--grid); pointer-events: none; }
.bars .gl span { position: absolute; right: 0; top: -15px; font-size: 10.5px; color: var(--text-3); }
.bar-x { display: flex; gap: 4px; margin-top: 6px; }
.bar-x span { flex: 1; text-align: center; font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tip { position: absolute; z-index: 5; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 6px 9px; border-radius: 10px; font-size: 12px; font-weight: 650; background: var(--text); color: var(--bg); pointer-events: none; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5); }

/* ---------------------------------------------------------------- заметки */
.notes-grid { columns: 2; column-gap: 10px; }
.note { break-inside: avoid; margin-bottom: 10px; display: block; width: 100%; text-align: left; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--card-line); box-shadow: inset 0 1px 0 var(--card-top); position: relative; overflow: hidden; transition: transform .2s var(--ease); }
.note::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: rgb(var(--c)); opacity: .9; }
.note:active { transform: scale(.97); }
.note h4 { margin: 2px 0 6px; font-size: 15px; font-weight: 750; letter-spacing: -.02em; }
.note p { margin: 0; font-size: 13.5px; color: var(--text-2); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.note .foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 10px; font-size: 11.5px; color: var(--text-3); }
.note .pin { position: absolute; top: 10px; right: 10px; color: rgb(var(--c)); }
.note .pin svg { width: 15px; height: 15px; }

/* отчёт */
.report-text { width: 100%; min-height: 52vh; border: 0; outline: none; background: none; font: 14.5px/1.55 var(--font); white-space: pre-wrap; padding: 16px; resize: none; }

/* профиль в «Ещё» */
.profile { display: flex; align-items: center; gap: 14px; padding: 16px; }
.profile .nm { font-size: 18px; font-weight: 750; letter-spacing: -.02em; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { display: grid; gap: 14px; padding: 16px; border-radius: 20px; background: var(--card); border: 1px solid var(--card-line); box-shadow: inset 0 1px 0 var(--card-top); text-align: left; position: relative; overflow: hidden; transition: transform .22s var(--ease); }
.tile::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgb(var(--c) / .25), transparent 70%); }
.tile:active { transform: scale(.96); }
.tile b { font-size: 15px; font-weight: 700; display: block; }
.tile small { font-size: 12.5px; color: var(--text-2); }

/* экран блокировки / вне Telegram */
.gate { min-height: calc(100vh - 140px); display: grid; place-content: center; justify-items: center; text-align: center; gap: 14px; padding: 20px; }
.gate .logo { width: 96px; height: 96px; border-radius: 30px; display: grid; place-items: center; background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .02)); border: 1px solid var(--glass-line); box-shadow: 0 30px 60px -20px rgb(var(--task) / .7); animation: float 5s ease-in-out infinite; }
.gate h1 { margin: 8px 0 0; font-size: 30px; font-weight: 850; letter-spacing: -.04em; line-height: 1.1; }
.gate h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate p { margin: 0; color: var(--text-2); max-width: 320px; }
.gate .feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; width: 100%; max-width: 360px; }
.gate .feat div { padding: 12px 6px; border-radius: 16px; font-size: 12px; font-weight: 600; color: var(--text-2); display: grid; justify-items: center; gap: 6px; background: var(--card); border: 1px solid var(--card-line); }
.gate .feat svg { color: rgb(var(--c)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .aurora i { animation: none; }
}
@media (max-width: 360px) {
  .hdr h1 { font-size: 28px; }
  .qa-item { width: 74px; }
  .hero-stat b { font-size: 19px; }
  .ring, .ring svg { width: 84px; height: 84px; }
}
