
/* ---------- DESIGN TOKENS: единая палитра для светлой и ночной темы ---------- */
:root {
  --surface-0: #fbf6ef;
  --surface-1: #fffdf9;
  --surface-2: #f8f1e6;
  --surface-3: #f2e8d8;
  --surface-warn: #fff4e5;
  --surface-tint-warm: #ffe9d4;
  --surface-tint-cool: #e9f2ed;
  --text-1: #23201d;
  --text-2: #4c453e;
  --text-3: #7a6f65;
  --on-brand: #ffffff;
  --border-1: #e8ddcf;
  --border-strong: #d9cbb9;
  --border-2: rgba(46, 36, 26, .14);
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --shadow-color: rgba(60, 45, 30, .08);
  --brand: #1f4b43;
  --brand-dark: #163a34;
  --brand-soft: #e4efeb;
  --brand-line: #cfe3dc;
  --brand-grad-top: #256055;
  --accent: #c97b4a;
  --accent-dark: #a95f33;
  --accent-soft: #f6e7d9;
  --ok: #2f6b45;
  --ok-soft: #eaf5ea;
  --danger: #a8443a;
  --danger-soft: #fbeceb;
  --danger-line: #f0c8c4;
  /* загруженность дня в календаре: 1 — всё свободно … 5 — занято (фирменная шкала) */
  --cal-load-1: #eaf3f0;
  --cal-load-2: #cfe4de;
  --cal-load-3: #a6ccc1;
  --cal-load-4: #6aa79a;
  --cal-load-5: #1f4b43;
  --cal-load-line: rgba(46, 36, 26, .12);
}


/* ============================================================
   Кабинет: оформление в стиле лендинга — тёплое стекло,
   фотоподложка, антиква в заголовках. Подключается ПОСЛЕ
   встроенных стилей cabinet.html, чтобы их переопределять.
   ============================================================ */

/* Фон: фотоподложка с размытием из glass.css работает и здесь */
body { background: transparent; }

/* Заголовок кабинета */
.cab-head {
  padding: 4px 0 2px;
}
.cab-head h1 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: -.01em;
}

/* Вкладки — стеклянные «пилюли» */
.tab {
  background: var(--glass);
  border: 1px solid var(--glass-strong);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 2px 8px var(--border-2);
  transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.tab:hover { border-color: var(--brand); color: var(--brand); }
.tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 8px 20px rgba(31, 75, 67, .25);
}

/* Карточки, занятия, строки — тёплое стекло */
.card,
.lesson,
.child-card,
.slot-row,
.cal-cell,
.pay-table,
.calc-card {
  background: var(--glass);
  border: 1px solid var(--glass-strong);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--glass-strong), 0 10px 30px var(--border-2);
}

.lesson time {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--brand-dark);
}
.lesson .who b { font-size: 1rem; }

/* Чипы статусов — мягкие, полупрозрачные */
.chip {
  background: var(--glass);
  border: 1px solid var(--glass-strong);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.chip.done { background: rgba(228, 239, 235, .85); }
.chip.cancelled { background: rgba(251, 236, 235, .9); }
.chip.paid { background: rgba(234, 245, 234, .9); }
.chip.unpaid { background: rgba(255, 244, 229, .9); }

/* Поля ввода — на стекле */
.input, .daybar .input, select.input, textarea {
  background: var(--glass-strong);
}
.input:focus { background: var(--surface-1); }

/* Таблицы оплат */
.pay-table th { background: var(--glass); }
.pay-table td { background: var(--glass); }

/* Календарь */
.cal-cell { background: var(--glass); }
.cal-cell.empty { background: transparent; box-shadow: none; border-color: transparent; }
.cal-cell.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand), 0 8px 24px rgba(31, 75, 67, .12); }
.cal-slot.free {
  background: rgba(31, 75, 67, .14);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.cal-slot.taken {
  background: var(--accent);
  box-shadow: 0 4px 10px rgba(201, 123, 74, .25);
}

/* Модальные окна — плотное стекло, чтобы формы читались */
.overlay {
  background: rgba(35, 32, 29, .42);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal {
  background: rgba(253, 249, 243, .95);
  border: 1px solid var(--glass-strong);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 30px 80px var(--border-2);
}
.modal h2 { font-family: var(--font-display); font-weight: 400; }

/* Дневник, отчёт, сводка */
.report {
  background: var(--glass);
  border: 1px solid var(--glass-strong);
  border-radius: var(--radius-sm);
}

/* Уведомления */
.toast {
  background: var(--brand-dark);
  box-shadow: 0 12px 30px rgba(31, 75, 67, .3);
}

/* Мобильная адаптация: меньше размытия */
@media (max-width: 760px) {
  .card, .lesson, .child-card, .slot-row, .cal-cell, .modal {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  .tab { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
}

/* ---------- CAB-ACTIONS: шапка кабинета ---------- */
.cab-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
}
.cab-actions .btn { padding: 8px 16px; font-size: .9rem; }

/* действия живут в окне профиля на всех размерах */
.cab-actions .cab-user,
.cab-actions #logout-btn,
.cab-actions #cab-schedule-btn,
.cab-actions #cab-password-btn {
  display: none !important;
}

@media (max-width: 760px) {
  .cab-actions { gap: 4px; }
  .cab-actions .btn { padding: 8px 12px; font-size: .82rem; }
}

/* ---------- FIN-MODULE: финансы и загрузка ---------- */
.fin-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fin-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.chip-btn {
  font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--glass);
  color: var(--ink-soft);
}
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }
.chip-btn.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

.fin-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.fin-card {
  background: var(--glass);
  border: 1px solid var(--glass-strong);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.fin-card-title { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.fin-card-value { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); margin-top: 4px; }
.fin-card-sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.fin-card.ok .fin-card-value { color: var(--brand); }
.fin-card.bad .fin-card-value { color: var(--danger); }
.fin-card.warn .fin-card-value { color: var(--accent-dark); }

.fin-chart { display: flex; gap: 8px; align-items: flex-end; height: 140px; margin-top: 8px; overflow-x: auto; }
.fin-chart-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 54px; }
.fin-chart-bars { display: flex; gap: 4px; align-items: flex-end; height: 110px; }
.fin-chart-bar { display: block; width: 9px; border-radius: 4px 4px 0 0; background: var(--brand); opacity: .85; }
.fin-chart-bar.income { background: var(--brand); }
.fin-chart-bar.expense { background: var(--accent); }
.fin-chart-bar.profit { background: var(--ok); }
.fin-chart-bar.profit.negative { background: var(--danger); }
.fin-chart-label { font-size: .72rem; color: var(--muted); }
.fin-chart-year { font-size: .62rem; opacity: .7; margin-left: 1px; }
.fin-legend { display: flex; gap: 12px; margin-top: 8px; font-size: .8rem; color: var(--muted); }
.fin-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.fin-legend .income::before { background: var(--brand); }
.fin-legend .expense::before { background: var(--accent); }
.fin-legend .profit::before { background: var(--ok); }
.fin-legend .planned::before { background: var(--bg-tint); border: 1px solid var(--line-strong); }

.fin-bar-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: .9rem; }
.fin-bar-label { min-width: 130px; color: var(--ink-soft); }
.fin-bar { flex: 1; height: 10px; border-radius: 999px; background: var(--bg-tint); overflow: hidden; display: flex; }
.fin-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.fin-bar-fill.accent { background: var(--accent); }
.fin-bar-fill.planned { background: rgba(201, 123, 74, .45); }
.fin-bar.two .fin-bar-fill:first-child { background: var(--brand); }
.fin-bar-value { min-width: 74px; text-align: right; color: var(--ink-soft); }
.fin-load-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: .88rem; }

.fin-form { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 8px; align-items: end; margin-top: 8px; }
.fin-form.one { grid-template-columns: 1fr; }
.fin-form .field label { font-size: .84rem; }
.fin-form .btn { align-self: end; }
.fin-form .check { grid-column: 1 / -1; }

.fin-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.fin-actions .btn.mini { padding: 4px 8px; font-size: .76rem; }

@media (max-width: 1000px) {
  .fin-cards { grid-template-columns: repeat(2, 1fr); }
  .fin-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .fin-cards { grid-template-columns: 1fr 1fr; }
  .fin-form { grid-template-columns: 1fr; }
  .fin-nav { margin-left: 0; }
}

/* ---------- FIN-SETTINGS: цены по типам ---------- */
.fin-settings .pay-table input { padding: 8px 8px; }
.fin-settings .pay-table td { vertical-align: middle; }
@media (max-width: 640px) {
  .fin-settings .pay-table th, .fin-settings .pay-table td { padding: 8px 8px; }
}

/* ---------- VIDEO-SECTION: видео с занятий ---------- */
.video-form {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
}
.video-form .btn { align-self: end; }
.video-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.video-card {
  background: var(--glass);
  border: 1px solid var(--glass-strong);
  border-radius: var(--radius-sm);
  padding: 12px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.video-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #000;
  display: block;
}
.video-meta { display: grid; gap: 2px; margin-top: 8px; font-size: .86rem; color: var(--ink-soft); }
.video-meta b { font-size: .96rem; color: var(--ink); }
.video-meta .btn { justify-self: start; margin-top: 4px; }

@media (max-width: 1000px) {
  .video-form { grid-template-columns: 1fr 1fr; }
  .video-list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .video-form { grid-template-columns: 1fr; }
}

/* ---------- REPORT-VIDEO: видео в отчёте и карточках ---------- */
.video-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.video-actions .btn { padding: 4px 8px; font-size: .78rem; }
.report-videos {
  background: var(--glass);
  border: 1px solid var(--glass-strong);
  border-radius: var(--radius-sm);
  padding: 12px 12px;
  margin-bottom: 12px;
  font-size: .9rem;
}
.report-video-list { display: grid; gap: 8px; margin-top: 8px; }
.report-video-list .check { font-size: .9rem; }
.report-video-list a { text-decoration: underline; }
@media (max-width: 760px) {
  .video-form { grid-template-columns: 1fr; }
}

/* ---------- DONE-STATE: кнопка «Проведено» после нажатия ---------- */
.btn.done-state,
.btn.done-state:disabled {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-color: var(--brand-line);
  opacity: 1;
  cursor: pointer;
  box-shadow: none;
  transform: none;
}
.btn.done-state:hover { background: var(--brand-line); }
.btn.done-state:active { transform: scale(.98); }
.btn.done-state::before { content: ""; }

/* ---------- CAB-MOBILE-LAYOUT: удобная мобильная версия ---------- */
@media (max-width: 760px) {
  /* компактная шапка без переполнения */
  .site-header .header-inner { padding: 8px 0; gap: 8px; flex-wrap: nowrap; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 1rem; }
  .brand-text strong { display: none; }
  .brand-text .brand-sub { display: none; }
  .brand-text .brand-mobile { display: block; font-size: .86rem; text-transform: none; letter-spacing: 0; }
  .cab-actions { gap: 4px; }
  .cab-actions .btn { padding: 8px 12px; font-size: .78rem; border-radius: 999px; }

  /* меньше воздуха сверху и снизу */
  main.container { padding-top: 4px; padding-bottom: 16px; }
  .cab-head { margin: 4px 0 4px; gap: 4px; }
  .cab-head h1 { font-size: 1.22rem; }
  .cab-head .btn { padding: 8px 12px; font-size: .8rem; }
  .panel { padding-bottom: 4px; }

  /* вкладки — одна строка с горизонтальной прокруткой */
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 4px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar { display: none; height: 0; }
  .tabs .tab {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: .84rem;
    padding: 8px 12px;
  }

  /* подвкладки финансов — тоже скроллер */
  .fin-toolbar { gap: 4px; align-items: center; }
  .fin-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 4px;
    width: 100%;
    margin-left: 0;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
  }
  .fin-nav::-webkit-scrollbar { display: none; height: 0; }
  .fin-nav .chip-btn { flex: 0 0 auto; font-size: .8rem; padding: 8px 12px; }

  /* плотнее карточки и поля */
  #panel-fin .card:first-child { padding: 8px; }
  .fin-cards { gap: 8px; }
  .fin-card { padding: 12px 12px; }
  .fin-card-value { font-size: 1.3rem; }
  .video-form { gap: 8px; }
}

/* ---------- FIN-MONTH-COMPACT: компактный выбор месяца ---------- */
.fin-toolbar { flex-wrap: wrap; row-gap: 8px; }
.fin-toolbar label { font-size: .86rem; }
#fin-month {
  width: auto;
  min-width: 150px;
  max-width: 190px;
  padding: 8px 12px;
  font-size: .92rem;
}
@media (max-width: 760px) {
  #fin-month {
    width: 150px;
    min-width: 0;
    max-width: 150px;
    padding: 8px 8px;
    font-size: .85rem;
  }
  .cab-head { align-items: center; flex-wrap: nowrap; }
  .cab-head h1 { flex: 1 1 auto; min-width: 0; }
  .cab-head .btn { margin-left: auto; flex: 0 0 auto; }
}

/* ---------- DATE-FIELDS-COMPACT: компактные дата и месяц ---------- */
#day, #month {
  width: auto;
  min-width: 150px;
  max-width: 190px;
  padding: 8px 12px;
  font-size: .92rem;
}
#fin-month { min-width: 140px; }

@media (max-width: 760px) {
  #day, #month, #fin-month {
    width: 148px;
    min-width: 0;
    max-width: 148px;
    padding: 8px 8px;
    font-size: .84rem;
  }
  .daybar, .toolbar { gap: 4px; }
  .daybar .btn.mini, .toolbar .btn.mini { padding: 8px 8px; font-size: .78rem; }
}

/* ---------- CAL-MOBILE-COMPACT: аккуратный календарь на телефоне ---------- */
.cal-count { display: block; font-size: .8rem; font-weight: 700; line-height: 1.1; }
.cal-count.zero { opacity: .55; }

@media (max-width: 760px) {
  /* шапка месяца компактнее */
  .cal-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
  }
  .cal-head #cal-label { font-size: 1.12rem; flex: 1 1 auto; text-align: center; }
  .cal-head .btn.mini { padding: 8px 8px; font-size: .78rem; }

  /* сетка: ровные небольшие ячейки */
  .cal-weekdays, .cal-grid { gap: 4px; }
  .cal-weekdays div { font-size: .62rem; letter-spacing: .02em; }
  .cal-cell {
    min-height: 54px !important;
    padding: 4px 2px;
    border-radius: 10px;
    gap: 2px;
  }
  .cal-date { font-size: .72rem; }
  .cal-cell.weekend { background: rgba(251, 236, 235, .85); }

  /* бейдж со числом слотов вместо длинной подписи */
  .cal-slot.summary { padding: 2px 2px; border-radius: 7px; }
  .cal-slot.summary .cal-count { font-size: .8rem; }

  /* на телефоне слово «выходной» скрываем — фон уже красноватый */
  .cal-weekend-label { display: none; }

  /* подпись под календарём короче и мельче */
  .panel-cal-note, #panel-cal .calc-note { font-size: .78rem; }
}

/* ---------- SLOT-TAKEN-LAYOUT: занятый слот без обрезания текста ---------- */
.slot-row.slot-taken { align-items: center; }
.slot-row.slot-taken .slot-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.slot-row.slot-taken .slot-who b { font-size: .98rem; line-height: 1.25; }
.slot-row.slot-taken .slot-who small {
  display: block;
  font-size: .82rem;
  line-height: 1.3;
  color: var(--muted);
}
.slot-row.slot-taken .slot-balance { color: var(--brand-dark); }
.slot-row.slot-taken .slot-arrow { flex: 0 0 auto; }

@media (max-width: 760px) {
  .slot-row.slot-taken { gap: 8px; padding: 8px 12px; }
  .slot-row.slot-taken .slot-time {
    min-width: 0;
    width: 58px;
    flex: 0 0 auto;
    font-size: .82rem;
    color: var(--brand-dark);
  }
  .slot-row.slot-taken .slot-who b { font-size: .96rem; }
  .slot-row.slot-taken .slot-who small { font-size: .78rem; }
  .slot-row.slot-taken .slot-arrow { font-size: 1.1rem; opacity: .6; }
}



/* ---------- INFO-DANGER-ROW: «Удалить занятие» и «Удалить серию» рядом ---------- */
#info-overlay .info-danger {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
#info-overlay .info-danger .btn { padding: 8px 12px; font-size: .84rem; }
@media (max-width: 760px) {
  #info-overlay .info-danger { gap: 4px; }
  #info-overlay .info-danger .btn { flex: 1 1 auto; text-align: center; }
}

/* ---------- SERIES-DISABLED: неактивная кнопка серии ---------- */
#info-overlay .info-danger .btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* ---------- MODAL-MOBILE-LOCK: карточка занятия без горизонтальных сдвигов ---------- */
body.overlay-open { overflow: hidden; }

@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  body { overscroll-behavior-x: none; }

  .overlay.open { overscroll-behavior: contain; }
  .overlay .modal {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  #info-overlay .modal { padding: 16px 16px; border-radius: 18px; }
  #info-overlay .modal h2 { font-size: 1.1rem; }

  /* строки информации переносятся, а не растягивают окно */
  #info-body > div { flex-wrap: wrap; gap: 4px 12px; }
  #info-body > div > span { min-width: 92px; }
  #info-body b { overflow-wrap: anywhere; }

  /* поля даты и времени не выходят за карточку */
  #info-overlay input, #info-overlay select, #info-overlay textarea {
    max-width: 100%;
    box-sizing: border-box;
  }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { max-width: 100%; }
}

/* ---------- INFO-SHEET-MOBILE: карточка занятия как нижняя шторка ---------- */
@media (max-width: 760px) {
  #info-overlay {
    align-items: center;
    justify-content: center;
    padding: 12px;
  }
  #info-overlay .modal {
    width: 100%;
    max-width: 100%;
    max-height: 88dvh;
    border-radius: 20px;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden !important;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    margin: auto;
  }
  #info-overlay .modal h2 { font-size: 1.05rem; margin-bottom: 4px; }

  /* компактные строки информации */
  #info-body {
    display: grid !important;
    gap: 4px !important;
    font-size: .93rem;
  }
  #info-body > div { flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
  #info-body > div > span { min-width: 88px; font-size: .84rem; }
  #info-body b { font-size: .93rem; overflow-wrap: anywhere; }

  /* поля даты/времени по ширине окна */
  #info-overlay .check {
    margin-top: 8px !important;
    padding: 8px 12px !important;
    font-size: .89rem;
  }
  #info-overlay .field { margin-top: 8px !important; }
  #info-overlay .field label { font-size: .84rem; margin-bottom: 4px; }
  #info-overlay .input {
    padding: 8px 12px;
    font-size: .95rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  #info-overlay .modal-actions {
    gap: 8px;
    margin-top: 8px !important;
    padding-top: 8px;
  }
  #info-overlay .modal-actions .btn {
    padding: 8px 12px;
    font-size: .85rem;
    white-space: nowrap;
  }
  #info-overlay .info-danger .btn { flex: 1 1 46%; }
  #info-overlay .calc-note { font-size: .8rem; margin-top: 4px !important; }

  /* никаких горизонтальных полос прокрутки внутри окон */
  .overlay .modal { overflow-x: hidden !important; }
  .overlay .modal * { max-width: 100%; }
}

/* ---------- INFO-DATETIME-COMPACT: поля даты/времени по ширине экрана ---------- */
@media (max-width: 760px) {
  /* карточка жёстко привязана к ширине экрана — не может вылезти за край */
  #info-overlay .modal {
    position: fixed;
    inset: 12px;
    width: auto;
    max-width: none;
    height: -moz-fit-content;
    height: fit-content;
    max-height: calc(100dvh - 24px);
    margin: auto;
    box-sizing: border-box;
    padding: var(--ds-space-16) var(--ds-space-16) calc(var(--ds-space-16) + env(safe-area-inset-bottom, 0px));
    border-radius: 20px;
    overflow-x: hidden !important;
    overflow-y: auto;
  }

  #info-overlay .field {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 8px !important;
    display: grid;
    gap: 4px;
  }
  #info-overlay .field label { font-size: .82rem; }
  #info-overlay .field .input,
  #info-overlay input[type="date"],
  #info-overlay input[type="time"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 40px;
    padding: 8px 8px;
    font-size: .9rem;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
  }
  #info-overlay .field .input::-webkit-date-and-time-value { text-align: left; }
  #info-overlay .field .input::-webkit-calendar-picker-indicator { margin-right: 2px; }

  /* компактнее блок «Заболел» и отступы */
  #info-overlay .check { margin-top: 8px !important; padding: 8px 8px !important; }
  #info-overlay .modal-actions { margin-top: 8px !important; padding-top: 8px; }
}

/* ---------- FIN-LESSON-CARDS: занятия в финансах на телефоне ---------- */
.fin-lesson-list { display: grid; gap: 8px; }
.fin-lesson-card {
  background: var(--glass);
  border: 1px solid var(--glass-strong);
  border-radius: var(--radius-sm);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 12px 12px;
}
.fin-lesson-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fin-lesson-top b { font-size: .95rem; color: var(--brand-dark); }
.fin-lesson-who { font-size: .95rem; font-weight: 600; margin-top: 4px; }
.fin-lesson-type { font-size: .84rem; color: var(--muted); }
.fin-lesson-sum { font-size: .86rem; color: var(--ink-soft); margin-top: 2px; }
.fin-lesson-card .fin-actions { margin-top: 8px; }
.fin-lesson-card .fin-actions .btn { padding: 4px 8px; font-size: .76rem; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- FIN-ROW-CARDS: расходы/инвестиции на телефоне ---------- */
.fin-row-card {
  background: var(--glass);
  border: 1px solid var(--glass-strong);
  border-radius: var(--radius-sm);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 12px 12px;
}
.fin-row-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fin-row-top b { font-size: .93rem; color: var(--brand-dark); }
.fin-row-main { font-size: .95rem; font-weight: 600; margin-top: 4px; }
.fin-row-sum { font-size: 1.05rem; color: var(--ink); margin-top: 2px; }
.fin-row-note { font-size: .84rem; color: var(--muted); margin-top: 2px; }
.fin-row-card .fin-actions { margin-top: 8px; }

@media (max-width: 760px) {
  /* компактные поля даты в финансовых формах */
  #ex-date, #in-date {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 40px;
    padding: 8px 8px;
    font-size: .9rem;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
  }
  .fin-form .field { min-width: 0; }
  #fin-body .table-scroll { display: none; }
}

/* ---------- FIN-CARDS-SPACING: отступ после карточек показателей ---------- */
.fin-cards { margin-bottom: 12px; }
.fin-cards + .card,
.fin-cards + .fin-lesson-list { margin-top: 12px; }
@media (max-width: 760px) {
  .fin-cards { margin-bottom: 8px; }
  .fin-cards + .card { margin-top: 8px; }
}

/* ---------- MOBILE-UX-POLISH: удобные размеры на телефоне ---------- */
@media (max-width: 760px) {
  /* 16px в полях — iOS не зумит страницу при фокусе */
  #panel-today input, #panel-today select, #panel-cal input, #panel-kids input,
  #panel-pay input, #panel-fin input, #panel-video input, #panel-calc input,
  #panel-calc select, .overlay input, .overlay select, .overlay textarea,
  .modal input, .modal select, .modal textarea {
    font-size: 16px;
  }
  .input, select.input, textarea { font-size: 16px; }

  /* кнопки — удобные для пальца */
  .btn { min-height: 44px; }
  .btn.mini { min-height: 36px; padding: 8px 12px; font-size: .82rem; }
  .cab-actions .btn { min-height: 40px; padding: 8px 12px; }
  .lesson .actions .btn { min-height: 36px; }
  .fin-actions .btn { min-height: 34px; }
  .tabs .tab, .fin-nav .chip-btn { min-height: 38px; display: inline-flex; align-items: center; }
  .slot-row { min-height: 52px; }
  .daybar .btn, .toolbar .btn { min-height: 40px; }

  /* окна */
  .overlay { padding: 8px; }
  .modal { max-height: 90dvh; }
  .pay-table th, .pay-table td { padding: 8px 8px; font-size: .84rem; }
}

/* ---------- UX-IMPROVEMENTS-MOBILE: материалы, программы, календарь, аналитика ---------- */
.prog-toggle { display: none; }
.cal-view-btn { display: none; }

@media (max-width: 760px) {
  /* материалы — 2 колонки */
  #materials { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
  #materials .card { padding: 8px; }
  #materials .card img { width: 100% !important; height: 110px !important; border-radius: 8px; }

  /* программа — сворачиваемые блоки */
  #program-blocks .prog-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    font-size: 1.35rem;
    line-height: 1;
    border-radius: 10px;
  }
  .prog-block .prog-body {
    display: block;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
  }
  .prog-block.open .prog-body {
    max-height: none;
    opacity: 1;
  }

  /* календарь: переключатель сетка/список */
  .cal-view-btn { display: inline-flex; }
  .cal-view-btn.active { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
  .cal-list-day {
    background: var(--glass);
    border: 1px solid var(--glass-strong);
    border-radius: 14px;
    padding: 8px 12px;
    margin-bottom: 8px;
  }
  .cal-list-date { font-size: .82rem; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
  .cal-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 4px;
    font: inherit;
    text-align: left;
  }
  .cal-list-time { min-width: 48px; font-weight: 700; color: var(--brand-dark); font-size: .85rem; }
  .cal-list-who { flex: 1; font-weight: 600; font-size: .92rem; }

  /* аналитика — крупнее столбики и понятные подписи */
  .fin-chart { gap: 4px; height: 170px; }
  .fin-chart-bars { height: 128px; }
  .fin-chart-bar { width: 8px; }
  .fin-chart-label { font-size: .62rem; }
  .fin-load-row { flex-wrap: wrap; row-gap: 4px; }
  .fin-load-row .fin-bar { flex: 1 1 100%; order: 3; }
  .fin-load-row .fin-bar-value { margin-left: auto; }
}

/* ---------- MATERIALS-GRID-2: материалы в 2 колонки ---------- */
@media (max-width: 760px) {
  #materials { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: stretch; }
  #materials .material-card { margin-bottom: 0; padding: 8px; }
  #materials .material-row { flex-direction: column; gap: 8px; }
  #materials .material-row img,
  #materials .material-card img {
    width: 100% !important;
    height: 104px !important;
    object-fit: cover;
  }
  #materials .material-info { width: 100%; font-size: .86rem; }
  #materials .material-info b { font-size: .9rem; display: block; line-height: 1.25; }
  #materials .material-actions { flex-direction: row !important; width: 100%; margin-top: 4px; }
  #materials .material-actions .btn { flex: 1 1 auto; }
}

/* ---------- QUICK-MODAL-MOBILE: меню добавления занятия на телефоне ---------- */
@media (max-width: 760px) {
  #quick-overlay {
    align-items: flex-end;
    padding: 0;
  }
  #quick-overlay .modal {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 0;
    top: auto;
    width: auto;
    max-width: none;
    max-height: 92dvh;
    box-sizing: border-box;
    padding: var(--ds-space-16) var(--ds-space-16) calc(var(--ds-space-16) + env(safe-area-inset-bottom, 0px));
    border-radius: 18px 18px 0 0;
    overflow-x: hidden !important;
    overflow-y: auto;
  }
  #quick-overlay .calc-inputs { grid-template-columns: 1fr !important; gap: 8px; }
  #quick-overlay .modal .field { min-width: 0; }
  #quick-overlay .modal .input,
  #quick-overlay .modal select,
  #quick-overlay .modal textarea,
  #quick-overlay input[type="time"],
  #quick-overlay input[type="number"],
  #quick-overlay input[type="date"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 44px;
    padding: 8px 12px;
    font-size: 16px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
  }
  #quick-overlay .modal textarea { height: auto; min-height: 72px; }
  #quick-overlay .calc-inputs .field { width: 100%; }
  #quick-overlay .modal-actions { flex-wrap: wrap; }
  #quick-overlay .modal-actions .btn { width: 100%; }
}

/* ---------- QUICK-FIELD-SPACING: одинаковые отступы между полями ---------- */
@media (max-width: 760px) {
  #quick-overlay .modal .field {
    margin: 0 !important;
    display: grid;
    gap: 4px;
  }
  /* отдельные поля (вне сетки) — одинаковый отступ снизу */
  #quick-overlay .modal > .field { margin-bottom: 8px !important; }
  #quick-overlay .calc-inputs {
    display: grid;
    gap: 8px;
    margin: 0 0 8px;
  }
  #quick-overlay .calc-inputs .field { margin-bottom: 0 !important; }
  /* чекбоксы и блоки между собой — тот же шаг 10px */
  #quick-overlay .modal .check { margin: 8px 0 0 !important; }
  #quick-overlay #q-new-child { margin: 8px 0 !important; }
  #quick-overlay #q-repeat-wrap { margin: 8px 0 0 !important; }
  #quick-overlay .modal-actions { margin-top: 12px !important; }
  #quick-overlay .modal > .field + .calc-inputs { margin-top: 0; }
  #quick-overlay .modal h2 { margin-bottom: 12px; }
}

/* ---------- SPACING-NORMALIZE: единая шкала отступов кабинета ----------
   Вертикаль: label→поле 6px, поле→поле 10px, кнопки 8px, секции 14px.
   Горизонталь: между элементами 8px, внутри карточек 14–16px. */
.cab-head { margin: 12px 0 12px !important; gap: 8px; }
.tabs { gap: 8px !important; margin-bottom: 12px !important; }
.daybar, .toolbar { gap: 8px !important; margin-bottom: 12px; }
.daybar .input, .toolbar .input { margin: 0; }

/* формы и модальные окна */
.modal .field { margin-bottom: 8px !important; }
.modal .field label { margin-bottom: 0; }
.field { gap: 4px; }
.modal-actions { gap: 8px !important; margin-top: 8px !important; }
.modal h2 { margin-bottom: 12px; }
.overlay .modal { padding: 16px; }

/* сетки полей */
.calc-inputs, .checks-grid, .fin-form, .video-form { gap: 8px !important; }
#quick-overlay .calc-inputs { margin-bottom: 12px; }
#quick-overlay .modal > .field { margin-bottom: 12px !important; }
#info-overlay .field { margin-top: 8px !important; }
#info-overlay .check { margin-top: 8px !important; }

/* кнопки и чипы */
.btn.mini { padding: 8px 12px; font-size: .8rem; min-height: 34px; }
.fin-actions, .video-actions, .info-series-actions { gap: 8px !important; }
.chip-btn, .tabs .tab { margin: 0; }
.fin-nav, .fin-toolbar { gap: 8px; }
.fin-cards { gap: 8px !important; }
.fin-lesson-list, .fin-lesson-card .fin-actions { gap: 8px; }

/* карточки */
.card { padding: 16px; }
.child-card, .lesson, .fin-lesson-card, .fin-row-card { margin-bottom: 8px; }

/* мобильная версия — та же шкала */
@media (max-width: 760px) {
  .cab-head { margin: 8px 0 8px !important; }
  .tabs { margin-bottom: 8px !important; gap: 8px !important; }
  .modal .field { margin-bottom: 8px !important; }
  .modal-actions { margin-top: 8px !important; gap: 8px !important; }
  #quick-overlay .modal > .field { margin-bottom: 8px !important; }
  #quick-overlay .calc-inputs { margin-bottom: 8px; }
  .fin-cards { gap: 8px !important; }
}

/* ---------- HIDE-PRINT-MOBILE: «Печать» только на ПК ---------- */
@media (max-width: 760px) {
  #cal-print { display: none !important; }
}

/* ---------- CAL-LIST-LAYOUT: список занятий в одну колонку ---------- */
.cal-grid.cal-list {
  display: block !important;
  grid-template-columns: none !important;
}
.cal-grid.cal-list .cal-list-day { margin-bottom: 8px; }
@media (max-width: 760px) {
  .cal-grid.cal-list .cal-list-day { width: 100%; }
}

/* ---------- HIDE-ALL-PRINT-MOBILE: никаких кнопок печати на телефоне ---------- */
@media (max-width: 760px) {
  #cal-print,
  #summary-print,
  .print-btn,
  [data-print] {
    display: none !important;
  }
}

/* ---------- KIDS-MOBILE-MINIMAL: аккуратный раздел «Дети» ---------- */
@media (max-width: 760px) {
  #panel-kids .toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
  #panel-kids #add-child { flex: 1 1 auto; }

  /* поиск — под кнопкой-лупой */
  .kids-search-toggle { display: none; padding: 8px 12px; font-size: 1rem; }
  #panel-kids .toolbar .kids-search-toggle { display: inline-flex; }
  #kids-toolbar .kids-search-input {
    display: none;
    width: 100%;
    order: 10;
    margin: 0;
    padding: 8px 12px;
    font-size: 16px;
  }
  #kids-toolbar.search-open .kids-search-input { display: block; }

  /* фильтры — компактные, в одну строку */
  #kids-type, #kids-sort {
    width: calc(50% - 4px);
    max-width: none;
    min-width: 0;
    padding: 8px 8px;
    font-size: .85rem;
    height: 40px;
  }
  #panel-kids .check { width: 100%; font-size: .88rem; }
  #panel-kids .check input { width: 18px; height: 18px; }

  /* карточка ребёнка не выезжает за экран */
  #kids { width: 100%; }
  .child-card { width: 100%; max-width: 100%; overflow: hidden; padding: 12px 12px; }
  .child-card header { flex-wrap: wrap; gap: 4px; }
  .child-card p { overflow-wrap: anywhere; }
  .child-card .actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
  .child-card .actions .btn {
    flex: 1 1 42%;
    min-width: 0;
    padding: 8px 8px;
    font-size: .78rem;
    min-height: 34px;
    white-space: nowrap;
  }
}

/* ---------- PAY-MOBILE-CARDS: оплаты на телефоне ---------- */
.pay-h { font-size: 1.02rem; margin: 0 0 8px; }
.pay-h:not(:first-child) { margin-top: 16px; }
.pay-cards { display: grid; gap: 8px; margin-bottom: 4px; }

.backup-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  font-size: .8rem;
}
.backup-mini .btn { flex: 0 0 auto; }
@media (max-width: 760px) {
  .backup-mini { font-size: .74rem; margin-top: 12px; }
  .backup-mini .btn { min-height: 32px; padding: 4px 8px; font-size: .74rem; }
}

/* ---------- PHONE-LINK: кликабельный телефон ---------- */
.phone-link {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.phone-link:hover,
.phone-link:visited { color: var(--brand-dark); }
.phone-link:active { text-decoration: underline; }
@media (max-width: 760px) {
  .phone-link { padding: 4px 0; display: inline-block; }
}

/* ---------- MATERIALS-MODAL-MOBILE: материалы на телефоне ---------- */
.m-search-toggle { display: none; }
@media (max-width: 760px) {
  #panel-materials .toolbar { flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
  #panel-materials #m-open { flex: 1 1 auto; }
  #m-toolbar .m-search-toggle { display: inline-flex; }
  #m-toolbar .m-search-input { display: none; width: 100%; order: 9; margin: 0; font-size: 16px; }
  #m-toolbar.search-open .m-search-input { display: block; }
  #m-filter-cat, #m-filter-age {
    width: calc(50% - 4px);
    max-width: none;
    min-width: 0;
    height: 40px;
    padding: 8px 8px;
    font-size: .85rem;
  }
  #m-overlay { align-items: flex-end; padding: 0; }
  #m-overlay .modal {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 0;
    top: auto;
    width: auto;
    max-width: none;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
    padding: var(--ds-space-16) var(--ds-space-16) calc(var(--ds-space-16) + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
  }
  #m-overlay .calc-inputs { grid-template-columns: 1fr !important; gap: 8px; }
  #m-overlay .field { margin-bottom: 8px; }
}

/* ---------- MATERIALS-EMPTY-FULL: пустое состояние на всю ширину ---------- */
@media (max-width: 760px) {
  #materials > .materials-empty,
  #materials > .card:only-child,
  #materials > p {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* ---------- MATERIALS-EMPTY-TEXT: пустое состояние без подложки ---------- */
.materials-empty-text {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
  color: var(--muted);
  opacity: .72;
  font-size: .92rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 38vh;
  padding: 16px 12px;
}
.materials-empty-text span { font-size: .82rem; opacity: .9; }

@media (max-width: 760px) {
  .materials-empty-text { min-height: 34vh; }
}

/* ---------- VIDEO-RETENTION-BOTTOM: подсказка о хранении — внизу экрана ---------- */
#video-storage {
  margin: 0;
  font-size: .8rem;
  line-height: 1.4;
  color: var(--muted);
  padding: 8px 4px 4px;
}
#video-storage.video-storage-warn { color: #a4442f; font-weight: 600; }

/* телефон: последняя строка панели, прямо над нижней навигацией */
@media (max-width: 760px) {
  body.app-shell #panel-video #video-storage {
    flex: 0 0 auto;
    margin-top: 4px;
    padding: 8px 2px 2px;
    border-top: 1px solid var(--border-2);
  }
}

/* ПК: липкая строка у нижнего края экрана, пока открыта вкладка «Видео» */
@media (min-width: 761px) {
  #panel-video #video-storage {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 8px;
    padding: 8px 12px;
    border-top: 1px solid var(--border-2);
    border-radius: 0 0 12px 12px;
    background: rgba(251, 246, 238, .94);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
}

/* ---------- TODAY-SLIDE: двухфазное листание дней в «Сегодня» ---------- */
/* фаза 1: старый список уезжает в сторону, противоположную приходу нового */
#lessons.day-out-next { animation: dayOutNext .23s cubic-bezier(.4, 0, .7, .3) both; }
#lessons.day-out-prev { animation: dayOutPrev .23s cubic-bezier(.4, 0, .7, .3) both; }
/* фаза 2: новый список въезжает, движение распределено по всей длительности */
#lessons.day-in-next { animation: dayInNext .55s cubic-bezier(.42, 0, .58, 1) both; }
#lessons.day-in-prev { animation: dayInPrev .55s cubic-bezier(.42, 0, .58, 1) both; }
#lessons.day-in-today { animation: dayInToday .6s cubic-bezier(.42, 0, .58, 1) both; }
#day-summary.day-fade { animation: dayFade .4s ease both; }
@keyframes dayOutNext {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateX(-16px); }
}
@keyframes dayOutPrev {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateX(16px); }
}
@keyframes dayInNext {
  from { opacity: .4; transform: translateX(22px); }
  to { opacity: 1; transform: none; }
}
@keyframes dayInPrev {
  from { opacity: .4; transform: translateX(-22px); }
  to { opacity: 1; transform: none; }
}
@keyframes dayInToday {
  from { opacity: .4; transform: scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes dayFade {
  from { opacity: .3; }
  to { opacity: 1; }
}
@keyframes dayFadeOnly {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* при «уменьшить движение» — только мягкое проявление, без сдвигов */
@media (prefers-reduced-motion: reduce) {
  #lessons.day-out-next, #lessons.day-out-prev { animation: none; opacity: 0; }
  #lessons.day-in-next, #lessons.day-in-prev, #lessons.day-in-today,
  #day-summary.day-fade { animation: dayFadeOnly .32s ease both; }
}

/* ---------- NOTIFY-MAX: согласие, код привязки и лента уведомлений ---------- */
/* колокольчик в шапке: уведомления под иконкой, рядом с профилем */
.cab-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--on-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(31, 75, 67, .18);
}
.cab-icon-btn:active { transform: scale(.96); }
.cab-icon-btn svg { display: block; }
.cab-bell-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--brand);
  pointer-events: none;
}
#notify-overlay .notify-modal {
  width: min(720px, 96vw);
  /* выше специфичность, чем у .modal (max-height: 90vh): окно не должно скроллиться целиком */
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
/* плавное появление окна уведомлений (display:none → flex анимируем через keyframes) */
#notify-overlay.open { animation: notifyFade .22s ease both; }
#notify-overlay.open .notify-modal { animation: notifyPop .28s cubic-bezier(.22, .9, .3, 1) both; }
#notify-overlay.closing { animation: none; opacity: 0; transition: opacity .18s ease; }
#notify-overlay.closing .notify-modal {
  animation: none;
  opacity: 0;
  transform: translateY(10px) scale(.99);
  transition: opacity .18s ease, transform .18s ease;
}
@keyframes notifyFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes notifyPop {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  #notify-overlay.open,
  #notify-overlay.open .notify-modal,
  #notify-overlay.closing,
  #notify-overlay.closing .notify-modal { animation: none; transition: none; }
}
.notify-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.notify-modal-head h3 { margin: 0; font-size: 1.1rem; }
.notify-modal-actions { display: flex; align-items: center; gap: 4px; }
/* прокручивается только список, шапка и подпись остаются на месте */
.notify-feed {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: grid;
  /* без max-content строки с overflow:hidden сжимаются и текст «уезжает» */
  grid-auto-rows: max-content;
  gap: 8px;
  padding-right: 2px;
}
.notify-field { display: grid; gap: 4px; }
.notify-status { margin: 0; font-size: .9rem; color: var(--ink-soft); min-height: 1.2em; }
.notify-code {
  margin: 4px 0 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--surface-1);
  border: 1px dashed var(--border-2);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: center;
  color: var(--brand-dark);
}
.notify-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 8px;
  align-items: start;
  padding: 8px 12px;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: var(--surface-1);
  font-size: .88rem;
  max-height: 420px;
  overflow: hidden;
  transition: opacity .26s ease, transform .26s ease, max-height .28s ease,
              padding .28s ease, margin .28s ease, border-width .28s ease;
}
.notify-row.removing {
  opacity: 0;
  transform: translateX(14px);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: -8px;
  border-width: 0;
}
.notify-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; min-width: 0; }
.notify-side { display: flex; align-items: center; gap: 4px; }
.notify-kind { font-weight: 600; }
.notify-client { color: var(--ink-soft); }
.notify-when { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .8rem; }
.notify-state {
  font-size: .74rem;
  color: var(--muted);
  text-transform: lowercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border-2);
  white-space: nowrap;
}
.notify-x {
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s ease, color .2s ease, transform .12s ease;
}
/* ховер только там, где есть мышь: на тач-экране он «залипает» после тапа
   и корзина выглядит включённым режимом */
@media (hover: hover) and (pointer: fine) {
  .notify-x:hover { background: var(--border-2); color: var(--ink); }
}
.notify-x:active { transform: scale(.92); }
.notify-x:focus { outline: none; }
.notify-x:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  background: transparent;
}
.notify-trash, .notify-close { width: 30px; height: 30px; min-height: 30px; }
#notify-clear { color: var(--danger) !important; }
#notify-clear:hover { color: var(--danger) !important; background: var(--danger-soft) !important; }
.notify-trash svg, .notify-close svg { display: block; }
.notify-state.notify-sent { color: #2f6b35; font-weight: 600; }
.notify-state.notify-failed { color: var(--danger); font-weight: 600; }
.notify-state.notify-received { color: var(--brand-dark); font-weight: 600; }
.notify-state.notify-no_link,
.notify-state.notify-no_consent { color: var(--danger); }
.notify-empty { margin: 0; color: var(--muted); opacity: .8; font-size: .9rem; }
.notify-text {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding: 8px 8px;
  border-radius: 10px;
  background: var(--bg-soft);
  border-left: 3px solid var(--border-2);
  font-size: .86rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}
.notify-text-in { border-left-color: var(--brand); background: var(--surface-2); }
/* небольшой воздух снизу, чтобы последняя запись не упиралась в край окна */
.notify-feed { padding-bottom: 4px; }
.notify-text-err { border-left-color: var(--danger); color: var(--danger); }
.notify-text-muted { border-left-color: var(--muted); color: var(--muted); background: transparent; }
@media (max-width: 760px) {
  .notify-row { grid-template-columns: 1fr auto; row-gap: 4px; }
  .notify-main { gap: 4px; }
  .notify-client { font-size: .86rem; }
  .notify-when { width: 100%; }
  .notify-text { font-size: .84rem; }
  .notify-feed { padding-bottom: 12px; }
  .notify-modal { padding-bottom: 16px; }
  .notify-modal-actions .btn { display: none; }
}

/* ---------- VIDEO-MODAL-MOBILE: видео как материалы ---------- */
.video-empty-text {
  margin: 0;
  text-align: center;
  color: var(--muted);
  opacity: .72;
  font-size: .92rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 38vh;
  padding: 16px 12px;
}
.video-empty-text span { font-size: .82rem; opacity: .9; }

@media (max-width: 760px) {
  #v-overlay { align-items: flex-end; padding: 0; }
  #v-overlay .modal {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 0;
    top: auto;
    width: auto;
    max-width: none;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
    padding: var(--ds-space-16) var(--ds-space-16) calc(var(--ds-space-16) + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
  }
  #v-overlay .video-form { grid-template-columns: 1fr !important; gap: 8px; }
  #v-overlay .field { margin-bottom: 8px; }
  .video-empty-text { min-height: 34vh; }
}

/* ---------- VIDEO-SEARCH: поиск по видео ---------- */
.v-search-toggle { display: none; }
#v-toolbar .v-search-input { max-width: 340px; }

@media (max-width: 760px) {
  #panel-video .toolbar { flex-wrap: wrap; gap: 8px; }
  #panel-video #v-open { flex: 1 1 auto; }
  #v-toolbar .v-search-toggle { display: inline-flex; }
  #v-toolbar .v-search-input { display: none; width: 100%; max-width: none; order: 9; margin: 0; font-size: 16px; }
  #v-toolbar.search-open .v-search-input { display: block; }
}

/* ---------- CALC-MOBILE-LAYOUT: калькулятор по ширине экрана ---------- */
@media (max-width: 760px) {
  #panel-calc { overflow-x: hidden; }
  #panel-calc .page-head { padding: 0 0 8px !important; }
  #panel-calc .page-head h2 { font-size: 1.45rem; line-height: 1.2; }
  #panel-calc .page-head p { font-size: .92rem; }
  #panel-calc .calc-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
    width: 100%;
    max-width: 100%;
  }
  #panel-calc .calc-grid > * { min-width: 0; width: 100%; max-width: 100%; }
  #panel-calc .calc-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 16px 12px;
    position: static !important;
  }
  #panel-calc .calc-inputs {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }
  #panel-calc .calc-inputs .field { min-width: 0; }
  #panel-calc .calc-card input,
  #panel-calc .calc-card select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    font-size: 16px;
  }
  #panel-calc .calc-card h3 { margin-top: 16px !important; }
  #panel-calc .calc-card h3:first-child { margin-top: 0 !important; }
}

/* ---------- REPORT-DIARY-ONBOARD: отчёт, дневник, пустые состояния ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 22vh;
  padding: 24px 12px;
  text-align: center;
  color: var(--muted);
  opacity: .75;
  font-size: .92rem;
  line-height: 1.5;
}
.empty-state b { color: var(--ink-soft); font-size: .95rem; font-weight: 600; }
.empty-state span { font-size: .83rem; }

.report-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 8px; }
.report-chips .chip-btn { font-size: .78rem; padding: 8px 12px; }

.report-edit {
  min-height: 180px;
  outline: none;
  border: 1px dashed transparent;
  border-radius: 12px;
  padding: 8px;
  white-space: pre-wrap;
}
.report-edit:focus {
  border-color: var(--brand);
  background: var(--glass-strong);
}

@media (max-width: 760px) {
  .report-edit { min-height: 150px; font-size: 15px; }
  .report-chips .chip-btn { font-size: .76rem; padding: 8px 8px; }
  .empty-state { min-height: 26vh; }
}

/* ---------- NO-ZOOM-MOBILE: масштаб на телефоне зафиксирован ---------- */
@media (max-width: 760px) {
  html, body { touch-action: manipulation; -ms-content-zooming: none; }
  input, select, textarea, button { touch-action: manipulation; }
}

/* ---------- VIDEO-EMPTY-CENTER: пустое видео на всю ширину секции ---------- */
.video-list .video-empty-text {
  grid-column: 1 / -1;
  width: 100%;
  justify-self: stretch;
  min-height: 40vh;
}
@media (max-width: 760px) {
  .video-list .video-empty-text { min-height: 34vh; }
}

/* ---------- MATERIALS-TOOLBAR-DESKTOP: компактные поиск и фильтры ---------- */
@media (min-width: 761px) {
  #m-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  #m-toolbar .m-search-input {
    width: 340px;
    max-width: 340px;
    height: 42px;
    padding: 8px 12px;
    font-size: .92rem;
  }
  #m-filter-cat,
  #m-filter-age {
    width: auto;
    min-width: 150px;
    max-width: 220px;
    height: 42px;
    padding: 8px 12px;
    font-size: .9rem;
  }
}

/* ---------- SUB-MODAL-ALIGN: абонемент — ровные поля ---------- */
#sub-overlay .modal { width: min(800px, 100%); }
#sub-overlay .calc-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  align-items: start;
}
#sub-overlay .field {
  display: grid;
  gap: 4px;
  margin: 0;
  min-width: 0;
}
#sub-overlay .field .input,
#sub-overlay .field input[type="number"],
#sub-overlay .field input[type="date"],
#sub-overlay .field select {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  min-height: 44px;
  padding: 8px 12px;
  font-size: .95rem;
  line-height: 1.2;
}
#sub-overlay input[type="date"]::-webkit-date-and-time-value { text-align: left; }
#sub-overlay #sub-calc-hint { margin-top: 2px; }
#sub-overlay .modal > .field { margin-top: 12px; }
#sub-overlay .modal-actions { margin-top: 12px; }

@media (max-width: 760px) {
  #sub-overlay .calc-inputs { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- MOB-BOTTOM-NAV: нижние вкладки как в мобильном приложении ---------- */
.mob-nav { display: none; }

@media (max-width: 760px) {
  .tabs { display: none !important; }
  body { padding-bottom: calc(var(--ds-space-64) + var(--ds-space-16) + env(safe-area-inset-bottom, 0px)); }

  .mob-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
    padding: var(--ds-space-8) var(--ds-space-4) calc(var(--ds-space-8) + env(safe-area-inset-bottom, 0px));
    background: rgba(253, 249, 243, .96);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-2);
    box-shadow: 0 -6px 24px var(--border-2);
  }
  .mob-nav button, .mob-nav a {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: 0;
    padding: 4px 2px;
    font: inherit;
    font-size: .64rem;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
  }
  .mob-nav button.active {
    color: var(--brand);
    font-weight: 700;
  }
  .mob-nav .mob-ico { font-size: 1.15rem; line-height: 1; }

  .mob-more { max-height: 92dvh; }
  .mob-more-grid { display: grid; gap: 8px; margin-top: 8px; }
  .mob-more-grid .btn { justify-content: flex-start; width: 100%; }
}

/* ---------- MOB-NAV-ICONS: иконки нижних вкладок ---------- */
.mob-nav .mob-ico svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mob-nav .mob-ico { font-size: 0; display: flex; align-items: center; justify-content: center; }

/* нижние вкладки: скрываем полосу прокрутки */
.mob-nav::-webkit-scrollbar { display: none; height: 0; }
.mob-nav > button, .mob-nav > a {
  flex: 0 0 auto;
  min-width: 74px;
  padding: 4px 4px;
}
.mob-nav > button span:last-child, .mob-nav > a span:last-child {
  font-size: .62rem;
}

/* ---------- HELP-BTN: «?» в шапке рядом с колокольчиком ---------- */
/* заголовок остаётся для скринридеров, но не занимает места */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.cab-actions #onboard-open {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  font-weight: 700;
}

/* ---------- CAB-HEAD-CENTER: заголовок по центру, знак «?» рядом ---------- */
.cab-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.cab-head h1 { margin: 0; }
.cab-head #onboard-open {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
}
@media (max-width: 760px) {
  .cab-head { justify-content: center; margin: 8px 0 12px !important; }
}

/* ---------- TODAY-CENTER-MOBILE: «Сегодня» по центру ---------- */
#panel-today .empty-state { min-height: 48vh; }
@media (max-width: 760px) {
  #panel-today .daybar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
  }
  #panel-today .daybar .input[type="date"] { width: auto; max-width: 210px; }
  #panel-today .empty-state { min-height: 52vh; }
}

/* ---------- TODAY-DAYBAR-CENTER: дата по центру, «Сегодня» на месте ---------- */
#day-summary { display: none; }
.day-group { display: flex; align-items: center; gap: 8px; }

@media (max-width: 760px) {
  /* на телефоне так же: дата по центру, «Текущий день» справа */
  #panel-today .daybar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 4px;
  }
  #panel-today .day-group {
    grid-column: 2;
    justify-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
  }
  #panel-today .day-group .input[type="date"] {
    width: 152px;
    max-width: 44vw;
    min-width: 0;
    padding: 8px 4px;
    font-size: .84rem;
    text-align: center;
  }
  #panel-today .day-group .btn { padding: 8px 8px; }
  #panel-today #today-btn {
    grid-column: 3;
    justify-self: end;
    padding: 8px 8px;
    font-size: .74rem;
    white-space: nowrap;
  }
}

/* ---------- OVERLAY-ABOVE-NAV: окна поверх нижней панели вкладок ---------- */
.overlay { z-index: 1000; }

@media (max-width: 760px) {
  .overlay { z-index: 1000; }
  .overlay .modal {
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .overlay .modal-actions,
  .overlay .modal-actions .btn {
    position: relative;
    z-index: 1;
  }
  #sheet-overlay .modal {
    max-height: 88dvh;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------- TODAY-BTN-ICON: кнопка «Сегодня» — круглая иконка ---------- */
#today-btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
#today-btn svg { width: 16px; height: 16px; display: block; }
@media (max-width: 760px) {
  #panel-today #today-btn {
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    border-radius: 50%;
  }
}

/* ---------- LESSON-CARD-GRID-V2: карточка занятия «рейл времени» ---------- */
/* Время и длительность — отдельной колонкой слева, действия подписаны словами:
   никаких иконок, которые читаются как «править / отправить / удалить». */
.lesson.lesson-v2 {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 0;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}
.lesson-v2 .lesson-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 9px 8px;
  background: linear-gradient(180deg, #f4faf7, #eaf3f0);
  border-right: 1px solid var(--brand-line);
}
.lesson-v2 .lesson-time {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-dark);
  line-height: 1.2;
}
.lesson-v2 .lesson-dur { font-size: 10px; color: var(--text-3); }
.lesson-v2 .lesson-seq {
  margin-top: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.lesson-v2.is-done .lesson-rail {
  background: linear-gradient(180deg, #f1f8f0, #e7f2e4);
  border-right-color: #cfe6d3;
}
.lesson-v2.is-cancelled .lesson-rail {
  background: linear-gradient(180deg, #fdf5f4, #fbeae8);
  border-right-color: #f0c8c4;
}
.lesson-v2.is-cancelled .lesson-time { color: var(--danger); }

.lesson-v2 .lesson-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
}
.lesson-v2 .who b { display: block; font-size: 14.5px; font-weight: 600; }
.lesson-v2 .lesson-meta { font-size: 11px; color: var(--text-3); }
.lesson-v2 .chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }

.lesson-btn {
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border-1);
  border-radius: 10px;
  background: var(--surface-1);
  color: var(--text-1);
  font-size: 12px;
  padding: 8px 10px;
  white-space: nowrap;
  cursor: pointer;
}
.lesson-btn:disabled { cursor: default; }
.lesson-btn-main {
  width: 100%;
  min-height: 36px;
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.lesson-btn-soft {
  width: 100%;
  min-height: 36px;
  background: var(--brand-soft);
  border-color: var(--brand-line);
  color: var(--brand-dark);
  font-weight: 600;
}
.lesson-btn-sub {
  min-height: 32px;
  background: transparent;
  color: var(--text-2);
}
.lesson-btn-danger {
  background: #fff;
  border-color: #eccac5;
  color: var(--danger);
}
.lesson-sub { display: grid; gap: 5px; margin-top: 2px; }
.lesson-sub.cols-2 { grid-template-columns: repeat(2, 1fr); }
.lesson-sub.cols-3 { grid-template-columns: repeat(3, 1fr); }
.lesson-sub .lesson-btn { padding: 6px 4px; font-size: 11.5px; }

@media (hover: hover) and (pointer: fine) {
  .lesson-btn-sub:hover { background: var(--surface-2); }
  .lesson-btn-danger:hover { background: var(--danger-soft); }
  .lesson-btn-main:hover { background: var(--brand-grad-top, var(--brand)); }
}

@media (max-width: 760px) {
  .lesson.lesson-v2 { grid-template-columns: 66px 1fr; }
  .lesson-v2 .lesson-body { padding: 7px 9px; gap: 3px; }
  .lesson-v2 .who b { font-size: 14px; }
  .lesson-btn-main, .lesson-btn-soft { min-height: 34px; }
}

/* DS-оболочка (screens.css) задаёт карточке padding 16px и крупное имя с !important.
   Для «рейла» это лишнее: карточка без внешних отступов, ритм задают рейл и тело. */
body.app-shell #lessons .lesson.lesson-v2 {
  padding: 0 !important;
  gap: 0 !important;
  align-items: stretch;
  line-height: 1.3;
}
body.app-shell #lessons .lesson-v2 .lesson-body { padding: 8px 10px !important; gap: 4px; }
body.app-shell #lessons .lesson-v2 .who b {
  font-size: 14.5px;
  line-height: 1.25;
  color: var(--ds-ink, var(--text-1));
}
body.app-shell #lessons .lesson-v2 .lesson-meta { font-size: 11px; line-height: 1.3; }
body.app-shell #lessons .lesson-v2 .chip { font-size: 10.5px; line-height: 1.3; padding: 2.5px 8px; }
body.app-shell #lessons .lesson-v2 .lesson-time { font-size: 15px; line-height: 1.2; }
body.app-shell #lessons .lesson-v2 .lesson-btn { font-size: 12px; line-height: 1.2; }
body.app-shell #lessons .lesson-v2 .lesson-btn-sub { font-size: 11.5px; }

/* Статусы на карточке «Сегодня» — не плашки, а просто цветной текст:
   фон и рамка убраны, чтобы не выглядели кнопками. */
body.app-shell #lessons .lesson-v2 .chip {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-3) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
body.app-shell #lessons .lesson-v2 .chip.done {
  color: var(--ok) !important;
  font-weight: 600;
}
body.app-shell #lessons .lesson-v2 .chip.paid {
  color: var(--brand) !important;
  font-weight: 600;
}
body.app-shell #lessons .lesson-v2 .chip.free {
  color: #245c96 !important;
  font-weight: 600;
}
body.app-shell #lessons .lesson-v2 .chip.cancelled {
  color: var(--danger) !important;
  font-weight: 600;
}
body.app-shell #lessons .lesson-v2 .chips { gap: 10px; }

/* ---------- APP-SHELL-MOBILE: экран не прокручивается, скроллятся только списки ---------- */
@media (max-width: 760px) {
  body.app-shell {
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
    display: flex;
    flex-direction: column;
  }
  body.app-shell .site-header { flex: 0 0 auto; }
  body.app-shell main.container {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
  }
  body.app-shell .panel {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  body.app-shell .panel.active { display: flex; flex-direction: column; }

  body.app-shell #panel-today .daybar,
  body.app-shell .cal-head,
  body.app-shell .cal-weekdays,
  body.app-shell #panel-kids .toolbar,
  body.app-shell #m-toolbar,
  body.app-shell #v-toolbar,
  body.app-shell #panel-fin > .card,
  body.app-shell .page-head { flex: 0 0 auto; }

  body.app-shell #lessons,
  body.app-shell #kids,
  body.app-shell #pay,
  body.app-shell #materials,
  body.app-shell #video-list,
  body.app-shell #fin-body,
  body.app-shell #cal-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: 8px;
  }
  body.app-shell #panel-pay .backup-mini { flex: 0 0 auto; }
  body.app-shell #panel-calc { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  body.app-shell .cal-split {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body.app-shell .cal-split #cal-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}

/* ---------- APP-SHELL-FIXED: экран вообще не прокручивается ---------- */
@media (max-width: 760px) {
  html.app-html {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }
  html.app-html body.app-shell,
  html.app-html body.admin-shell {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }
  html.app-html body.app-shell main.container,
  html.app-html body.admin-shell main.container {
    overscroll-behavior: contain;
  }
}

/* ---------- KIDS-CHIP-FIX: чип «активен» — обычная компактная плашка ---------- */
@media (max-width: 760px) {
  .child-card header {
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
  }
  .child-card header .chip {
    flex: 0 0 auto;
    align-self: flex-start;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
    padding: 4px 12px;
    font-size: .78rem;
    line-height: 1.3;
    border-radius: 999px;
    white-space: nowrap;
  }
}

/* ---------- SHEET-SLIDE-UP: расписание дня выезжает снизу ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes sheetSlideUp {
    from { opacity: .35; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes sheetBackdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  /* сама шторка выезжает снизу экрана */
  #sheet-overlay.open .modal {
    animation: sheetSlideUp .32s cubic-bezier(.22, .9, .3, 1) both;
    will-change: transform;
  }
  #sheet-overlay.open { animation: sheetBackdropIn .2s ease both; }
}

/* на телефоне шторка прижата к низу — выезд выглядит естественно */
@media (max-width: 760px) {
  #sheet-overlay { align-items: flex-end; padding: 0; }
  #sheet-overlay .modal {
    width: auto;
    left: 12px;
    right: 12px;
    bottom: 0;
    border-radius: 20px 20px 0 0;
    max-height: 88dvh;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    position: relative;
    margin: 0 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #sheet-overlay.open,
  #sheet-overlay.open .modal { animation: none !important; }
}

/* ---------- SHEET-SLIDE-UP-SMOOTH: более плавный выезд шторки ----------
   Причина «рывков»: анимация элемента с backdrop-filter и тенями заставляет
   браузер перерисовывать размытие каждый кадр. Убираем тяжёлые эффекты у шторки,
   анимируем только transform/opacity и используем translate3d (GPU). */
@keyframes sheetSlideUpSmooth {
  from { opacity: .4; transform: translate3d(0, 100%, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

#sheet-overlay .modal {
  background: var(--surface-1);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
}

#sheet-overlay .modal .chip,
#sheet-overlay .modal .card,
#sheet-overlay .modal .slot-row {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

@media (prefers-reduced-motion: no-preference) {
  #sheet-overlay.open .modal {
    animation: sheetSlideUpSmooth .38s cubic-bezier(.22, .61, .36, 1) both;
  }
  #sheet-overlay.open { animation: sheetBackdropIn .22s linear both; }
}

@media (prefers-reduced-motion: reduce) {
  #sheet-overlay.open .modal { animation: none !important; }
}

/* ---------- SHEET-CENTER-MOBILE: шторка расписания ровно по центру ---------- */
@media (max-width: 760px) {
  #sheet-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }
  #sheet-overlay .modal {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
    margin: 0 auto;
    box-sizing: border-box;
    border-radius: 20px 20px 0 0;
  }
}

/* ---------- SHEET-VCENTER: расписание по центру экрана ---------- */
@media (max-width: 760px) {
  #sheet-overlay {
    align-items: center;
    justify-content: center;
    padding: 12px;
  }
  #sheet-overlay .modal {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    margin: auto;
    max-height: 86dvh;
    box-sizing: border-box;
    border-radius: 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------- QUICK-SLIDE-UP: экран добавления занятия выезжает снизу ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes quickSlideUp {
    from { opacity: .4; transform: translate3d(0, 100%, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
  }
  #quick-overlay.open .modal {
    animation: quickSlideUp .38s cubic-bezier(.22, .61, .36, 1) both;
    will-change: transform;
    backface-visibility: hidden;
  }
  #quick-overlay.open { animation: sheetBackdropIn .22s linear both; }
}

#quick-overlay .modal {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: var(--surface-1);
}

@media (prefers-reduced-motion: reduce) {
  #quick-overlay.open,
  #quick-overlay.open .modal { animation: none !important; }
}

/* ---------- QUICK-VCENTER: форма занятия по центру экрана ---------- */
@media (max-width: 760px) {
  #quick-overlay {
    align-items: center;
    justify-content: center;
    padding: 12px;
  }
  #quick-overlay .modal {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    margin: auto;
    max-height: 88dvh;
    box-sizing: border-box;
    border-radius: 20px;
    padding: var(--ds-space-16) var(--ds-space-16) calc(var(--ds-space-16) + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
  }
}

/* ---------- CHILD-SLIDE-UP: карточка ребёнка выезжает снизу ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes childSlideUp {
    from { opacity: .4; transform: translate3d(0, 100%, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
  }
  #child-overlay.open .modal {
    animation: childSlideUp .38s cubic-bezier(.22, .61, .36, 1) both;
    will-change: transform;
    backface-visibility: hidden;
  }
  #child-overlay.open { animation: sheetBackdropIn .22s linear both; }
}

#child-overlay .modal {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: var(--surface-1);
}

@media (max-width: 760px) {
  #child-overlay {
    align-items: center;
    justify-content: center;
    padding: 12px;
  }
  #child-overlay .modal {
    width: 100%;
    max-width: 100%;
    margin: auto;
    max-height: 88dvh;
    box-sizing: border-box;
    border-radius: 20px;
    padding: var(--ds-space-16) var(--ds-space-16) calc(var(--ds-space-16) + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overflow-x: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  #child-overlay.open,
  #child-overlay.open .modal { animation: none !important; }
}

/* ---------- SLIDE-MODALS: сводка, абонемент, программа — выезд снизу ---------- */
#summary-overlay .modal,
#sub-overlay .modal,
#program-overlay .modal {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: var(--surface-1);
}

@media screen and (prefers-reduced-motion: no-preference) {
  #summary-overlay.open .modal,
  #sub-overlay.open .modal,
  #program-overlay.open .modal {
    animation: sheetSlideUpSmooth .38s cubic-bezier(.22, .61, .36, 1) both;
    will-change: transform;
    backface-visibility: hidden;
  }
  #summary-overlay.open,
  #sub-overlay.open,
  #program-overlay.open {
    animation: sheetBackdropIn .22s linear both;
  }
}

@media (max-width: 760px) {
  #summary-overlay,
  #sub-overlay,
  #program-overlay {
    align-items: center;
    justify-content: center;
    padding: 12px;
  }
  #summary-overlay .modal,
  #sub-overlay .modal,
  #program-overlay .modal {
    width: 100%;
    max-width: 100%;
    margin: auto;
    max-height: 88dvh;
    box-sizing: border-box;
    border-radius: 20px;
    padding: var(--ds-space-16) var(--ds-space-16) calc(var(--ds-space-16) + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overflow-x: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  #summary-overlay.open,
  #summary-overlay.open .modal,
  #sub-overlay.open,
  #sub-overlay.open .modal,
  #program-overlay.open,
  #program-overlay.open .modal { animation: none !important; }
}

/* ---------- MEDIA-MODALS-SLIDE: материалы и видео выезжают снизу ---------- */
#m-overlay .modal,
#v-overlay .modal {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: var(--surface-1);
}

@media screen and (prefers-reduced-motion: no-preference) {
  #m-overlay.open .modal,
  #v-overlay.open .modal {
    animation: sheetSlideUpSmooth .38s cubic-bezier(.22, .61, .36, 1) both;
    will-change: transform;
    backface-visibility: hidden;
  }
  #m-overlay.open,
  #v-overlay.open {
    animation: sheetBackdropIn .22s linear both;
  }
}

@media (max-width: 760px) {
  #m-overlay,
  #v-overlay {
    align-items: center;
    justify-content: center;
    padding: 12px;
  }
  #m-overlay .modal,
  #v-overlay .modal {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    margin: auto;
    max-height: 88dvh;
    box-sizing: border-box;
    border-radius: 20px;
    padding: var(--ds-space-16) var(--ds-space-16) calc(var(--ds-space-16) + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overflow-x: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  #m-overlay.open,
  #m-overlay.open .modal,
  #v-overlay.open,
  #v-overlay.open .modal { animation: none !important; }
}

/* ---------- CAL-COUNT-COLOR: число свободных слотов с цветовым градиентом ---------- */
.cal-count { font-weight: 800; font-variant-numeric: tabular-nums; }
.cal-count.zero { opacity: 1; }
.cal-slot.summary .cal-count { font-size: .86rem; }

/* ---------- CAL-CELL-TINT: клетка дня заливается цветом свободного времени ---------- */
.cal-slot.summary {
  background: transparent;
  border: 0;
  box-shadow: none;
  width: 100%;
  flex: 1 1 auto;
  min-height: 22px;
  padding: 0;
  display: block;
}
.cal-slot.summary:hover { background: var(--glass); }
.cal-count { display: none; }

/* ---------- CAL-SUMMARY-CLEAR: внутри клетки не должно быть белой плашки ---------- */
.cal-slot.summary,
.cal-slot.summary.empty {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: transparent !important;
}
.cal-slot.summary:hover { background: var(--glass) !important; }

/* ---------- CAL-BOARD-BG: ровная подложка под календарём ----------
   Фото-фон просвечивает и искажает цвета клеток — кладём светлую «бумагу». */
#cal-grid {
  background: rgba(253, 249, 243, .94);
  border: 1px solid var(--glass-strong);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 10px 28px var(--border-2);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

#cal-grid.cal-list {
  padding: 8px;
}

@media (max-width: 760px) {
  #cal-grid { padding: 4px; border-radius: 14px; }
  #cal-grid.cal-list { padding: 8px; }
}

/* ---------- CAL-BOARD-SUBTLE: подложка календаря едва заметная ---------- */
#cal-grid {
  background: rgba(253, 249, 243, .68);
  border: 1px solid var(--glass);
  box-shadow: 0 6px 18px var(--border-2);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

#cal-grid.cal-list {
  background: rgba(253, 249, 243, .62);
  border-color: var(--glass);
  box-shadow: none;
}

/* ---------- CAL-BOARD-FAINT: подложка едва угадывается ---------- */
#cal-grid {
  background: rgba(253, 249, 243, .42);
  border: 1px solid var(--glass);
  box-shadow: none;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

#cal-grid.cal-list {
  background: rgba(253, 249, 243, .38);
  border-color: var(--glass);
}

/* на узком календаре у клеток нет белой подложки — только цвет свободного времени */
@media (max-width: 900px) {
  .cal-cell {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
  }
  .cal-cell.weekend {
    background: rgba(251, 236, 235, .5);
    border-color: rgba(200, 150, 150, .14);
  }
  .cal-cell.empty {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
}

/* ---------- CAL-GHOST-FIX: у пустых клеток нет «матового стекла» ----------
   Призрачные прямоугольники в начале месяца давал backdrop-filter у .cal-cell:
   фон прозрачный, но размытие всё равно рисует светлый блок. */
.cal-cell.empty,
.cal-cell {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

@media (max-width: 900px) {
  .cal-cell {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
  }
  .cal-cell.empty {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
}

/* ---------- CHILD-CARD-ACTIONS-FIX: карточка ребёнка не обрезает кнопки ---------- */
@media (max-width: 760px) {
  .child-card {
    overflow: visible !important;
    height: auto;
    min-height: 0;
  }
  .child-card .actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
  }
  .child-card .actions .btn {
    width: 100%;
    min-height: 38px;
    min-width: 0;
    justify-content: center;
    padding: 8px 8px;
    font-size: .8rem;
    white-space: nowrap;
  }
  .child-card .actions .btn:last-child {
    grid-column: 1 / -1;
  }
}

/* ---------- CHILD-CARD-ROWS: строки списка по высоте карточки ---------- */
@media (max-width: 760px) {
  #kids.cards-list {
    grid-auto-rows: max-content;
    align-items: start;
  }
  #kids .child-card { align-self: start; }
}

/* ---------- PAY-SUMMARY-TOGGLE: сводка по кнопке ---------- */
.pay-summary-box {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(253, 249, 243, .72);
  border: 1px solid var(--glass);
  font-size: .85rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
@media (max-width: 760px) {
  .pay-summary-box { font-size: .8rem; padding: 8px 8px; }
}

/* ---------- TOAST-RECT: прямоугольные уведомления над нижними вкладками ---------- */
.toast {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 24px;
  transform: translateX(-50%) translateY(120%);
  width: auto;
  max-width: min(520px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--brand-dark);
  color: var(--on-brand);
  font-size: .9rem;
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 14px 34px rgba(20, 34, 30, .3);
  z-index: 100000;
  opacity: 1;
  transition: transform .24s ease, opacity .24s ease;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 760px) {
  .toast {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 24px);
    max-width: none;
    font-size: .86rem;
    padding: 12px 12px;
    border-radius: 14px;
  }
}

/* ---------- TOAST-HIDDEN-FIX: скрытый тост не висит полосой ---------- */
.toast {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
.toast.show {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* ---------- PAY-SUM-COLORS: оплачено зелёным, долг красным ---------- */
.sum-paid,
td.sum-paid {
  color: #2f7a43;
  font-weight: 700;
}
.sum-debt,
td.sum-debt {
  color: #c0392b;
  font-weight: 700;
}

/* ---------- BACKUP-MODAL: маленькое окно резервных копий ---------- */
.backup-modal { width: min(440px, 100%); }
.backup-modal h2 { font-size: 1.15rem; margin-bottom: 8px; }
.backup-modal #backup-info { margin: 0 0 8px; font-size: .9rem; }

#backup-overlay.open .modal {
  animation: sheetSlideUpSmooth .32s cubic-bezier(.22, .61, .36, 1) both;
}
@media (max-width: 760px) {
  #backup-overlay { padding: 12px; }
  #backup-overlay .modal { border-radius: 20px; max-height: 86dvh; }
}

/* ---------- PAY-MAIN-SWAP: оплачено и долг — главное, начислено — мелко ---------- */
.pay-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 4px;
  font-size: 1rem;
}
.pay-main .sum-paid,
.pay-main .sum-debt { font-size: 1.02rem; }
.sum-accrued {
  color: var(--muted) !important;
  font-weight: 500 !important;
  font-size: .82rem;
}
td.sum-accrued { font-weight: 500; }

/* ---------- PAY-TOP-CORNER: «Оплатить» в правом верхнем углу карточки ---------- */
.lesson { position: relative; }
.lesson .pay-top {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  padding: 4px 8px;
  min-height: 30px;
  font-size: .72rem;
  border-radius: 999px;
}
@media (max-width: 760px) {
  .lesson .who { padding-right: 64px; }
  .lesson .pay-top { top: 8px; right: 10px; }
}

/* ---------- PAY-TOP-DISABLED: неактивная кнопка «Оплатить» ---------- */
.lesson .pay-top:disabled {
  opacity: .45;
  cursor: default;
  background: var(--glass);
  color: var(--muted);
  border-color: var(--glass-strong);
}
.lesson .pay-top.paid-top:disabled {
  opacity: .9;
  color: #2f7a43;
  background: rgba(234, 245, 234, .9);
}

/* ---------- PAY-TOP-DESKTOP-INLINE: на ПК «Оплатить» в общем ряду ---------- */
.lesson .pay-top {
  position: static;
  padding: 4px 12px;
  min-height: 34px;
  font-size: .8rem;
  border-radius: 999px;
}

@media (max-width: 760px) {
  .lesson .pay-top {
    position: absolute;
    top: 8px;
    right: 10px;
    padding: 4px 8px;
    min-height: 30px;
    font-size: .72rem;
  }
  .lesson .who { padding-right: 64px; }
}

/* ---------- PAY-TOP-ABS-AGAIN: «Оплатить» снова в правом верхнем углу ---------- */
.lesson .pay-top {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  padding: 4px 12px;
  min-height: 34px;
  font-size: .8rem;
  border-radius: 999px;
}

@media (max-width: 760px) {
  .lesson .pay-top {
    top: 8px;
    right: 10px;
    padding: 4px 8px;
    min-height: 30px;
    font-size: .72rem;
  }
  .lesson .who { padding-right: 64px; }
}

/* ---------- PAY-TOP-NOWIDTH: угловая кнопка не растягивается на всю карточку ---------- */
.lesson .pay-top {
  width: auto !important;
  max-width: 140px;
  flex: 0 0 auto;
}

/* ---------- PAY-DESKTOP-ROW-FIX: на ПК «Оплатить» в общем ряду, без наложения ---------- */
@media (min-width: 761px) {
  .lesson .pay-top {
    position: static;
    width: auto !important;
    max-width: none;
    margin: 0;
    padding: 4px 12px;
    min-height: 34px;
    font-size: .8rem;
    border-radius: 999px;
    flex: 0 0 auto;
  }
  .lesson .actions { flex-wrap: wrap; row-gap: 4px; }
}

/* ---------- SUB-HIST-ROW: ровная история пополнений ---------- */
.sub-hist-row {
  border: 1px solid var(--border-2);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 8px;
  display: grid;
  gap: 4px;
  background: var(--glass);
}
.sub-hist-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sub-hist-date { font-size: .8rem; color: var(--muted); }
.sub-hist-main b { font-size: .95rem; line-height: 1.3; }
.sub-hist-comment { font-size: .82rem; color: var(--muted); line-height: 1.35; }
.sub-hist-del {
  flex: 0 0 auto;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
}

/* ---------- MATERIAL-CARD-CLEAN: аккуратная карточка материала ---------- */
@media (max-width: 760px) {
  #materials { align-items: start; }
  #materials .material-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
  }
  #materials .material-thumb,
  #materials .material-card img {
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px;
    border-radius: 8px;
  }
  #materials .material-card {
    padding: 8px;
    height: auto;
  }
  #materials .material-info { font-size: .82rem; }
  #materials .material-info b { font-size: .86rem; }
  #materials .material-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    width: 100%;
    margin-top: 4px;
  }
  #materials .material-actions .btn {
    min-width: 0;
    padding: 4px 4px;
    font-size: .72rem;
    white-space: nowrap;
  }
}

/* ---------- MATERIAL-CARD-LAYOUT: карточка материала без «каши» ---------- */
.material-card { display: block; }
.material-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: flex-start;
}
.material-info {
  flex: 1 1 240px;
  min-width: 0;
}
.material-info b {
  display: block;
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: 4px;
}
.material-info > div {
  line-height: 1.45;
  margin-top: 2px;
}
.material-info a {
  display: inline-block;
  margin-top: 4px;
  font-size: .88rem;
}
.material-actions {
  flex: 1 0 100%;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.material-actions .btn {
  min-height: 34px;
  padding: 8px 16px;
  font-size: .84rem;
}

@media (max-width: 760px) {
  .material-info { flex: 1 1 auto; }
  .material-thumb { width: 44px !important; height: 44px !important; flex: 0 0 44px; }
  .material-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
  .material-actions .btn { width: 100%; padding: 8px 4px; }
}

/* ---------- CAL-HEAD-SPACING: календарь не наезжает на шапку ---------- */
.cal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.cal-head .btn:focus { outline: none; }
.cal-head .btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .cab-head { margin-bottom: 16px !important; }
  #panel-cal .cal-head {
    margin-top: 0;
    row-gap: 8px;
    column-gap: 8px;
  }
  #panel-cal .cal-head .btn { min-height: 38px; }
}

/* ---------- CAL-HEAD-TIGHT: шапка компактнее, без лишнего скролла ---------- */
@media (max-width: 760px) {
  .cab-head {
    margin: 4px 0 8px !important;
    gap: 8px;
  }
  .cab-head h1 {
    font-size: clamp(1.15rem, 4.6vw, 1.45rem);
    line-height: 1.15;
  }
  .cab-head #onboard-open {
    width: 26px;
    height: 26px;
    min-height: 26px;
    font-size: .85rem;
  }
  #panel-cal .cal-head {
    margin-top: 4px;
    row-gap: 4px;
  }
  #panel-cal .cal-head .btn { min-height: 36px; }
}

/* ---------- LOADER-SPIN: аккуратный индикатор загрузки ---------- */
.loader {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-2);
  border-top-color: var(--brand, #1f5a45);
  border-radius: 50%;
  animation: cabinetSpin .7s linear infinite;
  vertical-align: -3px;
}
.loader.center {
  display: block;
  margin: var(--ds-space-16) auto;
  width: 22px;
  height: 22px;
}
@keyframes cabinetSpin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .loader { animation-duration: 1.6s; }
}

/* ---------- GLOBAL-LOADER: забелённый экран с центрированным лоадером ---------- */
.global-loader {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(253, 249, 243, .72);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.global-loader.open { display: flex; }
.global-loader-text {
  font-size: .9rem;
  color: var(--muted, #7a6f63);
  letter-spacing: .01em;
}
.loader.loader-big {
  width: 34px;
  height: 34px;
  border-width: 3px;
  vertical-align: 0;
}
@media (prefers-reduced-motion: reduce) {
  .global-loader { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- FIN-CHART-HIDESCROLL: график листается, но без видимого скроллбара ---------- */
.fin-chart {
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.fin-chart::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.fin-chart-wrap {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.fin-chart-wrap::-webkit-scrollbar {
  display: none;
}

/* ---------- CAB-USER-BADGE: кто вошёл и выход ---------- */
.cab-user {
  font-size: .82rem;
  color: var(--muted);
  margin-right: 4px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cab-user[data-role="owner"] { color: var(--brand); font-weight: 600; }
@media (max-width: 760px) {
  .cab-user { display: none; }
}

/* ---------- CAB-ACTIONS-ALIGN: «Выйти» и «На сайт» одинаковые, ровно в ряд ---------- */
.cab-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cab-actions .btn,
.cab-actions .btn.mini {
  padding: 8px 16px;
  font-size: .9rem;
  min-height: 40px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 760px) {
  .cab-actions { gap: 4px; }
  .cab-actions .btn,
  .cab-actions .btn.mini {
    padding: 8px 12px;
    font-size: .82rem;
    min-height: 36px;
  }
}

/* ---------- CAB-PROFILE-MOBILE: круглая кнопка профиля и мини-окно ---------- */
.cab-profile-wrap { position: relative; display: block; }
.cab-profile {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: var(--brand);
  color: var(--on-brand);
  font: inherit;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(31, 75, 67, .18);
}
.cab-profile:active { transform: scale(.96); }
.cab-profile-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 1200;
  min-width: 220px;
  max-width: 280px;
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(31, 45, 40, .18);
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cab-profile-pop b { font-size: .95rem; line-height: 1.25; }
.cab-profile-role { font-size: .8rem; color: var(--brand); font-weight: 600; }
.cab-profile-login { font-size: .78rem; color: var(--muted); }
.cab-profile-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-top: 8px;
}
.cab-profile-actions .btn {
  width: 100%;
  justify-content: center;
  min-height: 38px;
  padding: 8px 8px;
  font-size: .84rem;
  white-space: nowrap;
}
.cab-profile-actions #profile-team.is-locked {
  opacity: .55;
}
.cab-profile-actions #profile-team.is-locked:hover {
  opacity: .75;
}
.cab-profile-pop { min-width: 250px; }

.cab-profile svg { display: block; }

@media (max-width: 760px) {
  .cab-actions .cab-user,
  .cab-actions #logout-btn { display: none; }
  .cab-profile-wrap { display: block; }
  .cab-actions { gap: 8px; }
  .cab-actions > a.btn {
    min-height: 40px;
    padding: 8px 12px;
    font-size: .85rem;
  }
}

/* ---------- CAB-ADMIN-LINK: «Заявки» только владельцу и админу ---------- */
.cab-admin-link { white-space: nowrap; }
@media (max-width: 760px) {
  .cab-actions .cab-admin-link { display: none; }
}

@media (max-width: 760px) {
  .cab-profile-actions #profile-team { display: inline-flex; }
}

/* ---------- CHILD-SPEC-ROWS: аккуратный список специалистов ребёнка ---------- */
#child-spec-list .spec-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 8px 8px;
  border-radius: 10px;
  background: var(--glass);
  border: 1px solid var(--border-2);
  margin: 0;
}
#child-spec-list .spec-row input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--brand);
}
#child-spec-list .spec-row-text {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  line-height: 1.35;
  font-size: .92rem;
}
#child-spec-list .spec-row-text b { font-weight: 600; }
#child-spec-list .spec-row-text .muted { white-space: nowrap; font-size: .84rem; }
#child-spec-overlay .modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
#child-spec-overlay .modal-actions .btn { width: 100%; min-height: 46px; }
@media (max-width: 760px) {
  #child-spec-list .spec-row-text { font-size: .95rem; }
  #child-spec-list .spec-row-text .muted { white-space: normal; }
}

/* ---------- CHILD-MENU-DOTS: действия ребёнка под «три точки» ---------- */
.child-card { position: relative; z-index: 1; }
.child-card.menu-open { z-index: 60; }
.child-card header { gap: 8px; }
.child-head-right { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.child-menu-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: var(--glass-strong);
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.child-menu-btn:hover, .child-menu-btn[aria-expanded="true"] {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--surface-1);
}
.child-menu {
  position: absolute;
  right: 12px;
  top: 46px;
  z-index: 70;
  transform-origin: top right;
  animation: childMenuIn .17s ease-out;
  min-width: 190px;
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(31, 45, 40, .18);
  padding: 8px;
  display: grid;
  gap: 4px;
}
.child-menu[hidden] { display: none; }
.child-menu .btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: transparent;
  border-color: transparent;
  min-height: 38px;
}
.child-menu .btn:hover { background: rgba(31, 90, 69, .08); color: var(--brand); }
.child-menu .child-menu-del { color: var(--danger); }
.child-menu .child-menu-del:hover { background: rgba(179, 74, 63, .08); color: var(--danger); }

@keyframes childMenuIn {
  from { opacity: 0; transform: translateY(-4px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .child-menu { animation: none; }
}

/* ---------- CHILD-SPEC-POP: плавное появление окна специалистов ---------- */
#child-spec-overlay.open .modal {
  animation: childSpecPop .2s ease-out;
}
@keyframes childSpecPop {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  #child-spec-overlay.open .modal { animation: none; }
}

/* ---------- CHILD-SPEC-SLIDE: окно специалистов выезжает снизу на телефоне ---------- */
@media (max-width: 760px) {
  #child-spec-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  #child-spec-overlay .modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0 !important;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  #child-spec-overlay.open .modal {
    animation: sheetSlideUpSmooth .36s cubic-bezier(.22, .61, .36, 1) both !important;
  }
  #child-spec-overlay.open {
    animation: sheetBackdropIn .22s linear both;
  }
}

@media (prefers-reduced-motion: reduce) {
  #child-spec-overlay.open .modal { animation: none !important; }
}

/* ---------- HIDE-SCROLLBARS: в приложении не показываем полосы прокрутки ---------- */
html, body, * {
  scrollbar-width: none;            /* Firefox */
  -ms-overflow-style: none;         /* старый Edge/IE */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
/* прокрутка при этом полностью работает */

/* ---------- FIN-BY-SPEC: разбивка финансов по специалистам ---------- */
.fin-spec-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-2);
}
.fin-spec-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.fin-spec-name { font-size: .95rem; min-width: 0; }
.fin-spec-name b { font-weight: 600; }
.fin-spec-name .muted { font-size: .82rem; }
.fin-spec-nums { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: .88rem; }
.fin-spec-done { color: var(--muted); }
.fin-spec-done b { color: var(--ink); }
.fin-spec-nums .sum-debt { font-size: .82rem; }
@media (max-width: 760px) {
  .fin-spec-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .fin-spec-nums { font-size: .9rem; }
}

/* ---------- CAB-PASS-LINK: «Пароль» на ПК, «Сменить пароль» в профиле на телефоне ---------- */
@media (max-width: 760px) {
  .cab-actions .cab-pass-link,
  .cab-actions #cab-password-btn,
  #cab-password-btn { display: none !important; }
}

/* ---------- SCHEDULE-UI: окно рабочего графика ---------- */
.sched-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.sched-days .check { margin: 0; }
@media (max-width: 760px) {
  .cab-actions .cab-schedule-link,
  .cab-actions #cab-schedule-btn,
  #cab-schedule-btn { display: none !important; }
}

/* ---------- CAL-NO-SLOTS: подсказка, пока график не настроен ---------- */
.cal-no-slots {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
  font-size: .92rem;
}
.cal-no-slots b { color: var(--ink); font-size: 1.05rem; }
.cal-no-slots span { max-width: 340px; line-height: 1.4; }

/* ---------- SCHEDULE-UNIFIED-FIELDS: одинаковые поля в «Моём графике» и «Графике» специалиста ---------- */
#schedule-overlay .modal,
#sched-overlay .modal {
  padding: 16px !important;
}
#schedule-overlay .field,
#sched-overlay .field {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  margin: 0 0 12px !important;
}
#schedule-overlay .field > label,
#sched-overlay .field > label,
#schedule-overlay .modal > p,
#sched-overlay .modal > p {
  display: block;
  margin: 0 !important;
  font-size: .86rem;
  line-height: 1.3;
}
#schedule-overlay .input,
#sched-overlay .input,
#schedule-overlay select.input,
#sched-overlay select.input {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  box-sizing: border-box;
  min-height: 44px;
  padding: 8px 12px;
  font-size: .95rem;
}
#schedule-overlay .calc-inputs,
#sched-overlay .sched-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
#schedule-overlay .calc-inputs .field,
#sched-overlay .sched-grid .field {
  margin-bottom: 0 !important;
  min-width: 0;
}
/* в двухколоночной сетке поля одной строки выравниваем по низу:
   подписи разной длины (1–2 строки) не сдвигают инпуты */
#sched-overlay .sched-grid .field {
  height: 100%;
}
#sched-overlay .sched-grid .field > .input {
  margin-top: auto;
}
#schedule-overlay .sched-days,
#sched-overlay #sched-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
}
#schedule-overlay .sched-days .check,
#sched-overlay #sched-days .check {
  margin: 0;
  font-size: .92rem;
}
#schedule-overlay .modal-actions,
#sched-overlay .modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
#schedule-overlay .modal-actions .btn,
#sched-overlay .modal-actions .btn {
  width: 100%;
  min-height: 46px;
  font-size: .95rem;
}
@media (max-width: 560px) {
  #schedule-overlay .calc-inputs,
  #sched-overlay .sched-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- CAL-VIEW-ROW: «Сетка/Список» и выбор календаря в одной строке ---------- */
.cal-view-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.cal-view-row .cal-view-btn { flex: 0 0 auto; }
.cal-view-row .cal-specialist-select {
  flex: 1 1 140px;
  min-width: 0;
  max-width: 260px;
  min-height: 40px;
  padding: 8px 8px;
  font-size: .88rem;
  text-overflow: ellipsis;
}
@media (max-width: 760px) {
  .cal-view-row { width: 100%; }
  .cal-view-row .cal-specialist-select { max-width: none; }
}

/* ---------- KIDS-CHECKS-ROW: «Показать архив» и «Только мои дети» в одной строке ---------- */
.kids-checks {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  width: 100%;
  min-width: 0;
}
.kids-checks .check {
  margin: 0;
  white-space: nowrap;
  font-size: .88rem;
}
@media (max-width: 760px) {
  .kids-checks { gap: 8px; }
  .kids-checks .check { font-size: .84rem; }
}

/* ---------- CAL-SEG-TOGGLE: единый тумблер «Сетка/Список» с плавным ходом ---------- */
.cal-seg {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  background: var(--glass);
  flex: 0 0 auto;
}
.cal-seg::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 6px 14px rgba(31, 75, 67, .18);
  transition: transform .26s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
  pointer-events: none;
}
.cal-seg.list::before { transform: translateX(100%); }
.cal-seg-btn {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--ink-soft, #5f574d);
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  width: 76px;
  padding: 8px 0;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .18s ease;
}
.cal-seg-btn.active {
  background: transparent;
  color: var(--on-brand);
  box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
  .cal-seg::before { transition: none; }
}
.cal-list-free {
  border-style: dashed !important;
  background: rgba(31, 90, 69, .05) !important;
}
.cal-list-free .cal-list-time { color: var(--brand); font-size: .78rem; }
.cal-list-free .cal-list-who { color: var(--brand-dark); font-weight: 600; }
@media (max-width: 760px) {
  .cal-seg-btn { padding: 4px 12px; font-size: .8rem; }
}

/* ---------- SCHEDULE-BOUTIQUE: мягкие карточки, чипы и pill-поля ---------- */
#schedule-overlay.open .modal.sched-boutique,
#sched-overlay.open .modal.sched-boutique {
  background:
    radial-gradient(80% 42% at 100% 0%, var(--surface-tint-warm) 0%, rgba(255, 233, 212, 0) 58%),
    radial-gradient(70% 40% at 0% 100%, var(--surface-tint-cool) 0%, rgba(233, 242, 237, 0) 60%),
    linear-gradient(180deg, var(--surface-1), var(--surface-2)) !important;
  border: 1px solid var(--glass-strong) !important;
  border-radius: 24px !important;
  padding: 16px !important;
  max-height: 92dvh;
  box-shadow: 0 24px 60px rgba(76, 52, 30, .22) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  overflow-y: auto;
}
.sched-head { padding: 2px 4px 12px; }
.sched-eyebrow {
  display: block;
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
#schedule-overlay .sched-head h2,
#sched-overlay .sched-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 27px;
  line-height: 1.1;
  margin: 0 0 8px !important;
  color: var(--ink);
}
.sched-sub { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }

.sched-card {
  background: var(--surface-1);
  border: 1px solid var(--glass-strong);
  border-radius: 20px;
  padding: 12px 16px 16px;
  margin-bottom: 12px;
  box-shadow: 0 14px 34px rgba(92, 64, 36, .08);
}
.sched-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sched-ico {
  width: 40px; height: 40px;
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-dark, var(--accent-dark));
  flex: 0 0 auto;
}
.sched-ico.ico-green { background: var(--brand-soft); color: var(--brand); }
.sched-ico svg { width: 19px; height: 19px; display: block; }
.sched-card-text b { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.sched-card-text small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.sched-chips { display: flex; flex-wrap: nowrap; gap: 4px; }
.sched-chip {
  position: relative;
  margin: 0;
  cursor: pointer;
  flex: 1 1 0;
  min-width: 0;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}
.sched-chip input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  margin: 0;
  pointer-events: none;
  outline: none;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
}
.sched-chip span {
  display: flex; align-items: center; justify-content: center;
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 4px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
  -webkit-tap-highlight-color: transparent;
}
.sched-chip:active span { transform: scale(.97); transition: transform .08s ease; }
.sched-chip input:checked + span {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 8px 18px rgba(31, 75, 67, .2);
}
.sched-chip input:focus { outline: none !important; box-shadow: none !important; }
.sched-chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .sched-chip:active span { transform: none; }
}

.sched-pills { display: flex; gap: 8px; }
.sched-pill {
  flex: 1 1 0;
  min-width: 0;
  display: block;
  position: relative;
  background: var(--surface-2);
  border-radius: 16px;
  padding: 8px 12px;
  margin: 0;
}
.sched-pill .k {
  display: block;
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sched-pill.sched-pill-wide { margin-top: 8px; }
.sched-pill--select::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px; height: 7px;
  margin-top: -2px;
  border-right: 1.6px solid #c3b6a4;
  border-bottom: 1.6px solid #c3b6a4;
  transform: rotate(45deg);
  pointer-events: none;
}
#schedule-overlay .sched-select,
#sched-overlay .sched-select,
#schedule-overlay .sched-value,
#sched-overlay .sched-value {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  box-sizing: border-box;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.15;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  box-shadow: none !important;
}
#schedule-overlay .sched-value,
#sched-overlay .sched-value { font-family: var(--font-body); font-size: 20px; font-weight: 400; }
#schedule-overlay .sched-value--text,
#sched-overlay .sched-value--text {
  font-size: 14px;
  font-family: var(--font-body);
  padding: 2px 0 !important;
}
.sched-pill--select { padding-right: 32px; }

#schedule-overlay .sched-error,
#sched-overlay .sched-error {
  margin: 2px 4px 0;
  font-size: 12.5px;
  color: var(--danger);
  min-height: 1px;
}
#schedule-overlay .sched-actions,
#sched-overlay .sched-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.sched-save {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 16px;
  color: var(--on-brand);
  font-size: 15.5px;
  font-weight: 600;
  background: linear-gradient(180deg, var(--brand-grad-top), var(--brand));
  box-shadow: 0 14px 30px rgba(31, 75, 67, .26);
  cursor: pointer;
}
.sched-save:active { transform: translateY(1px); }
.sched-cancel {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  padding: 4px;
  cursor: pointer;
}
@media (max-width: 560px) {
  #schedule-overlay .modal.sched-boutique,
  #sched-overlay .modal.sched-boutique { border-radius: 22px 22px 0 0 !important; padding: 16px !important; }
  .sched-head h2 { font-size: 24px !important; }
}

/* ---------- FORM-BOUTIQUE: мягкий «бутиковый» стиль всех форм ---------- */
:is(#child-overlay,
    #quick-overlay,
    #sub-overlay,
    #program-overlay,
    #m-overlay,
    #v-overlay,
    #paste-overlay,
    #blocklib-overlay,
    #tpl-overlay,
    #matpick-overlay,
    #backup-overlay,
    #password-overlay,
    #report-overlay,
    #journal-overlay,
    #summary-overlay) .modal,
.modal.form-boutique {
  background:
    radial-gradient(80% 42% at 100% 0%, var(--surface-tint-warm) 0%, rgba(255, 233, 212, 0) 58%),
    radial-gradient(70% 40% at 0% 100%, var(--surface-tint-cool) 0%, rgba(233, 242, 237, 0) 60%),
    linear-gradient(180deg, var(--surface-1), var(--surface-2)) !important;
  border: 1px solid var(--glass-strong);
  border-radius: 24px !important;
  padding: 16px !important;
  box-shadow: 0 24px 60px rgba(76, 52, 30, .2) !important;
}
:is(#child-overlay,
    #quick-overlay,
    #sub-overlay,
    #program-overlay,
    #m-overlay,
    #v-overlay,
    #paste-overlay,
    #blocklib-overlay,
    #tpl-overlay,
    #matpick-overlay,
    #backup-overlay,
    #password-overlay,
    #report-overlay,
    #journal-overlay,
    #summary-overlay) .modal > h2,
.modal.form-boutique > h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.12;
  margin: 2px 0 12px !important;
  color: var(--ink);
}
:is(#child-overlay,
    #quick-overlay,
    #sub-overlay,
    #program-overlay,
    #m-overlay,
    #v-overlay,
    #paste-overlay,
    #blocklib-overlay,
    #tpl-overlay,
    #matpick-overlay,
    #backup-overlay,
    #password-overlay,
    #report-overlay,
    #journal-overlay,
    #summary-overlay) .modal .field,
.modal.form-boutique .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
:is(#child-overlay,
    #quick-overlay,
    #sub-overlay,
    #program-overlay,
    #m-overlay,
    #v-overlay,
    #paste-overlay,
    #blocklib-overlay,
    #tpl-overlay,
    #matpick-overlay,
    #backup-overlay,
    #password-overlay,
    #report-overlay,
    #journal-overlay,
    #summary-overlay) .modal .field > label:not(.check),
.modal.form-boutique .field > label:not(.check) {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0 2px;
}
:is(#child-overlay,
    #quick-overlay,
    #sub-overlay,
    #program-overlay,
    #m-overlay,
    #v-overlay,
    #paste-overlay,
    #blocklib-overlay,
    #tpl-overlay,
    #matpick-overlay,
    #backup-overlay,
    #password-overlay,
    #report-overlay,
    #journal-overlay,
    #summary-overlay) .modal .input,
:is(#child-overlay,
    #quick-overlay,
    #sub-overlay,
    #program-overlay,
    #m-overlay,
    #v-overlay,
    #paste-overlay,
    #blocklib-overlay,
    #tpl-overlay,
    #matpick-overlay,
    #backup-overlay,
    #password-overlay,
    #report-overlay,
    #journal-overlay,
    #summary-overlay) .modal select.input,
:is(#child-overlay,
    #quick-overlay,
    #sub-overlay,
    #program-overlay,
    #m-overlay,
    #v-overlay,
    #paste-overlay,
    #blocklib-overlay,
    #tpl-overlay,
    #matpick-overlay,
    #backup-overlay,
    #password-overlay,
    #report-overlay,
    #journal-overlay,
    #summary-overlay) .modal textarea,
.modal.form-boutique .input,
.modal.form-boutique select.input,
.modal.form-boutique textarea {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  box-sizing: border-box;
  background: var(--surface-2) !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  padding: 12px 12px !important;
  font-size: .94rem !important;
  color: var(--ink);
  box-shadow: none !important;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
:is(#child-overlay,
    #quick-overlay,
    #sub-overlay,
    #program-overlay,
    #m-overlay,
    #v-overlay,
    #paste-overlay,
    #blocklib-overlay,
    #tpl-overlay,
    #matpick-overlay,
    #backup-overlay,
    #password-overlay,
    #report-overlay,
    #journal-overlay,
    #summary-overlay) .modal .input:focus,
:is(#child-overlay,
    #quick-overlay,
    #sub-overlay,
    #program-overlay,
    #m-overlay,
    #v-overlay,
    #paste-overlay,
    #blocklib-overlay,
    #tpl-overlay,
    #matpick-overlay,
    #backup-overlay,
    #password-overlay,
    #report-overlay,
    #journal-overlay,
    #summary-overlay) .modal textarea:focus,
.modal.form-boutique .input:focus,
.modal.form-boutique textarea:focus {
  background: var(--surface-1) !important;
  border-color: rgba(31, 75, 67, .35) !important;
  box-shadow: 0 0 0 3px rgba(31, 75, 67, .1) !important;
  outline: none;
}
:is(#child-overlay,
    #quick-overlay,
    #sub-overlay,
    #program-overlay,
    #m-overlay,
    #v-overlay,
    #paste-overlay,
    #blocklib-overlay,
    #tpl-overlay,
    #matpick-overlay,
    #backup-overlay,
    #password-overlay,
    #report-overlay,
    #journal-overlay,
    #summary-overlay) .modal input[type="checkbox"],
.modal.form-boutique input[type="checkbox"] {
  accent-color: var(--brand);
  width: 18px;
  height: 18px;
}
:is(#child-overlay,
    #quick-overlay,
    #sub-overlay,
    #program-overlay,
    #m-overlay,
    #v-overlay,
    #paste-overlay,
    #blocklib-overlay,
    #tpl-overlay,
    #matpick-overlay,
    #backup-overlay,
    #password-overlay,
    #report-overlay,
    #journal-overlay,
    #summary-overlay) .modal .modal-actions,
.modal.form-boutique .modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
:is(#child-overlay,
    #quick-overlay,
    #sub-overlay,
    #program-overlay,
    #m-overlay,
    #v-overlay,
    #paste-overlay,
    #blocklib-overlay,
    #tpl-overlay,
    #matpick-overlay,
    #backup-overlay,
    #password-overlay,
    #report-overlay,
    #journal-overlay,
    #summary-overlay) .modal .modal-actions .btn,
.modal.form-boutique .modal-actions .btn {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 600;
  justify-content: center;
}
:is(#child-overlay,
    #quick-overlay,
    #sub-overlay,
    #program-overlay,
    #m-overlay,
    #v-overlay,
    #paste-overlay,
    #blocklib-overlay,
    #tpl-overlay,
    #matpick-overlay,
    #backup-overlay,
    #password-overlay,
    #report-overlay,
    #journal-overlay,
    #summary-overlay) .modal .modal-actions .btn-primary,
.modal.form-boutique .modal-actions .btn-primary {
  background: linear-gradient(180deg, var(--brand-grad-top), var(--brand)) !important;
  border: 0 !important;
  color: var(--on-brand) !important;
  box-shadow: 0 14px 30px rgba(31, 75, 67, .26) !important;
}
:is(#child-overlay,
    #quick-overlay,
    #sub-overlay,
    #program-overlay,
    #m-overlay,
    #v-overlay,
    #paste-overlay,
    #blocklib-overlay,
    #tpl-overlay,
    #matpick-overlay,
    #backup-overlay,
    #password-overlay,
    #report-overlay,
    #journal-overlay,
    #summary-overlay) .modal .modal-actions .btn-ghost,
.modal.form-boutique .modal-actions .btn-ghost {
  background: transparent !important;
  border: 0 !important;
  color: var(--muted) !important;
  box-shadow: none !important;
  min-height: 40px;
}
:is(#child-overlay,
    #quick-overlay,
    #sub-overlay,
    #program-overlay,
    #m-overlay,
    #v-overlay,
    #paste-overlay,
    #blocklib-overlay,
    #tpl-overlay,
    #matpick-overlay,
    #backup-overlay,
    #password-overlay,
    #report-overlay,
    #journal-overlay,
    #summary-overlay) .modal .calc-inputs,
.modal.form-boutique .calc-inputs {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
@media (max-width: 560px) {
  :is(#child-overlay,
      #quick-overlay,
      #sub-overlay,
      #program-overlay,
      #m-overlay,
      #v-overlay,
      #paste-overlay,
      #blocklib-overlay,
      #tpl-overlay,
      #matpick-overlay,
      #backup-overlay,
      #password-overlay,
      #report-overlay,
      #journal-overlay,
      #summary-overlay) .modal,
  .modal.form-boutique { border-radius: 22px !important; padding: 16px !important; }
  :is(#child-overlay,
      #quick-overlay,
      #sub-overlay,
      #program-overlay,
      #m-overlay,
      #v-overlay,
      #paste-overlay,
      #blocklib-overlay,
      #tpl-overlay,
      #matpick-overlay,
      #backup-overlay,
      #password-overlay,
      #report-overlay,
      #journal-overlay,
      #summary-overlay) .modal .calc-inputs,
  .modal.form-boutique .calc-inputs { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- TYPE-CHIPS-BOUTIQUE: типы занятий аккуратными строками, цена справа ---------- */
#child-overlay .checks-grid,
#quick-overlay .checks-grid,
#info-overlay .checks-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
}
#child-overlay .checks-grid .check,
#quick-overlay .checks-grid .check,
#info-overlay .checks-grid .check {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 !important;
  padding: 12px 12px !important;
  background: var(--surface-2) !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  font-size: .9rem !important;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  transition: background .16s ease, border-color .16s ease;
}
#child-overlay .checks-grid .check input,
#quick-overlay .checks-grid .check input,
#info-overlay .checks-grid .check input {
  margin: 0 !important;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
}
#child-overlay .checks-grid .type-name,
#quick-overlay .checks-grid .type-name,
#info-overlay .checks-grid .type-name {
  flex: 1 1 auto;
  min-width: 0;
}
#child-overlay .checks-grid .type-price,
#quick-overlay .checks-grid .type-price,
#info-overlay .checks-grid .type-price {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: .84rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
#child-overlay .checks-grid .check:has(input:checked),
#quick-overlay .checks-grid .check:has(input:checked),
#info-overlay .checks-grid .check:has(input:checked) {
  background: var(--brand-soft) !important;
  border-color: var(--brand-line) !important;
}
#child-overlay .checks-grid .check:has(input:checked) .type-price,
#quick-overlay .checks-grid .check:has(input:checked) .type-price,
#info-overlay .checks-grid .check:has(input:checked) .type-price {
  color: var(--brand-dark);
}

/* ---------- PANEL-BOUTIQUE: калькулятор и финансы (расходы/инвестиции/настройки) ---------- */
#panel-calc .field,
#panel-fin .field {
  display: flex !important;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0 !important;
  min-width: 0;
}
#panel-calc .field > label,
#panel-fin .field > label {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0 2px !important;
}
#panel-calc .field .hint,
#panel-fin .field .hint { font-size: 11.5px; color: var(--muted); }
#panel-calc .input,
#panel-fin .input,
#panel-calc select.input,
#panel-fin select.input,
#panel-fin textarea {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  box-sizing: border-box;
  background: var(--surface-2) !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  padding: 12px 12px !important;
  font-size: .94rem !important;
  color: var(--ink);
  box-shadow: none !important;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
#panel-calc .input:focus,
#panel-fin .input:focus,
#panel-fin textarea:focus {
  background: var(--surface-1) !important;
  border-color: rgba(31, 75, 67, .35) !important;
  box-shadow: 0 0 0 3px rgba(31, 75, 67, .1) !important;
  outline: none;
}
#panel-fin .input:-webkit-autofill,
#panel-fin .input:-webkit-autofill:hover,
#panel-fin .input:-webkit-autofill:focus,
#panel-fin .input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset !important;
  box-shadow: none !important;
  border-color: var(--line-strong) !important;
  outline: none !important;
  -webkit-text-fill-color: var(--ink) !important;
  caret-color: var(--ink) !important;
  animation: fin-autofill-fix 1ms forwards;
}
@keyframes fin-autofill-fix {
  to { background-color: var(--surface-2); color: var(--ink); }
}
#panel-calc .calc-inputs,
#panel-fin .fin-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px !important;
}
#panel-fin .fin-form.one { grid-template-columns: minmax(0, 1fr) !important; }
#panel-calc .calc-card h3,
#panel-fin .card > b {
  font-family: var(--font-display);
  font-weight: 400;
}
#panel-calc .calc-card h3 { font-size: 1.16rem !important; }
#panel-calc .btn-primary,
#panel-fin .btn-primary {
  border: 0 !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, var(--brand-grad-top), var(--brand)) !important;
  color: var(--on-brand) !important;
  box-shadow: 0 12px 26px rgba(31, 75, 67, .22) !important;
  min-height: 46px;
}
#panel-calc .btn-ghost,
#panel-fin .btn-ghost {
  border-radius: 14px !important;
  color: var(--muted) !important;
}
#panel-calc .calc-card,
#panel-fin .card {
  border-radius: 20px;
}
#panel-fin .pay-table th { background: var(--surface-2); }
#panel-fin .fin-settings .toolbar .btn { min-height: 44px; }
@media (max-width: 560px) {
  #panel-calc .calc-inputs,
  #panel-fin .fin-form { grid-template-columns: minmax(0, 1fr) !important; }
}

/* ---------- KIDS-NAV-ROW: «Дети» — кнопка-иконка и навигация в одной строке ---------- */
#panel-kids #kids-toolbar.kids-nav {
  position: relative;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}
#kids-toolbar .kids-add-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: linear-gradient(180deg, var(--brand-grad-top), var(--brand)) !important;
  color: var(--on-brand) !important;
  box-shadow: 0 10px 22px rgba(31, 75, 67, .24);
}
#kids-toolbar .kids-add-icon svg { width: 22px; height: 22px; }
#kids-toolbar .kids-search-wrap {
  position: relative;
  flex: 1 1 120px;
  min-width: 0;
  display: block;
}
#kids-toolbar .kids-search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  display: inline-flex;
  pointer-events: none;
}
#kids-toolbar .kids-search-input {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  order: 0 !important;
  height: 44px;
  padding: 8px 12px 8px 32px !important;
  font-size: .9rem !important;
  border-radius: 14px !important;
  background: var(--surface-2) !important;
  border: 1px solid transparent !important;
  box-sizing: border-box;
}
#kids-toolbar .kids-filter-select {
  flex: 1 1 0 !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0;
  height: 44px;
  padding: 8px 8px !important;
  font-size: .8rem !important;
  border-radius: 14px !important;
  background: var(--surface-2) !important;
  border: 1px solid transparent !important;
  box-sizing: border-box;
}
#kids-toolbar .kids-filter-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2) !important;
  border: 1px solid transparent !important;
  color: var(--ink-soft);
}
#kids-toolbar .kids-filter-btn[aria-expanded="true"] {
  background: var(--brand-soft) !important;
  color: var(--brand-dark);
}
#kids-toolbar .kids-filters-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 70;
  min-width: 220px;
  padding: 12px 12px;
  background: var(--surface-1);
  border: 1px solid var(--glass-strong);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(76, 52, 30, .18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#kids-toolbar .kids-filters-title {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
#kids-toolbar .kids-filters-pop .check { margin: 0; font-size: .9rem; white-space: nowrap; }
@media (max-width: 760px) {
  #panel-kids .toolbar.kids-nav { flex-wrap: nowrap !important; }
  #kids-toolbar .kids-filter-select { font-size: .76rem !important; }
  #kids-toolbar .kids-search-input { font-size: .86rem !important; }
}
@media (max-width: 420px) {
  #kids-toolbar .kids-search-input { padding-left: 32px !important; }
  #kids-toolbar .kids-search-ico { left: 10px; }
  #kids-toolbar .kids-filter-select { font-size: .72rem !important; }
}

/* ---------- KIDS-SEARCH-UNDER-LUPA: поиск раскрывается по кнопке-лупе ---------- */
#kids-toolbar .kids-search-toggle {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2) !important;
  border: 1px solid transparent !important;
  color: var(--ink-soft);
}
#kids-toolbar.search-open .kids-search-toggle {
  background: var(--brand-soft) !important;
  color: var(--brand-dark);
}
#kids-toolbar .kids-search-wrap { display: none; }
#kids-toolbar.search-open .kids-search-wrap {
  display: block;
  flex: 1 1 120px;
  min-width: 0;
}
#kids-toolbar.search-open .kids-filter-select,
#kids-toolbar.search-open .kids-filter-btn,
#kids-toolbar.search-open .kids-filters-pop { display: none !important; }
#kids-toolbar.search-open .kids-search-input {
  height: 44px;
  padding: 8px 12px !important;
}
@media (max-width: 420px) {
  #kids-toolbar.search-open .kids-search-input { font-size: .84rem !important; }
}

/* ---------- KIDS-ADD-CIRCLE: кнопка «Добавить ребёнка» строго круглая ---------- */
#panel-kids #kids-toolbar #add-child.kids-add-icon,
#panel-kids #kids-toolbar .kids-add-icon {
  flex: 0 0 44px !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  aspect-ratio: 1 / 1;
}
#panel-kids #kids-toolbar .kids-add-icon svg {
  width: 22px !important;
  height: 22px !important;
  flex: 0 0 auto;
}

/* ---------- KIDS-ROW-FILL: фильтры занимают всю строку, иконки — фиксированные ---------- */
#panel-kids #kids-toolbar.kids-nav { gap: 4px !important; }
#kids-toolbar .kids-filter-select { flex: 1 1 0 !important; }
#kids-toolbar .kids-filter-btn,
#kids-toolbar .kids-search-toggle,
#kids-toolbar .kids-add-icon { flex: 0 0 44px !important; }
#kids-toolbar .kids-search-wrap { flex: 1 1 auto; }
@media (max-width: 380px) {
  #kids-toolbar .kids-filter-select { font-size: .7rem !important; padding: 8px 4px !important; }
}

/* ---------- PANEL-NAV-ROW: одна строка навигации в «Материалах» и «Видео» ---------- */
#panel-materials .toolbar.kids-nav,
#panel-video .toolbar.kids-nav,
#panel-kids .toolbar.kids-nav {
  position: relative;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}
#m-toolbar .kids-filter-select,
#v-toolbar .kids-filter-select,
#kids-toolbar .kids-filter-select {
  flex: 1 1 0 !important;
  min-width: 0;
  max-width: none !important;
  width: auto !important;
  height: 44px;
  padding: 8px 8px !important;
  font-size: .8rem !important;
  border-radius: 14px !important;
  background: var(--surface-2) !important;
  border: 1px solid transparent !important;
  box-sizing: border-box;
}
#m-toolbar .kids-search-toggle,
#v-toolbar .kids-search-toggle,
#kids-toolbar .kids-search-toggle,
#m-toolbar .kids-add-icon,
#v-toolbar .kids-add-icon,
#kids-toolbar .kids-add-icon,
#m-toolbar .kids-filter-btn,
#v-toolbar .kids-filter-btn,
#kids-toolbar .kids-filter-btn {
  flex: 0 0 44px !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#m-toolbar .kids-search-toggle,
#v-toolbar .kids-search-toggle,
#kids-toolbar .kids-search-toggle,
#m-toolbar .kids-filter-btn,
#v-toolbar .kids-filter-btn,
#kids-toolbar .kids-filter-btn {
  background: var(--surface-2) !important;
  border: 1px solid transparent !important;
  color: var(--ink-soft);
}
#m-toolbar.search-open .kids-search-toggle,
#v-toolbar.search-open .kids-search-toggle,
#kids-toolbar.search-open .kids-search-toggle,
#m-toolbar .kids-filter-btn[aria-expanded="true"],
#kids-toolbar .kids-filter-btn[aria-expanded="true"] {
  background: var(--brand-soft) !important;
  color: var(--brand-dark);
}
#m-toolbar .kids-add-icon,
#v-toolbar .kids-add-icon,
#kids-toolbar .kids-add-icon {
  background: linear-gradient(180deg, var(--brand-grad-top), var(--brand)) !important;
  color: var(--on-brand) !important;
  box-shadow: 0 10px 22px rgba(31, 75, 67, .24);
}
#m-toolbar .kids-search-wrap,
#v-toolbar .kids-search-wrap,
#kids-toolbar .kids-search-wrap { display: none; }
#m-toolbar.search-open .kids-search-wrap,
#v-toolbar.search-open .kids-search-wrap,
#kids-toolbar.search-open .kids-search-wrap {
  display: block;
  flex: 1 1 120px;
  min-width: 0;
}
#m-toolbar.search-open .kids-filter-select,
#v-toolbar.search-open .kids-filter-select,
#kids-toolbar.search-open .kids-filter-select,
#m-toolbar.search-open .kids-filter-btn,
#v-toolbar.search-open .kids-filter-btn,
#kids-toolbar.search-open .kids-filter-btn { display: none !important; }
#m-toolbar .kids-search-input,
#v-toolbar .kids-search-input,
#kids-toolbar .kids-search-input {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 44px;
  padding: 8px 12px !important;
  font-size: .9rem !important;
  border-radius: 14px !important;
  background: var(--surface-2) !important;
  border: 1px solid transparent !important;
  box-sizing: border-box;
}
@media (max-width: 420px) {
  #m-toolbar .kids-filter-select,
  #v-toolbar .kids-filter-select,
  #kids-toolbar .kids-filter-select { font-size: .74rem !important; }
}

/* ---------- VIDEO-NAV-RIGHT: кнопки «Видео» прижаты к правому краю ---------- */
#panel-video #v-toolbar.kids-nav { justify-content: flex-end; }
#panel-video #v-toolbar.kids-nav.search-open { justify-content: flex-start; }
#panel-video #v-toolbar.kids-nav .kids-search-wrap { flex: 1 1 auto; }

/* ---------- HELP-MODAL: инструкция по текущей вкладке ---------- */
#help-overlay .modal.help-modal { max-width: 520px; }
.help-eyebrow {
  display: block;
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
#help-overlay #help-title {
  margin: 0 0 8px !important;
}
.help-sub {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.help-steps {
  margin: 0;
  padding: 0 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.help-steps li {
  font-size: .93rem;
  line-height: 1.45;
  color: var(--ink);
  padding-left: 2px;
}
.help-steps li::marker {
  color: var(--brand);
  font-weight: 700;
}
.help-ico {
  display: inline-flex;
  width: 17px;
  height: 17px;
  margin: 0 2px;
  vertical-align: -3px;
  align-items: center;
  justify-content: center;
}
svg.help-ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.help-ico-plus {
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.help-tip {
  margin: 12px 0 0;
  padding: 12px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink-soft, var(--text-2));
  font-size: .88rem;
  line-height: 1.4;
}
.help-tip[hidden] { display: none; }

/* плавное смахивание подсказок */
#help-overlay .help-modal { overflow: hidden; touch-action: pan-y; }
.help-slide {
  min-height: 210px;
  transition: transform .18s ease, opacity .18s ease;
  will-change: transform, opacity;
}
.help-slide-out-left { transform: translateX(-26px); opacity: 0; }
.help-slide-out-right { transform: translateX(26px); opacity: 0; }
.help-slide-in-right { transform: translateX(26px); opacity: 0; transition: none; }
.help-slide-in-left { transform: translateX(-26px); opacity: 0; transition: none; }

/* карусель подсказок */
.help-carousel {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-2);
}
.help-arrow {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 1px solid var(--border-2);
  border-radius: 50%;
  background: var(--surface-1);
  color: var(--brand);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.help-arrow:hover { background: var(--surface-2); }
.help-carousel-center {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.help-counter {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
}
.help-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}
.help-dot {
  width: 6px;
  height: 6px;
  min-height: 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--border-2);
  cursor: pointer;
}
.help-dot.active { background: var(--brand); width: 16px; border-radius: 4px; }
@media (max-width: 560px) {
  .help-carousel { gap: 8px; }
  .help-arrow { flex-basis: 32px; width: 32px; height: 32px; min-height: 32px; }
  .help-dots { gap: 4px; }
}

.feedback-modal textarea { min-height: 150px; resize: vertical; }
#feedback-overlay .modal { max-width: 560px; }
.feedback-hint {
  margin: -2px 0 8px;
  font-size: .78rem;
  line-height: 1.4;
  color: var(--muted);
}
.feedback-error {
  margin: 0 0 8px;
  color: var(--danger);
  font-size: .86rem;
}
.feedback-ok {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: .86rem;
  font-weight: 600;
}
@media (max-width: 560px) {
  #feedback-overlay .modal { max-width: 100%; }
}

/* ---------- CAL-PC-SPLIT: ПК-календарь с панелью выбранного дня ---------- */
.cal-split { display: block; }
.cal-day-panel { display: none; }
@media (min-width: 901px) {
  .cal-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(330px, 27vw, 390px);
    gap: 12px;
    align-items: start;
  }
  .cal-split.cal-list-mode { display: block; }
  .cal-day-panel:not([hidden]) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    background: rgba(255, 252, 247, .82);
    border: 1px solid var(--glass-strong);
    border-radius: 18px;
    padding: 16px 16px;
    box-shadow: 0 10px 28px rgba(76, 52, 30, .07);
  }
  .cal-day-head { flex: 0 0 auto; }
  .cal-day-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-right: -4px;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-2) transparent;
  }
  .cal-day-scroll::-webkit-scrollbar { width: 5px; }
  .cal-day-scroll::-webkit-scrollbar-thumb {
    background: var(--border-2);
    border-radius: 99px;
  }
  .cal-day-kicker {
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
  }
  .cal-day-panel h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 30px;
    line-height: 1.08;
    margin: 8px 0 2px;
    color: var(--ink);
  }
  .cal-day-sub {
    margin: 0 0 12px;
    font-size: 12.5px;
    color: var(--muted);
  }
  .cal-day-slot {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    padding: 12px 0;
    border: 0;
    border-top: 1px solid var(--border-2);
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
  }
  .cal-day-slot:hover { background: rgba(31, 75, 67, .035); }
  .cal-day-slot time {
    flex: 0 0 44px;
    padding-top: 1px;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
  }
  .cal-day-slot-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .cal-day-slot-main b { font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cal-day-slot-main small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cal-day-status {
    margin-left: auto;
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef5f0;
    color: #3f735f;
    font-size: 9.5px;
    white-space: nowrap;
  }
  .cal-day-status.done { background: #e9f1fb; color: #39689b; }
  .cal-day-status.off { background: #faece8; color: #a45b4b; }
  .cal-day-free {
    margin-top: 12px;
    padding: 12px 12px;
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.45;
  }
  .cal-day-empty {
    border-top: 1px solid var(--border-2);
    padding: 12px 0 4px;
    color: var(--muted);
    font-size: 13px;
  }
  .cal-day-open {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    margin-top: 12px;
    border: 0;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 12px;
    cursor: pointer;
  }
  .cal-cell-people {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: auto;
    padding-top: 4px;
    min-height: 22px;
  }
  .cal-ava {
    width: 21px;
    height: 21px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--surface-1);
    margin-left: -4px;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
  }
  .cal-ava:first-child { margin-left: 0; }
  .cal-ava.av1 { background: #5d8f7c; }
  .cal-ava.av2 { background: #b98472; }
  .cal-ava.av3 { background: #8d90b0; }
  .cal-ava.av4 { background: #c39a5a; }
  .cal-more { margin-left: 2px; color: var(--muted); font-size: 9.5px; }
  .cal-cell-meter {
    height: 3px;
    margin-top: 4px;
    border-radius: 3px;
    background: var(--border-2);
    overflow: hidden;
  }
  .cal-cell-meter i {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--brand);
  }
  .cal-cell.selected {
    border-color: var(--brand) !important;
    box-shadow: inset 0 0 0 1px var(--brand), 0 6px 18px rgba(31, 75, 67, .1) !important;
  }
  .cal-split .cal-cell {
    min-height: 78px;
    padding: 8px 8px;
  }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .cal-split { grid-template-columns: minmax(0, 1fr) 300px; gap: 8px; }
  .cal-day-panel h2 { font-size: 25px; }
}

/* ---------- BOUTIQUE-SHEET-INFO: шторка дня и карточка занятия в новом стиле ---------- */
#sheet-overlay .modal {
  background:
    radial-gradient(80% 42% at 100% 0%, var(--surface-tint-warm) 0%, rgba(255, 233, 212, 0) 58%),
    radial-gradient(70% 40% at 0% 100%, var(--surface-tint-cool) 0%, rgba(233, 242, 237, 0) 60%),
    linear-gradient(180deg, var(--surface-1), var(--surface-2)) !important;
  border: 1px solid var(--glass-strong) !important;
  border-radius: 24px 24px 0 0 !important;
  padding: 16px !important;
  box-shadow: 0 -18px 50px rgba(76, 52, 30, .2) !important;
}
#sheet-overlay .modal > h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px !important;
  line-height: 1.15;
  margin: 0 0 12px !important;
}
#sheet-overlay .slot-row {
  background: var(--surface-1) !important;
  border: 1px solid var(--glass-strong) !important;
  border-radius: 16px !important;
  padding: 12px 12px !important;
  box-shadow: 0 10px 24px rgba(92, 64, 36, .07) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  margin-bottom: 8px;
}
#sheet-overlay .slot-row.slot-free {
  background: var(--surface-2) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
#sheet-overlay .slot-row.slot-break {
  background: transparent !important;
  border-style: dashed !important;
  color: var(--muted) !important;
  box-shadow: none !important;
}
#sheet-overlay .slot-time {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--brand-dark);
  min-width: 92px;
}
#sheet-overlay .slot-plus {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-left: auto;
}
#sheet-overlay .slot-row.slot-taken .slot-who b { font-size: .95rem; }
#sheet-overlay .modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
#sheet-overlay .modal-actions .btn {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 600;
  justify-content: center;
}
#sheet-overlay .modal-actions .btn-primary {
  background: linear-gradient(180deg, var(--brand-grad-top), var(--brand)) !important;
  border: 0 !important;
  color: var(--on-brand) !important;
  box-shadow: 0 14px 30px rgba(31, 75, 67, .24) !important;
}
#sheet-overlay .modal-actions .btn-ghost {
  background: transparent !important;
  border: 0 !important;
  color: var(--muted) !important;
  box-shadow: none !important;
  min-height: 40px;
}

/* карточка занятия */
#info-overlay .modal {
  background:
    radial-gradient(80% 42% at 100% 0%, var(--surface-tint-warm) 0%, rgba(255, 233, 212, 0) 58%),
    radial-gradient(70% 40% at 0% 100%, var(--surface-tint-cool) 0%, rgba(233, 242, 237, 0) 60%),
    linear-gradient(180deg, var(--surface-1), var(--surface-2)) !important;
  border: 1px solid var(--glass-strong) !important;
  border-radius: 24px !important;
  padding: 16px !important;
  box-shadow: 0 24px 60px rgba(76, 52, 30, .2) !important;
}
#info-overlay .modal > h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px !important;
  line-height: 1.12;
  margin: 0 0 12px !important;
}
#info-overlay #info-body { gap: 8px !important; }
#info-overlay #info-body > div {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 8px 12px;
  font-size: .92rem;
  align-items: baseline;
}
#info-overlay #info-body > div .muted {
  min-width: 92px !important;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 600;
}
#info-overlay .field > label {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}
#info-overlay .input {
  background: var(--surface-2) !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  padding: 12px 12px !important;
  box-sizing: border-box;
}
#info-overlay label.check {
  background: var(--surface-warn) !important;
  border: 1px solid #f0d9b5 !important;
  border-radius: 14px !important;
  padding: 8px 12px !important;
}
#info-overlay .modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px !important;
}
#info-overlay .modal-actions .btn {
  width: 100%;
  min-height: 46px;
  border-radius: 15px;
  font-size: 14.5px;
  font-weight: 600;
  justify-content: center;
}
#info-overlay .modal-actions .btn-primary {
  background: linear-gradient(180deg, var(--brand-grad-top), var(--brand)) !important;
  border: 0 !important;
  color: var(--on-brand) !important;
  box-shadow: 0 14px 30px rgba(31, 75, 67, .24) !important;
}
#info-overlay .modal-actions .btn-ghost {
  background: transparent !important;
  border: 1px solid var(--border-2) !important;
  color: var(--ink-soft, var(--text-2)) !important;
  box-shadow: none !important;
}
#info-overlay .info-danger {
  border-top: 1px solid var(--border-2) !important;
  padding-top: 12px !important;
}
#info-overlay .info-danger .btn-ghost {
  color: var(--danger) !important;
  border-color: rgba(168, 68, 58, .25) !important;
}
@media (max-width: 560px) {
  #info-overlay .modal { border-radius: 22px !important; padding: 16px !important; }
  #info-overlay .modal > h2 { font-size: 23px !important; }
}

/* ---------- INFO-CARD-A: карточка занятия — два действия + меню ---------- */
#info-overlay .info-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
#info-overlay .modal > .info-head > h2 { margin: 0 !important; }
.info-head-actions { position: relative; display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.info-icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft, var(--text-2));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.info-icon-btn:hover { background: var(--border-2); }
.info-icon-btn[aria-expanded="true"] { background: rgba(31, 75, 67, .1); }

.info-edit-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 8px;
  padding: 8px 2px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.info-edit-chev { font-size: 1.1rem; color: var(--brand); transition: transform .18s ease; }
.info-edit-link[aria-expanded="true"] .info-edit-chev { transform: rotate(90deg); }
.info-edit {
  margin-top: 0;
  padding: 0 12px;
  border-radius: 16px;
  background: var(--surface-1);
  border: 1px solid rgba(236, 225, 210, 0);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height .3s cubic-bezier(.4, 0, .2, 1),
              opacity .22s ease,
              padding .3s cubic-bezier(.4, 0, .2, 1),
              margin .3s cubic-bezier(.4, 0, .2, 1),
              border-color .3s ease;
}
.info-edit.open {
  opacity: 1;
  margin-top: 4px;
  padding: 12px 12px;
  border-color: rgba(236, 225, 210, .9);
}
.info-edit[hidden] { display: none; }
.info-edit .field { margin-bottom: 8px; }
.info-edit .modal-actions { gap: 8px; }

.info-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 90;
  min-width: 230px;
  max-width: min(320px, calc(100vw - 64px));
  margin: 0;
  padding: 8px 8px;
  border-radius: 16px;
  background: var(--surface-1);
  border: 1px solid rgba(236, 225, 210, .95);
  box-shadow: 0 14px 34px rgba(76, 52, 30, .12);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.info-menu[hidden] { display: none; }
.info-menu .info-sick {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 4px;
  background: transparent !important;
  border: 0 !important;
  border-radius: 10px !important;
  font-size: .9rem;
}
.info-menu .info-sick input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
.info-menu-item {
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: .9rem;
  padding: 8px 8px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.info-menu-item:hover { background: var(--surface-2); }
.info-menu-item.danger { color: var(--danger); }
.info-menu-item:disabled { opacity: .45; cursor: default; }

@media (max-width: 560px) {
  .info-edit { padding: 0 12px; }
  .info-edit.open { padding: 12px; }
}

/* ---------- MODAL-X: крестик в углу окна вместо кнопки внизу ---------- */
.overlay .modal { position: relative; }
.overlay .modal > h2 { padding-right: 40px; }
.overlay .modal .sched-head,
.overlay .modal .info-head { padding-right: 40px; }
.cab-modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 8;
  -webkit-tap-highlight-color: transparent;
}
.cab-modal-x:hover { background: var(--border-2); color: var(--ink); }
.cab-modal-x:active { background: var(--border-2); }
.modal-x-original { display: none !important; }

/* ---------- NAV-UNIFIED: единая навигация разделов (как «Дети/Материалы/Видео») ---------- */
#panel-today .daybar,
#panel-pay .daybar,
.cal-head,
.fin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
#panel-pay .daybar { flex-wrap: nowrap; }

#panel-today .daybar .btn,
#panel-pay .daybar .btn,
.cal-head .btn,
.fin-toolbar .btn,
.fin-toolbar .btn-mini,
.daybar .btn.mini {
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: .82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}
#panel-today .daybar .btn:hover,
#panel-pay .daybar .btn:hover,
.cal-head .btn:hover,
.fin-toolbar .btn:hover { background: var(--surface-3); color: var(--ink); }
#panel-today .daybar .btn.active,
.cal-head .btn.active,
.cal-view-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}

#panel-today .daybar .input,
#panel-pay .daybar .input,
.fin-toolbar .input,
#fin-month,
#month,
#day {
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  background: var(--surface-2) !important;
  color: var(--ink);
  font-size: .9rem;
  font-weight: 600;
  padding: 0 12px !important;
  box-shadow: none !important;
}
#panel-today .daybar .input:focus,
#panel-pay .daybar .input:focus,
.fin-toolbar .input:focus {
  background: var(--surface-1) !important;
  border-color: rgba(31, 75, 67, .3) !important;
  box-shadow: 0 0 0 3px rgba(31, 75, 67, .1) !important;
}

/* кнопки «Сводка/Копия» и дата в «Оплатах» — как в «Детях» */
#panel-pay .daybar label,
#panel-pay .daybar .muted { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
#panel-pay #month { width: auto; max-width: 190px; min-width: 130px; }
#panel-pay .daybar .btn.mini { flex: 0 0 auto; }

/* финансы: чипы разделов — тёплые «таблетки» */
.fin-nav { gap: 4px; }
.fin-nav .chip-btn {
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: .82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.fin-nav .chip-btn:hover { background: var(--surface-3); color: var(--ink); border-color: transparent; }
.fin-nav .chip-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 8px 18px rgba(31, 75, 67, .18);
}

/* календарь: строка вида и выбора календаря — та же высота */
.cal-view-row { gap: 4px; }
.cal-view-row .cal-specialist-select {
  height: 44px;
  min-height: 44px;
  border-radius: 14px !important;
  background: var(--surface-2) !important;
  border: 1px solid transparent !important;
  font-size: .82rem !important;
}
.cal-seg { height: 44px; }
.cal-seg-btn { height: 38px; }

@media (max-width: 760px) {
  #panel-today .daybar,
  #panel-pay .daybar,
  .cal-head { gap: 4px; }
  #panel-today .daybar .btn,
  #panel-pay .daybar .btn,
  .cal-head .btn { padding: 0 12px; font-size: .78rem; }
  #panel-pay #month { min-width: 116px; max-width: 150px; }
  .fin-nav { overflow-x: auto; flex-wrap: nowrap; }
  .fin-nav .chip-btn { flex: 0 0 auto; }
}

/* ---------- CAL-SEG-FORCE: активный тумблер всегда зелёный ---------- */
.cal-seg { overflow: hidden; }
.cal-seg::before {
  background: var(--brand) !important;
  box-shadow: 0 6px 14px rgba(31, 75, 67, .18) !important;
}
.cal-seg .cal-seg-btn {
  background: transparent !important;
  color: var(--ink-soft) !important;
  box-shadow: none !important;
  border: 0 !important;
}
.cal-seg .cal-seg-btn.active {
  background: transparent !important;
  color: var(--on-brand) !important;
}

/* ---------- TODAY-DAYBAR-GRID: дата по центру, «Текущий день» у правого края ---------- */
#panel-today .daybar {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
#panel-today .daybar .day-group {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}
#panel-today .daybar #day {
  width: auto;
  min-width: 140px;
  max-width: 220px;
  text-align: center;
  margin: 0;
}
#panel-today .daybar #today-btn {
  grid-column: 3;
  justify-self: end;
  margin: 0;
}

/* ---------- TODAY-BTN-CIRCLE: кнопка «Сегодня» строго круглая ---------- */
#panel-today .daybar #today-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  max-width: 44px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  aspect-ratio: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
}
#panel-today .daybar #today-btn svg { width: 18px; height: 18px; }

/* ---------- INFO-HEAD-FIX: шапка карточки занятия — ровно «…» и крестик ---------- */
#info-overlay .info-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between;
  gap: 8px;
  padding: 0 !important;
  margin: 0 0 8px !important;
}
#info-overlay .info-head > h2,
#info-overlay .modal > .info-head > h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 24px !important;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#info-overlay .info-head-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end;
  gap: 0 !important;
  flex: 0 0 auto;
  padding: 0 !important;
}
#info-overlay .info-icon-btn {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  flex: 0 0 36px;
  border-radius: 50% !important;
}
#info-overlay .info-icon-btn svg { width: 17px !important; height: 17px !important; }
#info-menu-btn svg { width: 19px !important; height: 19px !important; }

/* ---------- SEARCH-SECOND-ROW: поиск отдельной строкой, навигация остаётся ---------- */
#kids-toolbar.kids-nav.search-open,
#m-toolbar.kids-nav.search-open,
#v-toolbar.kids-nav.search-open {
  flex-wrap: wrap !important;
  row-gap: 4px;
}
/* фильтры и иконки не исчезают */
#kids-toolbar.search-open .kids-filter-select,
#kids-toolbar.search-open .kids-filter-btn,
#m-toolbar.search-open .kids-filter-select,
#v-toolbar.search-open .kids-filter-select {
  display: inline-flex !important;
}
#kids-toolbar.search-open .kids-filters-pop { display: flex !important; }
#kids-toolbar.search-open .kids-filter-btn { display: inline-flex !important; }
/* поле поиска — на своей строке, без «ореола» */
#kids-toolbar.search-open .kids-search-wrap,
#m-toolbar.search-open .kids-search-wrap,
#v-toolbar.search-open .kids-search-wrap {
  display: block;
  flex: 1 1 100%;
  order: 20;
  min-width: 0;
  margin-top: 4px;
}
#kids-toolbar.search-open .kids-search-input,
#m-toolbar.search-open .kids-search-input,
#v-toolbar.search-open .kids-search-input {
  background: var(--surface-2) !important;
  border: 1px solid var(--border-2) !important;
  box-shadow: none !important;
  outline: none !important;
  height: 44px;
  border-radius: 14px !important;
}
#kids-toolbar.search-open .kids-search-input:focus,
#m-toolbar.search-open .kids-search-input:focus,
#v-toolbar.search-open .kids-search-input:focus {
  background: var(--surface-1) !important;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 2px rgba(31, 75, 67, .12) !important;
}
/* активная лупа — в тон кнопкам, без голубого */
#kids-toolbar.search-open .kids-search-toggle,
#m-toolbar.search-open .kids-search-toggle,
#v-toolbar.search-open .kids-search-toggle {
  background: var(--brand) !important;
  color: var(--on-brand) !important;
}
#kids-toolbar.search-open .kids-search-toggle svg,
#m-toolbar.search-open .kids-search-toggle svg,
#v-toolbar.search-open .kids-search-toggle svg { stroke: var(--on-brand) !important; }
@media (max-width: 760px) {
  #kids-toolbar.search-open .kids-search-wrap { flex-basis: 100%; }
}

/* ---------- SEARCH-ROW-FIX: поиск реально уходит на вторую строку ---------- */
#panel-kids #kids-toolbar.kids-nav.search-open,
#panel-materials #m-toolbar.kids-nav.search-open,
#panel-video #v-toolbar.kids-nav.search-open {
  flex-wrap: wrap !important;
  align-items: center;
}
/* фильтры остаются нормальной ширины */
#panel-kids #kids-toolbar.search-open .kids-filter-select,
#panel-materials #m-toolbar.search-open .kids-filter-select,
#panel-video #v-toolbar.search-open .kids-filter-select {
  flex: 1 1 0 !important;
  min-width: 84px !important;
  display: inline-flex !important;
}
#panel-kids #kids-toolbar.search-open .kids-filter-btn,
#panel-kids #kids-toolbar.search-open .kids-search-toggle,
#panel-kids #kids-toolbar.search-open .kids-add-icon {
  display: inline-flex !important;
}
/* поле — на новой строке во всю ширину */
#panel-kids #kids-toolbar.search-open .kids-search-wrap,
#panel-materials #m-toolbar.search-open .kids-search-wrap,
#panel-video #v-toolbar.search-open .kids-search-wrap {
  flex: 1 1 100% !important;
  order: 20;
  display: block !important;
  width: 100%;
  margin-top: 4px;
}
#panel-kids #kids-toolbar.search-open .kids-search-input,
#panel-materials #m-toolbar.search-open .kids-search-input,
#panel-video #v-toolbar.search-open .kids-search-input {
  width: 100% !important;
  box-sizing: border-box;
  box-shadow: none !important;
}
/* попап фильтров показываем только когда его открыли, а не вместе с поиском */
#kids-toolbar .kids-filters-pop[hidden],
#kids-toolbar.search-open .kids-filters-pop[hidden] {
  display: none !important;
}

/* ---------- PROGRAM-LAYOUT: понятное окно программы ---------- */
#program-overlay .modal.program-modal { width: min(860px, 100%); }
.program-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.program-head-text { min-width: 0; flex: 1 1 240px; }
.program-head-text h2 { margin: 0 0 4px !important; padding-right: 0 !important; }
.program-head-text .muted { margin: 0; font-size: .88rem; }
.program-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.program-tools .btn { min-height: 44px; border-radius: 14px; padding: 0 16px; font-size: .86rem; }
.program-tools .btn-primary {
  background: linear-gradient(180deg, var(--brand-grad-top), var(--brand)) !important;
  border: 0 !important;
  color: var(--on-brand) !important;
}
.program-tools .btn-ghost {
  background: var(--surface-2) !important;
  border: 1px solid transparent !important;
  color: var(--text-2) !important;
}
.program-more-wrap { position: relative; }
.program-more-btn {
  width: 44px !important;
  min-width: 44px;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 1.15rem;
  line-height: 1;
}
.program-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 90;
  min-width: 224px;
  padding: 8px;
  border-radius: 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  box-shadow: 0 20px 44px rgba(76, 52, 30, .2);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.program-more-menu[hidden] { display: none !important; }
.program-more-item {
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: .9rem;
  color: var(--text-1);
  padding: 12px 8px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.program-more-item:hover { background: var(--surface-2); }
.program-footer {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-1);
}
.program-footer .btn { min-height: 48px; border-radius: 15px; font-size: 15px; font-weight: 600; }
.program-footer .btn-primary {
  flex: 1 1 auto;
  background: linear-gradient(180deg, var(--brand-grad-top), var(--brand)) !important;
  border: 0 !important;
  color: var(--on-brand) !important;
  box-shadow: 0 14px 30px rgba(31, 75, 67, .24) !important;
}
.program-footer .btn-ghost {
  flex: 0 0 auto;
  min-width: 130px;
  background: transparent !important;
  border: 1px solid var(--border-2) !important;
  color: var(--text-2) !important;
}
#program-overlay #program-blocks { min-height: 120px; }
@media (max-width: 560px) {
  .program-tools { width: 100%; }
  .program-tools .btn-primary { flex: 1 1 auto; }
  .program-footer { flex-direction: column-reverse; }
  .program-footer .btn-ghost { width: 100%; }
}

/* ---------- PROGRAM-MORE-TOP: «…» рядом с крестиком, кнопки не растягиваются ---------- */
#program-overlay .modal.program-modal { position: relative; }
#program-overlay #program-title { padding-right: 64px !important; }
#program-overlay .program-more-wrap {
  position: absolute;
  top: 10px;
  right: 54px;
  z-index: 12;
}
#program-overlay .program-more-btn {
  width: 38px !important;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  border: 0 !important;
  color: var(--muted) !important;
  font-size: 1.2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#program-overlay .program-more-btn:hover { background: var(--surface-2) !important; color: var(--text-1) !important; }
#program-overlay .program-more-btn[aria-expanded="true"] { background: var(--surface-2) !important; }
#program-overlay .program-more-menu {
  right: 0;
  top: calc(100% + 6px);
  min-width: min(260px, calc(100vw - 48px));
}
/* кнопки инструментов — компактные, в одну строку */
#program-overlay .program-tools {
  width: auto !important;
  flex-wrap: wrap;
  gap: 8px;
}
#program-overlay .program-tools .btn {
  width: auto !important;
  flex: 0 0 auto !important;
  min-height: 44px;
  padding: 0 16px !important;
}
#program-overlay .program-tools .btn-primary { flex: 0 0 auto !important; }
@media (max-width: 560px) {
  #program-overlay .program-tools {
    width: 100% !important;
    display: flex;
    gap: 8px;
  }
  #program-overlay .program-tools .btn {
    flex: 1 1 0 !important;
    min-width: 0;
    padding: 0 8px !important;
    font-size: .84rem;
  }
}

/* ---------- FIN-NAV-COMPACT: компактная навигация «Финансов» ---------- */
#panel-fin .card:first-child { padding: 8px 12px !important; }
#panel-fin .fin-toolbar {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 8px;
  width: 100%;
}
#panel-fin .fin-toolbar > label.muted { display: none !important; }
#panel-fin #fin-month {
  width: 138px !important;
  min-width: 138px !important;
  max-width: 138px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 8px !important;
  border-radius: 12px !important;
  font-size: .84rem !important;
  font-weight: 600;
  flex: 0 0 138px;
  box-sizing: border-box;
}
#panel-fin .fin-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  margin-left: 0 !important;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
#panel-fin .fin-nav::-webkit-scrollbar { display: none; height: 0; }
#panel-fin .fin-nav .chip-btn {
  flex: 0 0 auto;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: .8rem;
}
@media (max-width: 420px) {
  #panel-fin #fin-month { width: 122px !important; min-width: 122px !important; max-width: 122px !important; flex-basis: 122px; }
  #panel-fin .fin-nav .chip-btn { padding: 0 12px; font-size: .78rem; }
}

/* ---------- FIN-NAV-FLAT: без белой подложки, месяц листается вместе с разделами ---------- */
#panel-fin .card:first-child {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
#panel-fin .fin-toolbar {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
#panel-fin .fin-toolbar::-webkit-scrollbar { display: none; height: 0; }
#panel-fin .fin-nav {
  flex: 0 0 auto !important;
  overflow: visible !important;
  width: auto !important;
  padding-bottom: 0;
}
#panel-fin #fin-month {
  flex: 0 0 auto !important;
  width: 138px !important;
  min-width: 138px !important;
  max-width: 138px !important;
  height: 40px !important;
  border-radius: 12px !important;
  font-size: .82rem !important;
  background: #f8f1e6 !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}
@media (max-width: 420px) {
  #panel-fin #fin-month { width: 128px !important; min-width: 128px !important; max-width: 128px !important; }
}

/* ---------- FIN-MONTH-ICON: месяц — иконка календаря, закреплена слева ---------- */
#panel-fin .fin-toolbar {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 8px;
  overflow: visible !important;
}
#panel-fin .fin-month-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  min-height: 42px;
  padding: 0 12px 0 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: #f8f1e6;
  color: var(--text-1);
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
#panel-fin .fin-month-btn svg { flex: 0 0 auto; color: var(--brand); }
#panel-fin .fin-month-btn:hover { background: #f2e8d8; }
#panel-fin .fin-month-btn:active { background: #ecdfca; }
#panel-fin .fin-month-input {
  position: absolute !important;
  left: -9999px;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
  border: 0 !important;
  padding: 0 !important;
}
#panel-fin .fin-nav {
  flex: 1 1 auto !important;
  min-width: 0;
  overflow-x: auto !important;
  overflow-y: hidden;
  flex-wrap: nowrap !important;
  display: flex !important;
  gap: 4px;
  -webkit-overflow-scrolling: touch;
}
#panel-fin .fin-nav::-webkit-scrollbar { display: none; height: 0; }

/* ---------- FIN-MONTH-WRAP: иконка календаря, нативный выбор месяца поверх ---------- */
#panel-fin .fin-month-wrap {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#panel-fin .fin-month-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f8f1e6;
  color: var(--brand);
  pointer-events: none;
}
#panel-fin .fin-month-btn svg { width: 18px; height: 18px; }
#panel-fin .fin-month-input {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  cursor: pointer;
  z-index: 2;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}
#panel-fin .fin-month-wrap:active .fin-month-btn { background: #ecdfca; }

/* ---------- FIN-MONTH-CUSTOM: свой компактный выбор месяца ---------- */
#panel-fin .fin-month-wrap {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: inline-flex;
}
#panel-fin .fin-month-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: #f8f1e6;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#panel-fin .fin-month-btn:hover { background: #f2e8d8; }
#panel-fin .fin-month-btn[aria-expanded="true"] { background: var(--brand-soft); }
#panel-fin .fin-month-btn svg { width: 18px; height: 18px; }
#panel-fin .fin-month-pop {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 95;
  width: 268px;
  max-width: calc(100vw - 40px);
  padding: 12px;
  border-radius: 18px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  box-shadow: 0 20px 44px rgba(76, 52, 30, .22);
}
#panel-fin .fin-month-pop[hidden] { display: none !important; }
#panel-fin .fin-month-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
#panel-fin .fin-month-pop-head b { font-size: .95rem; font-weight: 600; }
#panel-fin .fin-month-pop-head button {
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 1.05rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#panel-fin .fin-month-pop-head button:hover { background: #f2e8d8; }
#panel-fin .fin-month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
#panel-fin .fin-month-cell {
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  padding: 8px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#panel-fin .fin-month-cell:hover { background: #f2e8d8; color: var(--text-1); }
#panel-fin .fin-month-cell.active {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 8px 16px rgba(31, 75, 67, .2);
}

/* ---------- FIN-MONTH-CLICKABLE: кнопка месяца реально кликабельна ---------- */
#panel-fin .fin-month-btn {
  pointer-events: auto !important;
  position: relative;
  z-index: 3;
}
#panel-fin .fin-month-wrap .fin-month-input { display: none !important; }

/* ---------- FIN-LESSONS-SUM: сводка и фильтры раздела «Занятия» ---------- */
.fin-lessons-sum {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.fin-ls-item {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 8px 12px;
  min-width: 0;
}
.fin-ls-item span {
  display: block;
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fin-ls-item b { font-size: 1.02rem; font-weight: 600; color: var(--text-1); font-family: var(--font-display); }
.fin-ls-item.ok b { color: var(--ok); }
.fin-ls-item.debt { background: var(--surface-warn); }
.fin-ls-item.debt b { color: var(--danger); }
.fin-filter-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.fin-filter-row::-webkit-scrollbar { display: none; height: 0; }
.fin-filter-chip {
  flex: 0 0 auto;
  height: 38px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fin-filter-chip:hover { background: #f2e8d8; color: var(--text-1); }
.fin-filter-chip.active {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 8px 16px rgba(31, 75, 67, .18);
}
@media (max-width: 760px) {
  .fin-lessons-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- FIN-ACT-MENU: действия занятия под «…» + сводка под «Итого» ---------- */
.fin-lesson-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fin-lesson-top-right { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.fin-more-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fin-more-btn:hover { background: var(--surface-2); color: var(--text-1); }
.fin-more-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--text-1); }
.fin-act-menu {
  position: fixed;
  z-index: 300;
  width: 210px;
  padding: 8px;
  border-radius: 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  box-shadow: 0 20px 44px rgba(76, 52, 30, .24);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fin-act-menu[hidden] { display: none !important; }
.fin-act-item {
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: .9rem;
  color: var(--text-1);
  padding: 12px 8px;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fin-act-item:hover { background: var(--surface-2); }
.fin-sum-toggle { font-weight: 700; }
.fin-lessons-sum[hidden] { display: none !important; }

/* ---------- FIN-LESSONS-ANIM: плавное раскрытие итогов и строка «Ведёт» ---------- */
.fin-lessons-sum {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-bottom: 0;
  transition: max-height .28s cubic-bezier(.22, .61, .36, 1), opacity .2s ease, margin-bottom .28s ease;
}
.fin-lessons-sum.open {
  max-height: 220px;
  opacity: 1;
  margin-bottom: 8px;
}
.fin-lesson-spec {
  font-size: .82rem;
  color: var(--muted);
  margin-top: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .fin-lessons-sum { transition: none; }
}

/* ---------- CHILD-DOTS-PLAIN: «…» в карточке ребёнка без круга ---------- */
.child-card .child-menu-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
}
.child-card .child-menu-btn:hover,
.child-card .child-menu-btn[aria-expanded="true"] {
  background: var(--surface-2) !important;
  color: var(--text-1) !important;
  border-color: transparent !important;
}

/* ---------- FIN-CHART-FIT: все 6 месяцев помещаются в экран, включая текущий ---------- */
.fin-chart {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  overflow-x: hidden !important;
  justify-content: space-between;
  padding-bottom: 2px;
}
.fin-chart-col {
  flex: 1 1 0;
  min-width: 0 !important;
  gap: 4px;
}
.fin-chart-bars { gap: 2px; }
.fin-chart-bar { width: 6px; }
.fin-chart-label { font-size: .58rem; white-space: nowrap; }
.fin-chart-year { font-size: .52rem; }
@media (max-width: 760px) {
  .fin-chart { gap: 2px; }
  .fin-chart-bars { gap: 2px; }
  .fin-chart-bar { width: 5px; }
  .fin-chart-label { font-size: .56rem; }
}

/* ---------- FIN-CARDS-FLAT: без серого ореола у карточек финансов ---------- */
#panel-fin .card,
#panel-fin .fin-card,
#panel-fin .fin-row-card,
#panel-fin .fin-lesson-card,
#panel-fin .fin-by-spec {
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background: var(--surface-1) !important;
  border: 1px solid var(--border-1) !important;
}
#panel-fin .card[style*="padding:0"] { overflow: hidden; }


/* ---------- FIN-EXP-COMPACT: расход — компактная строка с крестиком ---------- */
#panel-fin .fin-exp-card {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 12px !important;
  border-radius: 14px !important;
}
#panel-fin .fin-exp-main { flex: 1 1 auto; min-width: 0; }
#panel-fin .fin-exp-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
#panel-fin .fin-exp-top b {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
#panel-fin .fin-exp-top .chip { font-size: .68rem; padding: 2px 8px; }
#panel-fin .fin-exp-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
#panel-fin .fin-exp-cat {
  font-size: .94rem;
  font-weight: 600;
  color: var(--text-1);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#panel-fin .fin-exp-sum {
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--text-1);
  white-space: nowrap;
}
#panel-fin .fin-exp-note {
  margin-top: 2px;
  font-size: .78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#panel-fin .fin-exp-del {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--danger);
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#panel-fin .fin-exp-del svg { width: 18px; height: 18px; }
#panel-fin .fin-exp-del:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- FIN-EXP-TWEAK: менее заметная карточка, сумма по центру ---------- */
#panel-fin .fin-exp-card {
  background: rgba(255, 255, 255, .38) !important;
  border: 1px solid rgba(46, 36, 26, .06) !important;
  box-shadow: none !important;
  padding: 8px 12px !important;
  border-radius: 12px !important;
  align-items: stretch !important;
}
#panel-fin .fin-exp-main { display: flex; flex-direction: column; justify-content: center; }
#panel-fin .fin-exp-right {
  position: relative;
  flex: 0 0 auto;
  width: 104px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  padding-top: 4px;
}
#panel-fin .fin-exp-right .fin-exp-del {
  position: absolute;
  top: -2px;
  right: -4px;
}
#panel-fin .fin-exp-sum {
  text-align: right;
  white-space: nowrap;
  margin-top: 12px;
}
#panel-fin .fin-exp-line { display: block !important; }

/* ---------- FIN-EXP-CENTER: сумма по центру между меткой и крестиком ---------- */
#panel-fin .fin-exp-card {
  position: relative;
  min-height: 74px;
}
#panel-fin .fin-exp-right {
  position: static !important;
  width: auto !important;
  padding: 0 !important;
  display: block !important;
}
#panel-fin .fin-exp-card .fin-exp-del {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
}
#panel-fin .fin-exp-card .fin-exp-sum {
  position: absolute;
  left: 64%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0 !important;
  text-align: center;
}
#panel-fin .fin-exp-card .fin-exp-main {
  padding-right: 34%;
}

/* ---------- FIN-EXP-SAME-GRID: одинаковая сетка суммы для расходов и инвестиций ---------- */
#panel-fin .fin-exp-card {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto 46px;
  align-items: center;
  column-gap: 12px;
  min-height: 74px;
  padding: 8px 12px !important;
}
#panel-fin .fin-exp-card .fin-exp-main {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: center;
  padding-right: 4px !important;
  min-width: 0;
}
#panel-fin .fin-exp-card .fin-exp-right { display: contents !important; }
#panel-fin .fin-exp-card .fin-exp-sum {
  position: static !important;
  transform: none !important;
  left: auto !important;
  top: auto !important;
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: center;
  justify-self: end;
  margin: 0 !important;
  padding: 0 2px;
  white-space: nowrap;
  text-align: right;
}
#panel-fin .fin-exp-card .fin-exp-del {
  position: static !important;
  top: auto !important;
  right: auto !important;
  grid-column: 3;
  grid-row: 1 / -1;
  align-self: center;
  justify-self: end;
  margin-top: 0;
}

/* ---------- TOOLBAR-FLAT: гибрид «чистый текст + сегменты» ----------
   Идея: второстепенные действия и фильтры — текст без рамок и подложек.
   Состояние показываем цветом, весом и тонким подчёркиванием. Коробка остаётся
   только у сегмента-переключателя (одна на группу) и у главного действия (+). */

/* кнопки-действия в тулбарах */
.toolbar .btn.btn-ghost,
.cal-head .btn.btn-ghost,
.daybar .btn.btn-ghost,
.fin-toolbar .btn.btn-ghost {
  position: relative;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--muted) !important;
  padding: 8px 4px !important;
  min-height: 30px !important;
  border-radius: 0 !important;
  font-size: .9rem !important;
  transition: color .18s ease;
}
.toolbar .btn.btn-ghost:hover,
.cal-head .btn.btn-ghost:hover,
.daybar .btn.btn-ghost:hover,
.fin-toolbar .btn.btn-ghost:hover { color: var(--brand) !important; }

/* активное действие и раскрытые фильтры */
.toolbar .btn.btn-ghost.active,
.toolbar .btn.btn-ghost[aria-pressed="true"],
.toolbar .btn.btn-ghost[aria-expanded="true"],
.cal-head .btn.btn-ghost.active,
.daybar .btn.btn-ghost.active {
  color: var(--brand) !important;
  font-weight: 600 !important;
}
.toolbar .btn.btn-ghost.active::after,
.toolbar .btn.btn-ghost[aria-pressed="true"]::after,
.toolbar .btn.btn-ghost[aria-expanded="true"]::after,
.cal-head .btn.btn-ghost.active::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 1px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

/* выпадающие фильтры — как текст с галочкой */
.toolbar .input.kids-filter-select,
.cal-head .input.cal-specialist-select,
.toolbar .kids-search-input {
  background-color: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--muted) !important;
  font-size: .9rem !important;
  min-height: 30px !important;
  padding: 8px 16px 8px 2px !important;
  -webkit-appearance: none;
  appearance: none;
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 9px 9px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 4l3 3 3-3' fill='none' stroke='%238b8378' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  transition: color .18s ease;
}
.toolbar .kids-search-input {
  padding-right: 4px !important;
  background-image: none;
}
.toolbar .input.kids-filter-select:hover,
.cal-head .input.cal-specialist-select:hover { color: var(--ink) !important; }
/* выбранное значение подсвечиваем — класс ставит app.js */
.toolbar .input.kids-filter-select.filter-on,
.cal-head .input.cal-specialist-select.filter-on {
  color: var(--brand) !important;
  font-weight: 600 !important;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 4l3 3 3-3' fill='none' stroke='%231f4b43' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* поле поиска в тулбаре — просто линия под текстом */
.toolbar .kids-search-input::placeholder { color: var(--muted); opacity: .9; }

/* «Сегодня»: дата как текст, без рамки */
#panel-today .daybar #day {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  font-weight: 600;
  color: var(--ink) !important;
  border-radius: 0 !important;
}
#panel-today .daybar #day:focus { outline: none; box-shadow: inset 0 -2px 0 var(--brand); }

/* сегмент-переключатель: тёплая подложка, активная — светлая пилюля */
.cal-seg {
  background: #f0e7d8 !important;
  border: 0 !important;
  padding: 2px !important;
}
.cal-seg::before {
  background: var(--surface) !important;
  box-shadow: 0 2px 6px rgba(40, 34, 26, .12) !important;
}
.cal-seg-btn { color: #756a5d !important; }
.cal-seg-btn.active { color: var(--brand) !important; }
.cal-seg .cal-seg-btn.active { color: var(--brand) !important; }

/* финансы: разделы — текст с подчёркиванием */
.fin-nav { background: transparent !important; padding: 0 !important; gap: 16px !important; }
.fin-nav .chip-btn {
  position: relative;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--muted) !important;
  padding: 4px 2px !important;
  border-radius: 0 !important;
  font-size: .9rem;
  transition: color .18s ease;
}
.fin-nav .chip-btn:hover { color: var(--brand) !important; }
.fin-nav .chip-btn.active { color: var(--brand) !important; font-weight: 600; }
.fin-nav .chip-btn.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

/* главное действие и круглые кнопки остаются акцентными */
.toolbar .kids-add-icon,
.daybar #today-btn { box-shadow: 0 6px 14px rgba(31, 75, 67, .18); }

@media (max-width: 760px) {
  .toolbar .btn.btn-ghost,
  .cal-head .btn.btn-ghost { padding: 8px 2px !important; }
  .fin-nav { gap: 12px !important; }
}

/* ---------- TOOLBAR-FLAT-STRONG: те же правила, но с id-специфичностью ----------
   Правила «Детей/Материалов/Видео» заданы через #id, поэтому перекрываем их здесь. */
#kids-toolbar .kids-filter-select,
#m-toolbar .kids-filter-select,
#kids-toolbar .kids-search-input,
#m-toolbar .kids-search-input,
#v-toolbar .kids-search-input,
.cal-head .cal-specialist-select {
  flex: 0 1 auto !important;
  width: auto !important;
  max-width: 230px !important;
  height: 30px !important;
  min-height: 30px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  box-shadow: none !important;
  color: var(--muted) !important;
  font-size: .9rem !important;
  padding: 4px 16px 4px 2px !important;
  -webkit-appearance: none;
  appearance: none;
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 9px 9px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 4l3 3 3-3' fill='none' stroke='%238b8378' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}
#kids-toolbar .kids-filter-select.filter-on,
#m-toolbar .kids-filter-select.filter-on,
.cal-head .cal-specialist-select.filter-on {
  color: var(--brand) !important;
  font-weight: 600 !important;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 4l3 3 3-3' fill='none' stroke='%231f4b43' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}
#kids-toolbar .kids-search-input,
#m-toolbar .kids-search-input,
#v-toolbar .kids-search-input {
  max-width: none !important;
  padding: 4px 4px 4px 32px !important;
  background-image: none !important;
}
#kids-toolbar .kids-search-input::placeholder,
#m-toolbar .kids-search-input::placeholder,
#v-toolbar .kids-search-input::placeholder { color: var(--muted) !important; }

/* иконки-действия: без круга и фона */
#kids-toolbar .kids-filter-btn,
#kids-toolbar .kids-search-toggle,
#m-toolbar .kids-search-toggle,
#v-toolbar .kids-search-toggle {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: var(--muted) !important;
  box-shadow: none !important;
}
#kids-toolbar .kids-filter-btn:hover,
#kids-toolbar .kids-search-toggle:hover,
#m-toolbar .kids-search-toggle:hover,
#v-toolbar .kids-search-toggle:hover { color: var(--brand) !important; }
#kids-toolbar .kids-filter-btn[aria-expanded="true"],
#kids-toolbar .kids-search-toggle[aria-expanded="true"] { color: var(--brand) !important; }

/* ---------- TOOLBAR-FLAT-3: остатки «коробок» в тулбарах ---------- */
/* «Оплаты»: месяц-поле и действия — без рамок */
#panel-pay .daybar .input[type="month"],
#panel-pay .daybar .input {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-weight: 600;
  color: var(--ink) !important;
  padding: 4px 2px !important;
  min-height: 30px !important;
}
#panel-pay .daybar .input:focus { outline: none; box-shadow: inset 0 -2px 0 var(--brand) !important; }
#panel-pay .daybar label { font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* «Финансы»: кнопка месяца — просто иконка, без круга и фона */
#panel-fin .fin-month-btn {
  width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--muted) !important;
}
#panel-fin .fin-month-btn:hover { background: transparent !important; color: var(--brand) !important; }
#panel-fin .fin-month-btn svg { color: currentColor !important; }
#panel-fin .fin-month-wrap:active .fin-month-btn { background: transparent !important; }

/* ---------- TOOLBAR-FLAT-4: выравнивание тулбаров по замечаниям ---------- */

/* 1. «Календарь»: активный сегмент — зелёный, выбор календаря не растягивается */
.cal-seg {
  background: transparent !important;
  border: 0 !important;
  padding: 2px !important;
}
.cal-seg::before {
  background: var(--brand) !important;
  box-shadow: 0 6px 14px rgba(31, 75, 67, .20) !important;
}
.cal-seg-btn,
.cal-seg .cal-seg-btn { color: #6f665b !important; }
.cal-seg .cal-seg-btn.active,
.cal-seg-btn.active { color: var(--on-brand) !important; }

.cal-head { flex-wrap: wrap !important; row-gap: 8px; }
.cal-view-row {
  flex: 0 1 auto !important;
  flex-wrap: wrap;
  min-width: 0;
  gap: 8px !important;
}
.cal-view-row .cal-specialist-select,
.cal-head .cal-specialist-select {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 220px !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 4px 16px 4px 2px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  text-overflow: clip;
}

/* 2. «Дети / Материалы / Видео»: фильтры не сжимаются и не обрезаются */
#kids-toolbar .kids-filter-select,
#m-toolbar .kids-filter-select,
#kids-toolbar .kids-search-input,
#m-toolbar .kids-search-input,
#v-toolbar .kids-search-input {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: max-content !important;
  max-width: none !important;
}
#kids-toolbar,
#m-toolbar,
#v-toolbar { gap: 12px !important; }
#kids-toolbar .kids-search-wrap,
#m-toolbar .kids-search-wrap { flex: 1 1 80px !important; }

/* 3. «Дети»: у лупы и бургера убираем любой остаточный фон/тень */
#kids-toolbar .kids-filter-btn,
#kids-toolbar .kids-search-toggle,
#m-toolbar .kids-search-toggle,
#v-toolbar .kids-search-toggle {
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0;
  -webkit-tap-highlight-color: transparent;
}
#kids-toolbar .kids-filter-btn:hover,
#kids-toolbar .kids-search-toggle:hover,
#m-toolbar .kids-search-toggle:hover,
#v-toolbar .kids-search-toggle:hover { background: transparent !important; }

/* 4. «Оплаты»: действия — к правому краю */
#panel-pay .daybar { align-items: center; }
#panel-pay #pay-summary-btn { margin-left: auto !important; }
#panel-pay .daybar .btn.btn-ghost { min-height: 30px !important; }

/* ---------- TOOLBAR-FLAT-5: мобильные тулбары без обрезки ---------- */
@media (max-width: 760px) {
  /* календарь: месяц сжимается, «Мой календарь» уходит к правому краю своей строки */
  .cal-head { row-gap: 4px !important; }
  .cal-head #cal-label {
    flex: 1 1 0 !important;
    min-width: 0;
    font-size: 1.05rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
  }
  .cal-head .cal-view-row { width: 100% !important; }
  .cal-view-row .cal-specialist-select { margin-left: auto !important; }

  /* дети / материалы / видео: фильтры в один ряд, действия — второй ряд */
  #kids-toolbar,
  #m-toolbar,
  #v-toolbar {
    flex-wrap: wrap !important;
    row-gap: 4px !important;
    column-gap: 8px !important;
  }
  #kids-toolbar .kids-filter-select,
  #m-toolbar .kids-filter-select {
    flex: 1 1 calc(50% - 8px) !important;
    min-width: 0 !important;
    max-width: none !important;
    font-size: .84rem !important;
    padding-right: 16px !important;
  }
  #kids-toolbar .kids-search-toggle,
  #m-toolbar .kids-search-toggle,
  #v-toolbar .kids-search-toggle { order: 10; }
  #kids-toolbar .kids-filter-btn { order: 11; }
  #kids-toolbar .kids-add-icon,
  #m-toolbar .kids-add-icon,
  #v-toolbar .kids-add-icon { order: 12; margin-left: auto; }
}

/* ---------- TOOLBAR-FLAT-6: календарная шапка с запасом на узкие экраны ---------- */
@media (max-width: 760px) {
  .cal-head #cal-label {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 42vw !important;
    font-size: 1rem !important;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cal-head #cal-prev,
  .cal-head #cal-next { flex: 0 0 auto; width: 34px !important; min-width: 34px !important; padding: 0 !important; }
  .cal-head #cal-today {
    flex: 0 0 auto;
    font-size: .74rem !important;
    padding: 0 8px !important;
    white-space: nowrap;
  }
  .cal-head { gap: 4px !important; }
}

/* ---------- TOOLBAR-FLAT-7: фильтры не растягиваются на всю ширину ---------- */
#panel-kids #kids-toolbar .kids-filter-select,
#panel-materials #m-toolbar .kids-filter-select {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: 210px !important;
  min-width: 0 !important;
}
#panel-kids #kids-toolbar,
#panel-materials #m-toolbar,
#panel-video #v-toolbar { column-gap: 16px !important; }
@media (max-width: 760px) {
  #panel-kids #kids-toolbar .kids-filter-select,
  #panel-materials #m-toolbar .kids-filter-select {
    flex: 1 1 calc(50% - 8px) !important;
    max-width: none !important;
  }
}

/* ---------- TOOLBAR-FLAT-8: шапка календаря на телефоне — сетка ----------
   Сетка вместо флекса: строка даты фиксированная, «Сетка/Список» и выбор календаря
   всегда в одной строке. Ничего не разъезжается при любом шрифте. */
@media (max-width: 760px) {
  #panel-cal .cal-head {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    row-gap: 8px;
    column-gap: 8px;
    padding-right: 0;
  }
  #panel-cal .cal-head #cal-prev { grid-column: 1; grid-row: 1; }
  #panel-cal .cal-head #cal-label {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    max-width: none !important;
    font-size: 1.05rem !important;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #panel-cal .cal-head #cal-next { grid-column: 3; grid-row: 1; }
  #panel-cal .cal-head #cal-today {
    grid-column: 4;
    grid-row: 1;
    font-size: .74rem !important;
    padding: 0 8px !important;
    white-space: nowrap;
  }
  #panel-cal .cal-head #cal-print { display: none !important; }
  #panel-cal .cal-head .cal-view-row {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: auto !important;
    min-width: 0;
  }
  #panel-cal .cal-head .cal-specialist-select {
    margin-left: auto !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 46vw !important;
  }
}

/* ---------- TOOLBAR-FLAT-9: «Мой календарь» справа и по уровню сегмента ----------
   Ошибка была в width: auto у строки — она сжималась по содержимому, свободного
   места нет, поэтому margin-left: auto ничего не сдвигал. Теперь строка занимает
   всю ширину, и выбор календаря честно уезжает к правому краю. */
.cal-view-row {
  flex: 1 1 auto !important;
  width: 100% !important;
  align-items: center !important;
  justify-content: flex-start !important;
}
.cal-view-row .cal-specialist-select,
.cal-head .cal-specialist-select {
  margin-left: auto !important;
  height: 44px !important;
  min-height: 44px !important;
  line-height: 44px !important;
  padding: 0 16px 0 0 !important;
  align-self: center;
  background-position: right 2px center !important;
}
@media (max-width: 760px) {
  /* на телефоне сегмент ниже, выравниваем выбор календаря по его центру */
  #panel-cal .cal-head .cal-view-row { gap: 12px; }
  #panel-cal .cal-head .cal-specialist-select {
    height: 40px !important;
    min-height: 40px !important;
    line-height: 40px !important;
    max-width: 48vw !important;
  }
}

/* ---------- TOOLBAR-FLAT-10: текст селекта календаря прижат вправо ---------- */
.cal-view-row .cal-specialist-select,
.cal-head .cal-specialist-select,
#panel-cal .cal-head .cal-view-row .cal-specialist-select {
  text-align-last: right !important;
  text-align: right !important;
  direction: ltr;
  padding: 0 16px 0 0 !important;
}

/* ---------- TOOLBAR-FLAT-11: селект календаря фиксированной ширины ----------
   Chromium не выравнивает текст внутри нативного select, поэтому просто
   подгоняем ширину под «Мой календарь» — текст сам встаёт у правого края. */
.cal-view-row .cal-specialist-select,
.cal-head .cal-specialist-select {
  width: 168px !important;
  max-width: 168px !important;
  text-align: right !important;
  text-align-last: right !important;
}
@media (max-width: 760px) {
  #panel-cal .cal-head .cal-view-row .cal-specialist-select {
    width: 152px !important;
    max-width: 152px !important;
  }
}

/* ---------- CAL-SPECIALIST-BTN: своя кнопка вместо нативного селекта ----------
   Chromium не выравнивает текст внутри select, поэтому рисуем кнопку сами:
   текст прижат вправо, нативный селект невидим и открывается по тапу. */
#panel-cal .cal-view-row .cal-specialist-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
  overflow: hidden;
}
.cal-specialist-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .9rem;
  padding: 4px 2px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .18s ease;
}
.cal-specialist-btn:hover { color: var(--brand); }
.cal-specialist-btn .cal-caret { font-size: .7rem; color: currentColor; opacity: .7; }
@media (max-width: 760px) {
  .cal-specialist-btn { font-size: .88rem; height: 38px; }
}

/* ---------- CAL-SPEC-POP: своё меню выбора календаря ----------
   Системный пикер цепляется к спрятанному селекту и открывается слева,
   поэтому рисуем меню сами: оно выезжает ровно под кнопкой, справа. */
#panel-cal .cal-view-row { position: relative; }
.cal-spec-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 220px;
  max-width: 78vw;
  padding: 8px;
  border-radius: 16px;
  background: var(--surface-1, #fffdf9);
  border: 1px solid var(--border-2, #e7dfd1);
  box-shadow: 0 18px 44px rgba(40, 34, 26, .18);
}
.cal-spec-pop[hidden] { display: none !important; }
.cal-spec-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: .9rem;
  color: var(--ink-soft, #5f574d);
  text-align: left;
  padding: 8px 8px;
  border-radius: 10px;
  cursor: pointer;
  white-space: normal;
  line-height: 1.25;
}
.cal-spec-opt:hover { background: var(--brand-soft, rgba(31, 75, 67, .08)); color: var(--brand); }
.cal-spec-opt.on { color: var(--brand); font-weight: 600; }
.cal-spec-opt .cal-opt-mark { width: 14px; flex: 0 0 14px; opacity: 0; }
.cal-spec-opt.on .cal-opt-mark { opacity: 1; }

/* ---------- CAL-SPEC-POP-ANIM: меню выезжает и убирается плавно ---------- */
.cal-spec-pop { transform-origin: top right; }
.cal-spec-pop:not([hidden]) {
  animation: calPopIn .18s cubic-bezier(.22, .9, .3, 1) both;
}
.cal-spec-pop.closing {
  animation: calPopOut .14s ease both;
}
@keyframes calPopIn {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes calPopOut {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-6px) scale(.985); }
}
@media (prefers-reduced-motion: reduce) {
  .cal-spec-pop:not([hidden]),
  .cal-spec-pop.closing { animation: none; }
}

/* ---------- CAL-HEAD-ARROWS: стрелки вплотную к месяцу ----------
   Раньше сетка растягивала название, и «→» уезжала к «Текущему месяцу».
   Теперь месяц — компактная группа: ← месяц →, а кнопка «Текущий месяц» справа. */
@media (max-width: 760px) {
  #panel-cal .cal-head {
    display: grid !important;
    grid-template-columns: auto auto auto 1fr auto !important;
    align-items: center !important;
    column-gap: 8px !important;
    row-gap: 8px !important;
  }
  #panel-cal .cal-head #cal-prev { grid-column: 1; grid-row: 1; justify-self: start; }
  #panel-cal .cal-head #cal-label {
    grid-column: 2; grid-row: 1;
    justify-self: start;
    max-width: 46vw;
    text-align: left;
  }
  #panel-cal .cal-head #cal-next { grid-column: 3; grid-row: 1; justify-self: start; }
  #panel-cal .cal-head #cal-today {
    grid-column: 5; grid-row: 1;
    justify-self: end;
    padding: 0 4px !important;
  }
  #panel-cal .cal-head .cal-view-row { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- TOOLBAR-EQUAL-ICONS: «+» и лупа одинаковые по весу ----------
   Зелёная заливка делала «+» визуально крупнее лупы. Убираем фон и выравниваем
   размеры/толщину: в «Материалах» и «Видео» это равноправные действия. */
#m-toolbar .kids-add-icon,
#v-toolbar .kids-add-icon {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--muted) !important;
}
#m-toolbar .kids-add-icon svg,
#v-toolbar .kids-add-icon svg { width: 19px !important; height: 19px !important; stroke-width: 1.8; }
#m-toolbar .kids-add-icon:hover,
#v-toolbar .kids-add-icon:hover { color: var(--brand) !important; background: transparent !important; }
#m-toolbar .kids-add-icon:active,
#v-toolbar .kids-add-icon:active { transform: scale(.94); }

/* ---------- VIDEO-TOOLBAR-GROUP: лупа и «+» рядом, справа ---------- */
@media (max-width: 760px) {
  #v-toolbar .kids-search-toggle {
    order: 10;
    margin-left: auto !important;
  }
  #v-toolbar .kids-add-icon {
    order: 11;
    margin-left: 4px !important;
  }
  #v-toolbar { justify-content: flex-end; }
}

/* ---------- TOOLBAR-ICONS-PAIR: иконки идут парой справа, во всех тулбарах одинаково ---------- */
#kids-toolbar .kids-add-icon,
#m-toolbar .kids-add-icon,
#v-toolbar .kids-add-icon {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--muted) !important;
  margin-left: 4px !important;
}
#kids-toolbar .kids-add-icon svg,
#m-toolbar .kids-add-icon svg,
#v-toolbar .kids-add-icon svg {
  width: 19px !important;
  height: 19px !important;
  stroke-width: 1.8;
}
#kids-toolbar .kids-add-icon:hover,
#m-toolbar .kids-add-icon:hover,
#v-toolbar .kids-add-icon:hover { color: var(--brand) !important; background: transparent !important; }

/* лупа тянет группу иконок к правому краю, «+» встаёт рядом с ней */
#kids-toolbar .kids-search-toggle,
#m-toolbar .kids-search-toggle,
#v-toolbar .kids-search-toggle {
  margin-left: auto !important;
  margin-right: 0 !important;
}
@media (max-width: 760px) {
  #kids-toolbar .kids-search-toggle,
  #m-toolbar .kids-search-toggle,
  #v-toolbar .kids-search-toggle { order: 20 !important; }
  #kids-toolbar .kids-filter-btn { order: 21 !important; }
  #kids-toolbar .kids-add-icon,
  #m-toolbar .kids-add-icon,
  #v-toolbar .kids-add-icon { order: 22 !important; }
}

/* ---------- TOOLBAR-ICONS-TIGHT: иконки ближе друг к другу и одинаковые ----------
   Раньше каждая иконка сидела в коробке 44px, поэтому «+» и лупа казались далеко.
   Сужаем хитбокс до 30px, отступ 4px — иконки идут парой. */
#panel-kids #kids-toolbar .kids-add-icon,
#panel-materials #m-toolbar .kids-add-icon,
#panel-video #v-toolbar .kids-add-icon {
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  height: 34px !important;
  min-height: 34px !important;
  margin-left: 4px !important;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: var(--muted) !important;
}
#panel-kids #kids-toolbar .kids-add-icon svg,
#panel-materials #m-toolbar .kids-add-icon svg,
#panel-video #v-toolbar .kids-add-icon svg {
  width: 19px !important;
  height: 19px !important;
  stroke-width: 1.8;
}
#panel-kids #kids-toolbar .kids-search-toggle,
#panel-kids #kids-toolbar .kids-filter-btn,
#panel-materials #m-toolbar .kids-search-toggle,
#panel-video #v-toolbar .kids-search-toggle {
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
}
#panel-kids #kids-toolbar .kids-search-toggle svg,
#panel-kids #kids-toolbar .kids-filter-btn svg,
#panel-materials #m-toolbar .kids-search-toggle svg,
#panel-video #v-toolbar .kids-search-toggle svg {
  width: 19px !important;
  height: 19px !important;
}
#panel-kids #kids-toolbar,
#panel-materials #m-toolbar,
#panel-video #v-toolbar { column-gap: 4px !important; }

/* ---------- TOOLBAR-ICONS-FLEX: снимаем flex-basis 44px у иконок «Детей» ----------
   Старое правило задавало flex: 0 0 44px, из-за него «+» оставался в коробке 44px
   и казался крупнее остальных. */
#panel-kids #kids-toolbar .kids-add-icon,
#panel-kids #kids-toolbar #add-child.kids-add-icon {
  flex: 0 0 30px !important;
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  height: 34px !important;
  min-height: 34px !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
}
#panel-kids #kids-toolbar .kids-search-toggle,
#panel-kids #kids-toolbar .kids-filter-btn {
  flex: 0 0 30px !important;
}

/* ---------- TOOLBAR-ICONS-NOFILL: у лупы и фильтра нет зелёной заливки ----------
   После тапа кнопка получала фон (правило для открытого поиска + фокус/актив),
   и на экране появлялся зелёный квадрат. Оставляем только цвет иконки. */
#kids-toolbar .kids-search-toggle,
#kids-toolbar .kids-filter-btn,
#m-toolbar .kids-search-toggle,
#v-toolbar .kids-search-toggle,
#kids-toolbar.search-open .kids-search-toggle,
#m-toolbar.search-open .kids-search-toggle,
#v-toolbar.search-open .kids-search-toggle {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  -webkit-tap-highlight-color: transparent;
}
#kids-toolbar.search-open .kids-search-toggle,
#m-toolbar.search-open .kids-search-toggle,
#v-toolbar.search-open .kids-search-toggle,
#kids-toolbar .kids-search-toggle[aria-expanded="true"],
#m-toolbar .kids-search-toggle[aria-expanded="true"],
#v-toolbar .kids-search-toggle[aria-expanded="true"],
#kids-toolbar .kids-filter-btn[aria-expanded="true"] {
  color: var(--brand) !important;
}
#kids-toolbar.search-open .kids-search-toggle svg,
#m-toolbar.search-open .kids-search-toggle svg,
#v-toolbar.search-open .kids-search-toggle svg,
#kids-toolbar .kids-search-toggle[aria-expanded="true"] svg {
  stroke: var(--brand) !important;
}
#kids-toolbar .kids-search-toggle:focus,
#kids-toolbar .kids-search-toggle:active,
#m-toolbar .kids-search-toggle:focus,
#m-toolbar .kids-search-toggle:active,
#v-toolbar .kids-search-toggle:focus,
#v-toolbar .kids-search-toggle:active,
#kids-toolbar .kids-filter-btn:focus,
#kids-toolbar .kids-filter-btn:active {
  background: transparent !important;
  box-shadow: none !important;
  color: var(--brand) !important;
}
#kids-toolbar .kids-search-toggle:focus-visible,
#m-toolbar .kids-search-toggle:focus-visible,
#v-toolbar .kids-search-toggle:focus-visible,
#kids-toolbar .kids-filter-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

/* ---------- SEARCH-ROW-ORDER: поиск не выдавливает иконки на новую строку ----------
   У иконок был order 20–22, у поля поиска — 20 с flex-basis 100%, из-за чего иконки
   уезжали на третью строку. Теперь иконки идут первыми (10–12), поле — ниже (30). */
@media (max-width: 760px) {
  #kids-toolbar .kids-search-toggle,
  #m-toolbar .kids-search-toggle,
  #v-toolbar .kids-search-toggle { order: 10 !important; }
  #kids-toolbar .kids-filter-btn { order: 11 !important; }
  #kids-toolbar .kids-add-icon,
  #m-toolbar .kids-add-icon,
  #v-toolbar .kids-add-icon { order: 12 !important; }

  #kids-toolbar.search-open .kids-search-wrap,
  #m-toolbar.search-open .kids-search-wrap,
  #v-toolbar.search-open .kids-search-wrap {
    order: 30 !important;
    flex: 1 1 100% !important;
    margin-top: 4px !important;
    width: 100%;
  }
  #kids-toolbar.search-open .kids-search-input,
  #m-toolbar.search-open .kids-search-input,
  #v-toolbar.search-open .kids-search-input {
    width: 100% !important;
    height: 40px !important;
  }
}

/* ---------- SEARCH-TOGGLE-STATE: зелёный только пока строка открыта ----------
   Раньше лупа оставалась зелёной после закрытия: красили :focus и :active,
   а фокус на кнопке живёт ещё долго. Красим строго по .search-open. */
#kids-toolbar .kids-search-toggle,
#m-toolbar .kids-search-toggle,
#v-toolbar .kids-search-toggle,
#kids-toolbar .kids-search-toggle:focus,
#kids-toolbar .kids-search-toggle:active,
#m-toolbar .kids-search-toggle:focus,
#m-toolbar .kids-search-toggle:active,
#v-toolbar .kids-search-toggle:focus,
#v-toolbar .kids-search-toggle:active,
#kids-toolbar .kids-search-toggle[aria-expanded="true"],
#m-toolbar .kids-search-toggle[aria-expanded="true"],
#v-toolbar .kids-search-toggle[aria-expanded="true"] {
  color: var(--muted) !important;
  background: transparent !important;
  box-shadow: none !important;
}
#kids-toolbar .kids-search-toggle svg,
#kids-toolbar .kids-search-toggle:focus svg,
#m-toolbar .kids-search-toggle svg,
#v-toolbar .kids-search-toggle svg { stroke: currentColor !important; }

/* объявляем последним, чтобы перебить предыдущее правило */
#kids-toolbar.search-open .kids-search-toggle,
#m-toolbar.search-open .kids-search-toggle,
#v-toolbar.search-open .kids-search-toggle {
  color: var(--brand) !important;
  background: transparent !important;
}
#kids-toolbar.search-open .kids-search-toggle svg,
#m-toolbar.search-open .kids-search-toggle svg,
#v-toolbar.search-open .kids-search-toggle svg { stroke: var(--brand) !important; }

/* ---------- SEARCH-TOGGLE-HOVER: залипший hover не должен красить лупу ----------
   На тач-экране :hover остаётся после тапа, перебивая серый цвет. Ховер
   приравниваем к обычному состоянию, а открытый поиск объявляем последним. */
#kids-toolbar .kids-search-toggle:hover,
#m-toolbar .kids-search-toggle:hover,
#v-toolbar .kids-search-toggle:hover,
#kids-toolbar .kids-filter-btn:hover,
#kids-toolbar.search-open .kids-search-toggle:focus,
#m-toolbar.search-open .kids-search-toggle:focus,
#v-toolbar.search-open .kids-search-toggle:focus {
  color: var(--muted) !important;
  background: transparent !important;
  box-shadow: none !important;
}

#kids-toolbar.search-open .kids-search-toggle,
#m-toolbar.search-open .kids-search-toggle,
#v-toolbar.search-open .kids-search-toggle,
#kids-toolbar.search-open .kids-search-toggle:hover,
#m-toolbar.search-open .kids-search-toggle:hover,
#v-toolbar.search-open .kids-search-toggle:hover,
#kids-toolbar.search-open .kids-search-toggle:focus,
#m-toolbar.search-open .kids-search-toggle:focus,
#v-toolbar.search-open .kids-search-toggle:focus,
#kids-toolbar .kids-filter-btn[aria-expanded="true"],
#kids-toolbar .kids-filter-btn.active {
  color: var(--brand) !important;
  background: transparent !important;
}
#kids-toolbar.search-open .kids-search-toggle svg,
#m-toolbar.search-open .kids-search-toggle svg,
#v-toolbar.search-open .kids-search-toggle svg { stroke: var(--brand) !important; }

/* на устройствах с настоящим ховером — подсветка при наведении */
@media (hover: hover) and (pointer: fine) {
  #kids-toolbar .kids-search-toggle:hover,
  #m-toolbar .kids-search-toggle:hover,
  #v-toolbar .kids-search-toggle:hover { color: var(--brand) !important; }
}

/* ---------- TABS-UNDERLINE: верхние вкладки без коробок (вариант A) ----------
   Только ПК: на телефоне .tabs скрыты, там нижнее меню.
   Навигация = текст, активный раздел = зелёное подчёркивание. */
.tabs {
  gap: 24px !important;
  margin-bottom: 16px !important;
  align-items: flex-end;
  overflow: visible;
}
.tabs .tab {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  color: var(--muted) !important;
  font-weight: 500;
  padding: 8px 2px 8px !important;
  position: relative;
  transition: color .18s ease;
}
.tabs .tab::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background .18s ease;
}
.tabs .tab.active,
.tabs .tab.active:hover,
.tabs .tab.active:focus {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--brand) !important;
  font-weight: 600;
}
.tabs .tab.active::after { background: var(--brand) !important; }

@media (hover: hover) and (pointer: fine) {
  .tabs .tab:hover {
    background: transparent !important;
    color: var(--brand) !important;
  }
  .tabs .tab:hover::after { background: rgba(31, 75, 67, .28) !important; }
  .tabs .tab.active:hover::after { background: var(--brand) !important; }
}

/* ---------- CAL-DESKTOP-TINT: на ПК клетка дня — как на телефоне ----------
   Раньше на широком экране в клетке рисовались кнопки слотов, и клетка была белой.
   Теперь клетка заливается цветом свободного времени, а по нажатию открывается
   экран со слотами (openDaySheet). */
/* без !important: заливку задаёт инлайн-стиль из calendar.js (hsla по свободным слотам) */
.cal-cell {
  position: relative;
  background: transparent;
  border-color: transparent;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.cal-cell.today { box-shadow: inset 0 0 0 1px var(--brand) !important; }
.cal-cell.weekend { background: rgba(251, 236, 235, .5) !important; }
.cal-cell.empty { background: transparent !important; border: 0 !important; }

.cal-cell .cal-slot.summary {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: inherit;
  cursor: pointer;
}
.cal-cell .cal-date {
  position: relative;
  z-index: 2;
  pointer-events: none;
}
.cal-cell .cal-weekend-label { position: relative; z-index: 2; pointer-events: none; }

@media (min-width: 901px) {
  #cal-grid .cal-cell {
    min-height: 76px;
    padding: 8px 8px;
    transition: transform .16s ease, box-shadow .16s ease;
  }
  #cal-grid .cal-cell:not(.empty):hover { transform: translateY(-1px); }
  #cal-grid .cal-cell.empty { min-height: 76px; }
}

/* ---------- CAL-LIST-DESKTOP: список занятий на ПК ----------
   Раньше стили списка жили только в мобильном медиазапросе, поэтому на ПК
   вид был «сырой»: кнопки без оформления и пунктирные рамки. */
.cal-list-day {
  background: rgba(253, 249, 243, .94);
  border: 1px solid var(--glass-strong, #e7dfd1);
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 8px;
  box-shadow: 0 6px 18px rgba(60, 48, 30, .05);
}
.cal-list-date {
  font-size: .92rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}
.cal-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--surface-1, #fffdf9);
  border: 1px solid var(--line, #e7dfd1);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 4px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease;
}
.cal-list-item:last-child { margin-bottom: 0; }
.cal-list-item:hover { border-color: var(--brand); transform: translateY(-1px); }
.cal-list-time {
  min-width: 96px;
  font-weight: 700;
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
}
.cal-list-who { flex: 1; font-weight: 600; }
.cal-list-free {
  border-style: solid !important;
  background: rgba(31, 75, 67, .05) !important;
}
.cal-list-free .cal-list-time { color: var(--brand); }
.cal-list-item .chip { flex: 0 0 auto; }

/* ---------- CAL-LIST-POLISH: список без внешней коробки, телефон как был ---------- */
#cal-grid.cal-list {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
@media (min-width: 761px) {
  #cal-grid.cal-list .cal-list-day { width: 100%; }
}
@media (min-width: 901px) {
  #cal-grid.cal-list {
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
  }
}
@media (max-width: 760px) {
  .cal-list-day {
    padding: 8px 12px;
    border-radius: 14px;
    box-shadow: none;
  }
  .cal-list-item { padding: 8px 12px; }
  .cal-list-time { min-width: 48px; }
}

/* ---------- BOOT-LOADER: лоадер при старте приложения ---------- */
.app-boot {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(160deg, #f7f0e6 0%, #efe6d8 55%, #ece3d4 100%);
  transition: opacity .28s ease, visibility .28s ease;
}
.app-boot-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--brand);
  color: var(--on-brand);
  font: 700 1.15rem/1 "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .04em;
}
.app-boot-text { font-size: .9rem; color: var(--muted); }
.app-boot-mark svg { width: 100%; height: 100%; display: block; }
body.app-ready .app-boot { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- HEADER-BTNS-SOFT: кнопки шапки чуть прозрачнее ---------- */
.cab-icon-btn,
.cab-profile {
  background: rgba(31, 75, 67, .84) !important;
  border-color: rgba(31, 75, 67, .5) !important;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 16px rgba(31, 75, 67, .14) !important;
}
@media (hover: hover) and (pointer: fine) {
  .cab-icon-btn:hover,
  .cab-profile:hover { background: rgba(31, 75, 67, .95) !important; }
}

/* ---------- CAL-CELL-SQUARE: ровные квадратные клетки на телефоне ---------- */
@media (max-width: 760px) {
  /* сетка: доска по числу недель, без дыр между рядами */
  #cal-grid:not(.cal-list) {
    gap: 4px !important;
    padding: 2px 2px 4px !important;
    align-content: start !important;
    grid-auto-rows: max-content !important;
    flex: 0 0 auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    margin-bottom: 8px !important;
  }
  /* список: своя прокрутка, чтобы длинный месяц не обрезался */
  #cal-grid.cal-list {
    display: block !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 2px 16px !important;
    margin-bottom: 0 !important;
  }
  /* календарь шире: убираем лишние поля панели на телефоне */
  #panel-cal { padding-left: 2px !important; padding-right: 2px !important; }
  #cal-grid .cal-cell {
    aspect-ratio: 1 / 1 !important;
    min-height: 0 !important;
    padding: 4px 8px !important;
    border-radius: 12px !important;
  }
  #cal-grid .cal-cell.empty { aspect-ratio: 1 / 1 !important; min-height: 0 !important; }
  #cal-grid .cal-date { font-size: .8rem; }
  #cal-grid .cal-weekend-label { font-size: .56rem; }
}

/* ---------- VIDEO-CARD-FLAT: без превью, ссылка на видео ---------- */
.video-card { padding: 12px 16px !important; }
.video-card video { display: none !important; }
.video-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid rgba(31, 75, 67, .35);
  padding-bottom: 1px;
  margin: 2px 0 8px;
}
.video-open:hover { border-bottom-color: var(--brand); }

/* ---------- FILE-PREVIEW: файл открывается в кабинете ---------- */
.file-modal {
  width: min(920px, 94vw);
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 16px !important;
}
.file-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.file-head b { font-size: 1rem; }
#file-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 60dvh;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
@media (max-width: 760px) {
  .file-modal { width: 100%; max-height: 92dvh; }
  #file-frame { min-height: 64dvh; }
}

/* кнопка-ссылка (материалы) */
.link-btn {
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: .82rem;
  padding: 0;
  cursor: pointer;
  border-bottom: 1px solid rgba(31, 75, 67, .35);
}
.link-btn:hover { border-bottom-color: var(--brand); }

/* ---------- FIN-PRICE-ROWS: цены по типам списком ---------- */
.fin-price-list { margin-top: 8px; }
.fin-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: .93rem;
}
.fin-price-row:last-child { border-bottom: 0; }
.fin-price-row .input { max-width: 140px; height: 38px; min-height: 38px; text-align: right; }

/* ---------- VID-PROGRESS: полоса загрузки видео ---------- */
.vid-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.vid-progress-bar {
  flex: 1 1 auto;
  height: 8px;
  border-radius: 99px;
  background: rgba(31, 75, 67, .12);
  overflow: hidden;
}
.vid-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--brand);
  transition: width .18s linear;
}
.vid-progress-text {
  flex: 0 0 auto;
  font-size: .8rem;
  color: var(--muted);
  min-width: 96px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.vid-progress.done .vid-progress-fill { background: #2f7d5c; }
.vid-progress.error .vid-progress-fill { background: #b4453a; }

/* ---------- BOOT-ERROR: сообщение вместо пустого экрана ---------- */
.boot-error {
  position: fixed;
  inset: auto 16px 84px 16px;
  z-index: 3100;
  padding: 16px 16px;
  border-radius: 16px;
  background: #fffdf9;
  border: 1px solid var(--border-2, #e7dfd1);
  box-shadow: 0 18px 44px rgba(40, 34, 26, .18);
  font-size: .9rem;
  line-height: 1.4;
}
.boot-error p { margin: 0 0 8px; }
.boot-error .btn { margin-top: 4px; }

/* ---------- REPORT-CLEAN: видео — просто чекбокс, без плашки ---------- */
.report-videos {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 0 8px !important;
  box-shadow: none !important;
  font-size: .92rem;
}
.report-videos .check { font-size: .92rem; }
.report-video-hint {
  margin: 4px 0 0;
  color: var(--danger);
  font-size: .8rem;
  line-height: 1.35;
}
.report-videos .report-video-list { margin-top: 0; }
/* чипы-подсказки стоят под текстом отчёта */
.report-chips { margin: 8px 0 8px; }
#report-text.report-edit { margin-bottom: 2px; }

/* ---------- VIDEO-CARD-COMPACT: карточки по содержимому, кнопки в строку ---------- */
#video-list,
.video-list {
  align-content: start !important;
  align-items: start !important;
  grid-auto-rows: max-content;
}
.video-card {
  align-self: start !important;
  height: auto !important;
  padding: 12px 12px !important;
}
.video-actions {
  flex-wrap: nowrap !important;
  gap: 8px;
  margin-top: 8px;
}
.video-actions .btn {
  flex: 0 0 auto;
  padding: 4px 12px;
  font-size: .8rem;
}
.video-meta { margin-top: 4px; gap: 2px; }
.video-open { margin: 0 0 4px; }
/* окно загрузки видео: прокрутка и видимый крестик */
#v-overlay .modal {
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
#v-overlay .cab-modal-x { position: absolute; top: 10px; right: 10px; }

/* ---------- VIDEO-ACTIONS-FULL: кнопки на всю ширину карточки ---------- */
.video-actions,
#materials .material-actions {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  margin-top: 8px !important;
}
.video-actions .btn,
#materials .material-actions .btn {
  flex: 1 1 0 !important;
  width: auto !important;
  justify-content: center;
  text-align: center;
  padding: 8px 8px;
  font-size: .82rem;
  background: var(--surface-1, #fffdf9);
  border: 1px solid var(--line, #e7dfd1);
}
.video-actions .btn:hover,
#materials .material-actions .btn:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- VID-PICK: выбор файла кнопкой, input вне окна ---------- */
.vid-file-input {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.vid-pick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.vid-pick-row .btn { padding: 8px 12px; font-size: .84rem; }
.vid-pick-name {
  font-size: .84rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

/* ---------- FIN-PRICE-FIELDS: цены по типам — те же поля, что и планирование ---------- */
.fin-price-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 8px;
}
.fin-price-list .field { margin: 0; }
.fin-price-list .input { width: 100%; }

/* ---------- FIN-SETTINGS-BLOCKS: два блока настроек ---------- */
.fin-settings { display: grid; gap: 12px; max-width: 640px; }
.fin-settings .fin-block { padding: 16px; margin: 0; }
.fin-settings .fin-block > b { display: block; margin-bottom: 4px; }
.fin-settings .fin-block .calc-note { margin: 0 0 8px; }
.fin-settings .fin-save-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

/* ---------- FIN-TYPE-EDIT: свои типы занятий в настройках ---------- */
.fin-type-line { display: flex; align-items: center; gap: 8px; }
.fin-type-line .input { flex: 1 1 auto; min-width: 0; }
.fin-type-del {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line, #e7dfd1);
  border-radius: 50%;
  background: #fffdf9;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
.fin-type-del:hover { color: #b4453a; border-color: #d9b3ad; }
.fin-type-add {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line, #e7dfd1);
}
.fin-type-add .btn { justify-content: center; min-height: 40px; }
@media (min-width: 620px) {
  .fin-type-add { grid-template-columns: 1fr 140px 96px auto; align-items: end; }
}

/* ---------- FIN-AUTOSAVE: подпись про автосохранение ---------- */
.fin-autosave { margin: 12px 0 0; }
.fin-autosave b { color: var(--ink); }

/* ---------- CAL-SLIDE: двухфазное листание месяцев ---------- */
#cal-grid.cal-out-next { animation: calOutNext .23s cubic-bezier(.4, 0, .7, .3) both; }
#cal-grid.cal-out-prev { animation: calOutPrev .23s cubic-bezier(.4, 0, .7, .3) both; }
#cal-grid.cal-in-next { animation: calInNext .55s cubic-bezier(.42, 0, .58, 1) both; }
#cal-grid.cal-in-prev { animation: calInPrev .55s cubic-bezier(.42, 0, .58, 1) both; }
#cal-grid.cal-in-today { animation: calInToday .6s cubic-bezier(.42, 0, .58, 1) both; }
#cal-label.cal-fade { animation: dayFade .4s ease both; }

@keyframes calOutNext {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateX(-16px); }
}
@keyframes calOutPrev {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateX(16px); }
}
@keyframes calInNext {
  from { opacity: .4; transform: translateX(22px); }
  to { opacity: 1; transform: none; }
}
@keyframes calInPrev {
  from { opacity: .4; transform: translateX(-22px); }
  to { opacity: 1; transform: none; }
}
@keyframes calInToday {
  from { opacity: .4; transform: scale(.97); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  #cal-grid.cal-out-next, #cal-grid.cal-out-prev { animation: none; opacity: 0; }
  #cal-grid.cal-in-next, #cal-grid.cal-in-prev, #cal-grid.cal-in-today,
  #cal-label.cal-fade { animation: dayFadeOnly .32s ease both; }
}

/* ---------- CAL-SWAP: смена календаря специалиста ---------- */
#cal-grid.cal-swap-out { animation: calSwapOut .22s cubic-bezier(.4, 0, .7, .3) both; }
#cal-grid.cal-swap-in { animation: calSwapIn .5s cubic-bezier(.22, .9, .3, 1) both; }

@keyframes calSwapOut {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(18px); }
}
@keyframes calSwapIn {
  from { opacity: .35; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  #cal-grid.cal-swap-out { animation: none; opacity: 0; }
  #cal-grid.cal-swap-in { animation: dayFadeOnly .3s ease both; }
}

/* ---------- JHISTORY: история дневника ребёнка ---------- */
.jhistory-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 62dvh;
  overflow-y: auto;
  margin: 8px 0 12px;
}
.jhistory-item {
  padding: 12px 12px;
  border-radius: 14px;
  background: var(--surface-2, #f8f1e6);
  border: 1px solid var(--line, #e7dfd1);
}
.jhistory-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.jhistory-item p { margin: 0 0 4px; font-size: .9rem; line-height: 1.35; }
.jhistory-item p:last-child { margin-bottom: 0; }
.jhistory-item b { color: var(--ink); }

/* ---------- CAL-OUTSIDE: занятие вне рабочего графика ---------- */
.chip.warn {
  background: rgba(251, 236, 235, .95);
  color: #a4392d;
  border: 1px solid rgba(164, 57, 45, .25);
}
#info-outside-wrap { margin: 8px 0 0; }
#info-outside-note { margin: 0 0 8px; color: #a4392d; }

/* ---------- CAL-LIST-FIT: строка списка не вылезает за карточку ---------- */
.cal-list-item {
  flex-wrap: nowrap;
  overflow: hidden;
}
.cal-list-item .cal-list-time { flex: 0 0 auto; }
.cal-list-item .cal-list-who {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-list-item .chip { flex: 0 0 auto; }

/* ---------- MOVE-OVERLAY: окно переноса поверх карточки занятия ---------- */
#move-overlay { z-index: 1300; }

/* ---------- CONSENT: отметки согласий в карточке ребёнка ---------- */
.consent-warn {
  margin: 0 0 8px;
  padding: 12px 12px;
  border-radius: 12px;
  background: rgba(251, 236, 235, .95);
  border: 1px solid rgba(164, 57, 45, .35);
  color: #7c3227;
  font-size: .86rem;
  line-height: 1.35;
}
.consent-warn b { color: #a4392d; }
#child-overlay .calc-inputs { align-items: start; }
#child-overlay .calc-inputs .consent-pd,
#child-overlay .calc-inputs .consent-warn,
#child-overlay .calc-inputs .notify-field,
#child-overlay #c-notify-consent-wrap,
#child-overlay #c-notify-consent-note { grid-column: 1 / -1; }
@media (max-width: 760px) {
  #child-overlay .calc-inputs { grid-template-columns: 1fr; }
}

.check.consent-pd {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 2px 0 8px;
  font-size: .88rem;
  line-height: 1.35;
}

/* ---------- CONSENT-INVALID: подсветка несогласия на уведомления ---------- */
.check.consent-invalid { color: #a4392d; }
.check.consent-invalid input {
  outline: 2px solid #c8554a;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- CHILD-LONG-TAP: обратная связь при удержании карточки ---------- */
.child-card.pressing {
  transform: scale(.985);
  box-shadow: 0 0 0 2px rgba(31, 75, 67, .35);
  transition: transform .12s ease, box-shadow .12s ease;
}

/* ---------- CHILD-HEAD-ROW: имя, возраст и «три точки» в одну строку ---------- */
.child-card {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.child-card a,
.child-card input,
.child-card textarea { -webkit-user-select: text; user-select: text; }
.child-card header {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: space-between;
}
.child-card header h3 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.child-card .child-head-right {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 0;
}
.child-card .child-head-right .chip {
  flex: 0 0 auto;
  align-self: center;
  white-space: nowrap;
}
.child-card .child-menu-btn { flex: 0 0 auto; }

/* список детей не должен расширяться из-за длинного имени */
#kids.cards-list { grid-template-columns: minmax(0, 1fr); }
#kids .child-card { min-width: 0; }

/* карточка — grid: внутренняя колонка не шире карточки (иначе шапка вылезает) */
.child-card { grid-template-columns: minmax(0, 1fr); }
.child-card > header { max-width: 100%; }

/* ---------- CHILD-LABEL: подписи в карточке ребёнка ---------- */
.child-card .child-label { color: var(--muted); }

/* ---------- NOTIFY-CODE-BTN: кнопка кода заметнее ---------- */
#c-notify-code {
  background: var(--brand-soft, #eef4f1);
  border-color: var(--brand, #1f4b43);
  color: var(--brand-dark, #173a34);
  font-weight: 700;
  min-height: 38px;
}
#c-notify-code:hover,
#c-notify-code:focus-visible {
  background: var(--brand, #1f4b43);
  border-color: var(--brand, #1f4b43);
  color: #fff;
}

/* ---------- PROGRAM-PERIOD: программы по месяцам ---------- */
.program-period {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: nowrap;
  margin: 0;
  padding: 12px 40px;
  position: relative;
  min-height: 58px;
}
.prog-period-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-dark);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.prog-period-btn:active { background: var(--brand-soft); }
.prog-period-label {
  font-weight: 700;
  font-size: .98rem;
  text-transform: capitalize;
  min-width: 140px;
  text-align: center;
}
.prog-period-today {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: .8rem;
  padding: 8px 8px;
  cursor: pointer;
}
.prog-copy-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #9a9086;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.prog-copy-btn:hover { color: var(--brand-dark, #173a34); background: rgba(0, 0, 0, .04); }
.prog-copy-btn:disabled { opacity: .35; cursor: default; }
.prog-empty {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: var(--bg-soft);
}

/* ---------- PROG-TITLE-ROW: название блока на всю ширину ---------- */
.prog-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.prog-actions-row .prog-num { color: var(--muted); min-width: 22px; }
.prog-actions-btns { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.prog-title-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px;
  padding: 8px 12px;
  font-size: .98rem;
  font-weight: 600;
}
.prog-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 8px;
}

/* ---------- PROG-DEL-BTN: корзина в строке месяца ---------- */
.prog-del-btn {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #c05a4d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.prog-del-btn:hover { color: #a4392d; background: rgba(196, 90, 77, .10); }
.prog-del-btn:disabled { opacity: .3; cursor: default; background: none; }

/* окно копирования программы — поверх окна программы */
#prog-copy-overlay { z-index: 1300; }

/* новый блок докручивается с небольшим отступом от верха окна */
.prog-block { scroll-margin-top: 8px; }

/* ---------- PROGRAM-HEAD-FIX: «…» в ряду кнопок, без наложения ---------- */
#program-overlay .program-head-row { padding-right: 64px; }
#program-overlay .program-tools { flex-wrap: wrap; align-items: center; }
#program-overlay .program-more-wrap {
  position: absolute;
  top: 10px;
  right: 54px;
  z-index: 12;
}
#program-overlay .program-more-btn {
  width: 38px !important;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  border: 0 !important;
  color: var(--muted) !important;
  font-size: 1.2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#program-overlay .program-more-btn:hover,
#program-overlay .program-more-btn[aria-expanded="true"] {
  background: transparent !important;
  color: var(--text-1) !important;
}
#program-overlay .program-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 90;
}
#program-overlay #program-title { padding-right: 64px !important; }
@media (max-width: 760px) {
  #program-overlay .program-head-row { padding-right: 64px; }
}

/* ---------- SCHED-DAYS: график по дням недели ---------- */
.sched-days-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin: 0 0 12px;
}
.sched-day {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 8px 2px 8px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.sched-day b { font-size: .78rem; color: var(--muted); font-weight: 700; }
.sched-day span { font-size: .68rem; color: var(--muted); }
.sched-day.on { border-color: var(--brand); background: var(--brand-soft); }
.sched-day.on b, .sched-day.on span { color: var(--brand-dark); }
.sched-day.active { box-shadow: 0 0 0 2px rgba(31, 75, 67, .35); }
.sched-day.off { background: #faf6ef; }

.sched-day-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: var(--surface-1);
  box-shadow: 0 12px 26px rgba(60, 40, 20, .10);
  margin: 0 0 12px;
}
.sched-day-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sched-day-head b { font-size: 1rem; }
.sched-x { border: 0; background: none; color: var(--muted); font-size: 1.05rem; cursor: pointer; padding: 2px 4px; }
.sched-day-times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sched-day-label {
  font-size: 10px;
  letter-spacing: .13em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  margin: 12px 0 4px 2px;
}
.sched-lunch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px minmax(0, 1fr) minmax(0, .92fr) 24px;
  align-items: center;
  gap: 4px;
  background: var(--bg-soft, #f8f1e6);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 12px;
  margin: 0 0 8px;
  font-size: .86rem;
}
.sched-lunch > span { color: var(--muted); text-align: center; }
.sched-lunch select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: .82rem;
  color: var(--text-1);
  text-align: center;
}
.sched-lunch .sched-x { justify-self: center; }
.sched-empty-lunch { margin: 0 0 8px; font-size: .82rem; color: var(--muted); }
.sched-add-lunch {
  border: 0;
  background: none;
  color: var(--brand);
  font-weight: 600;
  font-size: .85rem;
  padding: 2px 0 4px;
  cursor: pointer;
}
.sched-day-actions { display: flex; gap: 8px; margin-top: 12px; }
.sched-day-actions .sched-save { flex: 1; }
.sched-dayoff {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid #e2c4bf;
  background: #fff;
  color: #a4392d;
  font-weight: 600;
  font-size: .86rem;
  cursor: pointer;
}
.sched-hint { font-size: .78rem; color: var(--muted); margin: 4px 0 8px; }

/* окно графика: своя кнопка-крестик */
#schedule-overlay .modal.sched-boutique { position: relative; }
#schedule-overlay .cab-modal-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
}
#schedule-overlay .cab-modal-x:hover { background: var(--surface-2); color: var(--text-1); }
#schedule-overlay .sched-head { padding-right: 48px; }

/* ---------- DUR-SEG: длительность занятия 40/60 ---------- */
.dur-seg {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  gap: 8px;
  background: none;
  border: 0;
}
.dur-seg button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px 16px;
  font: inherit;
  font-size: .86rem;
  font-weight: 600;
  color: #6f665c;
  cursor: pointer;
  min-width: 96px;
  text-align: center;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.dur-seg button:active { transform: scale(.98); }
.dur-seg button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* корзина удаления обеда */
.sched-lunch-del {
  justify-self: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #c05a4d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sched-lunch-del:hover { color: #a4392d; background: rgba(196, 90, 77, .1); }

/* удаление блока программы — красная корзина */
.prog-block-del {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #c05a4d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.prog-block-del:hover { color: #a4392d; background: rgba(196, 90, 77, .1); }

/* «Применить ко всей серии» — просто галочка с подписью, без плашки */
#info-overlay #info-series-wrap.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-1);
}
#info-overlay #info-series-wrap.check input { margin: 0; }

/* диалог архивации ребёнка */
#archive-overlay { z-index: 1300; }
.archive-modal .archive-actions { display: grid; gap: 8px; margin-top: 12px; }
.archive-modal .archive-actions .btn { width: 100%; }
.archive-modal .archive-back { color: var(--muted); }

/* выбор времени из свободного окна дня */
.timepick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  margin: 4px 0 12px;
}
.timepick-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0 4px;
  height: 52px;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font: inherit;
  color: var(--text-1);
  cursor: pointer;
  overflow: hidden;
}
.timepick-btn b { font-size: .86rem; font-weight: 600; line-height: 1.1; }
.timepick-btn small { font-size: .66rem; line-height: 1.1; color: var(--muted); white-space: nowrap; }
.timepick-btn.lunch small { color: #a4392d; }
.timepick-btn.tight small { color: #8a6d1f; }
.timepick-btn:active { background: var(--brand-soft); border-color: var(--brand); }
.timepick-btn.lunch { color: #a4392d; border-color: #e2c4bf; }
.timepick-btn.tight { color: #8a6d1f; border-color: #e0d3b6; }
#timepick-overlay { z-index: 1300; }

/* ---------- SHEET-V2: лист дня по макету 17.11.2026 ----------
   В ленте только занятия и обед; свободное время — одной строкой сверху.
   Деньги и абонемент в листе дня не показываем. */
#sheet-overlay .modal.sheet-v2 { padding: 16px 16px 12px; }

@media (min-width: 761px) {
  /* на ПК лист дня — не на всю ширину, как в макете */
  #sheet-overlay .modal.sheet-v2 { max-width: 880px; margin: 0 auto; }
}

.sheet-head { padding: 2px 2px 8px; }
.sheet-eyebrow {
  display: block;
  font-family: var(--font-body, inherit);
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
#sheet-overlay .sheet-head h2,
#sheet-overlay #sheet-title { font-size: 22px; margin: 0; line-height: 1.15; }

/* итог дня — плашки под заголовком */
.sheet-summary { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 2px 8px; }
.sheet-chip {
  font-family: var(--font-body, inherit);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(31, 75, 67, .08);
  color: var(--brand-dark);
}
.sheet-chip.dim { background: rgba(46, 36, 26, .06); color: var(--ink-soft); }

/* одна строка свободного времени: первое доступное + сколько вариантов */
.sheet-freebar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 12px;
  margin: 0 0 8px;
  border-radius: 14px;
  background: rgba(31, 75, 67, .075);
  border: 1px solid rgba(31, 75, 67, .3);
  font-family: var(--font-body, inherit);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sheet-freebar[hidden] { display: none; }
.sheet-freebar:active { background: rgba(31, 75, 67, .13); }
.sheet-freebar .sf-lead { font-size: 13.5px; font-weight: 700; color: var(--brand-dark); white-space: nowrap; }
.sheet-freebar .sf-count { font-size: 11.5px; font-weight: 600; color: var(--brand); flex: 1 1 auto; }
.sheet-freebar .sf-pick {
  font-size: 12.5px; font-weight: 700; color: var(--brand); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}

/* строки листа дня */
#sheet-list { display: flex; flex-direction: column; gap: 8px; }
.sheet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 12px;
  border-radius: 14px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  font: inherit;
  color: var(--ink);
  text-align: left;
}
.sheet-row.sheet-lesson { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sheet-row.sheet-lesson:active { background: var(--surface-2); }
.sheet-row .sheet-time {
  font-family: var(--font-body, inherit);
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: 108px;
}
.sheet-row .sheet-who { flex: 1 1 auto; font-size: 15px; font-weight: 700; min-width: 0; }
.sheet-row .sheet-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sheet-row .sheet-chev { color: #b6ada2; font-size: 17px; line-height: 1; }

#sheet-list .sheet-chip.status { background: rgba(46, 36, 26, .08); color: var(--ink-soft); }
#sheet-list .sheet-lesson.done .sheet-chip.status { background: rgba(31, 75, 67, .14); color: var(--brand-dark); }
#sheet-list .sheet-lesson.cancelled .sheet-chip.status { background: rgba(164, 57, 45, .12); color: #a4392d; }
#sheet-list .sheet-lesson.cancelled .sheet-time { color: var(--muted); text-decoration: line-through; }
#sheet-list .sheet-chip.dur { background: rgba(46, 36, 26, .05); color: var(--muted); }

/* обед — заметная строка */
.sheet-row.sheet-lunch {
  background: linear-gradient(90deg, rgba(200, 130, 40, .16), rgba(200, 130, 40, .05));
  border: 1px solid rgba(200, 130, 40, .45);
  border-left: 3px solid #c88228;
  padding: 8px 12px 8px 12px;
}
.sheet-row.sheet-lunch .sheet-ico { width: 20px; height: 20px; color: #8a5a12; flex: 0 0 20px; }
.sheet-row.sheet-lunch .sheet-time { color: #8a5a12; }
.sheet-row.sheet-lunch .sheet-who {
  font-family: var(--font-body, inherit);
  font-size: 13px;
  font-weight: 700;
  color: #8a5a12;
}
.sheet-row.sheet-lunch .sheet-chip.dur { background: rgba(200, 130, 40, .16); color: #8a5a12; }

@media (max-width: 760px) {
  #sheet-overlay .modal.sheet-v2 { padding: 12px 12px 12px; }
  #sheet-overlay .sheet-head h2,
  #sheet-overlay #sheet-title { font-size: 19px; }
  .sheet-summary { gap: 4px; }
  .sheet-summary .sheet-chip { font-size: 10.5px; padding: 4px 8px; }
  .sheet-freebar { gap: 8px; padding: 12px 12px; }
  .sheet-freebar .sf-lead { font-size: 12.5px; }
  .sheet-freebar .sf-pick { font-size: 12px; }
  .sheet-freebar .sf-pick .sf-arrow { display: none; }
  .sheet-row {
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 8px 12px;
  }
  .sheet-row .sheet-time { min-width: 0; font-size: 13px; }
  .sheet-row .sheet-who { font-size: 14.5px; }
  .sheet-row .sheet-meta { order: 3; flex: 1 1 100%; }
  .sheet-row .sheet-chev { display: none; }
  .sheet-row.sheet-lunch { flex-wrap: nowrap; }
  .sheet-row.sheet-lunch .sheet-who { flex: 1 1 auto; }
  .sheet-row.sheet-lunch .sheet-meta { order: 0; flex: 0 0 auto; margin-left: auto; }
}

/* ---------- CAL-LOAD: заливка загруженности дня в фирменной палитре ----------
   Пять ступеней вместо радуги hsl(): тил → шалфей → песок → терракота → глина.
   Класс ставит calendar.js (loadBucket), цвета живут на токенах --cal-load-N. */
.cal-cell.cal-load-1 { background: var(--cal-load-1); border-color: var(--cal-load-line); }
.cal-cell.cal-load-2 { background: var(--cal-load-2); border-color: var(--cal-load-line); }
.cal-cell.cal-load-3 { background: var(--cal-load-3); border-color: var(--cal-load-line); }
.cal-cell.cal-load-4 { background: var(--cal-load-4); border-color: var(--cal-load-line); }
.cal-cell.cal-load-5 { background: var(--cal-load-5); border-color: var(--cal-load-line); }
/* сегодняшняя клетка: рамка бренда поверх любой ступени */
.cal-cell.today.cal-load-1, .cal-cell.today.cal-load-2, .cal-cell.today.cal-load-3,
.cal-cell.today.cal-load-4, .cal-cell.today.cal-load-5 {
  box-shadow: inset 0 0 0 1px var(--brand) !important;
}

/* ---------- SCHED-V2: график по макету 18.11.2026 ----------
   Одни часы на все рабочие дни, один список обедов, набор длительностей занятия. */
.sched-body .sched-day-label {
  font-size: 9.5px;
  letter-spacing: .12em;
  font-weight: 600;
  margin: 16px 0 12px 2px;
}
.sched-body .sched-day-label:first-of-type { margin-top: 0; }
.sched-body .sched-day-times { margin-bottom: 4px; }
.sched-dur-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}
.sched-dur-row .sched-day { padding: 8px 2px 8px; }
.sched-dur-row .sched-day b { font-size: 1rem; }
.sched-dur-row .sched-day span { font-size: .62rem; }
.sched-dur-row .sched-day.off b { color: #a9a094; }
.sched-dur-row .sched-day.off span { color: #bcb2a6; }
.sched-days-row .sched-day { padding: 12px 2px; }
.sched-days-row .sched-day b { font-size: .84rem; }
.sched-days-row .sched-day.off b { color: #bcb2a6; }
.sched-empty-lunch { margin: 0 0 8px; font-size: .82rem; color: var(--muted); }
/* SCHED-V2-WIDTH: на ПК окно графика не на всю ширину */
@media (min-width: 761px) {
  #schedule-overlay .modal.sched-boutique,
  #sched-overlay .modal.sched-boutique { max-width: 560px; margin: 0 auto; }
}

/* ---------- FIN-TYPES-V2: типы занятий полосой в две строки (макет 18.11.2026) ---------- */
.fin-type-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 4px;
  background: var(--ds-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 12px;
  margin: 0 0 8px;
}
.fin-type-row .tn2 {
  font-size: .88rem;
  color: var(--text-1);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.fin-type-row .tmeta {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 2px;
  font-size: .8rem;
  color: var(--muted);
}
.fin-type-row .tmeta .dot { margin: 0 4px; }
.fin-type-row .tin-price,
.fin-type-row .tin-min {
  border: 0;
  background: transparent;
  padding: 2px 0;
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-1);
  text-align: left;
  min-width: 0;
  -moz-appearance: textfield;
}
.fin-type-row .tin-price { width: auto; min-width: 3ch; max-width: 9ch; field-sizing: content; text-align: left; }
.fin-type-row .tin-min { width: auto; min-width: 2ch; max-width: 4ch; field-sizing: content; text-align: left; }
.fin-type-row .tin-min + .unit { margin-left: 3px; }
.fin-type-row .tin-price::-webkit-outer-spin-button,
.fin-type-row .tin-price::-webkit-inner-spin-button,
.fin-type-row .tin-min::-webkit-outer-spin-button,
.fin-type-row .tin-min::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fin-type-row .tin-price:focus,
.fin-type-row .tin-min:focus {
  outline: 2px solid var(--brand-line);
  outline-offset: 2px;
  border-radius: 6px;
}
.fin-type-row .unit { color: var(--muted); }
.fin-type-row .dot { color: var(--border-strong); }
.fin-type-row .sched-lunch-del { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.fin-price-list { margin-top: 8px; }

/* ---------- DUR-LINE: длительность строкой (макет 18.11.2026) ---------- */
.dur-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface-2);
  border-radius: 16px;
  padding: 12px 12px;
  font-size: .95rem;
  color: var(--text-1);
}
.dur-line .dur-change {
  border: 0;
  background: none;
  color: var(--brand);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .82rem;
  padding: 4px 2px;
  cursor: pointer;
}
.dur-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  background: var(--surface-2);
  border-radius: 14px;
  padding: 4px;
}
.dur-list[hidden] { display: none; }
.dur-list button {
  border: 0;
  background: #fff;
  border-radius: 10px;
  padding: 12px 12px;
  text-align: left;
  font-family: var(--font-body);
  font-size: .88rem;
  color: var(--text-1);
  cursor: pointer;
}
.dur-list button.on {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
}

/* ---------- Q-TIME-LIST: свой список времени в форме занятия ---------- */
.ctl-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--text-1);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ctl-time .caret { color: var(--muted); flex: 0 0 auto; }
.ctl-time[aria-expanded='true'] { border-color: var(--brand-line); }
.time-list {
  margin-top: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(76, 52, 30, .12);
  overflow: hidden;
  max-height: 46dvh;
  overflow-y: auto;
}
.time-list[hidden] { display: none; }
.time-list .tl-group {
  font-family: var(--font-body);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-2);
  padding: 8px 12px 4px;
}
.time-list .tl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 12px;
  border: 0;
  border-top: 1px solid rgba(46, 36, 26, .06);
  background: #fff;
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--text-1);
  text-align: left;
  cursor: pointer;
}
.time-list .tl-row .tl-to { font-size: .72rem; color: var(--muted); }
.time-list .tl-row.sel { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.time-list .tl-row.sel .tl-to { color: var(--brand); }
.time-list .tl-empty { margin: 0; padding: 12px; font-size: .86rem; color: var(--muted); }

/* ---------- Q-AMOUNT-RO: сумма из типа занятия, вводить нельзя ---------- */
#q-amount:disabled {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--text-3);
  -webkit-text-fill-color: var(--text-3);
  opacity: 1;
  cursor: default;
  pointer-events: none;
}
#q-amount:disabled::-webkit-outer-spin-button,
#q-amount:disabled::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* длительность: до тапа «изменить» поле выглядит неактивным */
.dur-line { cursor: default; }
.dur-line .dur-value { color: var(--text-3); }
.dur-line.active .dur-value { color: var(--text-1); }
.dur-line.active { box-shadow: inset 0 0 0 1px var(--brand-line); }

/* ---------- CUSTOM-SELECTS: неактивное поле и красная подсказка ---------- */
.ctl-time.is-disabled {
  opacity: .55;
  cursor: default;
}
.sched-hint.err {
  color: #a4392d;
  background: rgba(196, 90, 77, .10);
  border-radius: 10px;
  padding: 8px 8px;
  margin-top: 4px;
  display: block;
}
.sched-hint.err[hidden] { display: none; }

/* ---------- FIN-TYPES-EDIT: РєР°СЂР°РЅРґР°С€ Рё Р°РЅРёРјР°С†РёРё СЃРїРёСЃРєР° С‚РёРїРѕРІ ---------- */
.fin-type-row {
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  max-height: 140px;
  overflow: hidden;
  transition: opacity .22s ease, transform .22s ease, max-height .22s ease,
              padding .22s ease, margin .22s ease, border-width .22s ease;
}
.fin-type-row .fin-type-edit {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--muted);
}
.fin-type-row .fin-type-edit:hover { color: var(--brand); border-color: var(--brand-line); }
.fin-type-row .sched-lunch-del[data-del-type] {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
}
.fin-type-row.removing {
  opacity: 0;
  transform: translateX(-32px);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  border-width: 0;
}
.fin-type-row.added { animation: finRowIn .32s ease; }
@keyframes finRowIn {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.fin-type-add {
  display: block;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  padding-top: 0;
  border-top-width: 0;
  transition: max-height .3s ease, opacity .24s ease, margin-top .24s ease,
              padding-top .24s ease, border-top-width .24s ease;
}
.fin-type-add.open {
  max-height: 520px;
  opacity: 1;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line, #e7dfd1);
}
.fin-type-add-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-1);
}
.fin-type-add-actions { display: flex; gap: 8px; margin-top: 12px; }
.fin-type-add-actions .btn { flex: 1; justify-content: center; }
#add-type-open.is-hidden { display: none; }

/* ---------- FIELD-INVALID: подсветка незаполненного обязательного поля ---------- */
.field-invalid {
  outline: 2px solid #c45a4d;
  outline-offset: 1px;
  border-radius: 12px;
}

/* ---------- TYPE-MIN: длительность в списке типов карточки ребёнка ---------- */
#child-overlay .checks-grid .type-min,
#quick-overlay .checks-grid .type-min,
#info-overlay .checks-grid .type-min {
  flex: 0 0 auto;
  font-size: .74rem;
  color: var(--muted);
  white-space: nowrap;
}
.checks-grid .type-check .type-name { margin-right: 2px; }

/* ---------- CAL-LOAD-C: монохром тила, тёмные ступени с светлым текстом ---------- */
.cal-cell.cal-load-4,
.cal-cell.cal-load-5 { color: #fff; }
.cal-cell.cal-load-4 .cal-date,
.cal-cell.cal-load-5 .cal-date { color: #fff; }
.cal-cell.cal-load-4 .cal-weekend-label,
.cal-cell.cal-load-5 .cal-weekend-label { color: rgba(255, 255, 255, .82); }
.cal-cell.cal-load-3 { color: var(--text-1); }

/* ---------- VIDEO-LIST-WIDE: видео как материалы — в одну колонку на всю ширину ---------- */
#video-list.video-list {
  grid-template-columns: 1fr !important;
  gap: 8px !important;
  margin-top: 12px;
}
#video-list .video-card { width: 100%; box-sizing: border-box; }

/* ---------- BTN-SAME-LOOK: у кнопок материалов и видео одинаковые поля ---------- */
#materials .material-actions .btn,
#video-list .video-actions .btn {
  margin: 0 !important;
  height: 40px !important;
  min-height: 40px !important;
}

/* ---------- CAL-WEEKDAY-IN-GRID: дни недели внутри рамки сетки ---------- */
#cal-grid .cal-weekday {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 0 4px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ---------- DUR-CHANGE-HIDDEN: «изменить» без выбранного типа не показываем ---------- */
.dur-line .dur-change[hidden] { display: none !important; }

/* ---------- SHEET-ROUND-BOTTOM: лист дня скруглён со всех сторон ---------- */
#sheet-overlay .modal {
  border-radius: 22px !important;
}
@media (max-width: 760px) {
  #sheet-overlay {
    align-items: center;
    justify-content: center;
    padding: 12px;
  }
  #sheet-overlay .modal {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 22px !important;
    max-height: 86dvh;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}
#sheet-overlay .sheet-freebar .sf-count { display: none !important; }

/* ---------- SHEET-DEL: корзинка внутри карточки занятия ---------- */
.sheet-row .sheet-del {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-left: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: #a4392d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  opacity: .75;
}
.sheet-row .sheet-del:hover { opacity: 1; }
.sheet-row .sheet-del:active { transform: scale(.94); }
.sheet-row .sheet-del svg { width: 15px; height: 15px; }

/* ---------- INFO-CANCEL-RANGE: отмена занятий за период ---------- */
.info-cancel-range {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  display: grid;
  gap: 8px;
}
.info-cancel-range[hidden] { display: none !important; }
.info-cancel-range .icr-title { font-weight: 600; font-size: .95rem; }
.info-cancel-range .calc-note { margin: 0; }

/* ---------- INFO-MVP: действия карточки занятия ---------- */
.info-cancel-reasons {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}
.info-cancel-reasons[hidden] { display: none !important; }
.info-cancel-reasons .icr-title { font-weight: 600; font-size: .95rem; }
.info-cancel-reasons .icr-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.info-cancel-reasons .icr-row .btn { flex: 1 1 auto; }
.info-secondary-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.info-main-actions { margin-top: 4px !important; }
.info-main-actions .btn { flex: 1 1 auto; }
.info-main-actions #info-del { color: #a4392d; }

/* ---------- INFO-COMPACT: компактные действия карточки занятия ---------- */
.info-secondary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 8px;
}
.info-secondary-row[hidden] { display: none !important; }
.info-main-actions[hidden] { display: none !important; }
.info-link {
  border: 0;
  background: none;
  padding: 2px 0;
  font: inherit;
  font-size: .9rem;
  color: var(--brand-dark);
  opacity: .85;
  cursor: pointer;
  text-decoration: none;
}
.info-link:hover { opacity: 1; text-decoration: underline; }
.info-link.danger { color: #a4392d; }
.info-cancel-reasons .icr-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 8px; }
.info-cancel-reasons .chip-btn { flex: 1 1 auto; }

/* ---------- MASS-DIALOG: «только это / все занятия ребёнка» ---------- */
.mass-modal { max-width: 380px; padding: 16px 16px 16px; }
.mass-modal h2 { margin: 0 0 4px; font-size: 1.15rem; }
.mass-modal .calc-note { margin: 0 0 12px; }
.mass-actions { display: grid; gap: 8px; }
.mass-actions[hidden] { display: none !important; }
.mass-actions .btn { width: 100%; }
.mass-reasons[hidden] { display: none !important; }
.mass-reasons .icr-title { font-weight: 600; margin-bottom: 4px; }
.mass-reasons .icr-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.mass-reasons .chip-btn { flex: 1 1 auto; }

/* ---------- INFO-NOTES-EMPTY: пустые подписи не занимают место ---------- */
#info-series-note:empty,
#info-outside-wrap[hidden],
#info-outside-wrap:has(#info-outside-note:empty) { display: none; }
#info-edit-link { margin-bottom: 0; }

/* ---------- EDIT-TIME-WINDOW: отдельное окно даты и времени ---------- */
.edit-time-modal { max-width: 380px; padding: 16px 16px 16px; }
#edit-time-overlay .edit-time-modal { max-width: 520px; padding: 16px !important; }
@media (max-width: 560px) {
  #edit-time-overlay .edit-time-modal { max-width: 100%; }
}
.edit-time-modal .field { min-width: 0; }
.edit-time-modal input.input,
.edit-time-modal .ctl-time {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.edit-time-modal input[type="date"] {
  text-align: left;
  font: inherit;
  color: inherit;
  padding: 12px 12px;
  height: auto;
  -webkit-appearance: none;
  appearance: none;
}
.edit-time-modal input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.edit-time-modal input[type="date"]::-webkit-calendar-picker-indicator { opacity: .6; }
.edit-time-modal .time-list { left: 0; right: 0; }
.edit-time-modal h2 { margin: 0 0 12px; font-size: 1.1rem; }
.edit-time-modal .field { margin-bottom: 12px; }
.edit-time-modal .modal-actions { margin-top: 12px; }

/* ---------- FIN-BOTTOM: второстепенные цифры в самом низу ---------- */
.fin-bottom {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ---------- BALANCE-MONEY: денежный баланс ребёнка ---------- */
.balance-modal { max-width: 420px; }
.balance-now {
  font-family: var(--font-display);
  font-size: 1.9rem;
  line-height: 1.1;
  color: var(--brand-dark);
  margin: 2px 0 4px;
}
.balance-topup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.balance-topup .field { min-width: 0; }
.balance-topup .input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
#sub-date { min-width: 0; }

@media (max-width: 760px) {
  .balance-topup { grid-template-columns: 1fr; }
}
.bal-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.bal-row:last-child { border-bottom: 0; }
.bal-row-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.bal-date { color: var(--muted); font-size: .86rem; }
.bal-sum { font-weight: 700; font-size: .98rem; }
.bal-sum.plus { color: var(--brand-dark); }
.bal-sum.minus { color: #a4392d; }
.bal-row-sub { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.bal-row .info-link { margin-top: 4px; }

/* ---------- ALERT: предупреждение в стиле кабинета ---------- */
.alert-modal { max-width: 380px; padding: 16px 16px 16px; }
.alert-modal h2 { margin: 0 0 8px; font-size: 1.15rem; }
.alert-modal .calc-note { margin: 0 0 12px; }

/* ---------- SLOT-OFFER: предложение перенести занятие в освободившийся слот ---------- */
.slot-offer-modal { max-width: 440px; padding: 16px 16px 16px; }
.slot-offer-modal h2 { margin: 0 0 4px; font-size: 1.12rem; }
.slot-offer-modal .calc-note { margin: 0 0 12px; }
.slot-offer-list { display: grid; gap: 8px; margin-bottom: 8px; }
.slot-offer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-1);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.slot-offer-row:hover { border-color: var(--brand-line); background: var(--surface-2); }
.slot-offer-row:active { transform: scale(.995); }
.so-main { display: grid; gap: 2px; min-width: 0; }
.so-name { font-weight: 600; font-size: .96rem; }
.so-when { color: var(--muted); font-size: .84rem; }
.so-do { flex: 0 0 auto; color: var(--brand-dark); font-weight: 600; font-size: .86rem; }
.slot-offer-add {
  width: 100%;
  margin: 2px 0 12px;
  padding: 12px 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: none;
  font: inherit;
  font-size: .92rem;
  color: var(--brand-dark);
  cursor: pointer;
}
.slot-offer-add:hover { background: var(--surface-2); border-color: var(--brand-line); }

/* ---------- FREE-WINDOW: плашка «свободное окно» у отменённого занятия ---------- */
.chip.free {
  background: #eaf2fb;
  border-color: #c3d9f2;
  color: #245c96;
}
/* ---------- REGISTER / TRIAL ---------- */
.cab-profile-trial {
  display: inline-block;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eaf2fb;
  border: 1px solid #c3d9f2;
  color: #245c96;
  font-size: .78rem;
  line-height: 1.35;
  overflow-wrap: break-word;
}

/* ---------- LOGIN / REGISTER (boutique) ---------- */
.login-boutique {
  width: min(460px, 100%);
}
.login-boutique .help-sub {
  margin: 4px 0 16px;
  color: var(--text-muted, #8a7a66);
  line-height: 1.45;
}
.login-actions {
  flex-wrap: wrap;
  margin-top: 4px;
}
.login-actions .btn {
  flex: 1 1 46%;
  min-width: 160px;
  min-height: 44px;
}
.login-actions .btn-primary {
  flex-basis: 100%;
}
.login-error {
  min-height: 1.2em;
  color: #a12a1c;
  margin: 4px 0 0;
}
.login-hint {
  margin-top: 12px;
  text-align: center;
}
.consent-link {
  color: var(--brand, #245c96);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.consent-link:hover {
  text-decoration-thickness: 2px;
}
.consent-hint {
  color: var(--text-3, #7a6f65);
  font-size: .94em;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

/* ---------- BILLING BANNER ---------- */
.billing-banner {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 12px;
  margin: 14px 0 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface-1, #fffdf9);
  border: 1px solid var(--border-1, #e8ddcf);
  box-shadow: 0 2px 10px var(--shadow-color, rgba(60, 45, 30, .08));
  color: var(--text-2, #4c453e);
  font-size: .86rem;
  line-height: 1.4;
}
.billing-banner-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--brand-soft, #e4efeb);
  color: var(--brand, #1f4b43);
}
.billing-banner-icon svg { width: 18px; height: 18px; display: block; }
.billing-banner-text { min-width: 0; }
.billing-banner .btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 12px;
  font-size: .82rem;
}
@media (max-width: 760px) {
  .billing-banner {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px 10px;
    margin: 12px 0;
    padding: 12px;
  }
  .billing-banner .btn {
    grid-column: 2;
    justify-self: start;
    margin-top: 2px;
  }
}

/* ---------- CONSENT + POLICY ---------- */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.consent-row input[type="checkbox"] {
  flex: 0 0 auto;
  margin-top: 2px;
}
.consent-text {
  display: block;
  line-height: 1.45;
}
.consent-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand, #245c96);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.policy-modal {
  width: min(760px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.policy-body {
  overflow-y: auto;
  padding-right: 8px;
  margin-top: 4px;
}
.policy-body h3 {
  font-size: 1rem;
  margin: 16px 0 4px;
}
.policy-body p,
.policy-body li {
  line-height: 1.5;
}
.policy-body ul {
  margin: 4px 0 4px 16px;
  padding: 0;
}
.policy-note {
  color: var(--text-muted, #8a7a66);
  font-size: .85rem;
}
.policy-modal .modal-actions {
  margin-top: 12px;
}

/* ---------- BRAND «ЛОГОНИКА» ---------- */
.brand-text .brand-sub,
.brand-text .brand-mobile { color: var(--brand-dark, #1f4d3d); }

.brand-mark.brand-mark-logo {
  background: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
}
.brand-mark-logo .brand-mark-svg { width: 100%; height: 100%; display: block; }
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}
.login-brand-mark { width: 46px; height: 46px; flex: 0 0 auto; }
.login-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.login-brand-text b {
  font-family: var(--font-display, "Golos Text", sans-serif);
  font-size: 1.35rem;
  color: var(--brand, #1f4d3d);
}
.login-brand-text span {
  font-size: .8rem;
  color: #8a7a66;
  letter-spacing: .02em;
}
.plat-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.plat-brand img { width: 40px; height: 40px; display: block; }
.plat-brand b { font-family: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 1.3rem; color: #1f4d3d; }
.brand-mobile { display: none; }

/* ---------- MOBILE HEADER: кнопки в цвет знака ---------- */
@media (max-width: 760px) {
  .cab-icon-btn,
  .cab-profile {
    background: #1f4d3d !important;
    border-color: #1f4d3d !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: 0 6px 16px rgba(31, 77, 61, .18) !important;
  }
}

/* ---------- MAX BOT ---------- */
.maxbot-modal { width: min(560px, 100%); }
.maxbot-status {
  margin: 8px 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg-soft, #f4ede0);
  font-size: .92rem;
}
.maxbot-status.connected { background: #e6f2ea; color: #1f4d3d; }
.maxbot-help { margin-top: 12px; font-size: .88rem; color: #6b6256; }
.maxbot-help summary { cursor: pointer; color: var(--brand, #1f4d3d); }
.maxbot-help ol { margin: 8px 0 0 16px; padding: 0; line-height: 1.5; }

/* ---------- BALANCE-DATE-FIT: дата не выезжает за модалку ---------- */
#sub-overlay .balance-topup {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
#sub-overlay .balance-topup .field {
  min-width: 0;
  width: 100%;
  overflow: hidden;
}
#sub-overlay .balance-topup input[type="date"] {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
@media (max-width: 760px) {
  #sub-overlay .balance-topup { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- MATERIALS-LIST-MOBILE: материалы списком на телефоне ---------- */
@media (max-width: 760px) {
  #materials {
    grid-template-columns: 1fr !important;
    grid-auto-rows: max-content;
    align-items: start;
    align-content: start;
    gap: 8px;
  }
  #materials .material-card { margin: 0 !important; }
  #materials .material-row {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
  }
  #materials .material-row img,
  #materials .material-card img {
    width: 82px !important;
    height: 82px !important;
    border-radius: 10px;
  }
  #materials .material-info {
    width: auto;
    flex: 1 1 180px;
    min-width: 0;
  }
  #materials .material-actions {
    width: 100%;
    margin-top: 2px;
  }
  #materials .material-actions .btn { flex: 0 1 auto; }
}


/* ---------- LOGIN-RESEND / VERIFY-EMAIL (M18) ---------- */
.login-resend {
  align-self: flex-start;
  margin: -4px 0 8px;
}
.verify-email {
  color: var(--brand-dark, #1f4d3d);
  overflow-wrap: anywhere;
}

/* ---------- VIDEO-STORAGE-FIXED: подсказка внизу экрана на ПК ---------- */
@media (min-width: 761px) {
  #panel-video { padding-bottom: 48px; }
  #panel-video #video-storage {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    width: min(1180px, calc(100vw - 48px));
    z-index: 40;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--border-2);
    border-radius: 12px;
    background: rgba(251, 246, 238, .96);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(35, 32, 29, .08);
  }
}

/* ---------- VIDEO-STORAGE-FLOATING: подсказка вне main, не прыгает ---------- */
@media (min-width: 761px) {
  body #video-storage.video-storage-floating {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    width: min(1180px, calc(100vw - 48px));
    z-index: 40;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--border-2);
    border-radius: 12px;
    background: rgba(251, 246, 238, .96);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(35, 32, 29, .08);
  }
}

/* Подписка (M8) */
.sub-modal { max-width: 460px; }
#subscription-overlay .modal-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
#subscription-overlay #sub-pay {
  width: min(320px, 100%);
  min-height: 48px;
  justify-content: center;
}
#subscription-overlay #sub-cancel { align-self: center; }
.sub-box {
  margin: 12px 0 8px;
  padding: 16px 16px;
  border: 1px solid var(--line, #e8dfcf);
  border-radius: 16px;
  background: var(--surface-soft, #f7f2e7);
}
.sub-active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  margin: 0 0 12px;
  padding: 16px 16px;
  border: 1px solid rgba(31, 77, 61, .22);
  border-radius: 14px;
  background: rgba(31, 77, 61, .10);
  color: var(--brand, #1f4d3d);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-align: center;
}
.sub-price { display: flex; align-items: baseline; gap: 8px; }
.sub-price b { font-family: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 2.2rem; color: var(--brand, #1f4d3d); }
.sub-price span { color: var(--text-muted, #6b6256); font-size: .88rem; }
.sub-early {
  display: block;
  margin: 8px 0 0;
  padding: 8px 12px;
  border: 1px solid #e8d3a9;
  border-left: 3px solid #d9b36c;
  border-radius: 10px;
  background: linear-gradient(135deg, #fbf0d8 0%, #f7e7c7 100%);
  color: #5d471b;
  font-size: .8rem;
  font-weight: 500;
  line-height: 1.35;
}
.sub-early b {
  display: block;
  margin-bottom: 2px;
  color: var(--brand, #1f4d3d);
  font-size: .88rem;
  font-weight: 700;
}
.sub-early span { display: block; }
.sub-modal .calc-note { min-height: 1.2em; }
@media (max-width: 680px) {
  .sub-price b { font-size: 1.9rem; }
  .sub-box { padding: 12px; }
}

/* ---------- INSTALL-BANNER: установка PWA на телефон ---------- */
.install-banner {
  display: none;
}
@media (max-width: 760px) {
  .install-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 78px;
    z-index: 950;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 12px;
    border: 1px solid #c9dcd3;
    border-radius: 16px;
    background: #f3f8f4;
    box-shadow: 0 12px 30px rgba(31, 77, 61, .16);
  }
  .install-banner[hidden] { display: none; }
  .install-banner-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
  .install-banner-copy b { color: var(--brand, #1f4d3d); font-size: 12px; }
  .install-banner-copy span { color: var(--muted, #6b6256); font-size: 10px; line-height: 1.3; }
  .install-banner-link {
    flex: 0 0 auto;
    color: var(--brand, #1f4d3d);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
  }
  .install-banner-close {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--muted, #6b6256);
    font-size: 11px;
    cursor: pointer;
    padding: 4px;
  }
}

/* ---------- FIN-EMPTY: подсказка внизу пустого списка занятий ---------- */
.fin-empty-wrap {
  display: flex;
  flex-direction: column;
  min-height: 52vh;
}
.fin-empty-wrap .empty-state {
  margin: auto 0;
}
.fin-empty-wrap .calc-note {
  margin-top: auto;
  padding-top: 24px;
}
.fin-plan-lead { margin-bottom: 12px; }
.fin-calc-intro {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-left: 3px solid #b9d5c9;
  border-radius: 0 10px 10px 0;
  background: #f3f8f4;
  color: var(--muted, #6b6256);
  font-size: .82rem;
  line-height: 1.4;
}
@media (max-width: 760px) {
  .fin-empty-wrap { min-height: calc(100dvh - 280px); }
}

/* ---------- FIN-SICK-WIDE: «По болезни» на всю строку, но ниже ---------- */
#panel-fin .fin-card.sick-wide {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 16px !important;
  min-height: 0;
}
#panel-fin .fin-card.sick-wide .fin-card-title {
  flex: 0 0 auto;
}
#panel-fin .fin-card.sick-wide .fin-card-value {
  margin-top: 0;
  font-size: 1.08rem;
}
#panel-fin .fin-card.sick-wide .fin-card-sub {
  margin-top: 0;
  font-size: .78rem;
}
@media (max-width: 640px) {
  #panel-fin .fin-card.sick-wide { gap: 4px 8px; padding: 8px 12px !important; }
}

/* ---------- FIN-INVEST-TOTAL: одна строка вместо дублей карточек ---------- */
#panel-fin .fin-invest-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 2px 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-2);
  color: var(--ink);
  font-size: .92rem;
}
#panel-fin .fin-invest-total span { color: var(--muted); font-size: .82rem; }
#panel-fin .fin-invest-total.fin-invest-footer {
  margin-top: auto;
  margin-bottom: 0;
  padding: 16px 2px 8px;
  border-top: 1px solid var(--border-2);
  border-bottom: 0;
}

/* ---------- FIN-SCREEN-HEAD: заголовок раздела и кнопка «+» ---------- */
#panel-fin .fin-screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 2px 8px;
}
#panel-fin .fin-screen-head.no-title { justify-content: flex-end; }
#panel-fin .fin-screen-head b {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--ink);
}
#panel-fin .fin-screen-head span {
  display: block;
  margin-top: 2px;
  font-size: .78rem;
  color: var(--muted);
}
#panel-fin .fin-add {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--brand);
  box-shadow: none;
  cursor: pointer;
}
#panel-fin .fin-add svg { width: 19px; height: 19px; stroke-width: 1.8; }
#panel-fin .fin-add:hover { color: var(--brand-dark); background: transparent; }
#panel-fin .fin-add:active { transform: scale(.94); }
#panel-fin .fin-expenses-screen {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
#panel-fin .fin-expense-main { flex: 1 1 auto; min-height: 0; }
#panel-fin .fin-expense-main.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42vh;
  padding: 16px 0;
}
#panel-fin .fin-expense-note {
  margin-top: auto;
  padding-top: 16px;
}
@media (max-width: 760px) {
  body.app-shell #panel-fin #fin-body { margin-top: 4px !important; }
  #panel-fin .fin-screen-head { margin-top: 0; margin-bottom: 4px; }
  #panel-fin .fin-screen-head.no-title { margin-bottom: 2px; }
  body.app-shell {
    padding-bottom: calc(var(--ds-space-64) + env(safe-area-inset-bottom, 0px));
  }
  body.app-shell #fin-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    padding-bottom: 0;
  }
  body.app-shell #fin-body > .fin-filter-row {
    flex: 0 0 auto;
  }
  body.app-shell #fin-body > .fin-expenses-screen {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    padding-bottom: 0;
  }
  body.app-shell #fin-body > .fin-expenses-screen .fin-expense-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body.app-shell #fin-body > .fin-expenses-screen .fin-expense-main.is-empty {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  body.app-shell #panel-fin .fin-expense-note {
    position: static;
    margin: 0;
    padding: 12px 2px 8px;
    background: transparent;
  }
}

/* ---------- FIN-ENTRY-MODAL: отдельные окна расходов и вложений ---------- */
#expense-overlay .fin-entry-modal,
#investment-overlay .fin-entry-modal { max-width: 520px; }
.fin-entry-modal .fin-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: start;
}
.fin-entry-modal .fin-form .check { grid-column: 1 / -1; }
.fin-entry-modal .check { margin-top: 4px; }
@media (max-width: 640px) {
  .fin-entry-modal .fin-form { grid-template-columns: 1fr; }
}

/* HARD-FIX: Chrome autofill на поле цены */
body #panel-fin #fs-price:-webkit-autofill,
body #panel-fin #fs-price:-webkit-autofill:hover,
body #panel-fin #fs-price:-webkit-autofill:focus,
body #panel-fin #fs-price:-internal-autofill-selected {
  -webkit-box-shadow: 0 0 0 1000px #f7f2e7 inset !important;
  box-shadow: 0 0 0 1000px #f7f2e7 inset !important;
  background-color: #f7f2e7 !important;
  -webkit-text-fill-color: var(--ink) !important;
  border-color: var(--line-strong) !important;
  outline: none !important;
}

/* ---------- FIN-FILTER-FLAT: фильтры занятий как текстовые вкладки ---------- */
#panel-fin .fin-filter-row {
  gap: 16px !important;
  border-bottom: 1px solid var(--border-2);
  padding-bottom: 0;
  margin-bottom: 12px;
  max-width: 100%;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  padding-top: var(--ds-space-4);
}
#panel-fin { overflow-x: hidden; }
#panel-fin .fin-filter-chip {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 8px 1px !important;
  color: var(--muted) !important;
  font-size: .86rem;
  position: relative;
}
#panel-fin .fin-filter-chip:hover {
  background: transparent !important;
  color: var(--brand) !important;
}
#panel-fin .fin-filter-chip.active {
  background: transparent !important;
  color: var(--brand) !important;
  font-weight: 600;
  box-shadow: none !important;
}
#panel-fin .fin-filter-chip.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}
@media (max-width: 760px) {
  #panel-fin .fin-filter-row { gap: 16px !important; }
  #panel-fin .fin-filter-chip { font-size: .82rem; }
}

/* ---------- QUICK-ADD TITLE: sans, без средних точек ---------- */
#quick-overlay #q-title {
  font-family: var(--font-body);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.02em;
}
#quick-overlay #q-title .q-title-date {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
}

/* ---------- VIDEO-STORAGE-DESKTOP-HIDE: на ПК подсказка не нужна ---------- */
@media (min-width: 761px) {
  body #video-storage:not(.video-storage-warn),
  body #video-storage.video-storage-floating:not(.video-storage-warn) {
    display: none !important;
  }
}

/* ---------- CHILD-CARD-FINAL: карточка ребёнка по макету A ---------- */
body.app-shell #kids .child-card {
  display: block;
  padding: 0 !important;
  border-radius: 17px !important;
  overflow: visible !important;
}
body.app-shell #kids .child-card.is-archived { background: #fbf8f2; }
body.app-shell #kids .child-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 13px 10px;
}
body.app-shell #kids .child-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #dcece4, #b9d4c8);
  color: var(--brand-dark);
  font-size: 17px;
  font-weight: 600;
}
body.app-shell #kids .is-archived .child-avatar { background: #eee5d8; color: #8b7d6c; }
body.app-shell #kids .child-identity { flex: 1; min-width: 0; }
body.app-shell #kids .child-identity h3 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}
body.app-shell #kids .is-archived .child-identity h3 { color: var(--muted); }
body.app-shell #kids .child-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: #397246;
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 500;
}
body.app-shell #kids .child-status:before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
body.app-shell #kids .child-status.archive { color: var(--muted); }
body.app-shell #kids .child-body { padding: 0 13px 13px; }
body.app-shell #kids .child-balance {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
body.app-shell #kids .child-balance span { font-size: 10px; color: var(--muted); }
body.app-shell #kids .child-balance b {
  font-size: 17px;
  line-height: 1.1;
  font-weight: 600;
  color: var(--brand-dark);
  white-space: nowrap;
}
body.app-shell #kids .is-archived .child-balance b { color: var(--muted); }
body.app-shell #kids .child-contact {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
}
body.app-shell #kids .child-contact-label { color: var(--muted); }
body.app-shell #kids .child-contact-dot { color: var(--muted); }
body.app-shell #kids .child-contact a { color: var(--brand); font-weight: 500; text-decoration: none; }
body.app-shell #kids .is-archived .child-contact,
body.app-shell #kids .is-archived .child-contact a { color: var(--muted); }
body.app-shell #kids .child-request {
  margin-top: 7px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
}
body.app-shell #kids .child-request span { color: var(--muted); }
body.app-shell #kids .is-archived .child-request { color: var(--muted); }
body.app-shell #kids .child-types {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}
body.app-shell #kids .child-type {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 10.5px;
  line-height: 1.3;
  white-space: nowrap;
}
body.app-shell #kids .child-type:first-child { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
body.app-shell #kids .child-type-extra { display: none; }
body.app-shell #kids .child-types.open .child-type-extra { display: inline-flex; }
body.app-shell #kids .child-types-toggle {
  padding: 4px 8px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 10.5px;
  line-height: 1.3;
  font-weight: 600;
  cursor: pointer;
}
body.app-shell #kids .child-types.open .child-types-toggle {
  background: transparent;
  border-style: dashed;
  border-color: var(--line);
  color: var(--muted);
  font-weight: 500;
}
body.app-shell #kids .child-spec { margin-top: 7px; color: var(--muted); font-size: 9.5px; line-height: 1.35; }
body.app-shell #kids .child-menu-btn { flex: 0 0 auto; }
body.app-shell #kids .child-menu { top: 62px; right: 12px; }
body.app-shell #kids .is-archived .child-type { opacity: .78; }
@media (max-width: 760px) {
  body.app-shell #kids .child-head { padding: 11px 12px 9px; gap: 9px; }
  body.app-shell #kids .child-avatar { width: 42px; height: 42px; flex-basis: 42px; font-size: 16px; }
  body.app-shell #kids .child-identity h3 { font-size: 16px; }
  body.app-shell #kids .child-body { padding: 0 12px 12px; }
  body.app-shell #kids .child-balance { padding: 8px 0; }
  body.app-shell #kids .child-menu { top: 58px; right: 10px; }
}

/* Карточки детей: на широком экране используем ширину, как в макете. */
@media (min-width: 761px) {
  body.app-shell #kids.cards-list {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
  }
}

/* Кнопка «⋯»: без бежевой плашки при нажатии/наведении */
body.app-shell #kids .child-card .child-menu-btn:hover,
body.app-shell #kids .child-card .child-menu-btn[aria-expanded="true"],
body.app-shell #kids .child-card .child-menu-btn:focus {
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
}
body.app-shell #kids .child-card .child-menu-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- TODAY-DAYBAR-COMPACT: шапка дня не съедает экран (23.11.2026) ----------
   Отступы сверху и снизу одинаковые: 4 px от шапки приложения + padding 4 px,
   и столько же снизу (padding 4 + margin 4), чтобы полоса с датой стояла по центру. */
@media (max-width: 760px) {
  body.app-shell #panel-today .daybar {
    padding: 4px 0 !important;
    margin-bottom: 4px !important;
    gap: 4px;
  }
  body.app-shell #panel-today .daybar .btn,
  body.app-shell #panel-today .daybar .input,
  body.app-shell #panel-today .daybar .btn.mini {
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 9px;
    border-radius: 11px;
    font-size: .78rem;
  }
  body.app-shell #panel-today .daybar .btn svg { width: 14px; height: 14px; }
  /* кнопка «Сегодня» задана круглой 44px двумя id — перебиваем её точечно */
  body.app-shell #panel-today .daybar #today-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    max-width: 34px !important;
    padding: 0 !important;
  }
  body.app-shell #panel-today .daybar #today-btn svg { width: 14px; height: 14px; }
}

/* ---------- TODAY-GRID-PC: на ПК «Сегодня» сеткой, как карточки детей ---------- */
@media (min-width: 761px) {
  #panel-today #lessons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
    align-items: start;
  }
  #panel-today #lessons .lesson.lesson-v2 { margin-bottom: 0; }
  #panel-today #lessons > .empty-state { grid-column: 1 / -1; }
  body.app-shell #panel-today #lessons .lesson.lesson-v2 { grid-template-columns: 64px 1fr; }
  body.app-shell #panel-today #lessons .lesson-v2 .lesson-rail { padding: 8px 6px; }
  body.app-shell #panel-today #lessons .lesson-v2 .lesson-body { padding: 8px 10px !important; }
  body.app-shell #panel-today #lessons .lesson-sub .lesson-btn { padding: 6px 2px; font-size: 11px; }
  body.app-shell #panel-today #lessons .lesson-btn-main,
  body.app-shell #panel-today #lessons .lesson-btn-soft { min-height: 34px; font-size: 12px; }
}

/* ---------- VIDEO-TAB-V2: телефон — строки, ПК — витрина (23.11.2026) ----------
   Мокап: mockups/video-tab-variants.png. Функционал тот же: ссылка, удаление,
   срок хранения; превью — стилизованная заглушка с ▶, реальных кадров пока нет. */
.video-days {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 600; line-height: 1.2;
  color: var(--ok); background: rgba(47, 107, 69, .1);
  border-radius: 999px; padding: 2px 7px; white-space: nowrap;
}
.video-days.low { color: #8a5a22; background: rgba(200, 130, 40, .14); }

.video-open.v-thumb {
  position: relative; display: block; overflow: hidden; margin: 0 !important;
  border: 0 !important; border-radius: 10px; text-decoration: none !important;
  background: radial-gradient(120% 120% at 20% 0%, #6aa79a 0%, #2f6b5f 42%, #1f4b43 100%);
  color: #fff;
}
.video-open.v-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .35) 100%);
}
.v-play {
  position: absolute; z-index: 2; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 26px; height: 26px; border-radius: 50%; padding-left: 2px;
  background: rgba(255, 255, 255, .92); color: var(--brand-dark);
  display: grid; place-items: center; font-size: 10px;
}
.v-file {
  position: absolute; z-index: 2; right: 6px; bottom: 5px;
  font-size: 8.5px; letter-spacing: .04em; padding: 1px 4px;
  background: rgba(0, 0, 0, .35); border-radius: 5px;
}
.v-overlay { display: none; }

body.app-shell #video-list {
  display: grid !important; grid-template-columns: 1fr !important; gap: 10px;
  align-content: start !important; align-items: start !important;
}
body.app-shell #video-list .video-card {
  display: grid; grid-template-columns: 78px 1fr; gap: 9px; align-items: center;
  padding: 8px 10px !important; border-radius: 15px; overflow: hidden;
}
body.app-shell #video-list .video-open.v-thumb { width: 78px; height: 56px; }
body.app-shell #video-list .video-main {
  display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: center; min-width: 0;
}
body.app-shell #video-list .video-meta {
  display: flex; flex-direction: column; gap: 2px; margin: 0; min-width: 0;
}
body.app-shell #video-list .video-meta b {
  font-size: 13.5px; color: var(--text-1); line-height: 1.25;
}
body.app-shell #video-list .video-meta span {
  font-size: 10.5px; color: var(--text-3); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.app-shell #video-list .video-side {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
body.app-shell #video-list .video-actions {
  display: flex; gap: 8px; margin: 0; flex-wrap: nowrap !important;
}
body.app-shell #video-list .video-actions .btn {
  padding: 0 !important; border: 0 !important; background: transparent !important;
  min-height: 0 !important; font-size: 10.5px; color: var(--text-2); box-shadow: none !important;
}
body.app-shell #video-list .video-actions .video-del { color: var(--danger); }

@media (min-width: 761px) {
  body.app-shell #video-list {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important; gap: 14px;
  }
  body.app-shell #video-list .video-card {
    display: flex; flex-direction: column; align-items: stretch;
    padding: 0 !important; overflow: hidden;
  }
  body.app-shell #video-list .video-open.v-thumb {
    width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 0;
  }
  body.app-shell #video-list .v-play { width: 38px; height: 38px; font-size: 13px; }
  body.app-shell #video-list .v-overlay {
    display: block; position: absolute; z-index: 2; left: 10px; right: 10px; bottom: 9px;
  }
  body.app-shell #video-list .v-overlay b {
    display: block; font-size: 14px; font-weight: 600; color: #fff; line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  }
  body.app-shell #video-list .v-overlay small { font-size: 10.5px; color: rgba(255, 255, 255, .86); }
  body.app-shell #video-list .v-file { top: 8px; right: 8px; bottom: auto; }
  body.app-shell #video-list .video-main {
    display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 10px;
  }
  body.app-shell #video-list .video-meta b,
  body.app-shell #video-list .video-meta .v-meta-line { display: none; }
  body.app-shell #video-list .video-meta .v-note {
    white-space: normal; overflow: visible; text-overflow: clip;
  }
  body.app-shell #video-list .video-side {
    flex-direction: row; align-items: center; justify-content: space-between; width: 100%; gap: 8px;
  }
  body.app-shell #video-list .video-actions { gap: 10px; }
}

/* ---------- VIDEO-TOOLBAR-COMPACT: тулбар «Видео» ниже на телефоне (23.11.2026) ---------- */
@media (max-width: 760px) {
  body.app-shell #panel-video #v-toolbar.kids-nav {
    margin: 0 0 6px !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    gap: 6px;
  }
  body.app-shell #panel-video #v-toolbar .kids-search-toggle,
  body.app-shell #panel-video #v-toolbar .kids-add-icon {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 11px !important;
    box-shadow: none !important;
  }
  body.app-shell #panel-video #v-toolbar .kids-search-toggle svg,
  body.app-shell #panel-video #v-toolbar .kids-add-icon svg {
    width: 17px !important;
    height: 17px !important;
  }
  body.app-shell #panel-video #video-list { margin-top: 0 !important; }
  body.app-shell #panel-video #v-toolbar.search-open .kids-search-input {
    height: 36px !important;
    border-radius: 11px !important;
    font-size: .85rem !important;
  }
}

/* ---------- MATERIAL-TAB-V2: телефон — строки, ПК — обложки (23.11.2026) ----------
   Мокап: mockups/materials-tab-variants.png. Функционал тот же: открыть файл/ссылку,
   изменить, удалить, счётчик использований. */
body.app-shell #panel-materials #materials {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 9px;
  align-items: start !important;
}
body.app-shell #panel-materials #materials .material-card {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 9px 10px !important;
  border-radius: 15px;
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--glass-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 8px 20px rgba(60, 45, 30, .07);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.mat-cover {
  width: 54px;
  height: 54px;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(120% 120% at 20% 0%, #6aa79a 0%, #2f6b5f 45%, #1f4b43 100%);
}
.mat-cover.is-photo { background: var(--surface-2); color: var(--brand-dark); }
.mat-cover svg { width: 18px; height: 18px; }
.mat-cover .mat-thumb {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border-radius: 0 !important;
  display: block;
}
.mat-ext { font-size: 8.5px; letter-spacing: .05em; opacity: .92; }
.mat-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mat-title { font-size: 13.5px; font-weight: 600; line-height: 1.25; color: var(--text-1); }
.mat-meta, .mat-note {
  font-size: 10.5px; line-height: 1.3; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mat-note { color: var(--text-2); }
.mat-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.mat-tag {
  font-size: 9.5px; line-height: 1.3; background: var(--surface-2); color: var(--text-2);
  border-radius: 6px; padding: 1px 5px; white-space: nowrap;
}
.mat-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.mat-open {
  font: inherit; font-size: 10px; font-weight: 600; color: var(--brand);
  background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.mat-links { display: flex; gap: 6px; }
.mat-link {
  font: inherit; font-size: 9.5px; color: var(--text-2);
  background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap;
}
.mat-link.mat-del { color: var(--danger); }
.mat-used { font-size: 9px; color: var(--text-3); }

@media (min-width: 761px) {
  body.app-shell #panel-materials #materials {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 14px;
  }
  body.app-shell #panel-materials #materials .material-card {
    display: flex; flex-direction: column; align-items: stretch;
    padding: 0 !important; overflow: hidden;
  }
  body.app-shell #panel-materials .mat-cover {
    width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 0;
  }
  body.app-shell #panel-materials .mat-cover svg { width: 26px; height: 26px; }
  body.app-shell #panel-materials .mat-ext { font-size: 10px; }
  body.app-shell #panel-materials .mat-main { padding: 9px 11px 0; gap: 3px; }
  body.app-shell #panel-materials .mat-title { font-size: 14.5px; }
  body.app-shell #panel-materials .mat-meta { font-size: 11px; }
  body.app-shell #panel-materials .mat-note { font-size: 11.5px; white-space: normal; }
  body.app-shell #panel-materials .mat-tags { margin-top: 3px; }
  body.app-shell #panel-materials .mat-side {
    flex-direction: row; align-items: center; justify-content: space-between;
    gap: 8px; padding: 8px 11px 10px; margin-top: auto;
  }
  body.app-shell #panel-materials .mat-open { font-size: 11px; }
  body.app-shell #panel-materials .mat-link { font-size: 11px; }
  body.app-shell #panel-materials .mat-links { gap: 10px; }
}
