/* Экран «План работы» (/plan) — макет web/mockup/Plan*.dc.html. Поверх
   payroll.css: карточки, поля и кнопки форм — его .pay-*.
   Цвета — палитра «Полного разбора» (--rz-* в site.css, как razbor-pages.css):
   владелец 20.11.2026 «цвета аналогичные и кнопки и внутри на странице».
   Главные кнопки — .btn.rz-btn (site.css); красный остаётся только у ошибок.
   Контраст сверяет tools/site_dev/test_razbor_pages.mjs. */

/* --muted общий даёт 4,47:1 на --rz-bg — на странице свой, темнее (как у разбора) */
.plan-page { background: var(--rz-bg); --muted: var(--rz-muted); }
.plan-page .pay-guest { background: var(--card); border-color: var(--rz-line); }
/* «Начать заново» и другие ссылки-кнопки: в payroll.css они красные */
.plan-page .pay-link { color: var(--rz-ink); }
.plan-page .pay-link:hover { color: var(--rz-ink-2); }
/* Вторичные кнопки (в site.css рамка при наведении красная) — индиго */
.plan-page .btn:not(.rz-btn):hover { border-color: var(--rz-ink); }

.plan-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; max-width: 1180px; }
.plan-flow { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.plan-card textarea, .plan-q__free input {
  border: 1px solid var(--rz-field); border-radius: 10px; background: var(--card); padding: 10px 12px;
  font: inherit; font-size: 16px; line-height: 1.5; color: var(--ink); width: 100%; min-width: 0; resize: vertical;
}
.plan-card textarea::placeholder, .plan-q__free input::placeholder { color: var(--muted); }
.plan-card textarea:focus-visible, .plan-q__free input:focus-visible { outline-offset: 0; border-color: var(--rz-ink); }
.plan-card textarea[aria-invalid="true"], .plan-q__free input[aria-invalid="true"] { border-color: var(--accent); }
.plan-left { align-self: center; }
.plan-card { border-color: var(--rz-line); }

.plan-label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.plan-told__text { margin: 0; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.plan-told .pay-link { align-self: flex-start; }

.plan-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.plan-head__title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.2; }
.plan-head__title:focus { outline: none; }
.plan-head__title:focus-visible { outline: 2px solid var(--rz-ink); outline-offset: 4px; border-radius: 4px; }

/* Вопросы: варианты — «таблетки» поверх настоящих радиокнопок */
.plan-questions { display: flex; flex-direction: column; gap: 16px; }
.plan-q { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.plan-q legend { padding: 0; font-size: 15px; font-weight: 500; }
.plan-q__why { margin: 0; font-size: 13px; color: var(--muted); }
.plan-q__opts { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-opt { position: relative; display: inline-flex; }
.plan-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.plan-opt span {
  display: inline-flex; align-items: center; min-height: 36px; border: 1px solid var(--muted); border-radius: 999px;
  background: var(--card); padding: 4px 14px; font-size: 14px; color: var(--ink-2);
}
.plan-opt input:checked + span { border-color: var(--rz-ink); background: var(--rz-ink); color: #FFFFFF; }
.plan-opt input:focus-visible + span { outline: 2px solid var(--rz-ink); outline-offset: 2px; }
.plan-q__free { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.plan-q__free label { font-size: 13px; color: var(--muted); }

/* Шаги плана */
.plan-summary { margin: 0; font-family: var(--serif); font-size: 16.5px; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.plan-summary:empty { display: none; }
.plan-steps { margin: 0; padding: 0; list-style: none; }
.plan-step {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px 0;
  border-top: 1px solid var(--line); align-items: start;
}
.plan-step__switch { grid-row: span 3; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--rz-ink); cursor: pointer; }
.plan-step__switch:disabled { cursor: not-allowed; }
.plan-step__title { font-weight: 600; color: var(--rz-ink); overflow-wrap: anywhere; }
.plan-step__badge {
  grid-row: span 3; font-size: 12.5px; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 2px 10px; white-space: nowrap;
}
.plan-step__detail, .plan-step__note { margin: 0; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.plan-step__note { grid-column: 2; color: var(--muted); font-size: 13px; }
.plan-step.is-off .plan-step__title, .plan-step.is-off .plan-step__detail { color: var(--muted); }
.plan-step.is-off .plan-step__badge { color: var(--muted); border-color: var(--line); }
.plan-cost { padding-top: 14px; border-top: 1px solid var(--line); }

.plan-revise { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
/* Итоги выполнения */
.plan-results .plan-step { grid-template-columns: minmax(0, 1fr) auto; }
.plan-results .plan-step > :not(.plan-step__badge):not(.plan-step__title) { grid-column: 1 / -1; }
.plan-res__status { grid-row: auto; }
.plan-res__status.is-done { border-color: var(--rz-ink); color: var(--rz-ink); }
.plan-res__status.is-bad { border-color: var(--accent); color: var(--accent); }
.plan-res__big { margin: 4px 0 0; font-family: var(--serif); font-size: 26px; line-height: 1.2; overflow-wrap: anywhere; }
.plan-res__text { margin: 4px 0 0; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.plan-res__lines { margin: 4px 0 0; padding: 0 0 0 18px; font-size: 14px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.plan-res__norms { margin-top: 8px; }
.plan-res__doc { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.plan-res__doc pre {
  flex: 1 0 100%; margin: 0; max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px;
  background: var(--rz-bg); padding: 10px 12px; font: inherit; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}

.plan-status { margin: 0; min-height: 1.4em; font-size: 14px; color: var(--muted); }
.plan-error-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-left: 8px; vertical-align: middle; }

.plan-side { border-color: var(--rz-line); gap: 10px; font-size: 14px; }
.plan-side__title { margin: 0; font-size: 15px; font-weight: 600; }
.plan-side__sub { margin: 6px 0 0; font-size: 14px; font-weight: 600; }
.plan-side__list { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); }
.plan-side__list li::marker { color: var(--rz-ink); font-weight: 600; }
.plan-side a { color: var(--rz-ink); }

@media (max-width: 1180px) {
  .plan-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .plan-head__title { font-size: 22px; }
  .plan-step { grid-template-columns: 26px minmax(0, 1fr); }
  .plan-step__badge { grid-row: auto; grid-column: 2; justify-self: start; }
  .plan-results .plan-step { grid-template-columns: minmax(0, 1fr); }
  .plan-results .plan-step__badge { grid-column: 1; }
  .plan-res__big { font-size: 22px; }
}

/* Высокая контрастность: заливка выбранной «таблетки» пропадает — нужна рамка */
@media (forced-colors: active) {
  .plan-opt input:checked + span { outline: 3px solid Highlight; outline-offset: 1px; }
}
