:root {
  /* AUDIT-003: светлая тема по умолчанию, контраст WCAG 2.2 AA и выше (палитра — предложение аудита). */
  --bg: #F1F5F9; --card: #FFFFFF; --text: #14243D; --muted: #475569; --accent: #183B66; --on-accent: #FFFFFF;
  --line: #CBD5E1; --field: #64748B; --active: #DCE8F5; --link: #183B66; --focus: #2563EB;
  --ok-bg: #E7F6EC; --ok-line: #2F7A47; --ok-text: #14532D;
  --warn-bg: #FFF4DB; --warn-line: #B7791F; --warn-text: #7A4A00;
  --bad-bg: #FDECEC; --bad-line: #C0392B; --bad-text: #8A1C12;
  --side-w: 264px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #14161a; --card: #1d2026; --text: #eceae4; --muted: #b4b1a8; --accent: #d4b26a; --on-accent: #14161a;
  --line: #3a3f48; --field: #6b7280; --active: #2a2f38; --link: #e2c27f; --focus: #8ab4ff;
  --ok-bg: #12301c; --ok-line: #2c6b40; --ok-text: #8fd9a8;
  --warn-bg: #3a2a10; --warn-line: #8a6420; --warn-text: #f3c46b;
  --bad-bg: #3a1513; --bad-line: #8a2a24; --bad-text: #ff9b92;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { font-size: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 1.0625rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ico { width: 22px; height: 22px; flex: none; }
/* --- каркас: левое меню + рабочая область (AUDIT-002) --- */
.work { padding: 0 max(16px, env(safe-area-inset-right)) 32px max(16px, env(safe-area-inset-left)); }
main { max-width: 640px; margin: 0 auto; padding-top: 16px; }
body.with-nav main { max-width: 1040px; }
.brand { font-weight: 800; color: var(--text); letter-spacing: .02em; text-decoration: none; font-size: 1.125rem; line-height: 1.15; }
.brand span { display: block; font-weight: 600; font-size: 0.75rem; letter-spacing: .16em; color: var(--muted); }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; height: 44px;
  padding: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .brand { flex: 1; }
.side { position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(86%, 300px); display: flex; flex-direction: column;
  background: var(--card); border-right: 1px solid var(--line); padding: 12px; transform: translateX(-105%);
  transition: transform .2s ease; overflow-y: auto; }
body.nav-open .side { transform: none; visibility: visible; }
/* Закрытое меню на телефоне/планшете недоступно ни мыши, ни клавиатуре, ни диктору. */
@media (max-width: 1023px) { .side { visibility: hidden; } }
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(15, 23, 42, .45); }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 14px;
  border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.side-nav, .side-foot { display: grid; gap: 4px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.side-nav a, .side-foot a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px;
  border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.side-nav a:hover, .side-foot a:hover { background: var(--bg); }
.side-nav a.active, .side-foot a.active { background: var(--active); color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent); }
.side-nav a span, .side-foot a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.only-wide { display: none; }
@media (min-width: 1024px) {
  .topbar, .only-narrow, .scrim { display: none !important; }
  .only-wide { display: inline-flex; }
  .side { transform: none; width: var(--side-w); transition: width .15s ease; }
  body.with-nav .work { margin-left: var(--side-w); padding: 0 28px 40px; transition: margin-left .15s ease; }
  :root[data-nav="collapsed"] { --side-w: 76px; }
  :root[data-nav="collapsed"] .side .brand, :root[data-nav="collapsed"] .side-nav a span,
  :root[data-nav="collapsed"] .side-foot a span { display: none; }
  :root[data-nav="collapsed"] .side-head { justify-content: center; }
  :root[data-nav="collapsed"] .side-nav a, :root[data-nav="collapsed"] .side-foot a { justify-content: center; padding: 0; }
}
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.center { text-align: center; margin-top: 12vh; }
h1 { margin: 0 0 12px; font-size: 1.625rem; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 10px; margin-bottom: 16px; }
select, button { font: inherit; min-height: 48px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); padding: 0 14px; }
button { background: var(--accent); color: var(--on-accent); border: 0; font-weight: 600; width: 100%; cursor: pointer; }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
.card + .card { margin-top: 14px; }
h2 { margin: 0 0 10px; font-size: 1.25rem; }
.small { font-size: 0.9375rem; }
.error { color: var(--bad-text); font-weight: 600; }
.big { font-size: 2.125rem; font-weight: 700; letter-spacing: .06em; margin: 12px 0; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 1.625rem; }
.qr { background: #fff; border-radius: 12px; padding: 12px; width: min(80%, 320px); margin: 12px auto; }
.qr svg { width: 100%; height: auto; display: block; }
.list { list-style: none; padding: 0; margin: 0 0 12px; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--line); }
.list li.unread span:first-child { font-weight: 600; }
.list li.archived a { color: var(--muted); }
.list a { color: var(--text); }
input { font: inherit; min-height: 48px; border-radius: 12px; border: 1px solid var(--field); background: var(--card);
  color: var(--text); padding: 0 14px; }
.button { display: block; text-align: center; min-height: 48px; line-height: 48px; border-radius: 12px; font-weight: 600;
  text-decoration: none; background: var(--accent); color: var(--on-accent); margin-top: 12px; }
a.button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.small { min-height: 36px; width: auto; padding: 0 12px; font-size: 0.875rem; }
button.danger { background: #b3261e; color: #fff; }
.steps { text-align: left; color: var(--muted); }
section.card > button + .error { margin-top: 10px; }
a { color: var(--link); }
/* WP-4: машины */
textarea { font: inherit; border-radius: 12px; border: 1px solid var(--field); background: var(--card); color: var(--text);
  padding: 10px 14px; width: 100%; resize: vertical; }
.plate { font-family: ui-monospace, Menlo, monospace; letter-spacing: .06em; font-weight: 700; }
.big-plate { font-size: 2rem; margin: 4px 0 6px; }
.plate-input { text-transform: uppercase; font-family: ui-monospace, Menlo, monospace; letter-spacing: .06em; font-size: 1.375rem; }
.vlist { display: grid; gap: 2px; }
.vrow { display: flex; flex-direction: column; gap: 2px; padding: 12px 4px; border-bottom: 1px solid var(--line);
  color: var(--text); text-decoration: none; min-height: 48px; }
.vrow.archived { opacity: .6; }
.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); border-radius: 12px; padding: 10px 12px; }
fieldset.seg { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
fieldset.seg legend { padding: 0 0 6px; }
fieldset.seg label { display: flex; align-items: center; gap: 8px; min-height: 48px; border: 1px solid var(--line);
  border-radius: 12px; padding: 0 12px; }
fieldset.seg label:has(input:checked) { border-color: var(--accent); }
label.check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
details summary { cursor: pointer; min-height: 40px; line-height: 40px; color: var(--accent); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.pre { white-space: pre-line; }
.list li.voided span:first-child { text-decoration: line-through; color: var(--muted); }
a.button + a.button { margin-top: 8px; }
/* WP-5: очередь и заказ */
h3 { margin: 14px 0 6px; font-size: 1.0625rem; }
.orow { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line);
  color: var(--text); text-decoration: none; min-height: 48px; }
.orow.urgent { border-left: 3px solid var(--accent); padding-left: 8px; }
.otime { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9375rem; }
.obody { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.badge { display: inline-block; font-size: 0.8125rem; font-weight: 600; border-radius: 8px; padding: 1px 8px;
  border: 1px solid var(--line); vertical-align: middle; }
.badge.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.daynav { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; gap: 8px; text-align: center; }
.daynav .button { margin: 0; }
.daynav .big { font-size: 1.25rem; letter-spacing: 0; margin: 0; }
.complaint { white-space: pre-line; font-size: 1.125rem; }
.inline-form { margin-bottom: 8px; }
form.row { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
form.row select { min-height: 40px; padding: 0 8px; }
form.row button { width: auto; min-height: 40px; }
button.link { background: none; border: 0; color: var(--muted); width: auto; min-height: 36px; text-decoration: underline;
  font-weight: 400; font-size: 0.875rem; padding: 0 4px; }
fieldset.when { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; margin: 0; }
@media (max-width: 420px) { .list li { flex-wrap: wrap; } }
/* WP-6: автопарк и ТО */
.badge.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-text); }
.badge.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-text); }
.frow { display: flex; flex-direction: column; gap: 3px; padding: 12px 4px; border-bottom: 1px solid var(--line);
  color: var(--text); text-decoration: none; }
.fhead { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
section.card.muted h2 { color: var(--muted); }
/* WP-7: крупные действия, «Сохранено», нет интернета */
.big-button { min-height: 64px; font-size: 1.25rem; }
a.button.big-button { line-height: 64px; }
label.big-check { min-height: 56px; font-size: 1.125rem; }
label.big-check input { width: 26px; height: 26px; flex: none; }
/* Ревью вида 26.11: «Машина уже здесь» — вся строка крупная кнопка, а не маленькая галочка */
label.big-check { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--card); cursor: pointer; }
label.big-check:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
/* Шапка заказ-наряда: статус, время, пост и мастер рядом с номером машины */
.ohead { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 4px; }
.badge.status { font-size: 0.9375rem; padding: 3px 10px; }
.ometa { color: var(--muted); margin: 4px 0; }
.ometa svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 2px; display: inline; }
.saved { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-text); border-radius: 12px; padding: 12px 14px;
  margin: 0 0 14px; font-weight: 600; }
.offline { position: sticky; top: 0; z-index: 10; background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad-text);
  border-radius: 12px; padding: 10px 14px; margin: 0 auto 10px; max-width: 640px; }
form.search { margin-top: 14px; }
details.when-more { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; }
details.when-more[open] { display: grid; gap: 8px; padding-bottom: 12px; }
/* AUDIT-006: экран «Сегодня» */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page-head { margin: 4px 0 14px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; font-size: 1.875rem; margin: 0 0 2px; }
.page-head p { margin: 0; font-size: 1.125rem; }
.ico-lg { width: 30px; height: 30px; }
.searchbar { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--field);
  border-radius: 12px; padding: 4px 4px 4px 14px; margin-bottom: 14px; }
.searchbar input { flex: 1; border: 0; min-width: 0; padding: 0 4px; font-size: 1.125rem; background: transparent; }
.searchbar input:focus { outline: none; }
.searchbar:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.searchbar button { width: auto; min-height: 44px; }
.tiles { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles li a { display: flex; flex-direction: column; justify-content: space-between; min-height: 104px; height: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; color: var(--text);
  text-decoration: none; }
.tiles li a:hover { border-color: var(--accent); }
.tiles b { font-size: 2.5rem; line-height: 1; font-variant-numeric: tabular-nums; }
.tiles b small { font-size: 1.125rem; color: var(--muted); font-weight: 600; }
.tiles span { font-weight: 600; color: var(--muted); }
.tiles li.is-warn a { border-color: var(--warn-line); background: var(--warn-bg); }
.tiles li.is-warn span, .tiles li.is-warn b { color: var(--warn-text); }
.actions { display: grid; gap: 10px; margin-bottom: 16px; }
.actions .button { margin: 0; display: flex; align-items: center; justify-content: center; gap: 10px; line-height: 1.2; }
.cols { display: grid; gap: 14px; }
.cols .card + .card { margin-top: 0; }
@media (min-width: 720px) {
  .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .actions { grid-template-columns: 2fr 1fr; }
}
@media (min-width: 1200px) { .cols { grid-template-columns: 3fr 2fr; align-items: start; } }
/* AUDIT-004: заголовок раздела с главным действием справа */
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.head-action { margin: 0; width: auto; padding: 0 18px; display: inline-flex; align-items: center; gap: 8px; line-height: 1.2; }
.card h2 { display: flex; align-items: center; gap: 8px; }
:target { scroll-margin-top: 72px; }
.seg-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
:root:not([data-theme="dark"]) [data-theme-set="light"], :root[data-theme="dark"] [data-theme-set="dark"] {
  background: var(--active); border-color: var(--accent); color: var(--accent); }
/* кнопка-ссылка с иконкой — иконка и текст по центру одной строкой */
a.button { display: flex; align-items: center; justify-content: center; gap: 8px; line-height: 1.2; padding: 0 16px; }
.actions:has(> :only-child) { grid-template-columns: 1fr; }
a.button.big-button { line-height: 1.2; padding: 12px 18px; text-align: center; }
/* Телефон: «Записать машину» сразу под поиском (быстрый сценарий WP-7 не ухудшаем), плитки компактнее. */
.today-top { display: flex; flex-direction: column; }
@media (max-width: 719px) {
  .today-top .actions { order: 1; }
  .today-top .daybar { order: 2; }
  .today-top .tiles { order: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tiles li a { min-height: 84px; padding: 10px 10px; }
  .tiles b { font-size: 1.75rem; }
  .tiles b small { font-size: 0.9375rem; }
  .tiles span { font-size: 0.875rem; line-height: 1.25; }
}
.tiles span { overflow-wrap: anywhere; hyphens: auto; }
/* Этап D: рабочие таблицы (как в каталогах запчастей). Телефон — карточки, компьютер — таблица. */
.dt-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 16px; }
.dt-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--line); }
.dt-count { margin-left: auto; }
.dt-sortform { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dt-sortform select { min-height: 44px; }
.dt-cols { position: relative; }
.dt-cols summary { list-style: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--field); border-radius: 10px; color: var(--text); font-weight: 600; line-height: 1.2; }
.dt-cols summary::-webkit-details-marker { display: none; }
.dt-cols fieldset { position: absolute; z-index: 15; top: calc(100% + 6px); left: 0; min-width: 240px; margin: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .14); }
.dt-scroll { overflow-x: auto; }
table.dt { width: 100%; border-collapse: collapse; font-size: 1rem; }
.dt th, .dt td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.dt th { position: relative; background: var(--bg); font-size: .9375rem; color: var(--muted); white-space: nowrap;
  user-select: none; }
.dt th a { color: var(--text); text-decoration: none; display: inline-flex; gap: 4px; align-items: center; min-height: 32px; }
.dt th a:hover { text-decoration: underline; }
.dt th[aria-sort] a { color: var(--accent); }
.dt-arrow { font-size: .75rem; }
.dt-grip { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 1; }
.dt-grip:hover { background: var(--active); }
.dt .num { text-align: right; font-variant-numeric: tabular-nums; }
.dt tbody tr[data-href] { cursor: pointer; }
.dt tbody tr:hover { background: var(--bg); }
.dt tbody tr.is-urgent td:first-child { box-shadow: inset 4px 0 0 var(--warn-line); }
.dt tbody tr.is-archived { color: var(--muted); }
.dt td a { color: var(--text); font-weight: 700; }
.dt .sub { display: block; color: var(--muted); font-size: .9375rem; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 14px; }
.filters label { display: grid; gap: 4px; font-size: .9375rem; color: var(--muted); font-weight: 600; }
.filters select { min-height: 44px; }
.filters .button, .filters button { width: auto; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.chips a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--field); color: var(--text); text-decoration: none; font-weight: 600; background: var(--card); }
.chips a[aria-current] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chips b { font-variant-numeric: tabular-nums; }
@media (min-width: 720px) { .dt-sortform { display: none; } }
@media (max-width: 719px) {
  .dt-grip { display: none; }
  .dt-cols fieldset { left: auto; right: 0; }
  .dt thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .dt, .dt tbody, .dt tr, .dt td { display: block; width: 100%; }
  .dt tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .dt td { border: 0; padding: 2px 0; }
  .dt td[hidden] { display: none; }
  .dt td:not(:first-child)::before { content: attr(data-label) ": "; color: var(--muted); font-size: .9375rem; }
  .dt td:first-child { font-size: 1.125rem; }
}
.dt .plate, .dt td[data-col="when"] { white-space: nowrap; }
/* Телефон: в карточке сначала то, по чему узнают строку (госномер / имя), числа — слева. */
@media (max-width: 719px) {
  .dt tr { display: flex; flex-direction: column; }
  .dt td.dt-key { order: -1; font-size: 1.125rem; }
  .dt td.dt-key::before { content: none; }
  .dt td.num { text-align: left; }
  .dt td:first-child:not(.dt-key) { font-size: 1rem; }
  .dt td:first-child:not(.dt-key)::before { content: attr(data-label) ": "; color: var(--muted); font-size: .9375rem; }
}
@media (max-width: 719px) {
  .dt tbody tr.is-urgent { box-shadow: inset 4px 0 0 var(--warn-line); }
  .dt tbody tr.is-urgent td:first-child { box-shadow: none; }
}

/* Этап E: паспорт машины (концепт GPT 26.11): карточка-шапка 2×2 и разделы списком. */
.passport-head { padding-bottom: 6px; margin-bottom: 16px; }
.psec-hint .badge { line-height: 1.5; }
.ph-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ph-bar p { margin: 0; }
.ph-bar .button { width: auto; margin: 0; min-height: 40px; }
.ph-title { display: flex; gap: 16px; align-items: flex-start; margin: 10px 0 4px; }
.ph-ico { width: 3rem; height: 3rem; flex: none; color: var(--accent); margin-top: 4px; }
.ph-title h1 { margin: 0; font-size: 1.75rem; line-height: 1.2; }
.ph-sub { margin: 4px 0 0; font-size: 1.125rem; }
.ph-status { margin: 4px 0 0; font-weight: 600; color: var(--muted); }
.ph-status.is-warn { color: var(--warn-text); }
.ph-status.is-ok { color: var(--ok-text); }
.ph-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 14px 0 8px;
  padding-top: 14px; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .ph-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ph-facts dt { color: var(--muted); font-size: .9375rem; }
.ph-facts dd { margin: 2px 0 0; font-size: 1.375rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ph-facts dd small { display: block; font-size: .875rem; font-weight: 500; color: var(--muted); }
.ph-facts .is-warn dd { color: var(--warn-text); }
.ph-facts .is-bad dd { color: var(--bad-text); }
.psections { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.psec { border-bottom: 1px solid var(--line); }
.psections > .psec:last-child { border-bottom: 0; }
.psec > summary, .psec-later { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 0 18px;
  font-size: 1.125rem; font-weight: 600; line-height: 1.25; padding-top: 8px; padding-bottom: 8px; }
.psec > summary { list-style: none; cursor: pointer; }
.psec > summary::-webkit-details-marker { display: none; }
.psec > summary:hover { background: var(--bg); }
.psec > summary:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.psec-title { flex: 1; min-width: 0; }
.psec-hint { color: var(--muted); font-size: .9375rem; font-weight: 500; text-align: right; }
.psec-chev { color: var(--muted); transition: transform .15s; }
.psec[open] > summary .psec-chev { transform: rotate(90deg); }
.psec[open] > summary { border-bottom: 1px solid var(--line); }
.psec-body { padding: 14px 18px 18px; }
.psec-later { color: var(--muted); font-weight: 500; }
.psec-later .psec-hint { font-size: .8125rem; border: 1px solid var(--line); border-radius: 8px; padding: 1px 8px; }
.psec[id] { scroll-margin-top: 64px; }
.passport-actions { display: grid; gap: 10px; margin-bottom: 16px; }
.passport-actions .button { width: 100%; margin: 0; text-align: center; }
@media (prefers-reduced-motion: reduce) { .psec-chev { transition: none; } }
/* Телефон: подсказки справа не сжимают названия — цифры и так в шапке. */
@media (max-width: 479px) { .psec > summary .psec-hint { display: none; } }
/* RFC-004 APP-03: новая версия — человек обновляет сам, когда удобно. */
.app-update { position: sticky; top: 0; z-index: 11; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 12px 0 0; padding: 10px 14px; border-radius: 12px;
  background: var(--active); border: 1px solid var(--accent); color: var(--text); font-weight: 600; }
.app-update[hidden] { display: none; }
/* RFC-004 APP-01: установка — показываем инструкцию только для этого устройства. */
.install-steps[hidden], .install-only[hidden] { display: none; }
.install-steps ol { margin: 8px 0 0; padding-left: 1.4em; }
.install-steps li { margin: 4px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; word-break: break-all; }
.note-ok { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-text); border-radius: 12px;
  padding: 10px 14px; font-weight: 600; }
.login-password { margin-top: 20px; text-align: left; }

/* --- Как приложение (26.11, просьба Дани: «Назад», экран не дёргается, как в Core) --- */
/* Экран не «резинит» и не прокручивается под шапкой; текст не раздувается при повороте телефона. */
html, body { overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Нет двойного тапа-зума и серой вспышки при нажатии; кнопки и меню не выделяются как текст. */
a, button, input, select, textarea, label, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, .button, .iconbtn, .side-nav a, .side-foot a, .topbar, summary { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* iPhone приближает экран, если у поля шрифт меньше 16 px, и не отдаляет обратно — держим 16 px и больше. */
input, select, textarea { font-size: max(1rem, 16px); }
/* Отклик на нажатие — как у кнопок в приложении. */
button:active, .button:active, .iconbtn:active, .side-nav a:active, .backlink:active { opacity: .7; }
.topbar .back { border-color: transparent; }
.backlink { display: none; align-items: center; gap: 4px; margin: 0 0 8px -6px; padding: 6px 8px; border-radius: 10px;
  color: var(--link); text-decoration: none; font-weight: 600; width: max-content; }
.backlink:hover { background: var(--card); }
@media (min-width: 1024px) { .backlink.only-wide { display: inline-flex; } }
/* Плавная смена страниц (Safari 18.2+, Chrome 126+): шапка и меню стоят, меняется середина. */
@view-transition { navigation: auto; }
.topbar { view-transition-name: vas-topbar; }
.side { view-transition-name: vas-side; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
/* Кнопка во время отправки формы. */
button.busy { opacity: .6; cursor: progress; }
button.busy::after { content: " …"; }
/* Плашка обновления на телефоне — под шапкой (обе закреплены сверху, шапка непрозрачная). */
@media (max-width: 1023px) { body.with-nav .app-update { top: 61px; z-index: 19; } }

/* Нижняя панель разделов (ревью вида 26.11): телефон и планшет, под большой палец */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.tabbar a, .tabbar button { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 58px; padding: 6px 2px; border: 0; border-radius: 0; background: none; color: var(--muted);
  font: inherit; font-size: 0.75rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar a.active { color: var(--accent); }
.tabbar a.active svg { background: var(--active); border-radius: 999px; padding: 2px 14px; width: 52px; box-sizing: border-box; }
.tabbar a:active, .tabbar button:active { background: var(--bg); }
@media (max-width: 1023px) {
  body:has(.tabbar) .work { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media print { .tabbar { display: none; } }

/* «Сегодня»: сводка дня одной строкой (ревью вида 26.11) — только ненулевое + свободные посты */
.daybar { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.daybar a, .daybar span { display: inline-flex; align-items: baseline; gap: 5px; min-height: 40px; padding: 8px 11px; font-size: 0.9375rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); font-weight: 600; text-decoration: none; }
.daybar b { color: var(--text); font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.daybar li.is-warn a { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-text); }
.daybar li.is-warn b { color: var(--warn-text); }
.fb-text { white-space: pre-wrap; overflow-wrap: anywhere; }
fieldset.stack { border: 0; padding: 0; margin: 0; }

/* APP-02: размер интерфейса. zoom увеличивает всё вместе — текст, кнопки, поля, значки, отступы и зоны
   нажатия — и раскладка перестраивается под меньшую «ширину» (на телефоне 375 → 326 / 288 точек). */
html[data-scale="1"] body { zoom: 1.15; }
html[data-scale="2"] body { zoom: 1.3; }
.scale-pick { display: grid; grid-template-columns: 1fr; gap: 8px; }
.scale-pick button { min-height: 56px; padding: 6px 4px; }
.scale-pick .scale-0 { font-size: 0.9375rem; }
.scale-pick .scale-1 { font-size: 1.0625rem; }
.scale-pick .scale-2 { font-size: 1.1875rem; }
/* В крупном размере «ширина» экрана меньше: поле не должно распирать форму своей естественной шириной. */
.stack { grid-template-columns: minmax(0, 1fr); }
input, select, textarea { max-width: 100%; min-width: 0; box-sizing: border-box; }
/* Меню при увеличении: ширина от краёв экрана (как у нижней панели), иначе увеличенные 300 точек шире телефона. */
@media (max-width: 1023px) { html[data-scale] .side { width: auto; right: 14%; max-width: 300px; } }
html[data-scale="2"] .tabbar a, html[data-scale="2"] .tabbar button { font-size: 0.6875rem; padding-inline: 0; letter-spacing: -0.01em; }

/* RFC-005: Beta видно сразу — оранжевая полоса сверху и оранжевая черта под шапкой на каждом экране. */
.beta-bar { background: #C2410C; color: #fff; text-align: center; font-weight: 700; font-size: 0.8125rem;
  letter-spacing: .02em; padding: 4px 12px; }
html.is-beta .topbar { box-shadow: inset 0 -3px 0 #EA580C; }
html.is-beta .tabbar { box-shadow: inset 0 3px 0 #EA580C; }
