/* Endless — палитра бренда (brand/философия.md, «Цвет и голос»).
   Чернила #181818 — тишина и опора; лайм #CCFE00 — энергия, только там, где движение (прогресс, выполненное,
   цель, отправить); бумага, графит, серый — служебные. На светлом фоне лайм глубокий #8FB400: лайм на белый не ставим. */
:root {
  --fab-size: 84px; --fab-edge: 14px; --fab-gap: 10px;   /* кнопка ассистента: размер, отступ от края, зазор до текста – одно место правды (карточки первого дня берут запас отсюда) */
  --bg: #f4f3ee;            /* бумага */
  --bg-2: #ffffff;
  --card: rgba(255,255,255,.86);
  --line: rgba(24,24,24,.1);
  --text: #181818;          /* чернила */
  --muted: #6f6f69;         /* графит */
  --lime: #8FB400;          /* глубокий лайм для светлой темы */
  --accent: var(--lime);
  --accent-2: var(--lime);
  --ink: #181818;
  --paper: #f4f3ee;
  --on-accent: #181818;     /* текст на лаймовой заливке */
  --primary-bg: #181818;    /* главная кнопка на светлом: чернила */
  --primary-fg: #f4f3ee;
  --ok: #8FB400;
  --warn: #b7791f;
  --bad: #c0392b;
  --shadow: 0 8px 24px rgba(24,24,24,.05);
  --radius: 18px;
  --glow: none;
}
:root[data-theme="dark"] {
  --bg: #181818;            /* чернила */
  --bg-2: #222221;          /* графит */
  --card: rgba(34,34,33,.86);
  --line: rgba(244,243,238,.1);
  --text: #f4f3ee;          /* бумага */
  --muted: #9a9a93;
  --lime: #CCFE00;
  --on-accent: #181818;
  --primary-bg: #CCFE00;    /* главная кнопка на тёмном: лайм */
  --primary-fg: #181818;
  --ok: #CCFE00;
  --warn: #e0a84a;
  --bad: #e06c5c;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  --glow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #181818; --bg-2: #222221; --card: rgba(34,34,33,.86); --line: rgba(244,243,238,.1);
    --text: #f4f3ee; --muted: #9a9a93; --lime: #CCFE00; --on-accent: #181818;
    --primary-bg: #CCFE00; --primary-fg: #181818; --ok: #CCFE00; --warn: #e0a84a; --bad: #e06c5c;
    --shadow: 0 8px 24px rgba(0,0,0,.35); --glow: none;
  }
}

/* приветствие при открытии: тишина → «Endless» → внешнее кольцо → внутреннее → точка → пауза → приложение.
   Знак собран из обычных элементов (кольца — рамки), анимируются только прозрачность и масштаб: на iPhone это
   идёт ровно. Размеры — геометрия знака (brand/README.md: 200 → 212 единиц) в поле 140px, 1 ед. = 0.66px. */
.app, .fab { transition: opacity .5s ease; }
.splash { position: fixed; inset: 0; z-index: 100; background: #181818; color: #f4f3ee; display: flex; align-items: center; justify-content: center;
  transition: opacity .5s cubic-bezier(.4,0,.2,1); will-change: opacity; }
.splash.out { opacity: 0; pointer-events: none; }
.splash .scene { display: flex; flex-direction: column; align-items: center; gap: 30px; transform: translateY(-4vh); }
.splash .mark { position: relative; width: 140px; height: 140px; }
.splash .mark i { position: absolute; display: block; border-radius: 50%; opacity: 0; }
.splash .r1 { left: 0.3px; top: 0.3px; width: 139.3px; height: 139.3px; border: 7.3px solid currentColor; transform: scale(.94); }
.splash .r2 { left: 23.8px; top: 4.5px; width: 92.4px; height: 92.4px; border: 10.6px solid currentColor; transform: scale(.94); }
.splash .dot, .splash .halo { left: 48.9px; top: 12.4px; width: 42.2px; height: 42.2px; background: #CCFE00; }
.splash .dot { transform: scale(.6); }
.splash .word { font-family: "Montserrat Brand", Montserrat, Inter, sans-serif; font-weight: 600; font-size: 30px; letter-spacing: .3em; padding-left: .3em; opacity: 0; }
/* тайминг: тишина → «Endless» → кольцо → кольцо → точка → пауза → переход (Армен 07.11: 2,5 с вместе с угасанием, ритм 28.10 × 0,53) */
.splash.play .word { animation: word .6s cubic-bezier(.16,1,.3,1) .15s forwards; }
.splash.play .r1 { animation: ring .48s cubic-bezier(.16,1,.3,1) .75s forwards; }
.splash.play .r2 { animation: ring .45s cubic-bezier(.16,1,.3,1) 1.1s forwards; }
.splash.play .dot { animation: dot .35s cubic-bezier(.16,1,.3,1) 1.45s forwards; }
.splash.play .halo { animation: halo .6s ease-out 1.5s forwards; }
.splash.still .word, .splash.still .r1, .splash.still .r2, .splash.still .dot { opacity: 1; transform: none; letter-spacing: .04em; }
@keyframes word { to { opacity: 1; letter-spacing: .04em; } }
@keyframes ring { to { opacity: 1; transform: scale(1); } }
@keyframes dot { to { opacity: 1; transform: scale(1); } }
@keyframes halo { 0% { opacity: .4; transform: scale(1); } 100% { opacity: 0; transform: scale(2.4); } }

/* Inter лежит у нас (Inter-LICENSE.txt, OFL): ни запроса к Google, ни адреса человека у него; армянский идёт системным шрифтом, как раньше */
@font-face { font-family: Inter; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/fonts/inter-cyrillic-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: Inter; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/fonts/inter-cyrillic-wght-normal.woff2") format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: Inter; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/fonts/inter-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: Inter; font-style: normal; font-display: swap; font-weight: 100 900; src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* подпись знака — только Montserrat 600 (brand/README.md), шрифт под лицензией OFL в static/fonts */
@font-face { font-family: "Montserrat Brand"; src: url("/fonts/Montserrat-600.ttf") format("truetype"); font-weight: 600; font-display: swap; }
.brand > span:not(.orb):not(.ver) { font-family: "Montserrat Brand", Montserrat, Inter, sans-serif; font-weight: 600; letter-spacing: -.01em; }
.brand.big { font-family: "Montserrat Brand", Montserrat, Inter, sans-serif; font-weight: 600; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100vw; }
body {
  font-family: Inter, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
h3 { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
/* новый экран рисуется невидимым поверх старого и подменяет его одним кадром (app.js show, 10.11) */
.card.od-none { display: none; }  /* «Не закрыто» без строк — блока нет (календарь, 10.11) */
.view.view-pending { position: absolute; visibility: hidden; pointer-events: none; top: 0; left: 0; }
body.nav-pending .view:not(.hidden), body.nav-pending .fab:not(.agent) { pointer-events: none; }
.mobile-only { display: none; }

.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 22px 16px;
  display: flex; flex-direction: column; gap: 18px;
  border-right: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 60%, transparent);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand.big { font-size: 24px; justify-content: center; margin-bottom: 14px; }
.ver { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: auto; }
.orb { display: inline-flex; width: 22px; height: 22px; color: var(--text); }
.orb svg { width: 100%; height: 100%; }
.brand.big .orb { width: 32px; height: 32px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a, .bottom a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  color: var(--muted); font-weight: 500; cursor: pointer; transition: .15s;
}
.nav a i, .bottom a i { font-style: normal; width: 18px; text-align: center; opacity: .8; }
.nav a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.nav a.active, .bottom a.active { color: var(--text); background: color-mix(in srgb, var(--text) 10%, transparent); }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.logout { color: var(--muted); font-size: 13px; }
.theme {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  cursor: pointer; display: grid; place-items: center; color: var(--text); font-size: 16px;
}
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .moon { display: inline; }
:root[data-theme="dark"] .theme .sun { display: none; }

.main { padding: 26px 32px 90px; max-width: 1180px; width: 100%; }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.hello { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
/* шапка всех экранов, кроме «Сегодня»: название экрана вместо приветствия и даты, одна линия с кнопками, ниже прежней */
.top-title { display: none; font-size: 22px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.top-plain .top-title { display: block; }
body.top-plain .hello, body.top-plain .date { display: none; }
body.top-plain .top { margin-bottom: 14px; }
.top-actions .avatar { width: 44px; height: 44px; }  /* аватар в шапке крупнее кнопок (Армен 12.11: 44 px) */
/* Вариант Г (Армен 13.11), все экраны, кроме «Сегодня»: аватар 52, кнопки 44, название по центру оставшегося места,
   размер один на всех экранах (--top-fz считает fitTopTitle по самому длинному названию), одной строкой */
body.top-plain .top { gap: 10px; min-height: 52px; }  /* на «Профиле» аватара нет: высота та же, название не прыгает */
body.top-plain .top > div:first-child { flex: 1 1 auto; display: flex; justify-content: center; }
body.top-plain .top-title { font-size: var(--top-fz, 26px); line-height: 1.1; letter-spacing: -.03em; text-align: center; max-width: 100%; }
body.top-plain .top-actions { gap: 10px; flex: 0 0 auto; }
body.top-plain .top-actions .avatar { width: 52px; height: 52px; font-size: 20px; }
body.top-plain .top-actions > button:not(.avatar) { width: 44px; height: 44px; }
body.top-plain .top-actions > button:not(.avatar) svg { width: 22px; height: 22px; }
body.top-profile #avatar-btn { display: none; }
body.top-plain.top-profile .top > div:first-child { margin-right: 62px; }  /* место аватара (52 + 10) пустое: название на «Профиле» не сдвигается вбок (rev4) */
/* широкий экран: страница прокручивается целиком, у длинных экранов появлялась полоса 15 px, шапка сужалась и название
   вставало в двух точках (rev4 13.11) — место под полосу держим всегда */
@media (min-width: 861px) { html { scrollbar-gutter: stable; } }
body.in-gchat .top, body:has(#view-groups:not(.hidden) .g-top) .top { display: none; }  /* в чате группы шапка приложения не нужна: «назад» и название — в полосе чата, высота — чату (Армен 12.11).
   Вторая половина правила — вся открытая группа (вкладки «Цели», «Задачи»…): полоса группы общая и не должна прыгать при смене вкладки */
body.top-plain .set-screen-title { display: none; }  /* «Настройки» уже названы в шапке — второй раз не повторяем */
.top > div:first-child { min-width: 0; }
.date { color: var(--muted); margin-top: 2px; }

.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.stats { grid-template-columns: repeat(4, 1fr); }
.span2 { grid-column: span 2; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); backdrop-filter: blur(10px);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head.head-seg-below { flex-wrap: wrap; }
.card-head.head-seg-below > .seg { flex: 1 0 100%; order: 3; }  /* кнопка «＋ …» всегда справа от названия, период – строкой ниже */
.card-head h3 { margin: 0; }
.stat { padding: 16px 18px; }
.stat .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat .sub.money-sub { white-space: normal; overflow-wrap: normal; word-break: normal; }
.stat .value.ok { color: var(--ok); } .stat .value.bad { color: var(--bad); }

.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px;
  background: color-mix(in srgb, var(--bg-2) 55%, transparent); border: 1px solid var(--line); }
.row .ic { width: 22px; text-align: center; flex: none; }
.row .t { flex: 1; min-width: 0; }
.row .t .s { color: var(--muted); font-size: 12px; }
.row .r { color: var(--muted); font-size: 13px; white-space: nowrap; }
.row .r.money { color: var(--text); font-weight: 600; }
.row.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.row.bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.row.done { opacity: .55; }
/* плоская строка (Армен 30.10, здоровье): заголовок на всю ширину, значение справа в той же строке,
   подпись и кнопки — строкой ниже; текст не ужимается в узкий столбец между значком, значением и кнопками */
.row.flat { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "ic t r" "ic s a";
  column-gap: 10px; row-gap: 4px; align-items: start; }
.row.flat .ic { grid-area: ic; margin-top: 1px; }
.row.flat .t { display: contents; }
.row.flat .t > div:first-child { grid-area: t; min-width: 0; }
.row.flat .t .s { grid-area: s; align-self: center; min-width: 0; }
.row.flat .r { grid-area: r; white-space: nowrap; margin-top: 1px; }
.row.flat .acts { grid-area: a; margin: 0; justify-self: end; align-self: center; }
.row.flat .acts:has(.mini.ic) { margin: 0; }
/* стрелка «›» (12.11, жалоба Армена): во всех строках — последняя колонка справа, по центру строки, не переносится;
   число/время — слева от неё. Плоская строка — своя колонка сетки на оба ряда, обычная — край flex-ряда */
.row.flat:has(> .go) { grid-template-columns: 22px minmax(0, 1fr) auto auto; grid-template-areas: "ic t r g" "ic s a g"; }
.row.flat.click > .go { grid-area: g; align-self: center; margin: 0; white-space: nowrap; }
span.go { white-space: nowrap; }  /* «›» не переносится на вторую строку ни в одном месте */
.row.click > .a { flex: none; white-space: nowrap; text-align: right; }  /* строка-ссылка «сумма ›» (drillLink): число и стрелка вместе, справа */
.empty { color: var(--muted); font-size: 13px; padding: 6px 2px; }
.boot-wait { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 92px); z-index: 9999; max-width: calc(100vw - 32px); padding: 6px 12px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: center; pointer-events: none; }
/* длинное слово и большая сумма остаются в своей карточке: кнопка «⋯» не уезжает за экран */
.tl .t, .acc .v, .goal .title, .habit .head > div, .habit .name, .row .t, .g-card .title { min-width: 0; overflow-wrap: anywhere; }
.stat .value { overflow-wrap: anywhere; }
.stat .value .value-tail { white-space: nowrap; overflow-wrap: normal; }
.stat, .acc { min-width: 0; }  /* подпись «Потрачено сегодня» не рвётся посреди слова */
@media (max-width: 360px) {
  .accounts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .acc .n { flex-wrap: wrap; }
  .card-head { flex-wrap: wrap; }
  .period-nav { max-width: 100%; min-width: 0; }
  .period-nav .period-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .grid.stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .grid.stats .stat { padding: 10px; }
  .grid.stats .stat .value { font-size: 15px; }
  .spent-nav { gap: 2px; }
  .spent-nav .mini { padding: 0 4px; }
}
@media (max-width: 760px) { .foot { padding-bottom: 96px; } }  /* подвал уходит выше плавающих кнопок */
.card.load-fail { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.chip.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.chip.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.chip.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
:root[data-theme="dark"] .chip.warn { color: var(--warn); }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar { }
.bar .l { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.bar .l b { font-weight: 600; }
.bar .track { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.bar .fill { height: 100%; border-radius: 999px; background: var(--lime); transition: width .4s; }
.bar .fill.warn { background: var(--warn); }
.bar .fill.bad { background: var(--bad); }
.bar .fill.ok { background: var(--lime); }

.chart { position: relative; height: 240px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.month { font-weight: 600; min-width: 150px; text-align: center; }
.pill, .seg button {
  border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; font: inherit; font-size: 13px;
}
.seg { display: flex; gap: 6px; }
.seg button.active { background: var(--text); border-color: transparent; color: var(--bg); font-weight: 600; }
.input { border: 1px solid var(--line); background: var(--bg-2); color: var(--text); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 13px; width: 260px; max-width: 100%; }
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.table td.income { color: var(--ok); }

.goal { display: flex; flex-direction: column; gap: 10px; }
.goal .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.goal .title { font-weight: 600; font-size: 16px; }
.goal .meta { color: var(--muted); font-size: 13px; }
.goal .big { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.goal .ring { width: 72px; height: 72px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; flex: 0 0 72px;
  background: conic-gradient(var(--lime) calc(var(--p) * 1%), color-mix(in srgb, var(--text) 8%, transparent) 0); }
.goal .ring span { width: 56px; height: 56px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
/* .gtop, не .top: у .top общие правила шапки приложения (body.top-plain .top > div:first-child { flex: 1 1 auto; display: flex }) растягивали и сжимали кольцо по длине названия – замер стенда 14.11: ширина 31…185 px при высоте 72 */
.goal .gtop { display: flex; align-items: center; gap: 16px; margin: 0; }
.goal .gtop > div:last-child { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; padding-right: 36px; }   /* справа поверх карточки кнопка «⋯» (margin −30): название не уходит под неё (rev4 14.11, 360 px) */

.day { margin-bottom: 14px; }
.day h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.day.today h4 { color: var(--text); }

.habit { margin-bottom: 14px; }
/* ---------- большие экраны: сетки на широком (Армен 16.11: «справа пустое поле»): списки карточек встают в 2–3 колонки, когда в колонке 1180 есть место.
   Колонка не уже 340 – карточка цели и документа читается как на телефоне; только ≥ 861 px */
@media (min-width: 861px) {
  #goals-list, #doc-list, #watch-list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
}
@media (min-width: 1200px) {
  #hab-list, #cal-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
  #hab-list > .habit, #cal-days > .day { margin-bottom: 0; }
}
/* ---------- конец: большие экраны */
.habit .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.habit .name { font-weight: 600; }
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(14px, 1fr)); gap: 4px; }
.heat .c { aspect-ratio: 1; border-radius: 4px; background: color-mix(in srgb, var(--text) 7%, transparent); cursor: pointer; position: relative; }
.heat .c::before { content: ""; position: absolute; inset: -2px; }  /* зона нажатия на зазор: ≈19 px, вид тот же (Ревизор 4) */
.heat .c.d { background: var(--lime); }
.heat .c.p { background: color-mix(in srgb, var(--lime) 45%, transparent); }
.heat .c.off { opacity: .25; }
.heat .c.z { display: grid; place-items: center; background: color-mix(in srgb, var(--text) 10%, transparent); }
.heat .c.z::after { content: "⏸\FE0E"; font-size: 9px; line-height: 1; color: color-mix(in srgb, var(--text) 65%, transparent); }
.heat .c.f { opacity: .5; }

.note { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--bg-2) 55%, transparent); border: 1px solid var(--line); margin-bottom: 8px; }
.note .h { font-weight: 600; display: flex; justify-content: space-between; gap: 10px; }
.note .b { color: var(--muted); font-size: 13px; white-space: pre-wrap; margin-top: 4px; }

.foot { color: var(--muted); font-size: 12px; text-align: center; margin-top: 24px; }
.bottom { display: none; }
.toast { position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%); background: #1c1c1e; color: #f4f3ee; border: 1px solid rgba(244, 243, 238, .14);   /* всегда тёмная: в тёмной теме var(--text) давал белую плашку, лаймовое «Вернуть» на ней не читалось (Армен 18.11) */
  padding: 10px 16px; border-radius: 12px; font-size: 13px; box-shadow: var(--shadow); z-index: 90; }  /* над карточкой (.sheet 60): иначе ответ кнопки в карточке не виден (Армен 03.11) */
.toast .toast-act { position: relative; margin-left: 12px; min-height: 32px; padding: 6px 14px; border: 0; border-radius: 999px; background: #CCFE00; color: #181818; font: inherit; font-weight: 600; cursor: pointer; }
.toast .toast-act::after { content: ""; position: absolute; inset: -6px -4px; }   /* зона нажатия 44 px при видимой кнопке 32 (rev4b, хвост a6421e4) */   /* кнопка, а не текст: тёмное на лаймовом ~15:1 */

body.center { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login { max-width: 420px; text-align: center; }
.login p { margin: 8px 0; }

@media (max-width: 860px) {
  /* Прокручивается не страница, а .main: на iPhone (экран «Домой», iOS 26) fixed-панель снизу «взлетала» при
     прокрутке страницы. Страница теперь неподвижна, нижней панели нечему сдвигаться. */
  html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
  /* страницы без приложения (/privacy, /terms, /guide) листаются как обычная страница: иначе на телефоне они не прокручивались */
  html:has(> body > main.legal), html:has(> body > main.legal) > body { height: auto; overflow: visible; overscroll-behavior: auto; }
  .app { grid-template-columns: 1fr; height: 100%; height: 100dvh; height: var(--app-h, 100dvh); min-height: 0; }   /* min-height: 100vh из общего правила (большое окно: iOS 735 при видимых 695, Pixel 810 при 753) держал .app и .main выше видимого – замер облака 14.11 */   /* --app-h: см. app.js (fit), когда dvh больше видимого окна */
  .main { height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; box-sizing: border-box; }
  body.in-chat .main { overflow: hidden; }
  .side { display: none; }
  .mobile-only { display: grid; }
  .main { padding: 18px 16px calc(254px + env(safe-area-inset-bottom)); }   /* кнопка ассистента: низ 162 + высота 84 + 8 – последняя строка выше неё */


  .hello { font-size: 22px; }
  .grid.two, .grid.stats { grid-template-columns: 1fr 1fr; }
  .span2 { grid-column: span 2; }
  .bottom {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
    background: var(--bg-2); overflow-x: auto;
  }
  /* полупрозрачная с размытием – только где размытие есть; иначе непрозрачная. iOS 15 не знает ни color-mix, ни backdrop-filter без -webkit-: color-mix с var()
     не отбрасывается при разборе, а сбрасывает фон в прозрачный – панель была прозрачной, текст «Денег» шёл по подписям вкладок (облако, iPhone 13 Mini, 20.11) */
  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) and (background: color-mix(in srgb, red 50%, transparent)) {
    .bottom { background: color-mix(in srgb, var(--bg-2) 85%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
  }
  /* пункты одной ширины, значок в квадрате 30 px по центру, подпись одной строкой — ровно по вертикали и горизонтали */
  .bottom a { flex: 0 0 min(78px, calc((100% - 14px) / 5)); width: min(78px, calc((100% - 14px) / 5)); min-width: 0; flex-direction: column; justify-content: flex-start; gap: 3px;
    padding: 5px 0; font-size: min(11px, 3.05vw); line-height: 14px; white-space: nowrap; }   /* первые 5 пунктов целиком на любой ширине от 320 (ширина по окну, подпись ужимается), справа торчит край 6-го – знак, что меню листается (облако Galaxy S25 360 dp 15.11: 5-й «Кален…» был обрезан при фиксированных 78 px) */
  .bottom a > span { display: block; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }   /* подпись никогда не налезает на соседа: не влезла – «…», а длинные слова сокращены ключами common.nav.* */
  .bottom a i { width: 30px; height: 30px; display: grid; place-items: center; font-size: 24px; }
  .bottom a i .ico { width: 30px; height: 30px; }
  .bottom a i .emark { font-size: 26px; }
  .chart { height: 200px; }
}
@media (max-width: 520px) {
  .grid.two, .grid.stats { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .stat .value { font-size: 20px; }
  .input { width: 100%; }
}

/* счета */
.accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.acc { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.acc .n { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.acc .n .chip { align-self: flex-start; flex: none; }  /* имя счёта в две строки растягивало «основной» в бледный круг (аудит 02.11) */
/* Армен 08.11: «Сберб/анк» — плашка «основной» в той же строке съедала ширину, а имя рвалось посреди слова (overflow-wrap: anywhere).
   Теперь плашка — строкой над именем, имя переносится только по словам; одно длинное слово — мельче и с «…», без разрыва */
.acc .n { flex-wrap: wrap; row-gap: 4px; }
.acc .n .chip { order: -1; }
.acc .n > span { flex: 1 1 100%; min-width: 0; overflow-wrap: normal; word-break: normal; hyphens: none; }
.acc .n > span.long { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.acc .s { font-size: 12px; color: var(--muted); }
.acc .track { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; margin-top: 4px; }
.acc .track .fill { height: 100%; background: var(--lime); }
.acc.total { background: color-mix(in srgb, var(--text) 6%, transparent); }
/* документы */
.doc { display: flex; flex-direction: column; gap: 6px; }
.doc .h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.doc .title { font-weight: 600; }
.doc a.open { align-self: flex-start; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.doc a.open:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
/* медкарта */
.episode .visits { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.visit { border-left: 3px solid var(--line); padding-left: 10px; }
.visit .s { font-size: 13px; color: var(--muted); }
.ind { font-size: 12px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.section-title { margin: 18px 4px 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* действия */
.row .acts { display: flex; gap: 6px; margin-left: 8px; flex-shrink: 0; }
.mini { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 999px; padding: 4px 10px;
  font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
a.mini { text-decoration: none; display: inline-block; }
.mini:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
/* кнопка-значок в строке: квадрат 30 px под палец, значок 16 px; корзина краснеет только при наведении */
.mini.ic { width: 30px; height: 30px; padding: 0; display: inline-grid; place-items: center; color: var(--muted); }
.mini.ic .ico { width: 16px; height: 16px; vertical-align: 0; }
.mini.ic:hover { color: var(--text); }
.mini.ic.danger:hover { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.row .acts:has(.mini.ic) { gap: 4px; margin-left: 4px; }
/* Строка с кнопками (Армен 01.11: почта в «Google» залезала под «Сверить»). Длинное слово без пробелов — почта, ссылка,
   номер — переносится, а не вылезает за свой столбец. Текст не уже ROW_TEXT_MIN: не помещаются рядом — кнопки уходят
   второй строкой вправо (на телефоне — почти всегда для текстовых кнопок, на широком экране — в одну строку). */
.row .t, .own-row > span:first-child { overflow-wrap: anywhere; }
.own-row > span:first-child { min-width: 0; }
.own-row > span:last-child { flex: none; white-space: nowrap; }
.row:not(.flat):has(> .acts) { flex-wrap: wrap; row-gap: 8px; }
.row:not(.flat):has(> .acts) > .t { flex: 1 1 0; min-width: 8em; }  /* ROW_TEXT_MIN */
.row:not(.flat):has(> .acts) > .acts { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
/* Платежи: одна раскладка у всех строк (Армен 13.11): название и сумма справа в первой строке, «Оплачено» – всегда второй строкой и слева,
   под названием: по длине имени кнопка не прыгает вверх-вниз и не ложится под кнопку ассистента у правого края */
#fin-payments .row:not(.flat):has(> .acts) > .acts, #ov-payments .row:not(.flat):has(> .acts) > .acts { flex: 1 0 100%; margin-left: 0; justify-content: flex-start; }
tr.click { cursor: pointer; }
tr.click:hover td { background: color-mix(in srgb, var(--text) 5%, transparent); }
.fab { position: fixed; right: 20px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%; border: 0; z-index: 45;
  background: var(--bg-2); color: var(--text); font-size: 28px; cursor: pointer; border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(24,24,24,.25); }  /* «добавить» — тихая; лаймовая только одна: помощник */
@media (max-width: 860px) { .fab { bottom: calc(94px + env(safe-area-inset-bottom)); } }
/* просмотр документа внутри приложения */
.viewer { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: var(--bg); }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.viewer-bar .x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: 18px; cursor: pointer; flex: none; }
.viewer-bar .t { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; align-items: center; touch-action: pan-x pan-y pinch-zoom; }
.viewer-body img { width: 100%; max-width: 900px; border-radius: 8px; background: #fff; }
.viewer-body iframe { flex: 1; width: 100%; min-height: 100%; border: 0; border-radius: 8px; background: #fff; }
body.viewing { overflow: hidden; }
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.sheet-card { position: relative; width: min(520px, 100%); max-height: 88vh; overflow: auto; background: var(--bg-2, var(--bg));
  border-radius: 20px 20px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 861px) { .sheet { align-items: center; } .sheet-card { border-radius: 20px; } }
/* шторка: открытие – подъём снизу 260 мс (кривая выдвижной панели) и подложка проявляется; закрытие – копия уезжает вниз за 280 мс вместе с подложкой (closeSheet в app.js). Анимации не гасим по prefers-reduced-motion (решение Армена 24.10) */
.sheet.sheet-in .sheet-card { animation: sheet-up .26s cubic-bezier(.32, .72, 0, 1) backwards; }
.sheet.sheet-in .sheet-bg { animation: sheet-fade .22s ease-out backwards; }
#sheet-body.page-wait { pointer-events: none; }   /* подэкран собирается (page() в app.js): прежнее содержимое не нажимается */
.sheet-ghost { pointer-events: none; z-index: 59; }   /* под новой шторкой (60), если та открылась, пока копия ещё уезжает */
/* закрытие – ОДНО движение (жалоба Армена 19.11, запись iPhone: карточка пропадала на полпути, подложка гасла потом и рывком): карточка и подложка – одна
   длительность и одна кривая, подложка гаснет ровно в такт уходу карточки; 280 мс ease-out – на записи 10 кадров/с видно 52 % → 88 % → конец, а не «половина → пусто».
   Копию убирает transitionend подложки (app.js sheetGhostBuild, SHEET_OUT_MS) */
.sheet-ghost .sheet-card { transition: transform .28s cubic-bezier(0, 0, .58, 1), opacity .28s cubic-bezier(0, 0, .58, 1); }
.sheet-ghost .sheet-bg { transition: opacity .28s cubic-bezier(0, 0, .58, 1); }
.sheet-ghost.go .sheet-card { transform: translateY(100%); }
.sheet-ghost.go .sheet-bg { opacity: 0; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 861px) { .sheet.sheet-in .sheet-card { animation-name: sheet-pop; } .sheet-ghost.go .sheet-card { opacity: 0; transform: translateY(14px) scale(.98); } }
.sheet-card h3 { margin: 0; }
.sheet-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.sheet-card label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.sheet-card .input { width: 100%; font-size: 16px; padding: 10px 12px; }
.sheet-card .pair { display: flex; gap: 8px; } .sheet-card .pair .input:last-child { max-width: 120px; }
/* время и дата в паре — во всю половину: 120 px резали «08:00 AM» до «08:00 A» в en (обход 04.11) */
.sheet-card .pair .input[type=time]:last-child, .sheet-card .pair .input[type=date]:last-child { max-width: none; }
.seg.wide { display: flex; } .seg.wide button { flex: 1; }
.seg.hours { gap: 4px; } .seg.hours button { min-width: 0; padding-left: 0; padding-right: 0; font-variant-numeric: tabular-nums; }  /* «День заканчивается в»: 6 кнопок в 375 px */
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.pill.primary { background: var(--primary-bg); color: var(--primary-fg); border-color: transparent; }
.pill.danger { color: var(--bad, #e5484d); }

.sheet-card .input { min-width: 0; }
.sheet-card input[type=date], .sheet-card input[type=time] { -webkit-appearance: none; appearance: none; text-align: left; min-height: 44px; }
.sheet-card .pair > * { flex: 1 1 0; min-width: 0; }
.mini.on { background: var(--lime); color: var(--on-accent); border-color: transparent; }
.doc .links { display: flex; gap: 14px; flex-wrap: wrap; }
.doc .links button.open { background: none; border: 0; padding: 0; font: inherit; color: var(--text); cursor: pointer; }  /* без цвета кнопка брала системный чёрный — в тёмной теме не видно (аудит 02.11) */

/* телефон: ничего не шире экрана */
.app > *, .main, .grid > *, .card, .view { min-width: 0; }
.chart canvas { max-width: 100%; }
@media (max-width: 860px) { .app { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) {
  .grid.stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid.stats .stat { padding: 12px 14px; }
  .grid.stats .stat .sub { font-size: 11px; }
  .stat .label { font-size: 10.5px; }
  .stat .value { font-size: 18px; }
  .card { padding: 14px 14px; }
  .accounts { grid-template-columns: 1fr 1fr; gap: 8px; }
  .acc { padding: 10px 11px; }
  .acc .v { font-size: 16px; }
  .chart { height: 260px; }
  .card-head { flex-wrap: wrap; }
  .period-nav { max-width: 100%; min-width: 0; }
  .period-nav .period-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}
/* операции списком */
.ops { display: flex; flex-direction: column; }
.op { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.op .d { color: var(--muted); font-size: 12px; width: 40px; flex: none; }
.op .t { flex: 1; min-width: 0; }
.op .c { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op .s { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op .a { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.op .a.income { color: var(--ok); }
.op .s .refund, .s.refund { color: var(--ok); }  /* «вернули 10 400» у траты, «возврат за» у возврата */
.op .a .charge, .charge-line { color: var(--muted); font-weight: 500; }
.op .a .charge { display: block; font-size: 12px; text-align: right; }
.charge.est, .charge-line.est { font-style: italic; }
.charge-line { margin: 8px 0; }
.click { cursor: pointer; }
/* потрачено за день */
.spent-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 6px; }
.spent-nav span { order: -1; flex: 1 0 100%; min-width: 0; text-align: left; text-wrap: balance; }   /* подпись на своей строке целиком (по словам, без переноса внутри слова); стрелки ‹ › строкой ниже, не перекрывают текст при любой ширине плитки и крупном шрифте (облако 14.11, Galaxy S25) */
.spent-nav .mini { padding: 0 8px; line-height: 20px; flex: none; }
/* списки */
.row.todo { align-items: flex-start; }
.row.todo .check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: none; color: var(--on-accent); flex: none; cursor: pointer; font-size: 12px; line-height: 1; padding: 0; margin-top: 1px; }
.row.todo .check.on { background: var(--lime); border-color: var(--lime); }
.row.todo.done .t > div:first-child { text-decoration: line-through; }
.star { color: var(--warn); letter-spacing: 1px; }
.stars { display: flex; gap: 6px; }
.stars button { background: none; border: 0; font-size: 28px; color: color-mix(in srgb, var(--text) 20%, transparent); cursor: pointer; padding: 0; }
.stars button.on { color: var(--warn); }
textarea.input { resize: vertical; font-family: inherit; }
/* дни привычки */
.field { display: flex; flex-direction: column; gap: 8px; }
.flabel { font-size: 13px; color: var(--muted); }
.wd { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wd button { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 10px; padding: 9px 0; font: inherit; font-size: 13px; cursor: pointer; }
.wd button.on { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.quick { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* профиль */
.top-actions { display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); padding: 0; overflow: hidden;
  background: var(--text); color: var(--bg); font-weight: 700; font-size: 16px; cursor: pointer; display: grid; place-items: center; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.big { width: 88px; height: 88px; font-size: 34px; }
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.profile-head .who { min-width: 0; flex: 1; }
.profile-head .name { font-size: 20px; font-weight: 700; }
.pf-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pill.primary { background: var(--primary-bg); color: var(--primary-fg); border: 0; }
.pf-text { white-space: pre-wrap; font-size: 13px; line-height: 1.5; }
#pf-anketa .row .s { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }

/* вход по коду из бота (приложение на телефоне) */
.code-form { display: flex; gap: 8px; justify-content: center; margin: 14px 0 6px; }
.input.code { width: 180px; flex: 0 1 180px; min-width: 0; font-size: 22px; letter-spacing: .12em; text-align: center; padding: 10px 8px; font-variant-numeric: tabular-nums; }
.code-form > .pill { flex: none; white-space: nowrap; }   /* «Войти» / «Sign in» в одну строку и на 320 px: поле кода (8 цифр) сжимается, кнопка нет */
.login .small { font-size: 12px; }

/* ---------- помощник: разговор в приложении */
/* знак Endless как значок: размер задаёт font-size (1em = ширина знака), геометрия — brand/README.md */
.emark { position: relative; display: inline-block; width: 1em; height: 1em; vertical-align: middle; }
.emark i { position: absolute; display: block; border-radius: 50%; }
.emark .r1 { left: .2%; top: .2%; width: 99.5%; height: 99.5%; border: .052em solid currentColor; }
.emark .r2 { left: 17%; top: 3.2%; width: 66%; height: 66%; border: .076em solid currentColor; }
.emark .dot { left: 34.9%; top: 8.9%; width: 30.1%; height: 30.1%; background: var(--lime); }
.nav a i .emark { font-size: 17px; }
.nav a.active .emark .dot, .bottom a.active .emark .dot { background: var(--lime); }
/* кнопка помощника — знак бренда: в 1,5 раза больше «＋» (84 px), тёмный знак (белые кольца, лаймовая точка) на любом фоне */
.fab.agent { transition: bottom .22s cubic-bezier(.2,.8,.2,1), opacity .5s ease; }  /* «+» есть не на всех экранах: ✦ переезжает плавно, а не прыжком (10.11) */
.fab.agent { right: var(--fab-edge, 14px); bottom: 92px; width: var(--fab-size, 84px); height: var(--fab-size, 84px); background: #181818; color: #f4f3ee; font-size: 44px;
  border: 1.5px solid color-mix(in srgb, #CCFE00 55%, transparent); display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .2s ease, opacity 1.3s ease; }
.fab.agent .emark .dot { background: #CCFE00; }
.fab.agent > .emark { position: absolute; inset: 0; margin: auto; }  /* знак строго по центру круга без опоры на grid у <button>: на iPhone 14 / iOS 17 при display:grid знак уезжал вправо на полширины (кадр Координатора 15.11, продукт/скриншоты/2026-11-15-путь-iphone14-ios17) */
/* ✦ в текстах (тур, подсказки, лесенка «Сегодня») — маленькая копия кнопки ассистента: чёрный круг, логотип, лаймовая точка
   (Армен 01.11: «должен быть наш логотип, чтобы было понятно, что на этот круг нужно нажать»; tour.js endlessMark) */
.t-mark { display: inline-grid; place-items: center; width: 1.55em; height: 1.55em; border-radius: 50%; background: #181818; color: #f4f3ee;
  border: 1.5px solid #CCFE00; vertical-align: -.42em; margin: 0 .08em; line-height: 1; }
.t-mark .emark { font-size: .9em; vertical-align: 0; }
.t-mark .emark .dot { background: #CCFE00; }
.fab.agent:active { transform: scale(.95); }
/* кнопка ассистента — над шторкой (.sheet 60), просмотром (.viewer 70), фото группы (.g-viewer 80); под тостом и входом (90), заставкой (100).
   Всегда на своём месте (Армен 12.11): уступает шторка — ряд действий получает отступ справа под кнопку, под последним полем — запас */
#fab-chat { z-index: 85; transition: bottom .22s cubic-bezier(.2,.8,.2,1), width .2s ease, height .2s ease, font-size .2s ease, transform .2s ease, opacity 1.3s ease; }  /* клавиатура: 84 → 64 px и обратно плавно, без скачка */
body.fab-sheet .sheet-card { padding-bottom: calc(var(--fab-size, 84px) + var(--fab-bot, 92px) + var(--fab-gap, 10px) + env(safe-area-inset-bottom)); scroll-padding-bottom: calc(var(--fab-size, 84px) + var(--fab-bot, 92px) + var(--fab-gap, 10px)); }  /* ничего под кнопкой в конце прокрутки; запас – из размеров и места кнопки (--fab-bot), а не из замера от низа шторки: в установленном приложении iOS 26 низ шторки и низ окна расходятся, и ряд «Закрыть» вставал ниже кнопки, а строки со суммами – под неё (Армен 18.11) */
body.fab-sheet .sheet-card:has(> .sheet-actions:last-child) { padding-bottom: max(18px, var(--fab-bot, 92px)); }  /* ряд действий — на уровне кнопки, левее неё */
body.fab-sheet .sheet-card > .sheet-actions:last-child { min-height: var(--fab-size, 84px); align-items: center; flex-wrap: wrap; padding-right: max(0px, calc(var(--fab-ov, 0px) - 18px)); box-sizing: border-box; }
/* клавиатура открыта (не разговор): кнопка справа внизу над клавиатурой (--kb-lift считает app.js по visualViewport); запас снизу — экрану и шторке */
body.kb-open #fab-chat.fab.agent { bottom: calc(12px + var(--kb-lift, 0px)); translate: none; width: var(--fab-kb, 64px); height: var(--fab-kb, 64px); font-size: calc(var(--fab-kb, 64px) * .52); }
body.form-page.kb-open #fab-chat.fab.agent { bottom: auto; top: 0; will-change: transform; }  /* форма-страница: место по visualViewport задаёт app.js свойством translate на самой кнопке (композитор, без layout) */
body.kb-open .main { scroll-padding-bottom: calc(var(--kb-lift, 0px) + var(--fab-kb, 64px) + 28px); }
body.kb-open .main { padding-bottom: calc(var(--kb-lift, 0px) + var(--fab-kb, 64px) + 28px); }
@media (max-width: 860px) { .fab.agent { bottom: calc(162px + env(safe-area-inset-bottom)); } }  /* ОДНО место на всех экранах (Армен: «всегда на одном месте», решение 14.11): над «＋»; на экранах без «＋» место «＋» пустое, кнопка не прыгает при смене вкладки */
.chat-view { display: flex; flex-direction: column; height: calc(100vh - 160px); min-height: 320px; position: relative; }
.chat-down { position: absolute; right: 8px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); box-shadow: var(--shadow); display: grid; place-items: center; padding: 0; cursor: pointer; }
.chat-down svg { width: 20px; height: 20px; }
.chat-list { flex: 1; overflow-y: auto; padding: 6px 2px 12px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.chat-list .day { align-self: center; font-size: 11px; color: var(--muted); background: color-mix(in srgb, var(--bg-2) 70%, transparent); padding: 3px 10px; border-radius: 999px; margin: 8px 0 2px; }
.msg { max-width: min(78%, 560px); padding: 9px 12px 6px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); touch-action: pan-y; transition: transform .15s; user-select: none; -webkit-user-select: none; }
.msg .b { white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.4; user-select: text; -webkit-user-select: text; }
.msg .b a { color: inherit; text-decoration: underline; }
.g-lang { margin-top: 4px; }
.g-lang-text { color: var(--muted); font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; margin-bottom: 2px; }
.g-lang-btn { background: none; border: 0; padding: 4px 0; color: var(--muted); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.msg.me { align-self: flex-end; background: var(--text); color: var(--bg); border-color: transparent; border-bottom-right-radius: 6px; }
.msg.me .meta { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.msg.me .quote { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.msg.ai { align-self: flex-start; border-bottom-left-radius: 6px; }
.msg .meta { font-size: 10px; color: var(--muted); text-align: right; margin-top: 3px; display: flex; gap: 6px; justify-content: flex-end; }
.msg .quote { font-size: 12px; color: var(--muted); border-left: 2px solid var(--lime); padding: 2px 8px; margin: 0 0 6px; border-radius: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.msg.flash { box-shadow: 0 0 0 2px var(--lime); }
.msg.typing .b { color: var(--muted); font-size: 13px; }
.msg.typing.streaming .b { color: inherit; font-size: 15px; }  /* ответ потоком — как обычный пузырь */
.dots i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--lime); margin-right: 3px; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chat-empty { margin: auto; max-width: 420px; text-align: center; }
.chat-reply { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); padding: 6px 10px; border-left: 2px solid var(--lime); background: var(--card); border-radius: 0 10px 10px 0; margin: 6px 0 0; }
.chat-reply .q { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.chat-reply .x { border: 0; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 8px 0 0; }
.composer .input { flex: 1; width: auto; font-size: 16px; padding: 10px 12px; resize: none; max-height: 140px; line-height: 1.35; border-radius: 16px; }
.composer .mic, .composer .send { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 18px; cursor: pointer; flex: none; touch-action: none; -webkit-user-select: none; user-select: none; }
.composer .send { background: var(--primary-bg); color: var(--primary-fg); border: 0; }
.composer .send:disabled { opacity: .5; }
/* голос: коснись — запись (кнопка становится ■ с кольцом громкости «слышу»), коснись — стоп; поле правится по ходу */
.composer .mic { width: 56px; height: 56px; font-size: 24px; position: relative; transition: transform .15s ease, box-shadow .08s linear; }
/* кнопка голоса — знак Endless (геометрия как у знака, brand/README.md). Во время записи знак дышит по пути:
   гаснет снаружи внутрь (внешнее кольцо → среднее → точка) и возвращается изнутри наружу — пока идёт запись */
.composer .mic .mk { position: relative; display: block; width: 30px; height: 30px; margin: auto; }
.composer .mic .mk i { position: absolute; display: block; border-radius: 50%; }
.composer .mic .r1 { left: .2%; top: .2%; width: 99.5%; height: 99.5%; border: 1.6px solid currentColor; }
.composer .mic .r2 { left: 17%; top: 3.2%; width: 66%; height: 66%; border: 2.3px solid currentColor; }
.composer .mic .dot { left: 34.9%; top: 8.9%; width: 30.1%; height: 30.1%; background: var(--lime); }
.composer .mic.rec { border-color: var(--lime); transform: scale(1.12);
  box-shadow: 0 0 0 calc(3px + var(--lvl, 0) * 16px) color-mix(in srgb, var(--lime) 26%, transparent); }
.composer .mic.rec .r1 { animation: mk-outer 3.6s ease-in-out infinite; }
.composer .mic.rec .r2 { animation: mk-mid 3.6s ease-in-out infinite; }
.composer .mic.rec .dot { animation: mk-dot 3.6s ease-in-out infinite; }
@keyframes mk-outer { 0%, 8% { opacity: 1; } 22%, 80% { opacity: 0; } 94%, 100% { opacity: 1; } }
@keyframes mk-mid { 0%, 22% { opacity: 1; } 36%, 66% { opacity: 0; } 80%, 100% { opacity: 1; } }
@keyframes mk-dot { 0%, 36% { opacity: 1; } 48%, 54% { opacity: 0; } 66%, 100% { opacity: 1; } }
.composer.recording .input { border-color: var(--lime); }
.composer .attach { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; flex: none; touch-action: manipulation; }
.composer { position: relative; }
.attach-menu { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 30; display: flex; flex-direction: column; min-width: 260px; padding: 6px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.attach-menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--text); font-size: 15px; cursor: pointer; }
.attach-menu button:active, .attach-menu button:hover { background: var(--bg-2); }
.attach-menu button span { font-size: 12px; color: var(--muted); }
.chat-files .att .raw { position: absolute; left: 3px; bottom: 3px; font-style: normal; font-size: 10px; padding: 1px 5px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; }
/* вложения над полем: сразу карточка, шкала загрузки; в ленте — миниатюры фото */
.chat-files .atts { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; width: 100%; }
.chat-files .att { position: relative; flex: none; width: 92px; display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; background: transparent; height: auto; }
.chat-files .att .pic { position: relative; width: 92px; height: 92px; border-radius: 12px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.chat-files .att .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-files .att .doc { width: 92px; height: 92px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; box-sizing: border-box; }
.chat-files .att .doc .ic { font-size: 26px; } .chat-files .att .doc .nm { font-size: 11px; line-height: 1.2; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-all; }
.chat-files .att .bar { height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.chat-files .att .bar i { display: block; height: 100%; background: var(--lime); transition: width .2s; }
.chat-files .att.ok .bar { visibility: hidden; } .chat-files .att.err .bar i { background: var(--bad); width: 100% !important; }
.chat-files .att .st { font-size: 11px; color: var(--muted); text-align: center; }
.chat-files .att.err .st { color: var(--bad); }
.chat-files .att.wait .st { color: var(--muted); } .chat-files .att.wait .bar i { width: 0 !important; }  /* ждёт сеть: тихо, без красного */
.chat-files .att.up .pic img, .chat-files .att.up .doc { opacity: .65; }
.msg .mpics { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 4px; margin-bottom: 6px; max-width: 300px; }
.msg .mbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg .mthumb { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.chat-files { display: block; padding: 8px 0 0; flex: none; }
.chat-files .att button { position: absolute; top: 4px; right: 4px; z-index: 2; width: 28px; height: 28px; padding: 0; box-sizing: border-box; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }   /* ✕ строго по центру круга: flex, без сдвига шрифтом/полями кнопки (Армен 14.11) */
.chat-files .att button svg { display: block; width: 14px; height: 14px; margin: 0; flex: none; }
.chat-files .att button::before { content: ""; position: absolute; inset: -8px; }   /* зона нажатия 44 px при круге 28 */
.composer .cancel { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font-size: 16px; cursor: pointer; flex: none; touch-action: manipulation; }
.composer.voiced .cancel { display: block; }
.composer.hearing .input { animation: hearing 1.2s ease-in-out infinite; }
@keyframes hearing { 0%, 100% { border-color: var(--line); } 50% { border-color: var(--lime); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
body.in-chat .foot { display: none; }
/* клавиатура открыта в разговоре: шапка и нижняя панель уходят, поле ввода — над клавиатурой */
body.in-chat.kb .top, body.in-chat.kb .bottom, body.in-chat.kb .fab { display: none; }
body.in-chat.kb .main { padding-top: 6px; padding-bottom: 6px; }
body.in-chat { overflow: hidden; }
@media (display-mode: standalone) { body { padding-top: env(safe-area-inset-top); } }

/* путь, зашитый в знак (профиль) */
.path { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.path .st { padding: 12px; border-radius: 14px; border: 1px solid var(--line); }
.path .st .n { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.path .st .t { font-weight: 600; margin: 4px 0; }
.path .st .d { font-size: 12px; color: var(--muted); line-height: 1.4; }
.path .st.peak { border-color: var(--lime); }
.path .st.peak .n { color: var(--lime); }
@media (max-width: 860px) { .path { grid-template-columns: 1fr 1fr; } }
.brand-note { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0 0 12px; }
.path .st[data-stage] { cursor: pointer; transition: .15s; }
.path .st[data-stage]:hover { border-color: var(--text); }
.path .st.me { background: color-mix(in srgb, var(--text) 8%, transparent); border-color: var(--text); }
.path .st.me .t::after { content: " · я здесь"; font-size: 11px; color: var(--muted); font-weight: 500; }
.path .st.peak.me { border-color: var(--lime); }

/* «Сегодня»: фокус, хронология, вечер */
.focus .input { width: 100%; font-size: 17px; font-weight: 600; padding: 10px 12px; border-radius: 12px; }
.focus .small { font-size: 12px; margin-top: 6px; }
.timeline { display: flex; flex-direction: column; }
.tl { display: flex; gap: 10px; align-items: flex-start; padding: 7px 2px; border-bottom: 1px solid var(--line); }
.tl:last-child { border-bottom: 0; }
.tl .tm { width: 44px; flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.tl .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; margin-top: 7px; }
.tl.done .dot, .tl.habit .dot { background: var(--lime); }
.tl.event .dot { background: var(--text); }
.tl .t { flex: 1; min-width: 0; }
.tl .t .s { font-size: 12px; color: var(--muted); }
.tl .r { font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl.done .t > div:first-child { text-decoration: line-through; color: var(--muted); }
.tl.reminder .t { color: var(--muted); font-size: 13px; }

/* поле разговора как в Claude: текст во всю ширину сверху и растёт вместе с речью (до половины экрана),
   кнопки — строкой под ним: «+» слева, ✕ · голос · отправить справа */
.composer { flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid var(--line);
  border-radius: 22px; background: var(--bg-2); flex: none; }  /* колонка разговора не сжимает композер: иначе кнопки ложатся на текст */
.composer .input { order: -1; flex: 1 1 100%; width: 100%; max-height: 50vh; min-height: 44px; border: 0; background: transparent;
  padding: 6px 6px 2px; font-size: 17px; line-height: 1.4; overflow-y: auto; }
.composer .input:focus { outline: none; }
.composer .input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer .attach { margin-right: auto; }
.composer.recording { border-color: var(--lime); }
.composer.recording .input { border-color: transparent; }
/* микрофон крупнее соседних кнопок (+30%), при записи — ещё +20% */
.composer .mic { width: 62px; height: 62px; }
.composer .mic .mk { width: 38px; height: 38px; }
.composer .mic.rec { transform: scale(1.2); transform-origin: center; }
.composer.hearing { animation: hearing 1.2s ease-in-out infinite; }
.composer.hearing .input { animation: none; }

/* документ в разговоре */
.msg .fcard { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px; border: 1px solid var(--line);
  border-radius: 14px; background: color-mix(in srgb, var(--bg) 60%, transparent); flex-wrap: wrap; }
.msg .fcard .fic { font-size: 20px; }
.msg .fcard .fn { flex: 1 1 120px; font-weight: 600; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.msg .fcard .mini { text-decoration: none; }

.chat-files .rawtoggle { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 2px 4px 6px; }
.chat-files .rawtoggle input { width: 18px; height: 18px; }
.chat-files .rawtoggle .rt { flex: 1; min-width: 0; }  /* подпись и пояснение — одним абзацем, а не двумя колонками (Galaxy, облако 15.11) */
.chat-files .rawtoggle input, .chat-files .rawtoggle .ico { flex: none; }

/* ---------- Endless: вход (код из ассистента / Telegram Mini App), страница «о данных», тариф, push */
.login-wrap { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: var(--bg); overflow: auto; }
.login-wrap .card.login { width: 100%; }
#frozen .frozen-acts { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 6px; }   /* экран возврата: три действия столбиком, нажатие ≥ 44 px */
#frozen .frozen-acts .pill { min-height: 44px; width: 100%; }
#frozen .frozen-acts .link.danger { min-height: 44px; background: none; border: 0; font: inherit; font-size: 15px; color: var(--bad); cursor: pointer; }
.login .error { color: var(--bad); min-height: 1.2em; }
.brand .mark { font-size: 22px; line-height: 1; display: inline-flex; }
.brand.big .mark { font-size: 32px; }
.legal { max-width: 680px; margin: 0 auto; padding: 24px 16px 60px; line-height: 1.6; }
.legal h1 { font-size: 24px; }
.legal h3 { font-size: 16px; margin: 24px 0 6px; }
.legal li { margin: 4px 0; }
.legal .brand { margin-bottom: 8px; }
.guide .guide-lang { margin: 0 0 4px; }
.guide .guide-toc { margin: 8px 0 24px; }
.guide .guide-toc ol { padding-left: 22px; }
.guide h2 { font-size: 20px; margin: 36px 0 8px; scroll-margin-top: 12px; }
.guide .guide-shot { margin: 14px 0; }
.guide .guide-shot img[src^="/install/"] { max-width: 220px; }
.guide .guide-shot img { display: block; width: 100%; max-width: 375px; height: auto; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--text) 10%, transparent); }
.plan-line { font-size: 13px; color: var(--muted); }
.plan-line.warn { color: var(--warn); }
.help-box { white-space: pre-wrap; font-size: 13px; line-height: 1.5; margin: 6px 0 10px; }
.push-hint { font-size: 12px; color: var(--muted); margin-top: 8px; }
.links-list { display: flex; flex-direction: column; gap: 2px; }
.links-list a, .links-list button.link { display: block; text-align: left; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: none;
  color: var(--text); font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; }
.links-list .danger { color: var(--bad); }
.side-foot button.logout { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }

/* карточка привычки: справа — плашки (дней / частично / серия / пауза) и под ними кнопки ↑ ↓ ⋯ одним рядом */
.habit .head { align-items: flex-start; gap: 10px; }
.habit .hside { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; max-width: 48%; }
.habit .hchips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.habit .hbtns { display: flex; flex-wrap: nowrap; gap: 6px; }
.habit .hbtns .mini { min-width: 38px; }

/* голос поверх экрана: держишь знак помощника 2 с — запись; полоса с текстом речи внизу во всю ширину,
   экран над ней остаётся твоим; касание знака — помощник выполняет, экран обновляется на глазах */
.fab.agent { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* удержание знака — голос: ничего не выделяется и меню «Копировать» не всплывает (iPhone, Android) */
/* поля ввода — никогда: в iPhone user-select:none на textarea запрещает и набор текста (Армен 28.10: «текст не вводится») */
body.voice-hold, body.voice-hold *:not(input):not(textarea):not([contenteditable]) { -webkit-user-select: none !important; user-select: none !important; -webkit-touch-callout: none !important; }
body.voice-hold input, body.voice-hold textarea, body.voice-hold [contenteditable] { -webkit-user-select: text !important; user-select: text !important; }  /* иначе наследуют none от body */
.vbar .vhead, .vbar button, .vbar .vtext { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.fab, .fab * { -webkit-tap-highlight-color: transparent; }
.fab.agent.arming { animation: arming .45s linear forwards; }
@keyframes arming { from { box-shadow: 0 0 0 0 color-mix(in srgb, #CCFE00 0%, transparent); } to { box-shadow: 0 0 0 10px color-mix(in srgb, #CCFE00 45%, transparent); } }
.fab.agent.rec .emark .r1 { animation: mk-outer 3.6s ease-in-out infinite; }
.fab.agent.rec .emark .r2 { animation: mk-mid 3.6s ease-in-out infinite; }
.fab.agent.rec .emark .dot { animation: mk-dot 3.6s ease-in-out infinite; }
/* голос в карточке (человек): знак помощника в шапке карточки, как на остальных экранах */
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-head h3 { margin: 0; }
/* знак голоса в карточке — на привычном месте (внизу справа, как на экранах), поверх карточки; при записи — над полосой текста */
.vmic { display: none !important; }  /* второй знак задваивал кнопку ассистента (19.11): голос карточки человека запускает сам #fab-chat, элемент остаётся целью клика */
.vmic .emark { font-size: 44px; }
.vmic .emark .dot { background: #CCFE00; }
.vmic.rec { border-color: #CCFE00; box-shadow: 0 0 0 6px rgba(204,254,0,.18); animation: vpulse 1.4s ease-in-out infinite; }
@keyframes vpulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(204,254,0,.15); } 50% { box-shadow: 0 0 0 10px rgba(204,254,0,.28); } }
body.quick .vbar { z-index: 84; }   /* над просмотром документа (.viewer 70), карточкой первого дня (.fd-sheet 70) и фото группы (.g-viewer 80), под кнопкой ассистента (85): запись голосом поверх них видна, а не вслепую (аудит 3c, К2) */
/* голос из карточки: карточка закрывает нижнее меню — полоса текста прямо у нижнего края */
@media (min-width: 861px) { .vmic { right: 24px; } }
/* блок записи — внизу на всю ширину, прямо над нижним меню (решение Армена 12.11: «окошко внизу, кнопка ассистента над ним справа»);
   текст — 2 строки. Знак ассистента над блоком: где он и так выше (162 px) — не двигается, где блок его задел бы (94 px, клавиатура) —
   chat.js (fabLift) поднимает его ровно настолько, чтобы встать над блоком с зазором 10 px, и возвращает после записи */
.vbar { position: fixed; left: 12px; right: 12px; bottom: calc(94px + env(safe-area-inset-bottom)); height: auto; min-height: 0;
  z-index: 44; background: var(--bg-2); color: var(--text); border: 1.5px solid #CCFE00; border-radius: 18px; padding: 3px 6px 3px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "st bt" "tx bt";
  align-items: center; column-gap: 6px; }
@media (min-width: 861px) { .vbar { bottom: 24px; left: auto; width: 520px; } }
.vbar .vhead { display: contents; }
.vbar #vbar-status { grid-area: st; min-width: 0; font-size: 11px; line-height: 1.15; color: var(--muted); }  /* подпись не обрезается: на узком телефоне переносится */
.vbar .vbtns { grid-area: bt; display: flex; align-items: center; gap: 2px; }
.vbar .vtext { grid-area: tx; height: calc(2 * 1.25em); overflow-y: auto; font-size: 14px; line-height: 1.25; white-space: pre-wrap; padding-right: 6px; }  /* две строки, новое всегда видно (scrollTop вниз) */
.vbar .vx { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.vbar .vx .ico { width: 20px; height: 20px; }
/* правка на месте: нажал на текст блока — он становится полем, блок растёт до 4 строк; запись идёт (решение Армена 12.11) */
.vbar .vta { grid-area: tx; display: none; width: 100%; box-sizing: border-box; height: calc(4 * 1.25em); min-height: 0; margin: 0; padding: 0; border: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 14px; line-height: 1.25; resize: none; outline: none; }
.vbar.typing .vta { display: block; }
.vbar.typing .vtext { display: none; }
.vbar .vtext { cursor: text; }
#vbar-shield { position: fixed; inset: 0; z-index: 83; background: transparent; touch-action: none; }  /* первое касание вне блока только убирает клавиатуру */
/* голос из карточки: карточка закрывает нижнее меню — блок прямо у нижнего края */
body.quick:has(.sheet:not(.hidden)) .vbar { bottom: calc(12px + env(safe-area-inset-bottom)); }
body.quick .fab:not(.agent) { display: none; }


/* компактность: свёрнутые блоки, «показать все», период платежей */
h3.coll { cursor: pointer; user-select: none; -webkit-user-select: none; }
/* стрелка одна на все карточки (Армен 13.11: «свёрнутые маленькие и непонятные, стрелка ▸ мелкая»): шеврон ⌃/⌄ справа, как у коротких */
h3.coll::after { content: "\2303"; display: inline-block; float: right; margin-left: 8px; font-size: 18px; font-weight: 700; line-height: 1; color: inherit; transition: transform .15s ease; }
/* одна и та же стрелка в обоих состояниях (Армен 13.11: «у свёрнутой тонкая и бледная, у раскрытой жирная — нравится жирная»): у свёрнутой и пустой просто повёрнута */
.card.collapsed h3.coll::after, .card.nodata:not(.nodata-open) h3.coll::after { transform: rotate(180deg); }
.card-head, .card-pv, .card.collapsed, .card.nodata:not(.nodata-open) { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.card-head:has(> h3.coll), .card.collapsed, .card.nodata:not(.nodata-open) { cursor: pointer; }
/* заголовок и стрелка не разрываются (Армен 11.11: «Итог месяца» + выбор месяца — стрелка уезжала на вторую строку): при нехватке места сжимается то, что справа */
/* шапка карточки одна в обоих состояниях (Армен 13.11: «строка должна быть неизменной, стрелка всегда справа»): название и
   стрелка — своя строка во всю ширину, стрелка в правом углу; управление шапки («＋ …», ‹ месяц ›, периоды, список/график) —
   строкой ниже и только у раскрытой */
.card-head:has(> h3.coll) { flex-wrap: wrap; justify-content: flex-start; row-gap: 10px; }
.card .card-head:has(> h3.coll) > h3.coll { flex: 1 0 100%; min-width: 0; white-space: normal; order: 0; }  /* .card впереди — сильнее правила короткой карточки [data-preview] */
.card-head:has(> h3.coll) > :not(h3) { order: 2; }
.card-head > h3.coll ~ * { min-width: 0; }
.card.collapsed > *:not(h3):not(.card-head):not(.card-pv):not(.card-keep) { display: none !important; }  /* .card-keep — главное действие карточки остаётся видимым в короткой */
.card.collapsed > .card-keep { margin-top: 10px; }
.card.collapsed > .card-head > *:not(h3) { display: none !important; }
.card.collapsed { padding-bottom: 12px; }
.card.collapsed > h3, .card.collapsed > .card-head { margin-bottom: 0; }
/* карточка без данных: заголовок + «пока пусто» одной строкой, подсказка — по нажатию */
.card.nodata:not(.nodata-open) > *:not(h3):not(.card-head) { display: none !important; }
.card.nodata:not(.nodata-open) > .card-head > *:not(h3) { display: none !important; }
.card.nodata:not(.nodata-open) { padding-bottom: 16px; }  /* верх как у обычной карточки — стрелка не прыгает на 2 px при открытии */
.card.nodata:not(.nodata-open) > h3, .card.nodata:not(.nodata-open) > .card-head { margin-bottom: 0; }
.nd-cap { margin-left: 10px; font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
/* короткие разделы (Армен 12.11): у свёрнутой карточки с превью — заголовок, строка превью, шеврон справа */
.card-pv { display: none; margin-top: 6px; font-size: 14px; color: var(--muted); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }  /* одна строка */
.card.collapsed > .card-pv { display: block; }
.card[data-preview] > h3.coll, .card[data-preview] > .card-head > h3.coll { flex: 1 1 auto; white-space: normal; }
.more-btn { display: block; width: 100%; margin-top: 8px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 12px;
  background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-align: center; }
.accounts > .more-btn { grid-column: 1 / -1; }
.seg.sm { gap: 4px; flex-wrap: wrap; }
.seg.sm button { padding: 4px 9px; font-size: 12px; }

/* iPhone приближает страницу, если шрифт поля меньше 16px, — на телефонах поля всегда 16px, экран не прыгает */
@media (pointer: coarse) { .input, input, textarea, select { font-size: 16px !important; } }


/* диктовка: весь текст поля + хвост-черновик лежат слоем поверх textarea (voice.js VoiceField), своё поле рисует прозрачным */
textarea.voice-field { color: transparent; -webkit-text-fill-color: transparent; caret-color: var(--text); }
textarea.voice-field::placeholder { color: var(--muted); -webkit-text-fill-color: var(--muted); }
textarea.voice-field.has-tail::placeholder { color: transparent; -webkit-text-fill-color: transparent; }
.voice-mirror { position: absolute; z-index: 1; box-sizing: border-box; margin: 0; overflow: hidden; pointer-events: none; border-style: solid; border-color: transparent; background: none; color: var(--text); white-space: pre-wrap; overflow-wrap: break-word; }
.voice-tail { color: var(--muted); font-style: italic; }
.voice-note { color: var(--muted); font-size: .85em; }
.vbar .draft { color: var(--muted); font-style: italic; }

/* дневник */
.jr-text { width: 100%; min-height: 72px; font-size: 15px; line-height: 1.45; resize: vertical; }
.jr-row { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; }
.jr-row .pill.rec { background: var(--lime); color: #181818; border-color: transparent; }
.jr-scores { display: flex; flex-wrap: wrap; gap: 14px 22px; margin: 10px 0; }
.jr-scores .seg button { min-width: 34px; }
.jr-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.jr-fields .input { width: 100%; }
.jr-entry { padding: 10px 2px; border-bottom: 1px solid var(--line); }
.jr-entry:last-child { border-bottom: 0; }
.jr-entry .h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.jr-entry .b { white-space: pre-wrap; font-size: 14px; line-height: 1.5; }
.jr-entry .tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }
.jr-entry .tags span { color: var(--muted); }
.jr-entry .tags b { font-weight: 500; color: var(--text); }
@media (max-width: 720px) { .jr-fields { grid-template-columns: 1fr; } }
#view-journal .small { font-size: 12px; }
.jr-head-r { display: inline-flex; align-items: center; gap: 8px; }
#jr-cal-btn.on { background: var(--lime); color: var(--on-accent); border-color: transparent; }
.jr-cal { margin: 0 0 12px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.jr-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.jr-cal-nav .mini[disabled] { opacity: .3; }
.jr-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 8px; }
.jr-cal-grid .w { text-align: center; font-size: 11px; color: var(--muted); padding: 2px 0; }
.jr-cal-grid .d { position: relative; aspect-ratio: 1; min-height: 36px; border: 1px solid transparent; border-radius: 10px; background: transparent;
  color: var(--text); font: inherit; font-size: 13px; cursor: pointer; display: flex; align-items: flex-start; justify-content: center; padding-top: 6px; }
.jr-cal-grid .d i { position: absolute; left: 50%; bottom: 6px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--lime); }
.jr-cal-grid .d.now { border-color: var(--line); font-weight: 700; }
.jr-cal-grid .d.sel { background: var(--text); color: var(--bg); font-weight: 700; }
.jr-cal-grid .d.sel i { background: var(--lime); opacity: 1 !important; }
.jr-cal-grid .d[disabled] { opacity: .3; cursor: default; }
.jr-hint { margin: 8px 0 0; }
.jr-day-link { cursor: pointer; color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--muted); }
.jr-sum-card .card-head { flex-wrap: wrap; }
.jr-sum-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; font-size: 14px; }
.jr-sum-nav .mini { min-width: 36px; flex: none; }
.jr-sum-nav .period-label { min-width: 0; flex: 0 1 auto; overflow: hidden; }  /* «›» не уезжает за край карточки на 375 px (аудит 02.11) */
@media (max-width: 400px) { .jr-sum-nav { gap: 6px; } .jr-sum-nav .period-label { padding: 6px 9px; font-size: 13px; } }
.jr-sum-nav .mini[disabled] { opacity: .3; }
.jr-sum-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
.jr-sum-stats > div { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.jr-sum-stats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.jr-sum-stats b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.jr-sum-stats em { font-style: normal; font-size: 12px; color: var(--muted); min-height: 15px; }
.jr-bars { display: flex; gap: 3px; align-items: flex-end; margin: 14px 0 4px; }
.jr-bars .b { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font: inherit; }
.jr-bars .b[disabled] { opacity: .35; cursor: default; }
.jr-bars .col { width: 100%; height: 64px; display: flex; gap: 1px; align-items: flex-end; justify-content: center;
  border-radius: 6px; background: color-mix(in srgb, var(--text) 5%, transparent); overflow: hidden; }
.jr-bars .col i { display: block; width: 45%; max-width: 12px; border-radius: 3px 3px 0 0; }
.jr-bars i.m, .jr-legend i.m { background: var(--lime); }
.jr-bars i.e, .jr-legend i.e { background: color-mix(in srgb, var(--text) 45%, transparent); }
.jr-bars small { font-size: 10px; }
.jr-legend { display: flex; gap: 14px; font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.jr-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.jr-best { font-size: 13px; margin: 6px 0 4px; }
.jr-best a { cursor: pointer; border-bottom: 1px dotted var(--muted); }
.jr-sub { margin: 14px 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.jr-themes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.jr-themes .chip { background: color-mix(in srgb, var(--lime) 22%, transparent); }
.jr-set { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; font-size: 13px; }
.jr-set .input { width: 160px; }
/* ---------- Группы (groups.js) ---------- */
.g-card { cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.g-card .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.g-card .title, .g-title .title { font-weight: 600; font-size: 16px; }
.g-card .meta, .g-title .meta { color: var(--muted); font-size: 13px; }
.g-last { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-last b { color: var(--text); font-weight: 600; }
.g-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--lime); color: #181818; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.g-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.g-title { flex: 1; min-width: 0; }
.g-title .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-tabs { margin-bottom: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.g-tabs button { flex: none; }
.g-chat { display: flex; flex-direction: column; height: calc(100vh - 290px); min-height: 320px; position: relative; }
.g-list { flex: 1; }
.g-who { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.msg.g-bot { border-color: color-mix(in srgb, var(--lime) 55%, var(--line)); }
.g-sys { align-self: center; max-width: 90%; text-align: center; font-size: 12px; color: var(--muted); background: color-mix(in srgb, var(--bg-2) 70%, transparent); padding: 4px 12px; border-radius: 12px; }
.g-reply { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 6px 2px 0; }
.g-reply .q { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-check { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 14px; }
@media (max-width: 760px) { .g-chat { height: calc(100vh - 330px); } }
body.in-gchat #fab-chat, body.in-gchat .foot { display: none; }

/* «Я заметил» на экране «Сегодня» */
.insight #ins-text { margin: 4px 0 12px; font-size: 15px; line-height: 1.5; }
.insight .ins-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* таймеры и секундомер поверх экранов (timer.js): над содержимым и нижним меню, под карточками (sheet 60) и полосой
   голоса. Каждое окошко само по себе: стопка справа сверху (.tmr-dock) или свободно где оставили (.free, translate3d);
   сворачивается в свою пилюлю; тащится за верх карточки или пилюлю */
.tmr-layer { position: fixed; inset: 0; z-index: 43; pointer-events: none; }
.tmr-layer.hidden { display: none; }
.tmr-dock { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; width: min(300px, calc(100vw - 24px));
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px; border-radius: 20px; transition: box-shadow .15s; }
.tmr-dock { max-height: calc(100dvh - 170px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.tmr-dock::-webkit-scrollbar { display: none; }
.tmr-dock.target { box-shadow: 0 0 0 2px color-mix(in srgb, var(--lime) 55%, transparent); }
.tmr-w { pointer-events: auto; width: 100%; }
.tmr-w.min { width: auto; }
.tmr-w.free { position: absolute; left: 0; top: 0; width: min(300px, calc(100vw - 24px)); will-change: transform; }
.tmr-w.free.min { width: auto; }
.tmr-w.dragging { z-index: 2; transition: none; }
.tmr-w.dragging .tmr-card, .tmr-w.dragging .tmr-pill { box-shadow: 0 18px 44px rgba(0,0,0,.45); transform: scale(1.03); }
.tmr-h, .tmr-pill { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.tmr-h { cursor: grab; }
.tmr-w.dragging .tmr-h, .tmr-w.dragging .tmr-pill { cursor: grabbing; }
.tmr-card { position: relative; background: var(--bg-2); color: var(--text); border: 1.5px solid var(--lime); border-radius: 18px; padding: 10px 12px 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); touch-action: manipulation; transition: transform .12s, box-shadow .12s; }
.tmr-card::before { content: ""; position: absolute; left: 50%; top: 5px; width: 32px; height: 4px; margin-left: -16px; border-radius: 2px;
  background: color-mix(in srgb, var(--text) 22%, transparent); pointer-events: none; }
.tmr-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); min-height: 28px; }
.tmr-h span { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmr-h .tmr-b.x + .tmr-b.x { margin-left: -4px; }
.tmr-big { font-size: 44px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; margin: 2px 0 8px; }
.tmr-bar { height: 5px; border-radius: 999px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; margin-bottom: 10px; }
.tmr-bar i { display: block; height: 100%; background: var(--lime); transition: width .25s linear; }
.tmr-row { display: flex; gap: 8px; }
.tmr-b { min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--text); font: inherit; font-size: 16px; cursor: pointer; flex: 1; }
.tmr-b.main, .tmr-b.fin { background: var(--lime); color: var(--on-accent); border-color: transparent; font-weight: 600; }
/* текст кнопок — в одну строку внутри кнопки: пауза — только значок (узкая), «Закончить» — шире остальных */
.tmr-row .tmr-b { display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; padding: 0 10px; min-width: 0; }
.tmr-row .tmr-b.main, .tmr-row .tmr-b.ic { flex: 0 0 52px; padding: 0; }
.tmr-card.done .tmr-row .tmr-b.main { flex: 1 1 0; padding: 0 12px; }  /* «Готово» у прозвеневшего — со словом, не узкая */
.tmr-row .tmr-b.fin { font-size: 20px; font-weight: 700; }  /* «Завершить» — лаймовая с галочкой, одинаково у таймера и секундомера */
.tmr-row .tmr-b .ic, .tmr-row .tmr-b svg { flex: none; }
.tmr-b.x { flex: 0 0 auto; min-width: 44px; min-height: 44px; padding: 0; margin: -8px -8px -8px 0; border: 0; color: var(--muted); font-size: 18px; }
.tmr-b.off { opacity: .4; }
.tmr-b:active { transform: scale(.96); }
.tmr-laps { list-style: none; margin: 10px 0 0; padding: 0; max-height: 140px; overflow-y: auto; font-size: 14px; font-variant-numeric: tabular-nums; }
.tmr-laps li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.tmr-laps li span { color: var(--muted); }
.tmr-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; max-width: calc(100vw - 24px); padding: 0 16px;
  border-radius: 999px; border: 1.5px solid var(--lime); background: var(--bg-2); color: var(--text); font: inherit; font-size: 17px; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.3); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.tmr-pill em { font-style: normal; font-weight: 500; font-size: 14px; color: var(--muted); max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.tmr-pill.paused { border-style: dashed; }
.tmr-w.alarm .tmr-pill { animation: tmr-flash 1s ease-in-out infinite; }
.tmr-card.done { animation: tmr-flash 1s ease-in-out infinite; }
.tmr-card.done .tmr-big { font-size: 36px; }
@keyframes tmr-flash { 0%, 100% { background: var(--bg-2); } 50% { background: #CCFE00; color: #181818; } }
/* плашка «идёт тренировка» — окошко той же стопки: упражнение, подход, отсчёт отдыха, «+ как прошлый», «Закончить» */
.wkc [data-wkmin] { font-style: normal; }
.wkc .wk-name { font-size: 17px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.wkc .wk-sub { font-size: 13px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.wkc .wk-rest { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 6px; font-size: 15px; color: var(--muted); }
.wkc .wk-rest b { font-size: 34px; line-height: 1; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
/* «отдых закончен» мигает одной строкой, а не всей плашкой: на лаймовой вспышке кнопки и серый текст не читались (стенд, тёмная тема) */
.tmr-card.wkc.done { animation: none; }
.wkc .wk-over { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 44px; margin: 8px 0; padding: 0 10px; border: 0; border-radius: 12px; animation: tmr-flash 1s ease-in-out infinite; background: transparent; color: inherit; font: inherit; font-size: 22px; font-weight: 700; text-align: left; }
.wkc .tmr-row { margin-top: 10px; }
.wkc .tmr-row .tmr-b { flex: 1 1 0; }
.wkc .tmr-row .tmr-b.main { flex: 1.3 1 0; padding: 0 10px; }
.wkc .wk-restset { display: block; width: 100%; min-height: 44px; margin: 4px 0 -8px; padding: 0; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; text-align: left; }
@media (min-width: 861px) { .tmr-dock { right: 24px; top: 16px; } }

/* будильник (alarm.js) */
.alarm-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line, rgba(127,127,127,.15)); }
.alarm-row:first-child { border-top: 0; }
.alarm-row .t { flex: 1; min-width: 0; }
.alarm-time { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; }
.alarm-row > .muted.small { flex: 0 1 40%; text-align: right; }  /* «Set it in Clock for 7:00 AM» не отжимает время в две строки */
.alarm-row a.pill { text-decoration: none; }
.alarm-steps { padding-left: 20px; margin: 8px 0 12px; line-height: 1.5; }
.alarm-steps li { margin-bottom: 6px; }
.alarm-link { display: flex; gap: 8px; margin: 8px 0 4px; }
.alarm-link .input { flex: 1; min-width: 0; font-size: 13px; }
.alarm-note { position: fixed; left: 50%; bottom: calc(106px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9999;
  background: var(--primary-bg); color: var(--primary-fg); padding: 10px 16px; border-radius: 14px; font-size: 14px; max-width: calc(100vw - 32px); }

/* видимый низ экрана (app.js visibleBottom): нижнее меню и кнопки — над ним на любом устройстве */
@media (max-width: 860px) {
  .bottom { bottom: var(--vb-gap, 0px); padding-bottom: calc(6px + max(env(safe-area-inset-bottom), var(--tg-safe-bottom, 0px))); }
  .fab { translate: 0 calc(-1 * var(--vb-gap, 0px)); }
}

/* Мини-приложение Telegram (iOS WebView): закреплённая панель с размытием фона иногда не рисует содержимое до
   перерисовки (иконки меню пропадали, появлялись с клавиатурой) — без размытия, на своём слое */
body.in-telegram .bottom { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg-2); transform: translateZ(0); }

/* экран владельца — расходы (app.js ownerSheet) */
.own-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.own-tile { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.own-v { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.own-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.own-person { padding: 8px 0; border-top: 1px solid var(--line); }

/* чат группы (groups.js gFit): высоту задаёт скрипт по видимой области; набор текста — меню, шапка и вкладки прячутся */
body.in-gchat.kb .top, body.in-gchat.kb .bottom, body.in-gchat.kb .fab, body.in-gchat.kb .g-tabs { display: none; }
body.in-gchat.kb .main { padding-top: 6px; padding-bottom: 6px; }
/* кнопка голоса в группе — знак Endless, как в разговоре с помощником */

/* чат группы (Армен 28.10): поле — как у помощника (.composer), «＋» фото и файлы, знак Endless: касание — диктовка,
   удержание — голосовое (полоса записи вместо поля, влево — отмена, вверх — без рук), «@» — подсказка с ассистентом */
.g-chat .g-list { min-height: 0; }
.g-chat > :not(.g-list) { flex: none; }
.g-comp .mic { -webkit-touch-callout: none; }
.g-comp.vrec .input { display: none; }
.g-comp.vrec .attach { visibility: hidden; }
.g-comp.vrec { border-color: var(--lime); }
.g-comp.vrec:not(.locked) .mic { transform: translateX(var(--slide, 0px)) scale(1.2); transition: box-shadow .08s linear; }
.g-vrec { order: -1; flex: 1 1 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px; font-size: 15px; }
.g-vrec.hidden { display: none; }
.g-vrec .rd { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); flex: none; animation: blink 1.2s infinite; }
.g-vrec .tm { font-variant-numeric: tabular-nums; font-weight: 600; flex: none; }
.g-vrec .lv { flex: 1; min-width: 30px; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--text) 12%, transparent); overflow: hidden; }
.g-vrec .lv i { display: block; height: 100%; width: 8%; background: var(--lime); transition: width .1s linear; }
.g-vrec .hint { flex: 0 1 auto; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-files { padding-top: 6px; }
.g-chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 0; -webkit-overflow-scrolling: touch; }
.g-chips.hidden { display: none; }
.g-chips button { flex: none; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); border-radius: 999px; padding: 7px 12px; font-size: 14px; cursor: pointer; }
.g-chips button:first-child { border-color: color-mix(in srgb, var(--lime) 60%, var(--line)); }
/* меню сообщения (msgmenu.js): реакции + действия; поверх всего, в пределах видимой области */
.msg-menu { position: fixed; z-index: 58; display: flex; flex-direction: column; min-width: 220px; max-width: calc(100vw - 16px); padding: 6px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.35); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.msg-menu .mm-it { text-align: left; padding: 11px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--text); font-size: 15px; cursor: pointer; }
.msg-menu .mm-it.danger { color: #ff5d5d; }
.msg-menu .mm-it:active, .msg-menu .mm-it:hover { background: var(--card); }
.msg-menu .mm-rx { display: flex; justify-content: space-between; gap: 2px; padding: 2px 2px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.msg-menu .mm-rx button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; padding: 0; }
.msg-menu .mm-rx button.on { background: color-mix(in srgb, var(--lime) 35%, transparent); }
.msg-menu .mm-rx button:active { transform: scale(1.2); }
.msg { -webkit-touch-callout: none; }
.msg.menu-on { box-shadow: 0 0 0 2px color-mix(in srgb, var(--lime) 70%, transparent); }
body.msg-holding .msg, body.msg-holding .msg * { -webkit-user-select: none !important; user-select: none !important; -webkit-touch-callout: none !important; }
.msg .meta .ed { opacity: .8; font-style: italic; }
.msg.gone .b { font-style: italic; }
.g-rx { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; }
.g-rx button { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, currentColor 22%, transparent); background: color-mix(in srgb, currentColor 6%, transparent); color: inherit; font-size: 14px; line-height: 1.2; cursor: pointer; }
.g-rx button i { font-style: normal; font-size: 12px; font-variant-numeric: tabular-nums; opacity: .85; }
.g-rx button.on { border-color: var(--lime); background: color-mix(in srgb, var(--lime) 30%, transparent); }
.g-pics { display: grid; gap: 4px; margin: 2px 0 6px; max-width: 300px; }
.g-pics.n2 { grid-template-columns: 1fr 1fr; } .g-pics.n3 { grid-template-columns: 1fr 1fr 1fr; }
.g-img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 12px; display: block; cursor: zoom-in; background: color-mix(in srgb, var(--text) 8%, transparent); min-height: 80px; }
.g-pics.n2 .g-img, .g-pics.n3 .g-img { aspect-ratio: 1; }
.g-doc { display: flex; align-items: center; gap: 10px; margin: 2px 0 6px; padding: 8px 10px; border-radius: 12px; border: 1px solid color-mix(in srgb, currentColor 18%, transparent); color: inherit; text-decoration: none; max-width: 280px; }
.g-doc .ic { font-size: 24px; flex: none; }
.g-doc .nm { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.g-doc .nm b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-doc .nm i { font-style: normal; font-size: 12px; opacity: .7; }
.g-voice { display: flex; align-items: center; gap: 10px; min-width: 200px; max-width: 280px; padding: 2px 0 4px; cursor: pointer; }
.g-voice .pp { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--lime); color: #181818; font-size: 14px; flex: none; cursor: pointer; }
.g-voice .trk { flex: 1; height: 4px; border-radius: 4px; background: color-mix(in srgb, currentColor 22%, transparent); overflow: hidden; }
.g-voice .trk i { display: block; height: 100%; width: 0; background: currentColor; }
.g-voice .tm { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .75; flex: none; }
.g-tr { font-size: 13px; line-height: 1.4; opacity: .72; white-space: pre-wrap; word-break: break-word; user-select: text; -webkit-user-select: text; }
.g-tr.long:not(.open) { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.msg.pend { opacity: .7; }
.msg.me.pend .b { color: inherit; }
.g-viewer { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.94); display: flex; align-items: center; justify-content: center; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.g-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; touch-action: pinch-zoom; }
.g-viewer .x { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 18px; }
.g-viewer .dl { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); color: #fff; background: rgba(255,255,255,.18); padding: 8px 16px; border-radius: 999px; text-decoration: none; font-size: 14px; }
.g-comp .input::placeholder { font-size: 14px; }
body.in-gchat .fab { display: none; }
.own-person.idle { opacity: .6; }

/* группа (Армен 28.10): без полоски прокрутки под вкладками; фото — без системного предпросмотра iPhone при удержании */
.g-tabs { scrollbar-width: none; -ms-overflow-style: none; }
.g-tabs::-webkit-scrollbar { display: none; }
.g-img { -webkit-touch-callout: none; -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.g-viewer-acts { position: absolute; left: 0; right: 0; bottom: calc(24px + env(safe-area-inset-bottom)); display: flex; gap: 10px; justify-content: center; }
.g-viewer-acts .dl, .g-viewer-acts .del { position: static; transform: none; padding: 10px 18px; border-radius: 999px; background: rgba(255,255,255,.14); color: #fff; border: 0; font-size: 15px; text-decoration: none; }
.g-viewer-acts .del { color: #ff8a80; }

/* Иконки Endless (brand/icons, спрайт в index.html между icons:start/end): линии currentColor, лаймовая точка — --lime темы */
.ico { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; display: inline-block; --endless-lime: var(--lime); }
.nav a i .ico, .bottom a i .ico { width: 20px; height: 20px; vertical-align: middle; display: block; margin: 0 auto; }
@media (max-width: 860px) { .bottom a i .ico { width: 30px; height: 30px; } }
.nav a.active i, .bottom a.active i { opacity: 1; }
.composer .attach .ico, .composer .send .ico, .composer .cancel .ico { width: 22px; height: 22px; vertical-align: middle; }
.chat-reply .x .ico { width: 16px; height: 16px; }
.row .ic .ico { width: 20px; height: 20px; vertical-align: middle; }
.msg-menu .mm-rx button .ico { width: 26px; height: 26px; vertical-align: middle; }
.msg-menu .mm-it .ico { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; }
.g-rx button .ico { width: 16px; height: 16px; vertical-align: -3px; }
.title .ico, h3 .ico { width: 1.1em; height: 1.1em; vertical-align: -.18em; }
.msg.me .ico { --endless-lime: #CCFE00; }
:root[data-theme="dark"] .msg.me .ico { --endless-lime: #8FB400; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg.me .ico { --endless-lime: #8FB400; } }
.own-add { display: grid; grid-template-columns: 1fr 90px; gap: 8px; margin: 8px 0; }
.own-add select, .own-add button { grid-column: span 1; }

/* порядок блоков голосом (app.js applyLayout): свои блоки — одной колонкой, скрытые — не видно */
.layout-flow { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.layout-flow > .card { margin: 0; }
.user-hidden { display: none !important; }

/* «Настройки» (app.js settingsSheet): экраны и блоки — переключатели и порядок пальцем */
.nav-off { display: none !important; }
.set h3 { display: flex; align-items: center; gap: 10px; }
.set-group-title { margin: 14px 2px 8px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
/* заголовок раздела с «＋ …» справа — как шапка карточки (одна форма кнопки добавления везде, Армен 13.11) */
.set-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 2px 8px; }
.set-head > .set-group-title { margin: 0; }
.g-head-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }  /* «Группы» уже в шапке экрана — над списком только кнопки */
.set-list { display: flex; flex-direction: column; gap: 8px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--bg-2); cursor: pointer; transition: box-shadow .15s ease, transform .05s linear; touch-action: pan-y; }
.set-row.blk { cursor: default; }
.set-row.dragging { box-shadow: 0 10px 28px rgba(0,0,0,.35); border-color: color-mix(in srgb, var(--lime) 60%, var(--line)); position: relative; z-index: 2; }
.set-ic { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; }
.set-ic .ico { width: 22px; height: 22px; }
.set-name { flex: 1; min-width: 0; font-size: 16px; overflow-wrap: break-word; }  /* одно длинное слово («Նախասիրություններ», стенд hy 19.11) переносится, а не наезжает на .set-val */
.set-go { color: var(--muted); font-size: 20px; }
.set-drag { color: var(--muted); font-size: 18px; letter-spacing: -3px; padding: 6px 8px 6px 0; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
/* «‹ Настройки» (Армен 29.10): заметная кнопка назад — крупная стрелка, обычный размер текста, зона касания 44 px */
.set-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -6px 0 6px -8px; padding: 0 14px 0 4px;
  background: color-mix(in srgb, var(--text) 7%, transparent); border: 0; border-radius: 999px; color: var(--text);
  font: inherit; font-size: 17px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.set-title { display: flex; align-items: center; gap: 8px; }  /* «Настройки» со своей шестерёнкой (Армен 29.10) */
.set-title .ico { width: 22px; height: 22px; flex: none; color: var(--text); }
.set-back svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.set-back:active { background: color-mix(in srgb, var(--text) 14%, transparent); }
.set-sw { position: relative; width: 46px; height: 28px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--text) 12%, transparent);
  cursor: pointer; flex: none; padding: 0; transition: background .2s ease; }
.set-sw i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: transform .2s ease, background .2s ease; }
.set-sw.on { background: var(--lime); border-color: transparent; }
.set-sw.on i { transform: translateX(18px); background: #181818; }
/* «Профиль» и «Настройки» (ТЗ 03.11): только строки по группам — название слева, значение серым справа, ›; подэкран — в шторке */
.set-val { color: var(--muted); font-size: 14px; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.set-val:empty { display: none; }
.set-sub { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.set-cap { display: block; margin-bottom: 2px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.set-row.tall { align-items: center; }
.set-row.tall .set-name { font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.set-row.warn { border-color: color-mix(in srgb, var(--warn, #c9a36b) 55%, var(--line)); }
.set-row.danger .set-name { color: var(--bad, #e5484d); }
.set-row.rule .mini { flex: none; }
/* рецепт дел раскрывается вниз: название и шаги — столбиком, не рядом (на 375 px название сжималось в узкую колонку) */
details.set-row.recipe { display: block; }
details.set-row.recipe > summary { cursor: pointer; }
details.set-row.recipe > label { display: block; margin-top: 10px; }
.set-row[aria-disabled="true"], .set-sw[disabled] { opacity: .5; }
a.set-row { color: inherit; text-decoration: none; }
.set-check { flex: none; width: 22px; text-align: right; font-weight: 700; color: var(--text); }
.set-ver { text-align: center; margin: 18px 0 4px; }
.set-group-gap { height: 22px; }
.set-screen-title { margin: 0 2px 4px; font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.set-val.on { color: var(--text); }
.set .small { font-size: 13px; line-height: 1.4; }
.me-list > .set-group-title:first-child, .me-list > .set-g:first-child > .set-group-title:first-child { margin-top: 4px; }   /* первая группа экрана; заголовок внутри обёртки .set-g – только у первой обёртки */
.set-g { display: contents; }
/* ---------- большие экраны: «Настройки» и «Профиль» на широком: группы строк в две колонки (по порядку сверху вниз), группа не рвётся между колонками */
@media (min-width: 1200px) {
  .me-list { columns: 2; column-gap: 24px; }
  .me-list > .set-g { display: flow-root; break-inside: avoid; margin-bottom: 22px; }   /* flow-root: отступ заголовка не съедается на стыке колонок – верх обеих колонок на одной линии */
  .me-list > .set-g > .set-group-title { margin-top: 4px; }
  .me-list > .set-g > .set-list:first-child { margin-top: calc(12px + 1.45 * 12px); }   /* группа без заголовка – на уровне строк соседней колонки, не выше */
  .me-list > .set-group-gap { display: none; }
  .me-list > :not(.set-g):not(.set-group-gap) { column-span: all; }
}
/* ---------- конец: большие экраны */
.set .pf-text.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.set.page label { display: block; margin-top: 10px; }
.page-card { padding: 0; border: 0; background: none; box-shadow: none; margin: 0 0 6px; }
.page-card:not([data-keep]):not(.keep-head) > h3:first-child, .page-card:not([data-keep]):not(.keep-head) > .card-head:first-child { display: none; }

/* зажал и тащи (app.js): поднятый элемент — с тенью, поверх; на время — без выделения текста и прокрутки */
.lifting { position: relative; z-index: 30; box-shadow: 0 14px 34px rgba(0,0,0,.4); transition: none !important; opacity: .96; }
body.sorting, body.sorting * { user-select: none !important; -webkit-user-select: none !important; -webkit-touch-callout: none !important; }
body.sorting .main { touch-action: none; overflow: hidden; }
/* ---------- «Меню» (Армен 17.11, вариант А): внизу четыре раздела по краям и круг «Меню» в центре; окно – шторка над панелью, сетка 4 × 4,
   последняя ячейка – кнопка ассистента на своём месте (app.js menuSheet, menuFit). Высота панели прежняя: кнопка ассистента и «+» стоят там же */
.bottom > a, .nav-menu { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.nav-menu { display: none; }
@media (max-width: 860px) {
  .bottom { overflow: visible; justify-content: space-around; }
  .bottom > a:not(.edge) { display: none; }
  .nav-menu { order: 3; flex: 0 0 min(78px, calc((100% - 14px) / 5)); width: min(78px, calc((100% - 14px) / 5)); min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px;
    padding: 5px 0; border: 0; background: none; color: var(--text); font: inherit; font-size: min(11px, 3.05vw); line-height: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  /* круг 58 + обводка 4 цветом экрана; в разметке занимает те же 30 px, что значок соседей – панель не выше прежней, круг выступает над ней */
  .nav-menu i { width: 58px; height: 58px; margin-top: -36px; box-sizing: content-box; border: 4px solid var(--bg); border-radius: 50%; display: grid; place-items: center;
    background: var(--primary-bg); color: var(--primary-fg); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); font-style: normal; }
  .nav-menu i .ico { grid-area: 1 / 1; width: 26px; height: 26px; transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .2s ease; }
  .nav-menu .m-x { opacity: 0; transform: rotate(-90deg); }
  body.menu-open .nav-menu .m-x { opacity: 1; transform: none; }
  body.menu-open .nav-menu .m-dots { opacity: 0; transform: rotate(90deg); }
  .nav-menu .m-close, body.menu-open .nav-menu .m-open { display: none; }
  body.menu-open .nav-menu .m-close { display: block; }
  /* открыто: панель над шторкой (закрыть – тем же кругом), «+» – про раздел, а окно не раздел */
  body.menu-open #bottom { z-index: 61; background: var(--bg-2); -webkit-backdrop-filter: none; backdrop-filter: none; }   /* шторка кончается у верха панели: полупрозрачная панель пропускала текст страницы (облако 17.11, SE iOS 15) */
  body.menu-open .fab:not(.agent) { visibility: hidden; }
  body.menu-open #fab-chat { display: inline-block !important; }   /* 16-я ячейка – кнопка ассистента и на экране «Ассистент» (там она скрыта): без неё сетка не выравнивалась и 4-й ряд уходил под панель (скрин Армена 17.11, 21:24) */
  body.menu-open #sheet { padding-top: max(14px, calc(env(safe-area-inset-top) + 14px)); }   /* верх шторки не выше safe-area + 24 px (с 10 px ниже): жест от ручки у края экрана открывал Центр уведомлений iOS (облако 17.11, SE) */
  body.menu-open #sheet-body { width: 100%; max-height: calc(100% - 10px); padding: 20px 14px 18px; gap: 10px; animation: menu-up .28s cubic-bezier(.2, .8, .2, 1); }   /* 88vh резал окно на SE и 320 – сетка уезжала с места кнопки ассистента */
  body.menu-open .sheet-bg { animation: menu-fade .28s ease; }
  /* закрытие «Меню»: копия шторки (sheetGhostBuild) с тем же видом, уезжает вниз под панель (z 39 < панели 40) тем же движением, что открытие */
  .sheet-ghost.menu-ghost { z-index: 39; padding-top: max(14px, calc(env(safe-area-inset-top) + 14px)); }
  .menu-ghost > .sheet-card { width: 100%; max-height: calc(100% - 10px); padding: 20px 14px 18px; gap: 10px; transition: transform .24s cubic-bezier(.2, .8, .2, 1), opacity .24s ease-out; }
  .menu-ghost > .sheet-bg { transition: opacity .24s cubic-bezier(.2, .8, .2, 1); }   /* та же кривая, что у карточки меню: подложка гаснет в такт */
}
.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(var(--fab-size, 84px), 1fr); grid-auto-rows: var(--fab-size, 84px); gap: 8px 6px; }   /* 4-я колонка не уже кнопки ассистента: на 320 она заходила на плитку слева (rev4b 17.11) */
.menu-grid.tight .menu-tile { gap: 4px; padding-top: 0; }   /* низкое окно (SE в Safari): ряды ниже, значок меньше – сетка входит целиком (app.js menuFit) */
.menu-grid.tight .menu-tile > i { width: 42px; height: 42px; border-radius: 14px; }
.menu-grid.tight .menu-tile > i .ico { width: 22px; height: 22px; }
.menu-tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; min-width: 0; padding: 2px 0 0; border: 0; border-radius: 16px; background: none;
  color: var(--text); font: inherit; font-size: 12px; line-height: 14px; white-space: nowrap; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  animation: menu-tile .32s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--r, 0) * 20ms + 60ms); }
.menu-tile > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.menu-tile > i { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; font-style: normal; background: color-mix(in srgb, var(--text) 6%, transparent); }
.menu-tile > i .ico { width: 26px; height: 26px; }
.menu-tile > i .emark { font-size: 24px; }
.menu-tile.active > i { background: var(--lime); color: #181818; }
.menu-tile.lifting { position: relative; z-index: 2; background: var(--bg-2); box-shadow: 0 10px 26px rgba(0, 0, 0, .28); opacity: 1; transition: none; }
.menu-grid.settled .menu-tile { animation: none; }   /* анимация появления – один раз: перенос плитки в разметке запускал её заново (скачок, жалоба 17.11) */
.menu-grid:not(.scrolls) .menu-tile { touch-action: none; }   /* окно не листается – касание плитки целиком наше: iPhone не снимает удержание как прокрутку */
/* место кнопки ассистента: ячейка пустая, подпись – под кнопкой */
.menu-fab-cell { grid-column: 4; position: relative; pointer-events: none; }
.menu-fab-cell::after { content: attr(data-cap); position: absolute; left: 0; right: 0; top: calc(100% + 3px); text-align: center; font-size: 12px; line-height: 14px; color: var(--text); }
@media (max-width: 359px) { .menu-tile { font-size: 11px; letter-spacing: -.02em; } body.menu-open #sheet-body, .menu-ghost > .sheet-card { padding-left: 8px; } .menu-grid { column-gap: 4px; } }   /* 320: 4-я колонка – с кнопку (84), трём остальным место слева и из зазоров – «Наблюдения» целиком; правый край по-прежнему у кнопки */
/* анимация открытия не гасится по prefers-reduced-motion (решение Армена: у него «Reduce Motion» включён, движение он хочет видеть) */
@keyframes menu-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes menu-fade { from { opacity: 0; } }
@keyframes menu-tile { from { opacity: 0; transform: translateY(14px); } }
/* боковое меню на широком экране (Ш1): те же четыре сверху, черта, группы с подписями (app.js sideGroups) */
.nav-sep { border: 0; border-top: 1px solid var(--line); margin: 8px 12px 2px; }
.nav > a[data-view="costs"] { display: none; }   /* «Расходы» владельцу – строкой в «Настройках», не в меню (Армен 17.11) */
.nav-g { margin: 12px 12px 2px; font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
/* меню выше окна (ноутбук 1280 × 720, iPad альбомом 768): своя прокрутка, иначе нижние пункты и «Настройки» недостижимы (липкая колонка высотой в окно);
   пункты чуть плотнее – на 1440 × 900 входит целиком */
@media (min-width: 861px) {
  .side { height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }   /* 100vh в Safari iPad выше видимого окна (панель Safari): «Настройки» срезались на 7 px – облако 17.11, iPad 10.2 альбом */
  .nav { gap: 2px; }
  .nav a { padding-top: 8px; padding-bottom: 8px; }
}
/* ---------- конец: «Меню» */
[data-sort], .card h3 { -webkit-touch-callout: none; }

/* выбор дня или периода (Армен 28.10): подпись периода — кнопка, шторка-календарь; касание — день, палец по дням — отрезок */
.period-nav { display: flex; align-items: center; gap: 6px; }
.period-nav .mini { min-width: 34px; height: 34px; padding: 0; font-size: 16px; }
.period-nav .mini:disabled { opacity: .35; }
.period-label { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.period-label::after { content: ""; width: 6px; height: 6px; margin-left: 2px; border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .55; }
.period-label .ico { width: 15px; height: 15px; }
.period-label.on { background: var(--lime); color: var(--on-accent); border-color: transparent; }
.fin-sum .grid.stats { margin-bottom: 0; }
.fin-sum .stat { background: color-mix(in srgb, var(--text) 4%, transparent); box-shadow: none; backdrop-filter: none; }
.fin-sum .card-head h3 { flex: 1 1 auto; }
@media (max-width: 520px) { .fin-sum .card-head { flex-wrap: nowrap; } .fin-sum .period-label { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; } }
.pp { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pp-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 10px; }
.pp-chip { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 999px; padding: 8px 12px;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pp-chip.on { background: var(--lime); color: var(--on-accent); border-color: transparent; }
.pp-nav { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 6px; }
.pp-nav b { font-size: 16px; }
.pp-nav button { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  color: var(--text); font-size: 18px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pp-nav button:disabled { opacity: .3; }
.pp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; touch-action: none; }
.pp-grid .w { text-align: center; font-size: 11px; color: var(--muted); text-transform: uppercase; padding: 4px 0 6px; }
.pp-d { position: relative; height: 46px; border: 0; padding: 0; background: transparent; color: var(--text); font: inherit;
  font-size: 15px; font-weight: 600; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.pp-d span { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  margin: 0 auto; border-radius: 999px; }
.pp-d.now span { box-shadow: inset 0 0 0 1.5px var(--text); }
.pp-d:disabled { color: var(--muted); opacity: .4; cursor: default; }
.pp-d.in::before { content: ""; position: absolute; top: 3px; bottom: 3px; left: 0; right: 0; background: color-mix(in srgb, var(--lime) 26%, transparent); }
.pp-d.in.rs::before { left: 4px; border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.pp-d.in.re::before { right: 4px; border-top-right-radius: 999px; border-bottom-right-radius: 999px; }
.pp-d.in.a::before { left: 50%; } .pp-d.in.b::before { right: 50%; }
.pp-d.a.b::before { display: none; }
.pp-d.a span, .pp-d.b span { background: var(--lime); color: var(--on-accent); box-shadow: none; }
.pp-d i { position: absolute; z-index: 2; bottom: 6px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--lime); }
.pp-d.a i, .pp-d.b i { background: var(--on-accent); }
.pp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; min-height: 44px; }
.pp-sum { font-weight: 700; }
.pp-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- цикл (Здоровье): календарь 6 недель — месячные, прогноз пунктиром, фертильные дни, овуляция */
:root { --cyc: #F0567A; }
.cycle .card-head { display: flex; align-items: center; justify-content: space-between; }
.cyc-lock { font-size: 12px; color: var(--muted); }
.cyc-hero { display: flex; align-items: center; gap: 16px; margin: 4px 0 12px; }
.cyc-ring { position: relative; flex: 0 0 132px; width: 132px; height: 132px; }
.cyc-ring svg { width: 100%; height: 100%; display: block; }
.cyc-ring-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.cyc-ring-n { font-size: 34px; font-weight: 700; line-height: 1; }
.cyc-ring-s { font-size: 11px; color: var(--muted); margin-top: 4px; max-width: 80px; line-height: 1.2; }
.cyc-hero-t { flex: 1 1 auto; min-width: 0; }
.cycle .cyc-big { font-size: 17px; font-weight: 700; line-height: 1.25; }
.cycle .cyc-sub { font-size: 13px; margin-top: 4px; line-height: 1.35; }
.cyc-nav { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 2px; font-weight: 600; font-size: 14px; }
.cyc-nav .mini { width: 36px; height: 32px; padding: 0; font-size: 18px; }
.cyc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 6px 0 8px; }
.cyc-w { font-size: 11px; color: var(--muted); text-align: center; }
.cyc-d { position: relative; aspect-ratio: 1; max-height: 40px; width: 100%; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  font: inherit; font-size: 13px; color: var(--text); background: none; border: 1.5px solid transparent; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cyc-d.future { color: var(--muted); }
.cyc-d.fert { background: color-mix(in srgb, var(--lime) 22%, transparent); color: var(--text); }
.cyc-d.ov { background: var(--lime); color: #111; font-weight: 700; }
.cyc-d.pred { border: 1.5px dashed var(--cyc); color: var(--text); }
.cyc-d.per { background: var(--cyc); color: #fff; font-weight: 600; }
.cyc-d.today { box-shadow: 0 0 0 2px var(--text); }
.cyc-d.sel { outline: 2px solid var(--cyc); outline-offset: 2px; }
.cyc-d.log::after { content: ""; position: absolute; bottom: 2px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; opacity: .75; }
.cyc-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.cyc-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.cyc-legend .per::before { background: var(--cyc); }
.cyc-legend .pred::before { border: 1.5px dashed var(--cyc); width: 7px; height: 7px; }
.cyc-legend .fert::before { background: color-mix(in srgb, var(--lime) 35%, transparent); }
.cyc-legend .ov::before { background: var(--lime); }
.cyc-legend .logd::before { width: 4px; height: 4px; background: var(--muted); vertical-align: 2px; }
.cyc-panel { border-top: 1px solid color-mix(in srgb, var(--text) 10%, transparent); padding-top: 10px; }
.cyc-p-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 15px; margin-bottom: 8px; }
.cyc-p-note { font-size: 13px; }
.cycle .linkish { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--cyc); cursor: pointer; }
.cyc-acts { display: flex; gap: 8px; }
.cyc-acts .mini { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 6px 10px; font-size: 15px; line-height: 1.2; white-space: normal; }
.cyc-g { margin-top: 10px; }
.cyc-gl { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.cyc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cyc-chip { font: inherit; font-size: 13px; padding: 6px 11px; border-radius: 999px; background: none; color: var(--text);
  border: 1px solid color-mix(in srgb, var(--text) 18%, transparent); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cyc-chip.on { background: var(--cyc); border-color: var(--cyc); color: #fff; }
.cyc-box { margin-top: 12px; padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.4;
  background: color-mix(in srgb, var(--cyc) 9%, transparent); }
.cyc-box.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); }
.cyc-box .linkish { margin-top: 6px; }
.cyc-bars { display: flex; flex-direction: column; gap: 6px; }
.cyc-bar { display: grid; grid-template-columns: 58px 1fr 64px; align-items: center; gap: 8px; background: none; border: 0; padding: 2px 0;
  font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.cyc-bar-l { font-size: 13px; }
.cyc-bar-r { font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.cyc-bar-t { display: block; height: 12px; }
.cyc-bar-f { display: block; height: 100%; border-radius: 6px; background: color-mix(in srgb, var(--text) 14%, transparent); overflow: hidden; }
.cyc-bar-f.cur { background: none; border: 1.5px dashed color-mix(in srgb, var(--text) 30%, transparent); }
.cyc-bar-f i { display: block; height: 100%; background: var(--cyc); }
.cyc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
/* ---------- большие экраны: цикл на широком (Армен 16.11, MacBook): ячейки тянулись на всю ширину карточки, а высота упиралась в 40 – кружки становились овалами.
   Шире телефона – квадрат 44 × 44 (зона нажатия) в колонках 44; при месте – календарь слева, панель дня справа. На телефоне (≤ 520) – как было */
@media (min-width: 521px) {
  .cyc-grid { grid-template-columns: repeat(7, 44px); gap: 6px; justify-content: start; }
  .cyc-d { width: 44px; height: 44px; max-height: none; aspect-ratio: auto; }
  .cyc-nav, .cyc-legend { max-width: 344px; }   /* 7 × 44 + 6 × 6: стрелки и подписи по ширине календаря */
}
@media (min-width: 700px) and (max-width: 860px), (min-width: 1000px) {
  .card.cycle { display: grid; grid-template-columns: 344px minmax(0, 1fr); grid-template-rows: repeat(5, auto) 1fr; column-gap: 36px; align-items: start; }   /* 6-я строка гибкая: панель дня выше календаря – излишек уходит в неё, недели календаря не раздвигаются */
  .card.cycle > * { grid-column: 1 / -1; }
  .card.cycle > .card-head { grid-row: 1; }
  .card.cycle > .cyc-hero { grid-row: 2; }
  .card.cycle > .cyc-nav { grid-column: 1; grid-row: 3; }
  .card.cycle > .cyc-grid { grid-column: 1; grid-row: 4; }
  .card.cycle > .cyc-legend { grid-column: 1; grid-row: 5; }
  .card.cycle > .cyc-panel { grid-column: 2; grid-row: 3 / span 4; border-top: 0; padding-top: 4px; }
}
/* ---------- конец: большие экраны */
.cyc-remind { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.cyc-note { font-size: 12px; margin-top: 8px; }

/* экран «Расходы» (владельцу): карточки сервисов, поля «вручную», таблица сверки */
.own-bar { flex-wrap: wrap; } .own-bar .pill { margin-left: auto; }
.own-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.own-svc { padding: 12px 14px; margin: 0; }
.own-svc h4 { margin: 0 0 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; }
.own-set { display: grid; grid-template-columns: 1fr 120px; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 6px; }
.own-set input { padding: 6px 8px; font-size: 13px; }
.own-note { color: var(--muted, #888); margin-top: 4px; }
.own-head .own-big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.own-strip { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; }
.own-chip { display: inline-flex; gap: 4px; align-items: baseline; font-variant-numeric: tabular-nums; }
.own-chips { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; margin: 6px 0; }
.own-p { border-top: 1px solid var(--line); }
.own-prow { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; cursor: pointer; align-items: baseline; }
.own-prow .own-psum { font-size: 16px; font-variant-numeric: tabular-nums; }
.own-prow .own-pmeta { grid-column: 1 / -1; }
.own-p.open .own-prow { padding-bottom: 4px; }
.own-pcard { padding: 0 0 12px; }
.own-pcard h4 { margin: 10px 0 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
.own-bars { display: flex; align-items: flex-end; gap: 2px; height: 44px; margin: 8px 0 2px; }
.own-bars i { flex: 1; min-width: 2px; background: var(--accent, #3a7bd5); opacity: .75; border-radius: 2px 2px 0 0; }
.own-bars-cap { display: flex; justify-content: space-between; }
.own-turns { font-size: 13px; }
.own-turn { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 5px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; align-items: baseline; }
.own-turn .own-tok { grid-column: 1 / -1; }
.own-fold > summary { list-style: none; display: flex; align-items: baseline; gap: 10px; cursor: pointer; }
.own-fold > summary::-webkit-details-marker { display: none; }
.own-fold > summary h3 { margin: 0; }
.own-fold > summary::after { content: "›"; margin-left: auto; color: var(--muted); transform: rotate(90deg); transition: transform .15s; }
.own-fold[open] > summary::after { transform: rotate(-90deg); }
.own-fold[open] > summary { margin-bottom: 10px; }
.own-sub { margin-top: 10px; } .own-sub > summary { cursor: pointer; }
.own-extra { margin-top: 8px; }
.own-csv { display: inline-block; margin-top: 8px; cursor: pointer; }
.own-types { margin: 6px 0; }
.own-bad { color: var(--bad); font-weight: 600; }
.own-v.est { color: var(--muted); }
.own-table { width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; border-collapse: collapse; margin-top: 6px; }
.own-table td, .own-table th { padding: 4px 6px; border-top: 1px solid var(--line); text-align: right; font-weight: 500; }
.own-table td:first-child, .own-table th:first-child { text-align: left; }
.own-table th { color: var(--muted); font-size: 11px; font-weight: 500; }
/* вход для сторов (login.js): кнопка Apple по гайдам Apple (чёрная/белая, 44px), вкладки, согласия, оболочка */
.apple-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 320px; height: 44px; margin: 10px auto 0; border: 0; border-radius: 10px; background: #000; color: #fff; font: 600 16px/1 Inter, -apple-system, system-ui, sans-serif; cursor: pointer; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .apple-btn { background: #fff; color: #000; } }
:root[data-theme="dark"] .apple-btn { background: #fff; color: #000; }
.login .seg button { flex: 1; }
.consent-row { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 13px; line-height: 1.35; }
.consent-row input { margin-top: 3px; flex: none; }
html.native .not-native { display: none; }
html.native-ios .login-wrap { padding-top: calc(env(safe-area-inset-top) + 16px); }

/* пустая сфера: сводка с нулями и пустые графики не рисуются (app.js zeroCards, /api/has) */
.card.zero-off { display: none !important; }
.accounts > .empty { grid-column: 1 / -1; }  /* «Счетов пока нет» — во всю ширину, а не в колонку плитки */
/* сверху «Сегодня»: лесенка (одна возможность в день) и вопрос про push после первой записи — app.js nudges() */
.nudges { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.nudges:empty { display: none; }
.card.nudge { position: relative; margin: 0; border: 1.5px solid #CCFE00; }
.card.nudge h3 { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--text); }
.card.nudge p { margin: 4px 0 12px; font-size: 15px; line-height: 1.4; }
.nudge .nudge-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.nudge .nudge-acts .pill { white-space: normal; text-align: left; }
/* экран входа: «Вставить код» и «Прислать новый код» под полем (ТЗ путь клиента, дополнение 31.10) */
.login .code-help { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 4px 0 6px; }
.login .code-help .pill { text-decoration: none; }

/* «Мои люди»: знак Endless у человека (people.mineBadge) */
.mine-b { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; font-size: 18px; color: var(--text);
  background: none; border: 0; padding: 4px; border-radius: 999px; vertical-align: middle; line-height: 1; }
.mine-b b { font-size: 12px; font-weight: 700; }
.mine-b.in { border: 1px solid var(--line, color-mix(in srgb, var(--text) 25%, transparent)); padding: 3px 7px 3px 5px; cursor: pointer; }
.mine-b.in .emark .dot, .mine-b.pending .emark .dot { background: transparent; border: .07em solid currentColor; }
.mine-b.pending { opacity: .55; }
.mine-line { font-size: 13px; display: flex; gap: 6px; align-items: flex-start; }
.mine-line .emark { flex: none; font-size: 16px; margin-top: 1px; }
.card h3 .emark { font-size: 1.05em; vertical-align: -2px; }

/* карточка счёта и «Валюты и курсы» (03.11) */
.sheet-card .acc-default { flex-direction: row; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); margin: 10px 0 2px; }
.sheet-card .acc-default input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--accent); }
.sheet-card .acc-more { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.sheet-card .acc-more summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.sheet-card .acc-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.sheet-card .acc-links .link { background: none; border: 0; padding: 6px 0; font: inherit; font-size: 15px; color: var(--text); cursor: pointer; }
.sheet-card .acc-links .link.danger { color: var(--bad); }
.acc.total.click { cursor: pointer; }

/* «Корзина» в «Мои данные»: запись, вид и дата, две кнопки */
.trash-row { display: grid; gap: 6px; overflow-wrap: anywhere; }
.trash-acts { display: flex; gap: 8px; }
.mini.danger { color: var(--bad, #e5484d); }
/* «Документы»: вкладки категорий сверху (Армен 08.11) — как чипы периодов, переносятся на вторую строку, все видны сразу */
.doc-tabs { margin: 4px 0 12px; }
.doc-tabs button { white-space: nowrap; }
.doc .h .chip { white-space: nowrap; flex: none; }
.doc.soon { border-left: 3px solid var(--warn, #d08a00); padding-left: 8px; }  /* событие завтра или сегодня */
.doc.archived .title { color: var(--muted); }
#med-docs .doc-shelf + .doc-shelf { margin-top: 10px; }
/* растущая привычка (08.11): «сегодня 31 из 31 · завтра 32» и полоса дня под названием */
.habit .hprog { margin: 6px 0 2px; font-size: 13px; }
.habit .hprog .hprog-l { color: var(--muted); margin-bottom: 4px; }
.habit .hprog .track { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.habit .hprog .fill { height: 100%; background: var(--lime); }
.habit .hprog .fill.ok { background: var(--ok, var(--lime)); }


/* ручка перетаскивания (Армен 08.11, iPhone): видна всегда, тянуть сразу; браузер не забирает жест под прокрутку */
.drag-handle { float: right; margin-left: 10px; padding: 0 2px 0 10px; font-size: 20px; line-height: 1; color: var(--muted); cursor: grab;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.drag-handle:active { cursor: grabbing; color: var(--text); }
[data-psort], [data-sort] { -webkit-touch-callout: none; }

/* просроченное и прошедшие встречи (Армен 08.11): красная метка дня и времени; встреча после времени — серым */
.row.overdue .s { color: var(--bad); }
.overdue-head { color: var(--bad); margin: 2px 0 6px; }
.row.past { opacity: .55; }
/* переход по просьбе ассистенту (app.js aim): блок встаёт под шапку и на пару секунд обведён */
.nav-aim { scroll-margin-top: 12px; box-shadow: 0 0 0 2px var(--lime); }

/* тренировка дня в «Теле» (11.11): подходы «вес × повторы» по упражнениям */
.wk { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px 4px; }
.wk-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.wk-head b { font-size: 14px; }
.wk-head span, .wk-sum { color: var(--muted); font-size: 12px; }
.wk-sum { margin: 1px 0 6px; }
.wk-ex { border-top: 1px solid var(--line); padding: 8px 0; }
.wk-ex.gym:first-child, .wk-ex.wkh:first-child { border-top: 0; }
.wk-ex.wkh > .wkh-body .wk { margin-top: 8px; }
/* карточка «Тренировки»: состояние и кнопки сверху (12.11) */
.wk-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.wk-now { margin: 0 0 8px; font-size: 14px; }
/* главное действие карточки «Тренировки» (Г1, 12.11): большая кнопка и строка инструментов под ней */
/* шторка «Инструменты»: плитки 3 в ряд; значок кнопки шапки — сетка с одним акцентным квадратом */
#tools-btn .acc { stroke: var(--accent); }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 8px; }
.tool-tile { min-height: 88px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-2); color: var(--text); font: inherit; font-size: 13.5px; line-height: 1.25; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px 6px; cursor: pointer; text-align: center; }
.tool-tile:disabled { opacity: .55; }
.tool-ic { font-size: 22px; display: flex; }
.holding { opacity: .55; transition: opacity .15s; }  /* блок ждёт новые данные: прежнее бледно, высота держится */
.time-tabs { margin: 2px 0 14px; } .time-tabs button { padding-left: 4px; padding-right: 4px; }
.time-note { margin: -4px 0 10px; }
.time-h { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.wk-go { display: flex; gap: 8px; margin: 2px 0 8px; }
.wk-big { flex: 1 1 0; min-height: 52px; border: 0; border-radius: 16px; background: var(--primary-bg); color: var(--primary-fg); font: inherit; font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.wk-big.second { flex: 0 0 auto; padding: 0 18px; background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.wk-big:disabled { opacity: .6; }
/* три инструмента в одну строку и на 375 px по-русски («Секундомер», «+ Упражнение»): без переноса, отступы малы (стенд 12.11) */
.wk-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 2px; margin: 0 0 10px; }  /* перенос — только уже 375 px */
.wk-tool { min-height: 44px; padding: 0 2px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
/* с чипом в строке четыре элемента: на 375 px по-русски помещаются только плотнее (стенд 12.11: 332 px из 313 → 287) */
.wk-tools.has-last { gap: 0; } .wk-tools.has-last .wk-tool { font-size: 12.5px; gap: 3px; padding: 0; }
.wk-tools.has-last .wk-tool.last { padding: 0 6px; min-height: 28px; font-size: 12px; }
.wk-tool.last { min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; align-self: center; font-variant-numeric: tabular-nums; color: var(--text); }
.card.collapsed > .card-keep .wk-tools { display: none; }
.wk-hint { margin: 0 0 10px; line-height: 1.4; font-size: 13px; }
.wk-plan-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.wk-plan-row:last-child { border-bottom: 0; }
.wk-plan-row .n { font-size: 15px; }
.wk-plan-row .s { font-size: 12.5px; line-height: 1.4; color: var(--muted); margin-top: 3px; }
.wk-plan-row .s.up { color: var(--ok); }
.wk-plan-row.gym-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wk-plan-row.gym-row .t { min-width: 0; }
.wk-plan-row.gym-row .r { flex: none; }
.wk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.wk-chips .chip-btn { border: 1px solid var(--line); background: transparent; color: inherit; border-radius: 999px; padding: 5px 11px; font-size: 13px; }
.wk-chips .chip-btn.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
#body-workouts-form .go { color: var(--accent); font-weight: 600; }
#body-workouts-form { font-size: 13px; line-height: 1.4; margin-top: 10px; }  /* ответы анкеты тренировок — подписью, не строкой списка */
.wk-hist { display: block; min-height: 44px; margin: 4px 0 0; padding: 0; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.wk-hist-box:not(:empty) { margin: 0 0 8px; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.wk-spark { display: block; width: 100%; height: 44px; }
.wk-spark polyline { fill: none; stroke: var(--lime); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.wk-spark circle { fill: var(--lime); }
.wk-spark-ax { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.wk-spark-ax span { white-space: nowrap; }
.wk-spark-ax span:nth-child(2) { white-space: normal; text-align: center; min-width: 0; }
.wk-ex.gym .gym-now { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.wk-ex.gym .wk-sets li { gap: 12px; align-items: baseline; }
.wk-ex.gym .small { font-size: 13px; margin-top: 6px; }
.wk-ex.gym .wk-sets li span { min-width: 0; overflow-wrap: anywhere; }
.wk-ex.gym .wk-sets li b { min-width: 0; text-align: right; overflow-wrap: anywhere; font-weight: 500; }
.wk-ex summary { list-style: none; cursor: pointer; }
.wk-ex summary::-webkit-details-marker { display: none; }
.wk-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.wk-ex .name { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.wk-ex .max { flex: none; white-space: nowrap; font-size: 12px; color: var(--muted); }
.wk-ex .sets { font-size: 15px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }
.wk-ex .prev { color: var(--muted); font-size: 12px; margin-top: 2px; }
.wk-ex .up { color: var(--ok); white-space: nowrap; }
.wk-ex .down { color: var(--warn); white-space: nowrap; }
.wk-sets { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wk-sets li { display: flex; justify-content: space-between; font-size: 13px; }
.wk-sets li span { color: var(--muted); }
.wk-sets li b { font-variant-numeric: tabular-nums; }
.wk-rest { color: var(--muted); font-size: 12px; margin: 6px 2px 0; }

/* плитки «Итог месяца» открывают свой список (12.11): шеврон в подписи, итог сверху, дни с суммой */
.stat.click .more { color: var(--accent); font-weight: 600; }
.drill-total { display: flex; align-items: baseline; gap: 10px; margin: -4px 0 10px; }
.drill-total b { font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.drill-day { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 2px; font-variant-numeric: tabular-nums; }
.drill-cats { margin: 4px 0 6px; }
.drill-group { margin-top: 18px; }
.drill-note { margin: 0 0 6px; }
/* «Тело»: строка и полоска, которые открывают детали, — знак «›» справа (12.11) */
.row.click > .go { flex: none; align-self: center; margin-left: 8px; white-space: nowrap; order: 99; color: var(--accent); font-weight: 600; }
.bar.click, .muted.click { cursor: pointer; }
.bar.click .go, .muted.click .go { color: var(--accent); font-weight: 600; }
/* «Расходы по категориям / по дням» списком (12.11): от большего к меньшему, доля полоской; точка — скрыть/показать */
.cat-total { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 8px; }
.cat-total b { font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.cat-row.off .cat-main { opacity: .4; }
.cat-row.flash { animation: cat-flash 1.6s ease-out; }
@keyframes cat-flash { 0% { background: color-mix(in srgb, var(--lime) 35%, transparent); } 100% { background: transparent; } }
.cat-dot { flex: none; width: 44px; height: 44px; margin-left: -12px; border: 0; background: none; padding: 0; display: grid; place-items: center; cursor: pointer; }
.cat-dot::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent); }
.cat-row.off .cat-dot::before { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }
.cat-main { flex: 1; min-width: 0; padding: 9px 0; }
.cat-line, .day-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.cat-line .n, .day-row .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-line .v, .day-row .v { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-sub { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.cat-bar { flex: 1; height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.cat-bar > div { height: 100%; border-radius: 999px; }
.day-row { align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); }
.day-row .n { flex: 1; }


/* строка/полоска «Сегодня», ведущая в свой раздел (опись 12.11): шапка карточки сворачивает, строка внутри — детали */
.go { cursor: pointer; }
.go:active { background: color-mix(in srgb, var(--text) 5%, transparent); border-radius: 10px; }
.go:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 10px; }

/* каталог привычек */
.hc-choice { display: flex; gap: 10px; margin: 8px 0 4px; }
.hc-choice .pill { flex: 1; }
.hc-chips { flex: none; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 4px; margin: 0 -2px; }
.hc-chip { flex: 0 0 auto; border: 0; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13px; background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); white-space: nowrap; }
.hc-chip.on { background: var(--primary-bg); color: var(--primary-fg); }
.hc-note { flex: none; margin: 8px 0 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); font-size: 13px; }
.hc-card { flex: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px; margin-bottom: 9px; }
.hc-card.on { outline: 2px solid var(--lime); }
.hc-card.had { opacity: .7; }
.hc-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.hc-name { font-weight: 600; font-size: 16px; }
.hc-helps { color: var(--muted); font-size: 13px; margin: 6px 0 9px; }
.hc-meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.hc-dots { color: var(--lime); letter-spacing: 2px; font-size: 14px; }
.hc-more { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.hc-src { margin: 6px 0; }
.hc-src a { color: var(--text); text-decoration: underline; }
.hc-result { flex: none; margin: 8px 0; font-size: 13px; }
.hc-result .bad { color: var(--bad); }
.hc-bar { flex: none; position: sticky; bottom: -18px; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 0 calc(18px + env(safe-area-inset-bottom)); background: var(--bg-2, var(--bg)); border-top: 1px solid var(--line); margin: 8px 0 -18px; }  /* закрывает нижнее поле шторки */
.hc-result:empty { display: none; }
.hc-busy { pointer-events: none; opacity: .6; }
/* «Состояние»: дыхание, тишина, настроение (static/state.js) */
#state-root { padding-bottom: 120px; }  /* кнопка ассистента и меню не закрывают нижние кнопки сессии */
.st-big { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 4px; }
.st-num { font-size: 32px; font-weight: 700; letter-spacing: -1px; line-height: 1.1; }
.st-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 2px; }
.st-chip { border: 0; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13px; background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.st-chip.on { background: var(--primary-bg); color: var(--primary-fg); }
.st-about { margin-top: 8px; font-size: 13px; } .st-about summary { color: var(--muted); cursor: pointer; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.st-row:first-of-type { border-top: 0; } .st-link { cursor: pointer; }
.st-scale { display: flex; gap: 5px; }
.st-n { width: 34px; padding: 7px 0; border: 0; border-radius: 10px; font: inherit; font-weight: 600; background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.st-n.on { background: var(--primary-bg); color: var(--primary-fg); }
.st-ends { display: flex; justify-content: space-between; margin-top: 2px; }
.st-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.st-back { border: 0; background: transparent; color: var(--text); font-size: 26px; line-height: 1; padding: 4px 10px 4px 0; }
.st-stage { display: flex; justify-content: center; margin: 22px 0 14px; }
.st-orb { width: 230px; height: 230px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px solid var(--lime); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--lime) 40%, transparent), color-mix(in srgb, var(--lime) 12%, transparent)); will-change: transform; }
.st-ph { font-size: 28px; font-weight: 700; } .st-cnt { font-size: 54px; font-weight: 700; letter-spacing: -2px; line-height: 1; }
.st-legend { text-align: center; margin: 2px 0 10px; }
.st-track { display: flex; gap: 6px; margin: 12px 0 6px; } .st-track i { flex: 1; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--text) 10%, transparent); } .st-track i.on { background: var(--lime); }
.st-toggle { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.st-sw { width: 46px; height: 28px; border-radius: 999px; border: 0; background: color-mix(in srgb, var(--text) 14%, transparent); position: relative; padding: 0; flex: none; }
.st-sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-2, #fff); transition: left .15s; }
.st-sw.on { background: var(--lime); } .st-sw.on::after { left: 21px; }
.st-pair { display: flex; gap: 8px; margin-top: 12px; } .st-pair .pill { flex: 1; }
.st-safe { text-align: center; margin-top: 14px; }
/* общий приём (entity.js): «Добавить» внутри блока и быстрый выбор дня */
.ent-quick { margin: -2px 0 10px; }

/* Длинные суммы в плитках уменьшаются и на узком экране. */
.stat .value.value-long { font-size: 18px; }
.stat .value.value-xlong { font-size: 14px; }
@media (max-width: 360px) {
  .grid.stats .stat .value.value-long { font-size: 13px; }
  .grid.stats .stat .value.value-xlong { font-size: 11px; }
}

.habit-history { display: block; width: 100%; text-align: start; color: var(--text); cursor: pointer; }
.habit-history .name, .habit-history .muted { display: block; }

.habit-history .go { float: inline-end; margin-inline-start: 8px; }
.st-btns { display: flex; gap: 6px; flex: none; }

/* «⋯» у цели и решения группы — зона нажатия под палец 44 px (rev4 13.11) */
.mini[data-g-goal], .mini[data-g-dec] { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }


/* ПРОТОТИП (13.11, Армен: шторка с подъёмом на iPhone не держится): форма добавления – обычный экран в потоке документа. Страница позади скрыта, прокручивается сам документ,
   поля и ряд «Отмена/Сохранить» – в конце формы в потоке, без visualViewport: iOS сам докручивает поле в фокусе над клавиатурой. Кнопка ассистента остаётся поверх,
   внизу запас, чтобы последний ряд прокручивался выше неё */
html.form-page, body.form-page { height: auto !important; min-height: 100%; overflow: visible !important; overflow-x: hidden !important; }  /* класс на html – и для старых WebView без :has (Chrome < 105) */
html:has(body.form-page) { height: auto !important; min-height: 100%; overflow: visible !important; overflow-x: hidden !important; }  /* на телефоне документ обычно не прокручивается (html/body height 100%, overflow hidden, листает .main) – у формы-экрана листает сам документ */
body.form-page .app { height: 0 !important; min-height: 0 !important; overflow: hidden !important; visibility: hidden; }  /* не display: none – иначе прокрутка экрана под формой сбрасывается и после закрытия список стоит вверху */
body.form-page .fab:not(.agent), body.form-page nav.bottom, body.form-page .tmr-dock { display: none !important; }
/* Форма-страница листается документом: резкий бросок до конца на iOS «отскакивал» (резинка) – содержимое ехало за край и обратно, ряд «Сохранить» подпрыгивал и проезжал под кнопкой ассистента (записи Армена 14.11: кнопка стояла неподвижно, ±2 px на 60 к/с, двигалась резинка). Без отскока на обоих краях. */
html.form-page, body.form-page { overscroll-behavior-y: none; }
body.form-page .sheet.as-page { position: static !important; inset: auto !important; top: auto !important; bottom: auto !important; height: auto !important; display: block; z-index: auto; min-height: 100vh;
  background: var(--bg); padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 0 !important; box-sizing: border-box; }
html.form-page.kb-open, body.form-page.kb-open, html:has(body.form-page.kb-open) { min-height: 0 !important; }  /* min-height: 100% html/body = innerHeight без клавиатуры (695) держал документ (бюджет iPhone 13.11: docH 695 после снятия 100vh у шторки) */
body.form-page.kb-open .sheet.as-page { min-height: 0 !important; }  /* min-height: 100vh (большая высота окна iOS) держала документ длиннее формы; ряд остаётся под последним полем (решение Армена 13.11), пустота ниже конца прокрутки – поведение iOS (документ не короче окна без клавиатуры) */
body.form-page.kb-open .sheet.as-page .sheet-card { padding-bottom: calc(var(--kb-pad, 0px) + 16px) !important; }   /* запас снизу при клавиатуре – минимум: недостижимая часть окна + панель + 16, БЕЗ safe-area (под клавиатурой индикатор «Домой» не виден: замер облака 14.11, цель – лишние 34 px под рядом); ряд левее кнопки ассистента; Армен: «слишком низко можно пролистнуть» */  /* с клавиатурой кнопка стоит в 12 px над клавиатурой/панелью, а не в обычном месте над меню: запас = кнопка + 12 + 16, в конце прокрутки низ ряда на 16 выше верха кнопки (замер облака 13.11: с --fab-top было 84 вместо 16) */  /* клавиатура открыта: места в конце формы на высоту клавиатуры с панелью (за вычетом сжатия окна) (иначе нижнее поле не прокрутить в видимую область – замер 13.11, документ упирался в предел), ряд действий выше панели и поднятой кнопки */
body.form-page.kb-open .sheet.as-page .sheet-card > .sheet-actions { padding-right: calc(var(--fab-kb, 64px) + 14px) !important; flex-wrap: wrap; box-sizing: border-box; }  /* с клавиатурой кнопка ассистента поднята и стоит справа над клавиатурой: ряд «Отмена/Сохранить» уходит левее неё (как у шторок с кнопкой), а не под неё – 13 Mini, бюджет 14.11: ряд [216,249] под кнопкой [226,290], выше поднять нельзя без потери поля */
body.form-page .sheet.as-page .sheet-bg, body.form-page .sheet.as-page::after { display: none !important; }
body.form-page .sheet.as-page .sheet-card { position: static; width: auto; max-width: 560px; margin: 0 auto; max-height: none !important; height: auto !important; overflow: visible; background: transparent;
  border-radius: 0 !important; padding: 0 0 calc(var(--fab-size, 84px) + var(--fab-bot, 92px) + var(--fab-gap, 10px) + env(safe-area-inset-bottom, 0px)) !important; overflow-anchor: none; box-shadow: none; }  /* запас под кнопку ассистента: последний ряд прокручивается выше неё, кнопка на месте */
body.form-page .sheet.as-page .sheet-card > h3 { font-size: 26px; letter-spacing: -.02em; margin: 6px 0 14px; text-transform: none; color: var(--text); }
body.form-page .sheet.as-page .sheet-card > * { flex-shrink: 0; }
body.form-page .sheet.as-page .sheet-card > .hc-bar { position: sticky; bottom: 0; margin: 12px 0 0; padding: 10px 0 12px; background: var(--bg); border-top: 1px solid var(--line); }
body.form-page.kb-open .sheet.as-page .sheet-card > .hc-bar { padding-right: calc(var(--fab-kb, 64px) + 14px); box-sizing: border-box; }   /* каталог привычек: полоса «Добавить» левее кнопки ассистента при клавиатуре (облако 14.11, iPhone: actUnderFab) */
body.form-page .sheet.as-page .sheet-card > .sheet-actions { position: static !important; min-height: 0 !important; margin: 14px 0 0 !important; padding: 0 !important; border: 0 !important; background: none; }
.fp-back { align-self: flex-start; border: 0; background: none; color: var(--muted); font: inherit; font-size: 16px; padding: 6px 0; cursor: pointer; }
.sheet-grip { display: none; flex: none; align-self: center; position: relative; width: 120px; height: 44px; margin: -14px 0 -18px; padding: 0; border: 0; background: none; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.sheet-grip::before { content: ""; position: absolute; left: 50%; top: 50%; width: 40px; height: 5px; margin: -2.5px 0 0 -20px; border-radius: 3px; background: color-mix(in srgb, var(--text) 28%, transparent); }
@media (max-width: 860px) { .sheet-grip { display: block; } .fp-back { display: none; } }   /* телефон: ручка и смахивание вместо видимого «‹ Закрыть» (кнопка остаётся в разметке); широкий экран – «‹ Закрыть» как было */

/* порядок страниц: номер на плашке, зажать и перетащить (Армен 14.11) */
.chat-files .att img { -webkit-user-drag: none; user-drag: none; }
.chat-files .att { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.chat-files .att .num { position: absolute; left: 4px; top: 4px; z-index: 2; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; border-radius: 10px; background: rgba(0,0,0,.62); color: #fff; font: 600 12px/20px var(--font, system-ui); font-style: normal; text-align: center; pointer-events: none; }
.chat-files .att .doc { position: relative; }
.chat-files .att.ph { opacity: .35; }
.chat-files .att.ghost { opacity: .95; box-shadow: 0 8px 24px rgba(0,0,0,.28); transform-origin: center; border-radius: 12px; background: var(--card); }
.chat-files .orderhint { font-size: 12px; margin: 0 0 4px; }
.att.ghost .bar, .att.ghost button { visibility: hidden; }

/* «Закрытые (N)» под долгами (Армен 15.11): свёрнуто, строки как в списке */
.closed-fold { margin-top: 6px; }
.closed-fold > summary { cursor: pointer; padding: 10px 0; min-height: 44px; display: flex; align-items: center; list-style: none; }
.closed-fold > summary::-webkit-details-marker { display: none; }
.closed-fold > summary::after { content: "›"; margin-left: 8px; transition: transform .2s; }
.closed-fold[open] > summary::after { transform: rotate(90deg); }

/* сообщение не ушло (сеть, 5xx): серым, «Повторить» с тем же ключом, «✕» – убрать (Координатор 15.11) */
.msg.failed .b { opacity: .55; }
.msg.failed .fail-row { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px 8px; margin-top: 4px; font-size: 13px; color: var(--bg); color: color-mix(in srgb, var(--bg) 75%, transparent); }   /* подпись и кнопки внутри тёмного пузыря: узкий экран переносит кнопки строкой ниже, а не выталкивает «Не отправлено» за левый край (Galaxy S25, Облако-QA 16.11) */
.msg.failed .fail-row > span { flex: 1 1 auto; min-width: 0; text-align: right; }
.msg.failed .fail-row > .fail-btns { display: flex; gap: 8px; flex: none; }   /* «Повторить» и «✕» всегда вместе: узко – вся пара уходит строкой ниже, а не одинокий «✕» (Ревизор 4, 360 px) */
.msg.failed .fail-row .pill { min-height: 32px; padding: 4px 12px; }

/* ---------- большие экраны (Армен 16.11, MacBook 1440 / 1920): контент по центру места справа от меню, а не прижат влево;
   кнопка ассистента и «＋» у края контента, а не у края окна. Только ≥ 861 px – телефон и iPad портретом не меняются (tests/test_wide_screens.py).
   --wide-g – пустое поле по бокам колонки 1180; кнопка встаёт в это поле вплотную к контенту (зазор 24), где поля нет – как раньше у края (14). */
@media (min-width: 861px) {
  :root { --wide-g: max(0px, calc((100vw - 232px - 1180px) / 2)); --fab-edge: max(14px, calc(var(--wide-g) + 32px - 24px - var(--fab-size, 84px))); }
  html, body { overflow-x: clip; }   /* hidden делал body прокручиваемым контейнером – меню слева (sticky) уезжало вверх на длинных экранах; clip режет так же, но sticky держит */
  /* последняя строка прокручивается выше кнопки ассистента (низ 92 + 84) – правило 12.11. Справа: поле меньше кнопки (1280–1600, Ревизор 4b) – кнопка у края окна,
     колонка оставляет под неё место (кнопка + 24), чтобы посреди прокрутки она не закрывала суммы и «›»; поле растёт – запас плавно сходит к обычным 32
     (место уступает контент, не кнопка – решение Армена 12.11) */
  .main { margin-inline: auto; padding-bottom: calc(92px + var(--fab-size, 84px) + 24px); padding-right: max(32px, calc(var(--fab-edge) + var(--fab-size, 84px) + 24px - var(--wide-g))); }
  .fab:not(.agent) { right: calc(var(--fab-edge) + (var(--fab-size, 84px) - 56px) / 2); }   /* «＋» под кнопкой ассистента, по её оси */
  body.in-chat .main { padding-bottom: 90px; }   /* в разговоре кнопки ассистента нет, высоту держит .chat-view */
  .vmic { right: max(24px, var(--fab-edge)); }
  .vbar { right: calc(var(--fab-edge) - 2px); }
  .tmr-dock { right: calc(var(--wide-g) + 24px); }
  .toast, .boot-wait { left: calc(116px + 50vw); }   /* по центру контента (меню 232 слева), а не окна */
  .sheet:not(.as-page) { padding-left: 232px; box-sizing: border-box; }   /* окно по центру места контента, а не всего окна; фон-затемнение всё равно на весь экран */
  /* растянутое на 940+ px (Ревизор 4b Ш5): «Ещё…» по содержимому, разговор – колонкой 820 по центру, поле дневника до 720 */
  .more-btn { display: inline-block; width: auto; padding-inline: 16px; }
  #view-chat.chat-view { max-width: 820px; margin-inline: auto; }
  .jr-text { max-width: 720px; }
}
/* ---------- конец: большие экраны */
/* форма-страница: ничего не меняется под пальцем при прокрутке (запись Армена 17.11): без привязки прокрутки к содержимому, запас под кнопку – из размеров кнопки (выше), ряд действий и строка на уровне кнопки – левее неё статическим отступом */
html.form-page, body.form-page { overflow-anchor: none; }
body.form-page .sheet.as-page .sheet-card > .sheet-actions:last-child { padding-right: calc(var(--fab-size, 84px) + var(--fab-edge, 14px) + var(--fab-gap, 10px) - 16px) !important; flex-wrap: wrap; box-sizing: border-box; }
body.form-page .sheet.as-page .sheet-card > .fab-clash-el { padding-right: calc(var(--fab-size, 84px) + var(--fab-edge, 14px) + var(--fab-gap, 10px) - 16px); box-sizing: border-box; }
:root { --fab-bot: 92px; }  /* где стоит кнопка ассистента от низа окна: как .fab.agent { bottom } (на телефоне – следующее правило); из него – статический запас формы-страницы */
@media (max-width: 860px) { :root { --fab-bot: calc(162px + env(safe-area-inset-bottom)); } }
/* подэкран (page() в app.js) собирается вне шторки и входит целиком: никакого пустого каркаса, растущего на глазах (Армен 17.11) */
.page-stage { position: fixed; left: -10000px; top: 0; width: min(560px, 100vw); visibility: hidden; pointer-events: none; }
.set.page.page-in { animation: page-in .18s cubic-bezier(.2, .8, .2, 1); }
@keyframes page-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
/* шторка на телефоне: запас под кнопку ассистента не зависит от того, включил ли JS класс fab-sheet (запись Армена 18.11: в коротком списке дня кнопка стояла над средними строками, ряд «Закрыть» – ниже неё).
   Карточка полной ширины всегда под кнопкой, поэтому правило безусловное; значения – те же, что у body.fab-sheet выше */
@media (max-width: 860px) {
  .sheet:not(.as-page) .sheet-card { padding-bottom: calc(var(--fab-size, 84px) + var(--fab-bot, 92px) + var(--fab-gap, 10px) + env(safe-area-inset-bottom)); scroll-padding-bottom: calc(var(--fab-size, 84px) + var(--fab-bot, 92px) + var(--fab-gap, 10px)); }
  .sheet:not(.as-page) .sheet-card:has(> .sheet-actions:last-child) { padding-bottom: max(18px, var(--fab-bot, 92px)); }
  .sheet:not(.as-page) .sheet-card > .sheet-actions:last-child { min-height: var(--fab-size, 84px); align-items: center; flex-wrap: wrap; padding-right: calc(var(--fab-size, 84px) + var(--fab-edge, 14px) + var(--fab-gap, 10px) - 16px); box-sizing: border-box; }
}

/* трата: подсказка «похоже на погашение долга» (Армен 18.11, вариант Б) и «⋯» в ряду действий */
.tx-hint { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.tx-hint-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-actions .tx-more { min-width: 44px; padding-left: 12px; padding-right: 12px; font-size: 18px; line-height: 1; }
/* телефон: «Удалить · ⋯ · Изменить» – в одну строку левее кнопки ассистента (Облако-QA 18.11: на 13 Mini и S25 свободно 245 / 232 px,
   «Изменить» уходил на вторую строку). Кнопки этого ряда уже, промежуток 6 px, высота прежняя. */
@media (max-width: 600px) { .sheet-actions:has(> .tx-more) { gap: 6px; } .sheet-actions:has(> .tx-more) .pill { padding-left: 12px; padding-right: 12px; } .sheet-actions .tx-more { min-width: 44px; padding-left: 8px; padding-right: 8px; } }
.tx-menu-del { display: none; } .tx-menu-del .danger-text { color: var(--bad, #e5484d); }
@media (max-width: 340px) { .sheet-actions:has(> .tx-more) [data-act="tx-del"] { display: none; } .tx-menu-del { display: flex; } }   /* 320: три кнопки левее кнопки ассистента не помещаются – «Удалить» уходит последней строкой в «⋯» */
/* стек шторок: вход на новый уровень и возврат – содержимое въезжает мягко (.18 с), как у подэкранов; «‹ родитель» – тот же вид, что у «‹» подэкранов */
#sheet-body.stack-in > :not(.sheet-grip):not(.fp-back) { animation: page-in .18s cubic-bezier(.2, .8, .2, 1); }
.sheet-card > .stack-back { align-self: flex-start; }
/* Колёса времени (Фокус): прокрутка с привязкой, 3 строки, выбранная в центре; высота строки = WHEEL_ROW (40) в app.js */
.wheels { position: relative; display: flex; justify-content: center; align-items: center; gap: 6px; height: 120px; margin: 4px 0 12px; }
.wheel-band { position: absolute; left: 0; right: 0; top: 40px; height: 40px; border-radius: 12px; background: var(--line); pointer-events: none; }
.wheel-col { position: relative; width: 84px; height: 120px; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.wheel-col::-webkit-scrollbar { display: none; }
.wheel-pad { height: 40px; }
.wheel-item { height: 40px; line-height: 40px; text-align: center; font-size: 22px; font-variant-numeric: tabular-nums; color: var(--muted); scroll-snap-align: center; user-select: none; -webkit-user-select: none; }
.wheel-item.on { color: var(--text, inherit); font-weight: 600; }
.wheel-unit { font-size: 15px; color: var(--muted); min-width: 28px; }
.focus-whats { margin: 8px 0 4px; } .focus-whats .pill.sm { padding: 6px 12px; font-size: 14px; }
#focus-len .pill.active { background: var(--text); border-color: transparent; color: var(--bg); font-weight: 600; }   /* отмеченная длительность – как в .seg */
.focus-whats .pill.sm { max-width: calc(100% - var(--fab-size, 84px) - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* длинное название привычки не растягивает чип на всю ширину */
.sheet-actions.focus-acts { justify-content: flex-start; }   /* форма-страница: ряд идёт сразу за полями и может оказаться на уровне кнопки ассистента – кнопки слева, справа место ей */

/* ---------- смахнуть блок влево – «Скрыть» (Армен 18.11, вариант Б). Только экраны из блоков; вертикальная прокрутка – браузеру,
   вбок – нам (pan-y: без pointercancel и без passive:false на документе); ряды чипов, что листаются вбок, – свои */
#view-overview .card, #view-overview .block-wrap, #view-finance .card, #view-finance .block-wrap, #view-health .card, #view-health .block-wrap,
#view-journal .card, #view-journal .block-wrap, #view-calendar .card, #view-calendar .block-wrap, #view-documents .card, #view-documents .block-wrap { touch-action: pan-y pinch-zoom; }
.blk-swiping { position: relative; z-index: 2; }
.blk-host { position: relative; }   /* родитель смахиваемой карточки – на время жеста: полоса его соседом, не внутри карточки (WebKit режет по backdrop-filter) */
.blk-act { position: absolute; z-index: 1; width: 88px; border-radius: var(--radius); background: #2c2c2e; box-shadow: inset 0 0 0 1px rgba(244, 243, 238, .08); }
[data-theme="dark"] .blk-act { background: #48484a; }   /* заметно светлее фона и карточки тёмной темы */
.blk-hide { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0;
  border: 0; background: none; color: #f4f3ee; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.blk-hide .ico { width: 24px; height: 24px; }
.blk-hidden-foot { margin-top: 18px; }
/* смахнуть строку → «Удалить» (Армен 18.11): тот же жест, красная кнопка как в iOS Mail. Строка уезжает внутри своего списка – родитель
   на время жеста обрезает её (blk-clip; карточки-строки – привычки, цели – как блоки, полосой рядом). pan-y – вбок жест наш */
[data-ent], .op[data-act="tx"], .tl.tx[data-act="tx"], .row[data-act="person"], .row.todo, .list > .row, .doc, .jr-entry, .note[data-act="note"],
#hab-list > .card.habit, .card.goal[data-id] { touch-action: pan-y pinch-zoom; }
.blk-clip { overflow: hidden; overflow: clip; }
.blk-act.del { background: #ff3b30; box-shadow: none; }
[data-theme="dark"] .blk-act.del { background: #ff453a; }
.blk-act.del .blk-hide { color: #fff; gap: 3px; padding: 6px 0; font-size: 12px; }
.blk-act.del .blk-hide .ico { width: 20px; height: 20px; }
.blk-act.short .blk-hide { padding: 4px 0; } .blk-act.short .blk-hide .ico { display: none; }

/* Разбор почты: у каждого отправителя свой выбор и своя «Применить» (18.11, вариант Б). Ширина выбора – по самой длинной подписи:
   не помещается рядом с кнопкой (320, 16 px на телефоне) – кнопка уходит строкой ниже, подпись не обрезается */
.mc-row { display: block; }
.mc-row .mc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-b { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mc-b select.input { flex: 1 1 auto; width: auto; min-width: 0; min-height: 40px; font-size: 14px; }
.mc-b .pill { flex: 0 0 auto; min-height: 40px; margin-left: auto; }
.mc-all { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 10px; }
.mc-all .muted { font-size: 12px; }
/* подэкран (page()) всегда прокручивается: содержимое не ниже окна, запас под кнопку ассистента (padding-bottom карточки) остаётся сверху прокрутки – последний ряд любого короткого списка
   поднимается выше кнопки (Армен 18.11, «Что я о тебе узнал»; правило «прокрутка из-под кнопки» 12.11). Ряды не трогаем. Шторка: потолок 88vh, как у .sheet-card; страница: окно минус место кнопки. */
.sheet:not(.as-page) .sheet-card .set.page { flex-shrink: 0; min-height: calc(88vh - 20px - var(--fab-bot, 92px) - env(safe-area-inset-bottom, 0px)); }   /* + padding-bottom карточки = окно шторки + место кнопки: прокрутка ровно на кнопку, а не на пустой экран */
body.form-page .sheet.as-page .sheet-card .set.page { min-height: calc(100vh - var(--fab-bot, 92px)); min-height: calc(100dvh - var(--fab-bot, 92px)); }   /* dvh – видимое окно (в Safari вне PWA 100vh выше окна); прежняя строка – запасная для браузеров без dvh */

/* смена языка: пока перевод идёт, язык прежний (s/langswitch 20.11); полоса внизу, не перекрывает заголовок (20.11) */
.lang-switch { position: fixed; left: 12px; right: calc(var(--fab-edge, 14px) + var(--fab-size, 84px) + var(--fab-gap, 10px) + 4px); bottom: calc(env(safe-area-inset-bottom, 0px) + 100px); z-index: 60; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px; border-radius: 14px; background: #1c1c1e; color: #f4f3ee; font-size: 13px; line-height: 1.25; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; pointer-events: none; }   /* внизу слева от кнопки ассистента: заголовок и кнопки экрана не закрыты; fixed – раскладка не прыгает; без backdrop-filter (WebKit режет) */
.lang-switch.on { opacity: 1; transform: none; pointer-events: auto; }
.lang-switch .bar { flex: 1; min-width: 36px; height: 4px; border-radius: 2px; background: rgba(244, 243, 238, .2); overflow: hidden; }
.lang-switch .bar > i { display: block; height: 100%; width: 0; background: #c8f542; transition: width .3s; }
.lang-switch button { flex: none; background: none; border: 0; color: #c8f542; font: inherit; padding: 4px 2px; }
/* нет связи: тонкая строка в самом верху поверх верхнего поля – страница не сдвигается, шапку не накрывает */
.offline-bar { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 60; height: 18px; padding: 0 12px; text-align: center; font-size: 11px; line-height: 18px; color: var(--muted); background: var(--bg-2); pointer-events: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
