/* Symptomica — дизайн-система
   Ирисовый основной цвет, мятный для нормы, тёплый для отклонений.
   Мягкие скругления: 28 / 20 / 14 / 10 и пилюли. Шрифт Onest, цифры моноширинные по ширине. */

:root {
  --bg: #f3f4f9;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, #ece9ff 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #e3f6f1 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --sunken: #eef0f6;
  --ink: #15172a;
  --ink-2: #4b5069;
  --ink-3: #8a8fa8;
  --line: #e7e9f1;
  --line-2: #d7dae6;
  --brand: #5b4cf0;
  --brand-2: #4637d6;
  --brand-ink: #ffffff;
  --brand-soft: #efedff;
  --brand-soft-2: #e1ddff;
  --mint: #12a88a;
  --mint-soft: #e0f6f0;
  --band: #c9eee2;
  --warn: #d9720f;
  --warn-soft: #fff0e0;
  --bad: #e0464b;
  --bad-soft: #fde8e8;
  --hero: linear-gradient(135deg, #5b4cf0 0%, #7b5cf6 48%, #2fb8a0 130%);
  --hero-ink: #ffffff;
  --sh-1: 0 1px 2px rgba(21, 23, 42, 0.04), 0 6px 20px -8px rgba(21, 23, 42, 0.1);
  --sh-2: 0 2px 4px rgba(21, 23, 42, 0.04), 0 16px 40px -12px rgba(21, 23, 42, 0.18);
  --sh-brand: 0 10px 30px -10px rgba(91, 76, 240, 0.55);
  --r-xl: 28px;
  --r-lg: 20px;
  --r: 14px;
  --r-sm: 10px;
  --side: 264px;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --paper: #fffefa;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0e0f1a;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, #221d4d 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #0f2b27 0%, transparent 55%);
  --surface: #171928;
  --surface-2: #1c1f30;
  --sunken: #23263a;
  --ink: #eceef8;
  --ink-2: #b2b6cc;
  --ink-3: #7e839e;
  --line: #262a3f;
  --line-2: #343850;
  --brand: #8b7fff;
  --brand-2: #a69dff;
  --brand-ink: #10112a;
  --brand-soft: #25224a;
  --brand-soft-2: #322d63;
  --mint: #46d1b2;
  --mint-soft: #133129;
  --band: #1e4a3f;
  --warn: #f2a453;
  --warn-soft: #3a2a16;
  --bad: #ff7b7e;
  --bad-soft: #3d1c20;
  --hero: linear-gradient(135deg, #4a3cd6 0%, #6a4fe0 48%, #1f8f7e 130%);
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -10px rgba(0, 0, 0, 0.5);
  --sh-2: 0 2px 4px rgba(0, 0, 0, 0.3), 0 18px 44px -12px rgba(0, 0, 0, 0.7);
  --sh-brand: 0 10px 30px -10px rgba(139, 127, 255, 0.5);
  --paper: #1d2030;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']):not([data-theme='dark']) {
    --bg: #0e0f1a;
    --bg-grad: radial-gradient(1200px 600px at 100% -10%, #221d4d 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #0f2b27 0%, transparent 55%);
    --surface: #171928;
    --surface-2: #1c1f30;
    --sunken: #23263a;
    --ink: #eceef8;
    --ink-2: #b2b6cc;
    --ink-3: #7e839e;
    --line: #262a3f;
    --line-2: #343850;
    --brand: #8b7fff;
    --brand-2: #a69dff;
    --brand-ink: #10112a;
    --brand-soft: #25224a;
    --brand-soft-2: #322d63;
    --mint: #46d1b2;
    --mint-soft: #133129;
    --band: #1e4a3f;
    --warn: #f2a453;
    --warn-soft: #3a2a16;
    --bad: #ff7b7e;
    --bad-soft: #3d1c20;
    --hero: linear-gradient(135deg, #4a3cd6 0%, #6a4fe0 48%, #1f8f7e 130%);
    --sh-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -10px rgba(0, 0, 0, 0.5);
    --sh-2: 0 2px 4px rgba(0, 0, 0, 0.3), 0 18px 44px -12px rgba(0, 0, 0, 0.7);
    --sh-brand: 0 10px 30px -10px rgba(139, 127, 255, 0.5);
    --paper: #1d2030;
    color-scheme: dark;
  }
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--bg-grad), var(--bg); background-attachment: fixed;
  color: var(--ink); font: 400 15px/1.55 var(--font); font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, figure { margin: 0; }
h1 { font-size: clamp(26px, 3vw, 34px); line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 15px; line-height: 1.35; font-weight: 600; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
small { font-size: 13px; }
mark { background: var(--warn-soft); color: inherit; border-radius: 4px; padding: 0 3px; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.muted { color: var(--ink-3); }
.ic { width: 20px; height: 20px; flex: none; }
.ic.muted { color: var(--ink-3); }
.spacer { flex: 1; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Знак ---------- */
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.logo { width: 36px; height: 36px; flex: none; border-radius: 11px; box-shadow: var(--sh-brand); }
.brand__name { font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.brand__name b { color: var(--brand); font-weight: 700; }

/* ---------- Оболочка ---------- */
.side {
  position: fixed; inset: 12px auto 12px 12px; width: calc(var(--side) - 12px); z-index: 10;
  display: flex; flex-direction: column; gap: 22px; padding: 20px 14px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-1);
}
.side .brand { padding: 0 8px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav__link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  color: var(--ink-2); font-weight: 500; transition: background-color .15s, color .15s;
}
.nav__link:hover { background: var(--sunken); color: var(--ink); text-decoration: none; }
.nav__link.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav__link .count { margin-left: auto; }
.side__ask {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; border: 0; text-align: left;
  background: var(--hero); color: #fff; box-shadow: var(--sh-brand); position: relative; overflow: hidden;
}
.side__ask::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.12); }
.side__ask b { display: block; font-size: 15px; }
.side__ask small { opacity: .85; font-size: 12.5px; }
.side__ask .orb { width: 40px; height: 40px; }
.side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.side__user { width: 100%; text-align: left; font: inherit; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); }
.side__user:hover { text-decoration: none; border-color: var(--line-2); }
.side__user > span:not(.bubble):not(.avatar) { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.side__user b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__user small { color: var(--ink-3); font-size: 12px; }
.sync { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); padding: 0 10px; }
.sync .ic { width: 14px; height: 14px; }
.sync--error { color: var(--bad); }
.sync--saving, .sync--pending { color: var(--warn); }

.topbar, .tabbar { display: none; }
.main { margin-left: var(--side); padding: 32px clamp(20px, 3.4vw, 48px) 96px; max-width: calc(var(--side) + 1200px); outline: none; }

/* ---------- Заголовок страницы ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head > div:first-child { max-width: 72ch; min-width: 0; }
.page-head__kicker { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13.5px; margin-bottom: 8px; font-weight: 500; }
.page-head__kicker .ic { width: 16px; height: 16px; }
.page-head__sub { color: var(--ink-2); margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); margin: 0 0 14px -6px; font-size: 14px; font-weight: 500; padding: 6px 10px 6px 6px; border-radius: 999px; border: 0; background: none; }
.back:hover { background: var(--sunken); text-decoration: none; }
.back .ic { width: 18px; height: 18px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 14.5px; white-space: nowrap; background: none; text-decoration: none !important;
  transition: background-color .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.btn:active { transform: scale(0.98); }
.btn .ic { width: 18px; height: 18px; }
.btn--primary { background: var(--brand); color: var(--brand-ink); box-shadow: var(--sh-brand); }
.btn--primary:hover { background: var(--brand-2); }
.btn--soft { background: var(--brand-soft); color: var(--brand); }
.btn--soft:hover { background: var(--brand-soft-2); }
.btn--ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink-3); }
.btn--white { background: #fff; color: #2c2580; }
.btn--white:hover { background: #f1efff; }
.btn--glass { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.28); }
.btn--glass:hover { background: rgba(255,255,255,.26); }
.btn--danger { background: var(--bad); color: #fff; }
.btn--text { color: var(--brand); padding: 0 12px; }
.btn--text:hover { background: var(--brand-soft); }
.btn--text-danger { color: var(--bad); padding: 0 12px; }
.btn--text-danger:hover { background: var(--bad-soft); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn--sm .ic { width: 16px; height: 16px; }
.btn--lg { height: 52px; padding: 0 24px; font-size: 15.5px; }
.btn--block { width: 100%; }
.btn--icon { width: 36px; padding: 0; }
.btn--icon span { display: none; }
.btn:disabled { opacity: .6; cursor: progress; }
.iconbtn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 999px;
  border: 1px solid transparent; background: none; color: var(--ink-2); transition: background-color .15s;
}
.iconbtn:hover { background: var(--sunken); color: var(--ink); }
.iconbtn--line { border-color: var(--line-2); background: var(--surface); }
.iconbtn--sm { width: 32px; height: 32px; }
.iconbtn--sm .ic { width: 16px; height: 16px; }
.link { font-size: 14px; font-weight: 600; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 20px 22px; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 20px; }
.grid > .card, .grid > .section { margin-top: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card__head h2 { display: flex; align-items: center; gap: 10px; }
.card__lead { color: var(--ink-3); font-size: 14px; margin: -6px 0 10px; }
.card--flat { box-shadow: none; }
.card--tint { background: var(--surface-2); box-shadow: none; }
.section { margin-top: 28px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
.grid--even { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.empty { color: var(--ink-3); padding: 18px 0; text-align: center; }
.empty--art { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 20px; }
.empty--art svg { width: 140px; height: auto; }
.empty--art b { color: var(--ink); font-size: 16px; }

/* ---------- Значки, пилюли ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--sunken); color: var(--ink-2); }
.pill .ic { width: 14px; height: 14px; }
.pill--brand { background: var(--brand-soft); color: var(--brand); }
.pill--ok { background: var(--mint-soft); color: var(--mint); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--bad { background: var(--bad-soft); color: var(--bad); }
.pill--sm { height: 22px; padding: 0 8px; font-size: 11.5px; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--bad); color: #fff; }
.count--soft { background: var(--bad-soft); color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--mint); }
.dot--bad { background: var(--bad); }
.dot--warn { background: var(--warn); }

.avatar {
  --tone: #5b4cf0;
  display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(140deg, color-mix(in srgb, var(--tone) 78%, #fff) 0%, var(--tone) 100%);
  color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .01em; box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--tone) 70%, transparent);
}
.avatar.xs { width: 22px; height: 22px; font-size: 9.5px; box-shadow: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 14px; box-shadow: var(--sh-1);
}
.chip:has(.avatar) { padding-left: 6px; }
.chip:hover { text-decoration: none; color: var(--ink); border-color: var(--line-2); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip--sm { height: 32px; font-size: 13px; padding: 0 12px; box-shadow: none; }

/* ---------- Уведомления ---------- */
.notice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 20px; border-radius: var(--r); background: var(--brand-soft); color: var(--ink); }
.notice > .ic { color: var(--brand); }
.notice p { flex: 1; }
.notice--warn { background: var(--warn-soft); } .notice--warn > .ic { color: var(--warn); }
.notice--bad { background: var(--bad-soft); } .notice--bad > .ic { color: var(--bad); }
.notice--ok { background: var(--mint-soft); } .notice--ok > .ic { color: var(--mint); }

/* ---------- Главный баннер ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 28px 30px; color: var(--hero-ink);
  background: var(--hero); box-shadow: var(--sh-brand); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center;
}
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.09); pointer-events: none; }
.hero::before { width: 360px; height: 360px; right: -90px; top: -160px; }
.hero::after { width: 220px; height: 220px; right: 180px; bottom: -150px; }
.hero__date { opacity: .8; font-size: 14px; font-weight: 500; }
.hero h1 { margin: 6px 0 10px; font-size: clamp(26px, 3.2vw, 36px); }
.hero p { opacity: .92; max-width: 52ch; }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; position: relative; z-index: 1; }
.hero__ring { position: relative; z-index: 1; display: grid; place-items: center; }
.hero__ring .ring { width: 150px; height: 150px; }
.hero__ring .ring__track { stroke: rgba(255,255,255,.22); }
.hero__ring .ring__val { stroke: #fff; }
.hero__ring .ring__label { fill: #fff; }
.hero__ring .ring__sub { fill: rgba(255,255,255,.8); }

.ring { display: block; }
.ring__track { fill: none; stroke: var(--sunken); }
.ring__val { fill: none; stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.ring__label { font: 700 30px var(--font); fill: var(--ink); }
.ring__sub { font: 500 11.5px var(--font); fill: var(--ink-3); }

/* Быстрые действия */
.actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.action {
  display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--sh-1); color: var(--ink); text-align: left; transition: transform .15s, box-shadow .15s, border-color .15s; cursor: pointer;
}
.action:hover { transform: translateY(-2px); box-shadow: var(--sh-2); text-decoration: none; border-color: var(--line-2); }
.action b { font-size: 15px; }
.action small { color: var(--ink-3); font-size: 13px; line-height: 1.4; }
.bubble { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: var(--brand-soft); color: var(--brand); flex: none; }
.bubble .ic { width: 22px; height: 22px; }
.bubble--mint { background: var(--mint-soft); color: var(--mint); }
.bubble--warn { background: var(--warn-soft); color: var(--warn); }
.bubble--pink { background: color-mix(in srgb, #e5559b 14%, var(--surface)); color: #d23d86; }
.bubble--sm { width: 38px; height: 38px; border-radius: 12px; }
.bubble--sm .ic { width: 18px; height: 18px; }

/* ---------- План ---------- */
.plist > li + li { border-top: 1px solid var(--line); }
.prow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 14px 0; }
.prow--solo { grid-template-columns: minmax(0, 1fr) auto auto; }
.prow__title { font-weight: 600; line-height: 1.35; }
.prow__title .pill { margin-left: 6px; vertical-align: 1px; }
.prow__meta { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--ink-3); font-size: 13px; margin-top: 3px; }
.prow__due { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; line-height: 1.2; }
.prow__due small { color: var(--ink-3); font-size: 12.5px; }
.prow__act { display: flex; gap: 4px; }
.due { font-size: 13px; font-weight: 600; white-space: nowrap; padding: 4px 10px; border-radius: 999px; }
.due--overdue { color: var(--bad); background: var(--bad-soft); }
.due--soon { color: var(--warn); background: var(--warn-soft); }
.due--later { color: var(--ink-2); background: var(--sunken); }
.due--nodata { color: var(--ink-3); background: var(--sunken); }
.plan-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); display: flex; align-items: center; gap: 14px; }
.stat b { font-size: 28px; line-height: 1; font-weight: 700; display: block; }
.stat small { color: var(--ink-3); }

/* ---------- Семья ---------- */
.famlist > li + li { border-top: 1px solid var(--line); }
.famrow { display: flex; align-items: center; gap: 14px; padding: 12px 0; color: var(--ink); }
.famrow:hover { text-decoration: none; }
.famrow:hover b { color: var(--brand); }
.famrow__main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.famrow__main small { color: var(--ink-3); }
.famrow__flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.famrow__ok { font-size: 12.5px; color: var(--mint); margin-top: 4px; font-weight: 500; }
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.member {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); color: var(--ink); overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.member::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 64px; background: linear-gradient(120deg, color-mix(in srgb, var(--tone) 22%, transparent), transparent 80%); }
.member:hover { transform: translateY(-2px); box-shadow: var(--sh-2); text-decoration: none; }
.member > * { position: relative; }
.member__top { display: flex; align-items: center; gap: 14px; }
.member__top b { font-size: 17px; display: block; }
.member__top small { color: var(--ink-3); }
.member__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.member__stats div { background: var(--surface-2); border-radius: 12px; padding: 10px; text-align: center; }
.member__stats b { display: block; font-size: 18px; }
.member__stats small { color: var(--ink-3); font-size: 11.5px; }
.member__stats .is-bad b { color: var(--bad); }
.member--add { align-items: center; justify-content: center; text-align: center; border-style: dashed; box-shadow: none; background: transparent; color: var(--ink-2); min-height: 180px; }
.member--add::before { display: none; }
.member--add .bubble { margin: 0 auto; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.fact { padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); display: flex; gap: 12px; }
.fact h3 { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
.fact li { padding: 1px 0; }
.person { display: flex; gap: 18px; align-items: center; }

/* ---------- Документы ---------- */
.dlist { container-type: inline-size; }
.dlist > li + li { border-top: 1px solid var(--line); }
.drow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 6px; margin: 0 -6px; border-radius: 14px; color: var(--ink); }
.drow:hover { text-decoration: none; background: var(--surface-2); }
.drow:hover b { color: var(--brand); }
.drow__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--brand-soft); color: var(--brand); }
.drow__icon .ic { width: 20px; height: 20px; }
.drow__icon--study { background: color-mix(in srgb, #2f8fe0 14%, var(--surface)); color: #2f7fd0; }
.drow__icon--note { background: var(--mint-soft); color: var(--mint); }
.drow__icon--rx { background: var(--warn-soft); color: var(--warn); }
.drow__icon--vaccine { background: color-mix(in srgb, #e5559b 14%, var(--surface)); color: #d23d86; }
.drow__main { display: flex; flex-direction: column; min-width: 0; }
.drow__main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow__main small { color: var(--ink-3); display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; }
.drow__folder { display: inline-flex; align-items: center; gap: 4px; }
.drow__folder .ic { width: 14px; height: 14px; }
.drow__tags { display: flex; gap: 6px; }
.drow__date { color: var(--ink-2); font-size: 13.5px; white-space: nowrap; min-width: 88px; text-align: right; font-weight: 500; }
@container (max-width: 560px) {
  .drow { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 4px; }
  .drow__tags { grid-column: 2; grid-row: 2; }
  .drow__tags:empty { display: none; }
  .drow__folder { display: none; }
  .drow__date { min-width: 0; font-size: 12.5px; }
}

/* ---------- Архив ---------- */
.archive { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 24px; align-items: start; }
.archive__rail { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; padding: 12px; }
.archive__rail h3 { font-size: 12px; font-weight: 600; color: var(--ink-3); margin: 14px 10px 6px; text-transform: none; }
.archive__rail h3:first-child { margin-top: 2px; }
.rail__item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; color: var(--ink-2); font-size: 14px; font-weight: 500; border: 0; background: none; text-align: left; width: 100%; }
.rail__item .ic { width: 18px; height: 18px; }
.rail__item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail__item small { color: var(--ink-3); font-size: 12px; background: var(--sunken); border-radius: 999px; padding: 1px 8px; }
.rail__item:hover { background: var(--sunken); text-decoration: none; color: var(--ink); }
.rail__item.is-on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.rail__item.is-on small { background: var(--surface); }
.rail__add { color: var(--brand); }
.searchbar { position: relative; margin-bottom: 14px; }
.searchbar .ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 18px; height: 18px; }
.searchbar input { width: 100%; height: 50px; padding: 0 16px 0 46px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--sh-1); }
.catchips { display: none; gap: 6px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.folderbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.folderbar b { flex: 1; }
.dropslim { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 16px; margin-bottom: 16px; border: 1.5px dashed var(--line-2); border-radius: var(--r); color: var(--ink-3); font-size: 14px; cursor: pointer; transition: all .15s; }
.dropslim:hover, .dropslim.is-over { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.yeargroup { margin-top: 6px; }
.yeargroup + .yeargroup { margin-top: 18px; }
.yeargroup__h { font-size: 13px; font-weight: 700; color: var(--ink-3); padding: 0 0 6px; }

/* ---------- Карточка документа ---------- */
.docview { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.docview__preview { position: sticky; top: 24px; }
.preview__img { width: 100%; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); display: block; box-shadow: var(--sh-1); }
.preview__pdf { width: 100%; height: min(78vh, 900px); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.preview__file { display: flex; align-items: center; gap: 10px; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.skeleton { height: 420px; border-radius: var(--r-lg); background: linear-gradient(100deg, var(--sunken) 30%, var(--surface-2) 50%, var(--sunken) 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.paper {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 26px 26px 18px;
  font-size: 12.5px; line-height: 1.5; color: var(--ink-2); box-shadow: var(--sh-2); font-family: 'PT Serif', Georgia, serif;
}
.paper__org { font-size: 11px; color: var(--ink-3); border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 14px; }
.paper__title { font-size: 16px; font-weight: 700; color: var(--ink); text-align: center; margin-bottom: 10px; }
.paper__meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.paper table { width: 100%; border-collapse: collapse; }
.paper th { text-align: left; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--ink-3); padding: 4px 6px 4px 0; font-size: 11.5px; }
.paper td { padding: 4px 6px 4px 0; border-bottom: 1px dotted var(--line-2); }
.paper .r { text-align: right; }
.paper__text { color: var(--ink); }
.paper__foot { margin-top: 18px; font-size: 10.5px; color: var(--ink-3); text-align: right; font-family: var(--font); }
.quote { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; color: var(--ink-2); max-width: 80ch; }

/* ---------- Вердикт ---------- */
.verdict { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 24px 26px; margin-bottom: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.verdict::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--mint); }
.verdict--soon::before { background: var(--warn); }
.verdict--urgent { background: var(--bad-soft); border-color: transparent; }
.verdict--urgent::before { background: var(--bad); }
.verdict__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 12px; }
.verdict__summary { font-size: 17px; line-height: 1.6; max-width: 70ch; color: var(--ink); }
.verdict__stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.verdict .link { display: inline-block; margin-top: 12px; }
.urg { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 10px; border-radius: 999px; font-size: 13.5px; font-weight: 600; }
.urg .ic { width: 16px; height: 16px; }
.urg--ok { background: var(--mint-soft); color: var(--mint); }
.urg--warn { background: var(--warn-soft); color: var(--warn); }
.urg--bad { background: var(--bad); color: #fff; }
.urg__text { color: var(--ink-2); font-size: 14px; }

/* ---------- Показатели и шкала ---------- */
.indlist { container-type: inline-size; display: flex; flex-direction: column; gap: 8px; }
.indlist__cols { display: none; }
.ind { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .15s, box-shadow .15s; }
.ind--low, .ind--high { border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); }
.ind__head {
  width: 100%; padding: 14px 16px; background: none; border: 0; text-align: left; cursor: default;
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(90px, 0.55fr) minmax(150px, 1.2fr) minmax(130px, 0.8fr) 24px; gap: 16px; align-items: center;
}
.is-expandable > .ind__head { cursor: pointer; }
.is-expandable:hover { box-shadow: var(--sh-1); }
.ind__name { font-weight: 600; line-height: 1.3; }
.ind__val { white-space: nowrap; }
.ind__val b { font-size: 17px; font-weight: 700; }
.ind__val small { color: var(--ink-3); }
.ind--low .ind__val b, .ind--high .ind__val b { color: var(--warn); }
.ind__flag em { font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.ind__chev { color: var(--ink-3); transition: transform .2s; display: grid; place-items: center; }
.ind__chev .ic { width: 18px; height: 18px; }
.ind__head[aria-expanded="true"] .ind__chev { transform: rotate(180deg); }
.ind__body { padding: 0 16px 16px; max-width: 76ch; }
.ind__about { color: var(--ink-2); }
.ind__note { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.ind--low .ind__note, .ind--high .ind__note { background: var(--warn-soft); }
.ind__trend { margin-top: 14px; }
.ind__trend-h { font-size: 13px; color: var(--ink-3); margin-bottom: 4px; font-weight: 500; }
.indlist__more { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 16px; border: 1px dashed var(--line-2); border-radius: var(--r); background: none; color: var(--mint); font-weight: 600; text-align: left; }
.indlist__more .ic { width: 18px; height: 18px; transition: transform .2s; }
.indlist__more.is-open .ic { transform: rotate(180deg); }
.indlist__ok { display: flex; flex-direction: column; gap: 8px; }
@container (max-width: 680px) {
  .ind__head { grid-template-columns: minmax(0, 1fr) auto 20px; grid-template-areas: 'n v c' 's s s' 'f f f'; row-gap: 8px; }
  .ind__name { grid-area: n; } .ind__val { grid-area: v; } .ind__scale { grid-area: s; } .ind__flag { grid-area: f; } .ind__chev { grid-area: c; }
  .ind__flag:not(:has(em)) { display: none; }
}

.scale { position: relative; padding-top: 4px; }
.scale__track { position: relative; height: 8px; border-radius: 99px; background: var(--sunken); }
.scale__band { position: absolute; top: 0; bottom: 0; background: var(--band); border-radius: 99px; }
.scale__mark { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px var(--surface), 0 2px 6px rgba(0,0,0,.18); }
.scale--low .scale__mark, .scale--high .scale__mark { background: var(--warn); }
.scale__ticks { position: relative; height: 16px; margin-top: 5px; font-size: 11px; color: var(--ink-3); font-weight: 500; }
.scale__ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.scale--empty { font-size: 12.5px; color: var(--ink-3); }

.trendchart { width: 100%; height: auto; display: block; overflow: visible; }
.tc__band { fill: var(--band); opacity: .6; }
.tc__axis { stroke: var(--line-2); }
.tc__line { fill: none; stroke: var(--brand); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.tc__area { fill: url(#tcgrad); }
.tc__pt circle { fill: var(--mint); stroke: var(--surface); stroke-width: 2.5; }
.tc__pt--low circle, .tc__pt--high circle { fill: var(--warn); }
.tc__x, .tc__y { font-size: 11px; fill: var(--ink-3); font-family: var(--font); }
.tc__v { font-size: 12px; font-weight: 700; fill: var(--ink); font-family: var(--font); }
.trends { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.trend { padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.trend figcaption { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.trend figcaption span { color: var(--ink-3); font-size: 13.5px; }
.trend--low figcaption span, .trend--high figcaption span { color: var(--warn); font-weight: 600; }

/* ---------- Формы ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.field input, .field select, .field textarea, .select {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--surface); line-height: 1.4; transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .searchbar input:focus, .edtable input:focus, .select:focus, .chat__input textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft);
}
.field input:disabled { background: var(--sunken); color: var(--ink-3); }
.field--inline { flex-direction: row; align-items: center; gap: 12px; }
.field--inline > span { white-space: nowrap; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 13px; color: var(--ink-3); }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check-line input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--brand); flex: none; }
.filepick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.filepick__box { display: flex; align-items: center; gap: 10px; padding: 16px; border: 1.5px dashed var(--line-2); border-radius: var(--r); color: var(--ink-2); cursor: pointer; }
.filepick:hover .filepick__box, .filepick input:focus-visible + .filepick__box { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.filepick__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw { position: relative; display: block; }
.pw input { padding-right: 48px; }
.pw__eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: none; color: var(--ink-3); display: grid; place-items: center; border-radius: 999px; }
.pw__eye:hover { background: var(--sunken); }
.pw__eye .ic { width: 18px; height: 18px; }
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; max-width: 100%; padding: 4px; background: var(--sunken); border-radius: 999px; gap: 2px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.seg button .ic { width: 16px; height: 16px; }
.seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

/* ---------- Настройки ---------- */
.settings { display: grid; gap: 16px; max-width: 860px; }
.setting { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; }
.setting > div { min-width: 0; }
.setting__label h2 { font-size: 17px; }
.setting__label p { color: var(--ink-3); font-size: 14px; margin-top: 4px; max-width: 62ch; }
.setting__body { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.account { display: flex; gap: 12px; align-items: center; }
.account span { display: flex; flex-direction: column; }
.account small { color: var(--ink-3); }
.prose p + p { margin-top: 10px; }
.prose { color: var(--ink-2); max-width: 66ch; }
.ok-dot, .bad-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--mint); vertical-align: 1px; }
.bad-dot { background: var(--bad); }
.promo-list { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.promo-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }

/* ---------- Модальные окна, уведомления ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; }
.modal__scrim { position: absolute; inset: 0; background: rgba(14, 15, 30, 0.45); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.modal__panel {
  position: relative; width: min(540px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-xl); box-shadow: 0 30px 80px -20px rgba(0,0,0,.4);
  transform: translateY(12px) scale(.98); opacity: 0; transition: transform .25s cubic-bezier(.2,.8,.2,1), opacity .2s;
}
.modal__panel--wide { width: min(1100px, 100%); }
.modal.is-open .modal__scrim { opacity: 1; }
.modal.is-open .modal__panel { transform: none; opacity: 1; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 18px 8px 26px; }
.modal__head h2 { font-size: 20px; }
.modal__body { padding: 8px 26px 22px; overflow-y: auto; }
.modal__body > p + p { margin-top: 10px; }
.modal__foot { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 26px 22px; flex-wrap: wrap; }
.toasts { position: fixed; z-index: 80; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 500; box-shadow: var(--sh-2); animation: toast-in .25s cubic-bezier(.2,.8,.2,1); transition: opacity .3s, transform .3s; }
.toast.ok .ic { color: var(--band); }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Расшифровка ---------- */
.stepper { display: flex; gap: 8px; margin: 0 0 24px; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); font-size: 14px; font-weight: 600; }
.stepper span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--sunken); font-size: 12.5px; }
.stepper span .ic { width: 14px; height: 14px; }
.stepper .is-cur { color: var(--ink); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.stepper .is-cur span { background: var(--brand); color: var(--brand-ink); }
.stepper .is-done { color: var(--ink-2); }
.stepper .is-done span { background: var(--mint-soft); color: var(--mint); }

.dropzone {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 48px 24px; border: 2px dashed var(--line-2); border-radius: var(--r-xl); background: var(--surface);
  cursor: pointer; transition: border-color .15s, background-color .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone__art { width: 120px; height: auto; margin-bottom: 6px; }
.dropzone b { font-size: 19px; font-weight: 700; }
.dropzone > span:not(.btn) { color: var(--ink-3); }
.dropzone .btn { margin-top: 14px; }
.decode-opts { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 16px 0 8px; }
.decode-opts .select { width: auto; min-width: 260px; }
.decode-opts .hint { flex: 1; min-width: 240px; }
.samples { margin-top: 28px; }
.samples h2 { margin-bottom: 12px; }
.samples__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sample { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); text-align: left; box-shadow: var(--sh-1); transition: transform .15s, box-shadow .15s; }
.sample:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.sample > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.sample small { color: var(--ink-3); }

.busy { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 40px; align-items: center; }
.busy__preview { position: relative; overflow: hidden; border-radius: var(--r-lg); min-height: 280px; background: var(--sunken); }
.busy__preview .preview__pdf { height: 420px; }
.scanning::after { content: ''; position: absolute; left: 0; right: 0; height: 80px; top: -80px; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--brand) 25%, transparent) 70%, var(--brand) 100%); animation: scan 1.6s cubic-bezier(.5,0,.5,1) infinite; }
@keyframes scan { to { top: 100%; } }
.busy__lines { display: flex; flex-direction: column; gap: 6px; }
.busy__lines li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line); animation: line-on .4s calc(var(--i) * .6s) forwards; font-weight: 500; }
.busy__lines li::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); animation: dot-on .4s calc(var(--i) * .6s) forwards; }
@keyframes line-on { to { color: var(--ink); border-color: var(--brand-soft-2); } }
@keyframes dot-on { to { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); } }

.check { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 24px; align-items: start; }
.check__preview { position: sticky; top: 24px; }
.check__foot { display: flex; justify-content: space-between; gap: 12px; position: sticky; bottom: 0; padding: 14px 0 10px; background: linear-gradient(transparent, var(--bg) 35%); }
.edtable { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.edtable__row { display: grid; grid-template-columns: minmax(0, 2fr) 96px 80px 66px 66px 32px; gap: 6px; align-items: center; padding: 6px 8px; }
.edtable__row + .edtable__row { border-top: 1px solid var(--line); }
.edtable__row--head { font-size: 12px; color: var(--ink-3); padding-top: 10px; padding-bottom: 10px; background: var(--surface-2); font-weight: 600; }
.edtable input { width: 100%; height: 36px; padding: 0 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; font-size: 14px; }
.edtable input:hover { border-color: var(--line); }
.edval { position: relative; border-radius: 10px; }
.edval input { font-weight: 700; padding-left: 22px; }
.edval::before { content: ''; position: absolute; left: 9px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--mint); }
.edval--low, .edval--high { background: var(--warn-soft); }
.edval--low::before, .edval--high::before { background: var(--warn); }
.edval--none::before { background: var(--line-2); }
[data-action="ind-add"] { align-self: flex-start; }

.decoding { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.decoding__aside { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; }
.modal .decoding__aside { position: static; }
.aside-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--sh-1); }
.aside-block h2 { font-size: 15.5px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.aside-block__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.aside-block__head h2 { margin: 0; }
.aside-block--row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.aside-block--row .muted { display: flex; align-items: center; gap: 8px; }
.aside-block--row .ic { width: 18px; height: 18px; }
.aside-block--ask { background: var(--hero); color: #fff; border: 0; box-shadow: var(--sh-brand); }
.aside-block--ask p { opacity: .9; font-size: 14px; margin-bottom: 12px; }
.todo li { display: grid; grid-template-columns: 86px 1fr; gap: 10px; padding: 10px 0; }
.todo li + li { border-top: 1px solid var(--line); }
.todo__when { font-size: 12px; font-weight: 700; color: var(--brand); padding-top: 2px; }
.todo .is-urgent .todo__when { color: var(--bad); }
.todo p { font-size: 14px; line-height: 1.45; }
.questions li { position: relative; padding: 8px 0 8px 26px; font-size: 14px; line-height: 1.45; }
.questions li::before { content: '?'; position: absolute; left: 0; top: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 11px; display: grid; place-items: center; }
.fus li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; }
.fus b { font-weight: 600; }
.fus span { color: var(--ink-2); white-space: nowrap; }
.fus + .hint { margin-top: 8px; }
.disclaimer { display: flex; gap: 8px; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; padding: 4px 6px 0; }
.disclaimer .ic { width: 16px; height: 16px; margin-top: 1px; }
.meaning { display: flex; flex-direction: column; gap: 10px; }
.meaning li { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.meaning h3 { margin-bottom: 4px; }
.meaning p { color: var(--ink-2); max-width: 68ch; }
.lk { align-self: start; justify-self: start; font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--sunken); padding: 4px 10px; border-radius: 999px; }
.meaning li:first-child .lk { color: var(--brand); background: var(--brand-soft); }
.terms { margin: 14px 0 0; display: grid; gap: 8px; }
.terms div { display: grid; grid-template-columns: 210px 1fr; gap: 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.terms dt { font-weight: 700; }
.terms dd { margin: 0; color: var(--ink-2); }

/* ---------- ИИ-врач ---------- */
.fab {
  display: none;
  position: fixed; right: 24px; bottom: 24px; z-index: 40; display: flex; align-items: center; gap: 10px;
  height: 58px; padding: 0 22px 0 8px; border-radius: 999px; border: 0; background: var(--hero); color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: var(--sh-brand), 0 4px 10px rgba(0,0,0,.12); transition: transform .2s;
}
.fab:hover { transform: translateY(-2px); }
.fab .orb { width: 42px; height: 42px; }
.orb { flex: none; display: block; }
.chat-open .fab { opacity: 0; pointer-events: none; }
.fab { display: none; }
.chat {
  position: fixed; z-index: 50; top: 12px; right: 12px; bottom: 12px; width: min(440px, calc(100vw - 24px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.35); transform: translateX(110%); transition: transform .3s cubic-bezier(.2,.8,.2,1); overflow: hidden;
}
.chat.is-open { transform: none; }
.chat__head { display: flex; align-items: center; gap: 12px; padding: 16px 14px 14px 18px; background: var(--hero); color: #fff; }
.chat__head .orb { width: 44px; height: 44px; }
.chat__title { flex: 1; min-width: 0; line-height: 1.3; }
.chat__title b { display: block; font-size: 16px; }
.chat__title small { opacity: .85; }
.chat__head .iconbtn { color: #fff; }
.chat__head .iconbtn:hover { background: rgba(255,255,255,.16); }
.chat__ctx { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.chat__ctx .ic { width: 16px; height: 16px; color: var(--brand); }
.chat__ctx span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat__ctx select { border: 0; background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; color: var(--ink); max-width: 150px; }
.chat__body { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }
.msg p + p, .msg ul + p, .msg p + ul { margin-top: 8px; }
.msg ul { padding-left: 18px; list-style: disc; }
.msg li + li { margin-top: 3px; }
.msg--me { align-self: flex-end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 6px; }
.msg--ai { align-self: flex-start; background: var(--sunken); color: var(--ink); border-bottom-left-radius: 6px; }
.msg--ai b { font-weight: 700; }
.msg--sys { align-self: center; max-width: 100%; text-align: center; background: none; color: var(--ink-3); font-size: 12.5px; padding: 0 10px; }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chat__welcome { text-align: center; padding: 10px 6px 4px; }
.chat__welcome .orb { width: 72px; height: 72px; margin: 0 auto 10px; }
.chat__welcome b { display: block; font-size: 17px; margin-bottom: 4px; }
.chat__welcome p { color: var(--ink-2); font-size: 14px; }
.chat__suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.chat__suggest button { border: 1px solid var(--brand-soft-2); background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; text-align: left; }
.chat__suggest button:hover { background: var(--brand-soft-2); }
.chat__input { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.chat__input textarea { flex: 1; resize: none; max-height: 140px; min-height: 46px; padding: 12px 14px; border-radius: 22px; border: 1px solid var(--line-2); background: var(--surface-2); line-height: 1.4; }
.chat__send { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; flex: none; }
.chat__send:disabled { opacity: .45; cursor: default; }
.chat__meta { padding: 0 16px 10px; font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 10px; }
.chat__meta button { border: 0; background: none; color: var(--brand); font-weight: 600; font-size: 12px; padding: 0; }
.chat__lock { margin: auto 16px 16px; padding: 18px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); text-align: center; }

/* Тариф */
.tariff { border-radius: var(--r-xl); padding: 24px; background: var(--hero); color: #fff; position: relative; overflow: hidden; box-shadow: var(--sh-brand); }
.tariff::after { content: ''; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.1); }
.tariff__price { font-size: 38px; font-weight: 800; line-height: 1; margin: 8px 0 4px; letter-spacing: -0.02em; }
.tariff__price small { font-size: 15px; font-weight: 600; opacity: .85; }
.tariff ul { margin: 16px 0 18px; display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 1; }
.tariff li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.tariff li .ic { width: 18px; height: 18px; margin-top: 2px; }
.tariff__soon { font-size: 13px; opacity: .85; margin-top: 10px; }
.promo { display: flex; gap: 8px; margin-top: 14px; }
.promo input { flex: 1; min-width: 0; height: 46px; border-radius: 999px; border: 1px solid var(--line-2); padding: 0 16px; background: var(--surface); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

/* ---------- Вход ---------- */
.is-auth { background: var(--bg); }
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100dvh; padding: 14px; gap: 14px; }
.auth__intro {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 28px; padding: 36px clamp(24px, 4vw, 56px);
  border-radius: var(--r-xl); background: var(--hero); color: #fff;
}
.auth__intro .brand { color: #fff; }
.auth__intro .brand__name b { color: #fff; opacity: .75; }
.auth__pitch { margin-top: auto; max-width: 560px; position: relative; z-index: 1; }
.auth__pitch h1 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; margin-bottom: 18px; }
.auth__pitch p { opacity: .9; font-size: 16px; max-width: 46ch; }
.auth__art { position: relative; z-index: 1; width: min(460px, 100%); align-self: flex-start; }
.auth__art svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 30px 40px rgba(20, 10, 80, .35)); }
.auth__points { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.auth__points li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: 13.5px; font-weight: 600; }
.auth__points .ic { width: 16px; height: 16px; }
.auth__intro::before { content: ''; position: absolute; width: 520px; height: 520px; right: -200px; top: -200px; border-radius: 50%; background: rgba(255,255,255,.08); }
.auth__panel { display: flex; flex-direction: column; justify-content: center; padding: 32px clamp(16px, 4vw, 56px); }
.auth__card { width: 100%; max-width: 420px; margin: 0 auto; }
.auth__mbrand { display: none; }
.auth__tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 5px; background: var(--sunken); border-radius: 999px; margin-bottom: 26px; }
.auth__tabs button { height: 42px; border: 0; border-radius: 999px; background: none; font-weight: 600; color: var(--ink-2); }
.auth__tabs button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.auth__h { font-size: 26px; margin-bottom: 8px; }
.auth__lead { color: var(--ink-2); margin-bottom: 22px; }
.auth__card .back { margin: 0 0 16px -6px; }
.auth__card .btn--text { align-self: center; }
.auth__err { color: var(--bad); background: var(--bad-soft); padding: 11px 14px; border-radius: 14px; font-size: 14px; }
.auth__demo { margin-top: 18px; text-align: center; }
.auth__demo button { border: 0; background: none; color: var(--ink-2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.code { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 18px; margin-bottom: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line-2); font-size: 18px; font-weight: 700; letter-spacing: .08em; text-align: center; user-select: all; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }
.auth__card .btnrow { margin-bottom: 20px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Установка приложения */
.install-steps { display: flex; flex-direction: column; gap: 12px; counter-reset: st; }
.install-steps li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.install-steps li::before { counter-increment: st; content: counter(st); width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.install-steps .ic { color: var(--brand); }

/* ---------- Адаптив ---------- */
@media (max-width: 1240px) {
  .decoding { grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; }
  .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .grid--2, .grid--even, .docview, .check, .decoding { grid-template-columns: minmax(0, 1fr); }
  .docview__preview, .check__preview, .decoding__aside { position: static; }
  .docview__preview { max-width: 560px; }
  .check__preview { max-height: 380px; overflow: auto; border-radius: var(--r-lg); }
  .busy { grid-template-columns: 1fr; gap: 24px; }
  .busy__preview { max-height: 320px; }
  .auth { grid-template-columns: 1fr; }
  .auth__intro { order: 2; }
  .auth__art { display: none; }
}

/* ---------- Тарифы ---------- */
.lead { color: var(--ink-2); margin-bottom: 14px; }
.tariffs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.tcard { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 22px 20px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); min-width: 0; }
.tcard.is-current { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft-2); }
.tcard--hero { background: var(--hero); color: #fff; border-color: transparent; box-shadow: var(--sh-brand); overflow: hidden; }
.tcard--hero::after { content: ''; position: absolute; right: -50px; top: -50px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.1); pointer-events: none; }
.tcard__tag { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); margin-bottom: 4px; }
.tcard--hero .tcard__tag { background: rgba(255,255,255,.2); color: #fff; }
.tcard__name { font-size: 17px; }
.tcard__price { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.tcard__price small { font-size: 14px; font-weight: 600; opacity: .75; }
.tcard ul { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; position: relative; z-index: 1; }
.tcard li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.tcard li .ic { width: 17px; height: 17px; margin-top: 2px; flex: none; color: var(--mint); }
.tcard--hero li .ic { color: #fff; }
.freebar { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; padding: 12px 16px; border-radius: var(--r); background: var(--mint-soft); font-size: 14px; }
.freebar span { display: inline-flex; align-items: center; gap: 6px; }
.freebar .ic { width: 17px; height: 17px; color: var(--mint); }
.paynote { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); }
.paynote .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--brand); }
.quota { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; padding: 10px 14px; border-radius: var(--r); background: var(--brand-soft); font-size: 14px; }
.quota .ic { width: 17px; height: 17px; color: var(--brand); }
.quota span { flex: 1; min-width: 0; }
.quota--out { background: var(--warn-soft); }
.quota--out .ic { color: var(--warn); }
.meters { display: flex; flex-direction: column; gap: 12px; }
.meter__top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 6px; }
.meter__bar { height: 8px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.meter__bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

/* ---------- Админка ---------- */
.atabs { display: flex; gap: 6px; margin: -8px 0 22px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.atabs a { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: 14px; white-space: nowrap; background: var(--surface); border: 1px solid var(--line); }
.atabs a .ic { width: 16px; height: 16px; }
.atabs a:hover { text-decoration: none; color: var(--ink); }
.atabs a.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.kpi { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); min-width: 0; }
.kpi > div { min-width: 0; }
.kpi small { display: block; color: var(--ink-3); font-size: 13px; }
.kpi b { display: block; font-size: 24px; font-weight: 750; letter-spacing: -0.01em; line-height: 1.25; margin: 2px 0; overflow-wrap: anywhere; }
.kpi span:not(.bubble) { display: block; color: var(--ink-2); font-size: 12.5px; }
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 20px; }
.chart { padding: 16px 18px 12px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); min-width: 0; }
.chart figcaption { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chart figcaption span { flex: 1 1 100%; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.chart figcaption b { font-size: 22px; font-weight: 750; }
.chart figcaption small { color: var(--ink-3); font-size: 12.5px; }
.bars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); align-items: end; gap: 2px; height: 110px; border-bottom: 1px solid var(--line); }
.bars__col { position: relative; height: 100%; display: flex; align-items: flex-end; cursor: default; outline: none; }
.bars__col i { display: block; width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; opacity: .85; transition: opacity .15s; }
.bars__col:hover i, .bars__col:focus i { opacity: 1; background: var(--brand-deep, var(--brand)); }
.bars__col:hover::after, .bars__col:focus::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 8px; z-index: 5; pointer-events: none; }
.bars__col:first-child:hover::after, .bars__col:first-child:focus::after { left: 0; transform: none; }
.bars__col:last-child:hover::after, .bars__col:last-child:focus::after { left: auto; right: 0; transform: none; }
.bars__axis { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 11.5px; margin-top: 6px; }
.card__title { font-size: 17px; margin-bottom: 14px; }
.card__sub { font-size: 14px; color: var(--ink-2); margin: 18px 0 8px; }
.card--flush { padding: 0; overflow: hidden; }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel__row { display: grid; grid-template-columns: minmax(170px, 1.2fr) 2fr auto 44px; gap: 10px; align-items: center; font-size: 14px; }
.funnel__bar { height: 10px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.funnel__bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.funnel__row small { color: var(--ink-3); text-align: right; }
.kv { display: flex; flex-direction: column; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv li:last-child { border-bottom: 0; }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.atable { width: 100%; border-collapse: collapse; font-size: 14px; }
.atable th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.atable td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.atable tr:last-child td { border-bottom: 0; }
.atable tr[data-href] { cursor: pointer; }
.atable tr[data-href]:hover td { background: var(--surface-2); }
.atable tr.is-dead td { opacity: .55; }
.card .atable th { background: none; padding-left: 0; }
.card .atable td { padding-left: 0; }
.card--flush .atable th, .card--flush .atable td { padding-left: 14px; }
.afilter { display: grid; grid-template-columns: 2fr repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cgrid fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cgrid legend { font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 0 6px; }
.segs { display: flex; flex-direction: column; gap: 16px; }
.segs .card + .card { margin-top: 0; }
.segcard { display: flex; flex-direction: column; gap: 14px; }
.segcard__head { display: flex; flex-direction: column; gap: 10px; }
.radio { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); }
.radio input { width: 18px; height: 18px; accent-color: var(--brand); }
.savebar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; padding: 12px 14px 12px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-2, var(--sh-1)); }
.savebar .muted { flex: 1; font-size: 13.5px; }
.elog { display: flex; flex-direction: column; }
.elog li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.elog li:last-child { border-bottom: 0; }
.elog time { color: var(--ink-3); min-width: 110px; font-variant-numeric: tabular-nums; }
.elog__type { font-weight: 600; }
.elog__type--error { color: var(--bad); }
.elog__type--admin { color: var(--brand); }
.backlink { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; margin-bottom: 12px; }
.backlink .ic { width: 16px; height: 16px; }
.break { overflow-wrap: anywhere; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; }


/* ---------- Семейный доступ ---------- */
.people { display: flex; flex-direction: column; gap: 8px; }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.people li > span:nth-child(2) { flex: 1; min-width: 0; }
.people b { display: block; overflow-wrap: anywhere; font-size: 14.5px; }
.people small { color: var(--ink-3); font-size: 13px; }
.linkbox input { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line-2); padding: 0 14px; font: 13px/1 ui-monospace, monospace; background: var(--surface-2); color: var(--ink); }
.joinbox { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 18px; background: var(--brand-soft); margin-bottom: 14px; }
.joinbox > .ic { width: 34px; height: 34px; color: var(--brand); flex: none; }
.joinbox b { display: block; font-size: 17px; overflow-wrap: anywhere; }
.joinbox span { color: var(--ink-2); }
.joinlist { display: flex; flex-direction: column; gap: 10px; }
.joinlist li { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.joinlist .ic { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--mint); }
.whoami { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.whoami__b { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: left; }
.whoami__b:hover { border-color: var(--brand); }
.whoami__b small { display: block; color: var(--ink-3); }

/* ---------- Обучение ---------- */
.tour { position: fixed; inset: 0; z-index: 90; }
.tour__spot { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(12, 12, 30, .62), 0 0 0 3px var(--brand); transition: all .35s cubic-bezier(.2, .7, .2, 1); pointer-events: none; }
.tour__spot--none { left: 50%; top: 50%; width: 0; height: 0; box-shadow: 0 0 0 9999px rgba(12, 12, 30, .62); }
.tour__card { position: fixed; z-index: 2; width: 360px; max-width: calc(100vw - 24px); background: var(--surface); color: var(--ink); border-radius: 24px; padding: 22px; box-shadow: var(--sh-2); animation: tourIn .35s cubic-bezier(.2, .7, .2, 1); }
.tour__card--center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: 420px !important; text-align: center; animation: tourInC .35s cubic-bezier(.2, .7, .2, 1); }
@keyframes tourIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes tourInC { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
.tour__card > .bubble { margin-bottom: 12px; }
.tour__art svg { width: 170px; height: auto; margin: 0 auto 6px; display: block; }
.tour__step { font-size: 12.5px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.tour__card h2 { font-size: 20px; line-height: 1.2; margin-bottom: 8px; }
.tour__card > p { color: var(--ink-2); font-size: 15px; }
.tour__tip { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--brand-soft); font-size: 13.5px; color: var(--ink-2); text-align: left; }
.tour__tip .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--brand); }
.tour__foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.tour__card--center .tour__foot { justify-content: center; }
.tour__dots { display: flex; gap: 5px; margin-right: auto; }
.tour__card--center .tour__dots { display: none; }
.tour__dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.tour__dots i.is-done { background: var(--brand-soft-2); }
.tour__dots i.is-on { background: var(--brand); width: 18px; border-radius: 99px; }
.tour__final { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
@media (max-width: 860px) {
  .tour__card--center { width: calc(100vw - 24px) !important; }
}

@media (max-width: 860px) {
  .tariffs { grid-template-columns: minmax(0, 1fr); }
  .tcard__price { font-size: 28px; }
  .afilter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .afilter .field:first-child { grid-column: 1 / -1; }
  .afilter .btn { grid-column: 1 / -1; }
  .row3, .cgrid { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .kpi { padding: 12px; flex-direction: column; gap: 6px; }
  .kpi .bubble { display: none; }
  .kpi b { font-size: 19px; }
  .charts { grid-template-columns: minmax(0, 1fr); }
  .funnel__row { grid-template-columns: minmax(0, 1fr) auto 40px; }
  .funnel__bar { grid-column: 1 / -1; grid-row: 2; }
  .atabs { margin: -8px -14px 18px; padding: 0 14px 2px; }
  .savebar { border-radius: 20px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .savebar .muted { flex-basis: 100%; }
  .savebar .btn { flex: 1; }
  body { font-size: 15px; }
  .side { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20;
    height: 60px; padding: 0 8px 0 14px; padding-top: env(safe-area-inset-top); height: calc(60px + env(safe-area-inset-top));
    background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .topbar .logo { width: 32px; height: 32px; border-radius: 10px; }
  .topbar .brand__name { font-size: 17px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
    padding: 6px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--sh-2);
  }
  .tabbar__link { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0; font-size: 10.5px; color: var(--ink-3); font-weight: 600; border-radius: 18px; border: 0; background: none; }
  .tabbar__link:hover { text-decoration: none; }
  .tabbar__link.is-active { color: var(--brand); background: var(--brand-soft); }
  .tabbar__link .ic { width: 22px; height: 22px; }
  .tabbar__ask { color: var(--ink); }
  .tabbar__ask .orb { width: 34px; height: 34px; margin: -14px 0 0; filter: drop-shadow(0 6px 10px rgba(91, 76, 240, .45)); }
  .fab { display: none; }
  .main { margin-left: 0; padding: 14px 14px calc(110px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 18px; align-items: flex-start; }
  .page-head > .btn { width: 100%; }
  .page-head__actions { width: 100%; }
  .hero { grid-template-columns: 1fr; padding: 22px; border-radius: 24px; }
  .hero__ring { position: absolute; right: 14px; top: 14px; }
  .hero__ring .ring { width: 86px; height: 86px; }
  .hero__ring .ring__sub { display: none; }
  .hero h1 { padding-right: 90px; }
  .hero__actions .btn { flex: 1; }
  .actions { gap: 10px; margin-top: 14px; }
  .action { padding: 14px; gap: 10px; }
  .action small { display: none; }
  .card { padding: 16px; border-radius: 18px; }
  .notice { flex-wrap: wrap; }
  .notice p { flex: 1 1 calc(100% - 40px); }
  .notice .btn { margin-left: 32px; }
  .archive { grid-template-columns: minmax(0, 1fr); }
  .docview__preview { order: 2; }
  .page-head__sub .avatar { display: none; }
  .archive__rail { display: none; }
  .catchips { display: flex; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 16px; padding: 2px 14px 6px; scrollbar-width: none; }
  .chip { flex: none; }
  .prow { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 8px; }
  .prow__due { grid-column: 2; grid-row: 2; flex-direction: row; gap: 8px; align-items: center; text-align: left; }
  .prow__act { grid-column: 3; grid-row: 1 / span 2; }
  .prow__act .btn span { display: none; }
  .prow__act .btn { width: 40px; padding: 0; }
  .prow--solo { grid-template-columns: minmax(0, 1fr) auto; }
  .prow--solo .prow__due { grid-column: 1; }
  .prow--solo .prow__act { grid-column: 2; }
  .plan-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; }
  .stat b { font-size: 22px; }
  .stat .bubble { display: none; }
  .facts { grid-template-columns: 1fr; }
  .setting { grid-template-columns: 1fr; gap: 10px; }
  .seg { display: grid; width: 100%; }
  .seg button { padding: 0 8px; font-size: 13px; white-space: nowrap; }
  .seg button .ic { display: none; }
  .promo { flex-wrap: wrap; }
  .promo input { flex-basis: 100%; }
  .promo .btn { flex: 1; }
  .setting > .bubble { display: none; }
  .samples__list { grid-template-columns: 1fr; }
  .dropzone { padding: 32px 16px; }
  .decode-opts .select { min-width: 0; width: 100%; }
  .field--inline { flex-direction: column; align-items: stretch; gap: 6px; width: 100%; }
  .edtable { overflow-x: auto; }
  .edtable__row { grid-template-columns: 150px 84px 70px 58px 58px 30px; min-width: 490px; }
  .meaning li { grid-template-columns: 1fr; gap: 8px; }
  .terms div { grid-template-columns: 1fr; gap: 2px; }
  .stepper li:not(.is-cur) { padding: 0 6px; font-size: 0; gap: 0; }
  .modal { padding: 0; align-items: end; }
  .modal__panel { width: 100%; max-height: 92dvh; border-radius: 26px 26px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal__panel--wide { width: 100%; }
  .row2 { grid-template-columns: 1fr; }
  .avatar.xl { width: 58px; height: 58px; font-size: 20px; }
  .toasts { bottom: calc(96px + env(safe-area-inset-bottom)); width: calc(100% - 32px); }
  .chat { inset: 0; width: 100%; border-radius: 0; border: 0; padding-bottom: env(safe-area-inset-bottom); }
  .chat__head { padding-top: calc(14px + env(safe-area-inset-top)); }
  .auth { padding: 0; gap: 0; }
  .auth__intro { border-radius: 0; padding: 26px 18px 30px; gap: 18px; }
  .auth__intro .brand { display: none; }
  .auth__pitch h1 { font-size: 26px; margin-bottom: 10px; }
  .auth__panel { padding: calc(20px + env(safe-area-inset-top)) 18px 28px; justify-content: flex-start; }
  .auth__mbrand { display: flex; margin: 0 0 22px; }
  .code { grid-template-columns: repeat(2, 1fr); font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .busy__lines li { color: var(--ink); }
}

@media print {
  :root { --bg: #fff; --surface: #fff; }
  body { background: #fff; font-size: 12px; }
  .side, .topbar, .tabbar, .fab, .chat, .noprint, .stepper, .page-head__actions, .back, .toasts, .notice, .prow__act, .ind__chev, .indlist__more, .btn--text, .aside-block--ask { display: none !important; }
  .main { margin: 0; padding: 0; max-width: none; }
  .decoding, .docview { grid-template-columns: 1fr; }
  .decoding__aside, .docview__preview { position: static; }
  .indlist [hidden] { display: flex !important; }
  .card, .aside-block, .verdict, .ind { break-inside: avoid; box-shadow: none; }
  .preview__pdf { display: none; }
}
