/* Принято-145 / P5-03: длинная сумма остаётся читаемой на320px без прокрутки страницы. */
#file-check { display: grid; gap: 12px; }
#file-check[hidden], #check-unavailable[hidden] { display: none; }
#file-check input { min-width: 0; max-width: 100%; min-height: 44px; }
#check-digest { overflow-wrap: anywhere; font-family: monospace; }
.file-check-page { overflow-wrap: anywhere; }
.file-check-page button { white-space: normal; max-width: 100%; }
#file-check > * { min-width: 0; }
/* Принято-145 / P5-04–05: инструменты — линейные формы чтения, без fake checkout. */
.planning-page { overflow-wrap: anywhere; }
.planning-tools { display: grid; gap: 12px; max-width: 65ch; }
.planning-tools[hidden], .planning-tools [hidden] { display: none; }
.planning-tools > * { min-width: 0; }
.planning-tools input:not([type="checkbox"]), .planning-tools select, .planning-tools textarea { max-width: 100%; min-width: 0; width: 100%; }
.planning-tools textarea { resize: vertical; }
.planning-tools button { white-space: normal; max-width: 100%; }
.planning-actions { display: flex; flex-wrap: wrap; gap: 12px; }
/* Принято-145 / P5-07–09: локальные инструменты доступны с клавиатуры;
   печать не раскрывает исходные строки редактора или полный введённый URL. */
.planning-index { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-block: 24px; }
.planning-index a { display: inline-flex; align-items: center; min-height: 44px; }
.planning-page .planning-tools :is(input, textarea, select, button):focus-visible { outline: 3px solid #1d4ed8; outline-offset: 3px; }
.planning-page .planning-tools :is(input, textarea, select) { font: inherit; padding: 10px; border: 1px solid #64748b; border-radius: 6px; background: #fff; color: #334155; }
.planning-page .planning-tools [readonly] { background: #f1f5f9; }
@media (forced-colors: active) {
  .planning-page .planning-tools :is(input, textarea, select) { background: Canvas; color: CanvasText; border-color: CanvasText; }
  .planning-page .planning-tools :is(input, textarea, select, button):focus-visible { outline-color: Highlight; }
}
@media print {
  .planning-index, #redact-tools, #path-tools, #time-tools { display: none !important; }
}
/* Принято-102/103/129: публичные документы и scoped страницы ошибок.
   Этот allowlisted ресурс доступен Apache и при остановленном backend. */
/* Принято-129: цельная иллюстрация маршрута. Никаких absolute-текстов поверх
   номера/персонажа; единственная группа действий принадлежит error-story. */
.error-page { min-height: 100svh; display: flex; flex-direction: column; background: #fff; color: #334155; }
.error-header, .error-footer { width: min(1280px, 100%); margin-inline: auto; padding: 24px 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.error-header { border-bottom: 1px solid #cbd5e1; }
.error-header img { display: block; }
.error-header span { font-size: .875rem; }
.error-layout { width: min(1160px, 100%); margin: auto; padding: 48px 40px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 48px; }
.error-layout > * { min-width: 0; }
.error-story h1 { font-size: clamp(1.8rem, 3.1vw, 2.8rem); line-height: 1.16; max-width: 22ch; margin-bottom: 20px; text-wrap: balance; }
.error-eyebrow { color: #1d4ed8; font-weight: 500; font-size: 0.875rem; margin-bottom: 20px; }
.error-description { font-size: 1.125rem; max-width: 46ch; }
.error-detail { padding: 16px 0 16px 18px; border-left: 2px solid #2563eb; margin-top: 24px; font-size: 0.875rem; }
.error-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-top: 28px; }
.error-safety { font-size: 0.75rem; color: #5f6678; margin-top: 24px; max-width: 48ch; }
.error-scene { min-width: 0; }
/* Код уже дан в eyebrow. Прежний дубликат оставлен скрытым для старых fixtures. */
.error-number { display: none; }
.error-companion { margin: 0; width: 100%; max-width: 460px; }
/* Принято-139: R4. Предметы исходной сцены уже объясняют поиск/границу доступа.
   Не накладываем ещё один маршрут, значки и реплики от лица маскота. Белый фон
   продолжает страницу; полный кадр не обрезается ради одинаковой карточки. */
.mascot-ui-stage img { display: block; width: 100%; height: auto; object-fit: contain; }
.mascot-bubble { margin: 8px 0 0; padding: 0; max-width: 34ch; color: #5f6678; font-size: 0.75rem; line-height: 1.5; }
.error-footer { font-size: 0.75rem; border-top: 1px solid #cbd5e1; }
.error-footer span { max-width: 36ch; text-align: right; }
/* Существующая форма MFA остаётся основной: иллюстрация не вытесняет её поля. */
.manage-page main > .error-companion, body:not(.error-page) main > .error-companion { max-width: 360px; margin: 28px auto; }
/* Ошибку мутации/входа не превращаем в новую форму: раскладываем существующий
   документ, сохраняя токены и порядок полей. Подвал всегда завершает страницу. */
.error-decorated.manage-page .panel-main { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.error-decorated.manage-page .panel-main > h1, .error-decorated.manage-page .panel-main > footer { grid-column: 1 / -1; }
.error-decorated.manage-page .panel-main > .error-companion { grid-column: 2; grid-row: 2; margin: 0; align-self: center; }
.error-decorated .manage-action-feedback nav { display: grid; gap: 8px; margin-top: 20px; }
.error-decorated .manage-action-feedback nav a { display: flex; align-items: center; min-height: 44px; padding-block: 8px; }
.error-decorated .manage-action-feedback > h2 { display: none; }
@media (max-width: 760px) {
  .error-header, .error-footer { padding: 18px 24px; flex-wrap: wrap; }
  .error-header span { display: none; }
  .error-layout { grid-template-columns: 1fr; padding: 24px; gap: 24px; }
  .error-story h1 { max-width: 25ch; }
  .error-scene { max-width: 250px; width: 100%; margin-inline: auto; }
  .error-scene .mascot-bubble { font-size: .875rem; }
  .error-actions { align-items: stretch; gap: 8px; }
  .error-safety { margin-top: 16px; }
  .error-description { font-size: 1rem; }
  .error-footer span { text-align: left; }
  .error-decorated.manage-page .panel-main { display: block; }
  .error-decorated.manage-page .panel-main > .error-companion { max-width: 250px; margin: 20px auto; }
}
@media (prefers-reduced-motion: reduce) { .error-page *, .error-page *::before, .error-page *::after { transition: none !important; animation: none !important; } }
.public-guide { background: #fff; color: #334155; }
.public-guide .wrap { max-width: 1080px; }
.guide-header > .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; }
.guide-header .brand img { width: 160px; height: 40px; }
.guide-header nav { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-left: auto; }
.public-guide a { color: #1d4ed8; }
.public-guide .skip { color: #fff; }
.guide-header nav a, .guide-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.guide-main { padding-top: 48px; padding-bottom: 32px; }
.guide-main h1 { font-size: clamp(1.8rem, 4vw, 3rem); max-width: 24em; }
.guide-main p, .guide-main li { max-width: 65ch; }
.guide-main section { padding: 28px 0; border-top: 1px solid #cbd5e1; }
.guide-main h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); line-height: 1.3; }
.guide-main ul { padding-left: 1.3em; }
.guide-main li { margin-bottom: .7em; }
.guide-main .guide-print-help { padding: 20px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f1f5f9; }
.guide-main p a { display: inline-block; min-height: 44px; padding-block: 8px; }
.guide-footer { padding-bottom: 32px; border-top: 1px solid #cbd5e1; }
.guide-print-source { display: none; }
/* Принято-139: R4. Только Public guides: правила error/Office/Manage выше не
   меняются. Семантические фазы читаются без графики, JS и фоновой печати. */
.connection-guide .guide-lead { font-size: 1.125rem; line-height: 1.7; max-width: 60ch; border-left: 3px solid #3366ff; padding-left: 20px; margin-block: 24px; }
.connection-guide .guide-contents { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 24px; margin-block: 24px; padding-block: 12px; border-block: 1px solid #cbd5e1; }
.connection-guide .guide-contents a, .connection-guide .guide-next { display: flex; align-items: center; min-height: 44px; padding-block: 8px; }
.connection-guide .guide-step { border-left: 2px solid #cbd5e1; padding-left: 24px; }
.connection-guide .guide-step > h2 { scroll-margin-top: 24px; }
.connection-guide .guide-step > h2:target { outline: 3px solid #1d4ed8; outline-offset: 6px; }
.connection-guide .guide-checks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 24px; margin-block: 24px; }
.connection-guide .guide-checks label { display: flex; align-items: start; gap: 12px; min-width: 0; overflow-wrap: anywhere; min-height: 44px; padding: 12px; border: 1px solid #cbd5e1; border-radius: 6px; cursor: pointer; }
.connection-guide .guide-checks input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 3px; accent-color: #3366ff; }
.connection-guide .guide-checks label:has(input:focus-visible) { outline: 3px solid #1d4ed8; outline-offset: 3px; }
.connection-guide .guide-safety { background: #f8fafc; border-left-color: #1d4ed8; padding-right: 20px; }
.connection-guide .guide-trouble details { padding: 16px 0; border-bottom: 1px solid #cbd5e1; }
.connection-guide .guide-trouble summary { min-height: 44px; font-weight: 500; cursor: pointer; color: #04122e; }
.connection-guide .guide-trouble summary::marker { color: #1d4ed8; }
.connection-guide .guide-trouble details[open] > summary { margin-bottom: 12px; }
.connection-guide .guide-trouble details > a { display: inline-flex; align-items: center; min-height: 44px; }
.connection-guide .guide-trouble details > p { max-width: 58ch; }
.connection-guide .guide-terms { display: grid; grid-template-columns: minmax(6em,1fr) minmax(0,4fr); gap: 16px 24px; }
.connection-guide .guide-terms dt { font-weight: 600; color: #04122e; scroll-margin-top: 24px; }
.connection-guide .guide-terms dd { margin: 0; padding-bottom: 16px; border-bottom: 1px solid #cbd5e1; max-width: 60ch; }
.connection-guide .guide-header [aria-current] { font-weight: 600; text-decoration-thickness: 2px; }
/* Задача248 / Public D11: три временные главы вместо перемежающихся ссылок.
   Линия находится над ссылками и не пересекает текст при переносе. */
.connection-guide .guide-contents.guide-route { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; padding-block: 24px; }
.guide-route-stage { min-width: 0; border-top: 3px solid #2563eb; padding-top: 16px; }
.guide-main .guide-route-stage h2 { font-size: 1rem; min-height: 4.5em; margin-bottom: 12px; }
.guide-route-stage h2 span { display: block; color: #1d4ed8; font-size: 0.875rem; margin-bottom: 8px; }
.guide-route-stage a { border-bottom: 1px solid #cbd5e1; }
/* Задача248 / Public D12: общая подпись и две равноправные колонки показывают
   альтернативы допуска, а не последовательные шаги или работающую auth-форму. */
.guide-access-modes { margin-block: 24px; border-block: 1px solid #cbd5e1; padding-block: 20px; }
.guide-access-modes h3 { font-size: 1.125rem; }
.guide-access-modes dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; margin-block: 20px; }
.guide-access-modes dl > div { min-width: 0; }
.guide-access-modes dt { color: #1d4ed8; font-weight: 600; margin-bottom: 12px; }
.guide-access-modes dd { margin: 0; overflow-wrap: anywhere; }
.guide-access-modes dt { overflow-wrap: anywhere; }
.guide-access-modes > p { margin-bottom: 0; font-size: 1rem; }
@media (max-width: 700px) {
  .connection-guide .guide-contents.guide-route, .guide-access-modes dl { grid-template-columns: 1fr; }
  .guide-main .guide-route-stage h2 { min-height: 0; }
  .guide-access-modes dl > div + div { border-top: 1px solid #cbd5e1; padding-top: 20px; }
}
@media (forced-colors: active) {
  .guide-route-stage, .guide-route-stage a, .guide-access-modes, .guide-access-modes dl > div { border-color: CanvasText; }
  .guide-route-stage h2 span, .guide-access-modes dt { color: CanvasText; }
}
@media print {
  .guide-access-modes dl { display: block; }
  .guide-access-modes dl > div { margin-bottom: 8pt; break-inside: avoid; }
  .guide-access-modes dt { color: #000; }
}
@media (max-width: 600px) {
  .connection-guide .guide-checks, .connection-guide .guide-contents, .connection-guide .guide-terms { grid-template-columns: 1fr; }
  .connection-guide .guide-step { padding-left: 16px; }
  .connection-guide .guide-terms { gap: 8px; }
}
@media (forced-colors: active) {
  .connection-guide .guide-step, .connection-guide .guide-checks label, .connection-guide .guide-terms dd, .connection-guide .guide-contents, .connection-guide .guide-lead { border-color: CanvasText; }
  .connection-guide .guide-step > h2:target, .connection-guide .guide-checks label:has(input:focus-visible) { outline-color: Highlight; }
  .connection-guide .guide-safety { background: Canvas; }
}
@media print {
  .connection-guide .guide-contents, .connection-guide .guide-next { display: none; }
  .connection-guide .guide-step { border-left: 0; padding-left: 0; break-inside: auto; }
  .connection-guide .guide-step > h2 { break-after: avoid-page; }
  .connection-guide .guide-checks { display: block; }
  .connection-guide .guide-checks label { break-inside: avoid; border: 0; padding: 4pt 0; min-height: 0; }
  /* Пустой печатный квадрат — новая проверка на бумаге, не экспорт состояния ПК. */
  .connection-guide .guide-checks input { appearance: none; border: 1pt solid #000; width: 10pt; height: 10pt; background: #fff; }
  .connection-guide details::details-content { content-visibility: visible; display: block; }
  .connection-guide .guide-trouble details { break-inside: avoid; }
  .connection-guide .guide-trouble details > a { min-height: 0; }
  .connection-guide .guide-terms { display: block; }
  .connection-guide .guide-terms dt { break-after: avoid; }
}
@media (max-width: 600px) {
  .guide-header nav { margin-left: 0; }
  .guide-main { padding-top: 32px; }
}
/* Смысл не зависит от цветной заливки или настроек «печатать фон».
   Не печатаем навигацию; ссылки/контакты и границы допуска остаются в тексте. */
@page { size: A4; margin: 12mm; }
@media print {
  /* Принято-102: временный сигнал сети не должен попадать в постоянную памятку. */
  .public-guide .site-connectivity, .public-guide noscript { display: none !important; }
  .public-guide { color: #04122e; font-size: 10pt; line-height: 1.35; }
  .public-guide .skip, .public-guide .guide-header, .public-guide .guide-footer,
  .public-guide .guide-print-help { display: none; }
  .public-guide .guide-main { width: auto; max-width: none; padding: 0; margin: 0; }
  .guide-main h1 { font-size: 20pt; margin-bottom: 12pt; }
  .guide-main h2 { font-size: 12pt; break-after: avoid; }
  .guide-main p, .guide-main li { max-width: none; }
  .guide-main section { padding: 8pt 0; break-inside: avoid; }
  .public-guide a { color: #04122e; }
  .guide-main p a { display: inline; min-height: 0; padding: 0; }
  .guide-main p { margin-bottom: 7pt; }
  .guide-main .eyebrow { color: #04122e; font-size: 9pt; margin-bottom: 8pt; }
  .guide-main .guide-print-source { display: block; margin-top: 8pt; border-top: 1pt solid #04122e; padding-top: 6pt; font-size: 9pt; }
}


/* Public improve 2026-11-02 (U1–U4, U7, U9, U10): единые контролы и состояния форм без градиентов и теней. */
.planning-index a { border: 1px solid #8590a5; border-radius: 6px; padding-inline: 16px; text-decoration: none; }
.planning-index a:hover { background: #f1f5ff; border-color: #3366ff; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.field-row > div { display: grid; gap: 8px; min-width: 0; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
/* Результат оформляется карточкой только когда в нём есть текст: пустой live-регион не оставляет рамку. */
#estimate-result { margin: 0; padding: 0; }
#estimate-result:not(:empty) { padding: 16px; border-left: 3px solid #3366ff; background: #f1f5ff; }
/* Кнопки одиночного действия не растягиваются на колонку формы. */
.planning-tools > button, .planning-tools .planning-actions button, #file-check button { width: fit-content; justify-self: start; }
/* Атрибут hidden должен побеждать display:inline-flex из xp-ui.css (иначе кнопка видна до результата). */
#check-copy[hidden], #note-copy[hidden] { display: none; }
.estimate-compare[hidden] { display: none; }
.estimate-compare { width: 100%; border-collapse: collapse; }
.estimate-compare th, .estimate-compare td { padding: 12px; text-align: left; border-top: 1px solid #cbd5e1; }
.estimate-compare caption { text-align: left; padding: 12px 0; color: #334155; }
.estimate-compare tr[aria-current] { background: #f1f5ff; }
.field-count { display: block; font-size: 14px; color: #5f6678; }
.field-count.over { color: #b42318; font-weight: 600; }
.known-sums { list-style: none; padding: 0; display: grid; gap: 12px; }
.known-sums li { padding: 16px; border: 1px solid #cbd5e1; border-radius: 8px; max-width: none; }
.known-sums code { display: block; font-size: 14px; overflow-wrap: anywhere; }
.guide-main input[type="file"]::file-selector-button { background: #fff; color: #12141a; border: 1px solid #8590a5; border-radius: 6px; padding: 8px 16px; margin-right: 12px; font: inherit; cursor: pointer; }
/* Видимое состояние ошибки поля: не только цвет, но и толщина рамки. */
.file-check-page [aria-invalid="true"], .planning-page [aria-invalid="true"] { border: 2px solid #b42318; }
/* Счётчик готовности на CSS-счётчиках: работает без JS и ничего не хранит. */
.connection-guide .guide-step:has(.guide-checks) { counter-reset: done; }
.connection-guide .guide-checks input:checked { counter-increment: done; }
.connection-guide .guide-progress::after { content: "Отмечено: " counter(done) " из 4"; font-weight: 500; color: #12141a; }
.connection-guide .guide-checks label:has(input:checked) { border-color: #3366ff; background: #f1f5ff; }
@media print { .guide-progress, .estimate-compare { display: none; } }

/* === Фикс страницы ошибки (.error-page): кнопки без xp-ui.css, тёмная тема, сцена === */
.error-page {
  --err-bg: #f8fafc; --err-surface: #ffffff; --err-soft: #f1f5f9;
  --err-ink: #0f172a; --err-text: #334155; --err-muted: #475569;
  --err-line: #cbd5e1; --err-brand: #2563eb; --err-brand-hover: #1d4ed8; --err-brand-soft: #eff6ff;
  min-height: 100svh; display: flex; flex-direction: column;
  background: var(--err-bg); color: var(--err-text);
  font-family: Onest, "Segoe UI", Arial, sans-serif;
}
:root[data-theme="dark"] .error-page {
  --err-bg: #0b111b; --err-surface: #131b29; --err-soft: #1a2436;
  --err-ink: #e6edf7; --err-text: #cbd5e1; --err-muted: #94a3b8;
  --err-line: #2c3a50; --err-brand: #60a5fa; --err-brand-hover: #93c5fd; --err-brand-soft: #172554;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .error-page {
    --err-bg: #0b111b; --err-surface: #131b29; --err-soft: #1a2436;
    --err-ink: #e6edf7; --err-text: #cbd5e1; --err-muted: #94a3b8;
    --err-line: #2c3a50; --err-brand: #60a5fa; --err-brand-hover: #93c5fd; --err-brand-soft: #172554;
  }
}
.error-header {
  width: 100%; max-width: none;
  padding: 12px max(32px, calc((100% - 1376px) / 2));
  min-height: 64px;
  background: var(--err-surface);
  border-bottom: 1px solid var(--err-line);
  border-top: 2px solid #2563eb;
}
.error-header img { width: 160px; height: 40px; object-fit: contain; }
.error-header span {
  display: inline-flex; align-items: center; padding: 4px 12px;
  border: 1px solid var(--err-line); border-radius: 999px;
  background: var(--err-soft); color: var(--err-muted); font-size: 13px; font-weight: 500;
}
.error-footer {
  width: min(1280px, 100%); margin-inline: auto; padding: 20px 40px;
  border-top: 1px solid var(--err-line); color: var(--err-muted);
}
.error-layout {
  width: min(1160px, 100%); margin: auto; padding: 48px 40px;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  align-items: center; gap: 48px;
}
.error-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; margin-bottom: 16px;
  border: 1px solid var(--err-line); border-radius: 999px;
  background: var(--err-surface); color: var(--err-brand); font-size: 13px; font-weight: 600;
}
.error-story h1 { color: var(--err-ink); font-size: clamp(2rem, 3.2vw, 2.75rem); letter-spacing: -0.02em; margin: 0 0 16px; }
.error-description { color: var(--err-text); font-size: 1.0625rem; line-height: 1.6; margin-bottom: 20px; }
.error-detail {
  padding: 12px 16px; margin-top: 20px;
  border: 1px solid var(--err-line); border-left: 3px solid var(--err-brand); border-radius: 6px;
  background: var(--err-surface); color: var(--err-ink); font-size: 14px;
}
.error-detail code { font-family: Consolas, monospace; padding: 2px 6px; border-radius: 4px; background: var(--err-soft); }
.error-safety { color: var(--err-muted); font-size: 13px; margin-top: 24px; }
.error-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 28px; }
.error-actions a, .error-actions button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px;
  border: 1px solid var(--err-line); border-radius: 8px;
  background: var(--err-surface); color: var(--err-ink);
  font: 500 15px/1.4 Onest, Arial, sans-serif; text-decoration: none; cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.error-actions a:hover, .error-actions button:hover { background: var(--err-brand-soft); border-color: var(--err-brand); color: var(--err-brand); }
.error-actions a.error-primary { background: #2563eb; border-color: #2563eb; color: #ffffff; }
.error-actions a.error-primary:hover { background: #1d4ed8; border-color: #1d4ed8; color: #ffffff; }
.error-companion {
  padding: 28px; border: 1px solid var(--err-line); border-radius: 16px;
  background: radial-gradient(circle at 50% 45%, rgba(59,130,246,.12), var(--err-surface) 75%);
  text-align: center;
}
.mascot-bubble { margin: 12px auto 0; color: var(--err-muted); font-size: 13px; }
@media (max-width: 860px) { .error-layout { grid-template-columns: minmax(0,1fr); padding: 32px 20px; gap: 28px; } .error-header, .error-footer { padding-inline: 20px; } }

/* ==========================================================================
   ОПТИМИЗАЦИЯ СЕМЕЙСТВА ПУБЛИЧНЫХ ГАЙДОВ (.public-guide)
   ========================================================================== */

html:has(body.public-guide),
body.public-guide {
  color-scheme: light;
  --xp-brand: #2563eb;
  --xp-brand-hover: #1d4ed8;
  --xp-brand-soft: #eff6ff;
  --xp-brand-fill: #2563eb;
  --xp-brand-text: #1d4ed8;
  --xp-on-brand: #ffffff;
  --xp-ink: #0f172a;
  --xp-text: #334155;
  --xp-muted: #475569;
  --xp-line: #cbd5e1;
  --xp-surface: #ffffff;
  --xp-surface-2: #f1f5f9;
  --xp-soft: #eff6ff;
  background: #ffffff;
  color: #334155;
}
.public-guide .top.guide-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0 !important;
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #cbd5e1;
  border-top: 2px solid #2563eb;
}
.public-guide .guide-header > .wrap {
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 12px 24px;
}
.public-guide .guide-header nav {
  gap: 4px 12px;
}
.public-guide .guide-header nav a {
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 6px;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}
.public-guide .guide-header nav a:hover {
  background: #f1f5f9;
  color: #1d4ed8;
}
.public-guide .guide-header nav a[aria-current="page"],
.public-guide .guide-header nav a[aria-current="true"] {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
  box-shadow: inset 0 -2px 0 #2563eb;
}
.public-guide .guide-lead {
  font-size: 1.0625rem;
  line-height: 1.65;
  max-width: 65ch;
  padding: 14px 20px;
  margin-block: 20px 24px;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
}
.public-guide .guide-contents {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 20px;
  margin-block: 24px 32px;
  padding: 16px 20px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
}
.public-guide .guide-contents__title {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5f6678;
  margin-bottom: 4px;
}
.public-guide .guide-contents a {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.925rem;
  font-weight: 500;
  text-decoration: none;
  color: #1d4ed8;
}
.public-guide .guide-contents a:hover {
  background: #eff6ff;
  text-decoration: underline;
}
.public-guide .guide-step {
  border-top: 1px solid #cbd5e1;
  border-left: 3px solid #2563eb;
  padding: 24px 0 24px 24px;
  margin-bottom: 16px;
  scroll-margin-top: 84px;
}
.public-guide .guide-step > h2 {
  scroll-margin-top: 84px;
  margin-top: 0;
}
/* Гайды — не продуктовая витрина: глобальный min-width:560px из site.css
   здесь ни к чему, таблицы двухколоночные и обязаны сжиматься до экрана. */
.public-guide .a11y-matrix, .public-guide .estimate-compare {
  min-width: 0;
}
.public-guide .a11y-matrix {
  width: 100%;
  max-width: 760px;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-size: 0.925rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
}
.public-guide .a11y-matrix th,
.public-guide .a11y-matrix td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e2e8f0;
}
.public-guide .a11y-matrix thead th {
  background: #f1f5f9;
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.public-guide .a11y-report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.public-guide .guide-print-source {
  display: none;
}
@media print {
  .public-guide .guide-print-source {
    display: block;
    margin-top: 32px;
    padding-top: 12px;
    border-top: 1px solid #cbd5e1;
    color: #5f6678;
    font-size: 0.75rem;
  }
}
@media (max-width: 600px) {
  .public-guide .guide-step {
    padding-left: 16px;
  }
}

/* ==========================================================================
   РЕДИЗАЙН СТРАНИЦЫ «ПЕРВОЕ ПОДКЛЮЧЕНИЕ: ПАМЯТКА» (.connection-guide)
   ========================================================================== */
.connection-guide .guide-print-help {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 16px 20px;
  margin-block: 20px 24px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}
.connection-guide .guide-print-help p {
  margin: 0;
  font-size: 0.925rem;
  color: #334155;
  flex: 1 1 340px;
}
.connection-guide .guide-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.connection-guide .guide-role-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
}
.connection-guide .guide-role-switch button {
  min-height: 32px;
  padding: 4px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}
.connection-guide .guide-role-switch button[aria-pressed="true"] {
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
}
.connection-guide[data-guide-role="client"] .guide-step[data-step-role="admin"],
.connection-guide[data-guide-role="admin"] .guide-step[data-step-role="client"] {
  opacity: 0.55;
}
.connection-guide .guide-contents.guide-route {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 20px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}
.connection-guide .guide-route-stage {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-top: 3px solid #2563eb;
  border-radius: 8px;
  background: #ffffff;
}
.connection-guide .guide-main .guide-route-stage h2 {
  min-height: 0;
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 1rem;
}
.connection-guide .guide-route-stage a {
  min-height: 38px;
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
  border-radius: 4px;
  font-size: 0.875rem;
  text-decoration: none;
}
.connection-guide .guide-route-stage a:last-child { border-bottom: 0; }
.connection-guide .guide-route-stage a:hover { background: #eff6ff; color: #1d4ed8; }
.connection-guide .guide-step {
  position: relative;
  padding: 24px 24px 24px 28px;
  margin-bottom: 16px;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.connection-guide .guide-step.guide-safety {
  border-left-color: #2563eb;
  background: #f8fafc;
}
.connection-guide .guide-step:target,
.connection-guide .guide-step:has(:target) {
  border-color: #93c5fd;
  border-left-color: #2563eb;
  background: #eff6ff;
}
.connection-guide .guide-step > h2:target { outline: none; }
.connection-guide .guide-next {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-top: 8px;
  padding: 6px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}
.connection-guide .guide-next:hover { background: #eff6ff; border-color: #2563eb; }
.connection-guide .guide-progress-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin: 12px 0 16px;
  border: 1px solid #cbd5e1;
  border-left: 3px solid #2563eb;
  border-radius: 6px;
  background: #f8fafc;
}
.connection-guide .guide-progress { margin: 0; }
.connection-guide .guide-step:has(.guide-checks input:not(:checked)) .guide-progress::after {
  content: "Отмечено пунктов готовности: " counter(done) " из 4";
}
.connection-guide .guide-step:not(:has(.guide-checks input:not(:checked))) .guide-progress-bar {
  border-color: #bbf7d0;
  border-left-color: #15803d;
  background: #f0fdf4;
}
.connection-guide .guide-step:not(:has(.guide-checks input:not(:checked))) .guide-progress::after {
  content: "✓ Все 4 пункта проверены — рабочее место готово к сеансу";
  color: #15803d;
  font-weight: 600;
}
.connection-guide .guide-trouble details {
  padding: 4px 16px;
  margin-bottom: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
}
.connection-guide .guide-trouble details[open] {
  border-color: #2563eb;
  background: #ffffff;
  padding-bottom: 14px;
}
.connection-guide .guide-trouble details:target {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
@media (max-width: 900px) {
  .connection-guide .guide-contents.guide-route {
    grid-template-columns: 1fr;
  }
}
@media print {
  .connection-guide .guide-step .guide-print-source { display: none !important; }
  .connection-guide .guide-checks label,
  .connection-guide .guide-checks label:has(input:checked) {
    border: 0 !important;
    background: transparent !important;
    padding: 4pt 0 !important;
  }
  .connection-guide .guide-checks input {
    appearance: none !important;
    width: 10pt !important;
    height: 10pt !important;
    border: 1pt solid #000 !important;
    background: #fff !important;
  }
  .connection-guide .guide-progress-bar,
  .connection-guide .guide-toolbar-actions,
  .connection-guide .guide-role-switch,
  .connection-guide .guide-print-help {
    display: none !important;
  }
}
