/* Дизайн: светлый интерфейс, меню слева (только на компьютере),
   календарь месяца прижат к меню, события месяца — справа от календаря.
   Utility-классы в конце подбирает scripts/check_css.py. */

:root {
  --page: #d9dbdd;
  --panel: #fafafa;
  --card: #ffffff;
  --ink: #111111;
  --muted: #6b7280;
  --faint: #b8bcc2;
  --line: #e8e8e8;
  --line-soft: #f0f0f1;
  --radius: 14px;
}

/* DaisyUI 5 подогнан под светлую палитру: основные кнопки почти чёрные.
   В пятой версии переменные называются --color-* и хранят oklch(), а радиус
   кнопок задаёт --radius-field (в четвёртой это были --b1/--p/--rounded-btn). */
[data-theme="light"] {
  --color-base-100: oklch(0.98 0 0);
  --color-base-200: oklch(0.96 0 0);
  --color-base-300: oklch(0.93 0 0);
  --color-base-content: oklch(0.16 0 0);
  --color-primary: oklch(0.18 0 0);
  --color-primary-content: oklch(0.98 0 0);
  --radius-field: 0.6rem;
}

body { background: var(--page); color: var(--ink); font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }

/* --- каркас ----------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.shell-bare { grid-template-columns: 1fr; }
.main { display: flex; flex-direction: column; min-width: 0; background: var(--panel); }
.content { flex: 1; padding: 20px; }
.content > * + * { margin-top: 0; }

/* --- меню слева: только на компьютере --------------------------------------- */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; align-self: stretch;
  min-height: 100vh; max-height: 100vh; overflow: auto;
}

.brand { display: flex; align-items: center; gap: 10px; }
/* Логотип — static/icons/logo.svg (чёрный знак на прозрачном фоне), поэтому
   подложка не нужна: он и так читается на светлой панели меню. */
.brand-logo { width: 34px; height: 34px; flex-shrink: 0; }
.brand-logo-lg { width: 56px; height: 56px; }   /* на входе знак один, поэтому крупнее */
.brand-center { justify-content: center; }      /* знак по центру блока, а не слева */
.brand-title { font-weight: 700; font-size: 15px; line-height: 1.2; }

.side-nav { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line-soft); padding-top: 12px; flex: 1; }
.side-nav-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.side-nav a, .side-nav button {
  background: none; border: 0; text-align: left; padding: 9px 10px; border-radius: 9px;
  font-size: 13px; color: var(--muted); cursor: pointer; font-family: inherit; width: 100%;
}
.side-nav a:hover, .side-nav button:hover { background: #f1f1f2; color: var(--ink); }
.side-nav form { margin: 0; }
/* «Событие» — первый пункт меню и главная кнопка на компьютере
   (на телефоне меню нет, поэтому кнопка осталась в шапке) */
.side-nav .nav-add {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--ink); color: #fff; font-weight: 600;
  padding: 10px 12px; border-radius: 10px; margin-bottom: 8px;
}
.side-nav .nav-add:hover { background: #000; color: #fff; }
/* Открытый раздел подсвечен в меню: фон, жирный текст и тёмная полоска слева.
   Форма события относится к «Событие», поэтому активен и этот пункт. */
.side-nav a.is-active {
  background: #f1f1f2; color: var(--ink); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--ink);
}
/* У этой кнопки свой активный вид: чёрный фон и белый текст. Обычная подсветка
   открытого раздела (светлый фон, тёмный текст) перебивала цвет кнопки и получалась
   полностью чёрная плашка без текста. */
.side-nav .nav-add.is-active {
  background: var(--ink); color: #fff; font-weight: 700; box-shadow: 0 0 0 3px #d4d7dc;
}
.pill-dark { background: var(--ink); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 11px; }

/* --- верхняя панель --------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: var(--panel); position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-weight: 700; font-size: 16px; flex: 1; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
/* на телефоне логотип слева в верхней панели ведёт на календарь: меню слева только
   на большом экране, а верхняя панель — только на маленьком */
.topbar-brand { display: flex; align-items: center; flex: none; }
.topbar-brand .brand-logo { width: 30px; height: 30px; }

.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.icon-btn:hover { background: #f2f2f3; }

/* --- иконки lucide ------------------------------------------------------------
   Вставляются прямо в страницу (ui.icon), поэтому цвет берут у текста вокруг,
   а vertical-align ставит их по строке текста, а не по базовой линии. */
.icon { display: inline-block; vertical-align: -0.18em; flex-shrink: 0; }

/* профиль: только на телефоне */
.profile { position: relative; display: none; }
.avatar-btn {
  width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); font-weight: 700; font-size: 13px; cursor: pointer; color: var(--ink);
}
.menu-pop {
  position: absolute; right: 0; top: 38px; min-width: 200px; z-index: 40;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px; box-shadow: 0 10px 24px rgba(0,0,0,.12); list-style: none; margin: 0;
}
.menu-pop li { padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.menu-pop li:hover { background: #f3f3f4; }
.menu-pop form { margin: 0; }
.menu-pop button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.menu-name { font-weight: 700; }
.dot-badge { position: absolute; top: -4px; right: -4px; background: var(--ink); color: #fff; border-radius: 999px; font-size: 10px; padding: 1px 5px; }
.dot-badge[hidden] { display: none; }

/* --- календарь + список событий: два столбца на компьютере ------------------ */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }

.cal {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 16px; min-width: 0;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cal-title { font-size: 18px; font-weight: 700; }

.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-weekdays div {
  font-size: 11px; letter-spacing: 0.05em; color: var(--muted); font-weight: 600;
  text-align: center; padding: 6px 0;
}
.cal-cell {
  min-height: 92px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 6px;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.cal-cell:hover { border-color: var(--line); background: #fcfcfd; }
.cal-cell.dim { opacity: .4; }
.cal-day {
  font-size: 20px; font-weight: 700; line-height: 1; margin-top: 4px;
  width: 36px; height: 36px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}
.cal-day.today { background: var(--ink); color: #fff; }
.cell-add {
  position: absolute; top: 5px; right: 5px;
  width: 20px; height: 20px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 13px; line-height: 1; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; opacity: 0;
}
.cal-cell:hover .cell-add { opacity: 1; }
.cell-add:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
/* Клик по всей дате поднимает снизу экрана блок со всеми событиями дня */
.cal-cell.has-events { cursor: pointer; }
.cell-hit {
  width: 100%; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer;
}
.cal-dots { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 5px; min-width: 0; }
.ev-dot { width: 11px; height: 11px; border-radius: 999px; display: block; flex: none; }
.cal-foot { display: flex; justify-content: center; margin-top: 12px; }

/* --- события дня: блок выезжает снизу экрана ---------------------------------
   Тёмная шапка с датой и белая панель со списком: белая выезжает из-под шапки,
   поэтому у неё свои скруглённые верхние углы и отрицательный отступ. */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; flex-direction: column; max-height: min(62vh, 520px);
  pointer-events: none;  /* пустые поля по бокам не мешают кликам по календарю */
}
.sheet-head {
  pointer-events: auto; width: min(100%, 720px); margin: 0 auto;
  background: #131a2b; color: #fff; border-radius: 22px 22px 0 0;
  padding: 14px 16px 30px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 -6px 24px rgba(19, 26, 43, .18);
}
.sheet-dot { width: 10px; height: 10px; border-radius: 999px; flex: none; }
.sheet-date { font-size: 16px; font-weight: 700; flex: 1; min-width: 0; }
.sheet-count { font-size: 12px; color: #9fb0c9; white-space: nowrap; }
.sheet-close {
  width: 30px; height: 30px; flex: none; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.14); color: #fff; font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.sheet-close:hover { background: rgba(255,255,255,.28); }
.sheet-body {
  pointer-events: auto; width: min(100%, 720px); margin: -22px auto 0;
  background: var(--card); border: 1px solid var(--line-soft); border-bottom: 0;
  border-radius: 22px 22px 0 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  overflow: auto; flex: 1; min-height: 0;
}
.sheet-item { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.sheet-item:first-child { border-top: 0; padding-top: 2px; }
/* плашка типа — сплошным цветом типа, как на макете */
.sheet-pill {
  align-self: flex-start; max-width: 100%; padding: 5px 12px; border-radius: 999px;
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sheet-title { font-size: 16px; font-weight: 700; flex: 1; min-width: 150px; white-space: pre-wrap; }
.sheet-when { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.sheet-time { white-space: nowrap; }
.sheet-place { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-divider { width: 1px; height: 14px; background: var(--line); flex: none; }
.sheet-sub { font-size: 12px; color: var(--muted); }
/* Заметки: перевод каретки из textarea сохраняется, длинные строки переносятся */
.sheet-notes { font-size: 12px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.sheet-price { font-size: 14px; font-weight: 700; }
.sheet-link { font-size: 12px; color: var(--ink); text-decoration: underline; align-self: flex-start; }

/* выезд снизу и уход обратно */
.sheet-enter { transition: transform .3s cubic-bezier(.22, 1, .36, 1), opacity .3s ease; }
.sheet-enter-start { transform: translateY(100%); opacity: 0; }
.sheet-enter-end { transform: translateY(0); opacity: 1; }
.sheet-leave { transition: transform .22s ease-in, opacity .22s ease-in; }
.sheet-leave-start { transform: translateY(0); opacity: 1; }
.sheet-leave-end { transform: translateY(100%); opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .sheet-enter, .sheet-leave { transition: none; }
}

/* --- список событий месяца -------------------------------------------------- */
.cal-list { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px; min-width: 0; }
.cal-list-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
/* Список месяца: сначала само событие, кнопки — отдельной строкой под ним */
.event-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 0; border-bottom: 1px solid var(--line-soft);
}
.event-row:last-child { border-bottom: 0; }
/* Вся строка (кроме кнопок «Изменить»/«Удалить») кликабельна: поднимает нижний
   блок этого дня — тот же, что и клик по дате в сетке календаря. */
.event-row-hit {
  display: flex; align-items: flex-start; gap: 10px;
  background: none; border: 0; margin: 0; padding: 0; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
/* Плашка типа и плашка «сегодня» — всегда целиком: шириной жертвует только текст события */
.event-row-hit > .chip, .event-row-hit > .pill-bright { flex: none; }
.event-row-hit:hover .event-row-title { text-decoration: underline; }
.event-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.event-row-title { font-size: 14px; font-weight: 700; }
.event-row-sub { font-size: 12px; color: var(--muted); }
/* Дата в списке месяца крупнее остального текста: год не показываем, месяц в шапке календаря */
.event-row-date { font-size: 13px; font-weight: 600; color: var(--ink); }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
/* Кнопки «Изменить» и «Удалить»: своя строка под событием, прижаты к правому краю на любом экране */
.event-row-actions { display: flex; gap: 6px; justify-content: flex-end; }
/* сегодняшние события выделяются ярче: фон в цвет типа, жирная полоса и плашка */
.event-row.is-today {
  border: 1px solid var(--line-soft); border-left-width: 5px; border-radius: 10px;
  padding: 12px; margin: 6px 0;
}
.event-row.is-today .event-row-title { font-size: 15px; }
.pill-bright {
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: #fff; background: var(--ink); border-radius: 999px; padding: 4px 9px; white-space: nowrap;
}

/* --- пилюли типов ----------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f1f1f2; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--ink);
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip-sm { padding: 3px 8px; font-size: 11px; }
.dot { width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0; }
.cb { width: 16px; height: 16px; border-radius: 5px; border: 1px solid var(--line); background: #fff; accent-color: var(--ink); }

/* --- карточка события (страница удаления) ----------------------------------- */
.event-card {
  border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.more { color: var(--muted); font-size: 13px; letter-spacing: 1px; }
.card-title { font-size: 14px; font-weight: 700; line-height: 1.3; }
.card-notes { font-size: 12px; color: var(--muted); line-height: 1.4; white-space: pre-wrap; }

/* --- кнопки ----------------------------------------------------------------- */
.join-btn {
  min-width: 34px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.join-btn:hover { background: #f2f2f3; }
.btn-add {
  height: 34px; padding: 0 14px; border-radius: 10px; background: var(--ink); color: #fff;
  font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.btn-add:hover { background: #2a2a2a; }
.btn-primary {
  height: 38px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--ink); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center;
}
.btn-primary:hover { background: #2a2a2a; }
.btn-ghost {
  height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  font-size: 14px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; color: var(--ink);
}
.btn-ghost:hover { background: #f2f2f3; }
.btn-danger { background: #b91c1c; color: #fff; }
.btn-danger:hover { background: #991b1b; }

/* --- тост с сообщением: сам исчезает ---------------------------------------- */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; max-width: 380px;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 16px;
  font-size: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.22); cursor: pointer;
}
.toast-success { background: #14532d; }
.toast-error { background: #7f1d1d; }
.toast-info { background: var(--ink); }

/* --- поле даты со своим календарём ------------------------------------------ */
.dt { position: relative; }
.dt-row { display: flex; gap: 6px; }
.dt-row .field-input { flex: 1; min-width: 0; }
.picker {
  position: absolute; left: 0; top: 74px; z-index: 50; width: 330px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; box-shadow: 0 14px 34px rgba(0,0,0,.18);
}
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.picker-title { font-size: 15px; font-weight: 700; }
.picker-week, .picker-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.picker-week div { font-size: 11px; color: var(--muted); font-weight: 600; text-align: center; padding-bottom: 8px; }
.picker-grid button {
  border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink);
  height: 40px; border-radius: 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
/* даты, в которых уже есть события: точки тех же цветов, что в основном календаре */
.picker-dots { display: flex; align-items: center; justify-content: center; gap: 3px; min-height: 5px; }
.picker-dot { width: 5px; height: 5px; border-radius: 999px; display: block; flex: none; }
.picker-note { margin-top: 10px; font-size: 11px; color: var(--muted); text-align: center; }
.picker-grid button:hover { background: #f1f1f2; }
.picker-grid button.dim { color: var(--faint); }
.picker-grid button.today { background: var(--ink); color: #fff; font-weight: 700; }
.picker-grid button.picked { outline: 2px solid var(--ink); outline-offset: -2px; }
.picker-today {
  margin-top: 12px; width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); font: inherit; font-size: 14px; cursor: pointer; color: var(--muted);
}
.picker-today:hover { background: #f2f2f3; color: var(--ink); }

/* --- выбор времени: список часов и минут, только 24-часовой формат ----------- */
.time-picker { padding-bottom: 10px; }
.time-cols { display: flex; gap: 10px; }
.time-col { flex: 1; min-width: 0; }
.time-caption { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.time-list {
  max-height: 172px; overflow-y: auto; padding: 4px;
  border: 1px solid var(--line-soft); border-radius: 10px;
}
.time-list button {
  display: block; width: 100%; padding: 6px 8px; border: 0; border-radius: 7px; background: none;
  font: inherit; font-size: 13px; color: var(--ink); text-align: center; cursor: pointer;
}
.time-list button:hover { background: #f1f1f2; }
.time-list button.picked { background: var(--ink); color: #fff; font-weight: 600; }

/* --- поле места: ввод текста фильтрует выпадающий список -------------------- */
.combo { position: relative; }
.combo-box { position: relative; }
.combo-row { display: flex; gap: 6px; }
.combo-row .field-input { flex: 1; min-width: 0; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 50;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 14px 34px rgba(0,0,0,.18); padding: 8px;
  min-height: 132px; max-height: 280px; overflow: auto;
}
.combo-list button {
  display: block; width: 100%; text-align: left; border: 0; border-radius: 8px; cursor: pointer;
  background: none; font: inherit; font-size: 14px; color: var(--ink); padding: 8px 10px;
}
.combo-list button:hover, .combo-list button.active { background: #f1f1f2; }
.combo-list button.picked { background: #e7e7ea; font-weight: 700; }
.combo-empty { padding: 8px 10px; font-size: 13px; color: var(--muted); }
.combo-note { padding: 6px 10px 2px; font-size: 12px; color: var(--muted); }

/* --- формы и карточки страниц ---------------------------------------------- */
.page-card { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px; max-width: 560px; width: 100%; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 14px; }
.field { display: block; margin-bottom: 12px; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field-input {
  width: 100%; height: 38px; padding: 0 12px; font-size: 14px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px; outline: none; font-family: inherit;
}
.field-input:focus { border-color: var(--ink); }
textarea.field-input { height: auto; padding: 10px 12px; }
.form-actions { display: flex; gap: 8px; margin-top: 14px; }

.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
/* --- пагинация списков (20 оповещений на страницу) --------------------------- */
.pager { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.pager-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.pager-btn:hover { border-color: var(--ink); }
.pager-btn.is-off { opacity: 0.4; pointer-events: none; }   /* «Назад» на первой странице не кликается */
.pager-nums { display: inline-flex; align-items: center; gap: 4px; }
.pager-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.pager-num:hover { color: var(--ink); background: var(--line-soft); }
.pager-num.is-current { background: var(--ink); color: #fff; }
.pager-info { font-size: 12px; color: var(--muted); margin-left: auto; }
.page-card.wide { max-width: 760px; }
.place-row { align-items: flex-start; }
.place-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.place-name { font-size: 14px; font-weight: 700; }
.place-meta { font-size: 12px; color: var(--muted); }
.place-comments { font-size: 12px; color: var(--muted); }
.user-row { display: block; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.user-row:last-of-type { border-bottom: 0; }
.user-row-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.user-row-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.user-row-roles { display: flex; align-items: center; gap: 14px; margin-top: 8px; flex-wrap: wrap; }

/* --- активные входы пользователя: адрес, браузер и сброс входа -------------- */
.user-sessions {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 10px;
}
.user-sessions-head { display: flex; align-items: center; gap: 10px; }
.user-sessions-title { font-size: 12px; font-weight: 700; color: var(--muted); }
.session-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 10px; background: #fbfbfc;
}
.session-what { font-size: 13px; font-weight: 600; flex: 1; min-width: 170px; }
.session-meta { font-size: 12px; color: var(--muted); }
.session-flag {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
}
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Alpine */
[x-cloak] { display: none !important; }

/* --- утилиты, используемые в шаблонах --------------------------------------- */
.flex { display: flex; }
.grid { display: grid; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.min-w-0 { min-width: 0; }
.block { display: block; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.min-h-screen { min-height: 100vh; }
.mx-auto { margin-left: auto; margin-right: auto; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* --- компьютер: верхней панели нет ------------------------------------------
   Меню слева уже содержит и разделы, и счётчик оповещений, и «Добавить
   событие», а заголовок раздела лежит внутри содержимого (.page-title).
   .shell-bare — страницы без меню (вход и «нет сети»): у них шапка остаётся.
   На телефоне панели нет меню, поэтому кнопка добавления осталась в шапке. */
@media (min-width: 1024px) {
  .shell:not(.shell-bare) .topbar { display: none; }
}

/* --- телефон: меню слева исчезает, профиль появляется в шапке -------------- */
@media (max-width: 1023px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .profile { display: block; }
  .cal-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .content { padding: 12px; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .picker { width: 100%; padding: 12px; }
  .topbar { padding: 10px 12px; }
  .cal, .cal-list { padding: 10px; }
  .cal-cell { min-height: 56px; padding: 4px; }
  .cal-weekdays div { font-size: 9px; }
  .cal-day { font-size: 15px; width: 28px; height: 28px; margin-top: 2px; }
  .ev-dot { width: 9px; height: 9px; }
  /* точки стали крупнее — на телефоне уплотняем поле между ними, чтобы в ячейку
     по-прежнему влезало четыре события в строку */
  .cal-dots { gap: 4px; }
  .chip-sm { font-size: 10px; padding: 2px 6px; }
  .cell-add { opacity: 1; }
  /* на телефоне блок занимает всю ширину экрана */
  .sheet { max-height: 72vh; }
  .sheet-head, .sheet-body { width: 100%; border-radius: 20px 20px 0 0; }
  .sheet-date { font-size: 15px; }
  .sheet-title { font-size: 15px; min-width: 120px; }
  .sheet-when { font-size: 12px; gap: 8px; }
  /* на телефоне поля форм идут в одну колонку: поле поиска места не должно быть узким */
  .grid-cols-2 { grid-template-columns: minmax(0, 1fr); }
  .combo-list { max-height: 240px; min-height: 120px; }
}
