/* CVY Work Log — оформление как на сайте CVY Online, вариант «Синие панели» (примерка 14.10.2026, одобрена владельцем):
   синие панели меню и шапки на спокойном живом фоне, светлая середина для чисел и таблиц, один синий акцент сайта #24456f,
   шрифт Manrope, логотип A без плашки с бликом. Зелёного нет (ПРАВИЛО ВЛАДЕЛЬЦА: «у нас синий»).
   Раскладки задаёт js/shell.js: html[data-shell] = phone (до 767 px), tab (768–1099), desk (от 1100). */

/* Manrope — файлы шрифта CVY Online (brand/fonts, лицензия LICENSE-manrope.txt) */
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url(brand/fonts/manrope-cyrillic-400.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-weight: 500; font-display: swap; src: url(brand/fonts/manrope-cyrillic-500.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url(brand/fonts/manrope-cyrillic-600.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-weight: 400; font-display: swap; src: url(brand/fonts/manrope-latin-400.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 500; font-display: swap; src: url(brand/fonts/manrope-latin-500.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-weight: 600; font-display: swap; src: url(brand/fonts/manrope-latin-600.woff2) format("woff2"); }

/* CVY Onest — запасной шрифт, файлы шрифта CVY Online (brand/fonts, лицензия в brand/NOTICE.txt), как в cvy-ui.css строки 3–10 */
@font-face { font-family: "CVY Onest"; font-weight: 400; font-display: swap; src: url(brand/fonts/onest-cyrillic-400.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "CVY Onest"; font-weight: 500; font-display: swap; src: url(brand/fonts/onest-cyrillic-500.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "CVY Onest"; font-weight: 600; font-display: swap; src: url(brand/fonts/onest-cyrillic-600.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "CVY Onest"; font-weight: 400; font-display: swap; src: url(brand/fonts/onest-latin-400.woff2) format("woff2"); }
@font-face { font-family: "CVY Onest"; font-weight: 500; font-display: swap; src: url(brand/fonts/onest-latin-500.woff2) format("woff2"); }
@font-face { font-family: "CVY Onest"; font-weight: 600; font-display: swap; src: url(brand/fonts/onest-latin-600.woff2) format("woff2"); }

:root {
  /* тема «Как в программе»: меню, страница, поверхности, акцент */
  --side: #0a2347; --side-hover: rgba(255, 255, 255, .08); --side-on: rgba(255, 255, 255, .14); --side-ink: #dbe6f4; --side-dim: #a9b9cc; --side-line: rgba(255, 255, 255, .14);
  /* спокойный живой фон панелей — цвета примерки сайта (#061530, #123a6e, #1f5aa0, #0a2347) */
  --panel-bg: radial-gradient(60% 45% at 20% 10%, #1f5aa0, transparent 70%), radial-gradient(70% 55% at 85% 95%, #123a6e, transparent 70%), linear-gradient(160deg, #0a2347, #061530);
  /* тёмно-синий края логотипа владельца: полоса телефона и планшета в цвет баннера, без шва */
  --banner: #0a294f;
  --page: #f4f6f9; --card: #ffffff;
  --accent: #24456f; --accent-hover: #1b3657; --accent-soft: #eaf0f7; --ring: rgba(36, 69, 111, .18); --on-dark: #9fc4f0;
  --ink: #17212d; --muted: #556275; --muted-l: #667487; --line: #e1e6ec; --field-line: #c1c9d2;
  --head: #f4f6f8; --zebra: #f7f9fa; --hover: #eef1f5;
  /* только для настоящих ошибок: приглушённый красный */
  --err: #a33a3a; --err-soft: #f6eaea;
  --pop-shadow: 0 10px 28px rgba(21, 33, 47, .16), 0 0 0 1px rgba(21, 33, 47, .06);
  --r: 7px; --r-card: 10px;
  /* телефон: ввод от 16 px, цели нажатия от 44 px; компьютер плотнее — ниже */
  --fs: 16px; --fs-s: 14px; --ctl: 48px; --btn: 48px; --btn-big: 52px; --gap: 16px;
  font-family: "Manrope", "CVY Onest", "Segoe UI", system-ui, sans-serif;
  font-size: var(--fs); line-height: 1.45; color: var(--ink); background: var(--page);
  -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
html[data-shell="desk"], html[data-shell="tab"] { --fs: 14px; --fs-s: 12.5px; --ctl: 36px; --btn: 34px; --btn-big: 36px; --gap: 12px; }
@media (pointer: coarse) { html[data-shell="desk"], html[data-shell="tab"] { --fs: 16px; --fs-s: 14px; --ctl: 44px; --btn: 44px; --btn-big: 44px; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, b, strong { font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
td, th, input, .chip, .cnt { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* длинный текст без пробелов не вылезает: не больше двух строк и многоточие, полный текст — в подсказке (title) */
.cl { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; min-width: 0; }

/* ---------- логотип A владельца (как на входе cvyonline.com, прозрачный фон) прямо на синей панели: без плашки,
   рамки и перекраски — шва с шапкой нет. Поверх — блик как в примерке сайта (маска по самому логотипу).
   Файл заменяемый (brand/brand.js); размер задаётся высотой и предельной шириной ---------- */
/* маска блика: путь повторяет brand/brand.js (встроенный стиль запрещён защитой страницы) — при замене логотипа поменять и здесь */
:root { --logo-url: url(brand/logo-a.png); }
:root { --logo-side-h: 64px; --logo-bar-h: 36px; --logo-bar-w: 120px; --logo-tab-h: 36px; --logo-tab-w: 120px; }
.lfx { position: relative; display: block; flex: none; min-width: 0; }
.lfx .sh { position: absolute; inset: 0; pointer-events: none; -webkit-mask: var(--logo-url) center / contain no-repeat; mask: var(--logo-url) center / contain no-repeat;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .95) 48%, rgba(190, 230, 255, .9) 52%, transparent 65%) no-repeat; background-size: 250% 100%; animation: cvy-sweep 3.6s ease-in-out infinite; }
@keyframes cvy-sweep { 0% { background-position: 150% 0; } 60%, 100% { background-position: -60% 0; } }
/* спокойный живой фон панелей: медленный сдвиг градиента */
.ws-side, .tbar, .mbar { background: var(--panel-bg); background-size: 160% 160%; animation: cvy-drift 40s ease-in-out infinite alternate; }
@keyframes cvy-drift { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
@media (prefers-reduced-motion: reduce) { .lfx .sh, .ws-side, .tbar, .mbar { animation: none; } }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: #fff; text-decoration: none; border-radius: 10px; }
.brand:hover { color: #fff; }
.brand:focus-visible { outline-color: var(--on-dark); }
.logo { display: block; flex: none; width: auto; height: var(--logo-bar-h); max-width: var(--logo-bar-w); object-fit: contain; }
.brand-t { font-size: 16px; font-weight: 600; line-height: 1.2; color: #fff; min-width: 0; overflow-wrap: anywhere; }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--btn); padding: 6px 16px; border-radius: var(--r);
  border: 1px solid var(--field-line); background: var(--card); color: var(--ink); font-weight: 500; line-height: 1.25; text-align: center; text-decoration: none;
  cursor: pointer; min-width: 0; overflow-wrap: anywhere; transition: background-color .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--hover); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.big { min-height: var(--btn-big); width: 100%; }
.btn.danger { color: var(--err); border-color: #dcbcbc; }
.btn.danger:hover { background: var(--err-soft); color: var(--err); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn.quiet:hover { background: var(--hover); color: var(--ink); }
.btn.small { padding: 4px 12px; font-size: var(--fs-s); }
.link { display: inline-flex; align-items: center; min-height: 44px; padding: 4px; background: none; border: 0; font-weight: 500; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--accent-hover); }
.link.danger { color: var(--err); }
.link-row { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.row > .btn { flex: 1 1 200px; }

/* ---------- текст и сообщения ---------- */
.top { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.top h1 { font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.sub { color: var(--muted); overflow-wrap: anywhere; }
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 44px; font-weight: 500; text-decoration: none; }
.back::before { content: "‹"; font-size: 1.35em; line-height: 1; transform: translateY(-1px); }
.back .cl { -webkit-line-clamp: 1; }
.sec { font-size: var(--fs-s); font-weight: 500; color: var(--muted); margin-top: 4px; }
.empty, .hint, .muted { color: var(--muted); }
.hint { font-size: var(--fs-s); }
.muted { font-weight: 400; }
.notice { background: var(--accent-soft); color: var(--ink); padding: 10px 12px; border-radius: var(--r); overflow-wrap: anywhere; }
.tag { display: inline-block; flex: none; font-size: 12px; font-weight: 500; line-height: 1.6; padding: 0 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.err { color: var(--err); font-size: var(--fs-s); font-weight: 500; }
.check { font-size: var(--fs-s); font-weight: 500; padding: 8px 10px; border-radius: var(--r); overflow-wrap: anywhere; }
.check.ok { background: var(--accent-soft); color: var(--accent); }
.check.bad { background: var(--err-soft); color: var(--err); }

/* ---------- списки отчётов и карт ---------- */
.list, .ops, .totals, .plain, .sheets { list-style: none; margin: 0; padding: 0; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); color: var(--ink); text-decoration: none; transition: border-color .15s; }
.item:hover { border-color: var(--field-line); color: var(--ink); }
.item-t { display: flex; align-items: baseline; gap: 8px; font-weight: 600; min-width: 0; }
.item-m { font-variant-numeric: tabular-nums; }
.item-s { color: var(--muted); font-size: var(--fs-s); }

/* установка на телефон: тихий блок под списком отчётов, закрывается на 14 дней */
.install { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); }
.install h2 { font-size: 16px; }
.install p { color: var(--muted); overflow-wrap: anywhere; }
.install svg { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; color: var(--accent); }
.install .row > .btn { flex: 1 1 120px; }

/* ---------- разделы листа: карточки на телефоне ---------- */
.sect { display: flex; flex-direction: column; gap: 10px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px; }
.sect h2 { font-size: 18px; line-height: 1.3; }
.sect-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; min-width: 0; }
.sect-h > * { min-width: 0; }
.sect-t { display: flex; flex-wrap: wrap; gap: 6px; }
/* итог — рамка по ширине текста (CVY Online, DESIGN.md 7.8): название приглушённо, число цветом текста */
.chip { display: inline-block; max-width: 100%; padding: 1px 10px; border: 1px solid var(--accent); border-radius: 8px; color: var(--muted); font-size: var(--fs-s); overflow-wrap: anywhere; }
.chip b { color: var(--ink); font-weight: 500; }
.ops { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.op { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; min-height: 48px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.op:hover { color: var(--ink); background: var(--zebra); }
.op > * { min-width: 0; }
.op-t { font-weight: 600; overflow-wrap: anywhere; }
.op-q { font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.op-p { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--muted); font-size: var(--fs-s); }
.op-i { grid-column: 1 / -1; display: flex; flex-direction: column; color: var(--err); font-size: var(--fs-s); overflow-wrap: anywhere; }
.op-i span::before, .issue-row span::before { content: "! "; font-weight: 600; }
.street, .more { overflow-wrap: anywhere; min-width: 0; }
/* пролёт «столб ━ столб» и одиночный столб (короткая вертикальная планка). Номер столба не переносится внутри себя:
   на новую строку уходит весь пролёт целиком, а слишком длинный номер обрезается «…» с полным текстом в title */
.span, .pole { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.span b, .pole b { display: block; min-width: 0; padding-left: 8px; font-weight: 500; white-space: nowrap; overflow-wrap: normal; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(var(--muted-l), var(--muted-l)) left center / 3px 14px no-repeat; }
.span i { display: block; flex: none; width: 28px; height: 2px; background: var(--muted-l); }

/* ---------- таблицы ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs); }
.tbl th, .tbl td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tbl thead th { background: var(--head); color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.3; vertical-align: bottom; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line); }
.tbl thead th.n, .tbl thead th.s { white-space: normal; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:last-child > * { border-bottom: 0; }
.tbl tbody tr > * { background: var(--card); }
.tbl tbody tr:nth-child(even) > * { background: var(--zebra); }
.tbl tbody tr:hover > * { background: var(--hover); }
.tbl tbody tr.sel > * { background: var(--accent-soft); }
.tbl tbody tr.sel > th { box-shadow: inset 3px 0 0 var(--accent); }
.tbl tbody th { font-weight: 500; }
.tbl tbody th a { display: block; color: var(--ink); text-decoration: none; border-radius: 2px; }
.tbl tbody th a:hover { color: var(--accent); text-decoration: underline; }
.tbl .n { text-align: right; white-space: nowrap; }
.tbl .s { white-space: nowrap; }
/* в таблице слово переносится целиком; рвётся только сплошная строка длиннее колонки */
.tbl .cl { overflow-wrap: break-word; }
.tbl tbody .t .cl { max-width: 16em; }
.tbl tbody .w .cl { min-width: 8em; max-width: 26em; }
.tbl tbody th .cl { max-width: 13em; }
.iss { margin-top: 2px; color: var(--err); font-size: 12px; font-weight: 400; }

/* ---------- формы ---------- */
.form { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.form-body { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.form-h { font-size: 22px; line-height: 1.25; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.lbl { padding: 0; font-size: var(--fs-s); font-weight: 500; color: var(--muted); }
input:not([type="radio"]):not([type="checkbox"]), select, textarea {
  width: 100%; min-width: 0; min-height: var(--ctl); padding: 6px 12px; font-size: var(--fs); color: var(--ink); background-color: var(--card);
  border: 1px solid var(--field-line); border-radius: var(--r); caret-color: var(--accent); font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
  /* поле с фокусом не прячется под закреплёнными полосами: отступы прокрутки здесь и у зон, остальное — revealField в app.js */
  scroll-margin: 12px 0; }
input:not([type="radio"]):not([type="checkbox"]):hover, select:hover, textarea:hover { background-color: var(--zebra); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); background-color: var(--card); }
select { appearance: none; padding-right: 32px; background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23667487' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
textarea { min-height: 80px; resize: vertical; line-height: 1.4; }
textarea.copy { font-size: 13px; font-family: ui-monospace, Consolas, monospace; }
[aria-invalid="true"] { border-color: var(--err) !important; box-shadow: inset 0 0 0 1px var(--err); }
fieldset[aria-invalid="true"] { box-shadow: none; }
/* поля рядом: подписи, поля ввода и подсказки стоят на общих строках, даже если одна подпись в две строки */
.two, .three { display: grid; gap: 6px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto auto; align-items: start; }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 380px) { .three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.two > label.fld, .three > label.fld { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 6px; }
.two > label.fld > .lbl, .three > label.fld > .lbl { align-self: end; }
.two > fieldset.fld { grid-row: span 3; }
.rowline .link { grid-row: 4; grid-column: 1 / -1; justify-self: start; }
.seg-o { display: flex; gap: 8px; }
.seg-o label { position: relative; flex: 1 1 0; min-width: 0; }
.seg-o input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg-o span { display: flex; align-items: center; justify-content: center; min-height: var(--ctl); padding: 4px 8px; border: 1px solid var(--field-line); border-radius: var(--r);
  background: var(--card); font-weight: 500; text-align: center; overflow-wrap: anywhere; transition: background-color .15s, border-color .15s; }
.seg-o label:hover input:not(:checked) + span { background: var(--hover); }
.seg-o input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg-o input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.chk { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; cursor: pointer; }
.chk input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.actions { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
/* раскрываемые подробности: закрыто — одна строка */
.fold { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.fold-b { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: var(--ctl); padding: 6px 12px;
  background: none; border: 0; border-radius: var(--r); font-weight: 500; color: var(--ink); text-align: left; cursor: pointer; }
.fold-b:hover { background: var(--hover); }
.fold-b::after { content: ""; flex: none; width: 7px; height: 7px; margin-right: 4px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-2px) rotate(45deg); }
.fold-b[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
.fold-c { display: flex; flex-direction: column; gap: 12px; padding: 4px 12px 12px; }
.line { display: flex; flex-direction: column; gap: 10px; min-width: 0; margin: 0; padding: 8px 12px 10px; border: 1px solid var(--line); border-radius: var(--r); }
.line legend { padding: 0 4px; font-weight: 600; }

/* ---------- обзор черновика ---------- */
.totals li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.totals b { flex: none; font-weight: 500; white-space: nowrap; }
.issue-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--r); background: var(--err-soft); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.issue-row:hover { color: var(--ink); }
.issue-row b { font-weight: 500; }
.issue-row span { color: var(--err); font-size: var(--fs-s); }
.plain li { padding: 4px 0; overflow-wrap: anywhere; }

/* ---------- состояние сохранения и уведомление ---------- */
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-s); }
.st-t { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.st-t::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--field-line); vertical-align: 1px; }
.st-b { display: flex; flex-wrap: wrap; gap: 0 12px; }
.status.ok .st-t::before { background: var(--accent); }
.status.off { background: var(--hover); }
.status.bad { background: var(--err-soft); color: var(--err); font-weight: 500; }
.status.bad .st-t::before { background: var(--err); }
.status.bad .link { color: var(--err); }
.toast { display: flex; align-items: center; gap: 8px; margin: 0 12px 8px; padding: 6px 8px 6px 14px; border-radius: var(--r); background: var(--ink); color: #fff; font-weight: 500; box-shadow: 0 6px 18px rgba(21, 33, 47, .18); }
.toast span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast .link { color: var(--on-dark); }

/* ---------- окна ---------- */
dialog { width: min(480px, calc(100vw - 32px)); max-width: calc(100vw - 32px); padding: 20px; border: 0; border-radius: 12px; color: var(--ink); background: var(--card); box-shadow: var(--pop-shadow); overflow-wrap: anywhere; }
dialog::backdrop { background: rgba(21, 33, 47, .45); }
dialog h2 { margin-bottom: 8px; font-size: 18px; }
dialog p, dialog ul { margin: 0 0 12px; }
dialog .row > .btn { flex: 1 1 160px; }
/* под открытым окном страница не прокручивается */
html:has(dialog[open]) { overflow: hidden; }
.menu { position: fixed; inset: auto; margin: 0; padding: 6px; min-width: 200px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); box-shadow: var(--pop-shadow); }
.menu a { display: flex; align-items: center; min-height: 36px; padding: 6px 12px; border-radius: 6px; color: var(--ink); font-weight: 500; text-decoration: none; }
.menu a:hover, .menu a:focus-visible { background: var(--hover); color: var(--ink); }

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

/* =================== Телефон: тёмная полоса и последовательные экраны =================== */
/* полоса с логотипом закреплена сверху, полоса состояния — снизу: прокрутка и фокус оставляют поле между ними */
html[data-shell="phone"] { scroll-padding: calc(80px + env(safe-area-inset-top)) 0 calc(var(--dock-h, 56px) + 16px); }
html[data-shell="phone"], html[data-shell="phone"] body { overscroll-behavior-y: none; }
.mbar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; min-width: 0; padding: max(8px, env(safe-area-inset-top)) 16px 8px; box-shadow: 0 1px 0 rgba(10, 41, 79, .25); }
.mbar .brand { min-height: 44px; }
html[data-shell="phone"] .page { display: flex; flex-direction: column; gap: 16px; max-width: 640px; margin: 0 auto; padding: 16px 16px calc(var(--dock-h, 56px) + 32px); }
html[data-shell="phone"] .page > * { min-width: 0; }
html[data-shell="phone"] .dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; }
/* шапка карты на телефоне */
.ctx { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ctx .back { grid-column: 1 / -1; }
.ctx .ctx-map { grid-column: 1 / -1; font-size: 26px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ctx .ctx-date { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ctx .ctx-proj { min-width: 0; color: var(--muted); font-size: var(--fs-s); text-align: right; }
/* вид записей: карточки (основной) или таблица, которая листается вбок только внутри себя */
.viewsw { display: flex; align-self: flex-start; gap: 2px; padding: 2px; background: var(--hover); border: 1px solid var(--line); border-radius: 8px; }
.viewsw button { min-height: 44px; padding: 6px 16px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; }
.viewsw button[aria-pressed="true"] { background: var(--card); color: var(--accent); box-shadow: 0 0 0 1px var(--line); }
html[data-shell="phone"] .tbl-w { display: none; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(to right, var(--card) 30%, transparent) left / 24px 100% no-repeat local, linear-gradient(to left, var(--card) 30%, transparent) right / 24px 100% no-repeat local,
    linear-gradient(to right, rgba(21, 33, 47, .14), transparent) left / 10px 100% no-repeat scroll, linear-gradient(to left, rgba(21, 33, 47, .14), transparent) right / 10px 100% no-repeat scroll; }
html[data-shell="phone"][data-view="table"] .tbl-w { display: block; }
html[data-shell="phone"][data-view="table"] .ops { display: none; }
html[data-shell="phone"] .tbl th, html[data-shell="phone"] .tbl td { padding: 11px 12px; }
html[data-shell="phone"] .tbl tbody th { position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: inset -1px 0 0 var(--line); }
html[data-shell="phone"] .tbl tbody tr:nth-child(even) > th { background: var(--zebra); }
html[data-shell="phone"] .tbl tbody th a { min-height: 24px; }
html[data-shell="phone"] .sect > .btn.add { align-self: stretch; }

/* =================== Компьютер и планшет: рабочее пространство на всё окно =================== */
html[data-shell="desk"], html[data-shell="tab"], html[data-shell="desk"] body, html[data-shell="tab"] body { height: 100%; overflow: hidden; }
.ws { display: grid; height: 100vh; height: 100dvh; min-height: 0; }
/* три зоны: меню 264–300 px, таблица забирает остаток, редактор 380–560 px; без масштабирования */
.ws-desk { grid-template-columns: clamp(264px, 18vw, 300px) minmax(0, 1fr); }
.ws-desk.with-edit { grid-template-columns: clamp(264px, 18vw, 300px) minmax(0, 1fr) clamp(380px, 28vw, 560px); }
.ws-tab { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
.ws-tab.with-edit { grid-template-columns: minmax(0, 1fr) clamp(380px, 38vw, 420px); }
.ws-tab > .tbar, .ws-tab > .dock { grid-column: 1 / -1; }
.ws-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ws-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 16px 20px 28px; }
.ws .btn.big { width: auto; min-width: 180px; }
.ws .row > .btn { flex: 0 1 auto; }
.ws .back { min-height: var(--btn); }
.ws .link { min-height: var(--btn); }
.ws .link-row { min-height: var(--btn); }
.ws .chk { min-height: var(--btn); }
.ws .item { padding: 12px 16px; }

/* меню компьютера: эмблема, разделы, текущий отчёт, внизу — состояние сохранения */
.ws-side { display: flex; flex-direction: column; min-width: 0; min-height: 0; color: var(--side-ink); }
.side-top { display: flex; flex-direction: column; gap: 14px; padding: 16px 16px 10px; }
.ws-side .brand { flex-direction: column; align-items: stretch; gap: 10px; }
.ws-side .lfx { align-self: flex-start; margin: 6px 4px 4px; }
.ws-side .logo { width: 176px; height: auto; max-width: 100%; max-height: var(--logo-side-h); }
.ws-side .brand-t { padding: 0 4px; font-size: 15px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-a { display: flex; align-items: center; gap: 11px; min-height: 36px; padding: 6px 12px; border-radius: 8px; color: var(--side-ink); font-size: 14px; font-weight: 500; text-decoration: none; transition: background-color .15s, color .15s; }
.nav-a svg { flex: none; width: 18px; height: 18px; opacity: .85; }
.nav-a:hover { background: var(--side-hover); color: #fff; }
.nav-a[aria-current="page"] { background: var(--side-on); color: #fff; }
.nav-a[aria-current="page"] svg { opacity: 1; }
.ws-side :focus-visible { outline-color: var(--on-dark); }
.side-mid { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 16px 12px; border-top: 1px solid var(--side-line); }
.rep { display: flex; flex-direction: column; gap: 2px; }
.rep-p { display: flex; align-items: center; gap: 11px; min-height: 36px; padding: 6px 12px; border-radius: 8px; color: #fff; font-weight: 600; text-decoration: none; }
.rep-p svg { flex: none; width: 18px; height: 18px; opacity: .85; }
.rep-p .cl { -webkit-line-clamp: 2; }
.rep-p:hover { background: var(--side-hover); color: #fff; }
.rep-p[aria-current="page"] { background: var(--side-on); color: #fff; }
.rep-c { padding: 0 12px 0 41px; color: var(--side-dim); font-size: 12.5px; -webkit-line-clamp: 1; }
.sheets { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 4px; }
.sheet-a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 10px; min-height: 44px; padding: 6px 12px; border-radius: 8px; color: var(--side-ink); text-decoration: none; transition: background-color .15s, color .15s; }
.sheet-a:hover { background: var(--side-hover); color: #fff; }
.sheet-a[aria-current="page"] { background: var(--side-on); color: #fff; }
.sheet-m { font-weight: 500; -webkit-line-clamp: 1; }
.sheet-n { grid-column: 2; grid-row: 1 / span 2; min-width: 28px; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.sheet-d { grid-column: 1; color: var(--side-dim); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.side-add { display: flex; align-items: center; gap: 11px; min-height: 36px; padding: 6px 12px; border-radius: 8px; color: var(--side-ink); font-size: 13.5px; text-decoration: none; }
.side-add::before { content: "+"; flex: none; width: 18px; font-size: 18px; line-height: 1; text-align: center; }
.side-add:hover { background: var(--side-hover); color: #fff; }
.ws-side .dock { padding: 10px 12px 12px; border-top: 1px solid var(--side-line); }
.ws-side .status { padding: 4px; background: transparent; border: 0; color: var(--side-dim); font-size: 12.5px; }
.ws-side .status .link { min-height: 32px; color: var(--on-dark); }
.ws-side .status.ok .st-t::before { background: #7fb2ea; }
.ws-side .status.off { background: transparent; }
.ws-side .status.bad { padding: 8px 10px; background: var(--err-soft); color: var(--err); border-radius: 8px; }
.ws-side .status.bad .link { color: var(--err); }
.ws-side .toast { margin: 0 0 8px; background: var(--card); color: var(--ink); box-shadow: none; }
.ws-side .toast .link { min-height: 32px; color: var(--accent); }

/* планшет: верхняя панель вместо меню (в цвет баннера), внизу — строка состояния */
.tbar { display: flex; align-items: center; gap: 16px; min-width: 0; padding: 8px 16px; }
.tbar .nav-a:hover { background: rgba(255, 255, 255, .08); }
.tbar .nav-a[aria-current="page"] { background: rgba(255, 255, 255, .14); }
.tbar .logo { height: var(--logo-tab-h); max-width: var(--logo-tab-w); }
.tbar .brand-t { font-size: 15px; }
.tbar .nav { flex-direction: row; flex-wrap: wrap; margin-left: auto; }
.ws-tab > .dock .toast { margin: 8px 12px 0; }

/* центр: шапка карты, фильтр видов и таблицы разделов */
.ws-head { display: flex; flex-direction: column; gap: 10px; padding: 14px 20px 12px; border-bottom: 1px solid var(--line); background: var(--page); }
.ws-head .back { margin: -6px 0 -4px; }
.ws-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; min-width: 0; }
.ws-head .ctx-map { max-width: 100%; font-size: 22px; line-height: 1.25; font-variant-numeric: tabular-nums; -webkit-line-clamp: 1; }
.ws-head .ctx-date { font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ws-head .ctx-proj { display: flex; align-items: baseline; gap: 8px; flex-basis: 100%; min-width: 0; color: var(--muted); }
.ws-head .ctx-proj .cl { -webkit-line-clamp: 1; }
.ws-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.filter { display: flex; flex-wrap: wrap; gap: 2px; padding: 2px; background: var(--hover); border: 1px solid var(--line); border-radius: 8px; }
.filter button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; }
.filter button:hover { color: var(--ink); }
.filter button[aria-pressed="true"] { background: var(--card); color: var(--accent); box-shadow: 0 0 0 1px var(--line); }
.cnt { color: var(--muted); font-size: 12px; font-weight: 400; }
@media (pointer: coarse) { .filter button { min-height: 44px; } .menu a { min-height: 44px; } }
/* разделы — белые рамки одной ширины с таблицей во всю ширину; широкая таблица листается вбок вместе с зоной,
   шапка таблицы и первая колонка при этом закреплены */
.secs { display: grid; gap: 14px; width: fit-content; min-width: 100%; }
.ws .secs > .sect { gap: 0; padding: 0; min-width: auto; }
.ws .sect-h { padding: 12px 16px 10px; }
.ws .sect h2 { font-size: 15px; }
.ws .sect > .empty { padding: 0 16px 4px; }
.ws .sect-add { align-self: flex-start; margin: 4px 6px 6px; color: var(--accent); }
.ws .sect-add::before { content: "+"; font-size: 1.2em; line-height: 1; }
.ws .tbl th:first-child, .ws .tbl td:first-child { padding-left: 16px; }
.ws .tbl th:last-child, .ws .tbl td:last-child { padding-right: 16px; }
.ws .tbl thead th { position: sticky; top: 0; z-index: 1; }
.ws .tbl tbody th { position: sticky; left: 0; z-index: 1; }
.ws .tbl thead th:first-child { left: 0; z-index: 2; }
.ws .tbl tbody tr { scroll-margin-top: 44px; }
.ws-body, .ws-edit .form, .ed-hint { scrollbar-width: thin; scrollbar-color: var(--field-line) transparent; }
.side-mid { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .22) transparent; }
.blank { display: flex; flex-direction: column; gap: 10px; max-width: 640px; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); }
.blank h2 { font-size: 16px; }
.blank p { color: var(--muted); }
/* экраны без отчёта: формы не растягиваются, списки раскладываются сеткой */
.ws .page { display: flex; flex-direction: column; gap: 16px; }
.ws .page > * { min-width: 0; }
.ws .page-form { max-width: 720px; }
.ws .page-list .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; }
.ws .page .sect { width: auto; min-width: 0; padding: 16px; gap: 10px; margin: 0; }
.ws .page-form .form-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; align-items: start; }
.ws .page-form .form-body > .wide { grid-column: 1 / -1; }
.ws .actions { flex-direction: row; flex-wrap: wrap; }
.ws .actions > .check { flex-basis: 100%; }

/* редактор записи справа: заголовок, поля листаются, кнопки всегда внизу зоны */
.ws-edit { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--card); border-left: 1px solid var(--line); }
.ed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 10px 20px; border-bottom: 1px solid var(--line); }
.ed-t { min-width: 0; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
/* поля листаются под нижней строкой кнопок; короткая форма — кнопки всё равно внизу зоны */
.ws-edit .form { flex: 1; min-height: 0; gap: 0; overflow-y: auto; overscroll-behavior: contain; scroll-padding-bottom: 120px; }
.ws-edit .form-body { flex: 1 0 auto; padding: 16px 20px 20px; }
.ws-edit .actions { position: sticky; bottom: 0; z-index: 2; padding: 12px 20px 14px; border-top: 1px solid var(--line); background: var(--card); }
.ws-edit .actions .btn { flex: 1 1 auto; min-width: 0; }
.ws-edit .actions .btn.primary { flex-grow: 2; }
.ed-hint { display: flex; flex-direction: column; gap: 12px; padding: 20px; overflow-y: auto; }
.ed-hint p { color: var(--muted); }
.ed-hint .notice { color: var(--ink); }

/* =================== Стекло (решение владельца 14.10, в ограниченном виде) ===================
   Только CSS: без библиотек, анимации, шейдеров, 3D и «жидкого хрома». Только там, где под панелью прокручивается
   содержимое: закреплённая полоса телефона (тёмно-синяя, в цвет баннера), полоса состояния телефона, нижняя строка
   кнопок редактора на компьютере, меню «Добавить запись» и подложка окон. Таблицы, поля и окна — сплошные.
   Без поддержки размытия или при «меньше прозрачности» — сплошной фон. Текст на стекле — контраст от 4,5:1. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html[data-shell="phone"] .status:not(.bad) { background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7); }
  html[data-shell="phone"] .status.off { background: rgba(238, 241, 245, .9); }
  .ws-edit .actions { background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7); }
  .menu { background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); }
  dialog::backdrop { background: rgba(21, 33, 47, .38); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
}
@media (prefers-reduced-transparency: reduce) {
  html[data-shell="phone"] .status, .ws-edit .actions, .menu, dialog::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }
  html[data-shell="phone"] .status:not(.bad), .ws-edit .actions, .menu { background: var(--card); }
  html[data-shell="phone"] .status.off { background: var(--hover); }
  dialog::backdrop { background: rgba(21, 33, 47, .45); }
}
/* Телефон: логотип по центру и крупнее, надпись «CVY Work Log» в полосе убрана (имя — в alt логотипа) */
.mbar { justify-content: center; padding: max(10px, env(safe-area-inset-top)) 16px 10px; }
.mbar .brand { width: 100%; justify-content: center; min-height: 56px; }
.mbar .logo { height: 54px; max-width: min(240px, 72vw); }
/* Компьютер: логотип ровно по центру панели (одинаковые поля слева и справа), название — внизу меню */
.ws-side .brand { align-items: center; }
.ws-side .lfx { align-self: center; margin: 6px 0 4px; }
.ws-side .logo { margin-inline: auto; }
.side-name { margin: 0; padding: 6px 16px 12px; text-align: center; font-size: 12.5px; font-weight: 500; letter-spacing: .02em; color: var(--side-dim); }
/* Компьютер: «Отчёты» и «Резервная копия» внизу меню над строкой сохранения; резервная копия — мелким шрифтом, как строка сохранения */
.side-foot { padding: 8px 12px 4px; border-top: 1px solid var(--side-line); }
.side-foot .nav-a[href="#/data"] { min-height: 32px; font-size: 12.5px; font-weight: 400; color: var(--side-dim); }
.side-foot .nav-a[href="#/data"] svg { width: 15px; height: 15px; }
.side-foot .nav-a[href="#/data"]:hover, .side-foot .nav-a[href="#/data"][aria-current="page"] { color: #fff; }
.ws-side .dock { border-top: 0; }
/* Компьютер: правая колонка как на CVY Online — часы, погода и место, календарь, заметки */
.ws-edit { overflow-y: auto; overscroll-behavior: contain; }
.ed-hint { overflow: visible; flex: none; }
.rail { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px 20px; }
.ed-hint + .rail { padding-top: 0; }
.rail-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 14px 16px; background: var(--page); border: 1px solid var(--line); border-radius: var(--r-card); }
.rail-clock b { font-size: 34px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.rail-clock span { color: var(--muted); font-size: 14px; }
.rail-h { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: none; }
.rail-wx-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rail-temp { font-size: 30px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.rail-place { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.rail-dim { margin: 0; color: var(--muted); font-size: 13px; }
.rail-err { margin: 0; color: var(--err); font-size: 13px; }
.rail-btn { align-self: flex-start; min-height: 36px; font-size: 14px; }
.rail-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.rail-cal i { font-style: normal; font-size: 11.5px; color: var(--muted); padding-bottom: 2px; }
.rail-cal span { position: relative; padding: 5px 0; border-radius: 6px; color: var(--ink); }
.rail-cal span.is-today { background: var(--accent); color: #fff; font-weight: 600; }
.rail-cal span.has-work::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.rail-cal span.is-today.has-work::after { background: #fff; }
.rail-notes textarea { min-height: 120px; resize: vertical; font-size: 14px; }
