/* отчёты об испытаниях
   Палитра полигона: зелёно-серая «бумага», тёмный «полевой» текст, сигнальный жёлтый для действий.
   Интерфейс пилота рассчитан на телефон на солнце и в перчатках: крупные поля, высокий контраст. */

:root {
  color-scheme: light;
  --paper: #edf0ea;
  --surface: #fafbf8;
  --ink: #18211b;
  --ink-2: #4b564e;
  --muted: #7a847c;
  --line: #d5dbd2;
  --line-strong: #b9c2b6;
  --signal: #f2c230;
  --signal-ink: #18211b;
  --signal-hover: #e5b31c;
  --link: #22598f;
  --ok: #2f7a43;
  --warn: #9a6a00;
  --bad: #b8322c;
  --bad-bg: #fbe9e7;
  --ok-bg: #e6f2e8;
  --warn-bg: #fbf1d5;
  --focus: #22598f;
  /* графики */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --grid: #e1e5de;
  --axis: #b9c2b6;
  --s-good: #0ca30c;
  --s-warning: #fab219;
  --s-serious: #ec835a;
  --s-critical: #d03b3b;
  --s-lost: #7c1f1f;
  --s-neutral: #9aa39b;
  --radius-s: 6px;
  --radius-m: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-plate: "Roboto Condensed", "Arial Narrow", "Liberation Sans Narrow", sans-serif-condensed, var(--font);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #111612;
    --surface: #1a201c;
    --ink: #e8ece6;
    --ink-2: #a9b3ab;
    --muted: #7f8a81;
    --line: #2b332d;
    --line-strong: #3b453e;
    --link: #7fb2ea;
    --ok: #5fbf77;
    --warn: #e2b24a;
    --bad: #f07a72;
    --bad-bg: #3a1d1b;
    --ok-bg: #18301f;
    --warn-bg: #352b12;
    --focus: #7fb2ea;
    --series-1: #3987e5;
    --series-2: #d95926;
    --grid: #262d28;
    --axis: #3b453e;
    --s-lost: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111612; --surface: #1a201c; --ink: #e8ece6; --ink-2: #a9b3ab; --muted: #7f8a81;
  --line: #2b332d; --line-strong: #3b453e; --link: #7fb2ea; --ok: #5fbf77; --warn: #e2b24a; --bad: #f07a72;
  --bad-bg: #3a1d1b; --ok-bg: #18301f; --warn-bg: #352b12; --focus: #7fb2ea;
  --series-1: #3987e5; --series-2: #d95926; --grid: #262d28; --axis: #3b453e; --s-lost: #e66767;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.45 var(--font);
}
a { color: var(--link); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.boot { padding: 40vh 16px; text-align: center; color: var(--muted); }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------- бортовой номер: «табличка» как маркировка на фюзеляже ---------- */
.plate {
  display: inline-block; font-family: var(--font-plate); font-weight: 700; font-stretch: condensed;
  letter-spacing: .02em; line-height: 1; padding: .18em .42em .14em; border-radius: 3px;
  background: var(--signal); color: var(--signal-ink); white-space: nowrap;
  box-shadow: inset 0 0 0 2px var(--signal-ink);
}
.plate.lg { font-size: 30px; }
.plate.broken { background: var(--s-critical); color: #fff; box-shadow: inset 0 0 0 2px #5c1512; }

/* ---------- шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: #18211b; color: #e8ece6;
}
:root[data-theme="dark"] .topbar { background: #0b0f0c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topbar { background: #0b0f0c; } }
.brand { font-family: var(--font-plate); font-weight: 700; font-size: 20px; letter-spacing: .04em; display: flex; align-items: center; gap: 8px; }
.brand svg { width: 26px; height: 26px; }
.topbar .spacer { flex: 1; }
@media (max-width: 480px) { .who { display: none; } }
.who { font-size: 14px; color: #c7d0c6; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync {
  display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: #2b3a30; color: #e8ece6;
}
.sync .dot { width: 9px; height: 9px; border-radius: 50%; background: #5fbf77; }
.sync.offline .dot { background: #fab219; }
.sync.error .dot { background: #f07a72; }
.sync.busy .dot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .sync.busy .dot { animation: none; } }
.iconbtn { border: 0; background: transparent; color: inherit; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.iconbtn:hover { background: rgba(255,255,255,.08); }

/* ---------- навигация пилота (снизу, под большой палец) ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  border: 0; background: none; padding: 10px 4px 12px; font-size: 14px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; border-top: 3px solid transparent;
}
.tabs button[aria-current="page"] { color: var(--ink); border-top-color: var(--signal); }
.tabs .badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--signal); color: var(--signal-ink); font-size: 12px; margin-left: 4px; }

.page { max-width: 760px; margin: 0 auto; padding: 16px 16px 140px; }
.page h1 { font-size: 24px; line-height: 1.2; margin: 6px 0 4px; }
.page .lead { color: var(--ink-2); margin: 0 0 16px; }

/* ---------- форма ---------- */
fieldset {
  border: 0; margin: 0 0 14px; padding: 14px 14px 6px; background: var(--surface);
  border-radius: var(--radius-m); box-shadow: inset 0 0 0 1px var(--line);
}
legend { float: left; width: 100%; padding: 0; margin: 0 0 10px; font-weight: 700; font-size: 17px; }
fieldset > legend ~ * { clear: both; }
.grid { display: grid; gap: 0 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.full { grid-column: 1 / -1; }
@media (max-width: 420px) { .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: block; margin-bottom: 12px; min-width: 0; }
.field > span { display: block; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field > span em { font-style: normal; font-weight: 400; color: var(--muted); }
input[type=text], input[type=number], input[type=date], input[type=password], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: var(--radius-s);
  border: 1px solid var(--line-strong); background: var(--paper); font-size: 17px;
}
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { background: #121813; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: -1px; }
.field.invalid input, .field.invalid select { border-color: var(--bad); }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--line-strong); background: var(--paper); border-radius: 999px; padding: 9px 14px;
  font-size: 15px; cursor: pointer; min-height: 42px;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.bad[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); color: #fff; }

.outcomes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.outcome {
  text-align: left; padding: 12px; min-height: 56px; border-radius: var(--radius-s); cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--paper); font-weight: 600; display: flex; gap: 8px; align-items: center;
}
.outcome { overflow-wrap: anywhere; hyphens: auto; }
.outcome i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.outcome[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); background: var(--surface); }

.rowlist .row { display: grid; grid-template-columns: 1fr 84px 44px; gap: 8px; margin-bottom: 8px; }
.rowlist .row input { min-height: 44px; }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 10px 18px; border-radius: var(--radius-s); border: 1px solid var(--line-strong);
  background: var(--surface); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); }
.btn.primary:hover { background: var(--signal-hover); }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.submitbar {
  position: fixed; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 15;
  padding: 10px 16px; background: linear-gradient(to top, var(--paper) 70%, transparent);
}
.submitbar .inner { max-width: 760px; margin: 0 auto; display: flex; gap: 8px; }
.submitbar .btn.primary { flex: 1; font-size: 18px; min-height: 54px; }

/* медиа */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 12px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: var(--radius-s); overflow: hidden; background: var(--line); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .rm { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 18px; cursor: pointer; }
.thumb .tag { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; padding: 1px 6px; border-radius: 4px; }
.addmedia { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.addmedia label { cursor: pointer; }
.addmedia input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* выбор полёта для досылки */
.flightpick { display: grid; gap: 8px; margin-bottom: 12px; max-height: 360px; overflow: auto; }
.flightopt {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; text-align: left;
  padding: 10px 12px; border-radius: var(--radius-s); border: 1px solid var(--line-strong); background: var(--paper); cursor: pointer;
}
.flightopt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); border-color: var(--ink); background: var(--surface); }
.flightopt .meta { font-size: 14px; color: var(--ink-2); }
.flightopt .plate { grid-row: span 2; font-size: 20px; }

/* карточки отчётов */
.list { display: grid; gap: 8px; }
.item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 12px;
  background: var(--surface); border-radius: var(--radius-m); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; text-align: left; border: 0; width: 100%;
}
.item .plate { grid-row: span 2; font-size: 20px; }
.item .t { font-weight: 600; }
.item .m { font-size: 14px; color: var(--ink-2); }
.state { font-size: 13px; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; grid-row: span 2; }
.state.ok { background: var(--ok-bg); color: var(--ok); }
.state.wait { background: var(--warn-bg); color: var(--warn); }
.state.bad { background: var(--bad-bg); color: var(--bad); }
.section-title { font-size: 15px; font-weight: 700; color: var(--ink-2); margin: 20px 0 8px; }

.notice { padding: 12px 14px; border-radius: var(--radius-m); margin-bottom: 14px; background: var(--warn-bg); color: var(--ink); }
.notice.bad { background: var(--bad-bg); }
.notice.ok { background: var(--ok-bg); }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-2); background: var(--surface); border-radius: var(--radius-m); box-shadow: inset 0 0 0 1px var(--line); }

/* модальное окно / подробности */
dialog { border: 0; padding: 0; border-radius: var(--radius-m); background: var(--surface); color: var(--ink); width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(10, 14, 11, .55); }
.dlg-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dlg-head h2 { font-size: 18px; margin: 0; flex: 1; }
.dlg-body { padding: 16px; }
.report-text { white-space: pre-wrap; font-size: 15px; line-height: 1.55; background: var(--paper); padding: 12px 14px; border-radius: var(--radius-s); margin: 0 0 14px; }
.delivery { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: #18211b; }
.login form { width: min(400px, 100%); background: var(--surface); border-radius: 14px; padding: 24px 20px; }
.login .brand { color: var(--ink); font-size: 26px; margin-bottom: 4px; }
.login .brand svg rect { fill: var(--ink); }
.login p { color: var(--ink-2); margin: 0 0 18px; }

/* ---------- админка ---------- */
.admin { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 52px); }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 10px; }
.side button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 8px; font-weight: 600; color: var(--ink-2); cursor: pointer; margin-bottom: 2px; }
.side button[aria-current="page"] { background: var(--paper); color: var(--ink); box-shadow: inset 3px 0 0 var(--signal); }
.side .sep { height: 1px; background: var(--line); margin: 12px 4px; }
.main { padding: 20px 24px 60px; min-width: 0; }
.main h1 { font-size: 26px; margin: 0 0 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 14px 0 18px; }
.seg { display: inline-flex; background: var(--surface); border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line-strong); padding: 3px; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 6px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.toolbar .field { margin: 0; }
.toolbar input[type=date] { min-height: 40px; font-size: 15px; padding: 6px 10px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius-m); overflow: hidden; box-shadow: 0 0 0 1px var(--line); margin-bottom: 18px; }
.kpi { background: var(--surface); padding: 14px 16px; }
.kpi .k { font-size: 14px; color: var(--ink-2); }
.kpi .v { font-size: 30px; font-weight: 700; line-height: 1.15; margin: 4px 0 2px; }
.kpi .v small { font-size: 16px; font-weight: 600; color: var(--ink-2); margin-left: 3px; }
.kpi .d { font-size: 13px; color: var(--muted); }
.kpi .d b { font-weight: 600; }
.kpi .d .up-bad, .kpi .d .down-good { color: var(--bad); }
.kpi .d .down-bad { color: var(--ok); }
.kpi.alert .v { color: var(--bad); }

.panels { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.panel { grid-column: span 6; background: var(--surface); border-radius: var(--radius-m); box-shadow: inset 0 0 0 1px var(--line); padding: 16px; min-width: 0; }
.panel.wide { grid-column: span 12; }
.panel.third { grid-column: span 4; }
.panel h3 { font-size: 16px; margin: 0 0 2px; }
.panel .sub { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
@media (max-width: 1100px) { .panel, .panel.third { grid-column: span 12; } }

.forecast { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.fc { padding: 10px 12px; border-radius: var(--radius-s); background: var(--paper); }
.fc .k { font-size: 13px; color: var(--ink-2); }
.fc .v { font-size: 22px; font-weight: 700; }
.fc .t { font-size: 12px; color: var(--muted); }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data td.r, table.data th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: var(--paper); }
.tablewrap { overflow-x: auto; }

/* графики */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .bar.on { opacity: .8; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend i.fc { background: repeating-linear-gradient(135deg, currentColor 0 2px, transparent 2px 5px) !important; }
.tip {
  position: absolute; pointer-events: none; z-index: 5; background: var(--ink); color: var(--paper);
  padding: 6px 10px; border-radius: 6px; font-size: 13px; white-space: nowrap; transform: translate(-50%, -100%);
  margin-top: -8px;
}
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 40%) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.hbar .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { display: block; height: 12px; }
.hbar .fill { display: block; height: 12px; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; }
.hbar .val { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.donutwrap { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: center; }
@media (max-width: 520px) { .donutwrap { grid-template-columns: 1fr; } }
.dlegend { display: grid; gap: 6px; font-size: 14px; }
.dlegend div { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 8px; align-items: center; }
.dlegend i { width: 12px; height: 12px; border-radius: 3px; }
.dlegend .pct { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.dlegend .cnt { color: var(--muted); font-variant-numeric: tabular-nums; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--paper); color: var(--ink-2); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.wait { background: var(--warn-bg); color: var(--warn); }

@media (max-width: 820px) {
  .admin { grid-template-columns: 1fr; }
  .side { display: flex; overflow-x: auto; gap: 4px; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side button { width: auto; white-space: nowrap; margin: 0; }
  .side .sep { display: none; }
  .main { padding: 16px 16px 60px; }
}

#toast {
  position: fixed; left: 50%; bottom: calc(140px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 10px; font-weight: 600;
  max-width: calc(100vw - 32px); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s;
}
#toast.show { opacity: 1; }
@media print { .topbar, .side, .toolbar, .tabs { display: none; } .admin { display: block; } }

/* формы пилота внутри админки */
.admin .page { padding: 0 0 24px; margin: 0; max-width: 760px; }
.admin .submitbar { position: sticky; bottom: 0; padding: 12px 0; }
::placeholder { color: var(--muted); opacity: .75; }

/* ---------- справочники: список + «другое» */
.choice { display: grid; gap: 8px; }
.choice select { appearance: auto; }

/* ---------- состояние оборудования при закрытии полёта */
.eqlist { display: grid; gap: 10px; margin-bottom: 12px; }
.eq { background: var(--paper); border-radius: var(--radius-s); padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--line); border-left: 5px solid var(--ok); }
.eq[data-s="damaged"] { border-left-color: #b97a00; }
.eq[data-s="broken"] { border-left-color: var(--s-critical); }
.eq[data-s="burned"] { border-left-color: #8a3b12; }
.eq[data-s="lost"] { border-left-color: var(--s-lost); }
.eq .name { font-weight: 600; margin-bottom: 8px; overflow-wrap: anywhere; }
.eq .states { display: flex; flex-wrap: wrap; gap: 6px; }
.st { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 8px 12px; font-size: 14px; cursor: pointer; min-height: 40px; }
.st[aria-pressed="true"] { color: #fff; border-color: transparent; font-weight: 600; }
.st[data-s="ok"][aria-pressed="true"] { background: #2f7a43; }
.st[data-s="damaged"][aria-pressed="true"] { background: #9a6a00; }
.st[data-s="broken"][aria-pressed="true"] { background: #b8322c; }
.st[data-s="burned"][aria-pressed="true"] { background: #8a3b12; }
.st[data-s="lost"][aria-pressed="true"] { background: #7c1f1f; }
.rowlist .row.three { grid-template-columns: 1fr 120px 72px 44px; }
.rowlist .row select { min-height: 44px; font-size: 15px; }
@media (max-width: 480px) { .rowlist .row.three { grid-template-columns: 1fr 1fr 64px 44px; } .rowlist .row.three input:first-child { grid-column: 1 / -1; } }

/* ---------- вложения: документы */
.addmedia.docs { align-items: center; }
.addmedia select { width: auto; min-height: 48px; font-size: 16px; }
.thumb.doc { display: grid; place-content: center; gap: 4px; padding: 8px; text-align: center; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.thumb.doc b { font-size: 18px; letter-spacing: .02em; }
.thumb.doc .fn { font-size: 12px; overflow-wrap: anywhere; max-height: 3.6em; overflow: hidden; color: var(--ink-2); }
.thumb.doc a { display: contents; color: inherit; text-decoration: none; }
.mediagroup { margin-bottom: 6px; }
.mediagroup h4 { margin: 14px 0 6px; font-size: 13px; letter-spacing: .06em; color: var(--ink-2); }

/* ---------- справочники (админка) */
.cat-row td:first-child { font-weight: 600; }
.cat-row.off { opacity: .55; }
.tag-auto { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); margin-left: 8px; white-space: nowrap; }
.tag-def { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); margin-left: 8px; white-space: nowrap; }
.rolepick { min-height: 36px; font-size: 14px; padding: 4px 8px; width: auto; }
.viewbadge { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--paper); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.segline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

.sync .lbl { white-space: nowrap; }

.checks{display:grid;gap:8px;margin-top:12px}
.check{display:flex;gap:10px;align-items:flex-start;font-size:15px;min-height:32px}
.check input{width:20px;height:20px;margin-top:2px;flex:none}
table.data td.st-ok{background:var(--ok-bg);color:var(--ok)}
table.data td.st-damaged{background:var(--warn-bg);color:var(--warn);font-weight:600}
table.data td.st-broken,table.data td.st-burned{background:var(--bad-bg);color:var(--bad);font-weight:600}
table.data td.st-lost{background:var(--paper);color:var(--ink);font-weight:600}
table.data tfoot td{font-weight:600;border-top:2px solid var(--line-strong)}

.unitrow{display:flex;gap:8px;align-items:center}
.unitrow input{flex:1;min-width:0}
.unitrow select{flex:0 0 auto;width:auto;min-width:92px;max-width:50%;padding-left:8px;padding-right:4px}
.unitrow input{min-width:56px}
.unitfield .hint{margin-top:4px}

/* ---------- заставка при входе ---------- */
.splash { position: fixed; inset: 0; z-index: 1000; background: #18211b; display: grid; place-items: center; cursor: pointer; transition: opacity .38s ease; }
.splash.out { opacity: 0; pointer-events: none; }
.splash-in { text-align: center; color: #f4f6f1; }
.splash-logo svg { width: 92px; height: 92px; animation: sp-pop .7s cubic-bezier(.2,.9,.3,1.2) both; }
.splash-logo .g-wing { transform-box: fill-box; transform-origin: 50% 100%; animation: sp-wing .8s .15s cubic-bezier(.2,.9,.3,1) both; }
.splash-logo .g-body { transform-box: fill-box; transform-origin: 50% 0; animation: sp-body .5s .45s ease-out both; }
.splash-name { margin-top: 16px; font-family: var(--font-plate); font-weight: 700; font-size: 28px; letter-spacing: .12em; animation: sp-up .6s .4s ease both; }
.splash-sub { margin-top: 4px; font-size: 13px; letter-spacing: .08em; opacity: .65; animation: sp-up .6s .6s ease both; }
@keyframes sp-pop { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes sp-wing { from { transform: translateY(18px) scaleY(.3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sp-body { from { transform: scaleY(0); } to { transform: none; } }
@keyframes sp-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.login form { animation: sp-up .5s ease both; }
@media (prefers-reduced-motion: reduce) { .splash, .splash * , .login form { animation: none !important; transition: none !important; } }

/* ---------- обучение ---------- */
.tour { position: fixed; inset: 0; z-index: 900; }
.tour-hole { position: fixed; display: none; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(8, 12, 9, .66); outline: 2px solid #f2c230; transition: all .25s ease; pointer-events: none; }
.tour-card { position: fixed; background: var(--surface); color: var(--ink); border-radius: 14px; padding: 18px 18px 14px; box-shadow: 0 10px 40px rgba(0,0,0,.35); max-height: calc(100vh - 24px); overflow: auto; }
.tour-card h3 { margin: 2px 0 6px; font-size: 19px; }
.tour-card p { margin: 0 0 12px; color: var(--ink-2); line-height: 1.5; }
.tour-step { font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.tour-dots { display: flex; gap: 5px; margin-bottom: 12px; }
.tour-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.tour-dots span.on { background: #f2c230; width: 18px; border-radius: 4px; }
.tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-actions .spacer { flex: 1; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.tour:has(.tour-hole[style*="display: none"]) { background: rgba(8, 12, 9, .66); }
@media (prefers-reduced-motion: reduce) { .tour-hole { transition: none; } }
.helpbtn { flex: 0 0 34px; font-weight: 700; width: 34px; min-width: 34px; height: 34px; border: 1.5px solid rgba(255,255,255,.35); border-radius: 50%; padding: 0; }

/* ---------- помощь ---------- */
.help { max-width: 820px; padding: 0 0 40px; }
.help .toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.help .toolbar input { flex: 1; min-width: 200px; min-height: 40px; }
.faq-sec h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 24px 0 8px; }
.faq details { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 12px 14px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--ink-2); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0; padding: 0 14px 14px; color: var(--ink-2); line-height: 1.55; }
@media (max-width: 430px) { .topbar .brand span, .topbar .who { display: none; } }

/* ---------- переключатель темы ---------- */
.themebtn { font-size: 18px; line-height: 1; width: 34px; height: 34px; padding: 0; flex: 0 0 34px; }
.login { position: relative; }
.login-theme { position: absolute; top: 14px; right: 14px; color: #f4f6f1; border: 1.5px solid rgba(255,255,255,.3); border-radius: 50%; }

/* ---------- о приложении ---------- */
.about { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 4px; }
.about h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 20px 0 8px; }
.about-list { display: grid; grid-template-columns: minmax(130px, 200px) 1fr; gap: 8px 14px; margin: 0 0 12px; }
.about-list dt { color: var(--ink-2); font-size: 14px; }
.about-list dd { margin: 0; overflow-wrap: anywhere; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.login .about-line { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; margin: 0; font-size: 13px; color: rgba(244,246,241,.6); }
@media (max-width: 520px) { .about-list { grid-template-columns: 1fr; gap: 2px; } .about-list dd { margin-bottom: 8px; } }
.fb-text { white-space: pre-wrap; font: 13px/1.5 ui-monospace, Consolas, monospace; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 55vh; overflow: auto; }

/* Блок «Добавить фото и видео» в карточке отчёта */
.addmore { margin-top: 14px; }
.addmore progress { width: 100%; height: 8px; margin: 8px 0 0; accent-color: var(--accent, #2563eb); }
