/* Число разделов меняется (вкладки добавляются из pages.js) — колонки
   делятся поровну на столько кнопок, сколько есть, а не на фиксированные
   шесть: иначе при пяти разделах справа оставалась пустая колонка. */
.bottom-nav { width: min(calc(100% - 24px), 680px); grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; padding: 5px; }
.bottom-nav a { flex-direction: column; gap: 4px; min-height: 56px; min-width: 0; font-size: 10px; letter-spacing: -.03em; padding: 4px 0; }
.menu-symbol { display: grid; place-items: center; width: 22px; height: 22px; font-size: 22px; line-height: 1; }
.work-section { padding: 24px 0; border-bottom: 1px solid var(--line); }
.work-section > h2 { margin-bottom: 20px; }
.work-section h3 { font-size: 16px; margin: 16px 0 8px; }
.work-section p { font-size: 14px; overflow-wrap: anywhere; }
.work-form { display: flex; flex-direction: column; gap: 14px; margin-block: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; margin: 0; }
/* Поле, стоящее в панели само по себе, без .work-form с её gap — иначе
   подпись прилипает к тексту-пояснению над ней. */
.panel-content > .field { margin-top: 18px; }
/* Пустое состояние внутри панели — то же оформление, что на главных
   экранах, но тише: заголовок панели рядом, и h3 в 20px спорил бы с ним. */
.panel-content .empty, .work-section .empty { padding: 18px 0 8px; }
.panel-content .empty h3, .work-section .empty h3 { font-size: 16px; margin: 0 0 6px; }
.panel-content .empty p, .work-section .empty p { font-size: 13px; color: var(--muted); }

.field textarea, .field select { font: inherit; width: 100%; min-height: 48px; padding: 12px; border: 1px solid var(--field-border); border-radius: 10px; background: var(--card); color: var(--text); }
.field textarea { min-height: 112px; resize: vertical; }
.field input[type=file] { font-size: 13px; }
.check-row { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 8px 0; }
.check-row input { width: 22px; height: 22px; min-height: 22px; flex-shrink: 0; accent-color: var(--accent); }
.inline-action { margin-block: 12px; }
.inline-action .status:empty { display: none; }
.data-row { padding-block: 16px; border-bottom: 1px solid var(--line); }
.confirm-action summary { color: var(--text); }
.work-section details { border-bottom: 1px solid var(--line); padding-block: 8px; }
.work-section details > summary { font-weight: 550; font-size: 14px; }
.work-section img { display: block; max-width: 100%; height: auto; margin-block: 12px; border-radius: 12px; }
.work-section svg { width: 100%; height: auto; margin-block: 16px; }
.pre-line { white-space: pre-wrap; }
/* Ссылки — как текстовые кнопки рядом: без подчёркивания, тем же весом. */
.primary-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-size: 13px; font-weight: 550; text-decoration: none; }
@media (hover: hover) { .primary-link:hover { text-decoration: underline; } }
.financial-total { font-size: 32px !important; letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin-block: 16px; }
.work-section progress { display: block; margin-block: 12px 20px; }
.work-screen select:focus-visible, .work-screen textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.chat-tool-btn, .send-btn, .msg-action-btn, .msg-speak-btn, .chat-list-item-delete { min-width: 44px; min-height: 44px; }
.msg-actions { flex-wrap: wrap; }
.chat-input-pill textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.chat-sidebar { padding-top: calc(24px + var(--safe-top)); padding-bottom: calc(24px + var(--safe-bottom)); }
.chat-list-item-title { min-height: 44px; flex: 1; text-align: left; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .typing-dot { animation: none; } }
.menu-symbol svg { width: 22px; height: 22px; }

/* ---- Выпадающий список (select.js) ---- */
/* Нативный <select> заменён своим: у системного перечня чужая подсветка и
   отступы, стилями он не правится. Поле-кнопка повторяет геометрию
   остальных полей формы, а сам перечень — плавающая поверхность, поэтому
   оформлен как стекло (DESIGN.md §8), как нижняя панель и панель истории. */
.select { position: relative; }
/* Перебивает .work-section svg { width: 100% } выше по файлу: у того
   селектора специфичность выше, чем у одного класса, и значки списка
   растягивались во всю ширину кнопки. */
.select svg { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
.select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--field-border); border-radius: 10px;
  background: var(--card); color: var(--text);
  font: inherit; font-size: 15px; text-align: left;
}
.select-trigger[aria-expanded="true"] { border-color: var(--accent); }
.select-caption { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-caption-empty { color: var(--muted); }
.select .select-chevron { color: var(--muted); transition: transform 220ms cubic-bezier(.32, .72, 0, 1); }
.select-trigger[aria-expanded="true"] .select-chevron { transform: rotate(180deg); }
.select-popup {
  /* Перечень не уже поля, но и не обязан быть той же ширины: фильтр
     отраслей — узкая колонка, и названия вроде «Металлы и добыча» в ней
     обрезались бы многоточием прямо в списке выбора. */
  position: absolute; left: 0; top: calc(100% + 8px);
  min-width: 100%; width: max-content; max-width: min(340px, calc(100vw - 48px));
  /* Выше нижней панели: перечень у последнего поля экрана иначе уходит
     под неё, а обрезать плавающую поверхность нельзя. */
  z-index: calc(var(--z-navigation) + 2);
  padding: 6px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--glass-solid);
  box-shadow: 0 14px 40px var(--shadow-strong);
}
.select[data-drop="up"] .select-popup { top: auto; bottom: calc(100% + 8px); }
.select-popup[hidden] { display: none; }
@supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  :root:where(:not([data-glass="off"])) .select-popup {
    background: var(--glass-panel);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
  }
}
@media (prefers-reduced-transparency: reduce) {
  :root .select-popup { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.select-list { display: flex; flex-direction: column; gap: 2px; max-height: 292px; overflow-y: auto; overscroll-behavior: contain; }
.select-option {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 0; border-radius: 11px; background: transparent; color: var(--text);
  font: inherit; font-size: 15px; text-align: left;
}
.select-option-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-option-hint { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.select-option.is-active { background: var(--surface); }
.select-option.is-selected { color: var(--accent); font-weight: 600; }
.select-option.is-selected.is-active { background: var(--accent-tint); }
.select .select-check { width: 17px; height: 17px; opacity: 0; }
.select-option.is-selected .select-check { opacity: 1; }
/* Наведение и фокус ведут себя как у активной строки: подсветка одна и та
   же, чтобы мышь и клавиатура не спорили за "где я сейчас". */
.select-option:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.field-label { font-size: 13px; }
/* Общее правило base.css подчёркивает любую кнопку при наведении —
   для поля выбора и строк перечня это читается как ссылка. */
@media (hover: hover) {
  .select-trigger:hover, .select-option:hover { text-decoration: none; }
  .select-option:hover { background: var(--surface); }
}

/* ---- Флажок ---- */
/* Системный чекбокс — квадрат с системной галочкой; в тёмной теме она
   выходила тёмно-серой на синем, а форма спорила со скруглениями всего
   остального. accent-color красит только заливку, поэтому рисуем сами. */
.check-row input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px; min-height: 22px; flex-shrink: 0;
  margin: 0; border: 1.5px solid var(--field-border); border-radius: 7px;
  background: var(--card); position: relative;
  transition: background 160ms ease, border-color 160ms ease;
}
.check-row input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
/* Галочка ставится от центра квадрата: прежняя раскладка через grid на
   самом поле ввода в Chrome сдвигала её к нижнему краю. */
.check-row input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 5px;
  border-left: 2.2px solid var(--on-accent); border-bottom: 2.2px solid var(--on-accent);
  transform: translate(-50%, -70%) rotate(-45deg);
}
.check-row input[type="checkbox"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---- Выбор файла ---- */
.field:has(input[type="file"]) { position: relative; }
.field input[type="file"] {
  position: absolute; width: 1px; height: 1px; padding: 0;
  opacity: 0; pointer-events: none;
}
.file-picker {
  display: flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 7px 10px;
  border: 1px solid var(--field-border); border-radius: 10px;
  background: var(--card); cursor: pointer;
}
.file-pick {
  flex: 0 0 auto; padding: 9px 14px; border-radius: 8px;
  background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 550;
}
.file-chosen {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; color: var(--muted);
}
.field input[type="file"]:focus-visible ~ .file-picker { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) { .file-picker:hover .file-pick { background: var(--accent-soft); color: var(--accent); } }

/* Оформление оплаты тарифа (checkout в pages.js). */
.checkout { margin-top: 12px; }
.checkout summary { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 550; font-size: 14px; cursor: pointer; list-style: none; }
.checkout summary::-webkit-details-marker { display: none; }
.checkout[open] summary { background: var(--surface); color: var(--text); }
.checkout-summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 14px 0; font-size: 14px; }
.checkout-summary dt { color: var(--text-dim); }
.checkout-summary dd { margin: 0; font-weight: 550; }
.work-section .checkout-note { font-size: 12px; color: var(--text-dim); margin-top: 8px; }

/* Строка бумаги в портфеле (pages.js, buildFinance). */
.holding { border-bottom: 1px solid var(--line); }
.holding-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; column-gap: 12px; padding: 14px 0; cursor: pointer; list-style: none; transition: transform 160ms ease; }
.holding-row::-webkit-details-marker { display: none; }
/* Стрелка раскрытия (summary::before в base.css) здесь не нужна: нажимается
   вся строка, а в сетке стрелка заняла бы место логотипа. */
.holding-row::before { display: none; }
.holding-row:active { transform: scale(.985); }
.holding-identity { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.holding-identity strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.holding-identity small { font-size: 11px; color: var(--text-dim); }
.holding-quote { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-variant-numeric: tabular-nums; }
.holding-quote strong { font-size: 15px; font-weight: 600; white-space: nowrap; }
.holding-quote small { font-size: 12px; }
.holding[open] .holding-row { padding-bottom: 8px; }
.holding > :not(summary) { margin-left: 52px; }
@media (max-width: 360px) { .holding-row { grid-template-columns: 34px minmax(0, 1fr) auto auto; column-gap: 8px; } .holding > :not(summary) { margin-left: 0; } }
@media (prefers-reduced-motion: reduce) { .holding-row { transition: none; } }

/* ---------- формы раздела «Финансы» (finance-ui.js, buildFinance) ---------- */
.fin-form { gap: 16px; }
.fin-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.fin-goal-row { grid-template-columns: minmax(0, 1.4fr) minmax(120px, 1fr); }
.fin-field { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; }
.fin-field[hidden] { display: none; }
.fin-label { font-size: 12px; font-weight: 550; color: var(--text-dim); letter-spacing: .01em; }
.fin-hint { font-size: 12px; color: var(--text-dim); }
.fin-field input, .fin-money { width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 16px; transition: border-color 160ms ease, box-shadow 160ms ease; }
.fin-field input { padding: 12px 14px; }
.fin-field input:focus, .fin-money:focus-within { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.fin-money { display: flex; align-items: center; padding: 0 14px 0 0; }
.fin-money input { flex: 1; min-width: 0; border: 0; background: transparent; box-shadow: none !important; min-height: 46px; font-variant-numeric: tabular-nums; }
.fin-currency { color: var(--text-dim); font-size: 15px; }
.fin-more { border: 0; }
.fin-more > summary { font-size: 14px; font-weight: 550; color: var(--accent); cursor: pointer; padding: 4px 0; }
.fin-more[open] > summary { margin-bottom: 10px; }
.fin-add-date { align-self: flex-start; padding-left: 0; }
.fin-submit { width: 100%; }

.fin-stepper { display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 4px; border-radius: 14px; background: var(--surface); }
.fin-step { flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; border: 0; border-radius: 10px; background: var(--card); color: var(--text); font-size: 20px; line-height: 1; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.fin-step:disabled { opacity: .35; }
.fin-step-value { width: 64px; min-height: 40px !important; border: 0 !important; background: transparent !important; text-align: center; font-size: 17px !important; font-weight: 600; font-variant-numeric: tabular-nums; padding: 0 !important; box-shadow: none !important; }
.fin-step-unit { font-size: 13px; color: var(--text-dim); margin-right: 8px; }

.fin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 18px; }
.fin-stat { padding: 10px 12px; border-radius: 12px; background: var(--surface); }
.fin-stat dt { font-size: 11px; color: var(--text-dim); }
.fin-stat dd { margin: 4px 0 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

.fin-search { position: relative; margin-top: 4px; }
.fin-search-box { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); transition: border-color 160ms ease, box-shadow 160ms ease; }
.fin-search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.fin-search-box svg { width: 20px; height: 20px; color: var(--text-dim); flex: 0 0 auto; }
.fin-search-box input { flex: 1; min-width: 0; min-height: 50px; border: 0; background: transparent; color: var(--text); font-size: 16px; padding: 0; outline: none; }
.fin-search-list { display: grid; margin-top: 8px; padding: 6px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); box-shadow: 0 12px 32px rgba(0, 0, 0, .12); }
.fin-search-list[hidden] { display: none; }
.fin-search-option { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; border-radius: 12px; background: transparent; color: var(--text); text-align: left; }
.fin-search-option:hover, .fin-search-option[aria-selected="true"] { background: var(--surface); text-decoration: none; }
.fin-search-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fin-search-copy strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-search-copy small { font-size: 12px; color: var(--text-dim); }
.fin-search-price { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-search-note { font-size: 13px; color: var(--text-dim); margin: 8px 0 0; }
.fin-search-note:empty { display: none; }

.fin-picked { display: grid; gap: 16px; margin-top: 16px; padding: 16px; border-radius: 18px; background: var(--surface); }
.fin-picked[hidden] { display: none; }
.fin-picked-head { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.fin-picked-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fin-picked-copy strong { font-size: 17px; font-weight: 600; }
.fin-picked-copy small { font-size: 13px; color: var(--text-dim); }
.fin-picked .fin-stepper { background: var(--card); }

.fin-month { display: inline-flex; align-items: center; gap: 4px; margin: 4px 0 8px; padding: 4px; border-radius: 14px; background: var(--surface); }
.fin-month-arrow { width: 40px; height: 40px; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font-size: 22px; line-height: 1; }
.fin-month-arrow:disabled { opacity: .3; }
.fin-month-label { min-width: 150px; text-align: center; font-size: 15px; font-weight: 600; }

.fin-bars { display: grid; gap: 14px; margin: 8px 0 20px; }
.fin-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; font-size: 14px; }
.fin-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-bar-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.fin-bar-track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--surface); overflow: hidden; }
.fin-bar-fill { display: block; height: 100%; width: calc(var(--share, 0) * 100%); border-radius: inherit; background: var(--accent); transform-origin: left; animation: fin-bar-grow 800ms cubic-bezier(.22, 1, .36, 1) both; }
@keyframes fin-bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.fin-files { display: grid; gap: 10px; }
.fin-file { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; border: 1px dashed var(--field-border); background: var(--card); cursor: pointer; transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease; }
.fin-file:hover { border-color: var(--accent); }
.fin-file:active { transform: scale(.985); }
.fin-file input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.fin-file:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.fin-file-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.fin-file-icon svg { width: 24px; height: 24px; }
.fin-file-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fin-file-copy strong { font-size: 15px; font-weight: 600; }
.fin-file-copy small { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.fin-file.is-busy { opacity: .7; pointer-events: none; }
.fin-file.is-busy .fin-file-icon { animation: fin-pulse 1s ease-in-out infinite; }
.fin-file.is-done { border-style: solid; border-color: var(--up); }
@keyframes fin-pulse { 50% { transform: scale(.9); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .fin-bar-fill, .fin-file.is-busy .fin-file-icon { animation: none; } }

/* Разделы настроек (groupSettings в pages.js). */
.work-section .checkout-elsewhere { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); font-size: 13px; line-height: 1.5; }

/* Тарифы — карточками, как на сайте (landing.css: .pricing, .plan). */
.plans { display: grid; gap: 18px; margin-top: 16px; }
.plan { display: flex; flex-direction: column; padding: 24px 20px; border-radius: 24px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.plan.is-current { box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 6px var(--accent-tint); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.work-section .plan-head h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-dim); }
.plan-badge { padding: 4px 10px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 600; }
.work-section .plan-price { margin: 8px 0 20px; font-size: 40px; font-weight: 550; letter-spacing: -.06em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.plan-features { list-style: none; padding: 0; margin: 0 0 20px; }
.plan-features li { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.4; }
.plan-features li::before { content: ''; flex: 0 0 auto; width: 9px; height: 5px; margin-top: 6px; border: solid var(--accent); border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.work-section .plan-note { margin: -8px 0 16px; font-size: 13px; color: var(--text-dim); }
.plan .checkout { margin-top: auto; }
.plan .checkout > summary { width: 100%; justify-content: center; min-height: 50px; border-radius: 14px; font-size: 15px; }
.plan .checkout-elsewhere { margin-top: auto; }
.plan .checkout > summary::before { display: none; }
.work-section .plan .checkout { border: 0; padding-block: 0; }

/* Тариф ещё не куплен — блок тарифов первым в настройках, всегда открыт. */
.settings-featured { padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* Сводка тарифа — плашками в одну строку. */
.tariff-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tariff-chip, .tariff-fact { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; }
.tariff-chip { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tariff-fact { background: var(--surface); color: var(--text-dim); }

/* Подарок за подписку на канал. */
.bonus-card { position: relative; overflow: hidden; margin-top: 18px; padding: 24px 20px 20px; border-radius: 24px; color: #fff; isolation: isolate;
  background: #0a66ff; background: linear-gradient(145deg, #0a66ff 0%, #2f7bff 45%, #6a5cff 100%);
  box-shadow: 0 16px 40px rgba(10, 102, 255, .28); }
.bonus-card::before { content: ''; position: absolute; z-index: -1; width: 260px; height: 260px; right: -90px; top: -110px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .28), transparent 70%); }
.bonus-days { position: absolute; z-index: -1; right: 18px; top: -6px; font-size: 140px; font-weight: 700; letter-spacing: -.08em; line-height: 1; color: rgba(255, 255, 255, .13); pointer-events: none; }
.work-section .bonus-card .bonus-eyebrow { display: inline-flex; margin: 0 0 12px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .2); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.work-section .bonus-card h3 { margin: 0 0 8px; max-width: 80%; font-size: 24px; font-weight: 600; letter-spacing: -.035em; line-height: 1.15; color: #fff; }
.work-section .bonus-card .bonus-text { margin: 0 0 16px; font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, .88); }
.bonus-steps { counter-reset: step; list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.bonus-steps li { counter-increment: step; display: flex; align-items: center; gap: 10px; font-size: 13px; color: rgba(255, 255, 255, .92); }
.bonus-steps li::before { content: counter(step); display: grid; place-items: center; flex: 0 0 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .22); font-size: 12px; font-weight: 600; }
.bonus-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bonus-actions .inline-action { margin: 0; }
.bonus-actions .text-button { display: inline-flex; align-items: center; justify-content: center; text-align: center; width: 100%; min-height: 48px; padding: 0 12px; border-radius: 14px; font-size: 14px; font-weight: 600; text-decoration: none; }
.bonus-actions .bonus-primary { background: #fff; color: #0a66ff; }
.bonus-actions .bonus-secondary { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.bonus-actions .status { margin-top: 8px; font-size: 12px; color: #fff; }
.work-section .bonus-card .bonus-note { margin: 12px 0 0; font-size: 12px; color: rgba(255, 255, 255, .7); }
@media (max-width: 360px) { .bonus-actions { grid-template-columns: 1fr; } }

/* Псевдо-пуш с предложением тарифа (promo.js) — как уведомление iOS. */
.promo-push { position: fixed; z-index: 40; top: calc(8px + var(--safe-top, env(safe-area-inset-top, 0px))); left: 50%; width: min(calc(100% - 20px), 420px);
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 28px; gap: 12px; align-items: start; padding: 13px 12px 14px 14px; border-radius: 24px;
  background: var(--glass-solid); border: 1px solid var(--glass-border); box-shadow: 0 14px 44px var(--shadow-strong), inset 0 1px 0 var(--glass-highlight);
  color: var(--text); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
  transform: translate(-50%, calc(-100% - 24px - var(--safe-top, 0px))); opacity: 0;
  transition: transform 620ms cubic-bezier(.32, .72, 0, 1), opacity 260ms ease-out; }
@supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  .promo-push { -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%); }
}
.promo-push.is-shown { transform: translate(-50%, 0); opacity: 1; }
.promo-push.is-dragging { transition: none; }
.promo-push.is-leaving { transition: transform 380ms cubic-bezier(.4, 0, 1, 1), opacity 300ms ease-in; opacity: 0; }
.promo-push-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 20px; font-weight: 700; letter-spacing: -.04em; }
.promo-push-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.promo-push-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-dim); }
.promo-push-meta span:first-child { font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.promo-push-copy strong { font-size: 15px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.promo-push-text { font-size: 13.5px; line-height: 1.35; color: var(--text); opacity: .82; }
.promo-push-close { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--text-dim); }
.promo-push-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (prefers-reduced-motion: reduce) {
  .promo-push, .promo-push.is-leaving { transition: opacity 150ms linear; transform: translate(-50%, 0); }
}

.work-section .tariff-telegram-note { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; width: 100%; margin: 12px 0 0; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--accent-soft); color: var(--text); font-size: 13px; line-height: 1.45; text-align: left; }
.tariff-telegram-note strong { color: var(--accent); font-weight: 600; white-space: nowrap; }
@media (hover: hover) { .tariff-telegram-note:hover { text-decoration: none; } .tariff-telegram-note:hover strong { text-decoration: underline; } }
.work-section .settings-good { color: var(--up); font-weight: 600; }

/* ---------- Автосохранение и ползунок ---------- */
.work-section .status.autosave { margin: 10px 0 0; font-size: 12px; color: var(--text-dim); }
.work-section .muted-note { margin-top: 14px; font-size: 13px; color: var(--text-dim); }
.range-field { display: grid; gap: 10px; margin: 18px 0 8px; }
.range-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); }
.range-value { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.range-field input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; min-height: 28px !important; margin: 0; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; cursor: pointer; }
.range-field input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--accent) 0 var(--fill, 50%), var(--track) var(--fill, 50%) 100%); }
.range-field input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .22), 0 0 0 .5px rgba(0, 0, 0, .06); }
.range-field input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--track); }
.range-field input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
.range-field input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .22); }
.range-field input[type="range"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 8px; }

/* Текстовые кнопки внутри разделов — вровень с текстом над ними (отступ
   слева нужен только кнопкам, прижатым к правому краю заголовка). */
:where(.work-section) .text-button { padding-left: 0; padding-right: 0; }
.work-section .text-button.primary { padding: 0 20px; }
/* Последняя строка списка не рисует линию поверх линии раздела. */
.work-section .data-row:last-child { border-bottom: 0; }
/* Последний блок группы настроек — без своей линии: её даёт сама группа. */

/* ---------- Доходы и расходы по месяцам ---------- */
.fin-new-goal { margin-top: 4px; }

/* ---------- Широкий экран: личный кабинет на сайте ----------
   Мобильная колонка с нижней панелью на мониторе оставляла пустыми две трети
   экрана. Здесь колонка шире, а тарифы и финансы раскладываются в несколько
   колонок. Панель разделов остаётся внизу, как на телефоне (так решили
   03.10.2026 — боковое меню пробовали и вернули). */
@media (min-width: 1100px) {
  body:not(.signed-out) .shell { max-width: 960px; }
  .chat-form { width: min(calc(100% - 32px), 848px); }
  .plans { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
  /* Финансы на мониторе — карточки в сетке: крупное (портфель, расходы) во
     всю ширину (разбор трат тоже — выводы и советы встают рядом), чеки и
     отчёты — парой одинаковой высоты. */
  #finance-body {
    display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start;
    grid-template-areas: "tabs tabs" "assets assets" "holdings holdings" "add goals" "spending spending" "analysis analysis" "files reports";
  }
  #finance-body > * { min-width: 0; }
  #finance-body > .finance-tabs { grid-area: tabs; }
  #finance-body > .work-section { margin: 0; padding: 24px; border: 0; border-radius: 22px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
  #finance-body > .work-section:has(#finance-assets) { grid-area: assets; }
  #finance-body > .work-section:has(#finance-holdings) { grid-area: holdings; }
  #finance-body > .work-section:has(#finance-add) { grid-area: add; }
  #finance-body > .work-section:has(#finance-goals) { grid-area: goals; }
  #finance-body > .work-section:has(#finance-spending) { grid-area: spending; }
  #finance-body > .work-section:has(#finance-analysis) { grid-area: analysis; }
  #finance-body > .work-section:has(#finance-files) { grid-area: files; }
  #finance-body > .work-section:has(#finance-reports) { grid-area: reports; }
  .spend-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .spend-layout > .spend-chart { margin-top: 0; }
  .analysis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; }
  .analysis > .analysis-stats, .analysis > .analysis-summary, .analysis > .analysis-foot { grid-column: 1 / -1; }
  .analysis-stats { grid-template-columns: repeat(3, minmax(0, 220px)); }
  .work-section .analysis-summary { max-width: 70ch; }
  #finance-body > .work-section:has(#finance-files), #finance-body > .work-section:has(#finance-reports) { align-self: stretch; }
}

/* ---------- Настройки: список и страницы (pages.js, settingsNavigator) ----------
   Главная — сгруппированные строки, как в настройках iOS; формы — на
   отдельных страницах, каждая секция в своей карточке. */
.settings-list { margin-top: 28px; }
.settings-featured + .settings-home > .settings-list:first-child { margin-top: 32px; }
.settings-list-title { margin: 0 0 8px 16px; font-size: 13px; font-weight: 600; letter-spacing: -.01em; color: var(--text-dim); }
.settings-list-card { overflow: hidden; border-radius: 18px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.settings-row {
  position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 8px; align-items: center; gap: 14px;
  width: 100%; min-height: 56px; padding: 10px 18px 10px 14px; border: 0; border-radius: 0; background: transparent;
  color: var(--text); font-size: 15px; font-weight: 500; letter-spacing: -.01em; text-align: left; cursor: pointer;
  transition: background-color 160ms ease;
}
.settings-row + .settings-row::before { content: ''; position: absolute; top: 0; left: 60px; right: 0; height: 1px; background: var(--line); }
.settings-row[hidden] + .settings-row::before { display: none; }
.settings-row:active:not(:disabled) { transform: none; background: var(--surface); }
@media (hover: hover) { .settings-row:hover { background: var(--surface); text-decoration: none; } }
.settings-row:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.settings-row-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.settings-row-icon svg { width: 18px; height: 18px; }
.settings-row-label { min-width: 0; }
.settings-row-value { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 400; color: var(--text-dim); }
.settings-row-chevron { width: 7px; height: 7px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: rotate(-45deg); }
.settings-row.is-danger { color: var(--danger); }
.settings-row.is-danger .settings-row-icon { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }

.settings-page-head { display: grid; gap: 6px; margin: 4px 0 24px; }
.settings-back { justify-self: start; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; margin-left: -6px; padding: 0 8px 0 0; border: 0; background: transparent; color: var(--accent); font-size: 15px; font-weight: 500; }
.settings-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .settings-back:hover { text-decoration: none; opacity: .75; } }
.settings-page-title { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.045em; line-height: 1.1; }
.settings-page > .work-section { margin-bottom: 16px; padding: 20px 18px; border: 0; border-radius: 20px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.settings-page > .work-section > h2 { margin-bottom: 14px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.settings-page > .work-section.is-solo > h2 { display: none; }
.settings-page .work-section > .panel-content > p:first-child { margin-top: 0; }
.settings-page .data-row:first-child { padding-top: 0; }
.settings-page .work-form .field:first-child, .settings-page .work-form > :first-child { margin-top: 0; }

/* Внутри карточки страницы — без второй рамки вокруг подписи ползунка. */
.settings-page .onb-readout { padding: 0 0 4px; border: 0; background: none; }
.settings-page .onb-readout .onb-readout-count { font-size: 24px; }
.settings-page .inline-action > .text-button { text-align: left; justify-content: flex-start; }
.work-section .text-button.primary, .work-section .text-button.primary:hover { text-decoration: none; }

/* ---------- Строки настроек внутри карточки (дайджест) ----------
   Значок, название с подсказкой, справа — значение или переключатель. */
.option-rows { display: grid; margin: 0 -18px; }
.option-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 60px; padding: 10px 18px; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.option-row, .history-item { position: relative; }
.option-rows > .option-row + .option-row::before, .option-rows > .history-item + .history-item::before { content: ''; position: absolute; top: 0; left: 64px; right: 0; height: 1px; background: var(--line); }
.option-rows > .history-item + .history-item::before { left: 18px; }
.option-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.option-icon svg { width: 18px; height: 18px; }
.option-copy { display: grid; gap: 2px; min-width: 0; }
.option-title { font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.option-hint { font-size: 12.5px; line-height: 1.35; color: var(--text-dim); }
.option-lock { padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; white-space: nowrap; }
.option-row.is-locked .option-icon { background: var(--surface); color: var(--muted); }
@media (hover: hover) { .option-row.is-locked:hover { text-decoration: none; background: var(--surface); } }
.work-section .option-note { margin: 0 0 14px; font-size: 14px; line-height: 1.45; color: var(--text-dim); }

/* Время — маленькой плашкой справа, а не полем во всю ширину. */
.work-section input.time-pill { width: auto; min-width: 0; min-height: 36px !important; padding: 0 12px !important; border: 0 !important; border-radius: 10px; background: var(--surface) !important; box-shadow: none !important; color: var(--text); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.time-pill::-webkit-calendar-picker-indicator { display: none; }
.time-pill:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Переключатель как в iOS. */
.work-section input.ios-switch { appearance: none; -webkit-appearance: none; position: relative; flex: 0 0 auto; width: 51px; height: 31px; min-height: 31px !important; margin: 0; padding: 0 !important; border: 0 !important; border-radius: 999px; background: var(--track) !important; box-shadow: none !important; cursor: pointer; transition: background-color 200ms ease; }
.ios-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform 260ms cubic-bezier(.34, 1.4, .64, 1); }
.work-section input.ios-switch:checked { background: var(--accent) !important; }
.ios-switch:checked::after { transform: translateX(20px); }
.ios-switch:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .ios-switch, .ios-switch::after { transition: none; } }

/* Кнопка второго уровня: заметнее ссылки, тише главной. */
.secondary-action { width: 100%; min-height: 48px; border: 0; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 15px; font-weight: 600; }
@media (hover: hover) { .secondary-action:hover { text-decoration: none; background: var(--accent-soft-hover); } }

/* История — строками, текст раскрывается под строкой. */
.history-item > summary { list-style: none; grid-template-columns: minmax(0, 1fr) 8px; }
.history-item > summary::before { display: none; }
.history-item > summary::-webkit-details-marker { display: none; }
.history-item > summary .settings-row-chevron { transform: rotate(45deg); transition: transform 240ms ease; }
.history-item[open] > summary .settings-row-chevron { transform: rotate(-135deg); }
.history-text { padding: 0 18px 16px; font-size: 14px; line-height: 1.55; color: var(--text); }
.history-text img { width: 100%; margin-top: 10px; border-radius: 12px; }

.work-section details.history-item { margin: 0; padding: 0; border: 0; font-size: inherit; }
.history-item > summary.option-row { font-size: inherit; font-weight: inherit; padding-block: 10px; }
/* Строки сами дают воздух снизу — у карточки со строками нижний отступ меньше. */
.settings-page > .work-section:has(.option-rows) { padding-bottom: 6px; }
.settings-page > .work-section:has(.option-rows) .status.autosave { margin: 0 0 12px; }

/* Значки в строках: общее правило .work-section svg даёт картинкам поля
   сверху и снизу — в маленьком квадрате значок из-за них съезжал вниз. */
.work-section .option-icon svg, .work-section .settings-row-icon svg { margin: 0; width: 18px; height: 18px; }

/* ---------- Почта и пароль ---------- */
.option-pill { flex: 0 0 auto; min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }
@media (hover: hover) { .option-pill:hover { text-decoration: none; background: var(--accent-soft-hover); } }
.option-hint.is-good, .option-note.is-good { color: var(--up); }
.option-hint.is-warn { color: #c77700; }
:root[data-theme="dark"] .option-hint.is-warn { color: #f0a640; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .option-hint.is-warn { color: #f0a640; } }
.settings-page .option-rows + .option-note { margin-top: 12px; }
.option-note strong { color: var(--text); font-weight: 600; }
.settings-page .work-form { gap: 12px; }
.form-cancel, .form-links .text-button { justify-self: center; }
.form-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; }
.work-section input.code-input { text-align: center; font-size: 26px !important; font-weight: 600; letter-spacing: .4em; font-variant-numeric: tabular-nums; padding-left: .4em !important; }

/* Главные кнопки не подчёркиваются при наведении — это не ссылки. */
@media (hover: hover) { .primary:hover, .secondary-action:hover, .option-pill:hover { text-decoration: none; } }

/* ---------- Почта и пароль: шаги, поля, код (auth-flow.js) ---------- */
.auth-flow { display: grid; gap: 16px; }
.auth-steps { display: flex; align-items: center; gap: 10px; }
.auth-step { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); transition: color 300ms ease; }
.auth-step.is-active { color: var(--text); }
.auth-step-dot { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); color: var(--text-dim); font-size: 12px; font-weight: 700; transition: background-color 300ms ease, color 300ms ease, transform 300ms cubic-bezier(.34, 1.56, .64, 1); }
.auth-step.is-active .auth-step-dot { background: var(--accent); color: var(--on-accent); transform: scale(1.06); }
.auth-step.is-done .auth-step-dot { background: var(--up); }
.auth-step-dot svg { width: 14px; height: 14px; stroke-width: 2.6; }
.auth-step-line { position: relative; flex: 1 1 auto; height: 2px; min-width: 24px; border-radius: 1px; background: var(--line); overflow: hidden; }
.auth-step-line::after { content: ''; position: absolute; inset: 0; background: var(--up); transform: scaleX(var(--progress, 0)); transform-origin: left; transition: transform 500ms cubic-bezier(.32, .72, 0, 1); }
.auth-steps .auth-step-line::after { transform: scaleX(1); animation: authLine 600ms cubic-bezier(.32, .72, 0, 1) both; }
.auth-steps:has(.auth-step:first-child:not(.is-done)) .auth-step-line::after { transform: scaleX(0); animation: none; }
@keyframes authLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.work-section .auth-lead { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-dim); }
.auth-lead strong { color: var(--text); font-weight: 600; }

/* backwards, а не both: иначе конец анимации навсегда держал бы opacity: 1
   и неактивная кнопка выглядела бы активной. */
.auth-flow > * { animation: authIn 420ms cubic-bezier(.32, .72, 0, 1) backwards; }
.auth-flow > *:nth-child(2) { animation-delay: 40ms; } .auth-flow > *:nth-child(3) { animation-delay: 80ms; }
.auth-flow > *:nth-child(4) { animation-delay: 120ms; } .auth-flow > *:nth-child(5) { animation-delay: 160ms; }
.auth-flow > *:nth-child(n+6) { animation-delay: 200ms; }
@keyframes authIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.auth-field { display: grid; gap: 7px; }
.auth-label { font-size: 13px; font-weight: 500; color: var(--text-dim); }
.auth-control { position: relative; display: flex; align-items: center; min-height: 52px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px transparent; transition: box-shadow 200ms ease, background-color 200ms ease; }
.auth-control:focus-within { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px var(--accent-tint); }
.auth-field.is-error .auth-control { box-shadow: inset 0 0 0 1.5px var(--danger), 0 0 0 4px color-mix(in srgb, var(--danger) 14%, transparent); }
.auth-icon { display: grid; place-items: center; flex: 0 0 auto; width: 46px; color: var(--muted); transition: color 200ms ease; }
.auth-icon svg { width: 19px; height: 19px; }
.auth-control:focus-within .auth-icon { color: var(--accent); }
.work-section input.auth-input { flex: 1 1 auto; min-width: 0; min-height: 52px !important; padding: 0 8px 0 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; color: var(--text); font-size: 16px; outline: none; }
.auth-input::placeholder { color: var(--muted); }
.auth-eye { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); }
.auth-eye svg { width: 20px; height: 20px; }
@media (hover: hover) { .auth-eye:hover { color: var(--text); text-decoration: none; } }
.auth-mark { display: grid; place-items: center; flex: 0 0 auto; width: 0; overflow: hidden; color: var(--up); opacity: 0; transform: scale(.4); transition: width 240ms ease, opacity 200ms ease, transform 320ms cubic-bezier(.34, 1.56, .64, 1); }
.auth-mark svg { width: 18px; height: 18px; stroke-width: 2.4; }
.auth-field.is-valid .auth-mark { width: 38px; opacity: 1; transform: none; }
.auth-hint { font-size: 12.5px; }
.auth-hint.is-error { color: var(--danger); animation: authIn 260ms ease backwards; }

.auth-meter-row { display: flex; align-items: center; gap: 10px; }
.auth-meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; flex: 0 0 96px; }
.auth-meter-bar { height: 4px; border-radius: 2px; background: var(--line); transition: background-color 260ms ease, transform 260ms ease; transform-origin: left; }
.auth-meter[data-level="1"] .auth-meter-bar:nth-child(-n+1) { background: var(--danger); }
.auth-meter[data-level="2"] .auth-meter-bar:nth-child(-n+2) { background: #e0a100; }
.auth-meter[data-level="3"] .auth-meter-bar { background: var(--up); }
.auth-meter-label { font-size: 12.5px; color: var(--text-dim); }

.auth-error { margin: 0; font-size: 13px; color: var(--danger); }
.auth-error:empty { display: none; }
.auth-submit { position: relative; display: grid; place-items: center; min-height: 52px; border: 0; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-size: 16px; font-weight: 600; transition: opacity 200ms ease, transform 180ms cubic-bezier(.34, 1.56, .64, 1), background-color 200ms ease; }
/* Неактивная — серой плашкой, а не полупрозрачной синей: так видно, что
   её пока нельзя нажать, и ничего не меняется под курсором. */
.auth-submit:disabled { opacity: 1; background: color-mix(in srgb, var(--text) 9%, var(--card)); color: var(--muted); cursor: not-allowed; }
.auth-submit:hover { text-decoration: none; }
.auth-submit.is-busy:disabled { background: var(--accent); color: var(--on-accent); cursor: progress; }
.auth-submit:not(:disabled):active { transform: scale(.98); }
@media (hover: hover) { .auth-submit:not(:disabled):hover { background: var(--accent-hover); text-decoration: none; } }
.auth-submit-label, .auth-spinner { grid-area: 1 / 1; transition: opacity 200ms ease, transform 200ms ease; }
.auth-spinner { width: 20px; height: 20px; border: 2.4px solid currentColor; border-right-color: transparent; border-radius: 50%; opacity: 0; transform: scale(.6); }
.auth-submit.is-busy { opacity: 1; }
.auth-submit.is-busy .auth-submit-label { opacity: 0; transform: scale(.9); }
.auth-submit.is-busy .auth-spinner { opacity: 1; transform: none; animation: authSpin 700ms linear infinite; }
@keyframes authSpin { to { transform: rotate(360deg); } }
.auth-cancel, .auth-link { justify-self: center; min-height: 40px; padding: 0 6px; border: 0; background: transparent; color: var(--accent); font-size: 14px; font-weight: 500; }
.auth-link:disabled { color: var(--muted); cursor: default; }
@media (hover: hover) { .auth-cancel:hover, .auth-link:not(:disabled):hover { text-decoration: none; opacity: .75; } }
.auth-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 18px; }

.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; max-width: 360px; }
.work-section input.otp-cell { width: 100%; min-width: 0; height: 58px; min-height: 58px !important; padding: 0 !important; border: 0 !important; border-radius: 14px; background: var(--surface) !important; box-shadow: inset 0 0 0 1px var(--line) !important; color: var(--text); font-size: 26px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; caret-color: var(--accent); transition: box-shadow 180ms ease, background-color 180ms ease; outline: none; }
.work-section input.otp-cell:focus { background: var(--card) !important; box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px var(--accent-tint) !important; }
.work-section input.otp-cell.is-filled { background: var(--card) !important; box-shadow: inset 0 0 0 1px var(--line) !important; }
.otp.is-error input.otp-cell { box-shadow: inset 0 0 0 1.5px var(--danger) !important; }
.otp.is-success input.otp-cell { box-shadow: inset 0 0 0 1.5px var(--up) !important; color: var(--up); animation: otpOk 420ms cubic-bezier(.34, 1.56, .64, 1) both; }
.otp.is-success input.otp-cell:nth-child(2) { animation-delay: 40ms; } .otp.is-success input.otp-cell:nth-child(3) { animation-delay: 80ms; }
.otp.is-success input.otp-cell:nth-child(4) { animation-delay: 120ms; } .otp.is-success input.otp-cell:nth-child(5) { animation-delay: 160ms; }
.otp.is-success input.otp-cell:nth-child(6) { animation-delay: 200ms; }
@keyframes otpOk { 0% { transform: scale(1); } 45% { transform: scale(1.1); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .auth-flow > *, .auth-hint.is-error, .otp.is-success input.otp-cell, .auth-steps .auth-step-line::after { animation: none; }
  .auth-mark, .auth-step-dot, .auth-submit, .auth-control { transition: none; }
}

.work-section .auth-flow svg { margin: 0; }

/* Кнопка появляется только сдвигом, без прозрачности: иначе после конца
   анимации она резко меняла яркость — выглядело как реакция на наведение. */
.auth-flow > .auth-submit { animation-name: authRise; }
@keyframes authRise { from { transform: translateY(8px); } to { transform: none; } }

/* ---------- Темы новостей: плитки по группам ---------- */
.topics-summary { display: grid; gap: 12px; padding: 16px; border-radius: 16px; background: var(--surface); }
.topics-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topics-summary-copy { display: grid; gap: 3px; min-width: 0; }
.topics-count { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.topics-caption { font-size: 13px; line-height: 1.4; color: var(--text-dim); }
.topics-reset { flex: 0 0 auto; min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--card); color: var(--text); font-size: 13px; font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
@media (hover: hover) { .topics-reset:hover { text-decoration: none; color: var(--danger); } }
.topics-meter { position: relative; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.topics-meter-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 420ms cubic-bezier(.32, .72, 0, 1), background-color 300ms ease; }
.topics-summary.is-full .topics-meter-fill { background: #e0a100; }
.work-section .topics-message { margin: 10px 2px 0; font-size: 13px; color: var(--text-dim); min-height: 0; }
.topics-message:empty { display: none; }
.topics-message.is-shown { animation: authIn 260ms ease backwards; }
.topics-message-link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; }

.topic-group { margin-top: 22px; }
.work-section .topic-group-title { margin: 0 0 10px 2px; font-size: 13px; font-weight: 600; color: var(--text-dim); }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.topic-tile {
  position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px;
  min-height: 60px; padding: 10px 12px; border: 0; border-radius: 16px; background: var(--surface); color: var(--text);
  text-align: left; box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 220ms ease, box-shadow 220ms ease, opacity 220ms ease, transform 180ms cubic-bezier(.34, 1.56, .64, 1);
  animation: topicIn 360ms cubic-bezier(.32, .72, 0, 1) backwards; animation-delay: calc(var(--i, 0) * 18ms);
}
@keyframes topicIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.topic-tile:active { transform: scale(.97); }
@media (hover: hover) { .topic-tile:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); } }
.topic-tile[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.topic-tile.is-locked { opacity: .45; }
.topic-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--card); color: var(--accent); transition: background-color 220ms ease, color 220ms ease; }
.topic-tile[aria-pressed="true"] .topic-icon { background: var(--accent); color: var(--on-accent); }
.work-section .topic-icon svg { width: 19px; height: 19px; margin: 0; }
.topic-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; overflow-wrap: anywhere; hyphens: auto; font-size: 14px; font-weight: 500; line-height: 1.25; letter-spacing: -.01em; }
.topic-badge { padding: 1px 6px; border-radius: 6px; background: var(--card); color: var(--text-dim); font-size: 10.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.topic-tile[aria-pressed="true"] .topic-badge { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.topic-check { position: absolute; top: -6px; right: -4px; box-shadow: 0 0 0 2px var(--card); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--on-accent); opacity: 0; transform: scale(.3); transition: opacity 200ms ease, transform 320ms cubic-bezier(.34, 1.56, .64, 1); }
.work-section .topic-check svg { width: 12px; height: 12px; margin: 0; }
.topic-tile[aria-pressed="true"] .topic-check { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .topic-tile, .topic-check, .topics-meter-fill, .topic-icon { transition: none; animation: none; } }

/* Пока не пришёл тариф — заглушка вместо списка настроек. */
#settings-body.is-waiting > .settings-home, #settings-body.is-waiting > .settings-featured { display: none; }
.settings-skeleton { display: grid; gap: 14px; margin-top: 8px; }
.settings-skeleton-block { display: block; height: 120px; border-radius: 18px; background: linear-gradient(100deg, var(--surface) 30%, color-mix(in srgb, var(--text) 6%, var(--surface)) 50%, var(--surface) 70%); background-size: 220% 100%; animation: settingsShimmer 1.3s ease-in-out infinite; }
.settings-skeleton-block:first-child { height: 220px; }
@keyframes settingsShimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) { .settings-skeleton-block { animation: none; } }
.topics-count { display: inline-flex; align-items: baseline; white-space: pre; }
.topics-count-number { margin-left: .28em; }

/* ---------- Оформление: выбор темы миниатюрами ---------- */
.theme-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.theme-option { display: grid; justify-items: center; gap: 10px; padding: 0; border: 0; background: transparent; color: var(--text); }
@media (hover: hover) { .theme-option:hover { text-decoration: none; } .theme-option:hover .theme-preview { transform: translateY(-2px); } }
.theme-preview { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; max-width: 132px; border-radius: 16px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 6px 18px var(--shadow); transition: box-shadow 260ms ease, transform 260ms cubic-bezier(.34, 1.56, .64, 1); }
.theme-option[aria-checked="true"] .theme-preview { box-shadow: 0 0 0 2.5px var(--accent), 0 0 0 7px var(--accent-tint), 0 8px 22px var(--shadow); transform: scale(1.02); }
.theme-option:active .theme-preview { transform: scale(.97); }
.theme-mock { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6%; padding: 12% 10%; }
.theme-preview .theme-mock + .theme-mock { clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.theme-mock.is-light { --m-bg: #fafafa; --m-card: #ffffff; --m-line: #d9d9de; --m-text: #1d1d1f; --m-nav: #ffffff; }
.theme-mock.is-dark { --m-bg: #121214; --m-card: #1d1d21; --m-line: #3a3a40; --m-text: #f2f2f4; --m-nav: #232328; }
.theme-mock { background: var(--m-bg); }
.theme-mock-bar { display: flex; align-items: center; gap: 8%; }
.theme-mock-logo { width: 18%; aspect-ratio: 1; border-radius: 30%; background: #0a66ff; }
.theme-mock-title { display: block; width: 70%; height: 7%; border-radius: 3px; background: var(--m-text); opacity: .9; }
.theme-mock-card { display: flex; flex-direction: column; gap: 9%; padding: 10%; border-radius: 10px; background: var(--m-card); box-shadow: 0 0 0 1px color-mix(in srgb, var(--m-line) 60%, transparent); }
.theme-mock-line { display: block; height: 5px; border-radius: 3px; background: var(--m-line); }
.theme-mock-line.is-mid { width: 75%; } .theme-mock-line.is-short { width: 45%; }
.theme-mock-nav { display: flex; justify-content: space-around; margin-top: auto; padding: 7% 6%; border-radius: 9px; background: var(--m-nav); box-shadow: 0 0 0 1px color-mix(in srgb, var(--m-line) 50%, transparent); }
.theme-mock-nav span { width: 11%; aspect-ratio: 1; border-radius: 50%; background: var(--m-line); }
.theme-mock-nav span.is-on { background: #0a66ff; }
.theme-caption { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.theme-radio, .reveal-radio { position: relative; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--field-border); transition: box-shadow 220ms ease; }
.theme-radio::after, .reveal-radio::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--on-accent); transform: scale(0); transition: transform 280ms cubic-bezier(.34, 1.56, .64, 1); }
.theme-option[aria-checked="true"] .theme-radio, .reveal-option[aria-checked="true"] .reveal-radio { box-shadow: inset 0 0 0 10px var(--accent); }
.theme-option[aria-checked="true"] .theme-radio::after, .reveal-option[aria-checked="true"] .reveal-radio::after { transform: scale(1); }
.work-section .theme-hint { margin: 16px 0 0; text-align: center; }
/* Смена темы: цвета перетекают за 0,4 с, а не перещёлкиваются. */
html.theme-switching, html.theme-switching * { transition: background-color 400ms ease, color 400ms ease, border-color 400ms ease, box-shadow 400ms ease, fill 400ms ease, stroke 400ms ease !important; }

/* ---------- Оформление: живое превью раскрытия новости ---------- */
.reveal-stage { display: grid; gap: 8px; min-height: 176px; padding: 16px; border-radius: 16px; background: var(--surface); }
.reveal-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reveal-stage-source { font-size: 12px; font-weight: 600; color: var(--accent); }
.reveal-replay { min-height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--card); color: var(--text); font-size: 12.5px; font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
@media (hover: hover) { .reveal-replay:hover { text-decoration: none; color: var(--accent); } }
.work-section .reveal-stage-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; }
.reveal-stage-text { display: grid; gap: 6px; }
.work-section .reveal-stage-text p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-dim); }
.reveal-options { margin-top: 10px; }
.reveal-option { width: 100%; grid-template-columns: 20px minmax(0, 1fr); }
@media (hover: hover) { .reveal-option:hover { text-decoration: none; background: var(--surface); } }
@media (max-width: 360px) { .theme-picker { gap: 8px; } .theme-caption { font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { .theme-preview, .theme-radio, .theme-radio::after, .reveal-radio::after { transition: none; } }

/* ---------- Голос ответов ---------- */
.voice-option { cursor: pointer; grid-template-columns: 20px minmax(0, 1fr) auto; }
.voice-option[aria-checked="true"] .reveal-radio { box-shadow: inset 0 0 0 10px var(--accent); }
.voice-option[aria-checked="true"] .reveal-radio::after { transform: scale(1); }
@media (hover: hover) { .voice-option:hover { background: var(--surface); } }
.voice-option:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.voice-listen { position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent); transition: transform 180ms cubic-bezier(.34, 1.56, .64, 1), background-color 200ms ease; }
.voice-listen:active { transform: scale(.92); }
@media (hover: hover) { .voice-listen:hover { text-decoration: none; background: var(--accent-soft-hover); } }
.work-section .voice-listen svg { width: 16px; height: 16px; margin: 0 0 0 2px; fill: currentColor; }
.voice-listen > * { grid-area: 1 / 1; transition: opacity 180ms ease, transform 180ms ease; }
.voice-bars, .voice-spinner { opacity: 0; transform: scale(.6); }
.voice-bars { display: flex; align-items: center; gap: 2px; height: 14px; }
.voice-bars i { display: block; width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform-origin: center; animation: voiceBar 900ms ease-in-out infinite; animation-play-state: paused; }
.voice-bars i:nth-child(2) { animation-delay: -150ms; } .voice-bars i:nth-child(3) { animation-delay: -300ms; } .voice-bars i:nth-child(4) { animation-delay: -450ms; }
@keyframes voiceBar { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.voice-spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
.voice-listen.is-playing { background: var(--accent); color: var(--on-accent); }
.voice-listen.is-playing .voice-play, .voice-listen.is-loading .voice-play { opacity: 0; transform: scale(.6); }
.voice-listen.is-playing .voice-bars { opacity: 1; transform: none; }
.voice-listen.is-playing .voice-bars i { animation-play-state: running; }
.voice-listen.is-loading .voice-spinner { opacity: 1; transform: none; animation: authSpin 700ms linear infinite; }
.work-section .voice-message { margin: 10px 0 0; }
.volume-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 24px; align-items: end; gap: 12px; }
.volume-icon { display: grid; place-items: center; height: 28px; color: var(--muted); }
.work-section .volume-icon svg { width: 20px; height: 20px; margin: 0; }
.volume-slider .range-field { margin: 0; }
.volume-slider .range-head { justify-content: center; }
.volume-slider .range-value { font-size: 15px; }

/* ---------- Telegram ---------- */
.tg-hero { display: grid; justify-items: center; gap: 6px; padding: 8px 0 18px; text-align: center; }
.tg-hero-icon { position: relative; display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 8px; border-radius: 50%; background: linear-gradient(160deg, #37aee2, #1e96c8); color: #fff; box-shadow: 0 10px 28px rgba(34, 158, 217, .35); animation: tgPop 520ms cubic-bezier(.34, 1.56, .64, 1) backwards; }
.work-section .tg-hero-icon svg { width: 34px; height: 34px; margin: 0 3px 0 0; }
@keyframes tgPop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.tg-hero.is-waiting .tg-hero-icon::before { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(34, 158, 217, .5); animation: tgPulse 1.6s ease-out infinite; }
@keyframes tgPulse { from { box-shadow: 0 0 0 0 rgba(34, 158, 217, .5); } to { box-shadow: 0 0 0 22px rgba(34, 158, 217, 0); } }
.tg-hero-check { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px var(--card); animation: tgPop 420ms 240ms cubic-bezier(.34, 1.56, .64, 1) backwards; }
.tg-hero-check::after { content: ""; position: absolute; left: 8px; top: 7px; width: 9px; height: 5px; border-left: 2.4px solid #fff; border-bottom: 2.4px solid #fff; transform: rotate(-45deg); }
.work-section .tg-hero-title { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.03em; }
.work-section .tg-hero-text { max-width: 36ch; margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-dim); }
.tg-benefits { margin-bottom: 14px; }
.tg-benefit-mark { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); color: var(--muted); }
.tg-benefit-mark.is-on { background: color-mix(in srgb, var(--up) 16%, transparent); color: var(--up); }
.work-section .tg-benefit-mark svg { width: 12px; height: 12px; margin: 0; }
.tg-open { display: grid; place-items: center; text-decoration: none; }
.tg-connect { width: 100%; background: #229ed9; }
@media (hover: hover) { .tg-connect:not(:disabled):hover { background: #1b8cc2; } }
.work-section .tg-wait { margin: 12px 0 0; text-align: center; }

/* ---------- Поддержка ---------- */
.support-intro { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.support-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 15px; background: var(--accent-soft); color: var(--accent); }
.work-section .support-avatar svg { width: 24px; height: 24px; margin: 0; }
.support-intro-copy { display: grid; gap: 2px; }
.support-intro-copy strong { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.support-intro-copy span { font-size: 13px; color: var(--text-dim); }
.support-form { display: grid; gap: 14px; }
.support-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.support-topic { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--line); transition: background-color 200ms ease, color 200ms ease, box-shadow 200ms ease, transform 180ms cubic-bezier(.34, 1.56, .64, 1); }
.support-topic:active { transform: scale(.95); }
@media (hover: hover) { .support-topic:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--accent); } }
.support-topic[aria-checked="true"] { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.support-box { position: relative; display: block; border-radius: 16px; background: var(--surface); transition: box-shadow 200ms ease, background-color 200ms ease; }
.support-box:focus-within { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px var(--accent-tint); }
.work-section textarea.support-text { display: block; width: 100%; min-height: 128px; max-height: 320px; padding: 14px 16px 30px !important; border: 0 !important; background: transparent !important; box-shadow: none !important; color: var(--text); font-size: 15px; line-height: 1.5; resize: none; outline: none; }
.support-text::placeholder { color: var(--muted); }
.support-counter { position: absolute; right: 14px; bottom: 10px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; transition: color 200ms ease; }
.support-counter.is-near { color: #e0a100; }
.support-done { display: grid; justify-items: center; gap: 8px; padding: 20px 0 6px; text-align: center; }
.support-done-mark svg { width: 64px; height: 64px; fill: none; stroke: var(--up); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.work-section .support-done-mark svg { margin: 0 0 6px; }
.support-done-mark circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: doneDraw 600ms cubic-bezier(.65, 0, .35, 1) forwards; }
.support-done-mark path { stroke-dasharray: 36; stroke-dashoffset: 36; animation: doneDraw 360ms 420ms cubic-bezier(.65, 0, .35, 1) forwards; }
@keyframes doneDraw { to { stroke-dashoffset: 0; } }
.support-done-title { font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.support-done-text { max-width: 34ch; font-size: 14px; line-height: 1.5; color: var(--text-dim); }
@media (prefers-reduced-motion: reduce) {
  .tg-hero-icon, .tg-hero-check, .tg-hero.is-waiting .tg-hero-icon::before, .voice-bars i { animation: none; }
  .support-done-mark circle, .support-done-mark path { animation: none; stroke-dashoffset: 0; }
}

/* ---------- Память, документы, обучение, удаление ---------- */
.work-section .info-lead { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--text-dim); }
.info-empty { display: grid; justify-items: center; gap: 6px; padding: 18px 8px 8px; text-align: center; }
.info-empty strong { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.info-empty > span:last-child { max-width: 32ch; font-size: 13.5px; line-height: 1.5; color: var(--text-dim); }
.info-empty-mark, .tour-mark { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 6px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); }
.work-section .info-empty-mark svg, .work-section .tour-mark svg { width: 26px; height: 26px; margin: 0; }

.memory-list { display: grid; }
.memory-item { display: flex; align-items: flex-start; gap: 12px; overflow: hidden; padding: 12px 0; border-top: 1px solid var(--line); transition: height 300ms cubic-bezier(.32, .72, 0, 1), opacity 240ms ease, padding 300ms ease; }
.memory-item:first-child { border-top: 0; padding-top: 0; }
.memory-item.is-gone { opacity: 0; padding-block: 0; border-color: transparent; }
.work-section .memory-text { flex: 1; min-width: 0; margin: 0; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.memory-forget { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 4px; min-width: 32px; height: 32px; padding: 0 8px; border: 0; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; transition: background-color 200ms ease, color 200ms ease, transform 180ms cubic-bezier(.34, 1.56, .64, 1); }
.work-section .memory-forget svg { width: 14px; height: 14px; margin: 0; }
.memory-forget:active { transform: scale(.94); }
@media (hover: hover) { .memory-forget:hover { text-decoration: none; color: var(--danger); } }
.memory-forget.is-armed { background: var(--danger); color: #fff; padding: 0 12px; }
.memory-forget.is-armed svg { display: none; }

.doc-row { text-decoration: none; }
@media (hover: hover) { .doc-row:hover { text-decoration: none; background: var(--surface); } }
.doc-row:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.doc-out { color: var(--muted); }
.work-section .doc-out svg { width: 18px; height: 18px; margin: 0; }
.settings-page > .work-section:has(.doc-row) { padding-bottom: 6px; }

.tour-hero { display: grid; justify-items: center; gap: 6px; padding: 6px 0 16px; text-align: center; }
.tour-hero strong { font-size: 20px; font-weight: 600; letter-spacing: -.03em; }
.tour-hero > span:last-child { max-width: 36ch; font-size: 14px; line-height: 1.5; color: var(--text-dim); }
.tour-steps, .lost-list { display: grid; gap: 10px; margin: 0 0 18px; padding: 14px 16px; list-style: none; border-radius: 16px; background: var(--surface); font-size: 14px; }
.tour-steps li, .lost-list li { display: flex; align-items: center; gap: 12px; }
.tour-steps li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.lost-list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); opacity: .8; }
.work-section .tour-start { width: 100%; justify-content: center; }

.delete-begin, .delete-confirm, .delete-keep { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; border: 0; border-radius: 14px; font-size: 15px; font-weight: 600; transition: background-color 200ms ease, transform 180ms cubic-bezier(.34, 1.56, .64, 1); }
.delete-begin { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.delete-confirm { background: var(--danger); color: #fff; }
.delete-keep { margin-top: 8px; background: var(--surface); color: var(--text); }
.delete-begin:active, .delete-confirm:active, .delete-keep:active { transform: scale(.98); }
.delete-begin[hidden] { display: none; }
.delete-gate { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 320ms cubic-bezier(.32, .72, 0, 1), opacity 240ms ease; opacity: 0; }
.delete-gate.is-open { grid-template-rows: 1fr; opacity: 1; }
.delete-gate-inner { min-height: 0; overflow: hidden; }
.delete-gate:not(.is-open) .delete-gate-inner { visibility: hidden; }
.work-section .delete-gate-inner .status { margin: 8px 0 0; text-align: center; }
@media (prefers-reduced-motion: reduce) { .memory-item, .delete-gate { transition: none; } }

/* ---------- Тариф: компактные карточки ---------- */
.work-section .plan-price { margin: 4px 0 14px; font-size: 34px; }
.plan-features { margin-bottom: 0; }
.plan-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 320ms cubic-bezier(.32, .72, 0, 1); }
.plan-more.is-open { grid-template-rows: 1fr; }
.plan-more > .plan-features { min-height: 0; overflow: hidden; }
.plan-toggle { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--accent); font-size: 14px; font-weight: 550; text-align: left; }
.plan-toggle .settings-row-chevron { margin-left: 2px; border-color: var(--accent); transform: rotate(45deg) translate(-2px, -2px); transition: transform 240ms ease; }
.plan-toggle[aria-expanded="true"] .settings-row-chevron { transform: rotate(-135deg) translate(-2px, -2px); }
@media (hover: hover) { .plan-toggle:hover { text-decoration: none; opacity: .8; } }
.plan-toggle + * , .plan > .plan-toggle ~ .checkout, .plan > .plan-toggle ~ .checkout-elsewhere, .plan > .plan-toggle ~ .text-button { margin-top: 14px; }
.plan-features + .plan-note, .plan-features + .checkout, .plan-features + .checkout-elsewhere { margin-top: 14px; }
@media (prefers-reduced-motion: reduce) { .plan-more, .plan-toggle .settings-row-chevron { transition: none; } }

/* ---------- Подтверждение в два касания ---------- */
.confirm-action.is-armed .confirm-button { background: var(--danger); color: #fff; border-radius: 12px; padding: 0 16px; text-decoration: none; }
.confirm-button { transition: background-color 200ms ease, color 200ms ease; }

/* ---------- Сколько новостей: на странице настроек ---------- */
.settings-page .onb-delivery { margin-top: 0; }
.settings-page .onb-readout { padding: 0; border: 0; background: none; }
.settings-page .onb-readout .onb-readout-label { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); font-size: 13px; text-transform: none; letter-spacing: 0; }
.settings-page .onb-readout .onb-readout-count { margin-top: 14px; font-size: 34px; line-height: 1.05; letter-spacing: -.05em; }
.settings-page .onb-readout-hint { margin-top: 8px; }
.settings-page .onb-slider { margin-top: 18px; }
.settings-page .onb-tick, .settings-page .onb-tick:hover { font-size: 11px; text-decoration: none; letter-spacing: -.01em; }
.settings-page .onb-flex-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; margin-top: 10px; padding: 0 14px; border-radius: 14px; background: var(--surface); text-decoration: none; }

/* ---------- Финансы: цели, расходы, отчёты ---------- */
.goal-card { display: grid; gap: 10px; margin-bottom: 12px; padding: 16px; border-radius: 18px; background: var(--surface); }
.goal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.work-section .goal-title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.goal-percent { font-size: 22px; font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: var(--accent); }
.goal-track { display: block; height: 10px; border-radius: 5px; background: var(--track, var(--line)); overflow: hidden; }
.goal-fill { display: block; height: 100%; width: calc(var(--share, 0) * 100%); border-radius: inherit; background: var(--accent); transform-origin: left; animation: fin-bar-grow 800ms cubic-bezier(.32, .72, 0, 1) backwards; }
.goal-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.goal-meta .is-done { color: var(--up); font-weight: 600; }
.goal-date { justify-self: start; padding: 3px 10px; border-radius: 999px; background: var(--card); font-size: 12px; color: var(--text-dim); }
.fin-new-goal { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; border: 1.5px dashed var(--field-border, var(--line)); border-radius: 16px; background: none; color: var(--accent); font-size: 15px; font-weight: 550; text-decoration: none; }
@media (hover: hover) { .fin-new-goal:hover { text-decoration: none; background: var(--accent-soft); } }
.fin-split { display: flex; gap: 3px; height: 12px; margin: 4px 0 18px; }
.fin-split-part { flex: calc(var(--share, 0) * 1000) 1 0; min-width: 6px; border-radius: 6px; transform-origin: left; animation: fin-bar-grow 800ms cubic-bezier(.32, .72, 0, 1) backwards; }
.fin-bar-name { display: flex; align-items: center; gap: 8px; }
.fin-bar-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; }
.fin-bar-value small { font-size: 12px; font-weight: 500; color: var(--muted); }
.report-rows { margin: 0 -18px; }
#finance-reports .report-rows { margin: 0; gap: 8px; }
.report-row { border-radius: 16px; background: var(--surface); }
.option-rows.report-rows > .report-row + .report-row::before { display: none; }
@media (hover: hover) { .report-row:hover { text-decoration: none; background: var(--accent-soft); } }
.report-row:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.report-row:disabled { opacity: 1; }
.report-get { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--card); color: var(--accent); }
.work-section .report-get svg { width: 18px; height: 18px; margin: 0; transition: opacity 160ms ease, transform 160ms ease; }
.report-get::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; opacity: 0; }
.report-row.is-loading .report-get svg { opacity: 0; transform: scale(.6); }
.report-row.is-loading .report-get::after { opacity: 1; animation: authSpin 700ms linear infinite; }
#finance-reports .status { margin: 10px 0 0; font-size: 13px; color: var(--text-dim); }
#finance-reports .status:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .goal-fill, .fin-split-part { animation: none; } }

/* ---------- Разбор трат ---------- */
.analysis-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.work-section .analysis-mark svg { width: 22px; height: 22px; margin: 0; }
.analysis-card { display: grid; justify-items: start; gap: 8px; padding: 18px; border-radius: 18px; background: var(--surface); }
.analysis-card strong { margin-top: 4px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.analysis-card > span:not(.analysis-mark) { font-size: 14px; line-height: 1.5; color: var(--text-dim); }
.analysis-card small { font-size: 12px; color: var(--muted); }
.work-section .analysis-action { width: 100%; justify-content: center; margin-top: 6px; }
.analysis-loading { display: grid; gap: 10px; padding: 18px; border-radius: 18px; background: var(--surface); }
.analysis-loading-head { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-dim); }
.analysis-loading .analysis-mark { animation: analysisPulse 1.4s ease-in-out infinite; }
@keyframes analysisPulse { 50% { transform: scale(.9); opacity: .6; } }
.analysis-shimmer { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--line) 0%, var(--card) 50%, var(--line) 100%); background-size: 200% 100%; animation: analysisShimmer 1.3s linear infinite; }
.analysis-shimmer:nth-of-type(2) { width: 82%; } .analysis-shimmer:nth-of-type(3) { width: 64%; }
@keyframes analysisShimmer { to { background-position: -200% 0; } }
.analysis-error { display: grid; gap: 8px; font-size: 14px; color: var(--text-dim); }
.analysis-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.analysis-stat { display: grid; align-content: space-between; gap: 4px; padding: 12px; border-radius: 14px; background: var(--surface); }
.analysis-stat span { font-size: 11.5px; color: var(--text-dim); }
.analysis-stat strong { font-size: 16px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.analysis-stat.is-up strong { color: var(--up); }
.analysis-stat.is-down strong { color: var(--danger); }
.work-section .analysis-summary { margin: 16px 0 0; font-size: 15px; line-height: 1.55; }
.work-section .analysis-heading { margin: 20px 0 8px; font-size: 13px; font-weight: 600; color: var(--text-dim); }
.analysis-insights { display: grid; }
.analysis-insight { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.analysis-insight:first-child { border-top: 0; padding-top: 2px; }
.analysis-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--accent); }
.analysis-insight.is-warn .analysis-dot { background: #e0a100; }
.analysis-insight.is-good .analysis-dot { background: var(--up); }
.analysis-insight-copy { display: grid; gap: 2px; }
.analysis-insight-copy strong { font-size: 14.5px; font-weight: 600; }
.analysis-insight-copy span { font-size: 13.5px; line-height: 1.45; color: var(--text-dim); }
.analysis-tips { display: grid; gap: 8px; }
.analysis-tip { padding: 14px; border-radius: 16px; background: var(--surface); }
.analysis-tip-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; }
.analysis-tip-head strong { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.analysis-saving { padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.work-section .analysis-tip p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--text-dim); }
.analysis-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.work-section .analysis-refresh { min-height: 36px; font-size: 13px; }
@media (max-width: 360px) { .analysis-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .analysis-loading .analysis-mark, .analysis-shimmer { animation: none; } }


/* ---------- Расходы: заголовок с месяцем, пустой месяц, полгода ---------- */
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 4px; }
.work-section .section-head > h2 { margin: 0; }
.section-head .fin-month { margin: 0; }
.section-head .fin-month-label { min-width: 132px; }
.spend-total { display: grid; gap: 2px; margin: 14px 0 6px; }
.spend-caption { font-size: 13px; color: var(--text-dim); }
.spend-total .financial-total { margin: 0 !important; }
.spend-empty { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start; margin: 8px 0 4px; padding: 18px; border-radius: 18px; background: var(--surface); }
.spend-empty-copy { display: grid; gap: 4px; }
.spend-empty-copy strong { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.spend-empty-copy span { font-size: 13.5px; line-height: 1.5; color: var(--text-dim); }
.spend-empty-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.spend-empty-actions > button { flex: 1 1 auto; width: auto; min-height: 46px; justify-content: center; margin: 0; padding: 0 18px; border-radius: 14px; white-space: nowrap; }
.spend-chart { margin-top: 22px; }
.spend-chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.work-section .spend-chart-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.spend-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-dim); }
.spend-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; background: var(--accent); vertical-align: 1px; }
.spend-legend .is-income::before { background: var(--up); }
.spend-cols { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.spend-col { display: grid; justify-items: center; gap: 6px; padding: 8px 2px 6px; border-radius: 14px; }
.spend-col.is-current { background: var(--surface); }
.spend-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; height: 120px; border-bottom: 1px solid var(--line); }
.spend-bars i { display: block; width: min(14px, 30%); height: calc(var(--h, 0) * 100%); min-height: 2px; border-radius: 4px 4px 1px 1px; background: var(--accent); transform-origin: bottom; animation: spendGrow 700ms cubic-bezier(.32, .72, 0, 1) backwards; }
.spend-bars i.is-income { background: var(--up); }
.spend-bars i[style*="--h: 0;"] { opacity: .25; }
@keyframes spendGrow { from { transform: scaleY(0); } }
.spend-col-month { font-size: 12px; color: var(--text-dim); }
.spend-col.is-current .spend-col-month { color: var(--text); font-weight: 600; }
.spend-col-value { font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.analysis-card.is-quiet { justify-items: start; }
@media (prefers-reduced-motion: reduce) { .spend-bars i { animation: none; } }
#finance-analysis:focus { outline: none; }

/* ---------- Город для погоды (настройки дайджеста) ---------- */
.city-row { width: 100%; }
.city-row .settings-row-chevron { transform: rotate(45deg); transition: transform 240ms ease; }
.city-row[aria-expanded="true"] .settings-row-chevron { transform: rotate(-135deg); }
@media (hover: hover) { .city-row:hover { text-decoration: none; background: var(--surface); } }
.city-search { display: grid; gap: 8px; margin: 4px 0 14px; }
.city-search[hidden] { display: none; }
.work-section .city-search input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font-size: 16px; }
.work-section .city-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.city-results { display: grid; gap: 4px; }
.city-results:empty { display: none; }
.city-option { display: grid; gap: 2px; width: 100%; padding: 10px 14px; border: 0; border-radius: 12px; background: var(--surface); color: var(--text); text-align: left; }
.city-option strong { font-size: 15px; font-weight: 600; }
.city-option span { font-size: 12.5px; color: var(--text-dim); }
@media (hover: hover) { .city-option:hover { text-decoration: none; background: var(--accent-soft); } }
.city-search .status:empty { display: none; }
