/* Шрифты лежат рядом с сайтом (внешних подключений нет): Manrope — текст, Tektur — заголовки и крупные цифры. */
@font-face { font-family: "Manrope"; font-weight: 200 800; font-display: swap; src: url("manrope-cyrillic-wght-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-weight: 200 800; font-display: swap; src: url("manrope-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tektur"; font-weight: 400 900; font-display: swap; src: url("tektur-cyrillic-wght-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Tektur"; font-weight: 400 900; font-display: swap; src: url("tektur-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ——— Цвета: светлая тема по умолчанию, тёмная — по системе или по выбору (data-theme на <html>) ——— */
:root {
  color-scheme: light;
  --bg: #e8e8eb;
  --panel: #ffffff;
  --panel-2: #f3f3f5;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(246, 246, 248, 0.82);
  --glass-card: rgba(255, 255, 255, 0.56);
  --glass-edge: rgba(255, 255, 255, 0.75);
  --surface: rgba(22, 23, 28, 0.045);
  --surface-strong: rgba(22, 23, 28, 0.09);
  --border: rgba(22, 23, 28, 0.09);
  --border-strong: rgba(22, 23, 28, 0.22);
  --input-bg: #f6f6f8;
  --text: #16171b;
  --text-dim: #50525b;
  --text-faint: #666871;
  --accent: #1c1d21;
  --accent-ink: #ffffff;
  --accent-soft: rgba(22, 23, 28, 0.07);
  --accent-line: rgba(22, 23, 28, 0.5);
  --ring: rgba(22, 23, 28, 0.18);
  --hero-bg: #1d1e22;
  --hero-text: #ffffff;
  --hero-dim: rgba(255, 255, 255, 0.74);
  --hero-faint: rgba(255, 255, 255, 0.62);
  --hero-surface: rgba(255, 255, 255, 0.1);
  --hero-surface-2: rgba(255, 255, 255, 0.18);
  --hero-border: rgba(255, 255, 255, 0.14);
  --hero-border-2: rgba(255, 255, 255, 0.32);
  --danger: #b3261e;
  --danger-bg: rgba(179, 38, 30, 0.08);
  --danger-line: rgba(179, 38, 30, 0.4);
  --ok: #17703f;
  --ok-bg: rgba(23, 112, 63, 0.09);
  --ok-line: rgba(23, 112, 63, 0.35);
  --warn: #8a5a00;
  --warn-bg: rgba(138, 90, 0, 0.09);
  --warn-line: rgba(138, 90, 0, 0.38);
  --dot: #c93636;
  --shadow: 0 1px 0 rgba(22, 23, 28, 0.05);
  --shadow-lg: 0 24px 60px -18px rgba(22, 23, 28, 0.4);
  --line: rgba(22, 23, 28, 0.16);
  --grid-line: rgba(22, 23, 28, 0.045);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --bg-art: radial-gradient(circle at 88% -5%, rgba(255, 255, 255, 0.9) 0, transparent 45%), repeating-radial-gradient(circle at 15% 115%, transparent 0 46px, rgba(20, 22, 28, 0.07) 46px 48px), repeating-radial-gradient(circle at 95% -10%, transparent 0 60px, rgba(20, 22, 28, 0.05) 60px 62px), var(--noise) 0 0 / 180px 180px;
  --live: #b9f03a;
  --live-ink: #141a05;
  --live-glow: rgba(150, 200, 20, 0.55);
  --radius: 16px;
  --radius-sm: 10px;
  --tap: 48px;
  --sidebar-w: 260px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Tektur", "Manrope", ui-sans-serif, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e0e10;
    --panel: #1a1a1d;
    --panel-2: #242428;
    --glass: rgba(26, 26, 29, 0.74);
    --glass-strong: rgba(18, 18, 20, 0.84);
    --glass-card: rgba(38, 38, 43, 0.5);
    --glass-edge: rgba(255, 255, 255, 0.14);
    --surface: rgba(255, 255, 255, 0.055);
    --surface-strong: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.24);
    --input-bg: #232327;
    --text: #f2f2f4;
    --text-dim: #b4b6be;
    --text-faint: #9193a0;
    --accent: #f2f2f4;
    --accent-ink: #141416;
    --accent-soft: rgba(255, 255, 255, 0.09);
    --accent-line: rgba(255, 255, 255, 0.5);
    --ring: rgba(255, 255, 255, 0.22);
    --hero-bg: #f1f1f3;
    --hero-text: #141416;
    --hero-dim: rgba(20, 20, 22, 0.72);
    --hero-faint: rgba(20, 20, 22, 0.62);
    --hero-surface: rgba(20, 20, 22, 0.07);
    --hero-surface-2: rgba(20, 20, 22, 0.13);
    --hero-border: rgba(20, 20, 22, 0.12);
    --hero-border-2: rgba(20, 20, 22, 0.3);
    --danger: #ff8d8d;
    --danger-bg: rgba(255, 141, 141, 0.1);
    --danger-line: rgba(255, 141, 141, 0.4);
    --ok: #6fd9a0;
    --ok-bg: rgba(111, 217, 160, 0.09);
    --ok-line: rgba(111, 217, 160, 0.38);
    --warn: #f0c36a;
    --warn-bg: rgba(240, 195, 106, 0.09);
    --warn-line: rgba(240, 195, 106, 0.4);
    --shadow: none;
    --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, 0.8);
    --line: rgba(255, 255, 255, 0.16);
    --grid-line: rgba(255, 255, 255, 0.035);
    --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .055 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    --bg-art: radial-gradient(circle at 88% -5%, rgba(120, 130, 255, 0.16) 0, transparent 45%), repeating-radial-gradient(circle at 15% 115%, transparent 0 46px, rgba(255, 255, 255, 0.05) 46px 48px), repeating-radial-gradient(circle at 95% -10%, transparent 0 60px, rgba(255, 255, 255, 0.04) 60px 62px), var(--noise) 0 0 / 180px 180px;
    --live: #c6ff3d;
    --live-ink: #121a02;
    --live-glow: rgba(198, 255, 61, 0.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e10;
  --panel: #1a1a1d;
  --panel-2: #242428;
  --glass: rgba(26, 26, 29, 0.74);
  --glass-strong: rgba(18, 18, 20, 0.84);
  --glass-card: rgba(38, 38, 43, 0.5);
  --glass-edge: rgba(255, 255, 255, 0.14);
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.24);
  --input-bg: #232327;
  --text: #f2f2f4;
  --text-dim: #b4b6be;
  --text-faint: #9193a0;
  --accent: #f2f2f4;
  --accent-ink: #141416;
  --accent-soft: rgba(255, 255, 255, 0.09);
  --accent-line: rgba(255, 255, 255, 0.5);
  --ring: rgba(255, 255, 255, 0.22);
  --hero-bg: #f1f1f3;
  --hero-text: #141416;
  --hero-dim: rgba(20, 20, 22, 0.72);
  --hero-faint: rgba(20, 20, 22, 0.62);
  --hero-surface: rgba(20, 20, 22, 0.07);
  --hero-surface-2: rgba(20, 20, 22, 0.13);
  --hero-border: rgba(20, 20, 22, 0.12);
  --hero-border-2: rgba(20, 20, 22, 0.3);
  --danger: #ff8d8d;
  --danger-bg: rgba(255, 141, 141, 0.1);
  --danger-line: rgba(255, 141, 141, 0.4);
  --ok: #6fd9a0;
  --ok-bg: rgba(111, 217, 160, 0.09);
  --ok-line: rgba(111, 217, 160, 0.38);
  --warn: #f0c36a;
  --warn-bg: rgba(240, 195, 106, 0.09);
  --warn-line: rgba(240, 195, 106, 0.4);
  --shadow: none;
  --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, 0.8);
  --line: rgba(255, 255, 255, 0.16);
  --grid-line: rgba(255, 255, 255, 0.035);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .055 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --bg-art: radial-gradient(circle at 88% -5%, rgba(120, 130, 255, 0.16) 0, transparent 45%), repeating-radial-gradient(circle at 15% 115%, transparent 0 46px, rgba(255, 255, 255, 0.05) 46px 48px), repeating-radial-gradient(circle at 95% -10%, transparent 0 60px, rgba(255, 255, 255, 0.04) 60px 62px), var(--noise) 0 0 / 180px 180px;
  --live: #c6ff3d;
  --live-ink: #121a02;
  --live-glow: rgba(198, 255, 61, 0.55);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: transparent; /* фон задан на html, иначе зерно (body::before) оказывается под ним */
  -webkit-font-smoothing: antialiased;
}
/* Фон: тонкая сетка и зернистость (чёткие линии вместо размытых пятен) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; background: var(--bg-art); pointer-events: none;
}

h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-family: var(--font-display); font-size: clamp(1.6rem, 1.15rem + 1.8vw, 2.3rem); font-weight: 600; letter-spacing: -0.03em; }
h2 { font-size: 1.08rem; font-weight: 650; letter-spacing: -0.01em; }
h3 { font-size: 0.98rem; font-weight: 650; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ——— Карточки ——— */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card > h2 { margin-bottom: 12px; }

.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }

/* ——— Кнопки и поля ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 22px;
  font: inherit; font-weight: 650; color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease, background-color 0.15s ease;
}
.btn:hover { opacity: 0.86; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
  color: var(--text); background: var(--surface); border-color: var(--border-strong);
}
.btn-ghost:hover { opacity: 1; background: var(--surface-strong); }
.btn-block { width: 100%; }

.field { display: grid; gap: 6px; align-content: start; }
.field + .field { margin-top: 14px; }
.field label { font-size: 0.875rem; color: var(--text-dim); font-weight: 500; }
.input {
  width: 100%; min-height: var(--tap); padding: 0 16px;
  font: inherit; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
select.input { height: var(--tap); }
.input::placeholder { color: var(--text-faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
/* 16px у полей — iOS не приближает страницу при фокусе */

.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.925rem;
  color: var(--danger); background: var(--danger-bg); border: 1px solid var(--danger-line);
}

/* ——— Страница входа ——— */
.auth-wrap {
  min-height: 100dvh; display: grid; place-items: center;
  padding: calc(24px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
}
.auth-card { width: 100%; max-width: 420px; display: grid; gap: 20px; padding: 30px 26px; border-radius: 28px; }
.auth-card form { display: grid; gap: 0; }
.auth-card .btn { margin-top: 20px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
.brand-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; }
.brand-mark svg { width: 100%; height: 100%; overflow: visible; }
.brand-mark .k-base { fill: var(--text-faint); }
.brand-mark .k-top { fill: var(--accent); }
.brand-mark .k-q { fill: none; stroke: var(--accent-ink); stroke-width: 3.4; }
.brand-mark .k-tail { fill: none; stroke: var(--accent-ink); stroke-width: 3.4; stroke-linecap: round; }
.brand-mark .k-dot { fill: var(--live); stroke: var(--accent); stroke-width: 1.4; }

/* ——— Оболочка приложения ——— */
.shell { min-height: 100dvh; display: grid; grid-template-columns: 1fr; }
.content { min-width: 0; }
.sidebar, .appbar { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + var(--safe-top)) 16px 10px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.topbar-actions { display: flex; align-items: center; gap: 4px; margin-right: -8px; }

.main { padding: 20px 16px calc(112px + var(--safe-bottom)); width: 100%; max-width: 960px; margin: 0 auto; }
.page-head { display: grid; gap: 8px; margin-bottom: 24px; }
.page-head .muted { max-width: 70ch; }
.grid { display: grid; gap: 14px; }

/* Нижняя панель на телефоне: плавающая тёмная «таблетка» */
.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-bottom)); z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
  padding: 6px; border-radius: 30px;
  background: var(--hero-bg); color: var(--hero-text);
  box-shadow: var(--shadow-lg);
}
.tab {
  display: grid; justify-items: center; align-content: center; gap: 2px;
  min-height: 54px; border-radius: 24px; font-size: 0.72rem; font-weight: 600; color: var(--hero-dim);
}
.tab[aria-current="page"] { color: var(--hero-bg); background: var(--hero-text); }
.tab svg, .navlink svg { width: 22px; height: 22px; flex: none; }

.navlink {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px;
  border-radius: 999px; color: var(--text-dim); font-weight: 550;
}
.navlink:hover { background: var(--surface); color: var(--text); }
.navlink[aria-current="page"] { color: var(--hero-text); background: var(--hero-bg); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem;
  border: 1px solid var(--border-strong); background: var(--surface);
}
.status-ok { color: var(--ok); }
.status-bad { color: var(--danger); }
.nav-group { margin: 18px 14px 6px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.nav-group-plain { margin: 8px 14px; border-top: 1px solid var(--border); }
.me-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; color: var(--accent-ink);
  background: var(--accent);
}
.me-name { min-width: 0; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-actions { display: flex; gap: 8px; }
.foot-actions > * { flex: 1; }
.foot-actions .btn { width: 100%; }

/* Круглые кнопки-иконки: поиск, уведомления, тема */
.round-btn {
  position: relative; display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0;
  border-radius: 50%; color: var(--text); background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer; font: inherit;
}
.round-btn:hover { background: var(--panel-2); }
.round-btn svg { width: 21px; height: 21px; }
.topbar .round-btn { width: 42px; height: 42px; box-shadow: none; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: inline-block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: inline-block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.js-only { display: none; }
.js .js-only { display: inline-grid; }

@media (min-width: 900px) {
  .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: 24px; padding: 16px 24px 16px 16px; }
  .sidebar {
    display: flex; flex-direction: column; gap: 10px;
    position: sticky; top: 16px; height: calc(100dvh - 32px); padding: 22px 12px 14px;
    border-radius: 30px; background: var(--glass); border: 1px solid var(--border); box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  }
  .sidebar .brand { padding: 0 10px 8px; font-size: 1.25rem; }
  .side-nav { display: grid; align-content: start; gap: 2px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
  .side-nav .navlink { min-height: 40px; font-size: 0.94rem; }
  .sidebar-foot { display: grid; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
  .topbar, .tabbar { display: none; }
  .appbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; width: 100%; max-width: 1280px; margin: 0 auto; padding: 8px 40px 0; }
  .appbar .side-search { flex: 0 1 340px; margin: 0; }
  .appbar .me-pill { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 2px 16px 2px 2px; border-radius: 999px; background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow); font-weight: 600; font-size: 0.92rem; }
  .appbar .me-pill .avatar { width: 38px; height: 38px; }
  .main { padding: 20px 40px 48px; }
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ——— Уведомления, таблицы-списки, формы управления ——— */
.notice {
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.925rem;
  color: var(--ok); background: var(--ok-bg); border: 1px solid var(--ok-line);
}
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 0.9rem; }
.btn-danger { color: var(--danger); background: var(--danger-bg); border: 1px solid var(--danger-line); }
.btn-danger:hover { box-shadow: none; }
.select { appearance: none; padding-right: 14px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.row-actions form { display: contents; }
.user-list { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.user-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; justify-content: space-between; }
.link-box {
  display: block; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.85rem;
  background: var(--surface-strong); border: 1px solid var(--border-strong); overflow-wrap: anywhere; user-select: all;
}
.log-view {
  margin: 0; padding: 12px 14px; max-height: 60vh; overflow: auto; border-radius: var(--radius-sm); font-size: 0.78rem; line-height: 1.45;
  background: var(--surface-strong); border: 1px solid var(--border-strong); white-space: pre-wrap; overflow-wrap: anywhere;
}
details.card > summary { cursor: pointer; font-weight: 600; min-height: 32px; }
details.card[open] > summary { margin-bottom: 14px; }
.two-col { display: grid; gap: 12px; }
@media (min-width: 640px) { .two-col { grid-template-columns: 1fr 1fr; } }

/* ——— Календарь и смены ——— */
html { scroll-padding-bottom: 140px; }
.link { text-decoration: underline; text-underline-offset: 3px; color: var(--text); }
.textarea { padding: 12px 14px; min-height: 96px; resize: vertical; line-height: 1.45; }
.field-error { color: var(--danger); font-size: 0.85rem; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
input[type="datetime-local"] { min-width: 0; }
.form-card { max-width: 640px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.form-actions .btn { flex: 1 1 160px; }

.icon-wrap { position: relative; display: inline-grid; place-items: center; }
.badge-dot {
  position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; font-size: 0.7rem; font-weight: 700; line-height: 18px; text-align: center;
  color: var(--live-ink); background: var(--live);
}
.navlink .badge-dot { position: static; margin-left: 4px; }
.navlink .icon-wrap { display: contents; }
.navlink .icon-wrap svg { width: 22px; height: 22px; }

/* Панель инструментов календаря */
.cal-toolbar { display: grid; gap: 12px; margin-bottom: 16px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; min-width: 0; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.seg a { display: grid; place-items: center; min-height: 40px; padding: 0 12px; border-radius: 9px; color: var(--text-dim); font-weight: 600; }
.seg a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); }
.cal-nav { display: flex; gap: 8px; }
.cal-nav .btn { flex: 1; }
.cal-title { font-size: 1.15rem; }
.cal-filter { display: flex; gap: 8px; }
.cal-filter select { flex: 1; min-height: 40px; }
.cal-new { width: 100%; }

/* Карточки смен */
.chip-list { display: grid; gap: 8px; }
.chip {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center;
  min-height: 48px; padding: 8px 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border);
}
.chip:hover { background: var(--surface-strong); }
.chip-mine { border-color: var(--accent-line); background: var(--accent-soft); }
.chip-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-time { color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.chip-dur { color: var(--text-dim); font-size: 0.85rem; }
.chip .tag { justify-self: end; }
.tag { font-size: 0.72rem; padding: 1px 8px; border-radius: 999px; color: var(--text-dim); border: 1px solid var(--border-strong); white-space: nowrap; }
.tag-note { color: var(--text-faint); }
.chip-compact { min-height: 0; padding: 4px 8px; border-radius: 8px; font-size: 0.78rem; grid-template-columns: 1fr; }
.chip-compact .chip-time { text-align: left; color: var(--text-dim); }
.chip-compact .tag { display: none; }

.day-add {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; flex: none;
  color: var(--text-dim); border: 1px solid var(--border);
}
.day-add:hover { color: var(--text); background: var(--surface-strong); }

.week { display: grid; gap: 12px; }
.week-day { padding: 14px; }
.week-day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.week-day-title { font-weight: 600; }
.week-day-title .wd { color: var(--text-dim); font-size: 0.85rem; margin-right: 4px; }
.week-empty { padding: 4px 0; }

/* Неделя таблицей (ПК): строки — сотрудники, столбцы — дни. На телефоне остаются карточки по дням. */
.wm-wrap { display: none; padding: 6px 8px 10px; overflow-x: auto; }
.wm { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; min-width: 760px; }
.wm th, .wm td { padding: 8px 4px; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; }
.wm thead th { position: sticky; top: 0; font-weight: 600; font-size: 0.82rem; color: var(--text-dim); background: var(--panel); }
.wm-who { width: 150px; }
.wm-who span { overflow-wrap: anywhere; }
.wm .wm-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.wm tbody tr { position: relative; }
.wm-day a { display: block; }
.wm-day .dn { display: block; font-weight: 400; color: var(--text-faint); }
.wm-day.is-today { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); border-radius: 0; }
.wm-cell.is-today { background: var(--surface); box-shadow: none; border-radius: 0; }
.wm-shift { display: block; padding: 5px 2px; margin-bottom: 4px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 0.74rem; text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wm-shift:hover { background: var(--surface-strong); }
.wm-shift.is-plan { border-style: dashed; }
.wm-shift.is-live { border-color: var(--live); box-shadow: 0 0 0 1px var(--live); }
.wm-moon { display: inline-flex; vertical-align: middle; margin-left: 2px; }
.wm-moon svg { width: 11px; height: 11px; }
.wm-sum { width: 76px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: 0.86rem; }
.wm-group th { background: var(--surface); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); padding: 6px 8px; border-radius: 8px; }
.wm-mine .wm-who { color: var(--text); }
.wm-mine td, .wm-mine .wm-who { background: var(--accent-soft); }

.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 22px -8px var(--accent); }

.month-grid { display: none; }
.month-agenda { display: grid; gap: 12px; }

.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.comment-list li { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.comment-list li.mine { border-color: var(--accent-line); }
.comment-body { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }

.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notif.unread { border-color: var(--accent-line); box-shadow: inset 3px 0 0 var(--accent); }
.notif p { overflow-wrap: anywhere; }
.notif-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; }
.notif-foot form { margin-left: auto; }

/* Экранная клавиатура: нижняя панель мешает, пока набирается текст */
@media (max-width: 899px) {
  body:has(input:focus, textarea:focus, select:focus) .tabbar { display: none; }
  body:has(input:focus, textarea:focus, select:focus) .main { padding-bottom: calc(24px + var(--safe-bottom)); }
}

@media (min-width: 640px) {
  .cal-toolbar { grid-template-columns: auto auto 1fr; align-items: center; }
  .cal-title { grid-column: 1 / -1; order: 5; }
  .cal-filter { grid-column: 1 / 3; }
  .cal-new { width: auto; justify-self: end; grid-column: 3; }
}

@media (min-width: 900px) {
  .wm-wrap { display: block; }
  .week-cards { display: none; }
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
  .week-day { padding: 10px; }
  .week-day-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .week-day-head .day-add { align-self: flex-end; margin-top: -30px; }
  .week .chip { grid-template-columns: 1fr; padding: 8px; }
  .week .chip-time { text-align: left; }
  .week .chip .tag { justify-self: start; }
  .main { max-width: 1280px; }

  .month-agenda { display: none; }
  .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
  .month-wd { text-align: center; color: var(--text-dim); font-size: 0.82rem; padding: 4px 0; }
  .month-cell { min-height: 118px; display: grid; align-content: start; gap: 4px; padding: 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
  .month-cell.outside { opacity: 0.55; }
  .month-cell-head { display: flex; align-items: center; justify-content: space-between; }
  .month-cell .day-add { width: 26px; height: 26px; }
  .month-num { font-weight: 600; color: var(--text-dim); }
  .month-cell.is-today .month-num { color: var(--text); }
  .more { font-size: 0.78rem; color: var(--text-dim); padding: 2px 4px; }
}

/* ——— Вспомогательные классы (inline-стили запрещены политикой CSP) ——— */
.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; }
.mt-20 { margin-top: 20px; }
.mb-12 { margin-bottom: 12px; }
.mb-14 { margin-bottom: 14px; }
.mb-16 { margin-bottom: 16px; }
.gap-16 { display: grid; gap: 16px; }
.strong { color: var(--text); font-weight: 600; }
.auth-card-wide { max-width: 560px; }
.select-auto { width: auto; min-height: 40px; }
.input-email { width: auto; min-width: 220px; min-height: 40px; flex: 1 1 220px; }
.inline-form { display: inline; }
.comment-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.nav-form { margin: 0; }
.problems { margin: 8px 0 0 18px; padding: 0; }
.problems li { margin: 4px 0; }
code.block, pre.block {
  display: block; overflow-x: auto; white-space: pre-wrap; word-break: break-all;
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--line, var(--surface-strong)); font-size: 0.85rem;
}

/* ——— Дополнения для PHP-версии (CSP запрещает inline-стили, поэтому всё через классы) ——— */
.mb-6 { margin-bottom: 6px; }
.mt-4 { margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--text-dim); font-size: 14px; }
.check input { margin-top: 3px; }
ol { padding-left: 20px; display: grid; gap: 6px; }

/* ——— Части 4–6: зарплата, месяцы, журнал, FAQ, панель редактора, установка на iPhone ——— */
.mb-8 { margin-bottom: 8px; }
.two-col .field + .field, .filter-grid .field + .field { margin-top: 0; }

/* Ссылка «К содержимому» для клавиатуры и экранных дикторов */
.skip-link {
  position: absolute; left: 12px; top: -64px; z-index: 100; padding: 10px 14px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.skip-link:focus { top: calc(8px + var(--safe-top)); }
.main:focus, .public-main:focus { outline: none; }

/* Безопасные области iPhone: вырез, Dynamic Island, боковые поля в альбомной ориентации */
.topbar, .main {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.tabbar {
  padding-left: max(8px, env(safe-area-inset-left, 0px));
  padding-right: max(8px, env(safe-area-inset-right, 0px));
}
.auth-wrap {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 900px) {
  .main {
    padding-left: max(40px, env(safe-area-inset-left, 0px));
    padding-right: max(40px, env(safe-area-inset-right, 0px));
  }
}

/* Карточка входа и подпись под ней */
.auth-stack { width: 100%; display: grid; justify-items: center; gap: 16px; }
.auth-foot { font-size: 0.875rem; color: var(--text-faint); text-align: center; }

/* Публичные страницы без меню приложения */
.public-head {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + var(--safe-top)) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  background: var(--glass-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.public-nav { display: flex; align-items: center; gap: 14px; }
.public-main {
  max-width: 820px; margin: 0 auto;
  padding: 24px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px));
}
.public-foot { text-align: center; padding: 8px 16px calc(28px + var(--safe-bottom)); color: var(--text-faint); font-size: 0.9rem; }

/* Меню «Ещё» на телефоне: выезжает над нижней панелью, закрывается кнопкой, нажатием вне меню и клавишей Esc */
.tab-more > summary { cursor: pointer; list-style: none; }
.tab-more > summary::-webkit-details-marker { display: none; }
.tab-more[data-active] > summary, .tab-more[open] > summary { color: var(--text); background: var(--surface-strong); }
.more-sheet {
  position: absolute; left: max(8px, env(safe-area-inset-left, 0px)); right: max(8px, env(safe-area-inset-right, 0px));
  bottom: calc(100% + 8px); max-height: calc(100dvh - 150px - var(--safe-top) - var(--safe-bottom)); overflow-y: auto; overscroll-behavior: contain;
  padding: 10px; border-radius: 18px; background: var(--panel); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.more-sheet nav { display: grid; gap: 2px; }
.more-sheet .navlink { min-height: 44px; }
.more-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.more-user { padding: 2px 12px 8px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.install-link svg { opacity: 0.9; }
html.is-standalone .install-link { display: none; }
[hidden] { display: none !important; }

/* Предупреждения и статусы */
.notice-warn {
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.925rem;
  color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-line);
}
.pill {
  display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 0.78rem; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-dim);
}
.pill-ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.pill-warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }
.pill-off { color: var(--text-dim); }

/* Значение «сейчас действует» */
.stat { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.stat-label { color: var(--text-dim); font-size: 0.8rem; }
.stat-value { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.inline-details > summary { cursor: pointer; display: inline-block; min-height: 32px; padding: 4px 0; }
.inline-details[open] > summary { margin-bottom: 4px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.timeline li { padding-left: 12px; border-left: 2px solid var(--border-strong); overflow-wrap: anywhere; }
.plain-list { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; }
.steps { margin: 0; padding-left: 1.4em; display: grid; gap: 12px; }
.steps li { padding-left: 4px; }

/* Таблицы: на телефоне каждая строка превращается в карточку (без горизонтальной прокрутки страницы) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th, table.data td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
table.data th { color: var(--text-dim); font-weight: 600; font-size: 0.8rem; white-space: nowrap; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 639px) {
  .table-wrap { border: 0; background: none; overflow: visible; }
  table.data.stack, table.data.stack tbody { display: block; width: 100%; }
  table.data.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data.stack tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; margin-bottom: 10px; padding: 8px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  }
  table.data.stack td { display: block; min-width: 0; padding: 6px 0; border: 0; text-align: left; overflow-wrap: anywhere; white-space: normal; }
  table.data.stack td:first-child, table.data.stack td:last-child { grid-column: 1 / -1; }
  table.data.stack td::before { content: attr(data-label); display: block; color: var(--text-dim); font-size: 0.75rem; }
  table.data.stack td[data-label=""]::before { content: none; }
}

/* Журнал */
.filter-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.code-small { font-size: 0.72rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.detail-line { font-size: 0.85rem; color: var(--text-dim); overflow-wrap: anywhere; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* FAQ */
.faq-search { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-dim);
}
.chip-link[aria-current="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.chip-link[aria-current="true"] .faint { color: inherit; opacity: 0.7; }
.faq-cat { font-size: 0.95rem; font-weight: 650; color: var(--text-dim); margin-bottom: 8px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 8px; }
.faq-item > summary { cursor: pointer; padding: 14px 16px; min-height: var(--tap); font-weight: 600; overflow-wrap: anywhere; }
.faq-item[open] > summary { border-bottom: 1px solid var(--border); }
.pre-line { white-space: pre-line; overflow-wrap: anywhere; }
.inline-form { display: inline; }
.faq-a { padding: 14px 16px; white-space: pre-line; overflow-wrap: anywhere; color: var(--text-dim); }
.faq-title { overflow-wrap: anywhere; }
.faq-preview { color: var(--text-dim); white-space: pre-line; overflow-wrap: anywhere; }

/* Панель редактора: на ПК — боковая навигация слева, на телефоне — раскрывающийся блок «Разделы и фильтры» */
.panel { display: grid; gap: 16px; }
.panel-side { display: none; }
.panel-fold > summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.panel-fold[open] > summary { margin-bottom: 12px; }
.panel-main { min-width: 0; }
.panel-nav { display: grid; gap: 4px; }
.panel-title { margin: 14px 12px 4px; font-size: 0.78rem; font-weight: 600; color: var(--text-faint); }
.panel-link {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 12px;
  border-radius: 10px; color: var(--text-dim); overflow-wrap: anywhere;
}
.panel-link:hover { background: var(--surface); color: var(--text); }
.panel-link[aria-current="page"] { background: var(--surface-strong); color: var(--text); }
.panel-link .count { font-size: 0.8rem; color: var(--text-faint); }
@media (min-width: 900px) {
  .panel { grid-template-columns: 230px minmax(0, 1fr); align-items: start; }
  .panel-side { display: block; position: sticky; top: 24px; }
  .panel-fold { display: none; }
}

/* Раздельные графики «Админы» и «АЗ» в одном списке смен */
.chip-group + .chip-group { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.chip-group-title { margin: 0 0 4px; font-size: .82rem; font-weight: 600; }

/* ——— Задачи ——— */
.period-nav { display: flex; align-items: center; justify-content: center; gap: 16px; }
.period-nav strong { font-family: var(--font-display); font-weight: 600; font-size: 1rem; min-width: 11ch; text-align: center; }
.person { padding: 0; overflow: hidden; }
.person > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px 16px; }
.person > summary::-webkit-details-marker { display: none; }
.person[open] > summary { border-bottom: 1px solid var(--border); background: var(--surface); }
.person-name { font-weight: 650; overflow-wrap: anywhere; }
.person-sub { font-size: 0.85rem; color: var(--text-faint); }
.progress { display: grid; gap: 4px; justify-items: end; min-width: 84px; font-size: 0.85rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.progress-bar { width: 84px; height: 6px; border-radius: 999px; background: var(--surface-strong); overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.progress-bar > .w0 { width: 0%; } .progress-bar > .w1 { width: 10%; } .progress-bar > .w2 { width: 20%; } .progress-bar > .w3 { width: 30%; } .progress-bar > .w4 { width: 40%; } .progress-bar > .w5 { width: 50%; } .progress-bar > .w6 { width: 60%; } .progress-bar > .w7 { width: 70%; } .progress-bar > .w8 { width: 80%; } .progress-bar > .w9 { width: 90%; } .progress-bar > .w10 { width: 100%; }
.person-body { padding: 4px 16px 16px; }
.task-block { margin-top: 16px; }
.task-block > h3 { margin: 0 0 8px; color: var(--text-dim); font-weight: 650; }
.task-list, .cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.task-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.task-row.is-done { background: transparent; }
.task-row.is-done .task-title { color: var(--text-faint); text-decoration: line-through; }
.task-check { margin: 0; }
.check-btn {
  width: 30px; height: 30px; border-radius: 9px; border: 1.5px solid var(--border-strong); background: var(--input-bg);
  color: var(--accent-ink); font-weight: 800; cursor: pointer; display: grid; place-items: center; padding: 0; font-size: 1rem;
}
.check-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 14px -3px var(--accent); }
.task-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.task-more { margin-top: 6px; }
.task-more > summary { cursor: pointer; font-size: 0.85rem; }
.tf-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.tf-form .input { min-height: 40px; height: 40px; width: auto; flex: 1 1 120px; }
.tf-form label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; flex-wrap: wrap; }
.score-line { margin-top: 10px; }
.cat-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }

.chip-planned { border-style: dashed; opacity: 0.85; }

/* ——— Обзор ——— */
.hero-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.hero-shift { border-color: var(--border-strong); background: linear-gradient(160deg, var(--panel-2), var(--panel) 70%); }
.hero-time { display: inline-block; margin: 8px 0 6px; font-family: var(--font-display); font-weight: 600; letter-spacing: -0.03em; font-size: clamp(1.9rem, 1.2rem + 3vw, 2.9rem); font-variant-numeric: tabular-nums; line-height: 1.1; }
.hero-time:hover { color: var(--accent); }
.hero-empty { margin-top: 8px; font-size: 1.1rem; color: var(--text-dim); }
.big-num { margin-top: 8px; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.money-line { margin-top: 14px; font-weight: 650; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.money-line .faint { font-weight: 400; font-size: 0.9rem; }
.tile-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .tile-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); } }
.tile { display: grid; align-content: space-between; gap: 10px; min-height: 112px; padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border);  }

.tile-num { font-family: var(--font-display); font-weight: 600; font-size: 2rem; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.tile-of { color: var(--text-faint); font-size: 1.2rem; }
.tile-label { color: var(--text-dim); font-size: 0.88rem; line-height: 1.3; }
.tile-hot { border-color: var(--accent-line); box-shadow: inset 3px 0 0 var(--accent); }
.tile-hot .tile-num { color: var(--accent); }
.tile-warn { border-color: var(--warn-line); box-shadow: inset 3px 0 0 var(--warn); }
.tile-warn .tile-num { color: var(--warn); }
.sys-line { font-size: 0.85rem; }

/* Календарь: дни без смен занимают мало места, на ПК в узкой колонке — только число */
.week-day.is-empty { padding-top: 10px; padding-bottom: 10px; }
.week-day.is-empty .week-day-head { margin-bottom: 4px; }
.week-day-title .dn { font-family: var(--font-display); font-weight: 600; }
@media (min-width: 900px) {
  .week-day { min-height: 168px; }
  .week-day.is-empty { min-height: 120px; }
  .week-day-title .mn { display: none; }
  .week-day-title .dn { font-size: 1.15rem; }
}
.week-empty { font-size: 0.88rem; }

.week .chip-time { white-space: nowrap; font-size: 0.85rem; }
.week .chip-name { font-size: 0.92rem; }
.tf-form .input[inputmode] { flex: 0 0 96px; }
/* Фильтр с многими вариантами (статусы инициатив) переносится на несколько строк */
.seg-wrap { display: flex; flex-wrap: wrap; }
.seg-wrap a { flex: 1 1 auto; text-align: center; white-space: nowrap; }
.user-more > summary { cursor: pointer; min-height: 32px; }

/* ——— Быстрые действия, «сегодня в клубе», поиск ——— */
.js [data-autosubmit-btn] { display: none; }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 900px) { .quick { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } }
.quick-btn { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); font-weight: 600; font-size: 0.92rem; }
.quick-btn svg { width: 22px; height: 22px; flex: none; color: var(--accent); }
.quick-btn:hover { border-color: var(--border-strong); background: var(--panel-2); }
.countdown { font-weight: 650; color: var(--accent); }
.today-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.today-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid transparent; }
.today-row.is-live { border-color: var(--ok-line); background: var(--ok-bg); }
.today-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .today-row { grid-template-columns: minmax(0, 1fr) auto; } .today-row .today-time { grid-column: 1; } .today-row .pill { grid-column: 2; grid-row: 1 / span 2; } }
.today-time { font-variant-numeric: tabular-nums; color: var(--text-dim); }
.side-search { position: relative; margin: 0 4px; }
.side-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); display: grid; pointer-events: none; }
.side-search-icon svg { width: 18px; height: 18px; }
.side-search-input { width: 100%; height: 40px; padding: 0 12px 0 38px; font: inherit; font-size: 0.92rem; color: var(--text); background: var(--input-bg); border: 1px solid var(--border); border-radius: 10px; }
.side-search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.topbar-search { display: grid; place-items: center; width: 44px; height: 44px; margin: -6px -8px -6px 0; border-radius: 12px; color: var(--text-dim); }
.topbar-search svg { width: 22px; height: 22px; }
.cal-filter .btn { white-space: nowrap; }

/* Разделы клуба: склад, расходники, бронь, отпуска */
.stock-row { flex-wrap: wrap; }
.stock-edit { flex-basis: 100%; }
.stock-edit summary { cursor: pointer; }
.input-num { width: 88px; text-align: right; font-variant-numeric: tabular-nums; }
.rules { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--text-dim); }
.table-wrap td.num, .table-wrap th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cat-list .tf-form { flex-wrap: wrap; justify-content: flex-end; }
.table-wrap.scroll { overflow-x: auto !important; border: 1px solid var(--border) !important; background: var(--surface) !important; }
.table-wrap.scroll table.data { min-width: 640px; }
.card { min-width: 0; }
.cat-list li { flex-wrap: wrap; }
.cat-list .tf-form { min-width: 0; max-width: 100%; }
.cat-list .tf-form .input { min-width: 0; flex: 1 1 120px; }
.cat-list .tf-form .input-num { flex: 0 0 88px; }
.main { min-width: 0; }
body > * { min-width: 0; }
.shell { min-width: 0; max-width: 100vw; }
.shell > * { min-width: 0; }

/* ——— Оформление: тёмные акцентные карточки, плитки, сегментные переключатели ——— */
.card-hero, .tile-hot, .chip-mine {
  --text: var(--hero-text); --text-dim: var(--hero-dim); --text-faint: var(--hero-faint);
  --surface: var(--hero-surface); --surface-strong: var(--hero-surface-2);
  --border: var(--hero-border); --border-strong: var(--hero-border-2);
  --accent: var(--hero-text); --accent-ink: var(--hero-bg); --accent-soft: var(--hero-surface); --accent-line: var(--hero-border-2);
  --panel: var(--hero-bg); --panel-2: var(--hero-surface); --input-bg: var(--hero-surface); --ring: var(--hero-border-2);
  color: var(--hero-text); background: var(--hero-bg); border-color: transparent;
}
.hero-shift { padding: 26px; }
.hero-time { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.4rem); }
.hero-month .big-num { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }

.quick { gap: 10px; }
.quick-btn { min-height: 48px; border-radius: 999px; box-shadow: var(--shadow); padding: 0 18px; }
.quick-btn svg { color: var(--text); }
.quick-btn:hover { background: var(--panel-2); border-color: var(--border-strong); }

.tile { min-height: 132px; box-shadow: var(--shadow); align-content: start; gap: 14px; }
.tile:hover { border-color: var(--border-strong); }
.tile-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-strong); }
.tile-ic svg { width: 20px; height: 20px; }
.tile-body { display: grid; gap: 4px; }
.tile-hot { box-shadow: var(--shadow-lg); }
.tile-hot .tile-num { color: inherit; }
.tile-warn { border-color: var(--warn-line); box-shadow: var(--shadow); }
.tile-warn .tile-num { color: var(--warn); }
.home-lists { align-items: start; }

.seg { border-radius: 999px; background: var(--panel); box-shadow: var(--shadow); }
.seg a { border-radius: 999px; }
.seg a[aria-current="page"], .chip-link[aria-current="true"] { color: var(--hero-text); background: var(--hero-bg); border-color: var(--hero-bg); }
.chip-link { border-radius: 999px; background: var(--panel); }
.cal-nav .btn, .cal-filter .btn { border-radius: 999px; }

.chip { border-radius: 14px; background: var(--surface); }
.chip:hover { background: var(--surface-strong); }
.chip-mine { border-color: var(--accent-line); background: var(--accent-soft); }
.week-day, .month-cell { border-radius: 18px; }
.week-day { box-shadow: var(--shadow); }
.is-today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.month-cell.is-today { background: var(--panel); }

.tabbar .tab-more[data-active] > summary, .tabbar .tab-more[open] > summary { color: var(--hero-bg); background: var(--hero-text); }
.more-sheet { color: var(--text); border-radius: 24px; background: var(--panel); }
.tabbar .more-sheet .navlink[aria-current="page"] { color: var(--hero-text); background: var(--hero-bg); }

.side-search-input { height: 44px; border-radius: 999px; padding-left: 42px; background: var(--panel); box-shadow: var(--shadow); border-color: var(--border); }
.side-search-icon { left: 15px; }

.table-wrap, .table-wrap.scroll { border-radius: var(--radius-sm); }
table.data th { font-weight: 650; }
.pill, .tag, .badge { font-weight: 550; }
.check-btn { border-radius: 10px; }
.check-btn[aria-pressed="true"] { box-shadow: none; }
.public-head { background: var(--glass-strong); }
.faq-item, .task-row, .person, .today-row { border-radius: 16px; }
.notice { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.notice-warn { color: var(--warn); }
.link-box { background: var(--surface-strong); }

@media (max-width: 899px) {
  .quick { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 16px; padding: 4px 16px 10px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .quick::-webkit-scrollbar { display: none; }
  .quick-btn { flex: none; white-space: nowrap; scroll-snap-align: start; min-height: 46px; }
}
@media (min-width: 900px) {
  .month-cell { background: var(--glass); border-color: var(--border); }
  .month-cell.outside { opacity: 0.5; }
}

/* ——— Кнопки: только нажатие и смена цвета (без прыжков и бликов) ——— */
.btn, .quick-btn, .round-btn, .chip-link, .seg a, .navlink {
  transition: transform 0.12s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}
.btn:active, .quick-btn:active, .round-btn:active, .tab:active { transform: scale(0.97); }
@media (hover: hover) {
  .btn-ghost:hover, .quick-btn:hover { border-color: var(--accent-line); }
}

/* ——— Анимации: смена темы, пульс «сейчас», тосты и окна ——— */
@keyframes gw-pulse { 0% { box-shadow: 0 0 0 0 var(--live-glow); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes gw-toast-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes gw-pop { from { opacity: 0; transform: scale(0.94) translateY(8px); } to { opacity: 1; transform: none; } }

html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, fill 0.4s ease, stroke 0.4s ease !important;
}

/* ——— Скользящая «таблетка» ——— */
.seg.has-pill { position: relative; }
.seg-pill {
  position: absolute; top: 4px; bottom: 4px; left: 0; z-index: 0; width: var(--w, 0px); transform: translateX(var(--x, 0px));
  border-radius: 999px; background: var(--hero-bg); box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.5);
  transition: transform 0.38s cubic-bezier(0.3, 1.25, 0.4, 1), width 0.38s cubic-bezier(0.3, 1.25, 0.4, 1);
}
.seg-pill.no-anim { transition: none; }
.seg.has-pill a { position: relative; z-index: 1; }
.seg.has-pill a[aria-current="page"], .seg.has-pill a[aria-current="true"] { background: transparent; border-color: transparent; color: var(--hero-text); }
/* Кнопки-переключатели (тема в профиле) выглядят как сегменты */
.seg-btns { display: flex; flex-wrap: wrap; }
.seg-btns button { flex: 1 1 auto; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--text-dim); font: inherit; font-weight: 600; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.seg-btns button[aria-pressed="true"] { background: var(--hero-bg); color: var(--hero-text); }

/* ——— Тосты ——— */
.toasts { position: fixed; z-index: 90; bottom: 24px; right: 24px; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 18px; border-radius: 18px;
  color: var(--text); background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%);
  font-weight: 600; pointer-events: auto; animation: gw-toast-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: -2px; }
.toast > span { flex: 1; }
.toast.is-out { opacity: 0; transform: translateY(10px) scale(0.96); }
.toast-x { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--surface); color: var(--text-dim); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.toast-x:hover { background: var(--surface-strong); color: var(--text); }
@media (max-width: 899px) { .toasts { right: 16px; left: 16px; width: auto; bottom: calc(92px + var(--safe-bottom)); } }

/* ——— Окно подтверждения (стекло) ——— */
dialog.modal {
  width: min(420px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--glass-edge); border-radius: 28px;
  color: var(--text); background: var(--glass-strong); box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(26px) saturate(150%); backdrop-filter: blur(26px) saturate(150%);
}
dialog.modal[open] { animation: gw-pop 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1) both; }
dialog.modal::backdrop { background: rgba(12, 12, 16, 0.4); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal-text { font-size: 1.05rem; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal-actions .btn { flex: 1 1 120px; }
.more-sheet { background: var(--glass-strong); -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%); border-color: var(--glass-edge); }

/* ——— Пустые состояния ——— */
.empty { display: grid; justify-items: center; gap: 6px; padding: 18px 8px; text-align: center; }
.empty-ic { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 6px; border-radius: 50%; background: var(--surface-strong); color: var(--text-dim); }
.empty-ic svg { width: 26px; height: 26px; }
.empty-title { font-weight: 650; }
.empty-hint { max-width: 46ch; color: var(--text-dim); font-size: 0.92rem; }
.empty-hint code { font-size: 0.82rem; word-break: break-all; }

/* ——— «Вы на смене» ——— */
.live-dot { display: inline-block; width: 10px; height: 10px; margin-right: 10px; border-radius: 50%; background: var(--ok); vertical-align: 1px; animation: gw-pulse 1.8s ease-out infinite; }
.card-hero .live-dot { background: #4be08a; box-shadow: 0 0 0 0 rgba(75, 224, 138, 0.6); }
.hero-shift .countdown { color: var(--hero-text); font-size: 1.05rem; }

/* ——— Календарь: мои смены и ночные ——— */
.chip-mine.chip-planned { opacity: 1; border-style: solid; }
.tag-night { display: inline-flex; align-items: center; gap: 4px; }
.tag-night svg { width: 11px; height: 11px; }

/* ——— Оформление в профиле ——— */
.js-only-block { display: none; }
.js .js-only-block { display: block; }
.js .js-note { display: none; }
@media (prefers-reduced-motion: reduce) {
  .live-dot, .toast, dialog.modal[open] { animation: none !important; }
  .seg-pill { transition: none; }
}

.chip-mine, .chip-mine:hover { background: var(--hero-bg); border-color: transparent; }
.chip-mine:hover { filter: brightness(1.18); }
.card-hero .chip-mine, .card-hero .chip-mine:hover { background: var(--hero-surface-2); border-color: var(--hero-border-2); }

/* ——— Аватары: оттенок серого по имени ——— */
.avatar.av-0, .mini-av.av-0 { background: #2b2c31; color: #fff; }
.avatar.av-1, .mini-av.av-1 { background: #4a4c54; color: #fff; }
.avatar.av-2, .mini-av.av-2 { background: #6b6d77; color: #fff; }
.avatar.av-3, .mini-av.av-3 { background: #9a9ca6; color: #14151a; }
.avatar.av-4, .mini-av.av-4 { background: #c3c4cb; color: #14151a; }
.avatar.av-5, .mini-av.av-5 { background: #dedfe4; color: #14151a; }
.mini-av { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; font-size: 0.68rem; font-weight: 700; vertical-align: 1px; }
.chip-compact .mini-av { display: none; }
.chip-mine .mini-av { box-shadow: 0 0 0 1.5px var(--hero-text); }

/* ——— Формы: действия круглые, данные строже, главная карточка асимметрична ——— */
.tile { border-radius: 12px; }
.chip { border-radius: 10px; }
.week-day, .month-cell { border-radius: 12px; }
.task-row, .person, .today-row, .faq-item { border-radius: 10px; }
.card-hero { border-radius: 28px 28px 28px 6px; }
.tile-hot { border-radius: 12px 12px 12px 4px; }
.table-wrap, .table-wrap.scroll { border-radius: 10px; }
.input, .side-search-input { border-radius: 10px; }
.side-search-input { border-radius: 999px; }
.more-sheet { border-radius: 20px; }

/* ——— «Сейчас»: единственный яркий цвет сайта ——— */
.live-dot { background: var(--live); box-shadow: 0 0 0 0 var(--live-glow); }
.card-hero .live-dot { background: var(--live); }
.live-tag, .pill-live { display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; color: var(--live-ink); background: var(--live); border: 0; }
.today-row.is-live { border-color: var(--line); background: var(--surface); box-shadow: inset 3px 0 0 var(--live); }
.chip-live { box-shadow: inset 3px 0 0 var(--live); }
.chip-live .chip-name::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 1.5px var(--live-ink); vertical-align: 1px; }

/* ——— Схема зала ——— */
.seg-2 { max-width: 360px; grid-template-columns: 1fr 1fr; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 16px; padding: 0; list-style: none; color: var(--text-dim); font-size: 0.88rem; }
.map-legend li { display: inline-flex; align-items: center; gap: 8px; }
.map-key { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--border-strong); }
.hall-scroll { overflow-x: auto; padding-bottom: 6px; }
.hall-map { display: grid; gap: 8px; width: max-content; min-width: 100%; }
.hall-seat {
  display: grid; align-content: center; justify-items: center; gap: 2px; min-height: 64px; padding: 6px; border-radius: 8px;
  border: 1.5px solid var(--border-strong); background: var(--panel-2); text-align: center; overflow: hidden;
}
.hall-seat:hover { border-color: var(--accent); }
.seat-num { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.seat-zone { font-size: 0.66rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-free { background: var(--panel-2); }
.map-busy { background: var(--live); border-color: var(--live); color: var(--live-ink); }
.map-busy .seat-zone { color: var(--live-ink); opacity: 0.75; }
.map-broken { border-color: var(--warn); background: repeating-linear-gradient(135deg, transparent 0 6px, var(--warn-bg) 6px 12px), var(--panel-2); }
.hm-c1 { grid-template-columns: repeat(1, minmax(64px, 1fr)); }
.hm-c2 { grid-template-columns: repeat(2, minmax(64px, 1fr)); }
.hm-c3 { grid-template-columns: repeat(3, minmax(64px, 1fr)); }
.hm-c4 { grid-template-columns: repeat(4, minmax(64px, 1fr)); }
.hm-c5 { grid-template-columns: repeat(5, minmax(64px, 1fr)); }
.hm-c6 { grid-template-columns: repeat(6, minmax(64px, 1fr)); }
.hm-c7 { grid-template-columns: repeat(7, minmax(64px, 1fr)); }
.hm-c8 { grid-template-columns: repeat(8, minmax(64px, 1fr)); }
.hm-c9 { grid-template-columns: repeat(9, minmax(64px, 1fr)); }
.hm-c10 { grid-template-columns: repeat(10, minmax(64px, 1fr)); }
.hm-c11 { grid-template-columns: repeat(11, minmax(64px, 1fr)); }
.hm-c12 { grid-template-columns: repeat(12, minmax(64px, 1fr)); }
.hm-c13 { grid-template-columns: repeat(13, minmax(64px, 1fr)); }
.hm-c14 { grid-template-columns: repeat(14, minmax(64px, 1fr)); }
.hm-c15 { grid-template-columns: repeat(15, minmax(64px, 1fr)); }
.hm-c16 { grid-template-columns: repeat(16, minmax(64px, 1fr)); }
.hm-c17 { grid-template-columns: repeat(17, minmax(64px, 1fr)); }
.hm-c18 { grid-template-columns: repeat(18, minmax(64px, 1fr)); }
.hm-c19 { grid-template-columns: repeat(19, minmax(64px, 1fr)); }
.hm-c20 { grid-template-columns: repeat(20, minmax(64px, 1fr)); }
.hm-r1 { grid-row: 1; }
.hm-r2 { grid-row: 2; }
.hm-r3 { grid-row: 3; }
.hm-r4 { grid-row: 4; }
.hm-r5 { grid-row: 5; }
.hm-r6 { grid-row: 6; }
.hm-r7 { grid-row: 7; }
.hm-r8 { grid-row: 8; }
.hm-r9 { grid-row: 9; }
.hm-r10 { grid-row: 10; }
.hm-r11 { grid-row: 11; }
.hm-r12 { grid-row: 12; }
.hm-k1 { grid-column: 1; }
.hm-k2 { grid-column: 2; }
.hm-k3 { grid-column: 3; }
.hm-k4 { grid-column: 4; }
.hm-k5 { grid-column: 5; }
.hm-k6 { grid-column: 6; }
.hm-k7 { grid-column: 7; }
.hm-k8 { grid-column: 8; }
.hm-k9 { grid-column: 9; }
.hm-k10 { grid-column: 10; }
.hm-k11 { grid-column: 11; }
.hm-k12 { grid-column: 12; }
.hm-k13 { grid-column: 13; }
.hm-k14 { grid-column: 14; }
.hm-k15 { grid-column: 15; }
.hm-k16 { grid-column: 16; }
.hm-k17 { grid-column: 17; }
.hm-k18 { grid-column: 18; }
.hm-k19 { grid-column: 19; }
.hm-k20 { grid-column: 20; }

/* ——— Табло смены ——— */
.board { padding: 22px 24px 18px; }
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.board-head h2 { margin: 0; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.82rem; font-weight: 800; }
.board-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 8px; padding: 0 6px; border-radius: 6px; background: var(--live); color: var(--live-ink); font-size: 0.8rem; letter-spacing: 0; }
.board-clock, .board-time, .board-left { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.board-clock { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.8rem); font-weight: 700; letter-spacing: 0.02em; line-height: 1; }
.board-none { margin-bottom: 10px; color: var(--hero-dim); }
.board-list { list-style: none; margin: 0; padding: 0; display: grid; }
.board-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--hero-border); }
.board-mark { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--hero-faint); }
.board-row.is-live .board-mark { background: var(--live); border-color: var(--live); animation: gw-pulse 1.8s ease-out infinite; }
.board-row.is-done { opacity: 0.55; }
.board-name { font-weight: 700; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-name small { margin-left: 8px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--hero-border-2); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; }
.board-time { color: var(--hero-dim); }
.board-left { min-width: 11ch; text-align: right; font-size: 0.92rem; }
.board-row.is-live .board-left { color: var(--hero-text); font-weight: 700; }
@media (max-width: 560px) {
  .board-row { grid-template-columns: 14px minmax(0, 1fr) auto; }
  .board-time { grid-column: 2; grid-row: 2; font-size: 0.85rem; }
  .board-left { grid-column: 3; grid-row: 1 / span 2; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .board-row.is-live .board-mark { animation: none; } }

/* ——— Рисунки пустых экранов ——— */
.empty-art { width: 132px; height: auto; margin-bottom: 4px; }
.ea-dots { fill: var(--text-faint); opacity: 0.55; }
.ea-base { fill: var(--text-faint); opacity: 0.45; }
.ea-top { fill: var(--panel); stroke: var(--border-strong); stroke-width: 1.5; }
.ea-ic { color: var(--text); }
.ea-dot { fill: var(--live); stroke: var(--panel); stroke-width: 1.5; }
.card-hero .ea-top { fill: var(--hero-surface-2); }

.avatar svg, .mini-av svg { width: 62%; height: 62%; fill: currentColor; shape-rendering: crispEdges; }
.avatar { display: inline-grid; place-items: center; }
.avatar.av-0, .mini-av.av-0 { color: #f3f3f5; } .avatar.av-1, .mini-av.av-1 { color: #f3f3f5; } .avatar.av-2, .mini-av.av-2 { color: #fff; }
.mini-av svg { width: 70%; height: 70%; }

/* ===== Дизайн-пакет: моноширинные цифры, разделители, асимметрия, движение, свои элементы управления ===== */
:root { --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; }
.hero-time, .tile-num, .stat-value, .big-num, .chip-time, .today-time, .seat-num, .progress, .money-line, td.num, th.num, .input-num, .board-clock {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.hero-time, .tile-num, .big-num { font-weight: 600; letter-spacing: -0.04em; }

/* Однородные списки: тонкие линии вместо карточек */
.task-row, .today-row { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; padding-left: 2px; padding-right: 2px; }
.task-row:last-child, .today-row:last-child { border-bottom: 0; }
.today-row.is-live { background: transparent; border-color: var(--line); box-shadow: inset 3px 0 0 var(--live); padding-left: 12px; }
.task-row.is-done { background: transparent; }

/* Асимметричные плитки на главной */
@media (min-width: 900px) {
  .tile-grid.tiles-4 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tile-grid.tiles-4 > .tile:first-child { grid-column: span 2; }
  .tile-grid.tiles-3 { grid-template-columns: 2fr 1fr 1fr; }
}
.tile-grid > .tile:first-child .tile-num { font-size: 2.6rem; }

/* Осмысленное движение */
@keyframes gw-pop { 0% { transform: scale(0.7); } 55% { transform: scale(1.18); } 100% { transform: scale(1); } }
.check-btn.is-pop { animation: gw-pop 320ms cubic-bezier(.3,1.6,.5,1); }
@keyframes gw-pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--live-glow); } 50% { box-shadow: 0 0 0 6px transparent; } }
.badge-dot { animation: gw-pulse 2.4s ease-in-out 3; }

/* Загрузка: клавиша-логотип нажимается */
.gw-loader { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: color-mix(in srgb, var(--bg, #fff) 70%, transparent); backdrop-filter: blur(3px); }
.gw-loader .brand-mark { width: 56px; height: 56px; }
.gw-loader .brand-mark svg { width: 100%; height: 100%; overflow: visible; }
@keyframes gw-press { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(3px); } }
.gw-loader .k-top, .gw-loader .k-q, .gw-loader .k-tail, .gw-loader .k-dot { animation: gw-press 900ms ease-in-out infinite; }

/* Переходы между разделами (поддерживающие браузеры; остальным остаётся обычная смена страницы) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .sidebar { view-transition-name: gw-side; }
  .tabbar { view-transition-name: gw-tabs; }
  ::view-transition-old(root) { animation: 140ms ease-in both gw-vt-out; }
  ::view-transition-new(root) { animation: 220ms ease-out both gw-vt-in; }
  @keyframes gw-vt-out { to { opacity: 0; transform: translateX(-12px); } }
  @keyframes gw-vt-in { from { opacity: 0; transform: translateX(14px); } }
}

/* Свои полосы прокрутки и выделение */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::selection { background: var(--live); color: var(--live-ink); }

/* Флажки и переключатели в виде клавиш */
input[type="checkbox"], input[type="radio"] {
  appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 0; flex: none; vertical-align: middle;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 7px; box-shadow: 0 2px 0 var(--border-strong);
  display: inline-grid; place-content: center; cursor: pointer; transition: transform 90ms, box-shadow 90ms, background-color 120ms;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]::after { content: ""; width: 10px; height: 6px; border-left: 2px solid var(--accent-ink); border-bottom: 2px solid var(--accent-ink); transform: rotate(-45deg) scale(0); margin-top: -2px; transition: transform 120ms; }
input[type="radio"]::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-ink); transform: scale(0); transition: transform 120ms; }
input[type="checkbox"]:checked, input[type="radio"]:checked { background: var(--accent); border-color: var(--accent); transform: translateY(2px); box-shadow: 0 0 0 var(--border-strong); }
input[type="checkbox"]:checked::after { transform: rotate(-45deg) scale(1); }
input[type="radio"]:checked::after { transform: scale(1); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--live); outline-offset: 2px; }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: 0.5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { input[type="checkbox"], input[type="radio"], input[type="checkbox"]::after { transition: none; } .check-btn.is-pop, .badge-dot, .gw-loader * { animation: none; } }

/* ===== Расходники: сводка, фильтры, шкала запаса, шаги ===== */
.sum-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.sum { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.sum b { display: block; font-family: var(--font-mono); font-size: 1.7rem; line-height: 1.1; }
.sum span { font-size: 0.8rem; color: var(--text-dim); }
.sum.is-bad b { color: var(--danger, #e5484d); }
.sum.is-warn b { color: var(--warn, #e0a030); }
.chip-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip-f { padding: 6px 14px; border: 1px solid var(--border); border-radius: 99px; font-size: 0.85rem; color: var(--text-dim); }
.chip-f.on { background: var(--live); border-color: var(--live); color: var(--live-ink); font-weight: 700; }
.sbar { display: block; height: 7px; min-width: 110px; border-radius: 4px; background: var(--surface-strong); overflow: hidden; }
.sbar i { display: block; height: 100%; border-radius: 4px; background: var(--live); }
.sbar.is-low i { background: #e5484d; }
.sbar.is-mid i { background: #e0a030; }
.sup-row.is-low td:first-child { box-shadow: inset 3px 0 0 #e5484d; }
.sup-row.is-mid td:first-child { box-shadow: inset 3px 0 0 #e0a030; }
.qty-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.step-btn { min-width: 40px; min-height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); color: var(--text); font-family: var(--font-mono); font-size: 0.9rem; cursor: pointer; }
.step-btn.is-plus { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step-btn:active { transform: translateY(1px); }
.row-edit { margin-top: 8px; }
.row-edit > summary { cursor: pointer; font-size: 0.82rem; color: var(--text-dim); }
.row-edit .tf-form { margin-top: 8px; }
.sb-w0 { width: 0%; }
.sb-w1 { width: 5%; }
.sb-w2 { width: 10%; }
.sb-w3 { width: 15%; }
.sb-w4 { width: 20%; }
.sb-w5 { width: 25%; }
.sb-w6 { width: 30%; }
.sb-w7 { width: 35%; }
.sb-w8 { width: 40%; }
.sb-w9 { width: 45%; }
.sb-w10 { width: 50%; }
.sb-w11 { width: 55%; }
.sb-w12 { width: 60%; }
.sb-w13 { width: 65%; }
.sb-w14 { width: 70%; }
.sb-w15 { width: 75%; }
.sb-w16 { width: 80%; }
.sb-w17 { width: 85%; }
.sb-w18 { width: 90%; }
.sb-w19 { width: 95%; }
.sb-w20 { width: 100%; }
@media (max-width: 560px) { .sum-row { grid-template-columns: 1fr 1fr 1fr; } .sum b { font-size: 1.3rem; } }

/* ===== Брони: сетка «места × часы» ===== */
.bk-grid { border-collapse: separate; border-spacing: 2px; width: 100%; table-layout: fixed; min-width: 760px; font-size: 0.78rem; }
.bk-grid thead th { font-family: var(--font-mono); font-weight: 500; color: var(--text-faint); text-align: center; padding: 2px 0; }
.bk-grid thead th:first-child, .bk-grid tbody th { width: 92px; text-align: left; font-family: var(--font); }
.bk-grid tbody th { font-weight: 650; padding: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-grid .is-now { box-shadow: inset 0 -2px 0 #e5484d; }
.bk-free { height: 30px; padding: 0; background: var(--surface); border-radius: 6px; }
.bk-free a { display: block; height: 100%; border-radius: 6px; }
.bk-free a:hover, .bk-free a:focus-visible { background: var(--surface-strong); outline: 1px solid var(--border-strong); }
.bk-busy { height: 30px; padding: 0; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.bk-busy a { display: block; padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; }
.bk-busy.is-live { background: var(--live); color: var(--live-ink); }

/* ===== Отпуска: лента, календарь года, доска, баланс ===== */
.vac-gantt { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: 100%; min-width: 960px; font-size: 0.78rem; }
.vac-gantt thead th { text-align: left; font-weight: 600; font-size: 0.72rem; color: var(--text-dim); padding: 2px 4px 6px; border-left: 1px solid var(--line); overflow: hidden; white-space: nowrap; }
.vac-gantt thead th:first-child, .vac-gantt tbody th { width: 130px; border-left: 0; text-align: left; }
.vac-gantt tbody th { font-weight: 650; padding: 4px 6px 4px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; }
.vg-gap, .vg-bar { height: 26px; padding: 0; background: var(--surface); }
.vac-gantt tbody tr:nth-child(n) td { border-top: 3px solid transparent; border-bottom: 3px solid transparent; background-clip: padding-box; }
.vg-bar { background: var(--accent); border-radius: 5px; }
.vg-bar.is-pending { background: transparent; box-shadow: inset 0 0 0 2px var(--text-dim); background-image: repeating-linear-gradient(135deg, transparent 0 5px, var(--border-strong) 5px 6px); }
.vac-gantt .is-today { box-shadow: inset 2px 0 0 #e5484d; }
.vg-bar.is-today { box-shadow: inset 2px 0 0 #e5484d; }
.ymonths { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ymonth { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--panel); }
.ymonth h3 { font-size: 0.82rem; color: var(--text-dim); margin-bottom: 6px; }
.ygrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-family: var(--font-mono); font-size: 0.66rem; text-align: center; }
.yd { padding: 3px 0; border-radius: 4px; color: var(--text-faint); }
.yd.is-empty { visibility: hidden; }
.yd.is-vac { background: var(--accent); color: var(--accent-ink); }
.yd.is-pending { box-shadow: inset 0 0 0 1px var(--text-dim); color: var(--text); }
.yd.is-today { box-shadow: inset 0 -2px 0 #e5484d; color: var(--text); }
.vboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: start; }
.vcol h3 { font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; display: flex; justify-content: space-between; }
.vcard { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface); margin-bottom: 8px; }
.vcard.is-pending { border-style: dashed; border-color: var(--text-dim); }
.vcard.is-now { box-shadow: inset 3px 0 0 var(--live); }
.vdates { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }
.vbal { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.vbal li { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: center; font-size: 0.9rem; }
.num-mono { font-family: var(--font-mono); color: var(--text-dim); font-size: 0.85rem; white-space: nowrap; }
@media (max-width: 900px) { .ymonths { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .vbal li { grid-template-columns: 1fr auto; } .vbal .sbar { grid-column: 1 / -1; grid-row: 2; } }
.table-wrap.scroll table.vac-gantt { min-width: 960px; }
.table-wrap.scroll table.bk-grid { min-width: 760px; }
.main > .card, .main > section { min-width: 0; max-width: 100%; }
.vg-bar { position: relative; }

.yd.is-today.is-vac { color: var(--accent-ink); }

.bk-grid .is-now { box-shadow: none; }
.bk-grid thead th.is-now { box-shadow: inset 0 -2px 0 #e5484d; color: var(--text); }
.bk-free.is-now { background: var(--surface-strong); }
.qty-steps { flex-wrap: nowrap; }
.step-btn { min-width: 36px; padding: 0 8px; }
.sup-table td:last-child { min-width: 200px; }

/* ===== Схема зала клуба (SVG) ===== */
.fp { display: block; width: 100%; max-width: 680px; height: auto; margin: 0 auto; }
.fp-wall { stroke: var(--text-dim); stroke-width: 0.7; stroke-linecap: round; }
.fp-wall.fp-tv { stroke: var(--live); stroke-width: 1; }
.fp-door { stroke: var(--text-dim); stroke-width: 0.35; stroke-linecap: round; opacity: 0.8; }
.fp-text { fill: var(--text-faint); font-family: var(--font-display); font-weight: 600; pointer-events: none; }
.fp-text-zone { font-size: 4.2px; }
.fp-text-note { font-size: 2.2px; font-family: var(--font); }
.fp-body { fill: var(--panel-2); stroke: var(--border-strong); stroke-width: 0.45; }
.fp-chair { fill: var(--surface-strong); stroke: var(--border-strong); stroke-width: 0.35; }
.fp-num { fill: var(--text); font-family: var(--font-mono); font-size: 2.1px; font-weight: 700; pointer-events: none; }
.fp-link { cursor: pointer; }
.fp-pc.st-busy .fp-body { fill: var(--live); stroke: var(--live); }
.fp-pc.st-busy .fp-chair { fill: var(--live); stroke: var(--live); opacity: 0.6; }
.fp-pc.st-busy .fp-num { fill: var(--live-ink); }
.fp-pc.st-broken .fp-body { fill: var(--warn-bg); stroke: var(--warn); stroke-width: 0.7; }
.fp-pc.st-broken .fp-chair { stroke: var(--warn); }
.fp-link:hover .fp-body, .fp-link:focus-visible .fp-body { stroke: var(--text); stroke-width: 0.8; }
.fp-link:focus-visible { outline: none; }
.fp-wrap { overflow-x: auto; padding: 8px 0; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Редактор схемы зала */
.plan-hours{display:flex;gap:6px}
.fpe-mobile{display:none}
.fpe-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:8px}
.fpe-bar .btn[aria-pressed="true"]{border-color:var(--live);box-shadow:inset 0 0 0 1px var(--live);font-weight:600}
.fpe-sep{width:1px;height:22px;background:var(--border,currentColor);opacity:.3}
.fpe-save{margin-left:auto}
.fpe-hint{margin:0 0 12px}
.fpe-main{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:16px;align-items:start}
.fpe-canvas{background:var(--panel-2);border:1px solid var(--border,transparent);border-radius:12px;padding:8px;overflow:auto}
.fpe-svg{width:100%;height:auto;display:block;touch-action:none;user-select:none}
.fpe-svg[data-tool="wall"],.fpe-svg[data-tool="door"],.fpe-svg[data-tool="text"],.fpe-svg[data-tool="pc"]{cursor:crosshair}
.fpe-gridline{fill:none;stroke:currentColor;stroke-opacity:.12;stroke-width:.1}
.fpe-bg{fill:url(#fpe-grid)}
.fpe-frame{fill:none;stroke:currentColor;stroke-opacity:.35;stroke-width:.2;stroke-dasharray:1 1}
.fpe-hit{stroke:transparent;stroke-width:2.4;cursor:move}
.fpe-handle{fill:var(--live);stroke:var(--panel);stroke-width:.3;cursor:grab}
.fpe-hinge{fill:currentColor}
.fpe-preview{opacity:.55}
.fp .is-sel{outline:none}
.fp-wall.is-sel,.fp-door.is-sel{stroke:var(--live)}
.fp-pc.is-sel .fp-body{stroke:var(--live);stroke-width:.5}
.fp-text.is-sel{fill:var(--live)}
.fpe-side{display:grid;gap:12px}
.fpe-card{padding:12px}
.fpe-card h2{font-size:1rem;margin:0 0 8px}
.fpe-units{display:flex;flex-wrap:wrap;gap:6px}
.fpe-field{margin-bottom:8px}
.fpe-field label{display:grid;gap:4px}
.fpe-pc-title{margin:0 0 8px;font-weight:600}
@media (max-width:900px){
  .fpe-mobile{display:block;margin-bottom:12px}
  form.fpe,.fpe-hint{display:none}
}

.fpe-card .tf-form{display:grid;grid-template-columns:auto 1fr;gap:8px;align-items:center}
.fpe-card .tf-form .input{width:100%}

/* Склад: пересчёт, история, долги таблицей */
.rc-table th[scope="row"]{white-space:normal;min-width:150px}
.rc-table td .input-num{width:78px;text-align:right}
.rc-table .rc-note{min-width:150px}
.rc-diff{font-weight:700}
.rc-neg{color:var(--danger,#ff6b6b)}
.rc-pos{color:var(--warn)}
.rc-zero{color:var(--text-dim)}
.rc-table tbody tr[hidden]{display:none}
.rc-only{display:inline-flex;gap:8px;align-items:center;cursor:pointer}
.rc-paste{font-family:var(--font-mono);font-size:.85rem;width:100%}
.rc-warn{border-color:var(--warn-line)}
.rc-warn ul{padding-left:18px}
.rc-actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;position:sticky;bottom:12px;z-index:5}
.rc-buttons{display:flex;gap:8px;flex-wrap:wrap;margin-left:auto}
.rc-zero-label{display:inline-flex;gap:8px;align-items:center}
.debt-cell{display:inline-block;min-width:28px;padding:2px 8px;border-radius:8px;background:var(--warn-bg);color:var(--warn);font-weight:700;text-align:center;text-decoration:none}
.debt-grid tfoot th,.debt-grid tfoot td{border-top:1px solid var(--border);border-bottom:0}
@media (max-width:640px){.rc-actions{position:static}.rc-table td .input-num{width:64px}}

.seg.seg-5{grid-template-columns:repeat(5,1fr)}
.seg.seg-5 a{padding:0 4px;font-size:.92rem}
@media (max-width:640px){.seg.seg-5 a{font-size:.8rem;padding:0 2px}}
.rc-table .input{min-height:34px;padding:4px 8px}
.rc-table tbody th,.rc-table tbody td{padding-top:6px;padding-bottom:6px;vertical-align:middle}
.debt-grid tbody th[scope="row"],.debt-grid tfoot th[scope="row"]{position:sticky;left:0;z-index:1;background:var(--surface)}

@media (max-width:639px){
  .rc-count,.rc-count tbody{display:block;width:100%}
  .rc-count thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .rc-count tbody tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 10px;margin-bottom:10px;padding:8px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface)}
  .rc-count tbody th{grid-column:1/-1;padding:4px 0;border:0}
  .rc-count tbody td{display:block;min-width:0;padding:4px 0;border:0;text-align:left}
  .rc-count tbody td::before{content:attr(data-label);display:block;color:var(--text-dim);font-size:.72rem}
  .rc-count tbody td[data-label=""]::before{content:none}
  .rc-count tbody td:last-child{grid-column:1/-1}
  .rc-count td .input-num,.rc-count td .rc-note{width:100%;min-width:0}
  .rc-count tbody td.num{text-align:left}
  .rc-count .rc-diff{font-size:1.05rem}
}

/* Согласование правок графика */
.req-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.req { padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.req p + p { margin-top: 4px; }
.req-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.req-actions .input { flex: 1 1 200px; min-width: 0; }

/* Задачи: блок «Сделать сейчас» и крупные цели нажатия на телефоне */
.today-card { border-color: var(--accent-line); }
.today-card h2 { margin: 0; }
@media (max-width: 899px) {
  .task-row { padding: 12px 10px; }
  .check-btn { width: 40px; height: 40px; min-width: 40px; }
  .person > summary { flex-wrap: wrap; row-gap: 6px; }
  .tf-form { flex-wrap: wrap; }
}

/* Справочник: картинки отдельным блоком под текстом */
.faq-gallery { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.faq-fig { display: grid; gap: 6px; align-content: start; }
.faq-fig img { width: 100%; height: 130px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); display: block; }
.faq-fig .btn { width: 100%; }

/* Чек-лист смены */
.task-row.is-problem { border-color: var(--danger); }
.badge.status-bad { background: var(--danger-bg); color: var(--danger); }

/* Поле выбора файла: кнопка в стиле сайта, ровные отступы */
.input[type="file"] { padding: 8px 10px; height: auto; line-height: 1.4; color: var(--text-dim); cursor: pointer; }
.input[type="file"]::file-selector-button { margin-right: 12px; padding: 8px 14px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; }
.input[type="file"]::file-selector-button:hover { filter: brightness(1.12); }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; }
