/*
 * NotMeal — дизайн-система (тёмная тема, mobile-first PWA).
 * База: вариант B «Минимал» прототипа + glass-карточки варианта A.
 * Токены — в :root, компоненты — классами ниже. Без инлайн-стилей во вьюхах
 * (исключение: CSS custom property --pct для прогресс-баров).
 */

:root {
  --bg: #000000;
  --text: #F7F9FB;
  --dim: #BCC5D0;
  --faint: #AEB7C2;
  /* Фирменный акцент — почти-белый (1 пункт черноты, на глаз неотличим от белого). */
  --mint: #FEFEFE;
  --mint-ink: #000000;
  --coral: #FF9A8F;
  --border: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.10);
  --track: rgba(255, 255, 255, 0.12);
  /* Тинт стекла плотнее (0.7), а --faint светлее — чтобы мелкие подписи над
     фото-фоном держали контраст WCAG AA (в основном AAA). Замерено. */
  --card-bg: rgba(10, 13, 17, 0.7);
  --glass-strong: rgba(8, 11, 15, 0.74);
  --input-bg: rgba(255, 255, 255, 0.06);
  --font: "Inter", -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 22px;
  --radius-card: 20px;
  --radius-input: 14px;
}

* { box-sizing: border-box; }

/* Базовый тёмный фон держит <html> — чтобы фикс-слой фото (.liquid-bg)
   был виден за прозрачным <body>, и не было вспышки до загрузки кадра. */
/* overscroll-behavior:none глушит руббер-бэнд/оверскролл (владелец 19.07:
   «ничего не должно скролиться»). Пинч-зум убит вьюпортом, двойной-тап-зум —
   touch-action:manipulation. Скролл ленты сообщений при этом жив. */
html { -webkit-text-size-adjust: 100%; background: var(--bg); overscroll-behavior: none; }

/* Прячем ВСЕ полосы прокрутки везде — скролл жив, бегунок невидим (владелец
   24.07.2026: «я знаю что скролится и где», полосы мешают/ломали вёрстку).
   scrollbar-width:none — Firefox; -ms-overflow-style — старый Edge; ::-webkit —
   Chrome/Safari/WebView (в т.ч. TG). Ширину/высоту в 0 тоже, чтобы движки, что
   игнорят display:none у скроллбара, всё равно не занимали место под него. */
*, *::before, *::after { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none; }

body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  touch-action: manipulation;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1, h2, p { margin: 0; }

/* Цифры — моноширинным */
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── Каркас страницы ───────────────────────────────────────── */

.shell {
  max-width: 430px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 20px calc(120px + env(safe-area-inset-bottom));
}

/* Мин. ширина приложения — не сжимать в нитку уже 360px (владелец 20.07). */
body { min-width: 360px; }

/* Десктоп (≥900px): контентная колонка по центру, ~800px — не на всю ширину и не
   в нитку. Мобильную вёрстку (<900px) не трогаем. Композер и нижняя навигация
   (fixed, центрированы) расширяются заодно, чтобы совпасть с колонкой. */
@media (min-width: 900px) {
  .shell { max-width: 820px; }
  .chat-form { width: min(100% - 24px, 720px); }
}

/* Центрирование (страница входа) */
body.centered .shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 48px;
}

/* ── Flash ──────────────────────────────────────────────────── */

.flash-stack {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(390px, calc(100% - 32px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}

.flash {
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--dim);
}

.flash--alert { border-color: rgba(255, 154, 143, 0.5); color: var(--coral); }
.flash--notice { border-color: rgba(254, 254, 254, 0.5); color: var(--mint); }

/* ── Glass-карточка ─────────────────────────────────────────── */

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 12px 40px rgba(0, 0, 0, 0.45);
  padding: 18px 20px;
  margin-bottom: 16px; /* воздух между карточками (владелец 10.07) */
}

/* последняя карточка в потоке — без лишнего низа (снизу и так есть отступ shell) */
.card:last-child {
  margin-bottom: 0;
}

/* ── Заголовки секций / страниц ─────────────────────────────── */

.section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 22px 4px 10px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 6px 4px 14px;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 14px;
}

.page-head h1 { font-size: 17px; font-weight: 600; }

.back-btn {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Кнопки ─────────────────────────────────────────────────── */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease;
}

.btn:active { transform: scale(0.98); }

.btn--mint { background: var(--mint); color: var(--mint-ink); }

.btn--big { width: 100%; height: 54px; font-size: 16px; }

.btn--ghost {
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.btn-form { width: 100%; }

/* ── Переключатель биодней ──────────────────────────────────── */

/* Переключатель локали — тонкий ряд пилюль внизу экрана, по центру */
.lang-switch {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
}
.lang-switch__form { margin: 0; }
.lang-switch__pill {
  height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.08s ease;
}
.lang-switch__pill.is-active {
  background: var(--glass-strong);
  border-color: var(--border);
  color: var(--text);
}
.lang-switch__pill:active { transform: scale(0.96); }

/* ── Шапка: переход bio ↔ заметки + язык (владелец 13.07) ──────────────────────
   Низ экрана отдан таймлайну целиком, поэтому чипы языка и навбар уехали отсюда.
   Язык свёрнут в один флаг — «чтобы не мозолил глаза», разворачивается тапом. */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 0 0 4px; min-height: 30px; }
.topbar__link { font-size: 13px; font-weight: 600; letter-spacing: 0.03em; color: var(--faint);
  text-decoration: none; padding: 4px 10px; border-radius: 14px; border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04); -webkit-tap-highlight-color: transparent; }
.topbar__link:active { transform: scale(0.96); }
.topbar__link--off { border: none; background: none; }

.langpick { position: relative; margin-left: auto; }
.langpick > summary { list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 15px; font-size: 16px; line-height: 1; opacity: 0.5; filter: grayscale(0.5);
  transition: opacity 0.15s ease, filter 0.15s ease; }
.langpick > summary::-webkit-details-marker { display: none; }
.langpick[open] > summary { opacity: 1; filter: none; }
.langpick__menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  display: flex; gap: 6px; padding: 6px; border-radius: 18px; border: 1px solid var(--border);
  background: var(--glass-strong); backdrop-filter: blur(24px) saturate(1.7);
  -webkit-backdrop-filter: blur(24px) saturate(1.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 32px rgba(0, 0, 0, 0.5); }
.langpick__pill { display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 17px; font-size: 18px; line-height: 1;
  text-decoration: none; opacity: 0.55; filter: grayscale(0.4);
  transition: transform 0.08s ease, opacity 0.15s ease, filter 0.15s ease; }
.langpick__pill.is-active { opacity: 1; filter: none; background: rgba(255, 255, 255, 0.09); }
.langpick__pill:active { transform: scale(0.92); }

.day-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0 16px;
}

.day-nav__arrow {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
}

.day-nav__arrow--off { opacity: 0.25; pointer-events: none; }

/* Вход в чат с биологом с главного экрана (владелец 19.07). Заметная, но в
   минимализме «СЕГОДНЯ»: стеклянная плашка с мятным акцентом слева. */
.today-chat {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 13px 16px;
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  background: rgba(139, 234, 194, 0.07);
  color: var(--text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.today-chat:active { transform: scale(0.99); }
.today-chat__icon { color: var(--mint); flex-shrink: 0; }
.today-chat__label { flex: 1; font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
.today-chat__go { color: var(--dim); flex-shrink: 0; }

.day-nav__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.day-nav__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.day-nav__date { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }

/* ── Блок сна ───────────────────────────────────────────────── */

.sleep {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.sleep__meta {
  font-size: 13px;
  color: var(--dim);
  text-align: center;
}

/* Стата дня ОДНОЙ строкой (владелец 16.07.2026): «02:40 - 10:41 :: 8/5/4 :: 16:50» =
   отбой-подъём :: сон/работа/жизнь :: длительность биодня. Плотный моно-текст, всегда
   в одну строку (при нехватке места ужимается прокруткой, не переносится). */
.sleep__chrono {
  margin: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Блок сна (инфо + Отбой/Встал) — внизу экрана, не на первом месте.
   Плавно «всплывает» снизу при загрузке дня. */
.sleep-action {
  margin-top: 28px;
  animation: sleep-rise 460ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes sleep-rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .sleep-action { animation: none; }
}

/* Правка границ дня задним числом (#53) — свёрнута, чтобы не спорить с кнопкой «Отбой». */
.sleep-edit { text-align: center; }
.sleep-edit__toggle {
  font-size: 12px;
  color: var(--dim);
  cursor: pointer;
  list-style: none;
}
.sleep-edit__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.sleep-edit__field {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--dim);
}
.sleep-edit__input {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(254, 254, 254, 0.2);
  border-radius: 8px;
  color: inherit;
  padding: 6px 8px;
  font: inherit;
}

.badge-est {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--coral);
  cursor: help;
}

/* ── Калории крупно ─────────────────────────────────────────── */

.kcal-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
  margin-bottom: 12px;
}

.kcal-hero__top {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.kcal-hero__value {
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.kcal-hero__side {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.kcal-hero__goal { font-size: 13px; color: var(--dim); }
.kcal-hero__activity { font-size: 11px; color: var(--mint); opacity: 0.85; }

.kcal-hero__rest { font-size: 13px; font-weight: 500; }
.kcal-hero__rest--ok { color: var(--mint); }
.kcal-hero__rest--over { color: var(--coral); }

/* ── Прогресс-бар (тонкий) ──────────────────────────────────── */

.bar {
  height: 4px;
  border-radius: 2px;
  background: var(--track);
  overflow: hidden;
}

.bar__fill {
  height: 100%;
  border-radius: 2px;
  width: var(--pct, 0%);
  background: var(--text);
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

.bar__fill--ok { background: var(--mint); }
.bar__fill--over { background: var(--coral); }

/* ── Грид Б/Ж/У ─────────────────────────────────────────────── */

.macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.macro {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.macro__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.macro__value { font-size: 18px; font-weight: 600; }

.macro__goal { font-size: 12px; font-weight: 400; color: var(--faint); }

/* ── Hairline-строки ────────────────────────────────────────── */

.rows { border-bottom: 1px solid var(--line); }

.row {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.row__label { font-size: 13px; font-weight: 500; color: var(--dim); }

.row__value { font-size: 13px; }
.row__value--over { color: var(--coral); }

.row__suffix { color: var(--faint); }

/* Траты: раскрывающийся список */
.spend summary { cursor: pointer; list-style: none; }
.spend summary::-webkit-details-marker { display: none; }
.spend[open] summary .row__label::after { content: " ▴"; color: var(--faint); }
.spend summary .row__label::after { content: " ▾"; color: var(--faint); }

.tx-list {
  list-style: none;
  margin: 0;
  padding: 0 0 14px;
}

.tx {
  display: flex;
  flex-wrap: wrap; /* вторая строка — балансы «до → после» (P-4) */
  align-items: baseline;
  gap: 4px 10px;
  padding: 7px 0;
  font-size: 13px;
}

/* P-4 «ход виден СРАЗУ»: под каждым ходом — эффект на баланс затронутых счетов. */
.tx__balances {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  font-size: 11px;
  color: var(--faint);
}
.tx__leg { white-space: nowrap; }

.tx__time { font-size: 12px; color: var(--faint); flex-shrink: 0; }

.tx__label {
  flex: 1;
  min-width: 0;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx__amount { flex-shrink: 0; }
.tx--income .tx__amount { color: var(--mint); }
/* Переводы между счетами (владелец 11.07): движения нала вне ленты трат, но видимые.
   С 16.07.2026 — группа .money-card__group внутри дропдауна «Деньги», не своя карточка. */
.tx--transfer .tx__amount { color: var(--faint); }
.tx--transfer__route { color: var(--dim); }

/* Строка остатка по счетам — под списком трат */
.balance-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 4px 0 14px;
  font-size: 12px;
  color: var(--faint);
}
.balance-row__item { display: inline-flex; align-items: baseline; gap: 5px; }
.balance-row__label { color: var(--faint); }
.balance-row__val { color: var(--dim); }
.balance-row__item--total .balance-row__label,
.balance-row__item--total .balance-row__val { color: var(--text); font-weight: 600; }

/* Долги — одна строка в карточке счетов (владелец 16.07.2026): виджет долгов свёрнут,
   тут только общий остаток к возврату. */
.balance-debt { display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; }
.balance-debt__label { color: var(--faint); }
.balance-debt__val { color: #E0A0A0; }

/* Криптохолд — тонкая строка-тикер под остатком, вне свободных */
.hold-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: -6px;
  padding-bottom: 12px;
  font-size: 11px;
  letter-spacing: 0.02em;
}
.hold-row__item { display: inline-flex; align-items: baseline; gap: 5px; }
.hold-row__asset {
  color: var(--faint);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.06em;
}
.hold-row__val { color: var(--dim); }
.hold-row__cost { color: var(--faint); font-size: 10px; }
.hold-row__delta { font-size: 10px; }
.hold-row__delta--up { color: var(--mint); }
.hold-row__delta--down { color: var(--coral); }

/* Дневной бюджет-ориентир — тонкий бар + подпись под блоком трат */
.budget { display: flex; flex-direction: column; gap: 5px; padding: 2px 0 14px; }
.budget__cap { font-size: 11px; color: var(--faint); letter-spacing: 0.02em; }

/* ── Траты — отдельная стеклянная карточка (читаемая, под целями) ── */
.spend-card { margin-bottom: 12px; }
.spend-card > summary, .progress-card > summary { list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.spend-card > summary::-webkit-details-marker, .progress-card > summary::-webkit-details-marker { display: none; }
.spend-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.spend-card__label { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
/* Дни до зарплаты — одной цифрой, аккуратный пилюль-бейдж рядом с ярлыком. */
.spend-card__days { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; margin-left: 7px; padding: 0 5px; border-radius: 9px; background: var(--border); color: var(--dim); font-size: 10px; font-weight: 700; letter-spacing: 0; vertical-align: middle; }
.spend-card__total { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; display: inline-flex; align-items: baseline; gap: 7px; }
.spend-card__caret, .progress-card__caret { font-size: 11px; color: var(--faint); transition: transform 0.2s ease; }
.spend-card[open] .spend-card__caret, .progress-card[open] .progress-card__caret { transform: rotate(180deg); }
.spend-card .budget { padding: 12px 0 0; }
.spend-card__body { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.spend-card__body .tx-list { padding: 0 0 8px; }
/* Деньги — один виджет (16.07.2026): группы дропдауна (переводы, счета) отделены линией;
   первая группа без верхней линии, чтобы не двоить с бордюром тела. */
.money-card__group { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.money-card__grouplabel { display: block; margin-bottom: 8px; }
.spend-card__body > .money-card__group:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* ── Общий прогресс — стеклянная карточка-дропдаун ── */
.progress-card { margin-bottom: 14px; }
.progress-card__summary { display: flex; align-items: center; justify-content: space-between; }
.progress-card__summary > span:first-child { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.progress-card__rows { margin-top: 4px; border-bottom: none; }
.progress-card__rows .row:first-child { border-top: none; }

/* ── Карточки приёмов пищи ──────────────────────────────────── */

.meals {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meal-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--card-bg);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.meal-card--draft {
  border-color: rgba(255, 154, 143, 0.55);
  background: rgba(255, 123, 110, 0.08);
}

.meal-card--cancelled { opacity: 0.55; }
.meal-card--cancelled .meal-card__title { text-decoration: line-through; }

.meal-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meal-card__time { font-size: 12px; color: var(--faint); }

.meal-card__price { margin-left: auto; font-size: 12px; color: var(--faint); text-align: right; }
.meal-card__price--free { color: var(--mint); }

/* Неполная сумма (#66): часть транзакций без курса — спокойное «≈», не варнинг */
.money-approx { color: var(--dim); margin-right: 2px; cursor: help; }

/* Неучтённые деньги (#71): подтверждённые «дыры» — отдельная секция, не траты */
.gap-card { margin-bottom: 12px; border-color: rgba(255, 154, 143, 0.35); }
.gap-card__head { display: flex; align-items: center; margin-bottom: 6px; }
.gap-card__label { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--coral); }
.gap-card__note { color: var(--faint); }
.gap-card__amount { color: var(--coral); }
.gap-card__hint { margin-top: 6px; font-size: 11px; color: var(--faint); }

/* Долги (payable): кому/сколько осталось + прогресс гашения */
.debt-card { margin-bottom: 12px; }
.debt-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.debt-card__label { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.debt-card__total { font-size: 15px; font-weight: 600; color: var(--dim); }
.debt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.debt__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.debt__creditor { font-size: 14px; }
.debt__amount { font-size: 14px; font-weight: 500; text-align: right; }
.debt__usd { font-size: 12px; color: var(--faint); font-weight: 400; }
.debt__bar { margin-top: 6px; }
.debt__paid { display: block; margin-top: 4px; font-size: 11px; color: var(--faint); }

/* «Восьмёрки» 8/8/8 (#56): три дила Сон/Работа/Жизнь vs 8ч */
.loops-card { margin-bottom: 14px; padding: 16px 18px; --loop-sleep: #A9B4F0; --loop-work: var(--mint); --loop-life: #F2C98A; }
.loops-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.loops-card__label { font-size: 10px; font-weight: 600; letter-spacing: 0.18em; color: var(--faint); }
.loops-card__state { font-size: 11px; color: var(--faint); }
.loops-card__state--ok { color: var(--mint); font-weight: 600; }
.loops { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.loop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.loop__ring { width: 64px; height: 64px; }
.loop__track { stroke: var(--track); }
.loop__fill { stroke: var(--loop-color, var(--mint)); opacity: 0.85; transition: stroke-dasharray 0.6s ease; }
.loop--sleep { --loop-color: var(--loop-sleep); }
.loop--work { --loop-color: var(--loop-work); }
.loop--life { --loop-color: var(--loop-life); }
.loop--done .loop__fill { opacity: 1; }
.loop--done .loop__value { color: var(--loop-color); }
.loop__value { position: absolute; top: 32px; transform: translateY(-50%); font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.loop__label { font-size: 9px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }

.meal-card__title { font-size: 14px; font-weight: 500; line-height: 1.3; }

.meal-card__nutr { font-size: 12px; color: var(--dim); }
.meal-card__nutrients { margin-top: 8px; }
.meal-card__nutrients-sum { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.meal-card__nutrients-sum::-webkit-details-marker { display: none; }
.meal-card__nutrients-caret { font-size: 10px; color: var(--faint); transition: transform 0.2s ease; }
.meal-card__nutrients[open] .meal-card__nutrients-caret { transform: rotate(180deg); }
.meal-card__nutrients-rows { margin-top: 8px; }

/* Футер био-экрана (владелец 16.07.2026): info-ссылка + правка границ дня, «в самый
   футер». Тихий, по центру, над таймлайн-линией. */
.bio-footer { display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin: 20px auto 4px; }
.bio-footer__link { font-size: 10px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint); text-decoration: none;
  -webkit-tap-highlight-color: transparent; }
.bio-footer__link:active { transform: scale(0.96); }

/* Фон дня (owner-контрол) */
.day-bg { margin: 0 4px 14px; }
.day-bg--bottom { margin: 8px auto 18px; text-align: center; }
.day-bg--bottom .day-bg__summary { text-align: center; }
.day-bg--bottom .day-bg__form { justify-content: center; }
.day-bg__summary { cursor: pointer; list-style: none; font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.day-bg__summary::-webkit-details-marker { display: none; }
.day-bg__form { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.day-bg__file { font-size: 12px; color: var(--dim); max-width: 100%; }
.day-bg__submit { height: 36px; padding: 0 14px; font-size: 13px; }
.day-bg__reset { margin-top: 8px; background: none; border: none; color: var(--faint);
  font-size: 12px; text-decoration: underline; cursor: pointer; padding: 0; }

.meal-card__place {
  font-size: 12px;
  color: var(--faint);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
}
.meal-card__place:active { color: var(--dim); }
.meal-card__pin { font-size: 11px; opacity: 0.85; }

/* Бейджи */
.tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px 7px;
  color: var(--dim);
  white-space: nowrap;
}

.tag--mint { color: var(--mint); border-color: rgba(254, 254, 254, 0.5); }
.tag--coral { color: var(--coral); border-color: rgba(255, 154, 143, 0.5); }
.tag--hidden { color: var(--faint); border-color: var(--line); opacity: 0.85; }

/* ── Intakes-лента ──────────────────────────────────────────── */

.intakes { margin-top: 4px; }

/* Harm-time (#40): «≈ −2ч 45м жизни» над лентой веществ. */
.intakes__life {
  font-size: 12px;
  color: var(--coral);
  opacity: 0.85;
  margin: 2px 0 4px;
}

.intake {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: var(--dim);
}

.intake:first-child { border-top: none; }

.intake__qty { color: var(--faint); }

.intake__time { font-size: 12px; color: var(--faint); }

/* ── Пустые состояния ───────────────────────────────────────── */

.empty {
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 18px;
  padding: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--faint);
}

/* ── Нижняя навигация ───────────────────────────────────────── */

.nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: min(406px, calc(100% - 24px));
  height: 66px;
  border-radius: 33px;
  border: 1px solid var(--border);
  background: var(--glass-strong);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: stretch;
  padding: 0 10px;
  z-index: 31;
}

.nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.nav__item--active { color: var(--text); }

/* .nav__plus (кнопка «Новый приём») выпилена 23.07.2026 — навбар только bio/chat/info. */

/* ── Формы ──────────────────────────────────────────────────── */

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label { font-size: 12px; font-weight: 500; color: var(--dim); }

.input {
  width: 100%;
  height: 50px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  padding: 0 14px;
}

.input::placeholder { color: #7C8794; }

.input:focus {
  outline: none;
  border-color: rgba(254, 254, 254, 0.5);
}

.input--num {
  font-family: var(--mono);
  font-weight: 600;
}

textarea.input {
  height: auto;
  padding: 12px 14px;
  resize: none;
  line-height: 1.45;
}

.hint {
  font-size: 12px;
  color: var(--faint);
  line-height: 1.5;
  padding: 0 4px;
}

/* Заглушка «фото — скоро» */
.photo-stub {
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  background: rgba(10, 13, 17, 0.55);
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  opacity: 0.65;
}

.photo-stub__title { font-size: 14px; font-weight: 600; }

.photo-stub__hint { font-size: 12px; color: var(--faint); }

/* ── Цель ───────────────────────────────────────────────────── */

.goal-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.goal-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.goal-card__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.goal-card__status { font-size: 11px; font-weight: 600; color: var(--mint); }

.goal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.goal-grid__cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.goal-grid__num {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.goal-grid__cap { font-size: 11px; color: var(--faint); }

/* Список (история целей) */
.list { padding: 6px 20px; }

.list-row {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.list-row:first-child { border-top: none; }

.list-row__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.list-row__title { font-size: 13px; font-weight: 500; color: var(--dim); }

.list-row__sub { font-size: 11px; color: var(--faint); }
.list-row__sub--active { color: var(--mint); }

.list-row__value { font-size: 12px; color: var(--faint); }

.list-row--active .list-row__title { color: var(--text); }
.list-row--active .list-row__value { color: var(--dim); }

/* ── Вход ───────────────────────────────────────────────────── */

.auth {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
}

.auth__logo { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }

.auth__tagline { font-size: 14px; color: var(--dim); }

.auth__card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth__link {
  text-align: center;
  font-size: 14px;
  color: var(--dim);
  padding: 10px;
}

.auth__link:hover { color: var(--text); }

/* ── Чат биодня ─────────────────────────────────────────── */
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 162px); /* композер + навбар */ }
.msg { position: relative; max-width: 86%; border-radius: 18px; padding: 10px 14px 18px; }
/* Ч/Б, сплошные непрозрачные панели — текст читается на чёрном без стекла (владелец 19.07). */
.msg--user { align-self: flex-end; background: #2a2a2d; border: none; color: #fff; }
.msg--assistant { align-self: flex-start; background: #131315; border: 1px solid rgba(255, 255, 255, 0.09); color: #f2f4f6; }
.msg--failed { border: 1px solid rgba(255, 154, 143, 0.5); }
.msg__text { margin: 0; font-size: 15px; line-height: 1.5; }
.msg__photos { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.msg__photo { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; }
.msg__actions { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.msg__action { font-size: 12px; color: var(--dim); }
.msg__time { position: absolute; right: 12px; bottom: 4px; font-size: 9px; color: var(--faint); }
/* Панель ввода — сплошной чёрный, без стекла. Рамка чистая, при фокусе чуть ярче
   (никакой синей системной обводки — она на .chat-form__input убита outline:none). */
/* Композер = колонка строк: вложения → поле во всю ширину → строка контролов. */
.chat-form { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); /* над навбаром */ width: min(100% - 24px, 406px); display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.12); background: #0c0c0e; z-index: 25; transition: border-color 0.15s ease; }
.chat-form:focus-within { border-color: rgba(255, 255, 255, 0.28); }
/* font-size 16px ОБЯЗАТЕЛЕН: меньше — iOS Safari зумит вьюпорт при фокусе (владелец
   19.07: «увеличивается масштаб на поле ввода»). Авто-рост высоты — composer#autogrow. */
.chat-form__input { width: 100%; min-height: 40px; max-height: 132px; border: none; outline: none; background: none; color: #fff; font-size: 16px; line-height: 1.4; font-family: inherit; resize: none; padding: 6px 6px; -webkit-appearance: none; }
.chat-form__input:focus { outline: none; box-shadow: none; }

/* Строка контролов: камера · растяжка · отправить. */
.chat-form__controls { display: flex; align-items: center; gap: 8px; }
.chat-form__spacer { flex: 1; }
/* Кнопка отправки — проще и одинаково во всех браузерах (владелец 24.07: в Chrome
   input[type=submit] выглядел хуже). appearance:none снимает нативную отрисовку,
   line-height центрирует глиф без flex (input не флексится надёжно в Chrome). */
.chat-form__send { -webkit-appearance: none; appearance: none; width: 40px; height: 40px;
  border-radius: 12px; border: none; background: var(--mint); color: #06231A;
  font-size: 19px; font-weight: 700; line-height: 40px; text-align: center; padding: 0;
  cursor: pointer; flex-shrink: 0; -webkit-tap-highlight-color: transparent; }
.chat-form__send:active { opacity: 0.85; }
.chat-form__photo { width: 40px; height: 40px; border-radius: 14px; border: 1px solid var(--glass-border); color: var(--dim); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.chat-form__file { display: none; }

/* Строка вложений: горизонтальный ряд превью-чипов (~64px) с ✕-бейджем. */
.chat-form__attach { display: flex; gap: 8px; flex-wrap: wrap; padding: 2px 2px 0; }
.chat-form__attach[hidden] { display: none; }
.chat-form__chip { position: relative; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; border: 1px solid var(--glass-border); flex-shrink: 0; }
.chat-form__chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-form__chipx { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(0, 0, 0, 0.72); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* ── Поделиться днём + read-only витрина ───────────────────── */
.lang-switch a.lang-switch__pill { text-decoration: none; display: inline-flex; align-items: center; }

.share-day { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 22px; }
.share-day__btn {
  background: none; border: none; cursor: pointer;
  color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  opacity: 0.75; transition: opacity 0.12s ease;
}
.share-day__btn:hover { opacity: 1; }
.share-day__btn:disabled { opacity: 0.4; cursor: default; }
.share-day__copy {
  align-self: center; height: 38px; padding: 0 18px; border-radius: var(--radius-input);
  border: 1px solid var(--border); background: var(--glass-strong);
  color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer;
}
.share-day__copy:active { transform: scale(0.97); }
.share-day__timer { color: var(--dim); font-variant-numeric: tabular-nums; }

/* iOS-тост: fixed overlay, не влияет на layout, плавный fade+slide-up */
.share-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 1000;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  max-width: min(86vw, 320px); padding: 10px 18px; border-radius: 16px;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.share-toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.share-toast__text { color: var(--text); font-size: 13px; font-weight: 600; }
.share-toast__sub { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.share-toast__sub:empty { display: none; }

.share-banner {
  margin: 0 0 12px; padding: 7px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card-bg);
  color: var(--faint); font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-align: center;
}
.share-foot { margin-top: 14px; text-align: center; color: var(--faint); font-size: 11px; }
.day-nav--static { justify-content: center; }

.share-expired { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.share-expired__icon { font-size: 40px; opacity: 0.8; }
.share-expired__text { margin: 0; color: var(--dim); font-size: 15px; max-width: 280px; }

/* ── Шер-дропдаун со статой (owner-only) ───────────────────── */
details.share-day { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.share-day__summary {
  list-style: none; cursor: pointer; text-align: center;
  color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  padding: 4px 0; opacity: 0.8;
}
.share-day__summary::-webkit-details-marker { display: none; }
details.share-day[open] .share-day__summary { opacity: 1; color: var(--dim); }
.share-day__body { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.share-day__meta { margin: 0; text-align: center; color: var(--faint); font-size: 11px; }
.share-day__create {
  width: 100%; height: 40px; border-radius: var(--radius-input);
  border: 1px solid var(--border); background: var(--glass-strong);
  color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer;
}
.share-day__create:active { transform: scale(0.98); }
.share-day__overview { margin-top: 4px; border-top: 1px dashed var(--line); padding-top: 12px; }
.share-day__overview-title { display: block; text-align: center; color: var(--faint); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }

.stat-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 64px; padding: 8px 10px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card-bg);
}
.stat__v { color: var(--text); font-size: 16px; font-weight: 700; }
.stat__k { color: var(--faint); font-size: 10px; letter-spacing: 0.04em; }
.stat-grid--mini .stat { min-width: 52px; padding: 6px 8px; }
.stat-grid--mini .stat__v { font-size: 14px; }

/* ══════════════════════════════════════════════════════════════
   Liquid Glass — фикс-фон + boot-гейт + стекло-линза на карточках.
   Style-only слой: разметку/данные страниц не меняет.
   ══════════════════════════════════════════════════════════════ */

/* ── Фикс-фон: фото дня + скрим под читаемость, ИЛИ живой лоадер ──── */
.liquid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  /* Видим сразу: первичную загрузку кадра перекрывает boot-сплэш, поэтому
     отдельный fade фона не нужен (и не повторяется на Turbo-навигациях). */
}
/* Нет фотки дня → фоном становится сам лоадер: сердце бьётся вечно под стеклом
   (12.07.2026 — храм выпилен). Центрируем так же, как в сплэше, чтобы при
   снятии сплэша сердце не прыгнуло ни на пиксель. */
.liquid-bg--heart {
  display: flex;
  align-items: center;
  justify-content: center;
}

.liquid-bg__slide {
  position: absolute;
  inset: -6% -4%;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: translate3d(0, var(--bg-shift, 0px), 0) scale(1.12);
  filter: saturate(1.06) contrast(1.02);
  opacity: 0;
  transition: opacity 1800ms ease-in-out;
  will-change: transform, opacity;
}
.liquid-bg__slide.is-active { opacity: 1; }
.liquid-bg__scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 12%, transparent 40%, rgba(5, 7, 10, 0.5) 100%),
    linear-gradient(180deg,
      rgba(5, 7, 10, 0.62) 0%,
      rgba(5, 7, 10, 0.32) 26%,
      rgba(5, 7, 10, 0.4) 60%,
      rgba(5, 7, 10, 0.72) 100%);
}

/* ── Boot-сплэш: держит экран до готовности, гарантированно уходит ── */
.liquid-splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  /* Failsafe: если JS/декод не сняли сплэш — уберётся сам через 3.4с */
  animation: liquid-splash-failsafe 0.5s ease 3.4s forwards;
}
.liquid-splash.is-gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  animation: none;
  transition: opacity 450ms ease, visibility 0s linear 450ms;
}
@keyframes liquid-splash-failsafe { to { opacity: 0; visibility: hidden; } }

/* ── Лоадер-стек: анатомическое сердце + руна N↕M ──────────────
   Один и тот же стек живёт в сплэше и в фон-слое — стили общие, иначе при
   снятии сплэша сердце дёрнется. Биение — на JS (инлайн-rAF в лейауте). */
.nm-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
  transform: translateY(-4vh);
}
.nm-heart {
  width: 166px;
  height: auto;
  overflow: visible;                 /* дуга аорты при вздутии не обрезается */
  will-change: transform;
  transform: rotate(-9deg);          /* силуэт читается сердцем: апекс вниз */
  transform-origin: 50% 50%;
}
.nm-mark {
  width: clamp(184px, 62vw, 280px);
  height: auto;
  color: #F2F1ED;
}

/* ── Проявление контента после boot (стаггер карточек) ───────── */
/* fill-mode ОБЯЗАН быть backwards, НЕ both/forwards: forwards-фаза навсегда
   оставляет на ребёнке `translate: 0 0`, а любой translate ≠ none делает его
   containing block'ом для position:fixed потомков — fixed-панель (drawer)
   рисовалась внутри блока высотой с шапку и уезжала со скроллом (баг
   «панель в урезанном блоке», владелец 19.07 трижды). */
body.liquid-ready .shell > * {
  animation: liquid-rise 520ms cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}
body.liquid-ready .shell > *:nth-child(2) { animation-delay: 40ms; }
body.liquid-ready .shell > *:nth-child(3) { animation-delay: 80ms; }
body.liquid-ready .shell > *:nth-child(4) { animation-delay: 120ms; }
body.liquid-ready .shell > *:nth-child(5) { animation-delay: 160ms; }
body.liquid-ready .shell > *:nth-child(6) { animation-delay: 200ms; }
body.liquid-ready .shell > *:nth-child(7) { animation-delay: 240ms; }
body.liquid-ready .shell > *:nth-child(n+8) { animation-delay: 280ms; }
/* Анимируем отдельное свойство `translate`, а НЕ `transform` — чтобы не затирать
   `transform: translateX(-50%)` у фиксированных .nav/.quicklog/.chat-form.
   Где `translate` не поддержан — деградирует в чистый fade. */
@keyframes liquid-rise {
  from { opacity: 0; translate: 0 12px; }
  to { opacity: 1; translate: 0 0; }
}

/* ── Усиление стекла: реальное преломление фото + блики/глубина ─ */
.card, .meal-card { backdrop-filter: blur(22px) saturate(1.7) brightness(1.06); -webkit-backdrop-filter: blur(22px) saturate(1.7) brightness(1.06); }

/* анкер для псевдо-элементов (фиксированные .nav/.chat-form уже позиционированы) */
.card, .meal-card, .chip, .back-btn, .flash { position: relative; }

/* ::before — внутренняя глубина + верхний блик (ниже текста, читаемость) */
.card::before, .meal-card::before, .nav::before, .chip::before,
.back-btn::before, .flash::before, .chat-form::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 40%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.16),
    inset 0 -14px 26px -16px rgba(255, 184, 120, 0.16),
    inset 0 14px 26px -18px rgba(150, 190, 255, 0.16);
}

/* ::after — спекуляр-кромка с лёгкой хром.дисперсией; «течёт» от гиро/sheen */
.card::after, .meal-card::after, .nav::after, .chip::after,
.back-btn::after, .flash::after, .chat-form::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  padding: 1px;
  /* Бегущая полоса реализована СДВИГОМ background-position (а не transform),
     поэтому подсветка остаётся ВНУТРИ кромки карточки и не выезжает за грани. */
  background: linear-gradient(115deg,
    transparent 38%,
    rgba(255, 255, 255, 0.5) 47%,
    rgba(254, 254, 254, 0.18) 50%,
    rgba(255, 154, 143, 0.16) 53%,
    transparent 62%);
  background-size: 250% 100%;
  background-position: var(--sheen, 50%) center;
  background-repeat: no-repeat;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  transition: background-position 250ms ease-out;
  opacity: 0.65;
}

/* Авто-sheen (нет гиро/пермишена): блик медленно сам ходит по кромке */
.liquid-autosheen .card::after, .liquid-autosheen .meal-card::after,
.liquid-autosheen .nav::after, .liquid-autosheen .chip::after,
.liquid-autosheen .back-btn::after, .liquid-autosheen .flash::after,
.liquid-autosheen .chat-form::after {
  transition: none;
  animation: liquid-sheen 9s ease-in-out infinite;
}
@keyframes liquid-sheen {
  0% { background-position: 0% center; }
  50% { background-position: 100% center; }
  100% { background-position: 0% center; }
}

/* ── Фолбэк: webview без backdrop-filter → плотный фон, без линзы ─ */
.liquid-noblur .card, .liquid-noblur .meal-card,
.liquid-noblur .nav, .liquid-noblur .chip,
.liquid-noblur .chat-form, .liquid-noblur .flash {
  background: var(--glass-strong);
}
.liquid-noblur .liquid-bg { opacity: 0.5; }

/* ── Доступность: меньше движения ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .liquid-bg__slide { transform: scale(1.12); }
  body.liquid-ready .shell > * { animation: none; }
  .card::after, .meal-card::after, .nav::after, .chip::after,
  .back-btn::after, .flash::after, .chat-form::after { animation: none; background-position: 50% center; }
  .chrono__live { animation: none; }
}

/* ── Хронометрия (виджет: вёдра-аккордеоны + лента дня) ──────────────────
   Дизайн: design_handoff_chronometry. Тёмная обсерваторная карточка-стекло. */
.chrono { position: relative; display: flex; flex-direction: column; gap: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: radial-gradient(150% 130% at 50% -15%, rgba(26, 40, 40, 0.5) 0%, rgba(14, 18, 23, 0.82) 58%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 16px 44px rgba(0, 0, 0, 0.5);
  padding: 18px 20px; -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.chrono__head { display: flex; align-items: center; justify-content: space-between; }
.chrono__eyebrow { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); }
.chrono__dot { width: 7px; height: 7px; border-radius: 4px; background: var(--mint); box-shadow: 0 0 8px rgba(254, 254, 254, 0.7); }
.chrono__where { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.chrono__wherelabel { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #8FA0A8; }
.chrono__hours { font-size: 10px; color: #7E8A92; }
.chrono__bar { position: relative; display: flex; width: 100%; height: 15px; border-radius: 8px; overflow: hidden; background: rgba(255, 255, 255, 0.04); }
.chrono__seg { height: 100%; box-shadow: inset -0.5px 0 0 rgba(8, 11, 15, 0.5); }
.chrono__live { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--mint);
  box-shadow: 0 0 9px rgba(254, 254, 254, 0.85); animation: nm-pulse 2.4s ease-in-out infinite; }
.chrono__buckets { display: flex; flex-direction: column; }
.chrono__bucket { border-top: 1px solid var(--line); }
.chrono__bucket:first-child { border-top: none; }
.chrono__brow { display: flex; align-items: center; gap: 9px; padding: 11px 0; cursor: pointer;
  list-style: none; -webkit-tap-highlight-color: transparent; }
.chrono__brow::-webkit-details-marker { display: none; }
.chrono__brow--static { cursor: default; }
.chrono__lgdot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.chrono__bname { flex: 1; font-size: 13px; font-weight: 500; color: #E6ECEF; }
.chrono__btime { font-size: 13px; color: #9AA4B0; font-family: var(--mono); white-space: nowrap; }
.chrono__caret { color: #7E8A92; transition: transform 220ms ease; flex-shrink: 0; }
.chrono__bucket[open] > .chrono__brow .chrono__caret,
.chrono__timeline[open] > .chrono__brow .chrono__caret { transform: rotate(180deg); }
.chrono__bbody { padding: 2px 0 13px 18px; display: flex; flex-direction: column; gap: 10px; }
.chrono__subbar { display: flex; width: 100%; height: 8px; border-radius: 5px; overflow: hidden; background: rgba(255, 255, 255, 0.04); }
.chrono__subseg { height: 100%; box-shadow: inset -0.5px 0 0 rgba(8, 11, 15, 0.5); }
.chrono__subrows { display: flex; flex-direction: column; gap: 7px; }
.chrono__subrow { display: flex; align-items: center; gap: 8px; }
.chrono__subname { flex: 1; font-size: 12.5px; color: #C7CFD6; }
.chrono__subname--proj { flex: 0 0 auto; min-width: 72px; }
.chrono__subtime { font-size: 12.5px; color: #9AA4B0; font-family: var(--mono); white-space: nowrap; }
.chrono__msgcount { font-size: 12px; color: #D97757; font-family: var(--mono); white-space: nowrap; }
.chrono__locked { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #7E8A92; padding: 3px 0; }
.chrono__locked svg { flex-shrink: 0; opacity: 0.7; }
.chrono__timeline { border-top: 1px solid var(--line); }
.chrono__bname--tl { letter-spacing: 0.14em; text-transform: uppercase; font-size: 10px; font-weight: 600; color: #8FA0A8; }
.chrono__tlbar { display: flex; width: 100%; height: 11px; border-radius: 6px; overflow: hidden; background: rgba(255, 255, 255, 0.04); }
.chrono__tlbar--hero { position: relative; height: 26px; border-radius: 9px; margin-bottom: 1px; }
.chrono__note { display: block; margin-top: 8px; }
.chrono__tlseg { height: 100%; box-shadow: inset -0.5px 0 0 rgba(8, 11, 15, 0.5); }
.chrono__tlticks { display: flex; justify-content: space-between; margin-top: 6px; }
.chrono__tltick { font-size: 10px; color: #6C7682; font-family: var(--mono); }
/* ── Линия хронометрии внизу экрана (владелец 13.07: «просто линия») ──────────
   Не виджет: жирная светящаяся полоса над таб-баром. Ни цифр, ни тиков, ни подписей —
   день достаётся тапом/протяжкой (стеклянная панель ниже). */
/* Специфичность НАРОЧНО двойная (.chrono.chrono--dock): у секции три класса, и
   `.chrono__scrub { position: relative }` лежит ниже по файлу — при равном весе он
   перебивал fixed, и линия падала в поток, в самый низ страницы (владелец 13.07:
   «ты его уронил в самый низ»). Каскад пинится test/assets/chrono_dock_css_test.rb. */
.chrono.chrono--dock {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(92px + env(safe-area-inset-bottom));  /* над нижним навбаром (66px + 14px + зазор) */
  width: min(430px, 100%);
  padding: 8px 12px;
  margin: 0;
  border: none;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 26;
}
/* Жирная (48px — владелец 13.07) светящаяся полоса. Тапабельность читается из самой
   вещи: она большая, светится и медленно «дышит» — никаких подписей-указалок. */
.chrono__tlbar--dock {
  height: 48px;
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 18px rgba(255, 255, 255, 0.16),
    0 0 44px rgba(139, 234, 194, 0.18),
    0 8px 28px rgba(0, 0, 0, 0.5);
  animation: chrono-breathe 3.8s ease-in-out infinite;
}
@keyframes chrono-breathe {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 0 14px rgba(255, 255, 255, 0.12),
                         0 0 34px rgba(139, 234, 194, 0.13), 0 8px 28px rgba(0, 0, 0, 0.5); }
  50%      { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 24px rgba(255, 255, 255, 0.22),
                         0 0 56px rgba(139, 234, 194, 0.26), 0 8px 28px rgba(0, 0, 0, 0.5); }
}
@media (prefers-reduced-motion: reduce) { .chrono__tlbar--dock { animation: none; } }
/* Бампы событий поверх линии — размытые, чтобы на полосе не осталось ни одного ребра. */
.chrono--dock .chrono__tlbar--events { height: 48px; border-radius: 16px; opacity: 0.5;
  filter: blur(4px); }
/* Сводки сон/работа/жизнь НАД линией больше нет (владелец 16.07.2026): ни подписей,
   ни цветных точек — стата ушла строкой «8/4.5/4» в виджет отбоя (.sleep__chrono). */
/* Палец на линии — свечение подхватывается, дыхание замирает. */
.chrono--dock.is-scrubbing .chrono__tlbar--dock {
  animation: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 0 28px rgba(255, 255, 255, 0.28),
    0 0 64px rgba(139, 234, 194, 0.3),
    0 8px 28px rgba(0, 0, 0, 0.5);
}

/* Скраб по линии: прижал → отклик, ведёшь → панель едет за пальцем, на новом наборе
   событий — «щелчок». Без дропдаунов/кареток. */
.chrono__scrub { position: relative; padding: 5px 0 3px; touch-action: none; cursor: grab;
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
.chrono__scrub.is-scrubbing { cursor: grabbing; }
.chrono__scrubtrack { position: relative; }
.chrono__playhead { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px;
  background: #fff; border-radius: 2px; box-shadow: 0 0 10px rgba(255, 255, 255, 0.85); pointer-events: none; }
/* Оверлей событий поверх ленты: «жизнь» подсвечивается цветами событий (владелец 11.07). */
.chrono__tlbar--events { position: absolute; inset: 0 0 auto 0; height: 26px; background: transparent;
  border-radius: 9px; opacity: 0.6; mix-blend-mode: screen; pointer-events: none; }

/* ── Стеклянная панель (владелец 13.07): стекло как в iOS — искажение фона, блик
   по краю, пружина на входе. Едет за пальцем; МНОГОСТРОЧНАЯ и растёт под контент:
   никаких ellipsis/nowrap — длинный пункт стендапа виден ЦЕЛИКОМ. ── */
.chrono__panel {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: max-content;
  min-width: 172px;
  max-width: min(88vw, 340px);
  padding: 11px 13px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--glass-strong);
  backdrop-filter: blur(30px) saturate(1.9) brightness(1.12);
  -webkit-backdrop-filter: blur(30px) saturate(1.9) brightness(1.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    0 12px 40px rgba(0, 0, 0, 0.55);
  font-size: 13px;
  pointer-events: none;   /* пока ведём палец — панель прозрачна для жеста */
  transform-origin: bottom center;
  z-index: 6;
}
.chrono__panel[hidden] { display: none; } /* display:flex перебивал hidden */
/* Нет событий в точке — панель ужимается до самого времени: снят минимум ширины и
   разделитель под часами (владелец 16.07.2026: «просто время, без нижней черты,
   панель размером со время»). Правила ниже .chrono__panel → перебивают min-width. */
.chrono__panel--bare { min-width: 0; }
.chrono__panel--bare .chrono__panelclock { padding-bottom: 0; border-bottom: none; }
.chrono--dock.is-settled .chrono__panel { pointer-events: auto; } /* осела — ссылки кликабельны */
.chrono__panel.is-pop { animation: chrono-pop 380ms cubic-bezier(0.3, 1.45, 0.45, 1); }
/* Вход: пружина + лёгкое преломление (глитч), как всплывающее стекло iOS. */
@keyframes chrono-pop {
  0%   { opacity: 0; transform: translateY(6px) scale(0.94); filter: blur(6px); }
  55%  { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
/* Спекулярный блик по верхней кромке — «стекло», а не просто размытие. */
.chrono__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 42%);
  pointer-events: none;
}

/* Шапка панели — ОДНА временная отметка: время точки, куда ткнул палец. Часов по
   вёдрам тут нет (владелец 13.07: «убого, я это и так вижу по цвету линии»). */
.chrono__panelclock { font-size: 15px; font-weight: 600; color: var(--text); font-family: var(--mono);
  padding-bottom: 5px; border-bottom: 1px solid var(--line); }

/* Событие точки — РОВНО одна строка (владелец 16.07.2026): время · иконка · подпись ·
   детали · сумма, всё в один ряд с эмодзи. Подпись не переносится и не режется
   многоточием: что не влезло — уезжает БЕГУЩЕЙ СТРОКОЙ (marquee), но видно целиком. */
.chrono-ev { display: flex; flex-wrap: nowrap; align-items: baseline; gap: 7px; line-height: 1.5;
  white-space: nowrap; overflow: hidden; }
.chrono-ev__icon { flex-shrink: 0; font-size: 12px; }
/* Точка проекта у пункта стендапа (владелец 16.07.2026) вместо эмодзи ✅. */
.chrono-ev__dot { width: 9px; height: 9px; border-radius: 50%; align-self: center;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.25); }
.chrono-ev__time { flex-shrink: 0; font-size: 12px; color: #8B95A1; font-family: var(--mono); }
.chrono-ev__label { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--dim); }
/* Внутренний бегунок: одна неразрывная строка натуральной ширины; при переполнении
   JS вешает .is-marquee и катает его туда-обратно (--marq-shift = сколько не влезло). */
.chrono-ev__scroll { display: inline-block; white-space: nowrap; will-change: transform; }
.chrono-ev__label.is-marquee .chrono-ev__scroll {
  animation: chrono-marq var(--marq-time, 6s) ease-in-out infinite alternate; }
@keyframes chrono-marq {
  0%, 12%   { transform: translateX(0); }
  88%, 100% { transform: translateX(calc(-1 * var(--marq-shift, 0px))); }
}
@media (prefers-reduced-motion: reduce) {
  .chrono-ev__label.is-marquee .chrono-ev__scroll { animation: none; }
}
.chrono-ev__label a { color: var(--mint); }
.chrono-ev__detail { flex-shrink: 0; color: #7E8A92; font-size: 12px; font-family: var(--mono); }
.chrono-ev__amt { flex-shrink: 0; color: #8FA0A8; }
.chrono-ev--income .chrono-ev__amt { color: var(--mint); }
.chrono-ev--meal .chrono-ev__label { color: #F0A868; font-family: var(--mono); }
.chrono-ev--standup .chrono-ev__label { color: #C7D2DC; }
.chrono__note { font-size: 11px; line-height: 1.5; color: #6C7682; }
.chrono__sources { display: flex; flex-direction: column; margin-top: 2px; }
.chrono__split { display: flex; align-items: center; gap: 1px; width: 54px; height: 7px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, 0.05); }
.chrono__splitseg { height: 100%; border-radius: 2px; min-width: 2px; }
.chrono__standup > summary { list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.chrono__standup > summary::-webkit-details-marker { display: none; }
.chrono__subrow--standup { gap: 8px; }
.chrono__caret--sm { color: #6C7682; flex-shrink: 0; }
.chrono__standup[open] .chrono__caret--sm { transform: rotate(180deg); }
.chrono__standuphdr { margin: 6px 0 3px 17px; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #7E8A92; }
.chrono__standuplist { margin: 0 0 9px 17px; padding-left: 14px; display: flex; flex-direction: column; gap: 4px; }
.chrono__standuplist li { font-size: 12px; line-height: 1.45; color: #AEB7C2; list-style: disc; }
.chrono__standuplist a { color: var(--text); text-decoration: none; }

/* Меток времени под линией НЕТ (владелец 13.07, вторая правка): они падали в
   safe-area, налезали друг на друга и на контент — «их не видно, ужасно сделал».
   Под линией не должно быть НИ ОДНОЙ цифры даже по тапу; всё время — в панели
   сверху (.chrono__panelclock). Пинится test/assets/chrono_dock_css_test.rb. */

/* Растянутый прогресс-бар проекта в дропдауне «Работа». */
.chrono__pbar { flex: 1; height: 8px; border-radius: 5px; overflow: hidden; background: rgba(255, 255, 255, 0.05); min-width: 60px; }
.chrono__pbarfill { display: block; height: 100%; border-radius: 5px; min-width: 3px; }
@keyframes nm-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

/* ── План дня: тудушка-цели на биодень (виджет первым блоком) ── */
.todo-card { margin-bottom: 14px; padding: 16px 18px; }
.todo-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.todo-card__title { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--text); }
.todo-card__count { font-size: 11px; font-weight: 600; color: var(--faint); font-family: var(--mono); }
.todo-card__count--green { color: #8BEAC2; }
.todo-card__empty { font-size: 13px; color: var(--faint); margin: 4px 0; }

.todo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.todo { display: flex; align-items: stretch; gap: 4px; }
.todo__tap {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px;
  background: none; border: 0; width: 100%; text-align: left;
  padding: 9px 6px; border-radius: 12px; color: var(--text);
  font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.todo__tap:active { background: rgba(255, 255, 255, 0.05); }
.todo__tap--static { cursor: default; }
/* Тогл manual-тудушки: кнопка — только чекбокс, текст рядом остаётся ссылко-кликабельным. */
.todo__form { flex: 0 0 auto; display: flex; }
.todo__tap--toggle { flex: 0 0 auto; width: auto; }
.todo__box {
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 7px;
  border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; color: var(--mint-ink); background: transparent;
}
.todo--done .todo__box { background: #8BEAC2; border-color: #8BEAC2; }
.todo__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* Тудушка — РОВНО одна строка (владелец 13.07: «переносы запрещены»), и заголовок
   любой длины В ПРЕДЕЛАХ ВАЛИДАЦИИ (DayGoal::TITLE_LIMIT) обязан влезть в неё
   ЦЕЛИКОМ: при 14px 50 символов дают ~375px против 304px колонки — строка ломалась
   на две, ряд толстел вдвое («жирная тудушка в валидацию не умещается»). Кегль
   подбирает сервер под длину (day_goal_title_style); ellipsis — страховка для
   легаси-строк длиннее лимита. Пинится test/assets/todo_one_line_css_test.rb. */
.todo__title { font-size: 14px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo--done .todo__title { color: var(--faint); text-decoration: line-through; }
.todo__meta { font-size: 11px; color: var(--faint); }
.todo__auto { opacity: 0.7; }

/* Форма быстрого создания тудушки (владелец 23.07.2026: «верни формы»). */
.todo-add { display: flex; gap: 8px; margin-top: 10px; }
.todo-add__input {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04);
  color: var(--text); font: inherit; font-size: 16px; /* <16px — iOS зумит вьюпорт */
}
.todo-add__input::placeholder { color: var(--faint); }
.todo-add__btn {
  flex: 0 0 auto; width: 40px; border-radius: 12px; border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06); color: var(--text); font-size: 20px;
  line-height: 1; cursor: pointer;
}
.todo-add__btn:active { background: rgba(255, 255, 255, 0.12); }
.todo__del {
  flex: 0 0 auto; background: none; border: 0; color: var(--faint);
  font-size: 18px; line-height: 1; padding: 0 8px; cursor: pointer; opacity: 0.5;
}
.todo__del:active { opacity: 1; }

/* Тудушка v3 (29.07.2026): ручка сортировки, инлайн-правка, свайп-удаление.
   Строка едет за пальцем влево, за порогом краснеет — отпустил, и Turbo
   спрашивает нативным confirm. */
.todo { transition: transform 0.16s ease; }
.todo.is-swiping, .todo.is-sorting { transition: none; }
.todo.is-swipe-armed { background: rgba(240, 96, 96, 0.14); border-radius: 8px; }
.todo.is-sorting { opacity: 0.9; background: rgba(255, 255, 255, 0.06); border-radius: 8px; }
.todo__grip {
  flex: 0 0 auto; align-self: center; padding: 0 4px; cursor: grab;
  color: var(--faint); opacity: 0.45; font-size: 13px; line-height: 1;
  touch-action: none; -webkit-tap-highlight-color: transparent; user-select: none;
}
.todo__grip:active { cursor: grabbing; opacity: 0.9; }
.todo__edit { flex: 1 1 auto; min-width: 0; }
.todo__summary { list-style: none; cursor: text; width: 100%; }
.todo__summary::-webkit-details-marker { display: none; }
.todo__edit-form { display: flex; gap: 8px; margin: 4px 0 6px; }
.todo__edit-form .todo-add__input { font-size: 14px; }
.todo__del-form { flex: 0 0 auto; display: flex; align-items: center; }

.todo-add { display: flex; gap: 8px; margin-top: 12px; }
.todo-add__input {
  flex: 1; background: var(--input-bg); border: 1px solid var(--border);
  border-radius: var(--radius-input); padding: 9px 12px; color: var(--text);
  font: inherit; font-size: 14px;
}
.todo-add__input::placeholder { color: var(--faint); }
.todo-add__btn {
  flex: 0 0 auto; width: 40px; background: var(--input-bg); border: 1px solid var(--border);
  border-radius: var(--radius-input); color: var(--text); font-size: 20px; line-height: 1;
  cursor: pointer;
}
.todo-add__btn:active { background: rgba(255, 255, 255, 0.1); }

/* Нижний навбар bio/chat/info ВЕРНУЛСЯ 23.07.2026 (владелец: «верни просто нижний
   навбар») — теперь он единственная навигация, свайпы выпилены. Линия хронометрии
   на /bio живёт НАД ним; контент не должен заезжать под оба слоя. */
body.has-chrono-dock .shell { padding-bottom: 176px; }

/* ── Заметки: браузер волта и рендер (issue #60) ─────────────── */
/* 05.07.2026: граф — дефолт и почти весь экран; тонкий iOS-свитчер
   (одна кнопка-капелька справа сверху) вместо жирных чипов. */
.notes__bar { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; }
.notes__bar .notes__heading { margin: 0; }
.notes__viewtoggle {
  height: 26px; padding: 0 12px; border-radius: 13px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5);
  color: var(--faint); font-size: 12px; font-weight: 500; letter-spacing: 0.02em;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, color 0.15s ease;
}
.notes__viewtoggle:active { transform: scale(0.95); color: var(--text); }
/* Граф-редизайн (#67): контейнер-обёртка, канвас во всю площадь, оверлеи
   (кнопка «назад», риббон peek/удаления) абсолютом поверх. Жесты (тап/
   long-press/pan-y) обрабатываем сами — touch-action: none на канвасе. */
.notes__graph { position: relative; width: 100%; height: calc(100dvh - 160px); min-height: 360px; }
.notes__canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.notes__gback {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  height: 30px; padding: 0 12px; border-radius: 15px;
  border: 1px solid var(--border); background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  color: var(--dim); font-size: 12px; font-weight: 600; cursor: pointer;
}
.notes__gback:active { transform: scale(0.96); }
.notes__peek[hidden] { display: none; } /* display:flex перебивал hidden — граф теперь виден сразу, риббон светился пустым */
.notes__peek {
  position: absolute; top: 8px; left: 8px; right: 8px; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--glass-strong);
  backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  color: var(--text); font-size: 13px; line-height: 1.3;
  pointer-events: none;
}
.notes__peek-text { flex: 1; overflow-wrap: anywhere; }
.notes__peek-del {
  flex-shrink: 0; pointer-events: auto;
  height: 32px; padding: 0 14px; border-radius: 16px;
  border: 1px solid var(--coral); background: rgba(255, 154, 143, 0.16);
  color: var(--coral); font-size: 13px; font-weight: 600; cursor: pointer;
}
.notes__peek-del:active { transform: scale(0.96); }
.notes__peek-del:disabled { opacity: 0.5; }
.notes__back { display: inline-block; margin: 4px 0 10px; color: var(--faint); font-size: 13px; }
/* Сортировка заметки (11.07.2026): ряд нейтральных стеклянных капсул над
   «Удалить» — Skill/Rule/Memory/LOC, каждая шлёт ход агенту в чат. */
.notes__acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.notes__act-f { display: inline-flex; margin: 0; }
.notes__act {
  height: 32px; padding: 0 14px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--glass-strong);
  color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer;
  -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
}
.notes__act:active { background: rgba(255, 255, 255, 0.14); }
/* «Фича» — самая сильная сортировка (заметка → живой код): мятный акцент */
.notes__act--feature { border-color: var(--mint); color: var(--mint); }
/* «Issue» — заметка выносится на GitHub и удаляется: коралловый, как «Удалить» */
.notes__act--issue { border-color: var(--coral); color: var(--coral); }
/* «Удалить» на странице заметки (soft-hide) — та же капсула, что в peek графа */
.notes__del button, button.notes__del {
  margin-top: 12px;
  height: 32px; padding: 0 14px; border-radius: 16px;
  border: 1px solid var(--coral); background: rgba(255, 154, 143, 0.16);
  color: var(--coral); font-size: 13px; font-weight: 600; cursor: pointer;
}
.notes__heading { font-size: 19px; margin: 0 0 12px; }
/* Список — тонкие iOS-строки: без карточек/эмодзи, hairline-разделители, шеврон */
.notes__row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 4px; margin: 0; color: var(--text); font-size: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: none; border-radius: 0;
}
.notes__row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes__chev { color: var(--faint); font-size: 17px; line-height: 1; opacity: 0.7; }
.notes__row--pinned .notes__row-title { color: var(--mint); }
.notes__row--folder { color: var(--dim); font-weight: 500; }
.note { padding: 14px 16px; overflow-x: hidden; overflow-wrap: anywhere; }
.note h1 { font-size: 19px; margin: 0 0 10px; }
.note h2 { font-size: 16px; margin: 16px 0 8px; }
.note h3, .note h4 { font-size: 14px; margin: 12px 0 6px; }
.note p, .note li { font-size: 14px; line-height: 1.55; }
.note p { margin: 8px 0; }
.note ul, .note ol { padding-left: 20px; margin: 8px 0; }
.note blockquote { border-left: 2px solid var(--border); margin: 10px 0; padding: 2px 0 2px 10px; color: var(--faint); }
.note code { font-size: 12.5px; background: rgba(255, 255, 255, 0.08); border-radius: 4px; padding: 1px 4px; }
.note pre { overflow-x: auto; padding: 10px 12px; background: rgba(0, 0, 0, 0.35); border-radius: 10px; margin: 10px 0; }
.note pre code { background: none; padding: 0; }
.note table { display: block; overflow-x: auto; border-collapse: collapse; margin: 10px 0; max-width: 100%; }
.note th, .note td { border: 1px solid var(--border); padding: 4px 8px; font-size: 12.5px; white-space: nowrap; }
.note hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.note a, .note a.wikilink { color: var(--mint); }
.note .wikilink--dead { color: var(--faint); border-bottom: 1px dashed var(--faint); }

/* ── Донат «день одним кругом» (владелец 23.07.2026, сменил три ∞-восьмёрки) ──
   Один круг на биодень: сегменты — доля каждого ведра (Сон/Работа/Жизнь) от их
   суммы; в центре — длительность дня; под кругом — легенда с часами. Без JS. */
.biodonut { margin-top: 22px; padding: 18px 14px 16px; text-align: center;
  animation: sleep-rise 460ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.biodonut__ring { position: relative; width: min(210px, 62vw); margin: 0 auto; }
.biodonut__svg { width: 100%; height: auto; display: block; }
.biodonut__track { fill: none; stroke: var(--track); stroke-width: 12; }
.biodonut__seg { fill: none; stroke-width: 12; }
.biodonut__total { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-family: var(--mono); font-size: 24px; font-weight: 700;
  color: var(--text); letter-spacing: 0.04em; pointer-events: none; }
.biodonut__legend { display: flex; justify-content: center; flex-wrap: wrap;
  gap: 6px 18px; margin-top: 14px; }
.biodonut__key { display: inline-flex; align-items: baseline; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--dim); }
.biodonut__dot { width: 9px; height: 9px; border-radius: 50%; flex: none;
  align-self: center; }
.biodonut__h { font-family: var(--mono); color: var(--text); }
@media (prefers-reduced-motion: reduce) { .biodonut { animation: none; } }

/* Футер причёсан (владелец 16.07.2026: «сделай нормальный, сейчас уёбищно»): тонкая
   разделительная черта сверху, info и «правка времени» одним тихим рядом по центру. */
.bio-footer { margin: 26px auto 6px; padding-top: 14px; gap: 6px;
  border-top: 1px solid var(--line); max-width: 320px; }
.bio-footer__row { display: flex; justify-content: center; align-items: center;
  gap: 18px; }
.bio-footer__edit { text-align: center; }
.bio-footer__edit .sleep-edit__toggle { font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint);
  list-style: none; cursor: pointer; }
.bio-footer__edit .sleep-edit__toggle::-webkit-details-marker { display: none; }

/* Панель сессий чата (/chats) — обычная страница + задел под drawer (FR-N1/N2). */
.sessions { display: flex; flex-direction: column; gap: 20px; padding: 8px 0 24px; }
.sessions__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sessions__title { font-size: 15px; font-weight: 600; letter-spacing: 0.02em; color: var(--text); }
/* Лого NotMeal вместо слова «Сессии» (владелец 24.07); рядом — «+» новая сессия и ⚙. */
.sessions__logo { display: inline-block; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); }
.sessions__logo::first-letter { color: var(--mint); }
.sessions__head-actions { display: flex; align-items: center; gap: 8px; }
.sessions__gear { display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--card-bg); color: var(--dim); cursor: pointer; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent; }
.sessions__gear:active { background: rgba(255, 255, 255, 0.08); }
/* Компактная «+» новая сессия (владелец 24.07: квадратом рядом с ⚙). button_to
   вешает class на сам <button>, поэтому .sessions__new — это кнопка; форма-обёртка
   участвует во flex-строке .sessions__head-actions сама. */
.sessions__new, .sessions__new button {
  -webkit-appearance: none; appearance: none; display: inline-flex; align-items: center;
  justify-content: center; width: 34px; height: 34px; padding: 0; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card-bg); color: var(--text);
  font-size: 20px; line-height: 1; cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* Пункт «Биолог» в панели — переход из чата в стату (spec web-chat-home-navigation). */
.sessions__bio { display: flex; align-items: center; gap: 8px; text-decoration: none;
  padding: 12px 14px; border-radius: var(--radius-input); border: 1px solid var(--border);
  background: var(--card-bg); color: var(--text); font-size: 14px; font-weight: 600; }
.sessions__bio::before { content: "◵"; font-size: 16px; color: var(--dim); }

.sessions__day { display: flex; flex-direction: column; gap: 8px; }
.sessions__date { font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--faint); margin: 0; }
.sessions__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sessions__link { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  text-decoration: none; padding: 12px 14px; border-radius: var(--radius-input);
  border: 1px solid var(--border); background: var(--card-bg); color: var(--text); }
.sessions__item--active .sessions__link { border-color: var(--coral); }
.sessions__name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sessions__meta { font-size: 12px; color: var(--dim); flex-shrink: 0; display: flex; align-items: baseline; gap: 8px; }

/* Виджет стоимости/контекста (спека chat-cost-context-widget). Две малые цифры:
   контекст (краснеет за порогом окна модели) + цена сессии; dim в норме. */
:root { --ctx-amber: #E8B84B; --ctx-red: #FF6B5E; }
.sessions__ctx { font-variant-numeric: tabular-nums; color: var(--faint); }
.sessions__cost { font-variant-numeric: tabular-nums; color: var(--dim); }
.sessions__ctx--amber { color: var(--ctx-amber); }
.sessions__ctx--red { color: var(--ctx-red); font-weight: 600; }
.sessions__daysum { font-size: 12px; font-weight: 600; color: var(--dim);
  font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none; }
.sessions__date { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
/* Скрытый из цены чат: цена видна, но приглушена/зачёркнута. */
.sessions__item--hidden .sessions__cost { color: var(--faint); text-decoration: line-through; opacity: 0.7; }
.sessions__item { display: flex; align-items: stretch; gap: 6px; }
.sessions__item .sessions__link { flex: 1; min-width: 0; }
.sessions__hide button, .sessions__hide {
  border: 1px solid var(--border); background: var(--card-bg); color: var(--dim);
  border-radius: var(--radius-input); padding: 0 12px; font-size: 15px; line-height: 1;
  cursor: pointer; flex-shrink: 0; }
.sessions__item--hidden .sessions__hide button, .sessions__item--hidden .sessions__hide { color: var(--ctx-amber); }

/* Стат в шапке экрана сессии (сверху справа). */
/* Стат теперь в строке контролов между ⚙ и «отправить» (владелец 24.07): без
   margin-left:auto (растяжку даёт .chat-form__spacer), уже цифры, чтобы влезало
   на узких экранах. */
.chat-stat { display: flex; align-items: baseline; gap: 6px; min-width: 0;
  font-size: 11px; font-variant-numeric: tabular-nums; flex-shrink: 1; overflow: hidden; }
.chat-stat > * { white-space: nowrap; }
.chat-stat__ctx { color: var(--faint); }
.chat-stat__ctx--amber { color: var(--ctx-amber); }
.chat-stat__ctx--red { color: var(--ctx-red); font-weight: 600; }
.chat-stat__cost { color: var(--dim); }
/* Реальные лимиты подписки (5ч-окно, неделя) из oauth/usage. */
.chat-stat__lim { color: var(--faint); }
.chat-stat__lim--warning, .chat-stat__lim--allowed_warning { color: var(--ctx-amber); }
.chat-stat__lim--rejected, .chat-stat__lim--blocked { color: var(--ctx-red); font-weight: 600; }
.chat-stat--hidden .chat-stat__cost { color: var(--faint); text-decoration: line-through; opacity: 0.7; }

/* Маркдаун ответов ассистента (хендофф A): таблицы/заголовки/код, Ч/Б. */
.msg__text--md { font-size: 14px; line-height: 1.45; overflow-wrap: break-word; }
.msg__text--md > :first-child { margin-top: 0; }
.msg__text--md > :last-child { margin-bottom: 0; }
.msg__text--md h1, .msg__text--md h2, .msg__text--md h3, .msg__text--md h4 {
  margin: 10px 0 4px; line-height: 1.25; color: var(--text); }
.msg__text--md h1 { font-size: 16px; } .msg__text--md h2 { font-size: 15px; }
.msg__text--md h3, .msg__text--md h4 { font-size: 14px; }
.msg__text--md p, .msg__text--md ul, .msg__text--md ol, .msg__text--md blockquote { margin: 6px 0; }
.msg__text--md ul, .msg__text--md ol { padding-left: 20px; }
.msg__text--md code { font-family: ui-monospace, monospace; font-size: 12.5px;
  background: rgba(255, 255, 255, 0.08); border-radius: 5px; padding: 1px 5px; }
.msg__text--md pre { margin: 8px 0; padding: 10px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.06); overflow-x: auto; }
.msg__text--md pre code { background: none; padding: 0; }
.msg__text--md blockquote { border-left: 2px solid var(--line); padding-left: 10px; color: var(--dim); }
.msg__text--md a { color: var(--mint); }
.msg__text--md hr { border: none; border-top: 1px solid var(--line); margin: 10px 0; }
.msg__text--md table { width: 100%; margin: 8px 0; border-collapse: collapse; font-size: 13px; display: block; overflow-x: auto; }
.msg__text--md th, .msg__text--md td { padding: 5px 8px; border: 1px solid rgba(255, 255, 255, 0.12); text-align: left; white-space: nowrap; }
.msg__text--md th { background: rgba(255, 255, 255, 0.05); font-weight: 600; }

/* Стрим хода харнесса в ленте (spec web-chat-turn-stream): компактный Ч/Б блок
   «ход» с карточками шагов (тул-колы/текст/результаты), бегущая Σ токенов и цены.
   Дефолт — подробно (details open); «кратко» (.chat--brief) прячет блок целиком. */
.turn { margin: 2px 0 6px; }
.turn > details { border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.02); overflow: hidden; }
.turn > details > summary { list-style: none; cursor: pointer; padding: 6px 10px; }
.turn > details > summary::-webkit-details-marker { display: none; }
.turn__head { display: flex; align-items: baseline; gap: 8px; font-size: 11px; color: var(--dim); }
.turn__label { font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.turn__stat { font-variant-numeric: tabular-nums; }
.turn__cost { color: var(--dim); }
.turn__steps { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px 8px; }
.turn-step { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; line-height: 1.4;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--dim); }
.turn-step__icon { flex-shrink: 0; font-size: 11px; }
.turn-step__title { flex-shrink: 0; color: var(--text); }
.turn-step__detail { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: none; padding: 0; color: var(--faint); }
.turn-step__toks { flex-shrink: 0; color: var(--faint); font-size: 10.5px; }
.turn-step--tool_result .turn-step__detail { color: var(--dim); }
.turn-step--error .turn-step__title, .turn-step--error .turn-step__icon { color: var(--coral); }
.chat--brief .turn { display: none; } /* «кратко» — только ответ, как раньше */

/* Бегущая строка ТЕКУЩЕГО шага живого хода (владелец 24.07): один ряд, marquee как
   у события-стендапа (scrubber). Не растит блок и не сыпет пачкой карточек. */
.turn__now { overflow: hidden; white-space: nowrap; padding: 3px 10px 6px;
  font-size: 11.5px; color: var(--dim);
  font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.turn__now:empty { display: none; padding: 0; } /* пустой (до первого шага) не занимает места */
.turn__now-scroll { display: inline-block; white-space: nowrap; will-change: transform; }
.turn__now-icon { font-size: 11px; }
.turn__now-title { color: var(--text); }
.turn__now.is-marquee .turn__now-scroll {
  animation: chrono-marq var(--marq-time, 6s) ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) {
  .turn__now.is-marquee .turn__now-scroll { animation: none; }
}
/* Идущий ход — ЕДИНСТВЕННЫЙ индикатор, живёт на pending-сообщении ассистента
   (владелец 24.07: «надёжно и только 1 ход, тот что сейчас идёт, после моего
   сообщения»). Бегущая строка текущего шага; стрим молчит → пульсирующее «думает…». */
.turn-live { align-self: flex-start; max-width: 100%; margin: 2px 0 6px; }
.turn__now--wait .turn__now-scroll { color: var(--dim); font-style: italic;
  animation: turn-wait 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .turn__now--wait .turn__now-scroll { animation: none; } }
@keyframes turn-wait { 0%, 100% { opacity: 0.45 } 50% { opacity: 1 } }

/* Тумблер подробности хода — человеческий свитч-пилюля (владелец 20.07: «нормальный,
   человеческий»): подпись «подробно/кратко» + трек с бегунком, тап-таргет ≥38px.
   Рядом слот под будущий свитчер модели: пустой сейчас, но место в ряду заложено. */
.chat-form__turn { display: inline-flex; align-items: center; gap: 8px; min-height: 38px;
  border: 1px solid var(--border); background: var(--card-bg);
  color: var(--text); border-radius: 999px; padding: 8px 13px; font-size: 13px; line-height: 1;
  cursor: pointer; flex-shrink: 0; -webkit-tap-highlight-color: transparent; }
.chat-form__turn-track { position: relative; flex: 0 0 auto; width: 30px; height: 17px;
  border-radius: 999px; background: #3f3f45; transition: background 0.15s ease; }
.chat-form__turn-track::after { content: ""; position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%; background: #fff;
  transition: transform 0.15s ease; }
.chat-form__turn--on .chat-form__turn-track { background: #34c759; }
.chat-form__turn--on .chat-form__turn-track::after { transform: translateX(13px); }
.chat-form__modelslot { flex-shrink: 0; display: inline-flex; gap: 6px; align-items: center; }
/* Компактные селекты модели/effort в композере (spec web-chat-ux, п.7/8). */
.chat-form__model, .chat-form__effort { appearance: none; -webkit-appearance: none;
  min-height: 30px; max-width: 116px; padding: 4px 8px; border-radius: 9px; font-size: 12px;
  color: var(--text); background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16); cursor: pointer; }
.chat-form__effort { max-width: 96px; }

/* Вложения в пузыре сообщения (владелец 20.07): ряд превью-чипов, тап = открыть. */
.msg__photos { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.msg__photo { display: block; width: 96px; height: 96px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); flex-shrink: 0; }
.msg__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Веб-чат: «думает» и провал полного хода (FR-P3). */
.msg--pending { opacity: 0.6; }
.msg--pending .msg__text span { font-style: italic; }
.msg__retry button, .msg__retry {
  margin-top: 6px; padding: 4px 10px; border-radius: 12px;
  border: 1px solid rgba(255, 154, 143, 0.5); background: transparent;
  color: var(--coral); font-size: 12px; cursor: pointer; }

/* Топбар чата + выезжающая панель сессий (drawer, FR-N2/N3). */
/* Топбар с бургером ЗАФИКСИРОВАН сверху (владелец 19.07): sticky, чёрный фон
   перекрывает уходящую под него ленту, всегда доступен при скролле. */
/* Обёртка контроллера drawer'а не должна создавать бокс: иначе sticky-шапка
   липнет только в пределах её высоты, а стаггер .shell > * делает её
   containing block'ом для fixed-панели (см. коммент у liquid-rise). */
.drawer-scope { display: contents; }
/* Шапка — стекло (владелец 20.07: «верхний бургер, вся панель — стеклянной»).
   backdrop-filter здесь безопасен: drawer (fixed) — сиблинг шапки, не потомок,
   containing block от фильтра его не ловит. */
.chat-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 6px) 0 14px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4); }
.chat-top__menu { color: var(--text); line-height: 0; padding: 6px; margin: -2px 0; border-radius: 10px; text-decoration: none; }
.chat-top__title { display: flex; flex-direction: column; }
.chat-top__date { font-size: 11px; color: var(--dim); }
body.drawer-locked { overflow: hidden; }
.drawer { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.drawer--open { opacity: 1; pointer-events: auto; }
/* Лист панели — заметно светлее чёрной страницы, с тенью, иначе на #000 его не
   видно (владелец 19.07: «ничего не вижу»). Safe-area сверху — под чёлку. */
.drawer__sheet { position: absolute; inset: 0 auto 0 0; width: min(84vw, 360px);
  background: #141416; border-right: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.7);
  transform: translateX(-100%); transition: transform 0.22s ease;
  overflow-y: auto; padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
  -webkit-overflow-scrolling: touch; }
.drawer--open .drawer__sheet { transform: translateX(0); }

/* ── PWA офлайн (spec pwa-max-offline, этап 1) ─────────────────────────────── */
.offline-shell { display: flex; flex-direction: column; min-height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 18px calc(env(safe-area-inset-bottom, 0px) + 18px); }
.offline-banner { display: flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 7px 12px; border-radius: 999px; font-size: 13px; color: #ffd7b0;
  background: rgba(255, 138, 76, 0.14); border: 1px solid rgba(255, 138, 76, 0.34); }
.offline-banner__dot { width: 8px; height: 8px; border-radius: 50%; background: #ff8a4c;
  box-shadow: 0 0 0 0 rgba(255, 138, 76, 0.6); animation: offline-pulse 1.8s ease-out infinite; }
@keyframes offline-pulse { to { box-shadow: 0 0 0 10px rgba(255, 138, 76, 0); } }
.offline-body { margin: auto 0; max-width: 30rem; }
.offline-lead { font-size: 17px; color: var(--text); margin-bottom: 10px; }
.offline-hint { color: var(--dim); font-size: 14px; margin-bottom: 20px; }
.offline-retry { display: inline-block; padding: 10px 18px; border-radius: 12px;
  text-decoration: none; color: var(--text); background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16); }

/* Баннер офлайна поверх живого чата (outbox, этап 2): вставляется JS в #chat-messages. */
.net-banner { position: sticky; top: 0; z-index: 5; display: flex; align-items: center;
  gap: 8px; justify-content: center; padding: 6px 12px; font-size: 13px; color: #ffd7b0;
  background: rgba(255, 138, 76, 0.16); border-bottom: 1px solid rgba(255, 138, 76, 0.3); }

/* Пузырь в очереди (outbox, этап 2): приглушённый + метка ⏳. */
.msg--sending { opacity: 0.82; } /* оптимистичный пузырь до подтверждения broadcast'ом */
.msg--queued { opacity: 0.62; }
.msg__queued { display: inline-block; margin-top: 3px; font-size: 11px; color: var(--dim); }

/* Кнопка пушей в панели сессий (spec pwa-max-offline, этап 3). */
.sessions__push { margin: 6px 0 10px; }
.sessions__pushbtn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: 12px; font-size: 14px; color: var(--text); background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16); cursor: pointer; }
.sessions__pushbtn:disabled { opacity: 0.5; cursor: default; }
.sessions__pushnote { display: block; margin-top: 6px; font-size: 12px; color: var(--dim); }

/* Инфра-событие в ленте (spec web-chat-ux, п.9): серая строка, не пузырь. */
.msg-infra { display: flex; align-items: center; gap: 8px; margin: 4px auto; padding: 3px 10px;
  max-width: 92%; font-size: 11.5px; color: var(--dim); }
.msg-infra__dot { flex: none; width: 5px; height: 5px; border-radius: 50%; background: var(--dim); opacity: 0.7; }
.msg-infra__text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.msg-infra__time { flex: none; opacity: 0.7; }

/* ── Модалка настроек хода (владелец 20.07: строка контролов не влезала на SE) ──
   Одна ⚙-кнопка в строке; тап → bottom-sheet (портал в body, fixed от вьюпорта). */
.turnsheet { display: inline-flex; flex: 0 0 auto; }
.chat-form__gear { display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border-radius: 10px; color: var(--text);
  background: none; border: none; cursor: pointer; line-height: 0; }
.chat-form__gear:active { background: rgba(255, 255, 255, 0.08); }

/* Оверлей + затемнение. [hidden] обязан бить display:flex (иначе не скрыть — как
   было с панелью петли/chrono). z-index выше композера (25) и всего экрана. */
.turnsheet__panel { position: fixed; inset: 0; z-index: 1200; display: flex;
  flex-direction: column; justify-content: flex-end;
  background: rgba(0, 0, 0, 0.5); opacity: 1; }
.turnsheet__panel[hidden] { display: none; }
.turnsheet__sheet { background: #141416; border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px 20px 0 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.7);
  padding: 14px 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  display: flex; flex-direction: column; gap: 12px;
  transform: translateY(100%); transition: transform 0.24s ease; }
.turnsheet__panel--open .turnsheet__sheet { transform: translateY(0); }
.turnsheet__head { display: flex; align-items: center; justify-content: space-between; }
.turnsheet__title { font-size: 15px; color: var(--text); }
.turnsheet__close { width: 34px; height: 34px; border-radius: 50%; font-size: 15px;
  color: var(--text); background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.16)); cursor: pointer; }

/* Тумблер режима — человеческий свитч (трек+бегунок). */
.turnsheet__toggle { display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 44px; padding: 8px 12px; border-radius: 12px; color: var(--text);
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); cursor: pointer; }
.turnsheet__toggle-name { flex: 0 0 auto; font-size: 14px; }
.turnsheet__switch { position: relative; flex: 0 0 auto; width: 34px; height: 20px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.18); transition: background 0.15s ease; }
.turnsheet__switch::after { content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s ease; }
.turnsheet__toggle--on .turnsheet__switch { background: #34c759; }
.turnsheet__toggle--on .turnsheet__switch::after { transform: translateX(14px); }
.turnsheet__state { margin-left: auto; font-size: 13px; color: var(--dim); }

/* Поля модель/effort. */
.turnsheet__field { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; padding: 8px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); }
.turnsheet__field-name { font-size: 14px; color: var(--text); }
.turnsheet__select { appearance: none; -webkit-appearance: none; min-height: 32px;
  max-width: 62%; padding: 6px 10px; border-radius: 9px; font-size: 13px; color: var(--text);
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18); cursor: pointer;
  /* На ПК нативный список опций рисует ОС — светлый текст на светлом фоне не видно
     что выбираешь (владелец 24.07). color-scheme:dark → браузер красит попап тёмным;
     явные bg/color на <option> дожимают движки, что схему игнорят. */
  color-scheme: dark; }
.turnsheet__select option { background: #16181d; color: var(--text); }

/* Пуш-тумблер (владелец 24.07): переехал из панели в модалку. Без правого
   лейбла-состояния — свитч жмём вправо сам. */
.turnsheet__push { width: 100%; }
.turnsheet__push .turnsheet__switch { margin-left: auto; }
.turnsheet__push .turnsheet__toggle[disabled] { opacity: 0.5; cursor: default; }
.turnsheet__pushnote { display: block; margin-top: 6px; font-size: 12px; color: var(--dim); }
/* Блоки «фон дня» / «время сна» внутри модалки. */
.turnsheet__block { padding: 8px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); }
.turnsheet__block > summary { font-size: 14px; color: var(--text); cursor: pointer;
  list-style: none; -webkit-tap-highlight-color: transparent; }
.turnsheet__block > summary::-webkit-details-marker { display: none; }
.turnsheet__block[open] > summary { margin-bottom: 10px; }
/* Модалка может стать длинной (пуши + модель + effort + фон + сон) — скроллим. */
.turnsheet__sheet { max-height: 86vh; overflow-y: auto; }
.turnsheet__select option:checked { background: #2b2f3a; }

/* Раздел «Настройки» в панели (spec bio-panel-settings). */
.sessions__settings { margin: 6px 0 14px; padding: 10px 0; border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px; }
.sessions__settings-title { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.04em; }
.sessions__brain { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  padding: 8px 14px; border-radius: 12px; text-decoration: none; color: var(--text);
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); }
.sessions__setblock { border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px; padding: 8px 12px; }
.sessions__setblock > summary { cursor: pointer; font-size: 13px; color: var(--text); list-style: none; }
.sessions__setblock > summary::-webkit-details-marker { display: none; }
.sessions__setblock .sleep-edit__form, .sessions__setblock .day-bg__form { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }

/* ── Now-экран: таймер 40/20 (v2 W1, spec notes/v2/spec-01-ux.md) ──
   Один вопрос — «что я делаю». Цифры крупнее слов; перерыв переворачивает
   палитру (отдых ≠ работа). */
.focus { display: flex; flex-direction: column; gap: 22px; padding-top: 8vh; min-height: 72vh; }
.focus-hero { text-align: center; display: flex; flex-direction: column; gap: 6px; }
.focus-hero__kind { color: var(--faint); text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; }
.focus-hero__clock { font-size: clamp(64px, 26vw, 120px); line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.focus-hero__goal { color: var(--dim); font-size: 15px; }
.focus-hero--over .focus-hero__clock { color: var(--coral); }
.focus--break .focus-hero__clock { color: var(--mint); opacity: 0.55; }
.focus-actions, .focus-start { display: flex; flex-direction: column; gap: 10px; }
.focus-start__main { height: 30vh; font-size: clamp(48px, 18vw, 88px); font-weight: 700; border-radius: 28px; }
.focus-start__break { margin-top: 10px; }
.focus-goals { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.focus-goals__chip input { position: absolute; opacity: 0; }
.focus-goals__chip span {
  display: inline-block; padding: 8px 14px; border: 1px solid var(--border);
  border-radius: 999px; color: var(--dim); font-size: 14px;
}
.focus-goals__chip input:checked + span { background: var(--mint); color: var(--mint-ink); border-color: var(--mint); }
.focus-day { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.focus-strip { display: flex; gap: 4px; min-height: 8px; }
.focus-strip__seg { flex: 1 1 0; max-width: 42px; height: 8px; border-radius: 4px; background: var(--mint); }
.focus-strip__seg--break { background: transparent; border: 1px solid var(--border); }
.focus-strip__seg--cut { opacity: 0.35; }
.focus-strip__seg--live { animation: focus-live 1.6s ease-in-out infinite; }
@keyframes focus-live { 50% { opacity: 0.35; } }
.focus-day__meta { color: var(--faint); font-size: 13px; text-align: center; }

/* ── Plan-экран: тудушки-гипотезы (v2 W2, notes/v2/roadmap.md) ──
   Сортировка по impact; кнопка «40» справа — мост в Now. Правка веса/гипотезы
   свёрнута: экран для чтения, ввод = коррекция догадки. */
.plan { display: flex; flex-direction: column; gap: 14px; padding-top: 12px; min-height: 72vh; }
.plan__running { text-align: center; font-size: 13px; }
.plan__running-link { color: var(--mint); text-decoration: none; }
.plan__empty { color: var(--faint); text-align: center; }
.plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.plan-item { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.plan-item__row { display: flex; align-items: center; gap: 10px; }
.plan-item__body { flex: 1 1 auto; min-width: 0; }
.plan-item__title { font-size: 16px; }
.plan-item__hyp { color: var(--faint); font-size: 12px; }
.plan-item__weight { color: var(--mint); font-size: 15px; font-variant-numeric: tabular-nums; }
.plan-item__go { min-width: 56px; font-size: 18px; font-weight: 700; }
.plan-item__edit > summary { list-style: none; color: var(--faint); font-size: 11px; cursor: pointer; margin-top: 6px; }
.plan-item__edit > summary::-webkit-details-marker { display: none; }
.plan-edit { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.plan-edit__hyp { flex: 1 1 auto; min-width: 0; }
.plan-item--done { color: var(--faint); text-decoration: line-through; font-size: 14px; }
.plan-new { display: flex; gap: 8px; }
.plan-new__title { flex: 1 1 auto; min-width: 0; }
.plan-standup { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.plan-standup__title { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.plan-standup__line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--dim); }

/* ── Фокус, ОДИН виджет (29.07.2026, v3): цифра до дедлайна + деньги + разбивка
   по проектам + фокусные часы дня. Две карточки слиты по заказу владельца. ── */
.focus-card { padding: 16px 18px; }
.focus-top { display: flex; align-items: center; gap: 16px; }
.focus-count { flex: 0 0 auto; }
.focus-count__num { font-size: 44px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; color: var(--text); }
.focus-money { margin-left: auto; display: flex; flex-direction: column; gap: 2px; text-align: right; }
.focus-money__label { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.focus-money__val { font-size: 20px; font-weight: 600; color: var(--text); }

/* Среднее ч/день по каждому из трёх проектов; notmeal — не работа, приглушён. */
.focus-split { list-style: none; margin: 10px 0 2px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.focus-split__row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--dim); }
.focus-split__row--own { color: var(--faint); }
.focus-split__val { font-variant-numeric: tabular-nums; }

.focus-hour { padding: 8px 0; border-top: 1px solid var(--line); }
.focus-hour:first-of-type { margin-top: 8px; }
.focus-hour__row { display: flex; align-items: center; gap: 10px; }
.focus-hour__span { font-size: 14px; font-weight: 600; color: var(--text); }
.focus-hour__dur { font-size: 12px; color: var(--faint); }
/* Select проекта (v3: чипсы выпилены по заказу владельца — «ужасны»). Нативный
   вид на ПК был невидим на тёмном фоне: снимаем appearance и рисуем сами,
   стрелку — фоновым svg; option'ы форсим тёмными (иначе белые в Chrome/Linux). */
.focus-hour__proj { margin-left: auto; font-size: 12px; color: var(--dim); }
.focus-hour__select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  border: 1px solid var(--border); border-radius: 10px; padding: 4px 26px 4px 10px;
  background-color: rgba(255, 255, 255, 0.06); color: var(--text);
  font: inherit; font-size: 12px; line-height: 1.4; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%238B93A1' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 9px 6px;
}
.focus-hour__select:hover { background-color: rgba(255, 255, 255, 0.12); }
.focus-hour__select:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; }
.focus-hour__select option { background: #14161a; color: #e8ebf0; }
/* Фильтр проекта на весь виджет — в шапке, между заголовком и датой дедлайна. */
.focus-filter { margin-left: auto; display: flex; }
.focus-filter__select { font-size: 11px; padding: 2px 24px 2px 8px; }
.focus-items { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.focus-item__line { display: flex; gap: 8px; align-items: baseline; cursor: pointer; list-style: none; }
.focus-item__line::-webkit-details-marker { display: none; }
.focus-item__time { flex: 0 0 auto; font-size: 11px; color: var(--faint); }
.focus-item__text { font-size: 13px; color: var(--dim); min-width: 0; overflow-wrap: anywhere; }
.focus-items .focus-item__text { white-space: nowrap; overflow: hidden; }
.focus-item__text a { color: var(--mint); text-decoration: none; }
.focus-item__form { display: flex; gap: 8px; margin: 6px 0 4px; }
.focus-item__input { font-size: 14px; }

/* Пункт стендапа — строго ОДНА строка (v3): текст режется по длине при записи
   (~2 строки символов, Standup::BULLET_MAX_CHARS), а если всё равно не влез —
   едет «бегущей» тем же marquee-контроллером, что и подпись хода в чате
   (переполнение он меряет сам, без счёта символов). */
.focus-item__run { display: inline-block; white-space: nowrap; will-change: transform; }
.focus-item__text.is-marquee .focus-item__run {
  animation: chrono-marq var(--marq-time, 6s) ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) {
  .focus-item__text.is-marquee .focus-item__run { animation: none; }
}
/* Вид «как в Пачке»: главный список — codex-стендап, сырые коммиты в подвале. */
.focus-commits { margin-top: 4px; }
.focus-commits__sum { font-size: 11px; color: var(--faint); cursor: pointer; list-style: none; }
.focus-commits__sum::-webkit-details-marker { display: none; }
.focus-items--raw { margin-top: 4px; }
