/* calendar.css — Общий календарь (BM-50). Telegram Mini App.
 *
 * Палитра и геометрия перенесены из финального макета Claude Design
 * (claude-design/Общий календарь.dc.html, «правки Nik (v2)»). Цвета форматов — зеркало web/js/format.js.
 *
 * Порт: статичная геометрия — в классах; зависящие от СОСТОЯНИЯ цвета (сегодня/выбран/прошёл/формат)
 * выражены классами-модификаторами (.is-today, .is-selected, .fmt-blue …), которые проставляет вью.
 */

:root {
  --bg:#FBF7F1; --surface:#ffffff; --surface2:#F4EDE3;
  --ink:#27313C; --ink2:#5C6671; --ink3:#9aa0a8;
  --line:#EDE6DB;
  --accent:#E0857A; --accentDeep:#C96A5C; --accentSoft:#FBE7E1;
  --amberInk:#a9762f; --amberSoft:#F5ECDD;
  --ok:#5E9C6B; --okSoft:#E9F1E9; --okText:#4E7E5A;
  --weekend:#F6F0E6;

  /* категории действий (раздел «Действия») — медицина / образ жизни / психология */
  --med:#4d6c92; --medSoft:#E8EEF4;
  --life:#5f7a57; --lifeSoft:#EAF0E7;
  --psy:#6f6090; --psySoft:#EDE8F4;

  /* палитра форматов теперь в JS (web/js/format.js); цвета приходят инлайном через --c-bg/--c-text/--c-dot */

  --f:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html, body { margin: 0; height: 100%; }
body { background: #E7E2D9; color: var(--ink); font-family: var(--f); }

.app {
  position: relative; display: flex; flex-direction: column;
  width: 100%; max-width: 440px; margin: 0 auto;
  height: 100vh; height: 100dvh;
  background: var(--bg); color: var(--ink); overflow: hidden; isolation: isolate;
}
.app__top { padding-top: env(safe-area-inset-top, 0px); }

/* «Экран» (всё над таб-баром) — flex-колонка, занимающая высоту между верхом и таб-баром.
 * Без этого .feed { flex:1 } не работал бы (родитель не flex), и лента растягивала бы страницу. */
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* Десктоп-превью: показываем приложение как телефон в рамке по центру.
 * На мобиле / в Telegram (узкий вьюпорт) — на всю высоту, без рамки. */
@media (min-width: 480px) {
  body { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
  .app {
    height: min(860px, 100vh - 24px);
    border-radius: 30px;
    box-shadow: 0 2px 4px rgba(40,30,20,.05), 0 30px 70px -24px rgba(40,30,20,.34);
  }
}

.noscroll { -ms-overflow-style: none; scrollbar-width: none; }
.noscroll::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: reduce) { * { transition-duration: 0.01ms !important; } }

/* формат-цвета: --c-bg/--c-text/--c-dot проставляет вью инлайном из палитры JS (format.js) */

/* ─────────── шапка ─────────── */
.hdr { flex: none; padding: 6px 20px 0; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand__icon { width: 40px; height: 40px; border-radius: 13px; background: var(--accent); display: flex;
  align-items: center; justify-content: center; box-shadow: 0 4px 12px -4px rgba(224,133,122,.7); }
.brand__title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--surface2); display: flex;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--accentDeep); }

/* ─────────── сегмент-табы День/Неделя/Месяц ─────────── */
.segtabs { flex: none; margin: 16px 20px 0; display: flex; gap: 4px; background: var(--surface2);
  border-radius: 13px; padding: 4px; }
.segtab { flex: 1; text-align: center; padding: 8px 0; font-size: 13.5px; font-weight: 600;
  border-radius: 9px; cursor: pointer; color: var(--ink2); user-select: none; }
.segtab.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(40,30,20,.08); }

/* ─────────── полоса дней ─────────── */
.strip { flex: none; display: flex; justify-content: space-between; gap: 2px; padding: 14px 18px 10px; touch-action: pan-y; }
.strip__cell { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.strip__wd { font-size: 11px; font-weight: 600; color: var(--ink3); }
.strip__wd.is-accent { color: var(--accentDeep); }
.strip__num { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; color: var(--ink); border: 1.5px solid transparent; }
.strip__dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.strip__dot.has { background: var(--c-dot); }

/* общие модификаторы кружка дня (полоса + лента) */
.is-weekend { background: var(--weekend); }
.is-today   { border: 1.5px solid var(--accent) !important; color: var(--accentDeep) !important; background: transparent !important; }
.is-selected{ background: var(--accent) !important; color: #fff !important; border: 1.5px solid var(--accent) !important;
  box-shadow: 0 4px 10px -2px rgba(224,133,122,.6); font-weight: 700; }
.is-out { color: #C9C2B7 !important; text-decoration: line-through; }

/* ─────────── чипы фильтра ─────────── */
.chips { flex: none; display: flex; gap: 8px; padding: 12px 18px; overflow-x: auto; }
.chip { flex: none; display: flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 20px;
  font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; user-select: none;
  color: var(--ink2); background: var(--surface); border: 1px solid var(--line); }
.chip.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-dot); }

.divider { flex: none; height: 1px; background: var(--line); margin: 0 20px; }

/* ─────────── лента ─────────── */
.feed { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px 22px; }

.daygroup { display: flex; gap: 11px; margin-bottom: 12px; }
.daynum { width: 40px; flex: none; text-align: center; padding-top: 7px; }
.daynum__circle { width: 34px; height: 34px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 15px; font-weight: 700; line-height: 1; color: var(--ink); border: 1.5px solid transparent; }
.daynum__circle.is-past { color: var(--ink3); }
.daynum__wd { font-size: 11px; font-weight: 600; color: var(--ink3); margin-top: 4px; }
.daynum__wd.is-accent { color: var(--accentDeep); }

.daycard { flex: 1; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(40,30,20,.03); }
.daycard.is-muted { background: #FAF6F0; box-shadow: none; }
.daycard.is-dashed { border-style: dashed; }
.daycard.is-past { background: #F7F2EB; box-shadow: none; }

.event { display: flex; align-items: center; gap: 11px; padding: 10px 11px; cursor: pointer; }
.event.is-static { cursor: default; }
.event__sep { height: 1px; background: var(--line); margin: 0 11px; }

.event__time { width: 52px; height: 46px; flex: none; border-radius: 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; background: var(--c-bg); color: var(--c-text); }
.event__time--past { background: #EFEAE2; color: var(--ink3); }
.event__time--muted { background: #EFE9E2; color: var(--ink3); }
.event__time .t-start { font-size: 13px; font-weight: 700; }
.event__time .t-end { font-size: 9.5px; opacity: .7; }
.event__time--allday { text-align: center; }
.event__time--allday span { font-size: 10px; font-weight: 700; line-height: 1.15; }
.event__time--cancel .t-start { text-decoration: line-through; }

.event__body { flex: 1; min-width: 0; }
.event__title { font-size: 14.5px; font-weight: 650; line-height: 1.3; color: var(--ink); }
.event__title.is-muted { font-size: 14px; font-weight: 600; color: var(--ink3); }
.event__title.is-strike { text-decoration: line-through; }
.event__meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12.5px; color: var(--ink2); flex-wrap: wrap; }
.event__meta .sep { color: var(--line); }
.event__meta .muted { color: var(--ink3); }
.event__info-btn { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); color: var(--ink3);
  display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-style: italic; font-family: Georgia, serif; flex: none; }
.event__badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; flex: none; }
.badge--cancel { background: #ECE6DF; color: var(--ink2); }
.badge--moved { background: var(--amberSoft); color: var(--amberInk); }
.event__note { font-size: 12px; color: var(--ink3); margin-top: 3px; line-height: 1.4; }

.event__add { width: 30px; height: 30px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  cursor: pointer; background: #fff; border: 1px solid var(--line); color: var(--accentDeep); }
.event__add.is-added { background: var(--okSoft); border-color: var(--ok); color: var(--okText); }
.event__add .plus { font-size: 19px; line-height: 1; }

/* разделители ленты */
.gap { display: flex; align-items: center; gap: 10px; padding: 8px 2px 14px; }
.gap__line { flex: 1; height: 1px; background: var(--line); }
.gap__label { font-size: 11.5px; color: var(--ink3); white-space: nowrap; }
.weeksep { display: flex; align-items: center; gap: 7px; margin: 6px 0 14px; }
.weeksep__label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accentDeep); white-space: nowrap; }
.weeksep__line { flex: 1; height: 1px; background: var(--line); }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 54px 20px; text-align: center; gap: 10px; }
.empty__icon { width: 54px; height: 54px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; }
.empty__title { font-size: 15px; font-weight: 650; color: var(--ink); }
.empty__sub { font-size: 13px; color: var(--ink3); max-width: 240px; line-height: 1.45; }

/* ─────────── сетка месяца ─────────── */
.monthnav { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 14px; }
.monthnav__btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.monthnav__btn.is-disabled { color: var(--ink3); cursor: default; }
.monthnav__title { font-size: 16px; font-weight: 700; }
.monthnav__count { font-size: 12px; color: var(--ink3); margin-top: 1px; }
.monthwd { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; margin-bottom: 6px; }
.monthwd span { text-align: center; font-size: 11px; font-weight: 600; color: var(--ink3); }
.monthwd span.we { color: var(--accentDeep); }
.monthgrid { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.mcell { aspect-ratio: 1/1; border-radius: 11px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; border: 1.5px solid transparent; }
.mcell__num { font-size: 13.5px; font-weight: 500; color: var(--ink3); }
.mcell__dots { display: flex; gap: 2px; height: 5px; align-items: center; }
.mcell__dots .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--c-dot); }
.mcell.is-weekend { background: var(--weekend); }
.mcell.has-events { background: var(--surface); box-shadow: 0 1px 2px rgba(40,30,20,.06); cursor: pointer; }
.mcell.has-events .mcell__num { color: var(--ink); font-weight: 700; }
.mcell.is-clickable { cursor: pointer; }
.mcell.is-out .mcell__num { color: #C9C2B7; text-decoration: line-through; }
.mcell.is-past .mcell__num { color: #ADA69B; }
.mcell.is-today { border-color: var(--accent); cursor: pointer; }
.mcell.is-today .mcell__num { color: var(--accentDeep); font-weight: 700; }
.mcell.is-match { border-color: var(--ok); cursor: pointer; }
.mcell.is-match .mcell__num { font-weight: 700; }
.mcell.is-selected { background: var(--accent); box-shadow: 0 4px 10px -2px rgba(224,133,122,.55); border-color: var(--accent); cursor: pointer; }
.mcell.is-selected .mcell__num { color: #fff; font-weight: 700; }
.mcell.is-selected .mcell__dots .dot { background: rgba(255,255,255,.85); }
.monthfeed-title { display: flex; align-items: center; gap: 10px; padding: 20px 2px 4px; }
.monthfeed-title__label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink3); white-space: nowrap; }
.monthfeed-title__reset { display: flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--accentDeep); cursor: pointer; white-space: nowrap; }
.monthfeed-title__line { flex: 1; height: 1px; background: var(--line); }

/* ─────────── нижний таб-бар ─────────── */
.tabbar { flex: none; background: var(--surface); border-top: 1px solid var(--line);
  padding: 9px 16px calc(26px + env(safe-area-inset-bottom, 0px)); display: flex; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink3); }
.tab.is-active { color: var(--accentDeep); }
.tab.is-disabled { opacity: .55; }
.tab span { font-size: 11px; font-weight: 500; }
.tab.is-active span { font-weight: 600; }

/* ─────────── шторки (событие + ведущая) ─────────── */
.scrim { position: absolute; inset: 0; background: rgba(34,28,22,.42); opacity: 0; transition: opacity .28s ease;
  pointer-events: none; z-index: 40; }
.scrim.is-open { opacity: 1; pointer-events: auto; }
.scrim--host { background: rgba(34,28,22,.5); z-index: 50; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--bg);
  border-radius: 26px 26px 0 0; box-shadow: 0 -12px 44px -14px rgba(34,28,22,.34);
  transform: translateY(100%); transition: transform .34s cubic-bezier(.32,.72,0,1); max-height: 90%; display: flex; flex-direction: column; }
.sheet.is-open { transform: translateY(0); }
.sheet--host { z-index: 51; max-height: 92%; }
.sheet__handle { flex: none; display: flex; justify-content: center; padding: 10px 0 2px; }
.sheet__handle i { width: 40px; height: 4px; border-radius: 2px; background: var(--line); display: block; }
.sheet__body { overflow-y: auto; padding: 10px 22px 30px; }

.sheet__fmt { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink2);
  background: var(--surface2); padding: 4px 11px; border-radius: 20px; }
.sheet__fmt .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-dot); }
.sheet__title { font-size: 23px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; margin-top: 12px; }
/* тема выпуска (about) — раскрывающий подзаголовок сразу под названием (реш. владельца 2026-08-10:
 * без плашки и заголовка «Тема») */
.sheet__topic { font-size: 15.5px; font-weight: 600; color: var(--ink2); line-height: 1.35; margin-top: 5px; }
.sheet__cancel { margin-top: 12px; padding: 11px 13px; background: #F1EBE3; border-radius: 13px; display: flex; gap: 9px; align-items: flex-start; }
.sheet__cancel .tag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: #E3DBD1; color: var(--ink2); flex: none; }
.sheet__cancel .why { font-size: 13px; color: var(--ink2); line-height: 1.45; }
.sheet__rows { margin-top: 18px; display: flex; flex-direction: column; gap: 13px; }
.sheet__row { display: flex; align-items: center; gap: 11px; font-size: 14.5px; color: var(--ink); }
.sheet__host { margin-top: 18px; padding: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px;
  display: flex; align-items: center; gap: 12px; cursor: pointer; }
.sheet__host .ava { width: 44px; height: 44px; border-radius: 50%; background: var(--surface2); color: var(--accentDeep);
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; flex: none; }
.sheet__host .cap { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink3); }
.sheet__host .nm { font-size: 15px; font-weight: 650; margin-top: 1px; }
.sheet__host .rl { font-size: 13px; color: var(--accentDeep); margin-top: 1px; }
.sheet__info { margin-top: 16px; padding: 14px 15px; background: var(--accentSoft); border-radius: 15px; }
.sheet__info .cap { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accentDeep); margin-bottom: 6px; }
.sheet__info .txt { font-size: 14px; line-height: 1.5; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border-radius: 14px;
  font-size: 15px; font-weight: 650; cursor: pointer; }
.btn--add { margin-top: 20px; padding: 15px; background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px rgba(224,133,122,.8); }
.btn--added { margin-top: 20px; padding: 14px; background: var(--okSoft); color: var(--okText); border: 1.5px solid var(--ok); }
.btn--share { margin-top: 11px; padding: 13px; background: transparent; color: var(--ink2); border: 1px solid var(--line); font-size: 14.5px; font-weight: 600; }
.sheet__remind { font-size: 12px; color: var(--ink3); text-align: center; margin-top: 9px; line-height: 1.4; }

/* шторка ведущей */
.host__head { display: flex; align-items: center; gap: 15px; }
.host__ava { width: 72px; height: 72px; border-radius: 50%; flex: none; background: linear-gradient(150deg,var(--accentSoft),var(--surface2));
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; color: var(--accentDeep); border: 1px solid var(--line); }
.host__name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.host__role { font-size: 14px; color: var(--accentDeep); font-weight: 600; margin-top: 3px; }
.host__specs { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.host__spec { font-size: 12.5px; font-weight: 600; color: var(--ink2); background: var(--surface2); padding: 6px 12px; border-radius: 20px; }
.host__bio { font-size: 14px; line-height: 1.55; margin-top: 16px; }
.host__cap { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink3); margin: 22px 0 10px; }
.host__contacts { display: flex; flex-direction: column; gap: 9px; }
.host__contact { display: flex; align-items: center; gap: 12px; padding: 11px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.host__contact .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--surface2); display: flex; align-items: center; justify-content: center; flex: none; color: var(--ink2); }
.host__contact .lbl { font-size: 11px; color: var(--ink3); }
.host__contact .val { font-size: 14px; font-weight: 600; }
.host__back { display: flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--ink2); cursor: pointer; }
.host__bar { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 18px 4px; }

/* ─────────── кнопка поиска в шапке (вместо аватара) ─────────── */
.hdr-search { width: 36px; height: 36px; border-radius: 50%; background: var(--surface2); display: flex;
  align-items: center; justify-content: center; color: var(--accentDeep); cursor: pointer; flex: none; }
.hdr-search:active { background: var(--line); }

/* ─────────── крупная карточка (день-вью) ─────────── */
.bigcard { position: relative; margin-bottom: 14px; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; padding: 16px 16px 15px 19px; box-shadow: 0 2px 12px -5px rgba(40,30,20,.1);
  cursor: pointer; overflow: hidden; }
.bigcard.is-static { cursor: default; }
.bigcard.is-past { opacity: .62; }
.bigcard__accent { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.bigcard__head { display: flex; align-items: center; gap: 8px; }
.bigcard__spacer { flex: 1; }
.bigcard__fmt { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 20px;
  background: var(--c-bg); color: var(--c-text); font-size: 12px; font-weight: 700; flex: none; }
.bigcard__fmt .dot { width: 7px; height: 7px; border-radius: 50%; }
.bigcard__badge { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px; flex: none; }
.bigcard__badge.is-cancel { background: #ECE6DF; color: var(--ink2); }
.bigcard__badge.is-moved { background: var(--amberSoft); color: var(--amberInk); }
.bigcard__time { display: flex; align-items: baseline; gap: 4px; flex: none; }
.bigcard__time .t { font-size: 17px; font-weight: 750; letter-spacing: -.01em; color: var(--ink); }
.bigcard__time .z { font-size: 11px; font-weight: 600; color: var(--ink3); }
.bigcard__title { font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; margin-top: 11px; color: var(--ink); }
.bigcard__title.is-muted { color: var(--ink3); }
.bigcard__title.is-strike { text-decoration: line-through; }
.bigcard__info { font-size: 13.5px; color: var(--ink2); line-height: 1.5; margin-top: 7px; }
.bigcard__note { font-size: 13px; color: var(--ink3); line-height: 1.45; margin-top: 7px; font-style: italic; }
.bigcard__host { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.bigcard__host .ava { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--surface2);
  display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; color: var(--accentDeep); }
.bigcard__host .who { flex: 1; min-width: 0; }
.bigcard__host .nm { font-size: 13.5px; font-weight: 650; color: var(--ink); line-height: 1.25; }
.bigcard__host .rl { font-size: 12px; color: var(--ink3); line-height: 1.25; }
.bigcard__place { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink2); flex: none; }

/* ─────────── «событие уже прошло» в шторке ─────────── */
.sheet__past { margin-top: 20px; display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px; border-radius: 14px; background: var(--surface2); color: var(--ink3); font-size: 15px; font-weight: 600; }

/* ─────────── оверлей поиска ─────────── */
.search { position: absolute; inset: 0; z-index: 70; background: var(--bg); display: flex; flex-direction: column;
  opacity: 0; pointer-events: none; transform: translateY(-6px); transition: opacity .2s ease, transform .28s cubic-bezier(.32,.72,0,1); }
.search.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.search__bar { flex: none; display: flex; align-items: center; gap: 11px; padding: calc(48px + env(safe-area-inset-top, 0px)) 18px 12px; }
.search__field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; background: var(--surface2); border-radius: 13px; padding: 10px 13px; }
.search__input { flex: 1; min-width: 0; border: none; background: transparent; outline: none; font-size: 15px; color: var(--ink); font-family: inherit; }
.search__clear { width: 19px; height: 19px; flex: none; border-radius: 50%; background: var(--line); display: flex; align-items: center; justify-content: center; color: var(--bg); cursor: pointer; }
.search__cancel { flex: none; font-size: 14.5px; font-weight: 600; color: var(--accentDeep); cursor: pointer; }
.search__body { flex: 1; overflow-y: auto; padding: 4px 18px 22px; }
.search__idle, .search__none { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 24px; text-align: center; gap: 12px; }
.search__idleIcon { width: 56px; height: 56px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; color: var(--accentDeep); }
.search__idleText { font-size: 14px; color: var(--ink3); max-width: 230px; line-height: 1.5; }
.search__none { gap: 10px; }
.search__noneTitle { font-size: 15px; font-weight: 650; color: var(--ink); }
.search__noneSub { font-size: 13px; color: var(--ink3); max-width: 230px; line-height: 1.45; }
.search__count { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink3); margin: 8px 2px; }
.sresult { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.sresult:active { opacity: .6; }
.sresult__dot { width: 9px; height: 9px; flex: none; border-radius: 50%; }
.sresult__dot.is-past { opacity: .45; }
.sresult__body { flex: 1; min-width: 0; }
.sresult__top { display: flex; align-items: center; gap: 7px; }
.sresult__title { font-size: 15px; font-weight: 650; color: var(--ink); line-height: 1.3; }
.sresult__title.is-past { color: var(--ink3); }
.sresult__past { flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; padding: 2px 7px; border-radius: 20px; background: var(--surface2); color: var(--ink3); }
.sresult__meta { font-size: 12.5px; color: var(--ink2); margin-top: 2px; }
.sresult__host { font-size: 12px; color: var(--ink3); margin-top: 1px; }

/* ─────────── поп-ап подтверждения удаления из личного ─────────── */
.confirm { position: absolute; inset: 0; z-index: 80; background: rgba(34,28,22,.5); display: flex; align-items: center; justify-content: center;
  padding: 34px; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.confirm.is-open { opacity: 1; pointer-events: auto; }
.confirm__box { width: 100%; max-width: 300px; background: #fff; border-radius: 22px; padding: 24px 20px 18px; text-align: center;
  box-shadow: 0 24px 60px -18px rgba(34,28,22,.5); transform: scale(.92); transition: transform .2s ease; }
.confirm.is-open .confirm__box { transform: scale(1); }
.confirm__icon { width: 48px; height: 48px; border-radius: 50%; background: var(--accentSoft); color: var(--accentDeep);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 13px; }
.confirm__title { font-size: 17px; font-weight: 700; line-height: 1.3; }
.confirm__sub { font-size: 13px; color: var(--ink2); margin-top: 8px; line-height: 1.5; }
.confirm__btns { display: flex; gap: 9px; margin-top: 18px; }
.confirm__btn { flex: 1; padding: 12px; border-radius: 13px; font-size: 14.5px; font-weight: 650; cursor: pointer; }
.confirm__btn.is-no { background: var(--surface2); color: var(--ink); }
.confirm__btn.is-no:active { background: var(--line); }
.confirm__btn.is-yes { background: var(--accent); color: #fff; box-shadow: 0 8px 18px -8px rgba(224,133,122,.8); }
.confirm__btn.is-yes:active { transform: scale(.98); }

/* ═══════════════════════════ Личный календарь (BM-70) ═══════════════════════════
 * Экран Личного — отдельный корень (#personalRoot), переключается таб-баром. Вёрстка содержимого
 * инлайн-стилями 1:1 с макетом Claude Design; здесь — только каркас корня, скролл, липкая строка,
 * шторки/скрим, поп-апы, тост (поведенческие части на классах с переходами). Шторки/тост — зеркало
 * геометрии Общего (см. .scrim/.sheet/.confirm выше). */

/* два экрана-корня внутри .app (Общий/Личный); неактивный скрыт */
.root { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.root.is-hidden { display: none; }

/* шапка Личного */
.p-statusbar { flex: none; height: env(safe-area-inset-top, 0px); }
.p-hdr { flex: none; padding: 8px 20px 14px; display: flex; align-items: center; justify-content: space-between; }
.p-hdr__icon { width: 40px; height: 40px; border-radius: 13px; background: var(--accent); display: flex;
  align-items: center; justify-content: center; flex: none; box-shadow: 0 4px 12px -4px rgba(224,133,122,.7); }
.p-hdr__ava { width: 36px; height: 36px; border-radius: 50%; background: var(--surface2); display: flex;
  align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--accentDeep); flex: none; }

/* липкая свёрнутая строка дорожной карты (появляется при скролле) */
.p-compact { flex: none; overflow: hidden; max-height: 0; opacity: 0; padding: 0 18px;
  transition: max-height .3s ease, opacity .22s ease; background: var(--bg); box-shadow: 0 6px 14px -13px rgba(40,30,20,.5); z-index: 3; }
.p-compact.is-shown { max-height: 74px; opacity: 1; padding: 6px 18px 8px; }

/* область экрана + скролл */
.p-screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.p-scroll { flex: 1; min-height: 0; overflow-y: auto; }

/* эпизоды-слайдер и карточки строки — активные состояния как в макете */
.p-ep { user-select: none; }
.p-event:active { background: var(--surface2); }
/* карусель эпизодов: строго горизонтальная — вертикальное «качание» при свайпе убрано
   (фидбэк владельца 2026-07-12) */
.p-epis { overflow-y: hidden; touch-action: pan-x; overscroll-behavior-x: contain; }
/* «Смотреть»: видимый отклик нажатия (фидбэк 2026-07-12) — :active инлайном не задать */
.p-ep [data-pa="watchEpisode"] { transition: transform .08s ease, filter .08s ease; }
.p-ep [data-pa="watchEpisode"]:active { transform: scale(.94); filter: brightness(.92); }
/* скролл внутри шторок не «оттягивает» фон на краях (фидбэк 2026-07-12) */
.p-sheetscroll, .sheet__body { overscroll-behavior: contain; }

/* чипы-фильтр: липкие сверху ленты */
.p-chipbar { position: sticky; top: -6px; z-index: 4; background: var(--bg); padding: 6px 0 10px; margin: 0 -18px;
  display: flex; flex-direction: column; gap: 10px; }

/* шторки Личного (скрим + лист), зеркало геометрии Общего */
.p-scrim { position: absolute; inset: 0; background: rgba(34,28,22,.42); opacity: 0; transition: opacity .28s ease;
  pointer-events: none; z-index: 50; }
.p-scrim.is-open { opacity: 1; pointer-events: auto; }
.p-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--bg);
  border-radius: 26px 26px 0 0; box-shadow: 0 -12px 44px -14px rgba(34,28,22,.34);
  transform: translateY(100%); transition: transform .34s cubic-bezier(.32,.72,0,1); max-height: 92%; display: flex; flex-direction: column; }
.p-sheet.is-open { transform: translateY(0); }
.p-handle { flex: none; display: flex; justify-content: center; padding: 10px 0 2px; }
.p-handle i { width: 40px; height: 4px; border-radius: 2px; background: var(--line); display: block; }
.p-sheetscroll { overflow-y: auto; padding: 10px 22px 28px; }
.p-sheetx { width: 30px; height: 30px; border-radius: 50%; background: var(--surface2); display: flex;
  align-items: center; justify-content: center; color: var(--ink3); cursor: pointer; flex: none; }

/* поп-апы (пропущенный этап + подтверждение удаления) */
.p-pop { position: absolute; inset: 0; z-index: 70; background: rgba(34,28,22,.5); display: flex; align-items: center;
  justify-content: center; padding: 34px; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.p-pop.is-open { opacity: 1; pointer-events: auto; }
.p-pop__box { width: 100%; max-width: 300px; background: #fff; border-radius: 22px; padding: 24px 20px 18px; text-align: center;
  box-shadow: 0 24px 60px -18px rgba(34,28,22,.5); transform: scale(.92); transition: transform .2s ease; }
.p-pop.is-open .p-pop__box { transform: scale(1); }

/* тост. Длинный текст переносится, а не вылезает за экран (фидбэк 2026-07-09): max-width от ширины
 * приложения, перенос строк, центрирование. */
.p-toast { position: absolute; left: 50%; bottom: calc(98px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(12px); opacity: 0; transition: opacity .25s ease, transform .25s ease;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 600;
  pointer-events: none; z-index: 85; max-width: calc(100% - 44px); box-sizing: border-box; width: max-content;
  white-space: normal; text-align: center; line-height: 1.4; box-shadow: 0 10px 28px -10px rgba(0,0,0,.45); }
.p-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Бейдж «демо-данные» (аудит 1.4): виден всегда, пока источник — встроенная фикстура (?fixture).
 * Fixed на body (перерисовки #app его не смывают), поверх всего, кликам не мешает. */
.demo-badge { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 50%;
  transform: translateX(-50%); z-index: 9999; pointer-events: none;
  background: var(--amberSoft); color: var(--amberInk); border: 1px solid currentColor;
  border-radius: 999px; padding: 3px 12px;
  font: 700 11px/1.4 var(--f); letter-spacing: .07em; text-transform: uppercase;
  box-shadow: 0 6px 18px -8px rgba(34,28,22,.4); }
