/* Дизайн-система обеих систем.
   Холодный «бетонный» серый фон, синий акцент как на макетах ТЗ, единые цвета статусов во всём приложении.
   Шрифты системные: внешние CDN запрещены требованием работы без интернета. */

:root {
  --bg: #e9ecee;
  --panel: #ffffff;
  --panel-2: #f4f6f7;
  --ink: #18212b;
  --muted: #5b6875;
  --line: #c9d0d6;
  --line-soft: #dde2e6;
  --accent: #1f5fbf;
  --accent-ink: #ffffff;
  --accent-soft: #e3ecfa;
  --focus: #1f5fbf;

  /* статусы — из макетов ТЗ; легенда на каждом графике */
  --st-done: #2f9a53;      --st-done-bg: #d6efdd;
  --st-transit: #dd7334;   --st-transit-bg: #fbe2d3;
  --st-loading: #d9a021;   --st-loading-bg: #fcefcd;
  --st-planned: #5a8bd6;   --st-planned-bg: #dce7f8;
  --st-conflict: #c93a3a;  --st-conflict-bg: #f6d6d6;
  --st-none: #9aa5b0;      --st-none-bg: #ffffff;

  --radius-s: 6px;
  --radius-m: 10px;
  --shadow-pop: 0 12px 32px rgba(24, 33, 43, 0.18);
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --rail: 208px;
  color-scheme: light;
}

/* Тёмная тема — для операторской в ночные смены (переключатель на экране оператора) */
:root[data-theme="dark"] {
  --bg: #161d24;
  --panel: #1f2832;
  --panel-2: #26313c;
  --ink: #e6ebef;
  --muted: #9aa7b3;
  --line: #3a4753;
  --line-soft: #2e3944;
  --accent: #5b9bff;
  --accent-ink: #0d1620;
  --accent-soft: #23344d;
  --focus: #8db8ff;
  --st-done-bg: #1e3a29;
  --st-transit-bg: #42291b;
  --st-loading-bg: #40351a;
  --st-planned-bg: #1f3150;
  --st-conflict-bg: #4a2222;
  --st-none-bg: #1f2832;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
#root { min-height: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.right { text-align: right; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.grow { flex: 1 1 auto; min-width: 0; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------- каркас приложения ---------------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; }
.rail {
  background: var(--ink);
  color: #dfe5ea;
  display: flex; flex-direction: column;
  padding: 14px 10px; gap: 2px;
  position: sticky; top: 0; height: 100vh;
}
:root[data-theme="dark"] .rail { background: #0f151b; }
.rail .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: #fff; font-weight: 700; }
.rail .brand svg { flex: none; }
.rail a {
  display: flex; align-items: center; gap: 10px;
  color: inherit; text-decoration: none;
  padding: 9px 10px; border-radius: var(--radius-s);
  font-size: 14px;
}
.rail a:hover { background: rgba(255, 255, 255, 0.07); }
.rail a.active { background: var(--accent); color: #fff; }
.rail a .ico { width: 20px; height: 20px; flex: none; opacity: 0.9; }
.rail .spacer { flex: 1; }
.rail .who { font-size: 13px; padding: 8px 10px; color: #aeb9c3; border-top: 1px solid rgba(255,255,255,0.1); }
.rail .who button { background: none; border: 0; color: #fff; padding: 0; cursor: pointer; text-decoration: underline; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 22px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.content { padding: 18px 22px 40px; display: flex; flex-direction: column; gap: 16px; }
.content.flush { padding: 0; }
.bottom-nav { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .topbar { padding: 12px 16px; }
  .content { padding: 14px 16px 92px; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--panel); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 11px; color: var(--muted); text-decoration: none; padding: 4px 2px;
  }
  .bottom-nav button { background: none; border: 0; font: inherit; font-size: 11px; cursor: pointer; }
  .bottom-nav a.active { color: var(--accent); font-weight: 700; }
  .bottom-nav .ico { width: 22px; height: 22px; }
}

/* ---------------- панели и блоки ---------------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); }
.panel > .ph { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px; }
.panel > .pb { padding: 14px 16px; }
.panel.pad { padding: 14px 16px; }
.split { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

/* ---------------- кнопки и поля ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--panel); color: var(--ink); cursor: pointer; font-weight: 600;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--st-conflict); border-color: var(--st-conflict); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn.big { min-height: 64px; font-size: 19px; padding: 0 22px; border-width: 2px; border-radius: var(--radius-m); }
.btn.block { width: 100%; }
.icon-btn { width: 36px; padding: 0; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--st-conflict); }
.input, .select, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--panel); color: var(--ink);
}
textarea.input { min-height: 72px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.input.invalid { border-color: var(--st-conflict); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.check input { width: 18px; height: 18px; }

/* сегментированные кнопки процента (отчёт прораба, перчатки — крупные цели) */
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.seg button {
  min-height: 48px; border: 1.5px solid var(--line); border-radius: var(--radius-s);
  background: var(--panel); font-weight: 600; font-size: 16px; cursor: pointer;
}
.seg button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); border-width: 2px; }
.stepper { display: inline-grid; grid-template-columns: 48px 56px 48px; border: 1.5px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.stepper button { border: 0; background: var(--panel-2); font-size: 22px; cursor: pointer; min-height: 48px; }
.stepper input { border: 0; text-align: center; font-size: 18px; font-weight: 700; width: 56px; background: var(--panel); }

/* ---------------- таблицы ---------------- */
.table-wrap { overflow: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--panel-2); }
.table td.num, .table th.num { text-align: right; }

/* ---------------- статусы ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
}
.tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st-none); }
.tag.s-done::before { background: var(--st-done); }
.tag.s-transit::before { background: var(--st-transit); }
.tag.s-loading::before { background: var(--st-loading); }
.tag.s-planned::before { background: var(--st-planned); }
.tag.s-conflict::before { background: var(--st-conflict); }
.tag.plain::before { display: none; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 16px; height: 12px; border-radius: 3px; border: 1.5px solid; display: inline-block; }

.sw-done { background: var(--st-done-bg); border-color: var(--st-done); }
.sw-transit { background: var(--st-transit-bg); border-color: var(--st-transit); }
.sw-loading { background: var(--st-loading-bg); border-color: var(--st-loading); }
.sw-planned { background: var(--st-planned-bg); border-color: var(--st-planned); }
.sw-conflict { background: var(--st-conflict-bg); border-color: var(--st-conflict); }
.sw-none { background: var(--st-none-bg); border-color: var(--line); }

/* предупреждения */
.alert {
  border: 1.5px solid var(--st-loading); background: var(--st-loading-bg);
  border-radius: var(--radius-s); padding: 10px 12px;
}
.alert.risk { border-color: var(--st-conflict); background: var(--st-conflict-bg); }
.alert.info { border-color: var(--st-planned); background: var(--st-planned-bg); }
.alert.ok { border-color: var(--st-done); background: var(--st-done-bg); }
.alert .t { font-weight: 600; }
.alert .d { font-size: 13px; color: var(--muted); }

/* ИИ-выводы визуально отделены от фактических данных */
.ai {
  border: 1.5px dashed var(--accent); border-radius: var(--radius-m);
  background: repeating-linear-gradient(135deg, var(--accent-soft) 0 10px, transparent 10px 20px);
  padding: 12px 14px;
}
.ai .badge { font-size: 12px; font-weight: 700; color: var(--accent); }

/* ---------------- показатели ---------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; }
.kpi .k { font-size: 13px; color: var(--muted); }
.kpi .v { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 2px; }
.kpi .s { font-size: 13px; color: var(--muted); }
.kpi.warn { border-color: var(--st-loading); }
.kpi.bad { border-color: var(--st-conflict); }

.bar { height: 10px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--st-done); border-radius: 999px; }
.bar.warn > i { background: var(--st-transit); }
.bar.thin { height: 6px; }

/* ---------------- выезжающая панель и диалоги ---------------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 21, 27, 0.4); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(980px, 100vw);
  background: var(--panel); z-index: 41; display: flex; flex-direction: column;
  box-shadow: var(--shadow-pop);
}
.drawer.narrow { width: min(560px, 100vw); }
.drawer > header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer > .body { overflow: auto; flex: 1; padding: 16px 18px; }
.drawer > footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; }
.modal {
  position: fixed; left: 50%; top: 12vh; transform: translateX(-50%);
  width: min(520px, calc(100vw - 32px)); background: var(--panel); border-radius: var(--radius-m);
  z-index: 41; box-shadow: var(--shadow-pop); padding: 18px; display: flex; flex-direction: column; gap: 14px;
}

/* уведомления */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius-s); max-width: 420px; box-shadow: var(--shadow-pop); }
.toast.err { background: #8f2424; }
@media (max-width: 860px) { .toasts { bottom: 84px; left: 16px; } }

/* связь с сервером */
.netbar { padding: 8px 16px; background: var(--st-conflict); color: #fff; font-weight: 600; text-align: center; }
.netbar.queued { background: var(--st-loading); color: #1b1404; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  border: 0; background: none; padding: 10px 12px; cursor: pointer; color: var(--muted);
  border-bottom: 3px solid transparent; font-weight: 600; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

.empty { padding: 28px; text-align: center; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- вход ---------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .box { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.login .mark { display: flex; gap: 10px; align-items: center; }

/* ---------------- график отгрузок (временная шкала) ---------------- */
.timeline { position: relative; overflow-x: auto; }
.tl-grid { position: relative; min-width: 900px; }
.tl-hours { display: grid; height: 26px; margin-left: 150px; position: relative; font-size: 12px; color: var(--muted); }
.tl-hours span { position: absolute; transform: translateX(-50%); top: 4px; }
.tl-row { display: flex; height: 54px; border-top: 1px solid var(--line-soft); }
.tl-row .lbl { width: 150px; flex: none; padding: 6px 10px; font-size: 13px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line-soft); }
.tl-row .lane { position: relative; flex: 1; background-image: linear-gradient(to right, var(--line-soft) 1px, transparent 1px); }
.tl-row .lane.drop { background-color: var(--accent-soft); }
.trip {
  position: absolute; top: 9px; height: 36px; border-radius: 6px; border: 1.5px solid;
  font-size: 11px; line-height: 1.1; padding: 3px 4px; overflow: hidden; cursor: grab;
  white-space: nowrap; min-width: 6px;
}
.trip:hover { z-index: 3; box-shadow: var(--shadow-pop); }
.trip.risk { outline: 2px dashed var(--st-transit); outline-offset: 1px; }
.trip.late { outline: 2px solid var(--st-conflict); outline-offset: 1px; }
.trip.sel { outline: 3px solid var(--accent); outline-offset: 1px; z-index: 4; }
.downtime { position: absolute; top: 4px; bottom: 4px; background: repeating-linear-gradient(45deg, var(--line) 0 4px, transparent 4px 8px); border-radius: 4px; }
.now-line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--accent); z-index: 2; pointer-events: none; }
.now-line span { position: absolute; bottom: -20px; left: -30px; font-size: 12px; color: var(--accent); white-space: nowrap; }

.order-row { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.order-row:hover { background: var(--panel-2); }
.order-row.active { background: var(--accent-soft); }
.order-row .t1 { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }

/* ---------------- номерной знак (экран оператора) ---------------- */
.plate {
  display: inline-flex; align-items: stretch; border: 4px solid #111; border-radius: 10px;
  background: #fff; color: #111; font-weight: 800; letter-spacing: 0.04em; line-height: 1;
  box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px #111;
}
.plate .main { padding: 10px 18px 8px; font-size: clamp(44px, 7vw, 92px); display: flex; align-items: baseline; gap: 0.18em; flex-direction: row; }
.plate .main small { font-size: 0.72em; }
.plate .reg { border-left: 4px solid #111; padding: 6px 12px; display: flex; flex-direction: column; justify-content: center; align-items: center; font-size: clamp(26px, 3.6vw, 48px); }
.plate .reg .rus { font-size: 0.32em; letter-spacing: 0.1em; margin-top: 4px; display: flex; gap: 4px; align-items: center; }
.plate .reg .flag { width: 1.4em; height: 0.9em; background: linear-gradient(#fff 0 33%, #1c57a5 33% 66%, #d52b1e 66%); border: 1px solid #111; }
.plate.small .main { font-size: 22px; padding: 4px 8px; }
.plate.small .reg { font-size: 15px; padding: 2px 6px; }
.plate.small { border-width: 2px; border-radius: 5px; box-shadow: none; }
.plate.small .reg { border-left-width: 2px; }

.operator { min-height: 100vh; display: flex; flex-direction: column; }
.operator .head { display: flex; align-items: center; gap: 14px; padding: 14px 22px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.operator .body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 18px; padding: 18px 22px; flex: 1; }
@media (max-width: 1000px) { .operator .body { grid-template-columns: 1fr; } }
.now-card { border: 3px solid var(--accent); border-radius: 14px; background: var(--panel); padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.now-card.flash { animation: flash 1.2s ease 2; }
@keyframes flash { 50% { background: var(--st-loading-bg); } }
.queue-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-m); background: var(--panel); }
.queue-item.changed { border-color: var(--st-loading); background: var(--st-loading-bg); }
.queue-item .time { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; background: var(--st-done); }
.dot.off { background: var(--st-conflict); }

/* ---------------- шахматка и сетки стройки ---------------- */
.chess { display: inline-grid; gap: 6px; align-items: center; }
.chess .cell { width: 54px; height: 34px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--st-none-bg); cursor: pointer; padding: 0; font-size: 11px; font-weight: 600; color: var(--ink); }
.chess .cell.done { background: var(--st-done-bg); border-color: var(--st-done); }
.chess .cell.in_progress { background: var(--st-planned-bg); border-color: var(--st-planned); }
.chess .cell.behind { background: var(--st-loading-bg); border-color: var(--st-loading); }
.chess .cell.critical { background: var(--st-conflict-bg); border-color: var(--st-conflict); }
.chess .cell.none { visibility: hidden; }
.chess .fl { font-size: 13px; color: var(--muted); text-align: right; padding-right: 4px; font-variant-numeric: tabular-nums; }
.chess .fl.cur { color: var(--ink); font-weight: 700; }
.chess .gh { font-size: 12px; color: var(--muted); text-align: center; }
.chess .gap { width: 8px; }
.chess.compact .cell { width: 40px; height: 26px; }

.gantt { overflow-x: auto; }
.gantt table { border-collapse: collapse; font-size: 13px; }
.gantt th, .gantt td { border-bottom: 1px solid var(--line-soft); padding: 0; height: 30px; }
.gantt th.day { width: 34px; min-width: 34px; text-align: center; color: var(--muted); font-weight: 600; font-size: 12px; border-left: 1px solid var(--line-soft); }
.gantt th.day.today { color: var(--accent); background: var(--accent-soft); }
.gantt td.d { border-left: 1px solid var(--line-soft); position: relative; }
.gantt td.d.off { background: var(--panel-2); }
.gantt td.d.today { background: var(--accent-soft); }
.gantt td.name { padding: 0 10px; white-space: nowrap; position: sticky; left: 0; background: var(--panel); z-index: 1; }
.gantt td.crew { padding: 0 8px; color: var(--muted); text-align: center; position: sticky; left: 0; }
.gantt .blk { position: absolute; left: 2px; right: 2px; top: 6px; bottom: 6px; border-radius: 4px; border: 1.5px solid; }
.gantt tr.sep td { border-top: 2px solid var(--line); }
.blk.plan { background: var(--panel-2); border-color: var(--line); }
.blk.done { background: var(--st-done-bg); border-color: var(--st-done); }
.blk.in_progress, .blk.on_time { background: var(--st-planned-bg); border-color: var(--st-planned); }
.blk.behind, .blk.ahead-no { background: var(--st-loading-bg); border-color: var(--st-loading); }
.blk.critical { background: var(--st-conflict-bg); border-color: var(--st-conflict); }
.blk.forecast { background: transparent; border-style: dashed; border-color: var(--muted); }

/* отчёт прораба — телефон */
.mobile-form { max-width: 560px; margin: 0 auto; width: 100%; }
.work-card { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px; background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.work-card .meta { font-size: 13px; color: var(--muted); }
.sticky-action { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; }
@media (max-width: 860px) { .sticky-action { bottom: 64px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .rail, .topbar, .bottom-nav, .no-print { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}

/* дочерние элементы сеток не растягивают страницу (шкала графика прокручивается внутри панели) */
.split > *, .cols-2 > *, .cols-3 > * { min-width: 0; }
.main { overflow-x: hidden; }

/* загрузка бригад */
.gantt .load { width: 100%; height: 26px; border: 0; border-radius: 4px; background: transparent; font-weight: 600; font-size: 12px; cursor: pointer; color: var(--ink); }
.gantt .load.busy { background: var(--st-planned-bg); box-shadow: inset 0 0 0 1.5px var(--st-planned); }
.gantt .load.par { background: var(--st-transit-bg); box-shadow: inset 0 0 0 1.5px var(--st-transit); }
.gantt .load.idle { background: var(--st-loading-bg); box-shadow: inset 0 0 0 1.5px var(--st-loading); }
.gantt .load.fut { opacity: .7; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-s); display: block; }
.tpl-grid td input { width: 46px; text-align: center; }
.tpl-grid td.off { background: var(--panel-2); }
