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

   Для кого: артисты и администрация, 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;

  --travel: #6d28d9;
  --travel-soft: #f1ebfd;

  --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;
    --travel: #b79af7;
    --travel-soft: #2a2144;
    --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;
  --travel: #b79af7;
  --travel-soft: #2a2144;
  --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); }

/* Выбор, что за день: четыре большие кнопки, как у залов */
.kind-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; border: 0; padding: 0; margin: 0; }
.kind-pick legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.kind-pick label { cursor: pointer; }
.kind-pick input { position: absolute; opacity: 0; pointer-events: none; }
.kind-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;
}
.kind-pick .i { color: var(--mark); }
.kind-pick input:checked + span { border-color: var(--mark); background: var(--mark-soft); }
.kind-pick input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (min-width: 560px) { .kind-pick { grid-template-columns: repeat(4, 1fr); } }
/* Лишние поля прячутся по выбору: у выходного нет места и времени,
   начало концерта - только у концерта. Старый браузер покажет все поля */
.mark-form:has(input[name="kind"][value="off"]:checked) .not-off,
.mark-form:not(:has(input[name="kind"][value="concert"]:checked)) .only-concert { display: none; }

/* -- отметки на весь день ------------------------------------------------ */

/* Концерт - красный, цвет ансамбля; переезд - фиолетовый; выходной -
   серый. Цвет только подсказка: у каждой отметки ещё значок и подпись */
.mark-concert { --mark: var(--brand); --mark-soft: var(--brand-soft); }
.mark-travel { --mark: var(--travel); --mark-soft: var(--travel-soft); }
.mark-off { --mark: var(--muted); --mark-soft: color-mix(in srgb, var(--muted) 14%, var(--surface)); }
.mark-other { --mark: var(--ink-2); --mark-soft: color-mix(in srgb, var(--ink-2) 10%, var(--surface)); }

.marks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.mark {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  width: 100%; padding: 12px 16px; border-radius: var(--r); min-width: 0;
  background: var(--mark-soft); border: 0; border-left: 6px solid var(--mark);
  color: var(--ink); text-align: left; font: inherit;
}
.mark > .i:first-child { color: var(--mark); width: 26px; height: 26px; }
.mark-what { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.mark-title { font-weight: 700; font-size: 1.1rem; line-height: 1.3; }
.mark-place { font-weight: 600; }
.mark .meta { color: var(--ink-2); font-size: .98rem; margin-top: 2px; }
.mark .meta span + span::before { content: " · "; color: var(--muted); }
.mark .go { color: var(--muted); }
button.mark { cursor: pointer; }
button.mark:hover { background: color-mix(in srgb, var(--mark) 16%, var(--surface)); }
.mark.cancelled .mark-title, .mark.cancelled .meta { text-decoration: line-through; color: var(--muted); }
.mark-cancelled { margin-top: 4px; font-size: .88rem; font-weight: 700; color: var(--err); background: var(--err-soft); padding: 1px 8px; border-radius: 6px; }
.mark.compact { padding: 3px 6px; gap: 5px; border-left-width: 3px; border-radius: 6px; grid-template-columns: auto 1fr; }
.mark.compact > .i:first-child { width: 15px; height: 15px; }
.mark.compact { align-items: start; }
.mark.compact > .i:first-child { margin-top: 2px; }
.mark.compact .mark-title {
  font-size: .84rem; line-height: 1.25; max-width: 100%; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mark.compact .mark-what { overflow: hidden; }
.mark.compact .mark-cancelled { display: none; }
.mark-programs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -2px 0 2px 22px; font-size: .98rem; color: var(--ink-2); }
.mark-programs a { font-weight: 600; }
.day-card .day-marks { padding: 2px 12px 10px; }
.day-card .day-marks .marks { margin: 0; }

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

.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-table .wrow.has-marks .wday { grid-row: span 2; }
  .week-table .wmarks { grid-column: 2 / -1; padding: 10px 12px 4px; border-left: 1px solid var(--line); }
  .week-table .wmarks .marks { margin: 0; flex-direction: row; flex-wrap: wrap; }
  .week-table .wmarks .mark { flex: 1 1 280px; width: auto; padding: 8px 14px; }
  .week-table .wrow.off .cell { min-height: 24px; }
  .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; }
.month .mmarks { display: flex; flex-wrap: wrap; gap: 3px; }
@media (max-width: 899px) {
  /* На телефоне в клетке месяца места только на значок */
  .month .mmarks .mark { width: auto; padding: 3px; border-left-width: 0; }
  .month .mmarks .mark-what { display: none; }
}
@media (min-width: 900px) {
  .month .mmarks { flex-direction: column; flex-wrap: nowrap; }
  .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; }
}
/* Концерты программы, как шапка листка программы на доске */
.program-dates { padding: 14px 16px; margin-bottom: 16px; }
.program-dates h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 1.05rem; }
.program-dates h3 .i { color: var(--brand); }
.program-dates h3 small { color: var(--muted); font-weight: 400; }
.program-dates ul { list-style: none; margin: 0 0 10px; padding: 0; }
.program-dates li { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.program-dates li:first-child { border-top: 0; }
.program-dates li a { flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 10px 0; color: inherit; text-decoration: none; min-height: 48px; }
.program-dates li b { font-variant-numeric: tabular-nums; min-width: 5.5rem; }
.program-dates li.current b { color: var(--brand); }
.program-dates li.cancelled a > span:not(.mark-cancelled) { text-decoration: line-through; color: var(--muted); }
.program-dates .hint { margin: 0 0 10px; }
.struck { text-decoration: line-through; color: var(--muted); }

/* Месяц списком, как листок месяца на доске */
.mlist { overflow: hidden; }
.mlist .mline {
  display: grid; grid-template-columns: 60px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 10px 8px 0; border-top: 1px solid var(--line); min-height: 58px;
}
.mlist .mline:first-child { border-top: 0; }
.mlist .mdate { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: inherit; line-height: 1.15; }
.mlist .mdate b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.mlist .mdate span { color: var(--muted); font-size: .9rem; }
.mlist .weekend .mdate span { color: var(--brand); font-weight: 600; }
.mlist .mline.today { background: color-mix(in srgb, var(--today-soft) 55%, var(--surface)); box-shadow: inset 5px 0 0 var(--today); }
.mlist .mline.past { opacity: .6; }
.mlist .mline-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mlist .mark { padding: 8px 12px; }
.mlist .mline-rows { color: var(--ink-2); font-size: .95rem; text-decoration: none; }
.mlist .mline-rows:hover { text-decoration: underline; }

/* Переключатель "Сеткой / Списком" */
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; }
.seg .btn:first-child { border-radius: 10px 0 0 10px; }
.seg .btn:last-child { border-radius: 0 10px 10px 0; border-left: 0; }
.seg .btn.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.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, var(--mark)); padding-left: 12px; }
.change .one .line .i { color: var(--mark); vertical-align: -3px; }
.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; }
.card-title { margin: 0 0 10px; font-size: 1.05rem; }
.section > .card + .card { margin-top: 12px; }
.menu-list .txt { min-width: 0; }
.menu-list .txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* -- кто вызван -------------------------------------------------------------- */

.entry .called { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: .92rem; margin-top: 3px; }
.entry .mine-tag {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 4px;
  padding: 1px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .85rem; font-weight: 700;
}
.entry.mine .title { color: var(--ink); }
body.only-mine .entry:not(.mine) { display: none; }
.only-mine-switch { margin: 0 0 12px; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); font-weight: 600; transition: background .15s, border-color .15s;
}
.chip input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.chip input:checked + span::before { content: "\2713"; margin-right: 6px; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip input:disabled + span { opacity: .45; }
.picked { display: flex; flex-wrap: wrap; gap: 8px; }
.picked:empty { display: none; }
.picked-person {
  display: inline-flex; align-items: center; gap: 2px; padding-left: 14px; border-radius: 999px;
  background: var(--hall-1-soft); font-weight: 600; animation: rise .2s var(--ease);
}
.picked-person .icon-btn { width: 40px; height: 40px; }
.person-search { position: relative; }
/* Все люди сразу, прокручиваемым списком: не надо вспоминать фамилию */
.people-pick {
  list-style: none; margin: 0; padding: 4px; max-height: 320px; overflow-y: auto; overscroll-behavior: contain;
  border: 1.5px solid var(--line-strong); border-radius: 12px;
}
.pick-row {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 52px; padding: 6px 10px; border-radius: 8px; cursor: pointer; font-weight: 400;
}
.pick-row:hover { background: var(--bg); }
.pick-row input { width: 22px; height: 22px; accent-color: var(--brand); margin: 0; }
.pick-text { display: flex; flex-direction: column; min-width: 0; }
.pick-name { font-weight: 600; }
.pick-via { color: var(--ok); font-size: .88rem; }
.pick-row small { color: var(--muted); font-size: .9rem; }
.people-pick li.covered .pick-name { color: var(--ink-2); }
.pick-none { padding: 12px; color: var(--muted); }

.busy-all > summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.busy-all > summary::-webkit-details-marker { display: none; }
.busy-all > summary > .i:last-child { margin-left: 4px; color: var(--muted); transition: transform .2s var(--ease); }
.busy-all[open] > summary > .i:last-child { transform: rotate(180deg); }
.busy-all > summary .count-muted { margin-left: auto; white-space: nowrap; }
.busy-head { display: grid; gap: 2px; min-width: 0; }
.busy-head small { color: var(--muted); font-size: .9rem; }
.busy-all > .busy { border-top: 1px solid var(--line); }
.busy-away { margin: 0; padding: 0 16px 14px; color: var(--muted); font-size: .95rem; }
.busy details { border-top: 1px solid var(--line); }
.busy details:first-child { border-top: 0; }
.busy summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; font-size: 1.05rem; }
.busy summary::-webkit-details-marker { display: none; }
.busy summary .i:last-child { margin-left: auto; color: var(--muted); transition: transform .2s var(--ease); }
.busy details[open] summary .i:last-child { transform: rotate(180deg); }
.count-muted { color: var(--muted); }
.busy-list { list-style: none; margin: 0; padding: 0 16px 12px; }
.busy-list li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); }
.busy-list li.me { background: var(--brand-soft); margin: 0 -16px; padding: 8px 16px; }
.busy-list .name { font-weight: 600; }
.busy-list .when { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-2); font-size: .95rem; }
.busy-list .when span { display: inline-flex; gap: 6px; align-items: center; }
.busy-list .when span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--hall); }
@media (min-width: 900px) {
  .busy-list li { grid-template-columns: 16rem 1fr; align-items: baseline; }
}

.import-list { list-style: none; margin: 0 0 12px; padding: 0; box-shadow: none; border: 1px solid var(--line); }
.import-list li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.import-list li:first-child { border-top: 0; }
.import-list li > .i { color: var(--ok); }
.import-list li.skip > .i { color: var(--warn); }
.import-list li.skip .who { opacity: .6; }
.import-list .who { flex: 1; min-width: 0; }
.import-list .who b { display: block; }
.import-list .who span { color: var(--ink-2); font-size: .95rem; }
textarea.input { min-height: 140px; resize: vertical; font: inherit; }

/* -- дни, когда я нужен ------------------------------------------------------
   Фон тем насыщеннее, чем дольше человек занят. Цвет - только подсказка:
   рядом всегда подпись "ты нужен 4 ч" */

.load-1 { --load: 6%; }
.load-2 { --load: 14%; }
.load-3 { --load: 24%; }
.load-4 { --load: 36%; }
.day-card[class*="load-"]:not(.load-0),
.week-table .wrow[class*="load-"]:not(.load-0),
.month .mday[class*="load-"]:not(.load-0) {
  background: color-mix(in srgb, var(--brand) var(--load), var(--surface));
}
.month .mday.other[class*="load-"]:not(.load-0) { background: color-mix(in srgb, var(--brand) calc(var(--load) / 2), var(--surface)); }
.me-tag {
  display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 10px; line-height: 1.3;
  background: var(--brand); color: var(--on-brand); font-size: .8rem; font-weight: 700;
}
.day-card .me-tag { margin-top: 0; }
.month .mtop { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.month .me-time { font-size: .72rem; font-weight: 700; color: var(--brand); white-space: nowrap; overflow: hidden; }
.legend .legend-me::before { background: var(--brand); }
@media (max-width: 899px) {
  .month .me-time { display: none; }
}
.day-card > header { flex-wrap: wrap; }
.day-card .me-tag { white-space: nowrap; }

/* Окно отмены: сначала что именно поменяется, потом строка целиком */
.will-change { padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--warn); background: var(--warn-soft); margin-bottom: 10px; }
.will-change h4 { margin: 0 0 6px; font-size: .92rem; color: var(--warn); }
.will-change .diff { margin: 0; }

/* -- бот в MAX ------------------------------------------------------------ */

.qr-big { margin: 4px 0 16px; }
.qr-big svg { width: 240px; height: 240px; }
.status-line { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; }
.status-line .i { color: var(--ok); margin-top: 2px; }
.max-options { margin: 0; }
.switch-row {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 0; border: 0;
  border-top: 1px solid var(--line); background: none; text-align: left; cursor: pointer;
}
.switch-row span:first-child { flex: 1; }
.switch-row small { display: block; color: var(--muted); font-size: .92rem; }
.switch {
  flex: none; position: relative; width: 52px; height: 32px; border-radius: 16px; background: var(--line-strong);
  transition: background .2s var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow); transition: transform .2s var(--ease);
}
.switch-row[aria-pressed="true"] .switch { background: var(--ok); }
.switch-row[aria-pressed="true"] .switch::after { transform: translateX(20px); }
.max-dot { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 600; }
.status-nomax { background: var(--bg); color: var(--muted); }

/* -- состояние бота -------------------------------------------------------- */

.status-line.warn .i { color: var(--warn); }
.bot-state .status-line { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.stats b { display: block; font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { color: var(--ink-2); }

/* -- тренажёр бота: похоже на чат MAX -------------------------------------- */

.sim { display: grid; gap: 16px; }
@media (min-width: 900px) { .sim { grid-template-columns: minmax(0, 440px) 1fr; align-items: start; } }
.sim-phone {
  display: flex; flex-direction: column; height: min(78dvh, 760px); border-radius: 22px; overflow: hidden;
  background: #e9edf2; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
:root[data-theme="dark"] .sim-phone { background: #0b0d11; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sim-phone { background: #0b0d11; } }
.sim-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sim-head small { display: block; color: var(--muted); font-size: .85rem; }
.sim-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; }
.sim-log { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.sim-empty { color: var(--muted); text-align: center; margin: auto 12px; }
.msg { display: flex; flex-direction: column; max-width: 88%; animation: rise .25s var(--ease); }
.msg.me { align-self: flex-end; }
.msg.bot { align-self: flex-start; }
.bubble { padding: 10px 12px; border-radius: 16px; background: var(--surface); font-size: .98rem; line-height: 1.45; box-shadow: var(--shadow); }
.msg.me .bubble { background: var(--hall-1); color: #fff; border-bottom-right-radius: 6px; }
.msg.bot .bubble { border-bottom-left-radius: 6px; }
.bubble del { color: var(--err); }
.bubble mark { background: none; color: var(--err); font-weight: 700; }
.kb { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.kb-row { display: flex; gap: 4px; }
.kb-btn {
  flex: 1; min-height: 40px; padding: 6px 8px; border-radius: 10px; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--surface) 80%, var(--hall-1)); color: var(--hall-1); font: inherit; font-size: .9rem;
  font-weight: 600; text-align: center; text-decoration: none; display: flex; align-items: center; justify-content: center;
}
.kb-btn:hover { background: var(--hall-1-soft); }
.sim-note { margin: 0 12px 8px; padding: 8px 12px; border-radius: 10px; background: #1f2329; color: #fff; font-size: .92rem; animation: toast-in .3s var(--ease); }
.sim-input { display: flex; gap: 8px; padding: 10px; background: var(--surface); border-top: 1px solid var(--line); }
.sim-input .input { min-height: 44px; }
.sim-side { display: flex; flex-direction: column; gap: 12px; }
.sim-side h2 { margin: 0 0 6px; }
.sim-actions { display: grid; gap: 8px; }
.sim-side .msg { max-width: 100%; margin-bottom: 10px; }

/* -- репертуар: номера, составы, программы ----------------------------------- */

.seg { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.seg a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink-2); text-decoration: none; font-weight: 600;
}
.seg a[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.seg a[aria-current="page"] .count-muted { color: inherit; opacity: .75; }

/* Выбор одного из нескольких: состав, основной или второй */
.seg-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.seg-pick legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
.seg-pick label { flex: 1 1 140px; }
.seg-pick input { position: absolute; opacity: 0; }
.seg-pick span {
  display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 12px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); background: var(--surface); font-weight: 600; text-align: center; cursor: pointer;
}
.seg-pick input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.seg-pick input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.num-avatar { background: var(--brand-soft); color: var(--brand); }
.status-mine { background: var(--brand-soft); color: var(--brand); }
.status-away { background: var(--warn-soft); color: var(--warn); }
.person-row.is-past { opacity: .65; }
a.person-row { color: inherit; text-decoration: none; }
.person-row .who span { display: block; }
.number-note { display: flex; gap: 8px; align-items: flex-start; }
.number-note .i { margin-top: 4px; flex: none; color: var(--muted); }
.free { color: var(--muted); padding: 10px 16px; margin: 0; }
.desktop-hint { display: none; }
.hall-dot.hall-1 { color: var(--hall-1); }
.hall-dot.hall-2 { color: var(--hall-2); }

/* Составы: основной, второй, вводы. На телефоне друг под другом */
.cast-layout { display: grid; gap: 14px; align-items: start; }
.cast-board { display: grid; gap: 14px; }
.cast-line { padding-bottom: 8px; }
.cast-line header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px 16px 6px; }
.cast-line h3 { margin: 0; font-size: 1.05rem; }
.cast-line header small { color: var(--muted); font-weight: 700; }
.cast-line.line-main { border-top: 4px solid var(--brand); }
.cast-line.line-second { border-top: 4px solid var(--hall-1); }
.cast-line.line-intro { border-top: 4px solid var(--today); }
.cast-line > .btn { margin: 4px 12px 0; width: calc(100% - 24px); }
.cast-list { list-style: none; margin: 0; padding: 0; min-height: 8px; }
.member-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; border: 0; background: none;
  text-align: left; color: inherit; font: inherit;
}
button.member-row { cursor: pointer; }
button.member-row:hover { background: var(--bg); }
.member-row .avatar { width: 38px; height: 38px; font-size: .9rem; }
.member-row .who { flex: 1; min-width: 0; }
.member-row .who b { display: block; font-weight: 600; }
.member-row .who span { display: block; color: var(--ink-2); font-size: .92rem; }
.member-row .me-tag { margin-top: 0; }
.member-row .who .status { display: inline-block; margin-top: 4px; }
.member-row.me .who b { color: var(--brand); }
.member-row .go { color: var(--muted); }
.cast-base { display: none; }

/* Программа концерта: номера по порядку */
/* Номеров, сколько идёт, конец - в одну строку даже на телефоне:
   столбиком они занимали весь первый экран */
.program-stats { margin: 0 0 14px; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); padding: 14px 16px; }
.program-stats b { font-size: 1.5rem; }
.program-stats span { font-size: .92rem; }
@media (min-width: 900px) { .program-stats b { font-size: 2rem; } }
.warn-notice { background: var(--warn-soft); color: var(--warn); }
.warn-notice .solve-btn { margin-left: auto; flex: none; }
@media (max-width: 600px) { .warn-notice { flex-wrap: wrap; } .warn-notice .solve-btn { margin-left: 0; } }
.solve-sum { margin: 0 0 12px; font-weight: 600; }
.solve-steps { margin: 0 0 18px; padding-left: 24px; }
.solve-steps li { padding: 6px 0; }
.solve-head { font-size: 1rem; margin: 0 0 8px; }
.solve-left { margin: 0 0 10px; padding-left: 20px; color: var(--warn); }
.solve-left li { padding: 4px 0; }
.slot-list { list-style: none; margin: 0; padding: 0; }
.slot + .slot { border-top: 1px solid var(--line); }
.slot-row {
  display: flex; align-items: flex-start; gap: 14px; width: 100%; padding: 12px 16px; border: 0; background: none;
  text-align: left; color: inherit; font: inherit;
}
button.slot-row { cursor: pointer; }
button.slot-row:hover { background: var(--bg); }
.slot-num {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg); font-weight: 700; font-variant-numeric: tabular-nums;
}
.slot-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.slot-main b { font-size: 1.05rem; }
.slot-meta { color: var(--ink-2); font-size: .95rem; }
.slot-meta span + span::before { content: " · "; color: var(--muted); }
.slot-warn { display: flex; gap: 6px; align-items: flex-start; color: var(--warn); font-size: .92rem; }
.slot-warn .i { flex: none; margin-top: 3px; }
.slot-main .mine-tag {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .85rem; font-weight: 700;
}
.slot.is-break { background: var(--bg); }
.slot.is-break .slot-num { background: var(--surface); color: var(--muted); }
.slot.is-break .slot-main b { font-weight: 600; color: var(--ink-2); }
.slot-row .go { color: var(--muted); margin-top: 4px; }
.drag-hint { margin: 8px 2px 0; }
.drop-zone { display: none; }
.add-list .btn { flex: none; }
.added { flex: none; color: var(--ok); font-weight: 700; font-size: .92rem; }
.cast-offer { margin: 8px 0 0; }

@media (min-width: 900px) {
  .desktop-hint { display: inline; }
  .cast-layout.with-base { grid-template-columns: minmax(0, 1fr) 300px; }
  .cast-base { display: block; position: sticky; top: 16px; padding: 14px 0 8px; max-height: calc(100dvh - 32px); overflow: auto; }
  .cast-base h3 { margin: 0 16px 2px; font-size: 1.05rem; }
  .cast-base .hint { margin: 0 16px 10px; color: var(--muted); font-size: .92rem; }
  .cast-base .search { position: relative; display: block; margin: 0 12px 8px; }
  .cast-base .search .i { position: absolute; left: 14px; top: 15px; color: var(--muted); }
  .cast-base .search .input { padding-left: 44px; }
  .cast-base .member-row { cursor: grab; }
  .cast-base .member-row:hover { background: var(--bg); }
  .drop-zone {
    display: block; min-height: 90px; border: 2px dashed var(--line-strong); border-radius: var(--r); margin-top: 12px;
  }
  .drop-zone:empty::after { content: "Перетащи номер сюда"; display: block; padding: 32px; text-align: center; color: var(--muted); }
  body.dragging .cast-list[data-cast-sort] { min-height: 52px; background: var(--bg); border-radius: 10px; }
}
@media (min-width: 1280px) {
  .cast-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
