/* Новый интерфейс Smart Clinica (/app). Макет: docs/design/concept. */

@font-face { font-family: 'Onest'; src: url('../fonts/onest-cyrillic-8faa2f.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; src: url('../fonts/onest-latin-5ac482.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope-cyrillic-c9a5f1.woff2') format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope-latin-814019.woff2') format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono-cyrillic-50e257.woff2') format('woff2'); font-weight: 100 800; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono-latin-559371.woff2') format('woff2'); font-weight: 100 800; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Unbounded'; src: url('../fonts/unbounded-cyrillic-d8bc1d.woff2') format('woff2'); font-weight: 200 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; src: url('../fonts/unbounded-latin-5c3ff3.woff2') format('woff2'); font-weight: 200 900; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --bg: #F3F6FB; --side: #FFFFFF; --panel: #FFFFFF; --line: #E1E7F0;
  --text: #0E1A2C; --muted: #56667D; --accent: #3554E0; --accent-soft: rgba(74,104,243,0.10); --accent-line: rgba(74,104,243,0.35);
  --track: #EDF1F7; --good: #0F7F55; --good-soft: rgba(15,127,85,0.10); --bad: #C2412D; --bad-soft: rgba(194,65,45,0.10);
  --warn: #A9530A; --warn-soft: rgba(214,120,30,0.14); --warn-line: rgba(214,120,30,0.35);
  --btn: #4A68F3; --btn-text: #FFFFFF; --active-bg: rgba(74,104,243,0.10); --active-text: #2B47CC;
  --glow: radial-gradient(900px 520px at 78% -8%, rgba(74,104,243,0.10), transparent 70%);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0A1220; --side: #08101C; --panel: rgba(150,190,240,0.06); --line: rgba(170,205,255,0.14);
  --text: #EAF1FA; --muted: #9DB0C8; --accent: #7CC4FF; --accent-soft: rgba(124,196,255,0.14); --accent-line: rgba(124,196,255,0.35);
  --track: rgba(170,205,255,0.10); --good: #5ED3A0; --good-soft: rgba(94,211,160,0.14); --bad: #FF8A7A; --bad-soft: rgba(255,138,122,0.14);
  --warn: #FFB86B; --warn-soft: rgba(255,184,107,0.16); --warn-line: rgba(255,184,107,0.30);
  --btn: #7CC4FF; --btn-text: #06101D; --active-bg: rgba(124,196,255,0.14); --active-text: #EAF1FA;
  --glow: radial-gradient(900px 520px at 78% -8%, rgba(74,104,243,0.22), transparent 70%), radial-gradient(700px 480px at 10% 110%, rgba(124,196,255,0.08), transparent 70%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background-color: var(--bg); background-image: var(--glow); background-attachment: fixed; color: var(--text);
  font-family: Manrope, system-ui, sans-serif; font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
/* Атрибут hidden сильнее любого display из классов (иначе «Показать все» не прячет лишнее) */
[hidden] { display: none !important; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* Каркас */
.ui { min-height: 100vh; display: flex; }
.side { position: sticky; top: 0; height: 100vh; flex: 0 0 248px; display: flex; flex-direction: column; gap: 18px; padding: 24px 16px 16px;
  background: var(--side); border-right: 1px solid var(--line); overflow-y: auto; transition: flex-basis .15s ease; }
.ui.collapsed .side { flex-basis: 76px; padding-inline: 14px; }
.ui.collapsed .side .label, .ui.collapsed .side .group-title, .ui.collapsed .side .badge, .ui.collapsed .side .clinic-text { display: none; }
.ui.collapsed .side .group-rule { display: block; }
.ui.collapsed .nav a, .ui.collapsed .side .upload, .ui.collapsed .side .collapse { justify-content: center; }

.logo { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.logo .label { font-family: Unbounded, sans-serif; font-weight: 600; font-size: 15px; letter-spacing: 0.01em; white-space: nowrap; }
.clinic { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); text-align: left; }
.clinic .ini { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.clinic-text { display: flex; flex-direction: column; min-width: 0; }
.clinic-text b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clinic-text span { font-size: 13px; color: var(--muted); }

.nav a.upload, .upload { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--btn); color: var(--btn-text); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.nav a.upload:hover { background: var(--btn); color: var(--btn-text); filter: brightness(1.08); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--active-bg); color: var(--text); }
.nav a.active { background: var(--active-bg); color: var(--active-text); font-weight: 600; }
.nav a.disabled { opacity: .55; pointer-events: none; }
.nav svg, .upload svg, .collapse svg { flex: none; }
.group-title { padding: 14px 12px 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); opacity: .7; }
.group-rule { display: none; height: 1px; margin: 10px 8px; background: var(--line); }
.badge { margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.collapse { margin-top: auto; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-size: 14px; }

.main { flex: 1; min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 48px; display: flex; flex-direction: column; gap: 20px; }
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.crumb { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
h1 { margin: 0; font-family: Onest, sans-serif; font-weight: 600; font-size: 30px; letter-spacing: -0.01em; }
.sub { margin: 6px 0 0; color: var(--muted); }
.top-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; }
.account { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; min-height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); }
.account .av { width: 36px; height: 36px; border-radius: 50%; background: var(--btn); color: var(--btn-text); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.account span { display: flex; flex-direction: column; line-height: 1.25; }
.account b { font-size: 14px; white-space: nowrap; }
.account small { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Элементы */
.seg { display: flex; padding: 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.seg button { border: 0; background: transparent; padding: 8px 14px; min-height: 36px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg button.on { background: var(--active-bg); color: var(--active-text); }
/* Переключатели периода на телефоне: компактнее и с прокруткой, чтобы не вылезали за экран */
@media (max-width: 640px) { .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .seg::-webkit-scrollbar { display: none; } .seg button { padding: 8px 10px; white-space: nowrap; flex: none; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 14px; }
.chip.on { background: var(--btn); border-color: var(--btn); color: var(--btn-text); }

.card { padding: 20px 22px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); }
.card h2 { margin: 0; font-family: Onest, sans-serif; font-size: 18px; font-weight: 600; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.note { font-size: 14px; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi { padding: 18px 20px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 4px; }
a.kpi { color: inherit; transition: border-color .15s, transform .15s; }
a.kpi:hover { border-color: var(--accent-line); transform: translateY(-1px); }
a.kpi:hover .k::after { content: ' →'; color: var(--accent); }
@media (prefers-reduced-motion: reduce) { a.kpi:hover { transform: none; } }
.kpi .k { color: var(--muted); font-size: 14px; }
.kpi .v { font-family: Onest, sans-serif; font-weight: 600; font-size: 30px; letter-spacing: -0.02em; }
.kpi .n { font-size: 13px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
table.t th { font-weight: 500; color: var(--muted); text-align: left; padding: 8px; }
table.t td { padding: 12px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
table.t .r { text-align: right; }
.person { display: flex; align-items: center; gap: 10px; }
.person .av { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.bar { height: 8px; border-radius: 4px; background: var(--track); min-width: 90px; }
.bar i { display: block; height: 8px; border-radius: 4px; background: var(--accent); }
.pill { display: inline-block; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.skeleton { color: var(--muted); }

/* Нижняя панель разделов на телефоне */
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; gap: 2px; overflow-x: auto; scrollbar-width: none; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--side); border-top: 1px solid var(--line); }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar a { flex: 1 0 72px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border-radius: 12px; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none; text-align: center; white-space: nowrap; }
.tabbar a.active { color: var(--accent); background: var(--accent-soft); }

@media (max-width: 860px) {
  .ui { flex-direction: column; }
  .side { position: static; height: auto; flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .nav { display: flex; flex-direction: row; margin-left: auto; }
  .side .nav > a:not(.upload), .side .nav .group-title, .side .nav .group-rule, .side .collapse, .side .clinic { display: none; }
  .nav a.upload { margin-bottom: 0; }
  /* Логотип и кнопка — в одну строку: на узком экране не переносим, а ужимаем */
  .side { flex-wrap: nowrap; justify-content: space-between; }
  .side .logo { min-width: 0; padding: 0; }
  .side .nav { flex: none; }
  .main { padding: 18px 16px 96px; }
  h1 { font-size: 24px; }
  .tabbar { display: flex; }
}
@media (max-width: 420px) {
  .side .logo svg { width: 24px; height: 24px; }
  .side .logo .label { font-size: 13px; }
  .side .nav a.upload { min-height: 40px; padding: 0 12px; font-size: 13px; gap: 8px; }
  .side .logo { overflow: hidden; }
}
/* Совсем узкий экран: у кнопки остаётся только значок */
@media (max-width: 360px) {
  .side .nav a.upload .label { display: none; }
  .side .nav a.upload { width: 40px; padding: 0; justify-content: center; }
}

.more-btn { grid-column: 1 / -1; justify-self: start; align-self: start; border: 0; background: none; padding: 6px 0; color: var(--accent); font-weight: 600; font-size: 14px; }
.more-btn:hover { text-decoration: underline; }

/* Метки «демо» / «факт»: честно показываем, какие цифры настоящие */
.tag { display: inline-block; vertical-align: middle; font-family: inherit; font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 3px 8px; border-radius: 999px; text-transform: lowercase; white-space: nowrap; }
.tag.demo { background: var(--warn-soft); color: var(--warn); }
.tag.fact { background: var(--good-soft); color: var(--good); }
.tag.on-hero { background: rgba(255,255,255,.18); color: #fff; }
h1 .tag { font-size: 12px; margin-left: 6px; position: relative; top: -4px; }
h2 .tag { margin-left: 4px; }
.demo-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: 16px; border: 1px solid var(--warn-line); background: var(--warn-soft); font-size: 14px; line-height: 1.5; }
.demo-banner .tag.demo { background: var(--panel); flex: none; margin-top: 1px; }

/* Кабинет врача: статистика и обучение (этапы консультации) */
.g2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.crit { display: flex; flex-direction: column; gap: 14px; }
.crit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; font-size: 14px; }
.crit-row b { font-weight: 600; }
.crit-row small { color: var(--muted); font-size: 12px; }
.crit-row .bars { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; }
.crit-row .bar { min-width: 0; height: 6px; } .crit-row .bar i { height: 6px; }
.crit-row .bar.clinic i { background: var(--muted); opacity: .45; }
.crit-row.weak { padding: 10px 12px; margin: 0 -12px; border-radius: 12px; background: var(--bad-soft); }
.lnk { color: var(--accent); font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
.lnk:hover { text-decoration: underline; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 6px; border-radius: 3px; margin-right: 5px; vertical-align: middle; background: var(--accent); }
.legend i.clinic { background: var(--muted); opacity: .45; }

/* Диктовка в поля правки (ui-dictate.js) */
.dict-wrap { position: relative; display: flex; flex-direction: column; gap: 4px; width: 100%; }
.dict-wrap textarea { padding-right: 46px !important; overflow: hidden; }
.dict-btn { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.dict-btn:hover { color: var(--accent); border-color: var(--accent-line); }
.dict-btn.on { background: var(--bad); border-color: var(--bad); color: #fff; animation: dict-pulse 1.2s ease-in-out infinite; }
.dict-btn:disabled { opacity: .5; cursor: progress; }
@keyframes dict-pulse { 50% { box-shadow: 0 0 0 6px var(--bad-soft); } }
@media (prefers-reduced-motion: reduce) { .dict-btn.on { animation: none; } }
.dict-note { font-size: 12px; color: var(--muted); min-height: 0; }
.dict-note:empty { display: none; }

/* «Оценка ИИ точная?» под результатами ИИ (ui-feedback.js) */
.fb-box { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.fb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 13px; color: var(--muted); }
.fb-col { flex-direction: column; align-items: stretch; }
.fb-btn { min-height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.fb-btn:hover { border-color: var(--accent-line); }
.fb-btn.on { background: var(--btn); color: var(--btn-text); border-color: transparent; }
.fb-link { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.fb-text { width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; resize: vertical; }

/* Отзыв о платформе раз в месяц (ui-survey.js) */
.sv-back { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(7, 14, 26, .45); }
.sv { position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; box-sizing: border-box; display: flex; flex-direction: column; gap: 12px;
      padding: 24px; border-radius: 20px; background: var(--panel); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.sv h2 { margin: 0; font-size: 20px; }
.sv .note { margin: 0; line-height: 1.5; }
.sv label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.sv textarea { width: 100%; box-sizing: border-box; min-height: 56px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 15px; resize: vertical; }
.sv-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.sv-x:hover { background: var(--track); }
.sv-stars { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sv-stars button { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
.sv-stars button.on { background: var(--btn); color: var(--btn-text); border-color: transparent; }
.sv-foot { display: flex; align-items: center; gap: 14px; }
.sv .btn-main { display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border-radius: 12px; border: 0; background: var(--btn); color: var(--btn-text); font: inherit; font-weight: 600; cursor: pointer; }
.sv .err { margin: 0; color: var(--bad); font-size: 14px; } .sv .err:empty { display: none; }

/* Отзыв об уроке — по желанию (ui-course-feedback.js) */
.cf { display: flex; flex-direction: column; gap: 12px; }
.cf h2 { margin: 0; }
.cf .note { margin: 0; line-height: 1.5; }
.cf-done { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 14px; }
.cf-label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.cf-text { width: 100%; box-sizing: border-box; min-height: 56px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 15px; resize: vertical; }
.cf-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cf .btn-main { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 12px; border: 0; background: var(--btn); color: var(--btn-text); font: inherit; font-weight: 600; cursor: pointer; }
.cf .err { margin: 0; color: var(--bad); font-size: 14px; } .cf .err:empty { display: none; }
.sv-stars { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Уточнение расшифровки по смыслу (ui-transcript-fix.js): аккуратно, без заливки — тонкий пунктир */
.fx { text-decoration: underline dotted var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; cursor: help; }
.fx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 10px; font-size: 13px; }
.fx-bar:empty { display: none; }
.fx-note { color: var(--muted); }

/* Общие кнопки и формы новых экранов (настройки, клиники, отчёты, карта роста) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 12px; border: 0; background: var(--btn); color: var(--btn-text); font: inherit; font-weight: 600; font-size: 14px; white-space: nowrap; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.ghost:hover { border-color: var(--accent-line); filter: none; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 500; }
.form .opt { font-weight: 400; opacity: .8; }
.form input:not([type=checkbox]), .form select, .form textarea { min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 15px; box-sizing: border-box; width: 100%; }
.form textarea { padding: 10px 12px; line-height: 1.5; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--accent-line); outline-offset: 0; border-color: var(--accent); }
.form input:disabled, .form select:disabled { opacity: .7; }
.form-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.form-error { grid-column: 1 / -1; margin: 0; color: var(--bad); font-size: 14px; }
.form-error:empty { display: none; }
.saved { color: var(--good); font-size: 14px; font-weight: 600; }
.saved:empty { display: none; }

/* Вкладки страницы (подчёркиванием) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 15px; white-space: nowrap; cursor: pointer; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs .cnt { display: inline-block; margin-left: 6px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn-soft); color: var(--warn); font-size: 12px; line-height: 18px; text-align: center; }
.tab-pane[hidden] { display: none; }

/* Плитки интеграций */
.ints { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.int { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.int.on { border-color: var(--good); }
.int-top { display: flex; align-items: center; gap: 10px; }
.int-logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--track); color: var(--muted); flex: none; }
.int.on .int-logo { background: var(--good-soft); color: var(--good); }
.int-top b { flex: 1; min-width: 0; }
.int p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); flex: 1; }
.int .btn { align-self: flex-start; }

/* Полоса расхода лимита */
.meter { height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; position: relative; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.meter.warn i { background: var(--warn); } .meter.bad i { background: var(--bad); }
.meter::after { content: ''; position: absolute; left: 80%; top: 0; bottom: 0; width: 2px; background: var(--panel); }

/* Знакомство с платформой (ui-onboard.js) */
.ob-back { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(7, 14, 26, .45); }
.ob { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; box-sizing: border-box; padding: 28px; border-radius: 20px; background: var(--panel); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
#ob-body { display: flex; flex-direction: column; gap: 12px; }
.ob h2 { margin: 0; padding-right: 28px; font-family: Onest, sans-serif; font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.ob h3 { margin: 0; font-size: 16px; }
.ob p { margin: 0; font-size: 15px; line-height: 1.55; }
.ob-step { font-size: 12px; font-weight: 600; color: var(--muted); }
.ob-x { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.ob-x:hover { background: var(--track); }
.ob-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 6px; }
.ob .btn-main { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 0; background: var(--btn); color: var(--btn-text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.ob-ex { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); font-size: 14px; }
.ob-ex-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ob-ex-r { display: flex; justify-content: space-between; gap: 10px; }
.ob-ex .bar { height: 6px; }
.ob-ex p { font-size: 14px; color: var(--muted); }
.ob-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.ob-stats div { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; background: var(--track); font-size: 13px; color: var(--muted); }
.ob-stats b { font-family: Onest, sans-serif; font-size: 24px; color: var(--text); }
.ob-check ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.ob-check li { display: flex; align-items: center; gap: 10px; }
.ob-check li.done { color: var(--muted); }
.ob-check a { color: var(--accent); font-weight: 600; text-decoration: none; }
.ob-check a:hover { text-decoration: underline; }
.ob-tick { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); font-size: 12px; font-weight: 700; }
.ob-check li.done .ob-tick { border-color: transparent; background: var(--good-soft); color: var(--good); }
.ob-check-foot { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; }
