/* ==========================================================================
   Шахматка по неделе — стили
   Планировщик мероприятий строительного контроля
   ========================================================================== */

/* ── Reset & tokens ───────────────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --navy: #152a4e;
  --navy-900: #0f2039;
  --navy-950: #0a1729;
  --ink: #182236;
  --ink-2: #33405a;
  --muted: #6a7a92;
  --muted-2: #8d9ab0;
  --line: #dde4ee;
  --line-2: #e9eef5;
  --bg: #e8ecf2;
  --card: #fff;
  --blue: #3a6fa8;
  --teal: #2b8b83;
  --orange: #ef8a2b;
  --type-walk: #3a6fa8;
  --type-staff: #2b8b83;
  --type-vks: #e8852a;
  --font-head: 'Roboto Condensed', 'Arial Narrow', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { font-size: 16px; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.i {
  width: 1.1em;
  height: 1.1em;
  display: inline-block;
  vertical-align: -0.16em;
  flex: none;
}

:where(button, a, input, textarea, summary):focus-visible {
  outline: 2px solid #3a6fa8;
  outline-offset: 2px;
}

/* ── Toolbar ──────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid #dbe2ec;
}

.topbar__in {
  max-width: 98rem;
  margin: 0 auto;
  padding: 0.62rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  flex: none;
}

.brand__mark {
  width: 3.4rem;
  height: 2.5rem;
  flex: none;
  padding: 0.2rem;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  box-shadow: 0 2px 6px -2px rgba(15, 32, 57, 0.18);
}

.brand__mark img {
  display: block;
  width: 2.95rem;
  height: auto;
}

.brand__text strong {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.05;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand__text span {
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.18rem;
}

.weeknav {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.22rem 0.22rem 0.22rem 0.32rem;
  box-shadow: 0 1px 2px rgba(16, 32, 64, 0.04);
}

.weeknav__label {
  min-width: 15.5rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #243049;
  white-space: nowrap;
  padding: 0 0.3rem;
}

.weeknav__label b { font-weight: 700; }

.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.iconbtn {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: #43526c;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.iconbtn:hover { background: #eef2f8; color: #16294c; }
.iconbtn .i { width: 1.05rem; height: 1.05rem; }

.iconbtn--bordered {
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 32, 64, 0.04);
}

.iconbtn--bordered:hover { background: #f4f7fb; border-color: #cfd9e8; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.56rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: #fff;
  color: #243049;
  font-family: var(--font-body);
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn:hover { background: #f4f7fb; }
.btn:active { transform: translateY(1px); }
.btn .i { width: 1.02rem; height: 1.02rem; }

.btn--primary {
  background: linear-gradient(160deg, #1e3d6b, #15294c);
  border-color: #15294c;
  color: #fff;
  box-shadow: 0 6px 16px -10px rgba(18, 36, 68, 0.9);
}

.btn--primary:hover { background: linear-gradient(160deg, #254a80, #19335c); }

.btn--today { background: #f2f5fa; border-color: #e3e9f2; color: #33405a; }
.btn--today:hover { background: #e9eff7; }
.btn--today[disabled] { opacity: 0.55; cursor: default; transform: none; }

.btn--danger { color: #b4342d; border-color: #f0d6d3; background: #fff; }
.btn--danger:hover { background: #fdf1f0; border-color: #e8bcb8; }

.btn--print { color: #33405a; }

/* Dropdown menu */
.menu { position: relative; }

.menu__list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  min-width: 16.5rem;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: 0 24px 48px -24px rgba(12, 25, 48, 0.5), 0 2px 8px rgba(12, 25, 48, 0.08);
  z-index: 70;
}

.menu__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 0;
  border-radius: 0.5rem;
  background: none;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.2;
  color: #243049;
  text-align: left;
  cursor: pointer;
}

.menu__item:hover { background: #f1f5fa; }
.menu__item .i { width: 1.05rem; height: 1.05rem; color: #6d7d96; }
.menu__sep { height: 1px; background: var(--line-2); margin: 0.3rem 0.25rem; }

/* ── Page / poster shell ──────────────────────────────────────────────────── */
.wrap {
  max-width: 98rem;
  margin: 0 auto;
  padding: 1.1rem 1.25rem 1.6rem;
}

.poster {
  background: #fff;
  border: 1px solid #d9e1ec;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 34px 60px -44px rgba(13, 27, 54, 0.6), 0 2px 6px rgba(13, 27, 54, 0.05);
}

/* ── Poster header ────────────────────────────────────────────────────────── */
.poster__head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.15rem 1.35rem;
  background: linear-gradient(105deg, #172c51 0%, #112340 55%, #0d1c35 100%);
  color: #fff;
}

.poster__head::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(75% 130% at 88% 0%, rgba(96, 146, 216, 0.26), transparent 62%);
  pointer-events: none;
}

.poster__logo {
  position: relative;
  z-index: 1;
  width: 9.4rem;
  height: 5.8rem;
  flex: none;
  padding: 0.5rem;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 0.55rem;
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.75);
}

.poster__logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.poster__titles { position: relative; z-index: 1; min-width: 0; }

.poster__titles h1 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 2.55rem;
  line-height: 1;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.poster__titles p {
  margin: 0.42rem 0 0;
  font-size: 1.05rem;
  font-weight: 400;
  color: #c3d1e8;
  letter-spacing: 0.01em;
}

.poster__meta {
  position: relative;
  z-index: 1;
  margin-left: auto;
  flex: none;
  min-width: 14.5rem;
  border: 1.5px solid rgba(255, 255, 255, 0.42);
  border-radius: 0.5rem;
  text-align: center;
}

.poster__meta div {
  padding: 0.5rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #eaf1fd;
}

.poster__meta div + div {
  border-top: 1.5px solid rgba(255, 255, 255, 0.42);
  font-weight: 500;
  color: #c2d0e7;
}

/* ── Week grid ────────────────────────────────────────────────────────────── */
.week {
  --days: 5;
  display: grid;
  grid-template-columns: repeat(var(--days), minmax(0, 1fr));
  background: #eef1f6;
  padding: 0.85rem 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f1;
}

.day {
  min-width: 0;
  min-height: 15rem;
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.85rem 0.85rem;
  border-right: 1px solid #e2e8f1;
  transition: background 0.12s, box-shadow 0.12s;
}

.day:last-child { border-right: 0; }

.day.is-drop {
  background: #e5edf9;
  box-shadow: inset 0 0 0 2px #a7bfe0;
  border-radius: 0.4rem;
}

.day__head {
  padding-bottom: 0.55rem;
  margin-bottom: 0.7rem;
  border-bottom: 1.5px solid #d9e1ed;
}

.day.is-today .day__head { border-bottom-color: #14294c; }

.day__name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #16294c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day__meta {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #7c8aa2;
}

.day__date::before { content: "·"; margin-right: 0.42rem; opacity: 0.7; }

.day__today {
  padding: 0.08rem 0.42rem;
  border-radius: 99px;
  background: #14294c;
  color: #fff;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

.day__plus {
  margin-left: auto;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #d8e1ee;
  border-radius: 0.35rem;
  background: #fff;
  color: #516481;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.day__plus:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.day__plus .i { width: 0.85rem; height: 0.85rem; }

.day__list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 3rem;
}

.day__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.95rem 0.5rem;
  border: 1.5px dashed #d5deea;
  border-radius: 0.5rem;
  background: transparent;
  color: #93a1b6;
  font-family: var(--font-body);
  font-size: 0.77rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.day__empty:hover { border-color: #a9bcd6; color: #16294c; background: #f7f9fc; }
.day__empty .i { width: 1rem; height: 1rem; }

/* ── Event card ───────────────────────────────────────────────────────────── */
.ev {
  --c: var(--blue);
  position: relative;
  background: #fff;
  border: 1px solid #e0e7f0;
  border-radius: 0.5rem;
  padding: 0.55rem 0.6rem 0.6rem;
  box-shadow: 0 1px 2px rgba(16, 32, 64, 0.045);
  cursor: pointer;
  transition: box-shadow 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.ev:hover,
.ev:focus-visible {
  border-color: #cfd9e8;
  box-shadow: 0 12px 24px -16px rgba(13, 30, 60, 0.55);
  transform: translateY(-1px);
}

.ev.is-dragging { opacity: 0.35; transform: none; }
.ev--walk { --c: var(--type-walk); }
.ev--staff { --c: var(--type-staff); }
.ev--vks { --c: var(--type-vks); }

.ev__time {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.87rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--c);
  padding-right: 3.4rem;
}

.ev__time .i { width: 0.98rem; height: 0.98rem; }
.ev__time .ev__sep { opacity: 0.55; }

.ev__person {
  display: inline-block;
  max-width: 100%;
  margin: 0.42rem 0 0.4rem;
  padding: 0.22rem 0.45rem 0.24rem;
  border-radius: 0.28rem;
  background: var(--c);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1.15;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.ev__desc {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.34;
  color: #33405a;
  overflow-wrap: anywhere;
}

.ev__actions {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  display: flex;
  gap: 0.14rem;
  padding: 0.1rem;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 3px 10px -3px rgba(13, 30, 60, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.15rem);
  transition: opacity 0.15s, transform 0.15s;
}

.ev:hover .ev__actions,
.ev:focus-within .ev__actions {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.ev__actions button {
  width: 1.3rem;
  height: 1.3rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0.3rem;
  background: none;
  color: #5a6b85;
  cursor: pointer;
}

.ev__actions button:hover { background: #eef2f8; color: #16294c; }
.ev__actions button[data-act="del"]:hover { background: #fdeeed; color: #b4342d; }
.ev__actions .i { width: 0.9rem; height: 0.9rem; }

/* ── Poster footer ────────────────────────────────────────────────────────── */
.poster__foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18.5rem;
  background: #fff;
}

.foot { padding: 0.95rem 1.1rem; }
.foot + .foot { border-left: 1px solid #e6ecf4; }

.foot--legend {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
}

.foot__title {
  margin: 0 0 0.6rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #16294c;
}

.legend {
  display: flex;
  align-items: center;
  width: 100%;
}

.legend__item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 0.9rem;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.legend__item:first-child { padding-left: 0; }
.legend__item + .legend__item { border-left: 1px solid #e6ecf4; }

.legend__dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--c);
  flex: none;
}

.legend__count {
  min-width: 1.55rem;
  padding: 0.08rem 0.42rem;
  border-radius: 99px;
  background: #f1f5f9;
  color: #8493a9;
  font-size: 0.73rem;
  font-weight: 700;
  text-align: center;
}

.foot--total { padding: 0; }

.total {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0.9rem 1rem;
  text-align: center;
  background: linear-gradient(150deg, #1a3158, #0f2039 72%);
  color: #fff;
}

.total__label {
  padding-left: 0.26em;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #c9d6ec;
}

.total__num {
  margin: 0.18rem 0 0.08rem;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 4.1rem;
  line-height: 0.95;
  letter-spacing: -0.01em;
}

.total__cap {
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.total__sub {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: #a4b6d3;
}

/* ── Hint line ────────────────────────────────────────────────────────────── */
.hint {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin: 1rem 0.3rem 0;
  font-size: 0.74rem;
  color: #8592a6;
}

.hint kbd {
  font: inherit;
  font-size: 0.7rem;
  padding: 0.04rem 0.3rem;
  border: 1px solid #d5deea;
  border-bottom-width: 2px;
  border-radius: 0.25rem;
  background: #fff;
  color: #4a5a75;
}

/* ── Dialogs ──────────────────────────────────────────────────────────────── */
.modal {
  width: calc(100vw - 2rem);
  max-width: 38rem;
  padding: 0;
  border: 0;
  border-radius: 1rem;
  background: transparent;
  box-shadow: 0 44px 90px -34px rgba(9, 20, 42, 0.75);
  color: var(--ink);
}

.modal::backdrop {
  background: rgba(9, 19, 38, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.modal[open] { animation: pop 0.18s ease-out; }
.modal--narrow { max-width: 31rem; }

@keyframes pop {
  from { opacity: 0; transform: translateY(0.7rem) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.editor {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 54rem);
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
}

.editor__head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.15rem 0.9rem;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
}

.editor__eyebrow {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7f8da4;
}

.editor__title {
  margin-top: 0.18rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #16294c;
}

.editor__head .iconbtn { margin-left: auto; background: #f2f5fa; }

.editor__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
  padding: 1rem 1.15rem 1.1rem;
  overflow: auto;
}

.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.field--full { grid-column: 1 / -1; }

.field__label {
  font-size: 0.71rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6c7b93;
}

.input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1.5px solid #dde4ee;
  border-radius: 0.55rem;
  background: #f8fafc;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.3;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.input:focus {
  outline: none;
  border-color: #5b82b8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(70, 110, 170, 0.15);
}

.input.is-invalid {
  border-color: #c9554c;
  box-shadow: 0 0 0 3px rgba(195, 70, 60, 0.12);
}

.input--area { min-height: 4.4rem; resize: vertical; line-height: 1.4; }

.field__error { font-size: 0.72rem; font-weight: 600; color: #b4342d; }

.seg {
  display: flex;
  gap: 0.25rem;
  padding: 0.22rem;
  border: 1.5px solid #e1e8f2;
  border-radius: 0.6rem;
  background: #f3f6fa;
}

.seg__btn {
  flex: 1;
  padding: 0.42rem 0.3rem;
  border: 0;
  border-radius: 0.42rem;
  background: transparent;
  color: #5a6b85;
  font-family: var(--font-body);
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.seg__btn:hover { background: #e9eff7; color: #16294c; }
.seg__btn.is-active { color: #fff; box-shadow: 0 3px 8px -4px rgba(13, 30, 60, 0.5); }
.seg__btn.is-active[data-type="walk"] { background: var(--type-walk); }
.seg__btn.is-active[data-type="staff"] { background: var(--type-staff); }
.seg__btn.is-active[data-type="vks"] { background: var(--type-vks); }

.seg--days { gap: 0.18rem; padding: 0.25rem; }
.seg--days .seg__btn { padding: 0.42rem 0.1rem; font-size: 0.75rem; letter-spacing: 0.02em; }
.seg--days .seg__btn.is-active { background: var(--navy); }

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.7rem;
  border: 1.5px solid #e3e9f2;
  border-radius: 0.6rem;
  background: #f8fafc;
  font-size: 0.85rem;
  color: var(--ink-2);
  cursor: pointer;
}

.check input { width: 1rem; height: 1rem; accent-color: #152a4e; }

.editor__foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--line-2);
  background: #fbfcfe;
}

.editor__spacer { flex: 1; }

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.6rem 0.75rem 0.6rem 1rem;
  border-radius: 0.7rem;
  background: #0f2039;
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 20px 44px -18px rgba(9, 20, 42, 0.75);
  opacity: 0;
  transform: translate(-50%, 0.6rem);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

.toast__action {
  padding: 0.3rem 0.6rem;
  border: 0;
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.14);
  color: #cfe0ff;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.toast__action:hover { background: rgba(255, 255, 255, 0.24); color: #fff; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media screen and (max-width: 1320px) {
  html { font-size: 15.4px; }
  .weeknav__label { min-width: 13.5rem; }
}

@media screen and (max-width: 1120px) {
  html { font-size: 14.6px; }
  .poster__titles h1 { font-size: 2.2rem; }
  .weeknav__label { min-width: 11.5rem; font-size: 0.8rem; }
  .brand__text span { display: none; }
}

@media screen and (max-width: 900px) {
  html { font-size: 15px; }

  .topbar__in { gap: 0.6rem; padding: 0.55rem 0.8rem; }
  .weeknav { order: 3; width: 100%; justify-content: space-between; }
  .weeknav__label { flex: 1; min-width: 0; font-size: 0.8rem; }
  .topbar__actions { gap: 0.4rem; }
  .btn--primary span { display: none; }
  .btn--primary { padding: 0.56rem 0.65rem; }
  .btn--print span { display: none; }
  .btn--print { padding: 0.56rem 0.65rem; }

  .wrap { padding: 0.75rem 0.6rem 1.2rem; }
  .poster { border-radius: 0.8rem; }
  .poster__head { flex-wrap: wrap; gap: 0.8rem; padding: 0.9rem 1rem; }
  .poster__titles { flex: 1; }
  .poster__titles h1 { font-size: 1.8rem; }
  .poster__titles p { font-size: 0.9rem; margin-top: 0.3rem; }
  .poster__logo { width: 6.8rem; height: 4.2rem; padding: 0.35rem; border-radius: 0.45rem; }
  .poster__meta { margin-left: 0; width: 100%; min-width: 0; }
  .poster__meta div { padding: 0.45rem; font-size: 0.72rem; }

  .week { grid-template-columns: 1fr; padding: 0.6rem; }
  .day { padding: 0.55rem 0.5rem 0.8rem; border-right: 0; border-bottom: 1px solid #e2e8f1; }
  .day:last-child { border-bottom: 0; }
  .day__name { font-size: 1.15rem; }
  .day__plus { width: 1.9rem; height: 1.9rem; }
  .day__plus .i { width: 1rem; height: 1rem; }

  .poster__foot { grid-template-columns: 1fr; }
  .foot + .foot { border-left: 0; border-top: 1px solid #e6ecf4; }
  .foot--total { padding: 0; }
  .total { padding: 1.1rem; }
  .total__num { font-size: 3.4rem; }

  .hint { display: none; }
  .editor__body { grid-template-columns: 1fr; }
  .modal { width: calc(100vw - 1.2rem); }
  .toast { width: calc(100vw - 2rem); justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ── Print: чистая шахматка на А4 / А3 ───────────────────────────────────── */
@media print {
  @page { size: A4 landscape; margin: 7mm; }

  html { font-size: 11.2px; }

  body { background: #fff; }

  .topbar,
  .hint,
  .toast,
  .no-print { display: none !important; }

  .wrap { max-width: none; margin: 0; padding: 0; }

  .poster {
    display: flex;
    flex-direction: column;
    min-height: 194mm;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .week { flex: 1 1 auto; }
  .poster__foot { flex: none; }

  .day__plus,
  .day__empty,
  .ev__actions { display: none !important; }

  .ev { break-inside: avoid; page-break-inside: avoid; box-shadow: none; }
  .day { break-inside: avoid; }

  .poster__foot { break-inside: avoid; page-break-inside: avoid; }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ==========================================================================
   Серверная версия: режим редактирования, цвета, состояния загрузки
   ========================================================================== */

/* ── Пароль редактора ────────────────────────────────────────────────────── */
.btn--login {
  border-color: #cfdae9;
  background: #f2f6fb;
  color: #22355a;
}
.btn--login:hover { background: #e8eff8; border-color: #b7c9e0; }

.btn--transfer {
  border-color: #cddcee;
  background: #f4f8fd;
  color: #22355a;
}
.btn--transfer:hover { background: #e9f1fa; border-color: #b4c8e2; }
.btn--transfer .i { color: #3a6fa8; }
.btn--transfer:hover .i { color: #152a4e; }

.btn--logout {
  border-color: #e2e8f1;
  background: #f7f9fc;
  color: #48566c;
}

.btn--logout:hover { background: #eef3f9; border-color: #cfd9e8; }

.editor__note {
  font-size: 0.74rem;
  color: var(--muted-2);
}

.editor__body--login { grid-template-columns: 1fr; }

/* ── Цвета ───────────────────────────────────────────────────────────────── */
.colors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.swatch {
  position: relative;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sw, #ccc);
  box-shadow: 0 0 0 1.5px #dbe3ee;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
}

.swatch:hover { transform: scale(1.06); }
.swatch.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #152a4e; }

.swatch--auto {
  width: auto;
  height: 1.7rem;
  padding: 0 0.7rem;
  border-radius: 99px;
  background: #f2f5fa;
  box-shadow: 0 0 0 1.5px #dbe3ee;
  color: #5a6b85;
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.swatch--auto.is-active {
  background: #152a4e;
  color: #fff;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(21, 42, 78, 0.25);
}

.typecolors { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.typecolor {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.7rem 0.35rem 0.35rem;
  border: 1.5px solid #e1e8f2;
  border-radius: 0.6rem;
  background: #f8fafc;
  font-size: 0.82rem;
  color: var(--ink-2);
  cursor: pointer;
}

.typecolor input[type="color"] {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  overflow: hidden;
}

.typecolor input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.typecolor input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.typecolor input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }

/* ── Режим просмотра ─────────────────────────────────────────────────────── */
.is-readonly .day__plus,
.is-readonly .ev__actions { display: none !important; }

.is-readonly .ev { cursor: default; }
.is-readonly .ev:hover {
  transform: none;
  border-color: #e0e7f0;
  box-shadow: 0 1px 2px rgba(16, 32, 64, 0.045);
}

.is-readonly .day__empty {
  border-style: dashed;
  cursor: default;
}

.is-readonly .day__empty:hover { border-color: #d5deea; color: #93a1b6; background: transparent; }

/* ── Загрузка ────────────────────────────────────────────────────────────── */
body.is-loading .week { opacity: 0.45; pointer-events: none; }
body.is-loading .weeknav { opacity: 0.6; pointer-events: none; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  background: rgba(232, 236, 242, 0.9);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  color: #33405a;
  font-size: 0.95rem;
  font-weight: 500;
}

.boot__spinner {
  width: 1.3rem;
  height: 1.3rem;
  border: 2.5px solid #c3d0e2;
  border-top-color: #152a4e;
  border-radius: 50%;
  animation: boot-spin 0.8s linear infinite;
}

@keyframes boot-spin { to { transform: rotate(360deg); } }

.boot__error {
  max-width: 30rem;
  padding: 1.4rem 1.6rem;
  border: 1px solid #f0d6d3;
  border-radius: 0.9rem;
  background: #fff;
  box-shadow: 0 20px 50px -30px rgba(13, 27, 54, 0.6);
  text-align: center;
  line-height: 1.5;
}

.boot__error b { display: block; margin-bottom: 0.4rem; font-size: 1rem; color: #b4342d; }
.boot__error span { display: block; margin-bottom: 1rem; color: #5b6b83; }
.boot__error button { margin: 0 auto; }

/* ── Мобильные уточнения ─────────────────────────────────────────────────── */
@media screen and (max-width: 900px) {
  .btn--logout span { display: none; }
  .btn--logout { padding: 0.56rem 0.65rem; }
  .btn--login span { display: none; }
  .btn--login { padding: 0.56rem 0.65rem; }
  .btn--transfer span { display: none; }
  .btn--transfer { padding: 0.56rem 0.65rem; }
  .typecolors { gap: 0.4rem; }
}
