:root {
  --surface-1: #fcfcfb;
  --page: #f7f8fb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --series-1: #2a78d6;
  --series-red: #e34948;
  --good: #006300;
  --bad: #d03b3b;
  --warn-bg: rgba(250, 178, 25, 0.14);
  --accent: #2a78d6;
  --accent-2: #17976b;
  --accent-dark: #1c5cab;
  --grad: linear-gradient(120deg, #1c5cab, #2a78d6 55%, #1baf7a);
  --grad-soft: linear-gradient(120deg, rgba(42,120,214,.09), rgba(27,175,122,.09));
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --shadow-lift: 0 2px 4px rgba(15, 23, 42, .06), 0 18px 40px -16px rgba(28, 92, 171, .25);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }
.section, #screens { scroll-margin-top: 80px; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; cursor: pointer; }

.ic { width: 20px; height: 20px; flex-shrink: 0; vertical-align: -4px; }
.ic.lg { width: 24px; height: 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 10px;
  background: var(--grad); color: #fff; padding: 11px 24px; font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  box-shadow: 0 4px 14px -6px rgba(42, 120, 214, .5);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(42, 120, 214, .55); filter: brightness(1.05); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); box-shadow: none; }
.btn.ghost:hover { background: rgba(42, 120, 214, .07); }
.btn.small { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn.danger { background: transparent; color: var(--bad); border: 1.5px solid var(--bad); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow);
}

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* появление при скролле */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .blob, .hero-badge { animation: none !important; }
}

/* ---------- landing ---------- */
.land-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
  padding: 14px 5vw; position: sticky; top: 0; z-index: 20;
  background: rgba(247, 248, 251, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(11, 11, 11, .05);
}
.land-header nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
@media (max-width: 640px) {
  .land-header { padding: 10px 4vw; }
  .land-header nav a.muted { display: none; } /* на телефоне только логотип и «Войти» */
  .logo { font-size: 18px; }
}
.logo { font-size: 21px; font-weight: 800; letter-spacing: -.5px; }
.hero {
  position: relative; overflow: hidden;
  text-align: center; padding: 9vh 6vw 7vh;
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(58, 130, 220, .35), transparent 60%),
    radial-gradient(700px 380px at 85% 0%, rgba(27, 175, 122, .22), transparent 55%),
    linear-gradient(175deg, #0d2547 0%, #123663 55%, #16457e 100%);
  color: #fff;
}
.hero h1 { color: #fff; }
.hero .grad-text {
  background: linear-gradient(120deg, #6fd6a8, #37e0a0);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero p.sub { color: rgba(255, 255, 255, .82); }
.hero-note { color: rgba(255, 255, 255, .55); }
.hero .hero-badge { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .9); }
.hero .hero-badge .ic { color: #37e0a0; }
.hero .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .45); }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, .08); }

/* денежная CTA: уверенный зелёный */
.btn.money {
  background: linear-gradient(120deg, #0e9f64, #16c07c);
  box-shadow: 0 6px 20px -6px rgba(14, 159, 100, .55);
}
.btn.money:hover { box-shadow: 0 10px 26px -6px rgba(14, 159, 100, .6); filter: brightness(1.06); }

/* полоса доверия под hero */
.trust-strip {
  display: flex; gap: 26px; justify-content: center; flex-wrap: wrap;
  margin-top: 40px; padding: 0 10px;
}
.trust-strip .t-item { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: rgba(255, 255, 255, .75); }
.trust-strip .ic { width: 17px; height: 17px; color: #37e0a0; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: .2; z-index: 0;
  animation: float 26s ease-in-out infinite alternate; /* медленно «дышит» */
  pointer-events: none;
}
.hero > *:not(.blob) { position: relative; z-index: 1; }
.blob.b1 { width: 460px; height: 460px; background: #3f8fe8; top: -130px; left: 8vw; }
.blob.b2 { width: 400px; height: 400px; background: #2fd693; top: 40px; right: 6vw; animation-delay: -9s; }
.blob.b3 { width: 320px; height: 320px; background: #5aa8f0; bottom: -140px; left: 42vw; animation-delay: -17s; }
/* на светлых страницах (вход в кабинет, калькулятор) пятна остаются нежными */
.auth-wrap .blob.b1, .calc-hero .blob.b1 { background: #8fbcf2; }
.auth-wrap .blob.b2, .calc-hero .blob.b2 { background: #98e2c4; }
@keyframes float {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(34px, 22px) scale(1.08); }
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 16px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.hero-badge .ic { width: 16px; height: 16px; color: var(--accent-2); }
.hero h1 { font-size: clamp(32px, 4.8vw, 56px); letter-spacing: -1.5px; line-height: 1.08; max-width: 900px; margin: 0 auto; }
.hero p.sub { font-size: 18.5px; color: rgba(255, 255, 255, .85); margin: 20px auto 32px; max-width: 640px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 12px; color: rgba(255, 255, 255, .6); font-size: 13.5px; }

.screen-frame {
  max-width: 1020px; margin: 6vh auto 0; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border); box-shadow: 0 30px 80px -30px rgba(28, 92, 171, .35);
  background: #fff;
}
.screen-frame .bar {
  display: flex; gap: 6px; padding: 10px 14px; background: #f1f2f6; border-bottom: 1px solid var(--border);
}
.screen-frame .dot { width: 10px; height: 10px; border-radius: 50%; background: #d9dbe3; }
.screen-frame img { display: block; width: 100%; height: auto; }

.section { padding: 60px 6vw; max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.8px; }
.section-sub { text-align: center; color: var(--ink-2); margin: 10px auto 40px; max-width: 560px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.feature { transition: transform .2s ease, box-shadow .2s ease; }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.feature .fic {
  width: 44px; height: 44px; border-radius: 12px; background: var(--grad-soft);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
  color: var(--accent-2);
}
.feature h3 { font-size: 16.5px; margin-bottom: 6px; }
.feature p { color: var(--ink-2); font-size: 14.5px; }

.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.shot figcaption { text-align: center; color: var(--ink-2); font-size: 14px; margin-top: 12px; }
.shot .screen-frame { margin: 0; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; counter-reset: step; }
.step { position: relative; padding-top: 18px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: -18px; left: 22px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--grad); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px -6px rgba(42, 120, 214, .6);
}

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; max-width: 1000px; margin: 0 auto; }
.plan { display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease; }
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.plan h3 { font-size: 18px; }
.plan .price { font-size: 32px; font-weight: 800; margin: 8px 0 14px; }
.plan .price small { font-size: 14px; font-weight: 400; color: var(--muted); }
.plan ul { list-style: none; margin-bottom: 20px; flex: 1; }
.plan li { padding: 5px 0 5px 26px; position: relative; font-size: 14px; color: var(--ink-2); }
.plan li svg { position: absolute; left: 0; top: 8px; width: 16px; height: 16px; color: var(--good); }
.plan.featured { border: none; background: linear-gradient(var(--surface-1), var(--surface-1)) padding-box, var(--grad) border-box; border: 2px solid transparent; }
.plan .tag {
  position: absolute; top: -12px; right: 18px; background: var(--grad); color: #fff;
  font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px;
}
.plan { position: relative; }

/* секция мобильного приложения */
.app-section { display: grid; grid-template-columns: minmax(0, 460px) 320px; gap: 56px; align-items: center; justify-content: center; max-width: 940px; margin: 0 auto; }
.app-copy .kicker {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--accent-dark); margin-bottom: 10px;
}
.app-copy h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.8px; line-height: 1.15; }
.app-copy .lead { color: var(--ink-2); margin: 12px 0 4px; max-width: 42ch; }
@media (max-width: 800px) {
  .app-section { grid-template-columns: 1fr; gap: 44px; justify-items: center; text-align: center; }
  .app-copy .lead { margin-inline: auto; }
  .app-bullets { max-width: 360px; margin-inline: auto; }
  .app-bullets li { text-align: left; }
  .phone { margin-inline: auto; }
  .phone-wrap { width: 100%; }
}

/* телефон: кликабельный, с живым свечением позади */
.phone-wrap { position: relative; display: block; transition: transform .25s ease; }
.phone-wrap:hover { transform: translateY(-6px); }
.phone-wrap::before {
  content: ""; position: absolute; inset: -48px; z-index: -1; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(42, 120, 214, .38), rgba(27, 175, 122, .30), rgba(142, 195, 245, .34), rgba(42, 120, 214, .38));
  filter: blur(48px);
  animation: glow-spin 22s linear infinite, glow-breathe 6.5s ease-in-out infinite alternate;
}
@keyframes glow-spin { to { transform: rotate(360deg); } }
@keyframes glow-breathe { from { opacity: .45; } to { opacity: .95; } }
@media (prefers-reduced-motion: reduce) { .phone-wrap::before { animation: none; opacity: .6; } }
.phone-hint {
  text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted);
}
.phone {
  width: 272px; aspect-ratio: 9 / 18.4; border-radius: 40px; border: 9px solid #101418; overflow: hidden;
  box-shadow: 0 34px 70px -28px rgba(28, 92, 171, .5);
  background: #f7f8fb; position: relative;
}
.phone::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 82px; height: 16px; background: #101418; border-radius: 0 0 10px 10px; z-index: 2;
}
.phone img { width: 100%; height: calc(100% - 22px); object-fit: cover; object-position: top; display: block; margin-top: 22px; }
.app-bullets { list-style: none; margin: 20px 0 26px; display: grid; gap: 2px; }
.app-bullets li { padding: 8px 0 8px 32px; position: relative; color: var(--ink-2); font-size: 15.5px; line-height: 1.45; }
.app-bullets li svg { position: absolute; left: 0; top: 10px; width: 19px; height: 19px; color: var(--accent-2); }

.faq { max-width: 760px; margin: 0 auto; }
.faq details { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; margin-bottom: 10px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { color: var(--ink-2); margin-top: 8px; font-size: 14.5px; }

.cta-band {
  text-align: center; border-radius: 18px; padding: 50px 24px; color: #fff;
  background: var(--grad); max-width: 1020px; margin: 0 auto;
  position: relative; overflow: hidden;
}
.cta-band::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 200px at 20% 0%, rgba(255,255,255,.22), transparent);
}
.cta-band h2 { font-size: clamp(22px, 3vw, 32px); letter-spacing: -.5px; position: relative; z-index: 1; }
.cta-band p { opacity: .85; margin: 10px 0 24px; position: relative; z-index: 1; }
.cta-band .btn { background: #fff; color: var(--accent-dark); box-shadow: none; position: relative; z-index: 1; }

.land-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 36px 20px; }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 226px; flex-shrink: 0; background: var(--surface-1);
  border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; gap: 3px;
}
.sidebar .logo { padding: 0 10px 18px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 9px; color: var(--ink-2); font-size: 14.5px; font-weight: 500;
  transition: background .15s ease;
}
.nav-item .ic { width: 19px; height: 19px; opacity: .75; }
.nav-item.active { background: var(--grad-soft); color: var(--accent-dark); font-weight: 600; }
.nav-item.active .ic { opacity: 1; color: var(--accent); }
.nav-item:hover:not(.active) { background: rgba(11, 11, 11, .04); }
.sidebar .spacer { flex: 1; }
.main { flex: 1; padding: 28px 32px; max-width: 1180px; }
.main > * { animation: page-in .35s ease both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .main > * { animation: none; } }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.page-head h1 { font-size: 22px; letter-spacing: -.4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: var(--surface-1); border-radius: 999px;
  padding: 5px 14px; font-size: 13px; color: var(--ink-2); transition: all .15s ease;
}
.chip.active { border-color: transparent; background: var(--grad); color: #fff; font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.tile::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--grad); opacity: .85; }
.tile .label { font-size: 13px; color: var(--muted); }
.tile .value { font-size: 25px; font-weight: 800; margin-top: 2px; letter-spacing: -.5px; }
.tile .delta { font-size: 12.5px; margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.tile .delta .ic { width: 14px; height: 14px; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }

/* советник */
.advisor { margin-bottom: 18px; }
.advisor-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.advisor-head .aic {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(27, 175, 122, .35); }
  50% { box-shadow: 0 0 0 9px rgba(27, 175, 122, 0); }
}
.advisor-head h3 { font-size: 16px; }
.advisor-head .muted { font-size: 12.5px; }
.advice-list { display: grid; gap: 10px; }
.advice {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface-1); border: 1px solid var(--border);
  border-left: 4px solid var(--baseline); border-radius: 10px; padding: 13px 16px;
  box-shadow: var(--shadow);
}
.advice .ic { margin-top: 2px; }
.advice.critical { border-left-color: var(--bad); }
.advice.critical .ic { color: var(--bad); }
.advice.warning { border-left-color: #fab219; }
.advice.warning .ic { color: #b07900; }
.advice.tip { border-left-color: var(--accent); }
.advice.tip .ic { color: var(--accent); }
.advice.good { border-left-color: #0ca30c; }
.advice.good .ic { color: var(--good); }
.advice b { display: block; font-size: 14.5px; }
.advice span { color: var(--ink-2); font-size: 13.5px; }

.chart-card { margin-bottom: 18px; }
.chart-card h3 { font-size: 15px; margin-bottom: 12px; }
.chart-wrap { position: relative; height: 280px; }
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.chart-head h3 { margin: 0; }

/* структура расходов: полоса с сегментами */
.stack-bar { display: flex; height: 26px; border-radius: 8px; overflow: hidden; gap: 2px; margin: 14px 0 6px; background: var(--page); }
.stack-bar .seg { min-width: 3px; transition: filter .15s ease, flex-grow .6s ease; }
.stack-bar .seg:hover { filter: brightness(1.12); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; vertical-align: 1px; }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; color: var(--muted); font-weight: 500; padding: 8px 10px;
  border-bottom: 1px solid var(--grid); white-space: nowrap;
}
table.data td { padding: 8px 10px; border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }
table.data tr:hover td { background: rgba(42, 120, 214, .035); }
.table-scroll { overflow-x: auto; }
.num { text-align: right; }
th.num { text-align: right; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
input.cost-input {
  width: 84px; padding: 4px 6px; border: 1px solid var(--baseline); border-radius: 6px;
  font: inherit; font-size: 13px; text-align: right;
}
input.cost-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42,120,214,.15); }

/* миниатюры товаров */
.p-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.p-thumb {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0; object-fit: cover;
  border: 1px solid var(--border); background: var(--page);
}
.p-letter {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-soft); color: var(--accent-dark); font-weight: 700; font-size: 15px;
}

/* здоровье магазина */
.health-grid { display: grid; grid-template-columns: 140px 1fr; gap: 20px; align-items: center; }
@media (max-width: 640px) { .health-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.health-parts { display: grid; gap: 7px; }
.hp-row { display: grid; grid-template-columns: 150px 120px 1fr; gap: 10px; align-items: center; font-size: 13.5px; }
@media (max-width: 640px) { .hp-row { grid-template-columns: 110px 90px 1fr; text-align: left; } }
.hp-name { color: var(--ink-2); }
.hp-bar { height: 7px; border-radius: 99px; background: var(--grid); overflow: hidden; display: block; }
.hp-bar span { display: block; height: 100%; border-radius: 99px; transition: width .8s ease; }
.hp-note { font-size: 12.5px; }

/* чат ИИ-советника */
.chat-card { display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 420px; padding: 0; overflow: hidden; }
@media (max-width: 700px) { .chat-card { height: calc(100vh - 240px); } }
.chat-scroll { flex: 1; overflow-y: auto; padding: 20px 20px 8px; display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 10px; max-width: 88%; animation: msg-in .25s ease both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.msg.ai .avatar { background: var(--grad); color: #fff; }
.msg .bubble {
  padding: 11px 15px; border-radius: 16px; font-size: 14.5px; line-height: 1.55; white-space: pre-line;
}
.msg.ai .bubble { background: var(--surface-1); border: 1px solid var(--border); border-top-left-radius: 5px; color: var(--ink-2); box-shadow: var(--shadow); }
.msg.user .bubble { background: var(--grad); color: #fff; border-top-right-radius: 5px; }
.chat-hello { text-align: center; color: var(--muted); font-size: 13.5px; padding: 20px 24px 4px; }
.typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .35;
  animation: typing-b 1.2s ease-in-out infinite;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes typing-b { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
.chat-presets {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 20px;
  border-top: 1px solid var(--grid); scrollbar-width: none;
}
.chat-presets::-webkit-scrollbar { display: none; }
.preset-chip {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  border: 1px solid var(--border); background: var(--page); border-radius: 12px;
  padding: 8px 14px; font-size: 13.5px; color: var(--ink-2); transition: all .15s ease;
}
.preset-chip:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--grad-soft); transform: translateY(-1px); }
.preset-chip .ic { width: 16px; height: 16px; color: var(--accent-2); }
.chat-input-row { display: flex; gap: 10px; padding: 12px 20px 16px; align-items: center; }
.chat-input-row input {
  flex: 1; padding: 12px 16px; border: 1.5px solid var(--baseline); border-radius: 14px; font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease; background: #fff;
}
.chat-input-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42,120,214,.13); }
.send-btn {
  width: 46px; height: 46px; border: none; border-radius: 14px; flex-shrink: 0;
  background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px -6px rgba(42, 120, 214, .55); transition: transform .15s ease, filter .15s ease;
}
.send-btn:hover { transform: translateY(-1px) scale(1.04); filter: brightness(1.07); }
.send-btn:disabled { opacity: .5; transform: none; }
.send-btn svg { width: 21px; height: 21px; }

/* ИИ-обзор */
.ai-report { border-left: 4px solid transparent; border-image: linear-gradient(180deg, #2a78d6, #1baf7a) 1; white-space: pre-line; }
.ai-report .muted { white-space: normal; }

/* auth */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; overflow: hidden; }
.auth-card { width: 392px; max-width: 100%; position: relative; z-index: 1; }
.auth-card h2 { margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.field input, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--baseline); border-radius: 9px; font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease; background: #fff;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42,120,214,.14); }
.error-box { background: #fdecec; color: var(--bad); border-radius: 9px; padding: 9px 12px; font-size: 13.5px; margin-bottom: 12px; display: none; }
.info-box { background: var(--grad-soft); color: var(--accent-dark); border-radius: 9px; padding: 9px 12px; font-size: 13.5px; margin-bottom: 12px; }
.switch-link { font-size: 14px; text-align: center; margin-top: 14px; }

.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 600; }
.badge .ic { width: 13px; height: 13px; }
.badge.ok { background: rgba(12, 163, 12, 0.12); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: #7a5200; }
.badge.err { background: rgba(208, 59, 59, 0.12); color: var(--bad); }
.badge.mut { background: rgba(11, 11, 11, 0.06); color: var(--ink-2); }

.empty { text-align: center; padding: 52px 20px; color: var(--ink-2); }
.empty .fic {
  width: 60px; height: 60px; border-radius: 16px; background: var(--grad-soft);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; color: var(--accent-2);
}
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.store-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--grid); flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
/* нижний таб-бар (мобильное приложение) */
.tabbar { display: none; }

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar { width: 62px; padding: 14px 8px; }
  .sidebar .logo, .sidebar .nav-label { display: none; }
  .nav-item { justify-content: center; }
  .main { padding: 18px 14px; }
}
@media (max-width: 700px) {
  .sidebar { display: none; }
  .shell { flex-direction: column; }
  .main { padding: 16px 14px 96px; } /* место под таб-бар */
  .tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    display: flex; justify-content: space-around;
    background: rgba(252, 252, 251, .94); backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
  }
  .tabbar .nav-item {
    flex: 1; flex-direction: column; align-items: center; gap: 3px;
    padding: 4px 2px; font-size: 10.5px; font-weight: 500; border-radius: 10px;
  }
  .tabbar .nav-item .ic { width: 22px; height: 22px; }
  .tabbar .nav-item.active { background: none; color: var(--accent); }
  .tabbar .nav-item.active .ic { color: var(--accent); }
  .page-head h1 { font-size: 19px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile .value { font-size: 20px; }
  .chart-wrap { height: 220px; }
}
