/* Endless — палитра бренда (brand/философия.md, «Цвет и голос»).
   Чернила #181818 — тишина и опора; лайм #CCFE00 — энергия, только там, где движение (прогресс, выполненное,
   цель, отправить); бумага, графит, серый — служебные. На светлом фоне лайм глубокий #8FB400: лайм на белый не ставим. */
:root {
  --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 1.3s ease; }
.splash { position: fixed; inset: 0; z-index: 100; background: #181818; color: #f4f3ee; display: flex; align-items: center; justify-content: center;
  transition: opacity 1.3s 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; }
/* тайминг: 0.5 с тишины → «Endless» 1.6 с → кольцо 1.3 с → кольцо 1.2 с → точка 0.9 с → пауза → переход */
.splash.play .word { animation: word 1.6s cubic-bezier(.16,1,.3,1) .5s forwards; }
.splash.play .r1 { animation: ring 1.3s cubic-bezier(.16,1,.3,1) 2.1s forwards; }
.splash.play .r2 { animation: ring 1.2s cubic-bezier(.16,1,.3,1) 3s forwards; }
.splash.play .dot { animation: dot .9s cubic-bezier(.16,1,.3,1) 3.9s forwards; }
.splash.play .halo { animation: halo 1.6s ease-out 4s 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); } }

/* подпись знака — только 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; }
.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; }
.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 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 .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; }
.empty { color: var(--muted); font-size: 13px; padding: 6px 2px; }
.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; border-radius: 50%; display: grid; place-items: center; flex: none;
  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; }
.goal .top { display: flex; align-items: center; gap: 16px; margin: 0; }

.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; }
.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); }
.heat .c.d { background: var(--lime); }
.heat .c.p { background: color-mix(in srgb, var(--lime) 45%, transparent); }
.heat .c.off { opacity: .25; }

.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: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-size: 13px; box-shadow: var(--shadow); z-index: 50; }

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; }
  .app { grid-template-columns: 1fr; height: 100%; height: 100dvh; }
  .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(96px + env(safe-area-inset-bottom)); }
  .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: color-mix(in srgb, var(--bg-2) 85%, transparent); backdrop-filter: blur(14px);
    overflow-x: auto;
  }
  .bottom a { flex-direction: column; gap: 2px; padding: 6px 8px; font-size: 10px; min-width: 56px; }
  .bottom a i { font-size: 16px; }
  .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 .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); }
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(84px + 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; } }
.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; }
.seg.wide { display: flex; } .seg.wide button { flex: 1; }
.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; cursor: pointer; }

/* телефон: ничего не шире экрана */
.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; }
  .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; }
}
/* операции списком */
.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); }
.click { cursor: pointer; }
/* потрачено за день */
.spent-nav { display: flex; align-items: center; gap: 6px; }
.spent-nav span { flex: 1; text-align: center; }
.spent-nav .mini { padding: 0 8px; line-height: 20px; }
/* списки */
.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: 150px; font-size: 22px; letter-spacing: .18em; text-align: center; padding: 10px 8px; font-variant-numeric: tabular-nums; }
.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, .bottom 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 { right: 14px; bottom: 92px; width: 84px; height: 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:active { transform: scale(.95); }
@media (max-width: 860px) { .fab.agent { bottom: calc(152px + env(safe-area-inset-bottom)); } .fab.agent:only-of-type, .fab.hidden + .fab.agent { bottom: calc(84px + env(safe-area-inset-bottom)); } }
.chat-view { display: flex; flex-direction: column; height: calc(100vh - 160px); min-height: 320px; }
.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; }
.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 .src { opacity: .7; }
.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; }
.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.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 .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: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; cursor: pointer; }
.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); }
.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 .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; }

/* ---------- 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%; }
.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; }
.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; }
.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 { flex: none; width: 84px; height: 84px; border-radius: 50%; border: 1.5px solid var(--line); background: #181818; color: #f4f3ee; display: grid; place-items: center; cursor: pointer; touch-action: manipulation; }
.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: 65; }
/* голос из карточки: карточка закрывает нижнее меню — полоса текста прямо у нижнего края */
body.quick:has(.sheet:not(.hidden)) .vbar { bottom: calc(12px + env(safe-area-inset-bottom)); }
.vbar { position: fixed; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); height: 14vh; min-height: 68px;
  z-index: 44; background: var(--bg-2); color: var(--text); border: 1.5px solid #CCFE00; border-radius: 18px; padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 861px) { .vbar { bottom: 24px; left: auto; width: 520px; } }
.vbar .vhead { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.vbar .vx { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.vbar .vtext { flex: 1; overflow-y: auto; font-size: 16px; line-height: 1.4; white-space: pre-wrap; }
body.quick .fab:not(.agent) { display: none; }
body.quick #fab-chat { bottom: calc(84px + 14vh + 14px + env(safe-area-inset-bottom)); }
@media (min-width: 861px) { body.quick #fab-chat { bottom: calc(24px + 14vh + 14px); } }


/* компактность: свёрнутые блоки, «показать все», период платежей */
h3.coll { cursor: pointer; user-select: none; -webkit-user-select: none; }
h3.coll::after { content: " ▾"; color: var(--muted); font-size: 11px; }
.card.collapsed h3.coll::after { content: " ▸"; }
.card.collapsed > *:not(h3):not(.card-head) { display: none !important; }
.card.collapsed > .card-head > *:not(h3) { display: none !important; }
.card.collapsed { padding-bottom: 12px; }
.card.collapsed > h3, .card.collapsed > .card-head { margin-bottom: 0; }
.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; } }

/* голос: черновик текущей фразы — серым над полем; в поле только готовый текст */
.chat-live { margin: 0 4px 6px; padding: 6px 12px; border-radius: 12px; font-size: 15px; line-height: 1.35; color: var(--muted); background: color-mix(in srgb, var(--text) 5%, transparent); font-style: italic; }
.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-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; }
.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-composer { display: flex; gap: 8px; align-items: flex-end; padding: 8px 0 0; }
.g-composer .input { flex: 1; width: auto; font-size: 16px; padding: 10px 12px; resize: none; max-height: 140px; line-height: 1.35; border-radius: 16px; }
.g-composer button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 17px; cursor: pointer; flex: none; }
.g-composer .g-send { background: var(--primary-bg); color: var(--primary-fg); border: 0; }
.g-composer .g-ai { color: var(--text); font-weight: 700; }
.g-composer .g-mic.rec { background: var(--bad); color: #fff; border-color: transparent; }
.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; }
