/* ================= Шрифты ================= */
@font-face { font-family: "InterV"; src: url("fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "InterV"; src: url("fonts/inter-cyrillic-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "InterV"; src: url("fonts/inter-cyrillic-ext-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

/* ================= Темы ================= */
:root {
  --font: "SF Pro Display", "SF Pro Text", -apple-system, "InterV", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --r-xl: 28px; --r-lg: 22px; --r-md: 14px; --r-sm: 10px;

  --bg: #000; --bg2: #121214;
  --glow: rgba(255,255,255,.17); --glow2: rgba(255,255,255,.07); --orb: rgba(255,255,255,.08);
  --text: #f5f5f7; --text2: #a1a1a6; --text3: #6e6e73;
  --accent: #f5f5f7; --accent-text: #000; --link: #2997ff;
  --glass: rgba(255,255,255,.06); --glass-strong: rgba(28,28,30,.55);
  --line: rgba(255,255,255,.10); --hi: rgba(255,255,255,.22);
  --field: rgba(255,255,255,.06);
  --shadow: 0 30px 60px -20px rgba(0,0,0,.7), 0 0 0 .5px rgba(255,255,255,.04);
  --s-new: #3a3a3c; --s-sent: #8e8e93; --s-replied: #c7c7cc; --s-deal: #ffffff; --s-declined: #636366;
  --c1: #f5f5f7; --c2: #8e8e93;
  color-scheme: dark;
}
[data-theme="graphite"] {
  --bg: #0b0b0d; --bg2: #1d1d1f;
  --glow: rgba(41,151,255,.20); --glow2: rgba(191,90,242,.10); --orb: rgba(41,151,255,.10);
  --accent: #0a84ff; --accent-text: #fff;
  --s-new: #636366; --s-sent: #0a84ff; --s-replied: #ff9f0a; --s-deal: #30d158; --s-declined: #ff453a;
  --c1: #0a84ff; --c2: #30d158;
}
[data-theme="titanium"] {
  --bg: #0f0d0b; --bg2: #24201c;
  --glow: rgba(226,206,180,.20); --glow2: rgba(190,160,130,.09); --orb: rgba(226,206,180,.09);
  --text: #f4efe9; --text2: #b3a99d; --text3: #776d62;
  --accent: #dcc7ab; --accent-text: #1a1611; --link: #e3c9a3;
  --s-new: #3a332d; --s-sent: #a08a72; --s-replied: #dcc7ab; --s-deal: #f4efe9; --s-declined: #6b6158;
  --c1: #dcc7ab; --c2: #8a7a69;
}
[data-theme="midnight"] {
  --bg: #03050d; --bg2: #0d1630;
  --glow: rgba(100,210,255,.20); --glow2: rgba(94,92,230,.16); --orb: rgba(94,92,230,.12);
  --accent: #64d2ff; --accent-text: #03111c; --link: #64d2ff;
  --s-new: #3a3f55; --s-sent: #5e5ce6; --s-replied: #64d2ff; --s-deal: #66ffcc; --s-declined: #ff6482;
  --c1: #64d2ff; --c2: #5e5ce6;
}
[data-theme="light"] {
  --bg: #f5f5f7; --bg2: #ffffff;
  --glow: rgba(0,0,0,.07); --glow2: rgba(0,113,227,.06); --orb: rgba(0,0,0,.04);
  --text: #1d1d1f; --text2: #6e6e73; --text3: #a1a1a6;
  --accent: #1d1d1f; --accent-text: #fff; --link: #0066cc;
  --glass: rgba(255,255,255,.55); --glass-strong: rgba(255,255,255,.7);
  --line: rgba(0,0,0,.08); --hi: rgba(255,255,255,.9);
  --field: rgba(0,0,0,.04);
  --shadow: 0 30px 60px -25px rgba(0,0,0,.18), 0 0 0 .5px rgba(0,0,0,.05);
  --s-new: #d2d2d7; --s-sent: #86868b; --s-replied: #0071e3; --s-deal: #1d1d1f; --s-declined: #e8e8ed;
  --c1: #1d1d1f; --c2: #0071e3;
  color-scheme: light;
}
[data-theme="moder"] {
  --bg: #050000; --bg2: #3a0006;
  --glow: rgba(255,40,40,.24); --glow2: rgba(150,0,10,.20); --orb: rgba(255,30,30,.14);
  --text: #fff4f4; --text2: #d3a3a6; --text3: #8a5c60;
  --accent: #ff2d3a; --accent-text: #fff; --link: #ff6b74;
  --line: rgba(255,80,80,.16); --hi: rgba(255,120,120,.28); --field: rgba(255,60,60,.07);
  --s-new: #4a1a1d; --s-sent: #ff6b74; --s-replied: #ffb3b8; --s-deal: #ffffff; --s-declined: #6b3a3d;
  --c1: #ff2d3a; --c2: #ffb3b8;
}
[data-theme="moder"] .bg-base { background: radial-gradient(120% 90% at 85% -10%, #5c0009 0%, #1a0003 45%, #050000 75%); }
[data-theme="moder"] .grad-text { background-image: linear-gradient(100deg, #fff, #ff2d3a 60%, #8c0010); }

/* ================= База ================= */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg);
  font-size: 14px; line-height: 1.47; letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; overflow: hidden; user-select: none;
  transition: background-color .6s var(--ease), color .6s var(--ease);
}
input, textarea, select, button { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
textarea, input { user-select: text; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--text3); }
.muted { color: var(--text2); margin: 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text2); margin: 0 0 6px; }
.grad-text {
  background: linear-gradient(100deg, var(--text) 10%, var(--text3) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="graphite"] .grad-text { background-image: linear-gradient(100deg, #2997ff, #bf5af2 70%, #ff375f); }
[data-theme="midnight"] .grad-text { background-image: linear-gradient(100deg, #64d2ff, #5e5ce6); }
[data-theme="titanium"] .grad-text { background-image: linear-gradient(100deg, #f4efe9, #a08a72); }

/* ================= Фон, реагирующий на мышь ================= */
#bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-base { position: absolute; inset: 0; background: linear-gradient(165deg, var(--bg2) 0%, var(--bg) 55%, var(--bg) 100%); transition: background .8s var(--ease); }
.bg-cursor {
  position: absolute; inset: 0;
  background:
    radial-gradient(520px circle at var(--mx, 50%) var(--my, 30%), var(--glow), transparent 62%),
    radial-gradient(1100px circle at calc(100% - var(--mx, 50%)) calc(120% - var(--my, 30%)), var(--glow2), transparent 60%);
  transition: opacity .6s;
}
body.pressing .bg-cursor { opacity: .75; }
.bg-orb { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; background: radial-gradient(circle, var(--orb), transparent 65%); filter: blur(10px); }
.orb-a { left: -20vmax; top: -25vmax; transform: translate(var(--ox, 0), var(--oy, 0)); }
.orb-b { right: -25vmax; bottom: -30vmax; transform: translate(calc(var(--ox, 0) * -1.4), calc(var(--oy, 0) * -1.4)); }
.bg-grain { position: absolute; inset: -50%; opacity: .05; 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='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
[data-theme="light"] .bg-grain { opacity: .035; }
.ripple { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; border: 1px solid var(--text); opacity: .35; animation: ripple .9s var(--ease) forwards; }
@keyframes ripple { to { transform: scale(9); opacity: 0; } }

/* ================= Стекло ================= */
.glass {
  position: relative; isolation: isolate;
  background: linear-gradient(150deg, color-mix(in srgb, var(--glass) 160%, transparent), var(--glass) 40%, color-mix(in srgb, var(--glass) 50%, transparent));
  backdrop-filter: blur(28px) saturate(170%); -webkit-backdrop-filter: blur(28px) saturate(170%);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 0 var(--hi), inset 0 -1px 0 0 color-mix(in srgb, var(--hi) 30%, transparent), inset 0 0 0 1px var(--line), var(--shadow);
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(420px circle at var(--lx, -100%) var(--ly, -100%), color-mix(in srgb, var(--text) 9%, transparent), transparent 60%);
  opacity: 0; transition: opacity .4s;
}
.glass:hover::before { opacity: 1; }
.glass::after { /* бликовый ободок, следующий за курсором */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px;
  background: radial-gradient(260px circle at var(--lx, -100%) var(--ly, -100%), color-mix(in srgb, var(--text) 55%, transparent), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .4s;
}
.glass:hover::after { opacity: .7; }
.glass.heavy { background: var(--glass-strong); backdrop-filter: blur(40px) saturate(180%); }
.liquid { backdrop-filter: blur(6px) url(#liquid) saturate(180%) brightness(1.05); -webkit-backdrop-filter: blur(14px) saturate(180%); }

/* ================= Кнопки и поля ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 18px; border-radius: 980px; font-weight: 500; white-space: nowrap;
  transition: transform .18s var(--ease), background-color .25s, box-shadow .25s, opacity .2s;
}
.btn:active { transform: scale(.96); transition-duration: .08s; }
.btn.primary { background: var(--accent); color: var(--accent-text); box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn.ghost { background: var(--field); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
.btn.danger { color: #ff453a; }
.btn.big { height: 46px; font-size: 16px; padding: 0 26px; }
.btn.sm { height: 28px; padding: 0 12px; font-size: 12px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; color: var(--text2); font-weight: 500; padding-left: 4px; }
.field input, textarea, .select {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r-md); border: 0; outline: 0;
  background: var(--field); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .2s, background-color .2s;
}
textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.field input:focus, textarea:focus, .select:focus { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.select { height: 38px; width: auto; padding: 0 30px 0 14px; appearance: none; cursor: pointer; border-radius: 980px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238e8e93' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.select option { background: var(--bg2); color: var(--text); }

/* Сегментный переключатель с «пузырём» */
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: 980px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { position: relative; z-index: 1; height: 32px; padding: 0 16px; border-radius: 980px; color: var(--text2); font-weight: 500; transition: color .25s; }
.seg button.on { color: var(--text); }
.seg-thumb { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 980px; background: color-mix(in srgb, var(--text) 13%, transparent);
  box-shadow: inset 0 1px 0 var(--hi), 0 4px 14px -4px rgba(0,0,0,.4); transition: transform .45s var(--ease), width .45s var(--ease); }
[data-theme="light"] .seg-thumb { background: #fff; }
.seg.small button { height: 28px; padding: 0 12px; font-size: 12.5px; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text2); font-size: 13px; }
.switch input { display: none; }
.switch i { width: 38px; height: 23px; border-radius: 99px; background: color-mix(in srgb, var(--text) 18%, transparent); position: relative; transition: background .3s; }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .35s var(--ease); }
.switch input:checked + i { background: var(--accent); }
[data-theme="mono"] .switch input:checked + i { background: #f5f5f7; }
[data-theme="mono"] .switch input:checked + i::after { background: #000; }
.switch input:checked + i::after { transform: translateX(15px); }

/* Спиннер в стиле iOS */
.spinner { display: none; width: 16px; height: 16px; position: relative; }
.spinner::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 10%, currentColor); -webkit-mask: radial-gradient(circle, transparent 52%, #000 54%); mask: radial-gradient(circle, transparent 52%, #000 54%);
  animation: spin .8s linear infinite; }
.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= Окно ================= */
.titlebar { position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: 40px; display: flex; align-items: center; padding: 0 16px; }
.lights { display: flex; gap: 8px; }
.light { width: 13px; height: 13px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.25); }
.light svg { width: 8px; height: 8px; fill: none; stroke: rgba(0,0,0,.6); stroke-width: 1.4; opacity: 0; transition: opacity .15s; }
.lights:hover svg { opacity: 1; }
.light.close { background: #ff5f57; } .light.min { background: #febc2e; } .light.max { background: #28c840; }
.light:active { filter: brightness(.8); }
.titlebar-name { position: absolute; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 600; color: var(--text3); letter-spacing: .02em; pointer-events: none; }
#shell:not([hidden]) ~ .titlebar .titlebar-name, body.in-app .titlebar-name { opacity: 0; }

.screen { position: fixed; inset: 0; z-index: 1; }

/* ================= Заставка ================= */
#splash { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: var(--bg); transition: opacity .7s var(--ease), filter .7s var(--ease), transform .7s var(--ease); }
#splash.out { opacity: 0; filter: blur(16px); transform: scale(1.06); pointer-events: none; }
.splash-logo { display: grid; justify-items: center; gap: 18px; }
.logo-mark { width: 84px; height: 84px; fill: none; stroke: var(--text); stroke-width: 2.4; stroke-linecap: round; }
.lm-box { stroke-dasharray: 220; stroke-dashoffset: 220; animation: draw 1.1s var(--ease) forwards; opacity: .4; }
.lm-lens { stroke-dasharray: 70; stroke-dashoffset: 70; animation: draw .8s .35s var(--ease) forwards; }
.lm-handle { stroke-dasharray: 14; stroke-dashoffset: 14; animation: draw .4s .9s var(--ease) forwards; stroke-width: 3.2; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.splash-word { font-size: 30px; font-weight: 600; letter-spacing: -.03em; opacity: 0; animation: rise .8s .5s var(--ease) forwards;
  background: linear-gradient(90deg, var(--text3) 0%, var(--text) 40%, var(--text3) 80%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.splash-word { animation: rise .8s .5s var(--ease) forwards, shimmer 2.2s .5s linear infinite; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.splash-bar { width: 140px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; opacity: 0; animation: rise .5s .7s var(--ease) forwards; }
.splash-bar i { display: block; height: 100%; width: 0; background: var(--text); border-radius: inherit; animation: fill 1.3s .8s var(--ease-io) forwards; }
@keyframes fill { to { width: 100%; } }

/* ================= Вход ================= */
#auth { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 6vw; padding: 60px 8vw; }
.display { font-size: clamp(44px, 5.4vw, 80px); line-height: 1.04; letter-spacing: -.035em; font-weight: 700; margin: 0 0 22px; }
.display.small { font-size: clamp(36px, 3.6vw, 56px); margin-bottom: 0; }
.lead { font-size: 21px; line-height: 1.38; color: var(--text2); max-width: 30ch; margin: 0; letter-spacing: -.015em; font-weight: 450; }
.auth-hero > * { opacity: 0; animation: rise .9s var(--ease) forwards; }
.auth-hero > :nth-child(2) { animation-delay: .08s; } .auth-hero > :nth-child(3) { animation-delay: .16s; }
.auth-card { padding: 30px; display: grid; gap: 16px; border-radius: var(--r-xl); max-width: 420px; width: 100%; justify-self: end;
  opacity: 0; animation: materialize .9s .2s var(--ease) forwards; }
@keyframes materialize { from { opacity: 0; transform: scale(.94) translateY(16px); filter: blur(12px); } to { opacity: 1; transform: none; filter: none; } }
.auth-card .seg { width: 100%; }
.reg-only { display: none; }
.auth-card.register .reg-only { display: grid; animation: rise .4s var(--ease); }
.form-error { min-height: 18px; margin: -4px 0 -6px; color: #ff6961; font-size: 13px; }
.fine { font-size: 12px; color: var(--text3); margin: 0; text-align: center; }
.shake { animation: shake .45s var(--ease) !important; opacity: 1 !important; filter: none !important; }
@keyframes shake { 20%{transform:translateX(-10px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(3px)} }

/* ================= Оболочка ================= */
#shell { display: grid; grid-template-rows: auto 1fr; padding-top: 34px; }
.topnav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 6px 24px 14px; position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; letter-spacing: -.02em; }
.brand-mark { width: 26px; height: 26px; fill: none; stroke: var(--text); stroke-width: 3.4; stroke-linecap: round; }
.brand-mark rect { opacity: .4; }
.tabs { display: flex; padding: 4px; border-radius: 980px; position: relative; }
.tabs button { position: relative; z-index: 1; height: 34px; padding: 0 20px; border-radius: 980px; color: var(--text2); font-weight: 500; transition: color .3s; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--accent-text); }
.tab-thumb { position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: 980px; background: var(--accent); box-shadow: 0 6px 20px -6px color-mix(in srgb, var(--accent) 70%, transparent), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .5s var(--ease), width .5s var(--ease); }
.tab-thumb.squish { animation: squish .5s var(--ease); }
@keyframes squish { 40% { scale: 1.12 .86; } }
.nav-right { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.theme-dots { display: flex; gap: 6px; padding: 7px 9px; border-radius: 980px; }
.theme-dot { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); transition: transform .25s var(--ease), box-shadow .25s; }
.theme-dot:hover { transform: scale(1.18); }
.theme-dot.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text); }
.avatar, .id-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 14px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--text) 30%, transparent), color-mix(in srgb, var(--text) 8%, transparent)); box-shadow: inset 0 1px 0 var(--hi), inset 0 0 0 1px var(--line);
  transition: transform .2s var(--ease); }
.avatar:hover { transform: scale(1.06); }
.avatar.has-img, .id-avatar.has-img { background-size: cover; background-position: center; background-repeat: no-repeat; }
/* аватар в кабинете — кнопка смены фото */
button.id-avatar { position: relative; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; overflow: hidden; }
button.id-avatar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0;
  background: rgba(0,0,0,.45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E") center / 38% no-repeat;
  transition: opacity .2s var(--ease); }
button.id-avatar:hover::after, button.id-avatar:focus-visible::after { opacity: 1; }
button.id-avatar:active { transform: scale(.97); }
.avatar-acts { display: flex; justify-content: center; gap: 14px; margin: 2px 0 6px; }
.avatar-acts button { font: inherit; font-size: 13px; color: var(--text2); background: none; border: 0; padding: 4px 2px; cursor: pointer; }
.avatar-acts button:hover { color: var(--text); }
.avatar-acts button[hidden] { display: none; }

.loadbar { position: absolute; top: 34px; left: 0; right: 0; height: 2px; z-index: 6; pointer-events: none; }
.loadbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, transparent, var(--text)); opacity: 0; }
.loadbar.run i { animation: loadbar .7s var(--ease-io) forwards; }
@keyframes loadbar { 0% { width: 0; opacity: 1; } 70% { width: 85%; opacity: 1; } 100% { width: 100%; opacity: 0; } }

#views { position: relative; min-height: 0; }
.view { position: absolute; inset: 0; display: none; }
.view.active { display: grid; }
.view.enter { animation: viewIn .6s var(--ease) both; }
.view.leave { display: grid; animation: viewOut .3s var(--ease-io) both; pointer-events: none; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px) scale(.985); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes viewOut { to { opacity: 0; transform: scale(.985); filter: blur(8px); } }
.view.scroll { overflow-y: auto; }

/* ================= Поиск ================= */
.view[data-view="search"] { grid-template-columns: 300px 1fr; gap: 20px; padding: 0 24px 24px; }
.checklist { display: grid; grid-template-rows: auto auto 1fr; gap: 14px; padding: 20px 14px 10px; min-height: 0; border-radius: var(--r-xl); }
.cl-head { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; }
.cl-head h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.checklist .seg { margin: 0 4px; }
.ring { position: relative; width: 48px; height: 48px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; stroke-linecap: round; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--accent); stroke-dasharray: 113.1; stroke-dashoffset: 113.1; transition: stroke-dashoffset 1s var(--ease); }
.ring span { font-size: 11px; font-weight: 600; }
.cl-list { list-style: none; margin: 0; padding: 0 2px; overflow-y: auto; min-height: 0; }
.cl-item { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; cursor: pointer;
  transition: background-color .2s; animation: rise .45s var(--ease) both; }
.cl-item:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.cl-item b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-item small { color: var(--text3); font-size: 11.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-item > div { min-width: 0; }
.cl-item small.cl-last { color: var(--text2); margin-top: 2px; }
.cl-item.open { background: color-mix(in srgb, var(--text) 6%, transparent); cursor: default; }
.cl-note-btn { position: relative; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--text3); opacity: .55; transition: opacity .2s, background-color .2s, transform .15s var(--ease); }
.cl-item:hover .cl-note-btn, .cl-note-btn.has, .cl-item.open .cl-note-btn { opacity: 1; }
.cl-note-btn:hover, .cl-item.open .cl-note-btn { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); }
.cl-note-btn:active { transform: scale(.88); }
.cl-note-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.cl-note-btn em { position: absolute; top: -3px; right: -4px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 99px; font: 600 9.5px/15px inherit; font-style: normal; background: var(--accent); color: var(--accent-text); }
.cl-notes { grid-column: 1 / -1; display: grid; gap: 10px; padding: 4px 0 2px; animation: rise .3s var(--ease) both; }
.cl-notes .qn { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-notes .qn button { font-size: 11.5px; padding: 5px 10px; border-radius: 99px; color: var(--text2); background: var(--field); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .15s, color .15s, transform .12s var(--ease); }
.cl-notes .qn button:hover { color: var(--text); background: color-mix(in srgb, var(--text) 12%, transparent); }
.cl-notes .qn button:active { transform: scale(.94); }
.cl-notes .nl { display: grid; gap: 4px; list-style: none; margin: 0; padding: 0; }
.cl-notes .nl li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; font-size: 12.5px; padding: 6px 4px 6px 10px; border-radius: 9px; background: var(--field); }
.cl-notes .nl span { overflow-wrap: anywhere; }
.cl-notes .nl time { color: var(--text3); font-size: 11px; white-space: nowrap; }
.cl-notes .nl button { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--text3); opacity: .6; }
.cl-notes .nl button:hover { opacity: 1; color: var(--text); background: color-mix(in srgb, var(--text) 10%, transparent); }
.cl-notes .nf { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.cl-notes .nf input { min-width: 0; height: 34px; padding: 0 12px; border-radius: 10px; border: 0; outline: 0; font: inherit; font-size: 12.5px; color: var(--text); background: var(--field); box-shadow: inset 0 0 0 1px var(--line); }
.cl-notes .nf input:focus { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cl-notes .nf .btn { height: 34px; padding: 0 12px; font-size: 12.5px; }
.check { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--text3); display: grid; place-items: center; transition: background-color .25s, box-shadow .25s, transform .2s var(--ease); flex: none; }
.check svg { width: 12px; height: 12px; fill: none; stroke: var(--accent-text); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .35s .05s var(--ease); }
.check.on { background: var(--accent); box-shadow: none; }
.check.on svg { stroke-dashoffset: 0; }
.check:active { transform: scale(.85); }
.pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; background: color-mix(in srgb, var(--sc) 22%, transparent); color: color-mix(in srgb, var(--sc) 70%, var(--text)); box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--sc) 50%, transparent); }
.st-new { --sc: var(--s-new); } .st-sent { --sc: var(--s-sent); } .st-replied { --sc: var(--s-replied); } .st-deal { --sc: var(--s-deal); } .st-declined { --sc: var(--s-declined); }
.empty { text-align: center; color: var(--text3); padding: 40px 16px; font-size: 13px; }
.empty svg { width: 42px; height: 42px; stroke: var(--text3); fill: none; stroke-width: 1.5; margin-bottom: 8px; }

.center { display: grid; grid-template-rows: auto auto auto 1fr; min-height: 0; min-width: 0; gap: 14px; }
.toolbar { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; padding: 10px; border-radius: var(--r-xl); }
.search-field { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border-radius: 980px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .25s; }
.search-field:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.search-field svg, .mini-search svg { width: 18px; height: 18px; fill: none; stroke: var(--text2); stroke-width: 2; stroke-linecap: round; flex: none; }
.search-field input, .mini-search input { flex: 1; border: 0; outline: 0; background: none; font-size: 15px; min-width: 0; }
.toolbar .btn.primary { height: 44px; padding: 0 26px; font-size: 15px; }
.chips { grid-column: 1 / -1; display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-btn { height: 30px; padding: 0 14px; border-radius: 99px; font-size: 13px; color: var(--text2); white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line); transition: all .25s var(--ease); }
.chip-btn:hover { color: var(--text); background: var(--field); }
.chip-btn.on { background: var(--text); color: var(--bg); box-shadow: none; }

.grid-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 4px 6px 0; }
.title { margin: 0; font-size: 32px; letter-spacing: -.03em; line-height: 1.1; }
.grid-tools { display: flex; gap: 10px; align-items: center; }
.mini-search { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 99px; width: 200px; }
.mini-search input { font-size: 13px; }
.progress-line { display: none; gap: 8px; align-items: center; font-size: 13px; color: var(--text2); padding: 0 6px; }
.progress-line.on { display: flex; }
.progress-line i { flex: 1; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress-line b { display: block; height: 100%; width: 0; background: var(--text); border-radius: inherit; transition: width .8s var(--ease); }

.grid { overflow-y: auto; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; align-content: start; padding: 4px 6px 30px; margin: 0 -6px; }
.card { padding: 18px; display: grid; gap: 12px; align-content: start; border-radius: var(--r-xl); transform-style: preserve-3d;
  transition: transform .5s var(--ease), box-shadow .4s; will-change: transform; }
.card:hover { box-shadow: inset 0 1px 0 0 var(--hi), inset 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent), 0 40px 70px -25px rgba(0,0,0,.75); }
.card.flash { animation: flash 1.3s var(--ease); }
@keyframes flash { 0%, 100% { box-shadow: var(--shadow); } 25% { box-shadow: 0 0 0 2px var(--accent), 0 0 40px color-mix(in srgb, var(--accent) 40%, transparent); } }
.card-top { display: flex; align-items: center; gap: 8px; }
.card-top .x { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; color: var(--text3); display: grid; place-items: center; opacity: 0; transition: opacity .2s, background-color .2s; }
.card:hover .x { opacity: 1; }
.card-top .x:hover { background: var(--field); color: var(--text); }
.sphere { font-size: 11.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--text2); }
.card h3 { margin: 0; font-size: 21px; letter-spacing: -.02em; line-height: 1.2; font-weight: 650; }
.meta { margin: -6px 0 0; font-size: 12.5px; color: var(--text3); }
.msg { position: relative; }
.msg textarea { font-size: 13px; min-height: 120px; max-height: 260px; color: var(--text2); background: color-mix(in srgb, var(--bg) 35%, transparent); }
.msg textarea:focus { color: var(--text); }
.contacts { display: grid; gap: 6px; }
.ct { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 6px 10px; border-radius: 10px; background: var(--field); cursor: pointer; transition: background-color .2s; min-width: 0; }
.ct:hover { background: color-mix(in srgb, var(--text) 10%, transparent); }
.ct svg { width: 15px; height: 15px; fill: none; stroke: var(--text2); stroke-width: 1.8; flex: none; stroke-linecap: round; stroke-linejoin: round; }
.ct span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--text3); }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card-actions .btn { height: 32px; padding: 0 14px; font-size: 13px; }
/* Фастклик — тёплый акцент, чтобы читался как главное действие */
.btn.fast { color: #1c1300; background: linear-gradient(135deg, #ffd60a, #ff9f0a); box-shadow: 0 8px 22px -10px #ff9f0a; }
.btn.fast:hover { filter: brightness(1.08); box-shadow: 0 10px 28px -8px #ff9f0a; }
.card-actions .btn.fast { padding: 0 11px; }
.fast-next { height: 34px; padding: 0 16px; font-size: 13px; font-weight: 600; }
.ct-tg svg { color: #2aabee; }
.status-row { display: flex; gap: 4px; padding: 3px; border-radius: 99px; background: var(--field); }
.status-row button { flex: 1; height: 28px; border-radius: 99px; font-size: 12px; color: var(--text2); transition: all .25s var(--ease); }
.status-row button:hover { color: var(--text); }
.status-row button.on { background: var(--sc); color: var(--bg); font-weight: 600; }
[data-theme="mono"] .status-row button.on, [data-theme="titanium"] .status-row button.on { color: #000; }
[data-theme="light"] .st-deal.on { color: #fff !important; }
.card-in { animation: cardIn .7s var(--ease) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(.97); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }

.skeleton { height: 360px; border-radius: var(--r-xl); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); position: relative; overflow: hidden; padding: 18px; display: grid; gap: 12px; align-content: start; }
.skeleton i { display: block; height: 12px; border-radius: 6px; background: var(--line); }
.skeleton i:nth-child(2) { height: 22px; width: 70%; } .skeleton i:nth-child(3) { height: 110px; border-radius: 12px; } .skeleton i:nth-child(4) { width: 60%; } .skeleton i:nth-child(5) { width: 45%; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--text) 8%, transparent) 50%, transparent 80%); animation: sweep 1.4s infinite; }
@keyframes sweep { to { transform: translateX(100%); } }

/* ================= Статистика ================= */
.page { padding: 4px 24px 40px; max-width: 1400px; margin: 0 auto; width: 100%; display: grid; gap: 20px; align-content: start; }
.page-head { padding: 6px 4px 6px; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.kpi { padding: 20px; border-radius: var(--r-xl); animation: cardIn .7s var(--ease) both; }
.kpi .k-label { font-size: 13px; color: var(--text2); font-weight: 500; }
.kpi .k-value { font-size: 44px; font-weight: 700; letter-spacing: -.04em; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12px; color: var(--text3); }
.kpi .spark { height: 30px; margin-top: 8px; }
.row { display: grid; gap: 16px; }
.r-2-1 { grid-template-columns: 2fr 1fr; }
.r-1-1-1 { grid-template-columns: 1fr 1.2fr 1fr; }
.panel { padding: 22px; border-radius: var(--r-xl); animation: cardIn .8s var(--ease) both; min-width: 0; }
.panel h3 { margin: 0 0 14px; font-size: 17px; letter-spacing: -.02em; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-head h3 { margin: 0; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text2); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.lg-total { background: color-mix(in srgb, var(--text) 25%, transparent); } .lg-cont { background: var(--c1); }
.chart { position: relative; height: 260px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--text3); font-size: 11px; }
.chart .path { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: dash 1.6s var(--ease) forwards; }
.chart .area { opacity: 0; animation: fadeIn 1s .6s var(--ease) forwards; }
.chart .dot { transition: opacity .2s; }
@keyframes dash { to { stroke-dashoffset: 0; } }
@keyframes fadeIn { to { opacity: 1; } }
.chart .hover-line { stroke: var(--text3); stroke-dasharray: 3 4; opacity: 0; transition: opacity .2s; }
.tip { position: absolute; pointer-events: none; padding: 10px 12px; border-radius: 12px; font-size: 12px; min-width: 130px; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s var(--ease), left .15s var(--ease); z-index: 3; }
.tip.on { opacity: 1; transform: none; }
.tip b { display: block; margin-bottom: 4px; }
.tip div { display: flex; justify-content: space-between; gap: 14px; color: var(--text2); }
.tip div span:last-child { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.donut-wrap { display: grid; justify-items: center; gap: 16px; }
.donut { position: relative; width: 200px; height: 200px; }
.donut svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.donut circle { fill: none; stroke-width: 22; transition: stroke-width .3s var(--ease), opacity .3s; cursor: pointer; }
.donut circle.seg-arc { animation: arcIn 1.2s var(--ease) both; }
.donut circle:hover { stroke-width: 28; }
@keyframes arcIn { from { stroke-dasharray: 0 999; } }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center b { font-size: 36px; letter-spacing: -.04em; line-height: 1; }
.donut-center span { font-size: 12px; color: var(--text2); }
.donut-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; font-size: 12.5px; width: 100%; }
.donut-legend div { display: flex; align-items: center; gap: 8px; color: var(--text2); }
.donut-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--sc); box-shadow: inset 0 0 0 1px var(--line); }
.donut-legend b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }

.funnel { display: grid; gap: 10px; }
.fn-row { display: grid; gap: 5px; }
.fn-row header { display: flex; justify-content: space-between; font-size: 13px; color: var(--text2); }
.fn-row header b { color: var(--text); font-variant-numeric: tabular-nums; }
.fn-bar { height: 34px; border-radius: 10px; background: var(--field); overflow: hidden; }
.fn-bar i { display: block; height: 100%; width: 0; border-radius: 10px; background: linear-gradient(90deg, color-mix(in srgb, var(--c1) 55%, transparent), var(--c1)); transition: width 1.2s var(--ease); }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 34px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-row span:first-child { color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }
.bar-track { position: relative; height: 10px; border-radius: 6px; background: var(--field); }
.bar-track i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 6px; transition: width 1.1s var(--ease); }
.bar-track .t { background: color-mix(in srgb, var(--text) 22%, transparent); }
.bar-track .c { background: var(--c1); }
.cities { display: grid; gap: 4px; }
.city { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); font-size: 14px; animation: rise .5s var(--ease) both; }
.city:last-child { border: 0; }
.city .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--field); font-size: 12px; font-weight: 600; color: var(--text2); }
.city b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ================= Кабинет ================= */
.profile { grid-template-columns: 320px 1fr; align-items: start; max-width: 1180px; }
.id-card { position: sticky; top: 0; padding: 30px 22px 22px; border-radius: var(--r-xl); display: grid; justify-items: center; gap: 4px; text-align: center; animation: cardIn .7s var(--ease) both; }
.id-avatar { width: 96px; height: 96px; font-size: 36px; margin-bottom: 10px; }
.id-card h2 { margin: 0; font-size: 24px; letter-spacing: -.025em; }
.id-stats { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; margin: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; }
.id-stats b { display: block; font-size: 22px; letter-spacing: -.03em; }
.id-stats span { font-size: 11.5px; color: var(--text2); }
.settings { display: grid; gap: 16px; }
.settings .panel { display: grid; gap: 12px; }
.settings .panel h3 { margin: 0; }
.settings .panel:nth-child(2) { animation-delay: .05s; } .settings .panel:nth-child(3) { animation-delay: .1s; } .settings .panel:nth-child(4) { animation-delay: .15s; } .settings .panel:nth-child(5) { animation-delay: .2s; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12px; padding: 4px 10px; border-radius: 8px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line); color: var(--text2); transition: all .2s; }
.tag:hover { color: var(--text); background: color-mix(in srgb, var(--text) 12%, transparent); transform: translateY(-1px); }
.tpl-preview { padding: 14px 16px; border-radius: var(--r-md); background: color-mix(in srgb, var(--bg) 40%, transparent); box-shadow: inset 0 0 0 1px var(--line); }
.tpl-preview p { margin: 0; white-space: pre-wrap; font-size: 13px; color: var(--text2); }
.themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.theme-card { border-radius: 16px; padding: 8px; box-shadow: inset 0 0 0 1px var(--line); transition: transform .3s var(--ease), box-shadow .3s; text-align: left; }
.theme-card:hover { transform: translateY(-3px); }
.theme-card.on { box-shadow: inset 0 0 0 2px var(--text); }
.theme-card .sw { height: 64px; border-radius: 10px; margin-bottom: 8px; position: relative; overflow: hidden; }
.theme-card .sw::after { content: ""; position: absolute; left: 10px; right: 30%; bottom: 10px; height: 14px; border-radius: 6px; background: rgba(255,255,255,.18); backdrop-filter: blur(4px); box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.theme-card b { font-size: 13px; font-weight: 600; padding-left: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.save-bar { position: sticky; bottom: 0; padding: 10px 0 0; display: flex; justify-content: flex-end; }

/* ================= Тост ================= */
.toast { position: fixed; z-index: 60; left: 50%; bottom: 28px; transform: translate(-50%, 30px) scale(.95); padding: 12px 20px; border-radius: 99px; font-size: 13.5px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .35s var(--ease), transform .45s var(--ease); background: var(--glass-strong); }
.toast.on { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ================= Адаптивность и доступность ================= */
@media (max-width: 1250px) { .kpis { grid-template-columns: repeat(3, 1fr); } .r-1-1-1 { grid-template-columns: 1fr 1fr; } .themes { grid-template-columns: repeat(3, 1fr); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (prefers-reduced-transparency: reduce) { .glass { backdrop-filter: none; background: var(--bg2); } }

/* Круговая смена темы */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 9999; }

/* ================= Плашка разработчика ================= */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.dev-badge {
  position: relative; display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px 0 6px; border-radius: 99px;
  background: color-mix(in srgb, var(--bg2) 55%, transparent); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--hi), 0 14px 34px -16px rgba(0,0,0,.8); isolation: isolate; cursor: default; text-decoration: none; color: var(--text);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.dev-badge::before { /* переливающийся ободок */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: -1;
  background: conic-gradient(from var(--spin), transparent 0 55%, color-mix(in srgb, var(--text) 90%, transparent) 70%, transparent 85%), linear-gradient(var(--line), var(--line));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: devSpin 4.5s linear infinite;
}
@keyframes devSpin { to { --spin: 360deg; } }
.dev-badge:hover { transform: translateY(-2px) scale(1.03); box-shadow: inset 0 1px 0 var(--hi), 0 18px 40px -14px color-mix(in srgb, var(--text) 30%, transparent); }
.dev-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: -.04em;
  background: linear-gradient(145deg, var(--text), color-mix(in srgb, var(--text) 45%, var(--bg))); color: var(--bg); box-shadow: 0 0 0 1px var(--line), 0 4px 12px -4px rgba(0,0,0,.6); }
.dev-text { display: grid; line-height: 1.05; }
.dev-text small { font-size: 9px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text3); }
.dev-text b { font-size: 13px; font-weight: 750; letter-spacing: .16em; }
.dev-text b i { font-style: normal; font-weight: 500; letter-spacing: .02em; margin-left: 4px;
  background: linear-gradient(90deg, var(--text3), var(--text), var(--text3)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 3s linear infinite; }
.dev-dock { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 3; opacity: 0; animation: rise .9s .5s var(--ease) forwards; }
.dev-dock .dev-badge { animation: none; }
.splash-dev { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--text3); opacity: 0; animation: rise .8s 1s var(--ease) forwards; }
.splash-dev b { color: var(--text2); font-weight: 700; }
.id-card .dev-badge, .side-foot .dev-badge { justify-self: center; margin-top: 6px; }

/* ================= Тарифы ================= */
.plan-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 6px; border-radius: 99px; font-size: 12.5px; color: var(--text2); white-space: nowrap; transition: transform .25s var(--ease); }
.plan-chip:hover { transform: translateY(-1px); color: var(--text); }
.pb { display: inline-block; line-height: 1.2; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; padding: 4px 9px; border-radius: 99px; color: #000; background: #f5f5f7; }
.pb.p-pro { background: linear-gradient(135deg, #64d2ff, #0a84ff); color: #fff; }
.pb.p-max { background: linear-gradient(135deg, #ffd60a, #ff9f0a 55%, #ff375f); color: #1c1300; }
.pb.p-exp { background: #ff453a; color: #fff; }
.plan-chip .meter { width: 42px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.plan-chip .meter i { display: block; height: 100%; background: var(--text); border-radius: inherit; transition: width .8s var(--ease); }

.need { display: inline-block; vertical-align: 2px; margin-left: 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; padding: 2px 6px; border-radius: 6px;
  color: #1c1300; background: linear-gradient(135deg, #ffd60a, #ff9f0a); }
.need[hidden] { display: none; }
.locked { position: relative; }
.btn.locked { filter: grayscale(.85) brightness(.75); }
.theme-dot.locked, .theme-card.locked { opacity: .45; }
.theme-card.locked .sw::before { content: "🔒"; position: absolute; right: 8px; top: 6px; font-size: 12px; z-index: 1; }
textarea[readonly] { opacity: .6; cursor: not-allowed; }

.lockable { position: relative; display: grid; gap: 20px; }
.lockable.on > .row { filter: blur(10px) saturate(.6); opacity: .55; pointer-events: none; user-select: none; }
.lock-note { display: none; }
.lockable.on .lock-note { display: grid; gap: 8px; justify-items: center; text-align: center; position: absolute; z-index: 5; left: 0; right: 0; margin: 0 auto; top: 90px;
  width: min(440px, 90%); padding: 26px; border-radius: var(--r-xl); animation: materialize .7s var(--ease) both; }
.lock-note b { font-size: 19px; letter-spacing: -.02em; }
.lock-note span { color: var(--text2); margin-bottom: 8px; }

.center-head { text-align: center; display: grid; justify-items: center; gap: 10px; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; max-width: 1180px; width: 100%; margin: 0 auto; }
.plan { position: relative; display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 14px; padding: 28px 26px 24px; border-radius: var(--r-xl); animation: cardIn .8s var(--ease) both; transition: transform .5s var(--ease); }
.plan:hover { transform: translateY(-4px); }
.plan:nth-child(2) { animation-delay: .08s; } .plan:nth-child(3) { animation-delay: .16s; }
.plan h3 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 22px; letter-spacing: -.02em; }
.plan h3 .pb { font-size: 13px; padding: 6px 12px; }
[data-theme="light"] .pb.p-free { background: #1d1d1f; color: #fff; }
.plan .tagline { margin: 0; color: var(--text2); min-height: 42px; }
.plan .price { display: flex; align-items: baseline; gap: 6px; }
.plan .price b { font-size: 52px; line-height: 1; letter-spacing: -.045em; font-weight: 700; }
.plan .price span { color: var(--text2); }
.plan ul { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; align-content: start; }
.plan li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.plan li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--field) center / 11px no-repeat
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 7.5l2.6 2.6L11 4.5' fill='none' stroke='%23a1a1a6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); box-shadow: inset 0 0 0 1px var(--line); }
.plan li.off { color: var(--text3); }
.plan li.off::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M4 7h6' fill='none' stroke='%236e6e73' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.plan .btn { height: 44px; font-size: 15px; }
.plan.current { box-shadow: inset 0 0 0 1.5px var(--text), var(--shadow); }
.plan.hot { background: linear-gradient(160deg, color-mix(in srgb, #ff9f0a 16%, var(--glass)), var(--glass) 55%); }
.plan.hot::before { opacity: 1; }
.plan .ribbon { position: absolute; top: 18px; right: 18px; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 4px 10px; border-radius: 99px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line); color: var(--text2); }
.plan.hot .ribbon { color: #1c1300; background: linear-gradient(135deg, #ffd60a, #ff9f0a); box-shadow: none; }
.btn.max-btn { color: #1c1300; background: linear-gradient(135deg, #ffd60a, #ff9f0a 60%, #ff7a3d); box-shadow: 0 10px 30px -10px #ff9f0a; }
.compare { max-width: 1180px; width: 100%; margin: 0 auto; }
.cmp { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); font-size: 13.5px; }
.cmp > div { padding: 11px 10px; border-bottom: 1px solid var(--line); }
.cmp > div:nth-child(4n+1) { color: var(--text2); }
.cmp > div:nth-child(-n+4) { font-weight: 700; color: var(--text); }
.cmp > div:not(:nth-child(4n+1)) { text-align: center; }

.sub-panel { grid-template-columns: 1fr auto; align-items: center; }
.sub-panel .sub-info { display: grid; gap: 6px; }
.sub-panel .sub-info h3 { display: flex; align-items: center; gap: 10px; }
.sub-usage { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; max-width: 360px; }
.sub-usage i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--text); transition: width 1s var(--ease); }

.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
.modal-wrap.on { opacity: 1; pointer-events: auto; }
.modal { width: 440px; padding: 28px; border-radius: var(--r-xl); display: grid; gap: 14px; transform: scale(.92); filter: blur(8px); transition: transform .45s var(--ease), filter .45s var(--ease); }
.modal-wrap.on .modal { transform: none; filter: none; }
.modal h3 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.modal p { margin: 0; color: var(--text2); }
.modal .btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.modal .code { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--field); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; user-select: text; }
.modal .code button { margin-left: auto; }
@media (max-width: 1250px) { .plans { grid-template-columns: 1fr 1fr; } }


/* ================= Модератор ================= */
.moder-plate { margin-left: 10px; padding: 4px 10px; border-radius: 99px; font-size: 10.5px; font-weight: 800; letter-spacing: .09em; white-space: nowrap; cursor: pointer;
  color: #fff; background: linear-gradient(120deg, #ff2d3a, #7a0010); box-shadow: 0 6px 20px -8px #ff2d3a, inset 0 1px 0 rgba(255,255,255,.35); }
.moder-plate i { font-style: normal; opacity: .75; font-weight: 600; }
#moderWelcome { position: fixed; inset: 0; z-index: 45; overflow-y: auto; overflow-x: hidden; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 48px 20px;
  background: radial-gradient(120% 80% at 80% -10%, #6e000c 0%, #1c0003 45%, #050000 80%); animation: mwIn .7s var(--ease) both; }
#moderWelcome.out { animation: mwOut .45s var(--ease-io) forwards; }
@keyframes mwIn { from { opacity: 0; filter: blur(14px); transform: scale(1.03); } }
@keyframes mwOut { to { opacity: 0; filter: blur(12px); transform: scale(.98); } }
.mw { width: 100%; max-width: 720px; display: grid; gap: 20px; color: #fff4f4; }
.mw > * { animation: rise .8s var(--ease) both; }
.mw > :nth-child(2) { animation-delay: .08s; } .mw > :nth-child(3) { animation-delay: .16s; } .mw > :nth-child(4) { animation-delay: .24s; } .mw > :nth-child(5) { animation-delay: .32s; }
.mw .moder-plate { justify-self: start; margin: 0; font-size: 12px; padding: 6px 14px; cursor: default; }
.mw h1 { margin: 0; font-size: clamp(34px, 5vw, 56px); line-height: 1.04; letter-spacing: -.035em; }
.mw h1 span { background: linear-gradient(100deg, #fff, #ff2d3a 55%, #ff8a91); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mw .lead { color: #d9aeb1; max-width: none; font-size: 18px; }
.mw-card { padding: 20px 22px; border-radius: 22px; background: rgba(255,40,50,.07); box-shadow: inset 0 1px 0 rgba(255,140,140,.2), inset 0 0 0 1px rgba(255,70,80,.16); display: grid; gap: 10px; }
.mw-card h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: #ff8a91; }
.mw-card p { margin: 0; color: #f1d9da; line-height: 1.55; }
.mw-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.mw-card li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; color: #f1d9da; }
.mw-card li::before { content: "✓"; color: #ff2d3a; font-weight: 800; }
.mw-card small { color: #a77b7f; }
.mw-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mw-actions .btn.primary { background: linear-gradient(120deg, #ff2d3a, #8c0010); color: #fff; box-shadow: 0 12px 30px -12px #ff2d3a; }
.mw-actions .btn.ghost { color: #fff; }
.mw-note { font-size: 12.5px; color: #a77b7f; margin: 0; }


/* ================= Мем-статус «Алкопрайм» ================= */
.meme-logo { height: 34px; width: auto; margin: -4px 0; filter: drop-shadow(0 4px 10px rgba(0,0,0,.45)); cursor: pointer; transition: transform .4s var(--ease); }
.meme-logo:hover { transform: rotate(-8deg) scale(1.08); }
body.is-meme .brand .brand-mark { display: none; }
.splash-meme { display: none; height: 120px; width: auto; opacity: 0; animation: rise .8s .2s var(--ease) forwards; filter: drop-shadow(0 12px 30px rgba(0,0,0,.5)); }
.meme-boot .splash-meme { display: block; }
.meme-boot .splash-logo .logo-mark { display: none; }
#memeWelcome { position: fixed; inset: 0; z-index: 46; overflow-y: auto; overflow-x: hidden; display: grid; place-items: center; padding: 40px 20px;
  background: radial-gradient(90% 70% at 30% 40%, #1d5a2e 0%, #0b2414 45%, #030a05 85%); animation: mwIn .7s var(--ease) both; }
#memeWelcome.out { animation: mwOut .45s var(--ease-io) forwards; }
.mm { position: relative; width: 100%; max-width: 860px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 48px; align-items: center; color: #fff6dc; }
.mm-glow { position: absolute; left: 20px; top: 50%; width: 260px; height: 260px; margin-top: -130px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,196,110,.35), rgba(232,196,110,0) 70%); filter: blur(10px); animation: mmGlow 3s ease-in-out infinite alternate; }
.mm-bottle { position: relative; height: min(62vh, 460px); width: auto; filter: drop-shadow(0 30px 50px rgba(0,0,0,.6)); animation: mmIn 1s var(--ease) both, mmBob 4s 1s ease-in-out infinite alternate; }
.mm-text { display: grid; gap: 18px; justify-items: start; }
.mm-text > * { animation: rise .8s var(--ease) both; }
.mm-text > :nth-child(2) { animation-delay: .12s; } .mm-text > :nth-child(3) { animation-delay: .24s; } .mm-text > :nth-child(4) { animation-delay: .36s; }
.mm-plate { padding: 6px 14px; border-radius: 99px; font-size: 12px; font-weight: 800; letter-spacing: .1em; color: #0b2414;
  background: linear-gradient(120deg, #f6e3a8, #c99a3c); box-shadow: 0 8px 24px -8px rgba(232,196,110,.7), inset 0 1px 0 rgba(255,255,255,.6); }
.mm h1 { margin: 0; font-size: clamp(34px, 5.4vw, 60px); line-height: 1.04; letter-spacing: -.035em; }
.mm h1 span { background: linear-gradient(100deg, #fff6dc, #e8c46e 50%, #3fd06a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mm p { margin: 0; font-size: 19px; line-height: 1.5; color: #cfe3c8; max-width: 440px; }
.mm-go { margin-top: 8px; color: #0b2414; background: linear-gradient(120deg, #f6e3a8, #c99a3c); box-shadow: 0 14px 34px -12px rgba(232,196,110,.8); }
.mm-go:hover { filter: brightness(1.06); }
@keyframes mmIn { from { opacity: 0; transform: translateY(40px) rotate(-14deg) scale(.9); } }
@keyframes mmBob { from { transform: translateY(-6px) rotate(-3deg); } to { transform: translateY(8px) rotate(3deg); } }
@keyframes mmGlow { from { opacity: .6; transform: scale(.92); } to { opacity: 1; transform: scale(1.08); } }
@media (max-width: 700px) {
  .mm { grid-template-columns: 1fr; gap: 24px; justify-items: center; text-align: center; }
  .mm-text { justify-items: center; }
  .mm-bottle { height: 38vh; }
  .mm-glow { left: 50%; top: 18vh; margin-left: -130px; margin-top: -130px; }
}
@media (prefers-reduced-motion: reduce) { .mm-bottle, .mm-glow { animation: none; } }


/* ================= Первые шаги ================= */
#onboard { position: fixed; inset: 0; z-index: 44; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: obFadeIn .35s var(--ease) both; }
#onboard.out { animation: obFadeOut .35s var(--ease-io) forwards; }
@keyframes obFadeIn { from { opacity: 0; } }
@keyframes obFadeOut { to { opacity: 0; } }
.ob { width: min(520px, 100%); padding: 30px 30px 24px; border-radius: 28px; display: grid; gap: 14px; animation: rise .55s var(--ease) both; }
.ob h2 { margin: 0; font-size: 28px; letter-spacing: -.03em; }
.ob ol { margin: 4px 0 0; padding: 0; list-style: none; counter-reset: ob; display: grid; gap: 12px; }
.ob li { counter-increment: ob; display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; }
.ob li::before { content: counter(ob); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; background: var(--text); color: var(--bg); }
.ob li b { font-weight: 600; }
.ob li span { color: var(--text2); font-size: 14px; }
.ob-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
#searchForm.ob-pulse { animation: obPulse 1.2s var(--ease) 2; }
@keyframes obPulse { 50% { box-shadow: 0 0 0 4px rgba(255,255,255,.35), 0 20px 50px -20px rgba(255,255,255,.4); } }

.fine.legal { margin-top: -4px; }
.fine.legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
