/* Расписание ансамбля имени Игоря Моисеева.

   Для кого: артисты и администрация, 40-70 лет, в основном с телефона.
   Отсюда крупный шрифт, большие кнопки, подписи у всех иконок и цвет
   только как подсказка к тексту, а не вместо него.

   Зал 1 - синий, зал 2 - зелёный: эти два цвета различает почти каждый,
   в том числе при частых нарушениях цветового зрения. Красный - цвет
   ансамбля и главных кнопок. Жёлтый - сегодня и свежие изменения. */

:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-2: #454c59;
  --muted: #6a7180;
  --line: #e2e4e9;
  --line-strong: #cfd3da;

  --brand: #b3261e;
  --brand-hover: #9a1f18;
  --brand-soft: #fbeae8;
  --on-brand: #ffffff;

  --hall-1: #2563eb;
  --hall-1-soft: #eaf1fe;
  --hall-2: #15803d;
  --hall-2-soft: #e7f5ec;

  --today: #f59e0b;
  --today-soft: #fff5d6;
  --today-ink: #6b4400;

  --ok: #15803d;
  --ok-soft: #e7f5ec;
  --warn: #a15c07;
  --warn-soft: #fff4dc;
  --err: #b42318;
  --err-soft: #fdecea;

  --focus: #2563eb;
  --shadow: 0 1px 2px rgb(16 24 40 / .05), 0 1px 3px rgb(16 24 40 / .08);
  --shadow-lg: 0 12px 32px rgb(16 24 40 / .16), 0 2px 6px rgb(16 24 40 / .08);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --r: 14px;
  --r-sm: 10px;
  --gutter: 16px;
  --nav-h: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115;
    --surface: #181b21;
    --ink: #eceef2;
    --ink-2: #c3c8d1;
    --muted: #9aa2ae;
    --line: #2a2f37;
    --line-strong: #3a404a;
    --brand: #e5534b;
    --brand-hover: #f06a62;
    --brand-soft: #3a1d1b;
    --hall-1: #6ea0ff;
    --hall-1-soft: #172642;
    --hall-2: #4cc47a;
    --hall-2-soft: #142e1e;
    --today: #fbbf24;
    --today-soft: #3a2e0e;
    --today-ink: #ffe3a3;
    --ok: #4cc47a;
    --ok-soft: #142e1e;
    --warn: #f5b546;
    --warn-soft: #3a2c0e;
    --err: #f07167;
    --err-soft: #3a1b19;
    --focus: #6ea0ff;
    --shadow: 0 1px 2px rgb(0 0 0 / .4);
    --shadow-lg: 0 16px 40px rgb(0 0 0 / .55);
    color-scheme: dark;
  }
}

/* Тема, выбранная вручную в "Ещё". Значения те же, что выше: CSS не умеет
   сослаться на один набор из двух мест, а light-dark() старые iPhone
   не понимают, и у них пропали бы все цвета */
:root[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #181b21;
  --ink: #eceef2;
  --ink-2: #c3c8d1;
  --muted: #9aa2ae;
  --line: #2a2f37;
  --line-strong: #3a404a;
  --brand: #e5534b;
  --brand-hover: #f06a62;
  --brand-soft: #3a1d1b;
  --hall-1: #6ea0ff;
  --hall-1-soft: #172642;
  --hall-2: #4cc47a;
  --hall-2-soft: #142e1e;
  --today: #fbbf24;
  --today-soft: #3a2e0e;
  --today-ink: #ffe3a3;
  --ok: #4cc47a;
  --ok-soft: #142e1e;
  --warn: #f5b546;
  --warn-soft: #3a2c0e;
  --err: #f07167;
  --err-soft: #3a1b19;
  --focus: #6ea0ff;
  --shadow: 0 1px 2px rgb(0 0 0 / .4);
  --shadow-lg: 0 16px 40px rgb(0 0 0 / .55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 18px; height: 18px; }
.i-lg { width: 30px; height: 30px; }

/* -- каркас: боковое меню на компьютере, нижнее на телефоне ------------- */

.app { min-height: 100dvh; }
.content { padding: 0 var(--gutter) calc(var(--nav-h) + 40px + env(safe-area-inset-bottom)); max-width: 1120px; margin: 0 auto; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  margin: 0 calc(var(--gutter) * -1);
  padding: max(10px, env(safe-area-inset-top)) var(--gutter) 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.topbar .titles { flex: 1; min-width: 0; }
.topbar h1 { margin: 0; font-size: 1.6rem; line-height: 1.2; letter-spacing: -.015em; }
.topbar .sub { color: var(--muted); font-size: .98rem; }
.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 48px; height: 48px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface); color: var(--ink); }
.icon-btn.help { color: var(--brand); }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.nav a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: .8rem; font-weight: 600;
}
.nav a .i { width: 26px; height: 26px; transition: transform .2s var(--ease); }
.nav a[aria-current="page"] { color: var(--brand); }
.nav a[aria-current="page"] .i { transform: translateY(-1px) scale(1.06); }
.nav .count {
  position: absolute; top: 7px; left: calc(50% + 6px);
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--brand); color: var(--on-brand); font-size: .75rem; line-height: 20px; text-align: center;
}
.nav .desktop-only, .nav .brand, .nav hr { display: none; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 248px 1fr; }
  .content { padding-bottom: 48px; width: 100%; }
  .topbar { padding-top: 22px; padding-bottom: 14px; }
  .topbar h1 { font-size: 1.85rem; }
  .nav {
    position: sticky; top: 0; height: 100dvh; padding: 20px 12px;
    display: flex; flex-direction: column; gap: 2px;
    border-top: 0; border-right: 1px solid var(--line);
  }
  .nav .brand { display: block; padding: 4px 12px 18px; text-decoration: none; }
  .nav .brand b { display: block; font-size: 1.15rem; }
  .nav .brand span { color: var(--muted); font-size: .88rem; line-height: 1.3; display: block; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); font-size: 1rem; }
  .nav a:hover { background: var(--bg); color: var(--ink); }
  .nav a[aria-current="page"] { background: var(--brand-soft); }
  .nav a .i { width: 22px; height: 22px; }
  .nav .count { position: static; margin-left: auto; }
  .nav .mobile-only { display: none; }
  .nav .desktop-only { display: flex; }
  .nav div.desktop-only { display: block; }
  .nav hr { display: block; border: 0; border-top: 1px solid var(--line); margin: 10px 12px; }
  .nav .bottom { margin-top: auto; }
  .nav form { margin: 0; }
  .nav form button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
  .nav form button:hover { background: var(--bg); color: var(--ink); }
}

/* -- кнопки ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, var(--line)); }
.btn-danger.solid { background: var(--err); color: #fff; border-color: var(--err); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface); border-color: transparent; }
.btn-wide { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: .95rem; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { border: 0; background: none; padding: 0; color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Большая кнопка "Добавить" на телефоне висит над нижним меню */
.fab {
  position: fixed; z-index: 25; right: var(--gutter);
  bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg); border-radius: 999px; padding: 0 22px 0 18px; min-height: 56px; font-size: 1.05rem;
}
@media (min-width: 900px) { .fab { position: static; box-shadow: none; border-radius: 12px; min-height: 48px; } }

/* -- поля --------------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-weight: 600; font-size: 1rem; }
.field .hint { color: var(--muted); font-size: .92rem; margin: 0; }
.input, select.input {
  width: 100%; min-height: 52px; padding: 12px 14px;
  border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  font-size: 1.05rem; transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.input[aria-invalid="true"] { border-color: var(--err); background: var(--err-soft); }
.input[readonly] { background: var(--bg); }
.field-error {
  display: flex; gap: 6px; align-items: flex-start;
  color: var(--err); font-weight: 600; font-size: .95rem; margin: 0;
  animation: rise .2s var(--ease);
}
.field-error .i { width: 18px; height: 18px; margin-top: 2px; }
.field-warn { color: var(--warn); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; cursor: pointer; padding: 6px 0; }
.check input { width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.check small { display: block; color: var(--muted); font-size: .9rem; }
.form-error {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: var(--err-soft); color: var(--err); font-weight: 600; margin: 0;
}

/* Выбор зала: две большие кнопки с цветом зала */
.hall-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; border: 0; padding: 0; margin: 0; }
.hall-pick legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.hall-pick label { cursor: pointer; }
.hall-pick input { position: absolute; opacity: 0; pointer-events: none; }
.hall-pick span {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px;
  border: 2px solid var(--line-strong); border-radius: 12px; font-weight: 700;
  transition: background .15s, border-color .15s, color .15s;
}
.hall-pick span::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--hall); }
.hall-pick input:checked + span { border-color: var(--hall); background: var(--hall-soft); color: var(--ink); }
.hall-pick input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.hall-1 { --hall: var(--hall-1); --hall-soft: var(--hall-1-soft); }
.hall-2 { --hall: var(--hall-2); --hall-soft: var(--hall-2-soft); }

/* -- карточки и строки расписания ---------------------------------------- */

.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.section { margin-top: 26px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 10px; font-size: 1.2rem; }
.section-title small { color: var(--muted); font-weight: 400; font-size: .95rem; }

.entries { list-style: none; margin: 0; padding: 0; }
.entry {
  position: relative;
  display: grid; grid-template-columns: 5px 6.6rem 1fr auto; gap: 0 12px; align-items: start;
  padding: 14px 16px 14px 0; border-top: 1px solid var(--line);
  text-align: left; width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0;
  animation: rise .35s var(--ease) both;
}
.entries > li:first-child > .entry { border-top: 0; }
.entry::before { content: ""; align-self: stretch; background: var(--hall); border-radius: 0 3px 3px 0; }
.entry .time { font-size: 1.08rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.4; white-space: nowrap; }
.entry .what { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.entry .title { font-size: 1.08rem; font-weight: 600; line-height: 1.35; }
.entry .meta { color: var(--ink-2); font-size: .95rem; margin-top: 2px; }
.entry .meta span + span::before { content: " · "; color: var(--muted); }
.entry .hall-tag { display: inline-flex; align-items: center; gap: 5px; font-size: .88rem; font-weight: 600; color: var(--hall); margin-top: 3px; }
.entry .hall-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--hall); }
.entry .go { color: var(--muted); align-self: center; }
button.entry, a.entry { cursor: pointer; color: inherit; text-decoration: none; font: inherit; }
button.entry:hover, a.entry:hover { background: color-mix(in srgb, var(--hall-soft) 60%, transparent); }

.entry.is-now { background: var(--hall-soft); }
.entry.is-past { opacity: .5; }
.progress { grid-column: 3 / -1; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--hall) 18%, transparent); margin-top: 10px; overflow: hidden; }
.progress i { display: block; height: 100%; width: var(--done, 0%); background: var(--hall); border-radius: 3px; transition: width .6s var(--ease); }
.now-label { display: inline-flex; gap: 6px; align-items: center; font-size: .88rem; font-weight: 700; color: var(--hall); margin-top: 4px; }
.now-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.is-now .now-label::before { animation: pulse 1.6s infinite; }

/* Два зала рядом на компьютере, одним списком по времени на телефоне */
.by-hall { display: none; }
@media (min-width: 900px) {
  .by-time.has-halls { display: none; }
  .by-hall { display: grid; grid-template-columns: repeat(var(--halls, 2), 1fr); gap: 16px; }
  .by-hall .col { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; min-height: 80px; }
  .by-hall .col-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-weight: 700; border-bottom: 3px solid var(--hall); }
  .by-hall .col-head::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--hall); }
  .by-hall .entry .hall-tag { display: none; }
  .by-hall .free { color: var(--muted); padding: 14px 16px; margin: 0; }
}

.notice {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--r); margin-bottom: 14px;
  background: var(--today-soft); color: var(--today-ink); text-decoration: none; font-weight: 600;
  animation: rise .4s var(--ease);
}
.notice .i:last-child { margin-left: auto; }

.empty { text-align: center; padding: 34px 20px; }
.empty .badge-icon {
  display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--bg); color: var(--muted); margin-bottom: 12px;
}
.empty h2 { margin: 0 0 6px; font-size: 1.2rem; }
.empty p { margin: 0 auto 18px; color: var(--ink-2); max-width: 30em; }
.empty .actions { justify-content: center; }

/* -- переключатели и фильтры --------------------------------------------- */

.pager { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; flex-wrap: wrap; }
.pager .icon-btn { background: var(--surface); box-shadow: var(--shadow); color: var(--ink); }
.pager .label { font-weight: 700; font-size: 1.15rem; min-width: 0; }
.pager .grow { flex: 1; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--line); border-radius: 12px; margin-bottom: 16px; overflow-x: auto; }
.tabs a {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border-radius: 9px; text-decoration: none; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.pill { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 11px; background: var(--brand); color: var(--on-brand); font-size: .8rem; line-height: 22px; text-align: center; }

.filters { display: grid; gap: 10px; margin-bottom: 16px; }
.filters .search { position: relative; }
.filters .search .i { position: absolute; left: 14px; top: 15px; color: var(--muted); }
.filters .search .input { padding-left: 46px; }
.filters .selects { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.filters select.input { min-height: 48px; padding: 8px 12px; font-size: 1rem; }
.found { color: var(--muted); margin: 0 0 10px; }

/* -- неделя --------------------------------------------------------------- */

.week { display: flex; flex-direction: column; gap: 12px; }
.day-card { overflow: hidden; }
.day-card > header { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; }
.day-card > header a { text-decoration: none; display: flex; align-items: baseline; gap: 10px; flex: 1; }
.day-card .dname { font-weight: 700; font-size: 1.12rem; }
.day-card .ddate { color: var(--muted); }
.day-card.today { box-shadow: inset 0 4px 0 var(--today), var(--shadow); }
.day-card.past { opacity: .6; }
.day-card .empty-day { color: var(--muted); padding: 0 16px 16px; margin: 0; }
.today-tag { display: inline-block; padding: 1px 10px; border-radius: 999px; background: var(--today); color: #3b2600; font-size: .8rem; font-weight: 700; }
.show-past { width: 100%; }
@media (max-width: 899px) {
  .week:not(.with-past) .day-card.past { display: none; }
}
@media (min-width: 900px) {
  .show-past { display: none; }
  .week-table { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
  .week-table .whead, .week-table .wrow { display: grid; grid-template-columns: 150px repeat(var(--halls, 2), 1fr); }
  .week-table .whead { border-bottom: 2px solid var(--line-strong); }
  .week-table .whead > div { padding: 12px 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
  .week-table .whead .hall-1::before, .week-table .whead .hall-2::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--hall); }
  .week-table .wrow { border-top: 1px solid var(--line); }
  .week-table .wrow.today { background: color-mix(in srgb, var(--today-soft) 55%, var(--surface)); box-shadow: inset 5px 0 0 var(--today); }
  .week-table .wrow.past { opacity: .6; }
  .week-table .wday { padding: 14px 16px; }
  .week-table .wday a { text-decoration: none; display: block; }
  .week-table .wday b { display: block; font-size: 1.05rem; }
  .week-table .wday span { color: var(--muted); }
  .week-table .cell { border-left: 1px solid var(--line); min-height: 64px; padding: 0 0 6px; }
  .week-table .cell .entry { padding-right: 10px; grid-template-columns: 5px 6.4rem 1fr auto; }
  .week-table .cell .entry .hall-tag { display: none; }
  .week.mobile { display: none; }
}
@media (max-width: 899px) { .week-table { display: none; } }

/* Перетаскивание. Строка при этом не перекрашивается: на жёлтом "сегодня"
   белый фон взятой строки выглядел как чужой цвет */
[data-sort] { min-height: 12px; }
[data-sort] .entry { touch-action: pan-y; }
.drag-ghost { opacity: .4; }
.drag-chosen .entry, li.drag-chosen { outline: 2px dashed var(--hall, var(--focus)); outline-offset: -2px; border-radius: 8px; }
body.dragging [data-sort] { background: color-mix(in srgb, var(--focus) 5%, transparent); border-radius: 10px; }
.week-table .cell:empty { min-height: 64px; }

/* -- месяц ---------------------------------------------------------------- */

.month { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.month .mhead, .month .mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month .mhead div { padding: 10px 6px; text-align: center; font-weight: 700; color: var(--muted); font-size: .9rem; }
.month .mday {
  display: flex; flex-direction: column; gap: 4px; min-height: 76px; padding: 6px; min-width: 0;
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
  text-decoration: none; color: inherit; transition: background .15s;
}
.month .mday:nth-child(7n + 1) { border-left: 0; }
.month .mday:hover { background: var(--bg); }
.month .mday.other { color: var(--muted); background: color-mix(in srgb, var(--bg) 45%, var(--surface)); }
.month .num { font-weight: 700; font-size: 1rem; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
.month .mday.today .num { background: var(--today); color: #3b2600; }
.month .dots { display: flex; flex-wrap: wrap; gap: 4px; padding-left: 4px; }
.month .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--hall); }
.month .mini { display: none; }
@media (min-width: 900px) {
  .month .mday { min-height: 118px; padding: 8px; }
  .month .dots { display: none; }
  .month .mini { display: block; list-style: none; margin: 0; padding: 0; font-size: .86rem; line-height: 1.3; }
  .month .mini li { display: flex; gap: 6px; padding: 2px 0 2px 6px; border-left: 3px solid var(--hall); margin-bottom: 3px; overflow: hidden; min-width: 0; }
  .month .mini span { min-width: 0; }
  .month .mini b { font-variant-numeric: tabular-nums; flex: none; }
  .month .mini span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .month .more { color: var(--muted); font-size: .84rem; }
}
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 12px 2px 0; color: var(--ink-2); font-size: .95rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--hall, var(--today)); }

/* -- лента изменений ----------------------------------------------------- */

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.change { padding: 16px; animation: rise .35s var(--ease) both; }
.change header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.kind { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .88rem; font-weight: 700; }
.kind-добавлено { background: var(--ok-soft); color: var(--ok); }
.kind-изменено, .kind-перенесено, .kind-заменено { background: var(--warn-soft); color: var(--warn); }
.kind-удалено { background: var(--err-soft); color: var(--err); }
.change .where { font-weight: 700; }
.change .rows { display: flex; flex-direction: column; gap: 10px; }
.change .one { border-left: 4px solid var(--hall); padding-left: 12px; }
.change .one .line { font-size: 1.05rem; }
.change .one .line b { font-variant-numeric: tabular-nums; }
.diff { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 1rem; margin: 4px 0 0; }
.diff dt { color: var(--muted); }
.diff dd { margin: 0; }
.diff del { color: var(--err); text-decoration-thickness: 2px; background: var(--err-soft); padding: 0 4px; border-radius: 4px; }
.diff ins { color: var(--ok); text-decoration: none; background: var(--ok-soft); padding: 0 4px; border-radius: 4px; font-weight: 600; }
.diff .arrow { color: var(--muted); margin: 0 4px; }
.removed .line { text-decoration: line-through; color: var(--ink-2); }
.change footer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; color: var(--muted); font-size: .95rem; }
.change footer .grow { flex: 1; }
.change.cancelled .rows { opacity: .6; text-decoration: line-through; text-decoration-color: var(--muted); }
.cancel-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--bg); color: var(--ink-2); margin-top: 12px; }
.collapsed-rows summary { cursor: pointer; font-weight: 600; color: var(--ink-2); padding: 4px 0; }
.more-wrap { display: flex; justify-content: center; margin-top: 16px; }

/* -- люди ----------------------------------------------------------------- */

.people-list { list-style: none; margin: 0; padding: 0; }
.person-row {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px;
  background: none; border: 0; border-top: 1px solid var(--line); text-align: left; cursor: pointer;
}
.people-list li:first-child .person-row { border-top: 0; }
.person-row:hover { background: var(--bg); }
.avatar {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--hall-1-soft); color: var(--hall-1); font-weight: 700; font-size: 1rem;
}
.avatar.tone-1 { background: var(--hall-2-soft); color: var(--hall-2); }
.avatar.tone-2 { background: var(--today-soft); color: var(--today-ink); }
.avatar.tone-3 { background: var(--brand-soft); color: var(--brand); }
.avatar.lg { width: 64px; height: 64px; font-size: 1.3rem; }
.person-row .who { flex: 1; min-width: 0; }
.person-row .who b { display: block; font-size: 1.05rem; }
.person-row .who span { color: var(--ink-2); font-size: .95rem; }
.status { flex: none; font-size: .85rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.status-invited { background: var(--warn-soft); color: var(--warn); }
.status-blocked { background: var(--err-soft); color: var(--err); }
.status-pending { background: var(--hall-1-soft); color: var(--hall-1); }
.request { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.request:first-child { border-top: 0; }
.request .who { flex: 1 1 200px; }
.request .who span { display: block; color: var(--ink-2); }
.role-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.role-card h3 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.role-card h3 small { color: var(--muted); font-weight: 400; font-size: .95rem; }
.rights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rights li { display: flex; align-items: center; gap: 8px; }
.rights .yes { color: var(--ok); }
.rights .no { color: var(--muted); }
.roles-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.person-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.person-head b { display: block; font-size: 1.2rem; }
.person-head span { color: var(--ink-2); }
.new-role { padding: 14px; border-radius: 12px; background: var(--bg); display: flex; flex-direction: column; gap: 12px; animation: rise .25s var(--ease); }

/* -- ещё и профиль -------------------------------------------------------- */

.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list a, .menu-list button {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 10px 16px;
  text-decoration: none; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; cursor: pointer;
  font-size: 1.05rem; color: inherit;
}
.menu-list li:first-child > * { border-top: 0; }
.menu-list li:first-child > form > button { border-top: 0; }
.menu-list form { margin: 0; }
.menu-list a:hover, .menu-list button:hover { background: var(--bg); }
.menu-list .ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--bg); color: var(--ink-2); flex: none; }
.menu-list .txt { flex: 1; }
.menu-list .txt small { display: block; color: var(--muted); font-size: .9rem; }
.menu-list .danger { color: var(--err); }
.menu-list .go { color: var(--muted); }

/* -- помощь --------------------------------------------------------------- */

.help-list details { border-top: 1px solid var(--line); }
.help-list details:first-child { border-top: 0; }
.help-list summary {
  display: flex; align-items: center; gap: 12px; padding: 16px; cursor: pointer; font-weight: 600; font-size: 1.05rem; list-style: none;
}
.help-list summary::-webkit-details-marker { display: none; }
.help-list summary .i:last-child { margin-left: auto; transition: transform .2s var(--ease); color: var(--muted); }
.help-list details[open] summary .i:last-child { transform: rotate(180deg); }
.help-text { padding: 0 16px 16px 50px; color: var(--ink-2); }
.help-text p, .sheet-help p { margin: 0 0 10px; }
.sheet-help { color: var(--ink-2); font-size: 1.05rem; }

/* -- окно поверх страницы ------------------------------------------------- */

dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 100%;
  max-height: 92dvh; border-radius: 22px 22px 0 0;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
  flex-direction: column;
}
dialog.sheet[open] { display: flex; animation: sheet-up .32s var(--ease); }
dialog.sheet.closing { animation: sheet-down .22s ease-in forwards; }
dialog.sheet::backdrop { background: rgb(10 12 16 / .45); animation: fade .25s ease; }
.sheet-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 0; flex: none; }
#sheet-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.sheet-head { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 20px; flex: none; }
.sheet-head h2 { flex: 1; margin: 0; font-size: 1.3rem; line-height: 1.25; }
.sheet-body { overflow-y: auto; padding: 4px 20px calc(20px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.sheet-foot { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.sheet-foot .btn { flex: 1 1 auto; }
.sheet-loading { display: grid; place-items: center; min-height: 160px; color: var(--muted); }
@media (min-width: 700px) {
  dialog.sheet { margin: auto; width: 580px; max-height: 86dvh; border-radius: 20px; }
  dialog.sheet[open] { animation: pop .24s var(--ease); }
  dialog.sheet.closing { animation: pop-out .18s ease-in forwards; }
  .sheet-grab { display: none; }
  .sheet-head { padding-top: 14px; }
}
.sheet-page { max-width: 620px; margin: 16px auto; }
.lead { color: var(--ink-2); margin: 0 0 16px; }
.danger-zone { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.danger-zone h3 { margin: 0; font-size: 1rem; color: var(--muted); font-weight: 600; }

.compare { display: grid; gap: 10px; margin: 0 0 16px; }
.compare .side { padding: 12px 14px; border-radius: 12px; background: var(--bg); }
.compare .side h4 { margin: 0 0 6px; font-size: .92rem; color: var(--muted); }
.compare .side.after { background: var(--ok-soft); }
.compare .gone { color: var(--muted); font-style: italic; }
.compare-pair + .compare-pair { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

.link-box { display: flex; flex-direction: column; gap: 12px; }
.link-box .url { font-size: .95rem; word-break: break-all; padding: 14px; border-radius: 12px; background: var(--bg); border: 1.5px dashed var(--line-strong); user-select: all; }
.qr { display: grid; place-items: center; padding: 16px; background: #fff; border-radius: 12px; }
.qr svg, .qr img { width: 220px; height: 220px; }
.facts { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.facts li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); }
.facts .i { color: var(--ok); margin-top: 2px; }
.facts .i.warn { color: var(--warn); }

/* -- сообщение внизу экрана ---------------------------------------------- */

.toast {
  position: fixed; z-index: 60; left: var(--gutter); right: var(--gutter);
  bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  padding: 12px 8px 12px 16px; border-radius: 14px;
  background: #1f2329; color: #f5f6f8; box-shadow: var(--shadow-lg);
  animation: toast-in .35s var(--ease);
}
.toast.leaving { animation: toast-out .25s ease-in forwards; }
.toast > .i { flex: none; }
.toast.ok > .i { color: #6fdc98; }
.toast.warn > .i { color: #ffc857; }
.toast.err > .i { color: #ff8a80; }
.toast .text { flex: 1; font-size: 1rem; }
.toast form { margin: 0; }
.toast .undo { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 0; background: #3a404a; color: #fff; font-weight: 700; cursor: pointer; }
.toast .icon-btn { color: #c9ced6; width: 40px; height: 40px; }
.toast .icon-btn:hover { background: #333841; color: #fff; }
@media (min-width: 900px) { .toast { left: auto; right: 28px; bottom: 28px; max-width: 480px; } }

/* -- вход ------------------------------------------------------------------ */

.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--gutter); }
.gate .box { width: 100%; max-width: 420px; }
.gate .mark { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 18px; display: block; }
.gate h1 { margin: 0 0 6px; font-size: 1.8rem; line-height: 1.2; letter-spacing: -.015em; }
.gate .lead { margin-bottom: 26px; }
.gate .alt { margin-top: 24px; color: var(--ink-2); }
.gate .alt a { font-weight: 600; }
.gate .message-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface); color: var(--brand); margin-bottom: 16px; box-shadow: var(--shadow); }
.pw { position: relative; }
.pw .input { padding-right: 56px; }
.pw .icon-btn { position: absolute; right: 2px; top: 2px; }

.offline { position: sticky; top: 0; z-index: 40; margin: 0; padding: 10px 16px; text-align: center; background: var(--today); color: #3b2600; font-weight: 600; }

/* -- движение ------------------------------------------------------------- */

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pop-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* Плавный переход между страницами там, где браузер это умеет */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  @view-transition { navigation: none; }
}

.inline-help { margin: 0 0 16px; border-radius: 12px; background: var(--hall-1-soft); }
.inline-help summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 600; color: var(--hall-1); list-style: none; }
.inline-help summary::-webkit-details-marker { display: none; }
.inline-help div { padding: 0 14px 12px; color: var(--ink-2); }
.inline-help p { margin: 0 0 8px; }

/* Заголовок окна получает фокус ради экранного диктора, рамка ему не нужна */
#sheet-title:focus { outline: none; }
/* Главные кнопки окна всегда видны, даже если форма длиннее экрана */
.sheet-body .sheet-foot {
  position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); z-index: 2;
  margin: 0 -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
}
.filters .selects.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filters .selects.three .input { padding-right: 4px; text-overflow: ellipsis; }

/* -- тема и "Ещё" ---------------------------------------------------------- */

.theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--line); border-radius: 12px; border: 0; margin: 0; }
.theme-switch legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.theme-switch label { cursor: pointer; }
.theme-switch input { position: absolute; opacity: 0; pointer-events: none; }
.theme-switch span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border-radius: 9px; font-weight: 600; color: var(--ink-2); font-size: .95rem; text-align: center; line-height: 1.2; padding: 4px; }
.theme-switch input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.theme-switch input:focus-visible + span { outline: 3px solid var(--focus); }
.nav .theme-switch { margin: 6px 12px 10px; }
.nav .theme-switch span { font-size: .82rem; min-height: 36px; }
.nav .theme-label { padding: 0 12px; color: var(--muted); font-size: .85rem; font-weight: 600; }

.me-card { display: flex; align-items: center; gap: 14px; padding: 16px; text-decoration: none; }
.me-card b { display: block; font-size: 1.12rem; }
.me-card span { color: var(--ink-2); }
.me-card .go { margin-left: auto; color: var(--muted); }
.content > .card + .card { margin-top: 16px; }
.card-block { padding: 16px; }
.menu-list .txt { min-width: 0; }
.menu-list .txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
