/* «Смена» — стили. Светлая и тёмная темы, телефон (375) и десктоп (1440). */

:root {
  --bg: #f3f2ee;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --surface-3: #efede8;
  --ink: #15171c;
  --ink-2: #474c57;
  --muted: #666b75; /* AA: не ниже 4.5:1 на всех светлых фонах, включая --surface-3 */
  --line: #e2e0da;
  --line-2: #ecebe6;
  --field-line: #858993; /* граница полей и выключенного тумблера: не ниже 3:1 (WCAG 1.4.11) */
  --primary: #15171c;
  --on-primary: #ffffff;
  --accent: #d4ff3a;
  --accent-2: #b8e62a;
  --on-accent: #15171c;
  --green: #128a47;
  --green-bg: #e3f5ea;
  --amber: #a86400;
  --amber-bg: #fff1d6;
  --red: #c73434;
  --red-bg: #fde7e7;
  --blue: #2c5fe0;
  --blue-bg: #e7eeff;
  /* текст на светлых плашках статусов (бейджи, табель) — темнее основных цветов ради AA */
  --green-ink: #0f7a3e;
  --amber-ink: #8f5300;
  --red-ink: #b02a2a;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(21, 23, 28, .05), 0 10px 30px -12px rgba(21, 23, 28, .12);
  --shadow-lg: 0 2px 6px rgba(21, 23, 28, .06), 0 30px 60px -20px rgba(21, 23, 28, .25);
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --side: 248px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0e11; --surface: #15171b; --surface-2: #1a1c21; --surface-3: #22252b; --ink: #f1f2f4; --ink-2: #b9bec8;
    --muted: #898f9b; --line: #2a2d34; --line-2: #212329; --field-line: #6b7180; --primary: #f1f2f4; --on-primary: #0d0e11;
    --green: #3fd27f; --green-bg: rgba(63, 210, 127, .13); --amber: #ffb547; --amber-bg: rgba(255, 181, 71, .13);
    --red: #ff6b6b; --red-bg: rgba(255, 107, 107, .13); --blue: #7aa2ff; --blue-bg: rgba(122, 162, 255, .14);
    --green-ink: #3fd27f; --amber-ink: #ffb547; --red-ink: #ff6b6b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0e11; --surface: #15171b; --surface-2: #1a1c21; --surface-3: #22252b; --ink: #f1f2f4; --ink-2: #b9bec8;
  --muted: #898f9b; --line: #2a2d34; --line-2: #212329; --field-line: #6b7180; --primary: #f1f2f4; --on-primary: #0d0e11;
  --green: #3fd27f; --green-bg: rgba(63, 210, 127, .13); --amber: #ffb547; --amber-bg: rgba(255, 181, 71, .13);
  --red: #ff6b6b; --red-bg: rgba(255, 107, 107, .13); --blue: #7aa2ff; --blue-bg: rgba(122, 162, 255, .14);
  --green-ink: #3fd27f; --amber-ink: #ffb547; --red-ink: #ff6b6b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 0;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -.02em; font-weight: 650; }
p { margin: 0; }
[hidden] { display: none !important; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.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; }
.muted { color: var(--muted); }
:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { top: 12px; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 560; font-size: 14.5px; cursor: pointer;
  white-space: nowrap; text-decoration: none; transition: background-color .2s, border-color .2s, color .2s, box-shadow .2s;
}
.btn:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn--primary:hover { background: color-mix(in srgb, var(--primary) 86%, var(--accent)); border-color: transparent; }
.btn--accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn--danger { color: var(--red); }
.btn--danger:hover { background: var(--red-bg); border-color: transparent; }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn--icon { width: 42px; padding: 0; }
.btn--icon.btn--sm { width: 34px; }
.btn--block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; }

.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 13px; color: var(--ink-2); font-weight: 520; }
.field small { color: var(--muted); font-size: 12.5px; }
.input, .select, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--field-line); background: var(--surface);
  transition: border-color .2s, box-shadow .2s; outline: none;
}
textarea.input { min-height: 80px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--ink-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); }
.input[type="time"], .input[type="date"] { font-variant-numeric: tabular-nums; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 520px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 12px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; min-height: 36px; padding: 0 13px; border-radius: 9px; cursor: pointer; font-weight: 540; font-size: 14px; color: var(--ink-2); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; padding: 6px 0; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track { position: relative; width: 44px; height: 26px; border-radius: 99px; background: var(--field-line); flex: none; transition: background .2s; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .25s var(--ease); }
.switch input:checked + .switch__track { background: var(--green); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2.5px solid var(--blue); outline-offset: 2px; }

.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card__head h2, .card__head h3 { font-size: 16px; font-weight: 640; letter-spacing: -.01em; }
.card__body { padding: 16px 18px 18px; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12.5px; font-weight: 580; white-space: nowrap; background: var(--surface-3); color: var(--ink-2); }
.badge--green { background: var(--green-bg); color: var(--green-ink); }
.badge--amber { background: var(--amber-bg); color: var(--amber-ink); }
.badge--red { background: var(--red-bg); color: var(--red-ink); }
.badge--blue { background: var(--blue-bg); color: var(--blue); }
.badge--accent { background: var(--accent); color: var(--on-accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.dot--live { animation: live 1.6s infinite; }
.motion-paused .dot--live { animation: none; }
@keyframes live { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 650; font-size: 14px; flex: none; color: #fff; background: var(--c, #5b8def); }
.avatar--sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.avatar--lg { width: 52px; height: 52px; border-radius: 16px; font-size: 18px; }

.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; min-height: 220px; color: var(--muted); gap: 12px; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- Тосты и окна ---------- */
.toasts { position: fixed; z-index: 80; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
/* У тоста нет кнопок и ссылок — он не перехватывает нажатия: кнопка «Добавить N смен» и нижнее меню под ним работают */
.toast { background: var(--primary); color: var(--on-primary); padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 14.5px; display: flex; gap: 10px; align-items: center; pointer-events: none; }
/* один и тот же красный в обеих темах: белый текст на #ff6b6b тёмной темы давал 2.78:1 */
.toast--error { background: #c73434; color: #fff; }
.toast--ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(10, 11, 14, .48); backdrop-filter: blur(3px); }
.modal__box { position: relative; width: min(480px, 100%); max-height: calc(100svh - 32px); overflow: auto; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); }
.modal__box--wide { width: min(720px, 100%); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.modal__head h2 { font-size: 19px; }
.modal__head p { color: var(--muted); margin-top: 4px; font-size: 14px; }
.modal__body { padding: 18px 22px; display: grid; gap: 14px; }
.modal__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 22px 20px; flex-wrap: wrap; }
.modal__foot .spacer { flex: 1; }
@media (max-width: 560px) {
  .modal { place-items: end center; padding: 0; }
  .modal__box { border-radius: 22px 22px 0 0; max-height: 92svh; width: 100%; }
}

/* ---------- Стартовая страница ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(16px, 4vw, 40px); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -.02em; text-decoration: none; }
.logo__mark { width: 32px; height: 32px; border-radius: 10px; background: var(--primary); display: grid; place-items: center; flex: none; }
.logo__mark svg { width: 20px; height: 20px; }
.logo small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: 0; }

.start { position: relative; overflow: hidden; }
.hero { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 72px); align-items: center; padding: clamp(24px, 5vw, 64px) clamp(16px, 4vw, 40px) clamp(48px, 7vw, 96px); max-width: 1280px; margin: 0 auto; min-height: calc(100svh - 64px); }
.hero__bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.hero__bg-grid { position: absolute; inset: -10px; display: grid; grid-template-columns: repeat(var(--cols, 18), 1fr); grid-auto-rows: 54px; gap: 6px; opacity: .65; -webkit-mask-image: radial-gradient(ellipse 75% 65% at 35% 45%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse 75% 65% at 35% 45%, #000 20%, transparent 75%); }
.hero__bg-grid i { border-radius: 10px; border: 1px solid var(--line); background: transparent; }
.hero__bg-grid i.on { border-color: transparent; background: color-mix(in srgb, var(--c) 30%, transparent); }
.hero > *:not(.hero__bg) { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-2); font-size: 13px; font-weight: 560; color: var(--ink-2); box-shadow: var(--shadow); }
.eyebrow b { background: var(--accent); color: var(--on-accent); border-radius: 99px; padding: 2px 8px; font-size: 12px; }
.hero h1 { font-size: clamp(38px, 6.2vw, 84px); line-height: .98; letter-spacing: -.045em; font-weight: 700; margin: 22px 0 18px; }
.hero h1 em { font-style: normal; background: var(--accent); color: var(--on-accent); border-radius: .14em; padding: 0 .1em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hero__lead { font-size: clamp(16px, 1.5vw, 19px); color: var(--ink-2); max-width: 30em; }
.hero__points { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 26px; color: var(--ink-2); font-size: 14px; }
.hero__points span { display: inline-flex; gap: 8px; align-items: center; }
.hero__points .ico { color: var(--green); }

.login { padding: 22px; border-radius: 26px; background: var(--surface); box-shadow: var(--shadow-lg); border: 1px solid var(--line-2); width: min(440px, 100%); justify-self: end; }
.login__tabs { display: grid; grid-template-columns: 1fr 1fr; }
.login__tabs button { min-height: 42px; }
.login__pane { padding-top: 20px; }
.login__title { font-size: 21px; font-weight: 650; letter-spacing: -.02em; }
.login__sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.pin { display: flex; justify-content: center; gap: 9px; margin: 22px 0 18px; }
.pin__cell { width: 46px; height: 56px; border-radius: 14px; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; background: var(--surface-2); }
.pin__cell.is-filled { border-color: var(--ink); background: var(--surface); }
.pin__cell.is-next { border-color: var(--ink-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 50%, transparent); }
.pin-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pin.is-error .pin__cell { border-color: var(--red); color: var(--red); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { min-height: 54px; border-radius: 14px; border: 0; background: var(--surface-3); font-size: 22px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.keypad button:hover { background: color-mix(in srgb, var(--surface-3) 70%, var(--line)); }
.keypad button:active { background: var(--accent); }
.keypad .keypad__fn { font-size: 15px; font-weight: 560; color: var(--ink-2); background: transparent; }
.login__error { color: var(--red); font-size: 14px; min-height: 20px; text-align: center; margin-top: 10px; }
.login__form { display: grid; gap: 14px; margin-top: 18px; }
.pass { position: relative; }
.pass .btn { position: absolute; right: 4px; top: 4px; min-height: 36px; width: 36px; }
.demo { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; }
.demo__title { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); font-weight: 560; margin-bottom: 10px; }
.demo__list { display: flex; flex-wrap: wrap; gap: 6px; }
.demo__chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 99px; padding: 5px 10px 5px 6px; font-size: 13px; cursor: pointer; }
.demo__chip:hover { border-color: var(--ink-2); }
.demo__chip i { width: 18px; height: 18px; border-radius: 6px; background: var(--c); }
.demo__chip b { font-variant-numeric: tabular-nums; font-weight: 620; letter-spacing: .04em; }
.login__foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.linklike { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); cursor: pointer; font-weight: 540; }
.linklike:hover { text-decoration-color: var(--ink); }

/* Продающая часть */
.section { max-width: 1280px; margin: 0 auto; padding: clamp(56px, 8vw, 120px) clamp(16px, 4vw, 40px); }
.section__head { max-width: 760px; margin-bottom: clamp(28px, 4vw, 56px); }
.section__kicker { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.section h2 { font-size: clamp(30px, 4.4vw, 58px); letter-spacing: -.04em; font-weight: 700; }
.steps { display: grid; gap: 22px; }
.step { min-height: 74svh; display: flex; align-items: stretch; }
.step__inner { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(24px, 4vw, 56px); align-items: center; width: 100%; background: var(--surface); border-radius: 30px; padding: clamp(24px, 4vw, 52px); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); }
.step--accent .step__inner { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.step--accent .step__inner p { color: color-mix(in srgb, var(--on-primary) 70%, transparent); }
.step:nth-child(3) .step__inner { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.step:nth-child(3) .step__inner p { color: rgba(21, 23, 28, .72); }
.step__num { font-size: 14px; font-weight: 650; letter-spacing: .1em; }
.step h3 { font-size: clamp(28px, 3.6vw, 48px); letter-spacing: -.035em; margin: 12px 0 16px; font-weight: 700; }
.step p { font-size: clamp(15px, 1.4vw, 18px); color: var(--ink-2); max-width: 28em; }
.mock { border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line-2); padding: 16px; color: var(--ink); overflow: hidden; }
.mock-grid { display: grid; grid-template-columns: 90px repeat(7, 1fr); gap: 5px; font-size: 11.5px; }
.mock-grid > span { padding: 6px 4px; color: var(--muted); font-weight: 560; text-align: center; }
.mock-grid > b { font-weight: 600; padding: 7px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.mock-grid > i { height: 30px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; font-style: normal; font-size: 10.5px; font-weight: 600; color: transparent; }
.mock-grid > i.on { background: color-mix(in srgb, var(--c) 30%, var(--surface)); color: var(--ink); box-shadow: inset 3px 0 0 var(--c); }
.phone { width: min(290px, 100%); margin: 0 auto; border-radius: 40px; background: #0b0c0f; padding: 12px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); }
.phone__screen { border-radius: 30px; background: #f3f2ee; color: #15171c; padding: 26px 18px 22px; display: grid; gap: 16px; justify-items: center; text-align: center; }
.phone__time { font-size: 40px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.phone__btn { width: 150px; height: 150px; border-radius: 50%; background: #d4ff3a; display: grid; place-items: center; font-weight: 700; font-size: 16px; box-shadow: 0 0 0 10px rgba(212, 255, 58, .25), 0 0 0 22px rgba(212, 255, 58, .12); }
.ledger { display: grid; gap: 8px; background: rgba(255, 255, 255, .55); border-radius: 20px; padding: 18px; }
.ledger__row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .7); font-size: 14px; }
.ledger__row b { font-variant-numeric: tabular-nums; }
.ledger__row--total { background: #15171c; color: #fff; font-weight: 650; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { padding: 24px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line-2); }
.stat b { display: block; font-size: clamp(34px, 4vw, 54px); letter-spacing: -.04em; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 14px; }
.marquee { --marquee-gap: 40px; overflow: hidden; padding: 26px 0; border-block: 1px solid var(--line); }
.marquee__track { display: flex; gap: var(--marquee-gap); width: max-content; }
.marquee__track span { font-size: clamp(26px, 3.4vw, 46px); font-weight: 650; letter-spacing: -.03em; white-space: nowrap; display: inline-flex; align-items: center; gap: var(--marquee-gap); }
.marquee__track span::after { content: ""; width: 14px; height: 14px; border-radius: 4px; background: var(--accent); transform: rotate(45deg); }
/* Пауза движения (WCAG 2.2.2): кнопка в шапке ставит html.motion-paused, твины GSAP бегущей строки
   ставит на паузу скрипт в index.html; цветные клетки фона героя прячутся — сетка остаётся неподвижной */
.marquee.is-paused .marquee__track, .motion-paused .marquee__track { animation-play-state: paused; }
/* при «уменьшить движение» клетки и так неподвижны, а кнопка скрыта — не прячем их без возможности вернуть */
@media (prefers-reduced-motion: no-preference) { .motion-paused .hero__bg-grid i.on { visibility: hidden !important; } }
.motion-toggle .ico--play, .motion-toggle[aria-pressed="true"] .ico--pause { display: none; }
.motion-toggle[aria-pressed="true"] .ico--play { display: block; }
@media (prefers-reduced-motion: reduce) { .motion-toggle { display: none; } }
.cta { text-align: center; display: grid; justify-items: center; gap: 18px; }
.cta p { color: var(--ink-2); max-width: 34em; font-size: 17px; }
.footer { padding: 28px clamp(16px, 4vw, 40px) 40px; color: var(--muted); font-size: 13.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; max-width: 1280px; margin: 0 auto; }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 8px; gap: 22px; }
  .login { justify-self: stretch; width: 100%; }
  .hero h1 { margin: 16px 0 10px; }
  .hero__points { margin-top: 16px; }
  .hero__intro { order: 0; }
  .step { min-height: 0; }
  .step__inner { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .topbar .logo small, .topbar [data-action="connect"] { display: none; }
  .hero__lead { font-size: 15.5px; }
  .hero__points { display: none; }
  .login { padding: 16px; border-radius: 22px; }
  .pin__cell { width: 42px; height: 52px; }
  .mock-grid { grid-template-columns: 62px repeat(7, 1fr); }
  .stats { gap: 10px; }
  .stat { padding: 18px; }
}

/* ---------- Общий каркас приложения ---------- */
.app { min-height: 100svh; }

/* Кабинет работника */
/* minmax(0, 1fr): широкая карточка не распирает колонку шире экрана (320 px) */
.worker { max-width: 560px; margin: 0 auto; padding: 14px 16px 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.w-head { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.w-head__name { font-weight: 650; font-size: 16.5px; line-height: 1.2; }
.w-head__pos { color: var(--muted); font-size: 13.5px; }
.w-head__actions { margin-left: auto; display: flex; gap: 4px; }
/* isolation: ореол .punch__halo (z-index:-1) рисуется над фоном карточки, но под кнопкой */
.punch-card { padding: 22px 18px 24px; display: grid; justify-items: center; gap: 16px; text-align: center; overflow: hidden; position: relative; isolation: isolate; }
.punch-card__clock { font-size: 46px; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.punch-card__date { color: var(--muted); font-size: 14px; margin-top: 6px; }
.punch-card__date::first-letter { text-transform: uppercase; }
.punch-card__plan { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-2); background: var(--surface-2); border-radius: 99px; padding: 7px 14px; }
.punch { position: relative; width: 216px; height: 216px; border-radius: 50%; border: 0; cursor: pointer; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; font-size: 19px; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.punch__halo { position: absolute; inset: -14px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 30%, transparent); z-index: -1; }
.punch__inner { display: grid; gap: 6px; justify-items: center; }
.punch__inner .ico { width: 34px; height: 34px; stroke-width: 2.2; }
.punch--on { background: var(--primary); color: var(--on-primary); }
.punch--on .punch__halo { background: color-mix(in srgb, var(--green) 22%, transparent); }
.punch__timer { font-size: 34px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.punch__label { font-size: 14px; font-weight: 560; opacity: .8; }
.punch__ring { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); pointer-events: none; }
.punch__ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.punch__ring .bg { stroke: color-mix(in srgb, var(--ink) 10%, transparent); }
.punch__ring .fg { stroke: var(--green); transition: stroke-dashoffset 1s linear; }
.punch[disabled] { opacity: .7; cursor: progress; }
.punch-card__hint { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; justify-content: center; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 14px; background: var(--amber-bg); color: var(--ink); font-size: 14px; }
.alert .ico { color: var(--amber); margin-top: 1px; }
.alert--red { background: var(--red-bg); }
.alert--red .ico { color: var(--red); }
.days { list-style: none; margin: 0; padding: 0; display: grid; }
.days li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 14.5px; }
.days li:last-child { border-bottom: 0; }
.days .is-today { font-weight: 650; }
.days__day { display: flex; gap: 10px; align-items: center; }
.days__day small { color: var(--muted); font-weight: 450; }
.shift-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 9px; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--c, var(--blue)) 18%, var(--surface)); box-shadow: inset 3px 0 0 var(--c, var(--blue)); }
.off { color: var(--muted); font-size: 13.5px; }
.money__big { font-size: 40px; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.money__big small { font-size: 18px; font-weight: 600; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.money__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.money__cell { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.money__cell span { display: block; font-size: 12.5px; color: var(--muted); }
.money__cell b { font-size: 17px; font-variant-numeric: tabular-nums; }
.month-nav { display: flex; align-items: center; gap: 4px; }
.month-nav b { min-width: 118px; text-align: center; font-weight: 600; font-size: 14.5px; text-transform: capitalize; }
.marks { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.marks td, .marks th { padding: 9px 4px; border-bottom: 1px solid var(--line-2); text-align: left; }
.marks th { font-size: 12.5px; color: var(--muted); font-weight: 560; }
.marks td:last-child, .marks th:last-child { text-align: right; }

/* Админка */
/* minmax(0, 1fr): длинное название компании или широкая таблица не раздвигают колонку шире экрана */
.admin { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100svh; }
.side { position: sticky; top: 0; height: 100svh; padding: 18px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; background: var(--surface-2); }
.side__brand { padding: 4px 8px; }
.side__biz { font-size: 13px; color: var(--muted); margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; text-decoration: none; color: var(--ink-2); font-weight: 540; font-size: 14.5px; }
.nav a:hover { background: var(--surface-3); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.nav a[aria-current="page"] .ico { color: var(--accent); }
.side__foot { margin-top: auto; display: grid; gap: 8px; }
.mode { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); }
.mode b { font-weight: 600; }
.mode small { display: block; color: var(--muted); font-size: 12px; }
.main { min-width: 0; padding: 22px clamp(16px, 2.6vw, 36px) 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -.035em; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 14px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.week-nav { display: flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.week-nav b { padding: 0 10px; font-weight: 600; font-size: 14px; white-space: nowrap; min-width: 150px; text-align: center; }
.week-nav .btn { min-height: 34px; width: 34px; padding: 0; border: 0; }
.mtop { position: sticky; top: 0; z-index: 30; display: none; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-2); }
/* длинное название компании сжимается с многоточием, кнопки справа не переносятся */
.mtop .logo { flex: 1; min-width: 0; }
.mtop .row { flex: none; flex-wrap: nowrap; }
.bnav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: none; grid-template-columns: repeat(6, 1fr); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bnav a { display: grid; justify-items: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 10.5px; font-weight: 560; padding: 4px 0; border-radius: 10px; }
.bnav a .ico { width: 21px; height: 21px; }
.bnav a[aria-current="page"] { color: var(--ink); }
.bnav a[aria-current="page"] .ico { color: var(--ink); background: var(--accent); border-radius: 8px; padding: 2px; width: 25px; height: 25px; margin: -2px; }
@media (max-width: 960px) {
  .admin { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .mtop { display: flex; }
  .bnav { display: grid; }
  .main { padding: 16px 16px 96px; }
}

/* Главная */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi { padding: 16px 18px; }
.kpi > span { font-size: 13px; color: var(--muted); font-weight: 520; display: flex; gap: 7px; align-items: center; }
.kpi b { display: block; font-size: 30px; font-weight: 700; letter-spacing: -.035em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi small { color: var(--muted); font-size: 13px; }
.kpi--accent { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.kpi--accent > span, .kpi--accent small { color: rgba(21, 23, 28, .65); }
.dash { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: start; }
.dash > div { display: grid; gap: 14px; min-width: 0; }
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, 1fr); } .dash { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .kpi b { font-size: 24px; } .kpi { padding: 13px 14px; } }
.people { list-style: none; margin: 0; padding: 0; display: grid; }
.people li { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.people li:last-child { border-bottom: 0; }
.people__main { min-width: 0; flex: 1; }
.people__name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.people__sub { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.timeline { position: relative; display: grid; gap: 8px; }
.timeline__scale { display: grid; grid-template-columns: 130px 1fr; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline__ticks { position: relative; height: 18px; }
.timeline__ticks span { position: absolute; transform: translateX(-50%); }
.timeline__row { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 0; }
.timeline__name { font-size: 13.5px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 10px; display: flex; gap: 8px; align-items: center; }
.timeline__name i { width: 8px; height: 8px; border-radius: 3px; background: var(--c); flex: none; }
.timeline__track { position: relative; height: 30px; border-radius: 9px; background: repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px calc(100% / var(--hours, 18))); background-color: var(--surface-2); }
.tl-plan, .tl-fact { position: absolute; top: 4px; bottom: 4px; border-radius: 7px; }
.tl-plan { border: 1.5px dashed color-mix(in srgb, var(--c) 80%, var(--ink)); background: color-mix(in srgb, var(--c) 10%, transparent); }
.tl-fact { top: 8px; bottom: 8px; background: var(--c); border-radius: 5px; }
.tl-fact.is-open { background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 50%, transparent)); }
.tl-now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; z-index: 2; }
.tl-now::before { content: attr(data-time); position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 650; background: var(--accent); color: var(--on-accent); border-radius: 6px; padding: 1px 5px; font-variant-numeric: tabular-nums; }
.tl-now:not([data-time])::before { display: none; }
.timeline__legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.timeline__legend span { display: inline-flex; gap: 6px; align-items: center; }
.lg-plan { width: 18px; height: 10px; border: 1.5px dashed var(--ink-2); border-radius: 4px; }
.lg-fact { width: 18px; height: 6px; background: var(--ink-2); border-radius: 3px; }
@media (max-width: 560px) { .timeline__scale, .timeline__row { grid-template-columns: 84px 1fr; } }

/* Таблица-сетка (график, табель) */
.sheet { position: relative; overflow: auto; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow); max-height: calc(100svh - 190px); overscroll-behavior: contain; }
@media (max-width: 960px) { .sheet { max-height: calc(100svh - 240px); } }
.grid-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
.grid-table th, .grid-table td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); padding: 0; vertical-align: top; }
.grid-table thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); font-weight: 560; color: var(--ink-2); padding: 9px 8px; text-align: left; white-space: nowrap; font-size: 12.5px; }
.grid-table tfoot td { position: sticky; bottom: 0; z-index: 3; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; padding: 8px; font-variant-numeric: tabular-nums; }
.grid-table .col-name { position: sticky; left: 0; z-index: 2; background: var(--surface); min-width: 196px; max-width: 196px; padding: 10px 12px; }
.grid-table thead .col-name, .grid-table tfoot .col-name { z-index: 4; background: var(--surface-2); }
.grid-table th.is-today { background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); color: var(--on-accent); }
.grid-table td.is-today { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.grid-table .is-weekend:not(.is-today) { background: color-mix(in srgb, var(--surface-3) 45%, var(--surface)); }
.grid-table thead .is-weekend:not(.is-today) { background: var(--surface-3); }
.grid-table .col-total { min-width: 92px; padding: 10px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.who__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who__sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dayhead { display: grid; gap: 1px; }
.dayhead b { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.is-today .dayhead b, .is-today .dayhead span { color: var(--on-accent); }

.grid-table th { text-align: left; }
.grid-table tbody th { font-weight: inherit; }
.sched td.cell { min-width: 110px; height: 62px; padding: 5px; cursor: pointer; position: relative; }
.sched td.cell:hover { background: color-mix(in srgb, var(--blue) 6%, var(--surface)); }
.sched.is-brush td.cell { cursor: crosshair; }
.sched.is-brush td.cell:hover { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.cell__stack { display: grid; gap: 4px; }
.chip { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; border: 0; text-align: left; padding: 6px 8px; border-radius: 8px; font-size: 12.5px; font-weight: 620; font-variant-numeric: tabular-nums; cursor: pointer; background: color-mix(in srgb, var(--c) 20%, var(--surface)); color: var(--ink); box-shadow: inset 3px 0 0 var(--c); line-height: 1.2; }
.chip small { font-weight: 500; color: var(--ink-2); font-size: 11px; }
.chip:hover { background: color-mix(in srgb, var(--c) 32%, var(--surface)); }
.chip.is-pending { opacity: .55; }
.cell__add { position: absolute; inset: 5px; border-radius: 8px; border: 1.5px dashed var(--line); display: grid; place-items: center; color: var(--muted); opacity: 0; transition: opacity .15s; pointer-events: none; }
.sched:not(.is-brush) td.cell:hover .cell__add { opacity: 1; }
.cell__stack:not(:empty) + .cell__add { display: none; }
.brushbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 12px; }
.brushbar__label { font-size: 13px; color: var(--muted); font-weight: 560; padding: 0 6px; display: flex; gap: 6px; align-items: center; }
.brush { display: inline-flex; gap: 7px; align-items: center; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; min-height: 34px; padding: 0 11px; cursor: pointer; font-size: 13px; font-weight: 560; }
.brush small { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.brush[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.brush[aria-pressed="true"] small { color: rgba(21, 23, 28, .7); }
.brush--eraser[aria-pressed="true"] { background: var(--red-bg); border-color: var(--red); color: var(--red-ink); }
.hint { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }

.ts td.tcell { min-width: 44px; height: 44px; text-align: center; vertical-align: middle; font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 600; cursor: pointer; position: relative; }
.ts td.tcell:hover { outline: 2px solid var(--ink-2); outline-offset: -2px; }
.ts thead th.tday { text-align: center; padding: 7px 2px; min-width: 44px; }
.ts thead th.tday span { display: block; font-size: 10.5px; font-weight: 500; }
.tv { display: inline-grid; place-items: center; min-width: 34px; height: 28px; border-radius: 7px; padding: 0 3px; background: color-mix(in srgb, var(--green) calc(var(--k, .5) * 34%), transparent); }
.tv--plan { background: transparent; border: 1.5px dashed var(--line); color: var(--muted); font-weight: 500; }
.tv--miss { background: var(--red-bg); color: var(--red-ink); }
.tv--open { background: var(--amber-bg); color: var(--amber-ink); }
.tv__half { position: absolute; bottom: 2px; right: 4px; font-style: normal; font-size: 11px; line-height: 1; color: var(--ink-2); }
.tv__late { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend .tv { min-width: 22px; height: 18px; font-size: 10px; }

/* Обычные таблицы */
.table-wrap { overflow: auto; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); text-align: left; white-space: nowrap; }
.table thead th { background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); font-weight: 560; position: sticky; top: 0; z-index: 1; }
.table td.r, .table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: var(--surface-2); }
.table tfoot td { font-weight: 650; background: var(--surface-2); }
.table .actions { text-align: right; }
.table .actions .btn { margin-left: 4px; }
.table tr.is-open > td { background: var(--surface-2); }
.table tr.detail > td { background: var(--surface-2); white-space: normal; padding: 0 12px 14px; }
.due { font-weight: 700; }
.due--neg { color: var(--red); }
.due--zero { color: var(--muted); font-weight: 500; }
.adj-list { display: grid; gap: 6px; padding-top: 4px; }
.adj { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--line-2); border-radius: 11px; padding: 8px 10px; font-size: 13.5px; }
.adj__main { display: flex; gap: 10px; align-items: center; min-width: 0; flex-wrap: wrap; }
.adj-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.adj-form .input, .adj-form .select { min-height: 38px; width: auto; }
.sum-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 760px) { .sum-cards { grid-template-columns: 1fr; } }

/* Сотрудники */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.person { padding: 16px; display: grid; gap: 14px; }
.person__top { display: flex; gap: 12px; align-items: center; }
.person__name { font-weight: 650; font-size: 16px; line-height: 1.2; }
.person__pos { color: var(--muted); font-size: 13.5px; }
.person__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.person__meta div { background: var(--surface-2); border-radius: 11px; padding: 8px 10px; font-size: 13px; }
.person__meta span { display: block; color: var(--muted); font-size: 12px; }
.person__meta b { font-weight: 600; font-variant-numeric: tabular-nums; }
.person__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.person.is-archived { opacity: .62; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors button { width: 32px; height: 32px; border-radius: 10px; border: 0; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .0); }
.colors button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.code-big { font-size: 46px; font-weight: 700; letter-spacing: .14em; text-align: center; font-variant-numeric: tabular-nums; padding: 16px; border-radius: 18px; background: var(--accent); color: var(--on-accent); }

/* Настройки */
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 1100px) { .settings { grid-template-columns: minmax(0, 1fr); } }
.settings .card__body { display: grid; gap: 14px; }
/* Узкий телефон: длинные подписи кнопок («Ссылка и QR для сотрудников») переносятся, а не вылезают за экран */
@media (max-width: 400px) {
  .settings .card__body .row .btn { white-space: normal; max-width: 100%; text-align: center; line-height: 1.25; padding-top: 8px; padding-bottom: 8px; }
}
.tpl-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr .8fr auto; gap: 8px; align-items: center; }
.tpl-row .input { min-height: 40px; padding: 8px 10px; }
@media (max-width: 560px) { .tpl-row { grid-template-columns: 1fr 1fr; } .tpl-row .input:first-child { grid-column: 1 / -1; } }
.radio-list { display: grid; gap: 8px; }
.radio { display: flex; gap: 11px; align-items: flex-start; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.radio input { margin-top: 3px; accent-color: var(--ink); }
.radio b { font-weight: 600; font-size: 14px; display: block; }
.radio small { color: var(--muted); font-size: 12.5px; }
.radio:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }
.qr { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 16px; width: fit-content; margin: 0 auto; }
.qr svg, .qr img { width: 200px; height: 200px; }
.copy-field { display: flex; gap: 6px; }
.copy-field .input { font-size: 13px; }
.steps-list { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps-list li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 12px; font-size: 14.5px; }
.steps-list li::before { content: counter(s); width: 30px; height: 30px; border-radius: 10px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; }
.steps-list b { display: block; margin-bottom: 3px; }
.steps-list p { color: var(--ink-2); }
.steps-list .row { margin-top: 8px; }
kbd { font: inherit; font-size: 12.5px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }

/* Печать ведомости */
.print-only { display: none; }
@media print {
  body { background: #fff; color: #000; }
  .side, .mtop, .bnav, .toolbar, .page-head .toolbar, .no-print, .toasts { display: none !important; }
  .admin { display: block; }
  .main { padding: 0; }
  .print-only { display: block; margin-bottom: 12px; }
  .table-wrap, .card { box-shadow: none; border: 0; }
  .table th, .table td { padding: 6px 8px; font-size: 12px; }
  /* без прокрутки и с переносами — правые колонки ведомости не срезаются на A4 */
  .table-wrap { overflow: visible; }
  .table th, .table td, .who__name, .who__sub { white-space: normal; }
}

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

/* ---------- Дополнения ---------- */
.ico--xs { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; }
.sched.is-brush td.cell { touch-action: none; user-select: none; -webkit-user-select: none; }
@media (max-width: 640px) {
  .grid-table .col-name { min-width: 128px; max-width: 128px; padding: 8px 10px; }
  .grid-table .col-name .avatar { display: none; }
  .sched td.cell { min-width: 104px; }
  .page-head { align-items: stretch; }
  .page-head .toolbar { width: 100%; }
  .week-nav { flex: 1; justify-content: space-between; }
  .week-nav b { min-width: 0; }
  .brushbar .hint { display: none; }
  .table th, .table td { padding: 10px 9px; }
}
@media print {
  .sheet { max-height: none; overflow: visible; box-shadow: none; }
  .grid-table thead th, .grid-table tfoot td, .grid-table .col-name { position: static; }
  .cell__add, .brushbar { display: none !important; }
}

/* ---------- Облачный режим: вход, кабинет, формы ---------- */
.field > label { font-size: 13px; color: var(--ink-2); font-weight: 520; }
/* соседние поля в .grid2 разной высоты: поле не растягивается под соседа */
.field { align-content: start; }
.field__error, .field .field__error { color: var(--red-ink); font-size: 12.5px; font-weight: 540; }
.field__error:empty { display: none; }
.field__error--after { margin-top: -6px; }
.input[aria-invalid="true"] { border-color: var(--red); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 22%, transparent); }
.form-stack { display: grid; gap: 14px; }
.form-error { color: var(--red-ink); font-size: 14px; }
.form-note { font-size: 13px; }
.check { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--field-line); border-radius: 12px; cursor: pointer; font-weight: 560; transition: border-color .2s, background-color .2s; }
.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--green); }
.check:has(input:checked) { border-color: var(--green); background: var(--green-bg); }
.alert--info { background: var(--blue-bg); }
.alert--info .ico { color: var(--blue); }
.alert .linklike { margin-left: 2px; }

/* Шапка: главная кнопка «Создать кабинет» не прячется и на телефоне */
.topbar__cta { padding: 0 14px; }
@media (max-width: 380px) { .topbar__cta { padding: 0 10px; font-size: 13px; } .topbar .row { gap: 6px; } }
/* Узкие телефоны (320–360 px): клетки кода сжимаются, кнопка «Создать кабинет» остаётся в одной строке с логотипом */
@media (max-width: 360px) {
  .pin { gap: 6px; }
  .pin__cell { flex: 1 1 0; min-width: 0; max-width: 42px; }
}
@media (max-width: 340px) { .topbar .motion-toggle { display: none; } }

/* Код компании на экране входа сотрудника */
.biz { margin-bottom: 18px; }
/* с полем кода компании карточка выше — чуть плотнее клетки и клавиатура */
.biz:not([hidden]) ~ .pin { margin: 16px 0 14px; }
.biz:not([hidden]) ~ .keypad button { min-height: 50px; }
.motion-paused .biz__plate .biz__mark { animation: none; }
.biz__row { display: flex; gap: 8px; }
.biz__input { text-transform: uppercase; letter-spacing: .14em; font-weight: 620; font-size: 17px; font-variant-numeric: tabular-nums; min-width: 0; flex: 1; }
.biz__input::placeholder { color: var(--muted); opacity: 1; font-weight: 500; }
.biz__plate { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); }
.biz__mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); flex: none; }
.biz__plate[data-state="offline"] .biz__mark { background: var(--amber-bg); color: var(--amber-ink); }
.biz__plate[data-state="checking"] .biz__mark { animation: live 1.2s infinite; }
.biz__info { display: grid; min-width: 0; flex: 1 1 140px; }
.biz__info b { font-weight: 640; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.biz__info small { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.biz__change { font-size: 13.5px; white-space: nowrap; margin-left: auto; }
.login__links { display: flex; justify-content: space-between; gap: 10px 16px; margin-top: 14px; font-size: 14px; flex-wrap: wrap; }

/* Код восстановления: крупно, моноширинным */
.rcode { display: grid; justify-items: center; gap: 6px; padding: 18px 14px; border-radius: 18px; background: var(--accent); color: var(--on-accent); text-align: center; }
.rcode__label { font-size: 12px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; }
.rcode__value { font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace; font-size: clamp(22px, 6.6vw, 34px); font-weight: 700; letter-spacing: .08em; word-break: break-all; user-select: all; }
.rcode__tools { justify-content: center; }
.rcode__note { font-size: 13px; }
.rcode-input { text-transform: uppercase; letter-spacing: .08em; font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace; }
.rcode-input::placeholder { color: var(--muted); opacity: 1; }

/* Вопросы на стартовой странице */
.faq .section__head { margin-bottom: clamp(22px, 3vw, 40px); }
.faq__list { display: grid; gap: 10px; max-width: 880px; }
.faq__item { background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); }
.faq__item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px 18px 22px; font-weight: 620; font-size: clamp(16px, 1.5vw, 18.5px); letter-spacing: -.01em; border-radius: 18px; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: ""; width: 30px; height: 30px; flex: none; border-radius: 10px; color: var(--ink);
  background: linear-gradient(currentColor, currentColor) center / 12px 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 12px no-repeat, var(--surface-3);
  transition: transform .35s var(--ease), background-color .2s;
}
.faq__item[open] summary::after { transform: rotate(45deg); color: var(--on-accent); background-color: var(--accent); }
.faq__item summary:hover::after { background-color: color-mix(in srgb, var(--surface-3) 70%, var(--line)); }
.faq__item[open] summary:hover::after { background-color: var(--accent-2); }
.faq__item summary:focus-visible { outline-offset: -3px; border-radius: 18px; }
.faq__a { padding: 0 22px 20px; display: grid; gap: 10px; color: var(--ink-2); max-width: 70ch; font-size: 15.5px; }
.footer__note { max-width: 64ch; }

/* Настройки в облаке */
.card__lead { font-size: 13.5px; }
.bizcode { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--field-line); }
.bizcode__label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 520; }
.bizcode__value { display: block; font-size: 26px; letter-spacing: .12em; font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace; font-weight: 700; }
.share { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.share__side { display: grid; gap: 10px; min-width: 0; }
.qr--sm { margin: 0; padding: 8px; border-radius: 12px; }
.qr--sm svg { width: 128px; height: 128px; }
.copy-field .input { min-width: 0; }
@media (max-width: 520px) { .share { grid-template-columns: 1fr; justify-items: center; } .share__side { width: 100%; } }
.actions-list { list-style: none; margin: 0; padding: 0; display: grid; }
.actions-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.actions-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.actions-list b { display: block; font-weight: 600; font-size: 14px; }
.actions-list small { color: var(--muted); font-size: 12.5px; }
.actions-list .btn { flex: none; }
.card--danger { border-color: color-mix(in srgb, var(--red) 40%, var(--line-2)); }
.card--danger .card__head h2 { color: var(--red-ink); }
/* сплошная красная кнопка: один цвет в обеих темах, белый текст 5:1 */
.btn--danger-solid { background: #c73434; color: #fff; border-color: #c73434; }
.btn--danger-solid:hover { background: #a92a2a; border-color: #a92a2a; }
.del-name { color: var(--ink); font-weight: 650; }

/* Главная нового кабинета: с чего начать */
.onboard { display: grid; gap: 16px; padding: 20px; margin-bottom: 14px; border-color: color-mix(in srgb, var(--accent) 55%, var(--line-2)); box-shadow: inset 4px 0 0 var(--accent), var(--shadow); }
.onboard h2 { font-size: 20px; letter-spacing: -.02em; }
.onboard p { color: var(--ink-2); margin-top: 6px; max-width: 62ch; }
.onboard__steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.onboard__steps li { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 99px; background: var(--surface-2); font-size: 13.5px; font-weight: 560; color: var(--ink-2); }
.onboard__steps b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 12px; color: var(--ink); }
.onboard__steps .is-now b { background: var(--accent); color: var(--on-accent); }

/* Окно с кодом нового сотрудника: QR, код компании и пояснение */
.code-share { margin: 14px 0; }
.code-share__note { font-size: 13px; margin: 0; }
.code-share__link { font-size: 13px; margin: 0; overflow-wrap: anywhere; word-break: break-all; }

/* ---------- Правка смен администратором (specs/003) ----------
   Окно «Смены сотрудника» (.sd-*), окно дня (.de-*), входы из «Главной», «Зарплаты» и «Табеля».
   Дни календаря и строки появляются через GSAP (сдвиг по y) — transition у transform им не задаём. */

/* Пустая строка ошибки не добавляет отступ сетки, но остаётся в дереве доступности (role="alert") */
.form-stack > .form-error:empty, .sd-pick > .form-error:empty { position: absolute; }

/* Кнопки небольших действий: на телефоне и сенсорном экране — цель не меньше 42 px */
@media (max-width: 640px), (pointer: coarse) {
  .btn--tap { min-height: 42px; }
  .btn--tap.btn--sm { padding: 0 14px; }
  .brush.btn--tap { min-height: 42px; }
}

/* «Зарплата»: число смен — кнопка, выглядит как число со ссылкой */
.shifts-link { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 36px; min-height: 32px; margin: -6px -8px; padding: 0 8px; border-radius: 8px; font-weight: 650; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); transition: background-color .15s, text-decoration-color .15s; }
.shifts-link:hover { background: var(--surface-3); text-decoration-color: var(--ink); }
.shifts-link:focus-visible { border-radius: 8px; outline-offset: 0; }
@media (max-width: 640px), (pointer: coarse) { .shifts-link { min-height: 40px; min-width: 40px; margin: -9px -8px; } }

/* «Табель»: имя в первой колонке — кнопка, открывает смены сотрудника за месяц */
.ts-name { display: block; width: calc(100% + 12px); min-height: 40px; margin: -4px -6px; padding: 4px 6px; border-radius: 9px; text-align: left; text-decoration: none; font-weight: inherit; transition: background-color .15s; }
.ts-name .who { min-height: 32px; }
.ts-name__text { display: grid; min-width: 0; }
.ts-name__text > span { min-width: 0; }
.ts-name .who__name { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.ts-name:hover { background: var(--surface-2); }
.ts-name:hover .who__name { text-decoration-color: var(--ink); }
.ts-name:focus-visible { border-radius: 9px; outline-offset: -2px; }

/* «Главная»: имя и подпись — одна кнопка (выглядит как прежний текст), быстрые действия — отдельной строкой */
.people__btn { display: grid; align-content: center; gap: 1px; min-height: 40px; margin: -4px 0 -4px -8px; padding: 4px 8px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background-color .15s; }
.people__btn .people__name, .people__btn .people__sub { display: block; min-width: 0; }
/* Подпись (время смены, «вне графика, с …») переносится, а не обрезается. Кнопке оставляем ширину не меньше
   «10:00–21:00»: если рядом не помещаются значки (.people__tags), они целиком уходят на вторую строку
   к правому краю — на 320 px время смены видно целиком и не рвётся посередине */
.people__btn .people__sub { white-space: normal; overflow-wrap: break-word; }
.people li { flex-wrap: wrap; row-gap: 6px; }
.people__btn { flex: 1 1 7rem; }
.people__tags { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; margin-left: auto; }
.people__btn:hover { background: var(--surface-2); }
.people__btn:hover .people__name { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.people__btn:focus-visible { border-radius: 10px; outline-offset: 0; }
.people li.has-act { flex-wrap: wrap; row-gap: 8px; }
.people__act { flex: 1 0 100%; display: flex; padding-left: 41px; }
/* Предупреждения с кнопкой («опаздывает», «не закрыта»): на узком экране кнопка всегда уходит под текст.
   Пустой ::after во всю ширину переносит её на новую строку, отступ слева — под текст, мимо значка */
@media (max-width: 560px) {
  .alert:has(> .btn) { flex-wrap: wrap; row-gap: 0; }
  .alert:has(> .btn)::after { content: ""; flex-basis: 100%; order: 1; }
  .alert > .btn { order: 2; margin: 10px 0 0 30px; }
}

/* Окно «Отметить приход» / «Закончить смену»: крупное поле времени */
.quick-time .input { min-height: 56px; font-size: 24px; font-weight: 650; letter-spacing: -.01em; }
.quick-time small { line-height: 1.35; }

/* ----- Окно «Смены сотрудника» ----- */
.sd-box [data-sd-main] { display: grid; gap: 12px; min-width: 0; }
.sd-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.sd-nav b { min-width: 140px; }
.sd-pick-toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.sd-pick-toggle[aria-pressed="true"]:hover { background: var(--accent-2); border-color: var(--accent-2); }
.sd-sum, .de-total { margin-top: 0; }
.sd-legend { margin-top: 0; gap: 8px 14px; }
/* Кнопка «Добавить N смен» всегда видна, даже когда календарь длиннее экрана */
.sd-box .modal__foot { position: sticky; bottom: 0; z-index: 2; padding-top: 12px; background: var(--surface); border-top: 1px solid var(--line-2); }

/* Календарь периода: недели с понедельника */
.sd-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.sd-dow { padding: 2px 0; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sd-day {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-width: 0; min-height: 62px; padding: 5px 4px 7px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: center;
  font-variant-numeric: tabular-nums; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.sd-day__num { align-self: flex-start; min-width: 20px; padding: 0 3px; border-radius: 6px; font-size: 12.5px; font-weight: 600; line-height: 18px; color: var(--ink-2); }
.sd-day__val { flex: 1; display: grid; place-items: center; min-height: 28px; font-size: 12.5px; font-weight: 600; }
.sd-day .tv { min-width: 30px; max-width: 100%; height: 26px; font-size: 12.5px; }
.sd-day.is-weekend { background: color-mix(in srgb, var(--surface-3) 45%, var(--surface)); }
.sd-dow.is-weekend, .sd-day.is-weekend .sd-day__num { color: var(--muted); }
button.sd-day:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.sd-day:focus-visible { border-radius: 12px; outline-offset: 2px; }
/* Сегодня — как в шапке табеля: число на салатовой плашке */
.sd-day.is-today { border-color: var(--ink-2); }
.sd-day.is-today .sd-day__num { background: var(--accent); color: var(--on-accent); }
/* Дни соседних периодов — для ориентира, тускло и без кнопки */
.sd-day--out { cursor: default; background: transparent; border-color: transparent; opacity: .45; }
.sd-day--out.is-weekend { background: transparent; }

/* Режим «Отметить отработанные дни»: выбрать можно прошедшие дни без отметок — у них пунктир и кружок */
.is-picking .sd-day[aria-pressed] { border: 1.5px dashed var(--field-line); }
.is-picking .sd-day.is-locked { background: transparent; border-color: transparent; }
.is-picking .sd-day.is-locked .sd-day__num { color: var(--muted); }
/* Сегодня с отметкой (выбрать нельзя): число остаётся тёмным на салатовой плашке — серый на ней в тёмной теме нечитаем */
.is-picking .sd-day.is-today.is-locked .sd-day__num { color: var(--on-accent); }
.sd-day__check { position: absolute; top: 4px; right: 4px; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--field-line); background: var(--surface); color: transparent; }
.sd-day__check .ico { width: 11px; height: 11px; stroke-width: 3; }
.is-picking .sd-day[aria-pressed="true"] { background: var(--accent); border: 1.5px solid var(--accent); color: var(--on-accent); }
.is-picking .sd-day[aria-pressed="true"]:hover { background: var(--accent-2); border-color: var(--on-accent); }
.is-picking .sd-day[aria-pressed="true"] .sd-day__num { color: var(--on-accent); }
.is-picking .sd-day[aria-pressed="true"] .sd-day__check { background: var(--on-accent); border-color: var(--on-accent); color: var(--accent); }
/* На салатовом фоне значения дня — тёмные в обеих темах, иначе пропадает контраст */
.is-picking .sd-day[aria-pressed="true"] .tv { background: rgba(21, 23, 28, .08); border-color: rgba(21, 23, 28, .4); color: var(--on-accent); }

/* Панель выбора дней под календарём */
.sd-pick { display: grid; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); }
.sd-pick__info { font-size: 14px; color: var(--ink-2); font-weight: 520; }
.sd-pick .switch { padding: 0; }
.sd-switch__title { font-weight: 600; font-size: 14px; }
.sd-pick .switch small { font-size: 12.5px; }
.sd-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sd-times__hint { margin-top: -6px; font-size: 12.5px; }
.sd-pick .input { background: var(--surface); }

/* ----- Окно дня ----- */
.de-body { display: grid; gap: 18px; min-width: 0; }
.de-sec { display: grid; gap: 8px; min-width: 0; }
.de-h { font-size: 13px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.de-sec .adj-list { padding-top: 0; }
.de-sec .row { gap: 8px; }
.de-meta { font-size: 13px; }
.de-empty { font-size: 13.5px; padding: 2px 0; }
.de-note, .de-len { font-size: 13px; }
.de-len { margin-top: -6px; }
.de-box .adj .btn { flex: none; }
.de-box .money__cell b { font-size: 16px; }
@media (max-width: 520px) {
  .de-shift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .de-shift-grid .field:last-child { grid-column: 1 / -1; }
}

/* Телефон: окна смен без лишних полей, календарь помещается в 320 px */
@media (max-width: 560px) {
  .sd-box .modal__head { padding: 18px 16px 0; }
  .sd-box .modal__body { padding: 14px 16px; }
  .sd-box .modal__foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
  .sd-tools > * { flex: 1 1 100%; }
  .sd-cal { gap: 4px; }
  .sd-day { min-height: 58px; padding: 4px 2px 6px; border-radius: 10px; }
  .sd-day:focus-visible { border-radius: 10px; }
  .sd-day__num { font-size: 12px; padding: 0 2px; min-width: 0; }
  .sd-day .tv { min-width: 0; width: 100%; height: 24px; padding: 0 1px; font-size: 11.5px; }
  .sd-day__check { top: 3px; right: 3px; width: 14px; height: 14px; }
  .sd-day__check .ico { width: 9px; height: 9px; }
  .sd-pick { padding: 12px; }
}
@media (max-width: 360px) {
  .sd-cal { gap: 3px; }
  .sd-dow { font-size: 10.5px; letter-spacing: 0; }
  .sd-day .tv { font-size: 10.5px; }
}

/* ---------- Команды ---------- */
.teams-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; }
.team-chip-group { display: inline-flex; align-items: center; gap: 0; }
.team-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 99px; cursor: pointer; font-size: 14px; font-weight: 560; }
.team-chip b { font-weight: 640; color: var(--muted); font-variant-numeric: tabular-nums; }
.team-chip:hover { background: var(--surface-2); }
.team-chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.team-chip[aria-pressed="true"] b { color: inherit; opacity: .7; }
.team-chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.team-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.team-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent); }
.team-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.team-select { min-height: 40px; width: auto; max-width: 200px; }
.team-members { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.team-members legend { padding: 0; margin-bottom: 6px; font-size: 13.5px; font-weight: 560; color: var(--ink-2); }
.team-member { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.team-member:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }
.team-member input { width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.team-member span { display: grid; min-width: 0; }
.team-member small { color: var(--muted); font-size: 12.5px; }
.sched tr.sched-group th { text-align: left; padding: 14px 12px 6px; background: var(--surface-2); font-size: 13.5px; font-weight: 650; position: static; }
.sched tr.sched-group th small { color: var(--muted); font-weight: 520; margin-left: 4px; }
.sched tr.sched-group .team-dot { margin-right: 8px; vertical-align: 0; }
/* Подпись группы прилипает к левому краю, когда широкую таблицу листают вбок */
.sched-group__label { position: sticky; left: 12px; display: inline-flex; align-items: center; white-space: nowrap; }
@media (max-width: 640px) {
  /* Отступ со всех сторон — чтобы рамка фокуса у крайних чипов не обрезалась прокруткой; отрицательный margin держит прежнее место */
  .teams-bar { flex-wrap: nowrap; overflow-x: auto; padding: 5px; margin: -5px -5px 13px; scrollbar-width: none; }
  .team-chip { white-space: nowrap; }
  .team-select { max-width: 150px; }
}
@media print { .teams-bar, .team-select { display: none !important; } .sched-group__label { position: static; } }

/* ---------- Периоды графика и ведомости: неделя, месяц, половины, свои даты ---------- */
.period-kinds { padding: 3px; }
.period-kinds button { min-height: 34px; padding: 0 11px; font-size: 13.5px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
/* Компактная сетка для периода длиннее недели: узкие клетки, время смены коротко («9–18») */
.sched--compact thead th { padding: 7px 4px; text-align: center; }
.sched--compact .dayhead b { font-size: 14px; }
.sched--compact .dayhead b small { font-size: 10.5px; font-weight: 560; color: var(--ink-2); }
.sched--compact .is-today .dayhead b small { color: var(--on-accent); }
.sched--compact td.cell { min-width: 60px; height: 52px; padding: 4px 3px; }
.sched--compact .cell__stack { gap: 3px; }
.sched--compact .chip { justify-content: center; padding: 5px 3px; font-size: 11.5px; gap: 2px; }
.sched--compact .chip small { display: none; }
.sched--compact .cell__add { inset: 4px 3px; }
.sched--compact tfoot td { padding: 6px 4px; font-size: 11.5px; text-align: center; line-height: 1.35; }
.sched--compact tfoot .col-name, .sched--compact tfoot .col-total { text-align: left; }
.sched--compact tfoot .col-total { text-align: right; }
/* Начисление по графику в итогах строки */
.plan-pay { margin-top: 3px; font-size: 12px; font-weight: 620; color: var(--ink); font-variant-numeric: tabular-nums; }
.col-total .plan-pay { padding-top: 3px; border-top: 1px dashed var(--line); }
.sched-note { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-top: 12px; }
.sched-note p { font-size: 13px; max-width: 760px; }

/* Выбор дней месяца в окне новой смены */
.mpick { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-2); }
/* float выводит legend из рамки fieldset: подпись стоит внутри блока обычной строкой */
.mpick__title { float: left; width: 100%; padding: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.mpick__quick { width: 100%; background: var(--surface-3); }
.mpick__quick button { flex: 1 1 auto; min-height: 34px; padding: 0 10px; font-size: 13px; }
.mpick__range { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.mpick__range .input { background: var(--surface); min-width: 0; }
.mpick__range .btn { min-height: 44px; }
.mpick__info { font-size: 12.5px; }
.mcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mcal__dow { padding: 2px 0; text-align: center; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mcal__day {
  position: relative; height: 40px; min-width: 0; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface);
  color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background-color .15s, border-color .15s;
}
.mcal__day.is-weekend { background: color-mix(in srgb, var(--surface-3) 55%, var(--surface)); color: var(--ink-2); }
.mcal__day:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.mcal__day.is-today { border: 1.5px solid var(--ink-2); }
.mcal__day[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.mcal__day[aria-pressed="true"]:hover { background: var(--accent-2); }
.mcal__day.is-today[aria-pressed="true"] { border-color: var(--on-accent); }
.mcal__dot { display: none; position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--blue); }
.mcal__day.has-shift .mcal__dot { display: block; }
.mcal__day[aria-pressed="true"] .mcal__dot { background: var(--on-accent); }
.mcal__day:focus-visible { border-radius: 10px; }

@media (max-width: 640px) {
  .period-kinds { width: 100%; flex-wrap: nowrap; }
  .period-kinds button { flex: 1 1 auto; padding: 0 6px; justify-content: center; font-size: 13px; }
  .sched--compact td.cell { min-width: 56px; }
}
@media (max-width: 520px) {
  .mpick { padding: 10px; }
  .mpick__range { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mpick__range .btn { grid-column: 1 / -1; min-height: 40px; }
  .mcal { gap: 3px; }
  .mcal__day { height: 38px; font-size: 13px; }
}
@media print { .period-kinds { display: none !important; } }

/* ---------- «Зарплата»: правка записей и смен из строки ведомости ---------- */
/* Раскрытая строка — липкий блок шириной с видимую часть таблицы: на телефоне таблица прокручивается вбок,
   а записи, кнопки «Изменить» / «Удалить» и форма остаются на экране */
.pay-detail { position: sticky; left: 0; display: grid; gap: 10px; max-width: 860px; padding-top: 6px; }
@media (max-width: 960px) { .pay-detail { width: calc(100vw - 2 * clamp(16px, 2.6vw, 36px) - 26px); } }
.adj__act { display: flex; flex: none; gap: 2px; }
.adj-form .select { max-width: 100%; }
@media (max-width: 560px) {
  .adj { padding: 6px 6px 6px 10px; }
  .adj-form > * { flex: 1 1 auto; }
  .adj-form .input[name="amount"] { width: auto !important; flex-basis: 110px; }
  .adj-form .btn { flex: 1 1 100%; min-height: 42px; }
}
/* Кнопки «Изменить» / «Удалить» у записи: на телефоне и сенсорном экране — квадрат 40 px */
@media (max-width: 640px), (pointer: coarse) { .adj__act .btn--icon { width: 40px; min-height: 40px; } }
.adj-hint:empty { display: none; }
