/* ДООП.Конструктор — интерфейс. Все стили локальные, без внешних шрифтов и CDN. */
:root {
  --paper: #f3eee4;
  --paper-deep: #ebe3d5;
  --card: #fffdf8;
  --card-soft: #fbf7ee;
  --ink: #1c2a26;
  --ink-soft: #34443e;
  --muted: #6d7771;
  --muted-2: #8a938e;
  --line: #ded6c8;
  --line-strong: #c9beac;
  --green: #124b40;
  --green-2: #1a6a58;
  --green-soft: #e3efe9;
  --green-pale: #f0f6f2;
  --terracotta: #b5653e;
  --terracotta-soft: #f8e8de;
  --gold: #c69a57;
  --danger: #a94335;
  --danger-soft: #fae9e4;
  --warn: #9b681f;
  --warn-soft: #fbf0d8;
  --ok: #2f7054;
  --ok-soft: #e8f3ec;
  --shadow-sm: 0 1px 2px rgba(35, 43, 38, .04), 0 8px 24px rgba(35, 43, 38, .035);
  --shadow-md: 0 18px 50px rgba(31, 44, 38, .10);
  --serif: Georgia, "Times New Roman", "PT Serif", serif;
  --sans: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(198, 154, 87, .12), transparent 65%),
    linear-gradient(180deg, #f6f1e8 0%, var(--paper) 60%, #efe8dc 100%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: var(--green-2); text-decoration-thickness: .06em; text-underline-offset: .16em; }
a:hover { color: var(--green); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
svg { display: block; }
::selection { background: #cfe4d8; color: var(--green); }

/* ---------- Верхняя панель ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 10px 24px;
  border-bottom: 1px solid rgba(201, 190, 172, .65);
  background: rgba(250, 247, 240, .91);
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  background: var(--green);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.brand-mark span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  border-radius: 2px;
  background: #f2e7d4;
}
.brand-mark span:nth-child(1) { top: 12px; }
.brand-mark span:nth-child(2) { top: 18px; right: 15px; background: #d9a66a; }
.brand-mark span:nth-child(3) { top: 24px; right: 12px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.brand-name span { color: var(--terracotta); }
.brand-sub { color: var(--muted); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }
.top-actions { display: flex; align-items: center; gap: 7px; }
.save-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 6px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.save-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(47, 112, 84, .10); }
.save-state.is-saving .save-dot { background: var(--gold); animation: pulse 1s infinite; }
.save-state.is-error { color: var(--danger); }
.save-state.is-error .save-dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }
.menu-toggle { display: none; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 37px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, color .16s ease;
}
.btn:hover { background: rgba(18, 75, 64, .07); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .38; cursor: not-allowed; transform: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--green); color: #fffdf7; border-color: var(--green); box-shadow: 0 5px 14px rgba(18, 75, 64, .16); }
.btn-primary:hover { background: var(--green-2); color: #fff; }
.btn-quiet { border-color: transparent; }
.btn-quiet:hover { border-color: var(--line); background: rgba(255, 253, 248, .75); }
.btn-soft { background: var(--green-pale); color: var(--green); border-color: #cadfd4; }
.btn-soft:hover { background: var(--green-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #efc9c0; }
.btn-label { display: inline; }
.top-export { padding-left: 15px; padding-right: 15px; }
.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--ink); background: rgba(18, 75, 64, .07); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.icon-btn .icon { width: 16px; height: 16px; }
.icon-link {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 8px;
  color: var(--green-2);
  text-decoration: none;
}
.icon-link:hover { background: var(--green-soft); color: var(--green); }
.icon-link .icon { width: 15px; height: 15px; }
.link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green-2);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn.muted { color: var(--muted); font-weight: 500; }
.link-btn:hover { color: var(--green); }
.tools-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }

/* ---------- Каркас ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 302px minmax(0, 1fr);
  align-items: start;
  max-width: 1600px;
  margin: 0 auto;
}
.sidebar {
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 22px 16px 30px 20px;
  border-right: 1px solid rgba(201, 190, 172, .58);
  scrollbar-width: thin;
  scrollbar-color: #c9beac transparent;
}
.sidebar::-webkit-scrollbar { width: 7px; }
.sidebar::-webkit-scrollbar-thumb { background: #cfc4b3; border-radius: 10px; }
.main {
  min-width: 0;
  width: 100%;
  max-width: 1180px;
  min-height: calc(100vh - 72px);
  padding: 34px 44px 110px;
  margin: 0 auto;
  outline: none;
}

/* ---------- Прогресс и навигация ---------- */
.progress-card {
  padding: 15px 15px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 253, 248, .74);
  box-shadow: var(--shadow-sm);
}
.progress-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11.5px; }
.progress-top strong { color: var(--green); font-family: var(--serif); font-size: 23px; font-weight: 600; line-height: 1; }
.progress-track { height: 5px; margin-top: 11px; overflow: hidden; border-radius: 8px; background: #e4dccd; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #3b8d74); transition: width .35s ease; }
.progress-caption { margin-top: 8px; color: var(--muted-2); font-size: 10.5px; }
.nav-group-title {
  margin: 21px 9px 7px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) 8px;
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease;
}
.nav-item + .nav-item { margin-top: 2px; }
.nav-item:hover { background: rgba(255, 253, 248, .66); border-color: #e2d9ca; }
.nav-item.is-active { background: var(--card); border-color: #d5cbbb; box-shadow: 0 4px 14px rgba(35, 43, 38, .05); }
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--terracotta);
}
.nav-num {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 7px;
  background: #e9e1d3;
  color: #7e776c;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 600;
}
.nav-num .icon { width: 13px; height: 13px; }
.nav-item.is-done .nav-num { background: var(--green); color: #fffdf7; }
.nav-item.is-partial .nav-num { background: var(--terracotta-soft); color: var(--terracotta); }
.nav-item.is-active .nav-num { background: var(--green); color: #fffdf7; }
.nav-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.nav-label { color: var(--ink-soft); font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.nav-item.is-active .nav-label { color: var(--green); }
.nav-sub { color: var(--muted-2); font-size: 9.8px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: #d8cfc0; }
.nav-item.is-done .nav-dot { background: #4e9276; }
.nav-item.is-partial .nav-dot { background: var(--terracotta); }
.side-actions { display: grid; gap: 4px; margin: 22px 0 16px; padding-top: 16px; border-top: 1px solid rgba(201, 190, 172, .55); }
.side-action {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.side-action:hover { color: var(--green); background: rgba(255, 253, 248, .64); }
.side-action .icon { width: 15px; height: 15px; color: var(--green-2); }
.block2-note {
  padding: 14px;
  border: 1px dashed #c7b9a3;
  border-radius: 12px;
  background: rgba(247, 240, 226, .6);
}
.block2-label { display: block; margin-bottom: 4px; color: var(--terracotta); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.block2-note strong { display: block; font-family: var(--serif); font-size: 18px; color: var(--green); }
.block2-note p { margin-top: 5px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.privacy-note { display: flex; gap: 7px; margin-top: 18px; padding: 0 3px; color: var(--muted-2); font-size: 10px; line-height: 1.45; }
.privacy-note .icon { width: 13px; height: 13px; flex: 0 0 13px; margin-top: 1px; color: var(--ok); }

/* ---------- Заголовок шага ---------- */
.step-head { max-width: 900px; margin-bottom: 23px; }
.step-kicker { margin-bottom: 8px; color: var(--terracotta); font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.step-head h1 { font-family: var(--serif); font-size: clamp(28px, 3vw, 38px); font-weight: 500; line-height: 1.08; letter-spacing: -.025em; color: var(--green); }
.step-lead { max-width: 830px; margin-top: 10px; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.step-head .note { margin-top: 15px; }

/* ---------- Карточки формы ---------- */
.form-card {
  margin-bottom: 16px;
  padding: 23px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .89);
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 19px; }
.card-num {
  display: inline-grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 600;
}
.card-head h2 { font-family: var(--serif); font-size: 21px; font-weight: 500; line-height: 1.15; color: var(--ink); }
.card-head p { margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.head-tools { margin-left: auto; }
.grid-1 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 15px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.subhead { margin: 24px 0 11px; padding-top: 17px; border-top: 1px solid #e8e0d2; font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--ink-soft); }
.subhead:first-of-type { border-top: 0; padding-top: 0; }

/* ---------- Поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { color: var(--ink-soft); font-size: 12px; font-weight: 600; line-height: 1.35; }
.req { margin-left: 3px; color: var(--terracotta); font-weight: 700; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 41px;
  padding: 10px 12px;
  border: 1px solid #d8cfc0;
  border-radius: 9px;
  background: #fffefb;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.45;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #c9bca8; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--green-2);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 106, 88, .10);
}
.field input::placeholder, .field textarea::placeholder { color: #a9a196; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #7b847d 50%), linear-gradient(135deg, #7b847d 50%, transparent 50%); background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.field-hint { color: var(--muted-2); font-size: 10.5px; line-height: 1.4; }
.char-counter { align-self: flex-end; margin-top: -2px; color: var(--muted-2); font-size: 10px; font-variant-numeric: tabular-nums; }
.char-counter.is-short { color: var(--warn); }
.char-counter.is-empty { color: var(--muted-2); }
.field input[type="date"] { font-size: 13px; }
input[type="number"] { font-variant-numeric: tabular-nums; }

/* ---------- Заметки и подсказки ---------- */
.note {
  display: flex;
  gap: 10px;
  margin: 15px 0;
  padding: 11px 13px;
  border: 1px solid #d8e4db;
  border-radius: 10px;
  background: var(--green-pale);
  color: #37594d;
  font-size: 11.5px;
  line-height: 1.5;
}
.note-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: #cce2d5;
  color: var(--green);
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
}
.note.warn { border-color: #ead4ad; background: var(--warn-soft); color: #6e4c1b; }
.note.warn .note-icon { background: #efd5a5; color: var(--warn); }
.note.soft { border-color: #e4dccd; background: #fbf7ee; color: var(--muted); }
.note.soft .note-icon { background: #e8dfd0; color: #857866; }
.note em { color: var(--ink); font-style: normal; font-weight: 600; }
.tip {
  margin: 16px 0 4px;
  border: 1px solid #e0d7c8;
  border-radius: 11px;
  background: rgba(251, 247, 238, .7);
}
.tip summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.tip summary::-webkit-details-marker { display: none; }
.tip-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #e8dfd0; color: #7e6d53; font-family: var(--serif); font-size: 11px; font-weight: 700; }
.tip-chevron { margin-left: auto; color: var(--muted-2); transition: transform .2s ease; }
.tip[open] .tip-chevron { transform: rotate(180deg); }
.tip-body { padding: 0 13px 13px 40px; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.tip-body p + p { margin-top: 8px; }
.tip-body ul { margin: 0; padding-left: 17px; }
.tip-body li + li { margin-top: 5px; }

/* ---------- Титульный лист ---------- */
.title-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.preview-col { position: sticky; top: 94px; }
.preview-label { margin-bottom: 8px; color: var(--muted-2); font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.paper-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 297;
  overflow: hidden;
  border: 1px solid #d7cdbd;
  background: #fffefa;
  box-shadow: 0 18px 38px rgba(34, 44, 38, .13);
  color: #1e231f;
  font-family: "Times New Roman", Georgia, serif;
}
.paper-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(75, 55, 26, .04), transparent 8%, transparent 92%, rgba(75, 55, 26, .035));
}
.pp-inner { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; padding: 8% 8% 6%; }
.pp-org { min-height: 18%; color: #2d322e; font-size: 6.1px; line-height: 1.35; text-align: center; text-transform: uppercase; }
.pp-founder { margin-bottom: 2px; }
.pp-approval { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 0 6px; border-top: 1px solid #d5cdc0; border-bottom: 1px solid #d5cdc0; color: #333833; font-size: 5.6px; line-height: 1.45; }
.pp-approval b { font-size: 5.8px; letter-spacing: .02em; }
.pp-sign { display: inline-block; margin-top: 3px; border-top: 1px solid #5d655e; padding-top: 2px; min-width: 52px; }
.pp-seal { display: inline-block; margin-top: 2px; color: #7f877f; font-size: 5.2px; }
.pp-type { margin-top: 9%; color: #303630; font-size: 6.5px; line-height: 1.35; text-align: center; text-transform: uppercase; }
.pp-focus { margin-top: 2px; color: #5d655e; font-size: 6.2px; text-align: center; }
.pp-title { margin: 4% 0 5%; color: #171b18; font-size: 17px; font-weight: 700; line-height: 1.08; text-align: center; letter-spacing: -.02em; }
.pp-meta { margin: 7% auto 0; width: 76%; color: #262b27; font-size: 7.2px; line-height: 1.55; }
.pp-meta b { font-weight: 600; }
.pp-author { margin-top: 6%; line-height: 1.45; }
.pp-bottom { margin-top: auto; padding-top: 5%; color: #2f3530; font-size: 7.4px; text-align: center; }
.preview-caption { margin-top: 9px; color: var(--muted-2); font-size: 10px; line-height: 1.4; text-align: center; }

/* ---------- Нормативная основа ---------- */
.norm-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 18px 0 8px; padding: 14px 15px; border: 1px solid #d7e2d9; border-radius: 12px; background: #f7fbf8; flex-wrap: wrap; }
.norm-region { width: 245px; flex: 0 0 245px; }
.norm-region .field-label { font-size: 10.5px; }
.norm-region .field select { min-height: 36px; padding: 7px 9px; font-size: 12px; }
.norm-date { width: 210px; flex: 0 0 210px; }
.norm-date .field-label { font-size: 10.5px; }
.norm-date .field input { min-height: 36px; padding: 7px 9px; font-size: 12px; }
.switch-line { min-width: 0; }
.switch { position: relative; display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.switch input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch-ui { position: relative; width: 36px; height: 20px; flex: 0 0 36px; margin-top: 1px; border-radius: 20px; background: #cec4b3; transition: background .18s ease; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fffdf7; box-shadow: 0 1px 2px rgba(0,0,0,.18); transition: transform .18s ease; }
.switch input:checked + .switch-ui { background: var(--green); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.switch span:last-child { display: flex; flex-direction: column; gap: 2px; }
.switch strong { font-size: 12px; color: var(--ink-soft); }
.switch small { color: var(--muted); font-size: 10.5px; line-height: 1.35; }
.norm-groups { margin-top: 4px; }
.norm-group { margin-top: 18px; }
.norm-group[hidden] { display: none; }
.norm-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; padding: 0 2px; }
.norm-group-head h3 { color: var(--ink-soft); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.norm-group-tools { display: flex; align-items: center; gap: 9px; color: var(--muted-2); font-size: 10px; }
.group-hint { color: var(--muted-2); font-size: 10px; }
.norm-doc {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 12px;
  border: 1px solid #e1d9cb;
  border-radius: 10px;
  background: #fffdf9;
  transition: border-color .15s ease, background .15s ease;
}
.norm-doc + .norm-doc { margin-top: 6px; }
.norm-doc:hover { border-color: #cbbda8; }
.norm-doc.is-selected { border-color: #b9d2c3; background: #f6fbf8; }
.norm-doc.is-selected .norm-doc-title { color: var(--green); }
.norm-doc[hidden] { display: none; }
.norm-doc-text { min-width: 0; }
.norm-doc-title { color: var(--ink-soft); font-size: 11.5px; font-weight: 600; line-height: 1.42; }
.norm-doc-detail { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.norm-doc-note { margin-top: 4px; color: var(--muted-2); font-size: 9.7px; line-height: 1.4; }
.check-box { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; cursor: pointer; }
.check-box input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.check-box span { position: relative; display: block; width: 17px; height: 17px; border: 1.5px solid #bdb3a3; border-radius: 5px; background: #fffefb; transition: border-color .15s ease, background .15s ease; }
.check-box input:checked + span { border-color: var(--green); background: var(--green); }
.check-box input:checked + span::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 1.7px 1.7px 0; transform: rotate(43deg); }
.check-box input:focus-visible + span { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.custom-doc-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 30px; gap: 9px; align-items: start; padding: 9px 0; border-bottom: 1px dashed #e3dacb; }
.custom-doc-fields { display: grid; gap: 6px; }
.custom-doc-fields input { width: 100%; padding: 7px 9px; border: 1px solid #ded5c6; border-radius: 7px; background: #fffefb; font-size: 11.5px; outline: none; }
.custom-doc-fields input:focus { border-color: var(--green-2); box-shadow: 0 0 0 2px rgba(26, 106, 88, .09); }
.card-actions-line { margin-top: 13px; }
.excluded-card { border-style: dashed; background: rgba(250, 246, 238, .65); }
.excluded-card .card-head { margin-bottom: 8px; }
.excluded-card .card-num { background: var(--warn-soft); color: var(--warn); }
.excluded-list { display: grid; gap: 9px; }
.excluded-item { display: flex; justify-content: space-between; gap: 12px; padding: 9px 11px; border-radius: 9px; background: rgba(255, 253, 248, .75); }
.excluded-item strong { color: #6a5d4d; font-size: 11px; }
.excluded-item p { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; }

/* ---------- Выбор уровня / форм ---------- */
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 17px; }
.choice-card { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid #ddd4c5; border-radius: 11px; background: #fffdf9; cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.choice-card { position: relative; }
.choice-card input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice-card:hover { border-color: #cbbda8; }
.choice-card.is-checked { border-color: var(--green-2); background: var(--green-pale); box-shadow: inset 0 0 0 1px rgba(26, 106, 88, .12); }

.choice-mark { display: inline-grid; place-items: center; width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; border: 1.5px solid #bdb3a3; border-radius: 50%; background: #fff; }
.choice-card input:checked + .choice-mark { border: 5px solid var(--green); background: #fffdf9; }
.choice-card input:focus-visible + .choice-mark { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.choice-card span:last-child { display: flex; flex-direction: column; gap: 3px; }
.choice-card strong { color: var(--ink-soft); font-size: 11.5px; }
.choice-card small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.check-card { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid #e0d7c8; border-radius: 9px; background: #fffdf9; color: var(--ink-soft); font-size: 11.5px; cursor: pointer; }
.check-card.is-checked { border-color: #bad3c4; background: var(--green-pale); color: var(--green); }
.check-card { position: relative; }
.check-card input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.check-mark { position: relative; width: 15px; height: 15px; flex: 0 0 15px; border: 1.5px solid #bdb3a3; border-radius: 4px; background: #fff; }
.check-card input:checked + .check-mark { border-color: var(--green); background: var(--green); }
.check-card input:checked + .check-mark::after { content: ""; position: absolute; left: 3px; top: 0; width: 5px; height: 8px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(43deg); }
.check-card input:focus-visible + .check-mark { outline: 2px solid var(--terracotta); outline-offset: 2px; }

/* ---------- Автоформулировки и сводки ---------- */
.auto-line { display: flex; flex-direction: column; gap: 3px; margin-bottom: 16px; padding: 12px 14px; border-left: 3px solid var(--terracotta); border-radius: 0 9px 9px 0; background: #fbf4ec; }
.auto-label { color: var(--terracotta); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.auto-line p { color: #574d40; font-size: 12px; line-height: 1.5; }
.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-bottom: 17px; overflow: hidden; border: 1px solid #ddd4c5; border-radius: 10px; background: #ddd4c5; }
.summary-item { padding: 10px 12px; background: #fffdf8; }
.summary-item span { display: block; color: var(--muted-2); font-size: 9px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.summary-item strong { display: block; margin-top: 2px; color: var(--green); font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.1; }
.plan-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.plan-check { margin-top: 14px; }
.check-line { display: flex; align-items: flex-start; gap: 8px; padding: 9px 11px; border-radius: 8px; background: #f6f1e7; color: var(--muted); font-size: 11px; line-height: 1.4; }
.check-line.ok { background: var(--ok-soft); color: #356a50; }
.check-line.warn { background: var(--warn-soft); color: #775018; }
.check-dot { width: 7px; height: 7px; flex: 0 0 7px; margin-top: 4px; border-radius: 50%; background: currentColor; }
.norm-callout { display: flex; gap: 11px; margin-top: 16px; padding: 13px 14px; border: 1px solid #e7cfa6; border-radius: 10px; background: #fdf6e7; }
.norm-callout-icon { display: inline-grid; place-items: center; width: 21px; height: 21px; flex: 0 0 21px; border-radius: 50%; background: #efd39f; color: #7c5314; font-family: var(--serif); font-weight: 700; font-size: 12px; }
.norm-callout strong { display: block; color: #6f4c17; font-size: 11.5px; }
.norm-callout p { margin-top: 3px; color: #7d6339; font-size: 10.5px; line-height: 1.5; }
.norm-callout a { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; color: #775018; font-size: 10.5px; font-weight: 600; }
.norm-callout a .icon { width: 12px; height: 12px; }

/* ---------- Мини-карточки ---------- */
.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 15px; }
.mini-card { padding: 11px 12px; border: 1px solid #e5ddcf; border-radius: 9px; background: #fbf8f1; }
.mini-num { display: block; margin-bottom: 3px; color: var(--terracotta); font-family: var(--serif); font-size: 11px; }
.mini-card strong { display: block; color: var(--ink-soft); font-size: 11px; }
.mini-card p { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; }

/* ---------- Сравнения ---------- */
.comparison-list { display: grid; gap: 11px; }
.comparison-card { padding: 13px; border: 1px solid #e2d9cb; border-radius: 10px; background: #fdfaf4; }
.comparison-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.comparison-no { color: var(--terracotta); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- Цель ---------- */
.goal-builder { background: linear-gradient(180deg, #fffdf8, #fdfaf3); }
.formula { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 16px; padding: 10px 12px; border: 1px dashed #d4c7b3; border-radius: 9px; background: #fbf7ee; color: var(--muted); font-size: 11px; }
.formula span { color: var(--green); font-family: var(--serif); font-size: 13px; font-weight: 600; }
.formula b { padding: 2px 7px; border-radius: 5px; background: #ece2d2; color: #605445; font-size: 10px; font-weight: 600; }
.formula i { color: var(--terracotta); font-style: normal; font-weight: 700; }
.goal-preview { margin: 15px 0 0; padding: 12px 14px; border-left: 3px solid var(--green); border-radius: 0 9px 9px 0; background: var(--green-pale); }
.goal-preview p { color: #35594c; font-family: var(--serif); font-size: 15px; line-height: 1.45; }
.repeater-block { margin-top: 15px; padding-top: 15px; border-top: 1px solid #e7dfd1; }
.repeater-block:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.repeater-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.repeater-head h3 { color: var(--ink-soft); font-size: 12.5px; font-weight: 700; }
.repeater-head span { color: var(--muted-2); font-size: 10px; }
.repeater-list { display: grid; gap: 6px; }
.repeater-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 30px; gap: 7px; align-items: start; }
.repeater-no { padding-top: 10px; color: var(--muted-2); font-family: var(--serif); font-size: 10px; }
.repeater-row input, .repeater-row textarea { width: 100%; padding: 8px 10px; border: 1px solid #ded5c6; border-radius: 7px; background: #fffefb; color: var(--ink); font-size: 11.5px; line-height: 1.4; outline: none; }
.repeater-row textarea { min-height: 54px; resize: vertical; }
.repeater-row input:focus, .repeater-row textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 2px rgba(26, 106, 88, .09); }
.add-row-btn { display: inline-flex; align-items: center; gap: 5px; margin: 7px 0 0 33px; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--green-2); font-size: 10.5px; font-weight: 600; cursor: pointer; }
.add-row-btn:hover { background: var(--green-soft); }
.add-row-btn .icon { width: 13px; height: 13px; }

/* ---------- Учебный план ---------- */
.inline-alert { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 13px; padding: 9px 11px; border-radius: 8px; background: #f6f1e7; color: var(--muted); font-size: 11px; line-height: 1.45; }
.inline-alert.is-ok { background: var(--ok-soft); color: #356a50; }
.inline-alert.is-warn { background: var(--warn-soft); color: #775018; }
.alert-dot { width: 7px; height: 7px; flex: 0 0 7px; margin-top: 4px; border-radius: 50%; background: currentColor; }
.plan-table-head { display: grid; grid-template-columns: 48px minmax(170px, 1fr) 72px 76px 62px minmax(145px, 210px) 88px; gap: 6px; padding: 0 12px 7px; color: var(--muted-2); font-size: 8.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.section-card { margin-bottom: 12px; padding: 13px; border: 1px solid #ddd4c5; border-radius: 12px; background: #fffdf9; box-shadow: 0 2px 8px rgba(35,43,38,.025); }
.section-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 9px; align-items: center; margin-bottom: 8px; }
.section-code { padding: 3px 7px; border-radius: 5px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.section-title-input { width: 100%; min-height: 35px; padding: 7px 9px; border: 1px solid #d8cfc0; border-radius: 7px; background: #fffefb; color: var(--ink); font-size: 12.5px; font-weight: 600; outline: none; }
.section-title-input:focus { border-color: var(--green-2); box-shadow: 0 0 0 2px rgba(26, 106, 88, .09); }
.section-total { color: var(--green); font-family: var(--serif); font-size: 15px; font-weight: 600; white-space: nowrap; }
.row-actions { display: flex; gap: 1px; }
.section-intro-row { margin-bottom: 8px; }
.section-intro-row textarea { width: 100%; min-height: 40px; padding: 7px 9px; border: 1px dashed #ded5c6; border-radius: 7px; background: #fdfaf4; color: var(--muted); font-size: 10.5px; line-height: 1.4; resize: vertical; outline: none; }
.topics-list { display: grid; gap: 5px; }
.topic-row { display: grid; grid-template-columns: 48px minmax(170px, 1fr) 72px 76px 62px minmax(145px, 210px) 88px; gap: 6px; align-items: center; padding: 6px 0; border-top: 1px dashed #ece4d7; }
.topic-row.is-over { background: #fff7f3; border-radius: 6px; }
.topic-code { color: var(--muted-2); font-family: var(--serif); font-size: 10px; }
.topic-title-input, .num-input, .assessment-input { width: 100%; min-height: 33px; padding: 6px 8px; border: 1px solid #e0d7c8; border-radius: 6px; background: #fffefb; color: var(--ink); font-size: 11px; outline: none; }
.topic-title-input:focus, .num-input:focus, .assessment-input:focus { border-color: var(--green-2); box-shadow: 0 0 0 2px rgba(26, 106, 88, .08); }
.num-input { text-align: center; font-variant-numeric: tabular-nums; }
.topic-total { color: var(--green); font-family: var(--serif); font-size: 14px; font-weight: 600; text-align: center; }
.topic-total::after { content: " ч"; font-family: var(--sans); font-size: 8px; font-weight: 500; color: var(--muted-2); }
.topic-over { grid-column: 2 / -1; margin: -2px 0 3px; color: var(--danger); font-size: 9.5px; }
.plan-total-row { display: grid; grid-template-columns: 48px minmax(170px, 1fr) 72px 76px 62px minmax(145px, 210px) 88px; gap: 6px; align-items: center; margin-top: 8px; padding: 10px 12px; border-top: 2px solid var(--green); color: var(--green); }
.plan-total-row strong { font-family: var(--serif); font-size: 13px; }
.plan-total-row span { text-align: center; font-size: 12px; }
.plan-total-row span:nth-child(2) { text-align: left; }
.plan-total-row > span:first-child { text-align: left; }
.section-card .add-row-btn { margin-left: 0; }

/* ---------- Содержание ---------- */
.content-section { margin-bottom: 18px; padding: 18px; border: 1px solid #ddd4c5; border-radius: 13px; background: rgba(255, 253, 248, .8); }
.content-section-head { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 12px; }
.content-no { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 7px; background: var(--green); color: #fffdf7; font-family: var(--serif); font-size: 12px; }
.content-section-head h2 { font-family: var(--serif); font-size: 20px; font-weight: 500; color: var(--green); }
.content-section-head p { margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.content-topic { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e8e0d2; }
.content-topic-head { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 9px; }
.content-topic-head h3 { color: var(--ink-soft); font-size: 12.5px; font-weight: 700; line-height: 1.4; }
.content-topic-head p { margin-top: 1px; color: var(--muted-2); font-size: 9.5px; }
.content-texts { gap: 11px; }
.content-texts .field textarea { min-height: 108px; }

/* ---------- Проверка ---------- */
.check-hero { display: flex; align-items: center; gap: 25px; margin-bottom: 16px; padding: 24px; border-radius: 16px; background: linear-gradient(120deg, #103f36, #175a4b 60%, #1d6a57); color: #f8f2e7; box-shadow: 0 18px 40px rgba(18, 75, 64, .16); }
.check-ring { --p: 0; position: relative; display: grid; place-items: center; width: 116px; height: 116px; flex: 0 0 116px; border-radius: 50%; background: conic-gradient(#d7b57f calc(var(--p) * 1%), rgba(255,255,255,.14) 0); }
.check-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #13483d; }
.check-ring > div { position: relative; z-index: 1; text-align: center; }
.check-ring strong { display: block; font-family: var(--serif); font-size: 28px; font-weight: 500; line-height: 1; }
.check-ring span { display: block; margin-top: 3px; color: #c8d9d0; font-size: 8.5px; letter-spacing: .06em; text-transform: uppercase; }
.check-hero-text { min-width: 0; }
.check-hero-text h2 { font-family: var(--serif); font-size: 25px; font-weight: 500; line-height: 1.15; }
.check-hero-text p { max-width: 600px; margin-top: 7px; color: #c9d9d0; font-size: 12px; line-height: 1.5; }
.check-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.check-hero .btn-soft { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.25); color: #f8f2e7; }
.check-hero .btn-soft:hover { background: rgba(255,255,255,.17); }
.check-hero .btn-primary { background: #f0d3a4; border-color: #f0d3a4; color: #263d35; }
.check-hero .btn-primary:hover { background: #f7dfba; color: #1d322b; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 16px; }
.stat { padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,253,248,.82); }
.stat span { display: block; color: var(--muted-2); font-size: 9px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.stat strong { display: block; margin-top: 2px; color: var(--green); font-family: var(--serif); font-size: 25px; font-weight: 600; line-height: 1.1; }
.stat small { color: var(--muted); font-size: 10px; }
.text-danger { color: var(--danger) !important; }
.text-ok { color: var(--ok) !important; }
.check-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.check-panel { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,248,.82); }
.check-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.check-panel-head h3 { font-family: var(--serif); font-size: 18px; font-weight: 500; color: var(--ink); }
.pill { display: inline-grid; place-items: center; min-width: 24px; height: 19px; padding: 0 7px; border-radius: 20px; font-size: 10px; font-weight: 700; }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.issue-group + .issue-group { margin-top: 12px; }
.issue-group-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; color: var(--ink-soft); font-size: 10.5px; font-weight: 700; }
.issue-list { margin: 0; padding-left: 15px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.issue-list.error li::marker { color: var(--danger); }
.issue-list.warning li::marker { color: var(--warn); }
.issue-list li + li { margin-top: 4px; }
.clean-state { display: flex; align-items: center; gap: 9px; padding: 12px 0; color: var(--ok); font-size: 12px; }
.clean-state .icon { width: 19px; height: 19px; }
.novelty-check { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 16px; padding: 14px 16px; border: 1px solid #cfe1d5; border-radius: 11px; background: var(--ok-soft); }
.novelty-check.is-bad { border-color: #efc8bf; background: var(--danger-soft); }
.novelty-icon { display: inline-grid; place-items: center; width: 23px; height: 23px; flex: 0 0 23px; border-radius: 50%; background: #cbe3d3; color: var(--ok); font-family: var(--serif); font-size: 13px; font-weight: 700; }
.novelty-check.is-bad .novelty-icon { background: #efc7bd; color: var(--danger); }
.novelty-check strong { display: block; color: #2e6249; font-size: 12px; }
.novelty-check.is-bad strong { color: #7b3027; }
.novelty-check p { margin-top: 2px; color: #527462; font-size: 10.5px; line-height: 1.45; }
.novelty-check.is-bad p { color: #8a4a3e; }
.next-block { display: flex; gap: 15px; margin-bottom: 16px; padding: 17px 18px; border: 1px dashed #cbbca6; border-radius: 12px; background: rgba(250, 245, 235, .7); }
.next-block-mark { display: inline-grid; place-items: center; width: 45px; height: 45px; flex: 0 0 45px; border: 1px solid #d3c5b1; border-radius: 50%; color: #8b7a63; font-family: var(--serif); font-size: 19px; }
.next-label { display: block; color: var(--terracotta); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.next-block h3 { margin-top: 2px; font-family: var(--serif); font-size: 19px; font-weight: 500; color: var(--ink); }
.next-block p { max-width: 760px; margin-top: 3px; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.export-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 18px; border: 1px solid #cbded2; border-radius: 12px; background: #f4faf6; }
.export-bar strong { color: var(--green); font-family: var(--serif); font-size: 18px; font-weight: 500; }
.export-bar p { margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.export-actions { display: flex; flex-wrap: wrap; gap: 7px; }

/* ---------- Подвал шага ---------- */
.step-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px -10px -24px;
  padding: 13px 10px;
  border-top: 1px solid rgba(201, 190, 172, .5);
  background: linear-gradient(180deg, rgba(243, 238, 228, .65), rgba(243, 238, 228, .96) 40%);
  backdrop-filter: blur(9px);
}
.footer-mid { color: var(--muted-2); font-size: 9.5px; letter-spacing: .03em; text-align: center; }
.step-footer .btn { min-height: 36px; }

/* ---------- Пустое состояние ---------- */
.empty-state { padding: 44px 24px 40px; border: 1px dashed #cbbca6; border-radius: 14px; background: rgba(255, 253, 248, .58); text-align: center; }
.empty-illustration { display: flex; justify-content: center; gap: 5px; height: 42px; margin-bottom: 12px; }
.empty-illustration span { display: block; width: 31px; border: 1px solid #cbbda8; border-radius: 4px; background: #fffdf8; box-shadow: 2px 2px 0 #e9dfd0; }
.empty-illustration span:nth-child(2) { margin-top: 7px; border-color: #b9cdbf; }
.empty-illustration span:nth-child(3) { margin-top: 14px; }
.empty-state h3 { font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--green); }
.empty-state p { max-width: 520px; margin: 7px auto 16px; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* ---------- Модальные окна и тосты ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(20, 28, 24, .48); backdrop-filter: blur(4px); }
.modal { display: flex; flex-direction: column; width: min(760px, 100%); max-height: min(86vh, 900px); overflow: hidden; border: 1px solid #d8cdbb; border-radius: 16px; background: #fffdf8; box-shadow: var(--shadow-md); animation: modalIn .18s ease-out; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex: 0 0 auto; padding: 19px 20px 12px; border-bottom: 1px solid #ece4d6; }
.modal-head h2 { font-family: var(--serif); font-size: 24px; font-weight: 500; line-height: 1.15; color: var(--green); }
.modal-body { min-height: 0; overflow-y: auto; padding: 15px 20px 6px; }
.modal-lead { margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid #ece4d6; background: #fffdf8; }
.error-pre { max-height: 210px; overflow: auto; padding: 10px; border-radius: 7px; background: #f6f1e7; color: #6f4a3e; font-family: Consolas, monospace; font-size: 11px; white-space: pre-wrap; }
.toast-host { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; width: min(370px, calc(100vw - 36px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border: 1px solid #d8cdbb; border-radius: 10px; background: #fffdf8; box-shadow: 0 14px 34px rgba(30, 38, 33, .16); color: var(--ink-soft); font-size: 11.5px; line-height: 1.45; opacity: 0; transform: translateY(8px); transition: opacity .22s ease, transform .22s ease; pointer-events: auto; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-mark { display: inline-grid; place-items: center; width: 19px; height: 19px; flex: 0 0 19px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-family: var(--serif); font-size: 11px; font-weight: 700; }
.toast.error { border-color: #efc8bf; }
.toast.error .toast-mark { background: var(--danger-soft); color: var(--danger); }
.toast.success .toast-mark { background: var(--ok-soft); color: var(--ok); }
.overlay { position: fixed; inset: 0; z-index: 40; display: none; background: rgba(20, 28, 24, .38); backdrop-filter: blur(3px); }
.overlay.is-visible { display: block; }
.noscript { padding: 20px; background: var(--danger-soft); color: var(--danger); text-align: center; }

/* ---------- Адаптивность ---------- */
@media (max-width: 1280px) {
  .app-shell { grid-template-columns: 282px minmax(0, 1fr); }
  .sidebar { padding-left: 15px; }
  .main { padding-left: 30px; padding-right: 30px; }
  .title-layout { grid-template-columns: minmax(0, 1fr) 330px; }
}
@media (max-width: 1120px) {
  .save-state { display: none; }
  .btn-label { display: none; }
  .top-actions .btn { padding-left: 10px; padding-right: 10px; }
  .title-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .plan-table-head, .topic-row, .plan-total-row { grid-template-columns: 42px minmax(155px, 1fr) 65px 68px 55px minmax(120px, 185px) 78px; }
}
@media (max-width: 900px) {
  .topbar { min-height: 64px; padding: 8px 14px; gap: 9px; }
  .menu-toggle { display: inline-grid; }
  .brand-sub { display: none; }
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    z-index: 45;
    width: min(330px, 88vw);
    height: calc(100vh - 64px);
    padding: 20px 16px 30px;
    border-right: 1px solid var(--line);
    background: #f6f1e7;
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: 18px 0 50px rgba(24, 34, 29, .14);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open { overflow: hidden; }
  .main { min-height: calc(100vh - 64px); padding: 25px 20px 100px; }
  .step-head h1 { font-size: 31px; }
  .title-layout { grid-template-columns: 1fr; }
  .preview-col { position: static; order: 2; max-width: 360px; }
  .check-grid, .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-table-head { display: none; }
  .section-card { padding: 12px; }
  .topic-row { grid-template-columns: 35px minmax(0, 1fr) 64px 70px 55px 30px; padding: 9px 0; }
  .topic-row .assessment-input { grid-column: 2 / 6; }
  .topic-row .row-actions { grid-column: 6; grid-row: 1 / 3; flex-direction: column; }
  .topic-over { grid-column: 2 / 7; }
  .plan-total-row { grid-template-columns: 35px minmax(0, 1fr) 64px 70px 55px 30px; }
  .plan-total-row span:last-child, .plan-total-row span:nth-last-child(2) { display: none; }
  .check-hero { align-items: flex-start; }
  .check-ring { width: 96px; height: 96px; flex-basis: 96px; }
  .check-ring strong { font-size: 24px; }
}
@media (max-width: 700px) {
  .top-actions .top-action:not(.top-export) { display: none; }
  .brand-name { font-size: 15px; }
  .main { padding: 20px 14px 95px; }
  .step-head { margin-bottom: 17px; }
  .step-head h1 { font-size: 27px; }
  .step-lead { font-size: 13px; }
  .form-card { padding: 17px 15px; border-radius: 12px; }
  .card-head h2 { font-size: 19px; }
  .card-num { width: 31px; height: 31px; flex-basis: 31px; font-size: 10px; }
  .grid-2, .grid-3, .choice-grid, .check-grid, .mini-grid, .summary-strip, .stat-grid, .check-columns { grid-template-columns: 1fr; }
  .plan-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-strip { gap: 1px; }
  .norm-toolbar { flex-direction: column; align-items: stretch; }
  .norm-region, .norm-date { width: 100%; flex: auto; }
  .norm-doc { grid-template-columns: 22px minmax(0, 1fr); }
  .norm-doc > .icon-link { display: none; }
  .check-hero { flex-direction: column; gap: 16px; padding: 19px; }
  .check-hero-text h2 { font-size: 22px; }
  .export-bar { flex-direction: column; align-items: flex-start; }
  .next-block { align-items: flex-start; }
  .step-footer { margin-left: -4px; margin-right: -4px; padding-left: 4px; padding-right: 4px; }
  .footer-mid { display: none; }
  .step-footer .btn { flex: 1; }
  .toast-host { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
  .section-card-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  .section-card-head .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .topic-row { grid-template-columns: 30px minmax(0, 1fr) 62px 68px 50px; }
  .topic-row .row-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
  .topic-row .assessment-input { grid-column: 2 / 6; }
  .topic-over { grid-column: 2 / 6; }
  .plan-total-row { grid-template-columns: 30px minmax(0, 1fr) 62px 68px 50px; font-size: 11px; }
  .plan-total-row span:last-child { display: none; }
  .repeater-row { grid-template-columns: 22px minmax(0, 1fr) 28px; }
  .modal-head h2 { font-size: 21px; }
  .modal { max-height: 92vh; }
  .export-actions { width: 100%; }
  .export-actions .btn { flex: 1; }
}
@media (max-width: 420px) {
  .brand-mark { width: 33px; height: 33px; flex-basis: 33px; }
  .brand-mark span { left: 8px; right: 8px; }
  .brand-mark span:nth-child(1) { top: 10px; }
  .brand-mark span:nth-child(2) { top: 16px; right: 12px; }
  .brand-mark span:nth-child(3) { top: 22px; right: 10px; }
  .top-export { padding: 8px 10px; }
  .top-export .btn-label { display: none; }
  .step-footer .btn { font-size: 12px; }
  .paper-preview { max-width: 330px; margin: 0 auto; }
}

/* ---------- Печать ---------- */
@media print {
  body { background: #fff; }
  .topbar, .sidebar, .step-footer, .preview-col, .toast-host, .modal-backdrop, .overlay { display: none !important; }
  .app-shell { display: block; }
  .main { max-width: none; padding: 0; }
  .form-card, .content-section, .section-card { break-inside: avoid; box-shadow: none; }
}

/* ---------- AI-версия ---------- */
.brand-name .brand-ai {
  display: inline-grid;
  place-items: center;
  margin-left: 3px;
  padding: 2px 6px 1px;
  border-radius: 5px;
  background: var(--terracotta);
  color: #fffaf2;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  vertical-align: 2px;
}
.ai-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  margin-bottom: 17px;
  padding: 23px 25px;
  border-radius: 16px;
  background:
    radial-gradient(420px 180px at 100% 0%, rgba(213, 163, 97, .28), transparent 65%),
    linear-gradient(120deg, #102f29, #185648 58%, #70452f);
  color: #f8f1e4;
  box-shadow: 0 18px 40px rgba(18, 75, 64, .14);
}
.ai-hero::after {
  content: "AI";
  position: absolute;
  right: 22px;
  bottom: -30px;
  color: rgba(255, 250, 240, .055);
  font-family: var(--serif);
  font-size: 150px;
  line-height: 1;
  pointer-events: none;
}
.ai-orb {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(244, 207, 150, .55);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e4bd7f, #b96c45 60%, #6c3c2b);
  color: #1c2923;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  box-shadow: 0 0 0 7px rgba(255, 249, 237, .06), 0 12px 28px rgba(0,0,0,.20);
}
.ai-hero-text { position: relative; z-index: 1; min-width: 0; }
.ai-hero-text h2 { font-family: var(--serif); font-size: 25px; font-weight: 500; line-height: 1.15; color: #fff8ea; }
.ai-hero-text p { max-width: 760px; margin-top: 6px; color: #c8d8d0; font-size: 12px; line-height: 1.55; }
.ai-status {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 15px;
  padding: 12px 14px;
  border: 1px solid #e4d8c5;
  border-radius: 11px;
  background: #fbf7ee;
}
.ai-status.ok { border-color: #c7dfd0; background: #f2faf5; }
.ai-status.bad { border-color: #e7c9b5; background: #fdf2e8; }
.ai-status-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 8px;
  background: #e9dfd0;
  color: #7d6a51;
  font-size: 12px;
  font-weight: 700;
}
.ai-status.ok .ai-status-icon { background: #d5e9dc; color: var(--ok); }
.ai-status.bad .ai-status-icon { background: #f2d9c7; color: #9a5236; }
.ai-status strong { display: block; color: var(--ink-soft); font-size: 11.5px; }
.ai-status p { margin-top: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.ai-status code, .ai-code {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(80, 66, 45, .08);
  color: #5f513d;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 10px;
}
.ai-form-card { border-color: #d8c9b4; background: linear-gradient(180deg, #fffdf8, #fdf9f1); }
.ai-form-card .card-num { background: var(--terracotta-soft); color: var(--terracotta); }
.ai-brief-note { margin-top: 12px; }
.ai-generate-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 17px; padding-top: 16px; border-top: 1px solid #e9dfd0; }
.ai-generate-row .btn-primary { min-height: 44px; padding-left: 19px; padding-right: 19px; background: linear-gradient(120deg, #9e5b39, #b5653e); border-color: #9e5b39; box-shadow: 0 7px 18px rgba(181, 101, 62, .20); }
.ai-generate-row .btn-primary:hover { background: #a85c38; }
.ai-generate-row .btn:disabled { opacity: .45; }
.ai-generate-hint { color: var(--muted-2); font-size: 10px; line-height: 1.4; }
.ai-result {
  margin-top: 16px;
  padding: 17px;
  border: 1px solid #d6e3da;
  border-radius: 13px;
  background: #f7fbf8;
}
.ai-result-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 11px; margin-bottom: 11px; }
.ai-result-head h3 { font-family: var(--serif); font-size: 21px; font-weight: 500; color: var(--green); }
.ai-result-head p { margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.ai-result-meta { color: var(--muted-2); font-size: 9.5px; text-align: right; }
.ai-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ai-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid #cfe1d5; border-radius: 20px; background: #fffdf8; color: #3b6654; font-size: 9.5px; font-weight: 600; }
.ai-chip b { color: var(--green); font-size: 11px; }
.ai-preview-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ai-preview-card { padding: 10px 11px; border: 1px solid #e0e9e3; border-radius: 8px; background: rgba(255,255,255,.66); }
.ai-preview-card h4 { color: var(--ink-soft); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ai-preview-card p { margin-top: 3px; color: var(--muted); font-size: 10.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ai-result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 14px; padding-top: 13px; border-top: 1px solid #dce8e0; }
.ai-overwrite { display: flex; align-items: center; gap: 7px; margin-left: auto; color: var(--muted); font-size: 10px; cursor: pointer; }
.ai-overwrite input { accent-color: var(--green); }
.ai-json { margin-top: 11px; }
.ai-json summary { color: var(--muted-2); font-size: 10px; cursor: pointer; }
.ai-json pre { max-height: 240px; overflow: auto; margin-top: 7px; padding: 9px; border-radius: 7px; background: #eef4ef; color: #4f6258; font-family: Consolas, monospace; font-size: 9.5px; line-height: 1.4; white-space: pre-wrap; }
.ai-loading { display: flex; align-items: center; gap: 11px; margin-top: 16px; padding: 14px 16px; border: 1px dashed #d7c6ad; border-radius: 11px; background: #fdf8ef; color: #745b3d; font-size: 11.5px; }
.ai-spinner { width: 22px; height: 22px; flex: 0 0 22px; border: 2px solid #ead8bd; border-top-color: var(--terracotta); border-radius: 50%; animation: aiSpin .8s linear infinite; }
@keyframes aiSpin { to { transform: rotate(360deg); } }
.ai-error { margin-top: 14px; padding: 12px 14px; border: 1px solid #ecc8bd; border-radius: 10px; background: var(--danger-soft); color: #7d372b; font-size: 11px; line-height: 1.5; white-space: pre-wrap; }
.ai-workflow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
.ai-workflow-step { padding: 9px 10px; border: 1px solid #e5dbcb; border-radius: 8px; background: #fdfaf4; }
.ai-workflow-step span { color: var(--terracotta); font-family: var(--serif); font-size: 11px; }
.ai-workflow-step strong { display: block; margin-top: 1px; color: var(--ink-soft); font-size: 10px; }
.ai-workflow-step p { margin-top: 1px; color: var(--muted); font-size: 9.5px; line-height: 1.35; }
.ai-disclaimer { margin-top: 14px; padding: 11px 13px; border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; background: #fbf5e8; color: #725c39; font-size: 10.5px; line-height: 1.5; }
@media (max-width: 900px) {
  .ai-hero { grid-template-columns: 58px minmax(0, 1fr); gap: 14px; padding: 19px; }
  .ai-orb { width: 58px; height: 58px; font-size: 17px; }
  .ai-hero-text h2 { font-size: 22px; }
}
@media (max-width: 700px) {
  .ai-preview-columns, .ai-workflow { grid-template-columns: 1fr; }
  .ai-result-actions { align-items: flex-start; }
  .ai-overwrite { margin-left: 0; }
  .ai-result-head { flex-direction: column; }
  .ai-result-meta { text-align: left; }
}
.ai-empty { padding: 27px 22px 22px; border: 1px dashed #cbbca6; border-radius: 13px; background: rgba(255, 253, 248, .58); text-align: center; }
.ai-empty-mark { display: inline-grid; place-items: center; width: 48px; height: 48px; margin-bottom: 8px; border: 1px solid #d7c5ae; border-radius: 50%; background: #f6eadb; color: var(--terracotta); font-family: var(--serif); font-size: 16px; font-weight: 700; }
.ai-empty h3 { font-family: var(--serif); font-size: 21px; font-weight: 500; color: var(--green); }
.ai-empty > p { max-width: 560px; margin: 6px auto 13px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.ai-empty .ai-workflow { max-width: 680px; margin: 0 auto; text-align: left; }
.ai-warning { margin-bottom: 12px; padding: 10px 12px; border: 1px solid #e6d1aa; border-radius: 8px; background: var(--warn-soft); color: #74501b; font-size: 10.5px; line-height: 1.5; }

/* ---------- II блок: таблицы ---------- */
.calendar-head, .calendar-row {
  display: grid;
  grid-template-columns: 34px 108px 72px minmax(160px, 1fr) 58px 118px 108px 126px 82px;
  gap: 5px;
  align-items: center;
}
.calendar-head, .education-head, .evaluation-head, .methods-head {
  padding: 0 8px 7px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.calendar-list, .education-list, .evaluation-list, .methods-list, .source-list { display: grid; gap: 5px; }
.calendar-row {
  padding: 6px;
  border-top: 1px dashed #e8e0d2;
  border-radius: 6px;
}
.calendar-row:hover { background: #fdfaf4; }
.calendar-row input, .education-row input, .evaluation-row input, .evaluation-row textarea, .evaluation-row select, .methods-row input {
  width: 100%;
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid #e0d7c8;
  border-radius: 6px;
  background: #fffefb;
  color: var(--ink);
  font-size: 10.5px;
  line-height: 1.35;
  outline: none;
}
.calendar-row input:focus, .education-row input:focus, .evaluation-row input:focus, .evaluation-row textarea:focus, .evaluation-row select:focus, .methods-row input:focus { border-color: var(--green-2); box-shadow: 0 0 0 2px rgba(26, 106, 88, .08); }
.calendar-row .num-input { text-align: center; }
.calendar-no { color: var(--muted-2); font-family: var(--serif); font-size: 10px; text-align: center; }
.calendar-topic { font-size: 10.5px; }
.calendar-row .row-actions { display: flex; gap: 0; }
.calendar-row .icon-btn { width: 25px; height: 28px; }
.calendar-row .icon-btn .icon { width: 13px; height: 13px; }
.education-head, .education-row { display: grid; grid-template-columns: 34px minmax(160px, 1.1fr) 90px 140px minmax(160px, 1fr) 30px; gap: 5px; align-items: center; }
.education-row { padding: 6px; border-top: 1px dashed #e8e0d2; border-radius: 6px; }
.education-row:hover { background: #fdfaf4; }
.evaluation-head, .evaluation-row { display: grid; grid-template-columns: 104px minmax(140px, 1.2fr) minmax(110px, 1fr) minmax(110px, 1fr) minmax(110px, 1fr) 86px 30px; gap: 5px; align-items: start; }
.evaluation-row { padding: 6px; border-top: 1px dashed #e8e0d2; border-radius: 6px; }
.evaluation-row:hover { background: #fdfaf4; }
.evaluation-row textarea { min-height: 54px; resize: vertical; }
.evaluation-row select { appearance: auto; }
.methods-head, .methods-row { display: grid; grid-template-columns: 34px 110px minmax(160px, 1.2fr) minmax(110px, 1fr) minmax(110px, 1fr) 30px; gap: 5px; align-items: center; }
.methods-row { padding: 6px; border-top: 1px dashed #e8e0d2; border-radius: 6px; }
.methods-row:hover { background: #fdfaf4; }
.assessment-card { margin-bottom: 11px; padding: 13px; border: 1px solid #e3dacb; border-radius: 10px; background: #fdfaf4; }
.assessment-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.assessment-head h3 { color: var(--ink-soft); font-size: 12.5px; font-weight: 700; }
.assessment-head span { color: var(--muted-2); font-size: 9.5px; }
.source-card, .appendix-card { margin-bottom: 10px; padding: 13px; border: 1px solid #e3dacb; border-radius: 10px; background: #fdfaf4; }
.source-head, .appendix-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: var(--terracotta); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.appendix-head input, .appendix-head select { flex: 1; min-width: 0; min-height: 34px; padding: 6px 8px; border: 1px solid #ddd3c3; border-radius: 6px; background: #fffefb; color: var(--ink); font-size: 11px; outline: none; }
.appendix-head select { flex: 0 0 190px; }
.appendix-head .icon-btn { flex: 0 0 30px; }
.appendix-card .field textarea { background: #fffefb; }
.empty-mini { padding: 18px; border: 1px dashed #d7c9b7; border-radius: 9px; background: #fdfaf4; color: var(--muted); font-size: 10.5px; text-align: center; }
.inline-alert.is-soft { background: #f6f1e7; color: var(--muted); }
@media (max-width: 900px) {
  .calendar-head, .education-head, .evaluation-head, .methods-head { display: none; }
  .calendar-row { grid-template-columns: 28px 1fr 1fr 1fr; }
  .calendar-row .calendar-topic { grid-column: 2 / 5; }
  .calendar-row .row-actions { grid-column: 1 / 5; justify-content: flex-end; }
  .education-row { grid-template-columns: 28px 1fr 1fr; }
  .education-row input:nth-of-type(3) { grid-column: 2 / 4; }
  .education-row input:nth-of-type(4) { grid-column: 2 / 4; }
  .education-row .icon-btn { grid-column: 3; justify-self: end; }
  .evaluation-row { grid-template-columns: 1fr 1fr; }
  .evaluation-row textarea { grid-column: 1 / 3; }
  .evaluation-row select { grid-column: 1 / 3; }
  .evaluation-row .icon-btn { grid-column: 2; justify-self: end; }
  .methods-row { grid-template-columns: 28px 1fr; }
  .methods-row input { grid-column: 2; }
  .methods-row .icon-btn { grid-column: 2; justify-self: end; }
}
@media (max-width: 560px) {
  .calendar-row { grid-template-columns: 28px 1fr 1fr; }
  .calendar-row .calendar-topic { grid-column: 2 / 4; }
  .calendar-row .row-actions { grid-column: 1 / 4; }
  .education-row { grid-template-columns: 28px 1fr; }
  .education-row input { grid-column: 2; }
  .education-row input:nth-of-type(3), .education-row input:nth-of-type(4) { grid-column: 2; }
  .education-row .icon-btn { grid-column: 2; }
  .appendix-head { flex-wrap: wrap; }
  .appendix-head select { flex: 1 0 100%; }
}
.block2-status { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 16px; padding: 15px 17px; border: 1px solid #cfe1d5; border-radius: 11px; background: var(--ok-soft); }
.block2-status-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: #cde4d4; color: var(--green); font-family: var(--serif); font-size: 15px; }
.block2-status strong { display: block; color: #2f6249; font-size: 12px; }
.block2-status p { margin-top: 3px; color: #527462; font-size: 10.5px; line-height: 1.45; }

/* ---------- AI-поиск похожих программ ---------- */
.ai-search-card { border-color: #d7e2d8; background: linear-gradient(180deg, #fbfdf9 0%, #f7faf5 100%); }
.ai-search-card .card-head { margin-bottom: 8px; }
.ai-search-card > p { color: var(--muted); font-size: 11px; line-height: 1.55; }
.ai-similar-result { margin-top: 14px; padding-top: 13px; border-top: 1px solid #dce8dc; }
.ai-source-list { display: grid; gap: 6px; margin: 10px 0 12px; }
.ai-source { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; border: 1px solid #e0e9df; border-radius: 8px; background: #fffefb; }
.ai-source strong { display: block; color: var(--ink-soft); font-size: 10.5px; line-height: 1.4; }
.ai-source span { display: block; margin-top: 2px; color: var(--muted-2); font-size: 9.5px; }
.ai-source a { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; background: #eef5ef; color: var(--green); }
.ai-source a .icon { width: 12px; height: 12px; }
.ai-section-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 14px; padding: 11px 13px; border: 1px dashed #d8c9b5; border-radius: 9px; background: #fdfaf4; }
.ai-section-bar strong { display: block; color: var(--ink-soft); font-size: 11px; }
.ai-section-bar p { margin-top: 2px; color: var(--muted-2); font-size: 9.5px; line-height: 1.45; }
.ai-section-bar .btn { flex: 0 0 auto; }
.ai-modal-lead { margin-bottom: 12px; padding: 9px 11px; border-radius: 7px; background: var(--warn-soft); color: #74501b; font-size: 10.5px; line-height: 1.5; }
.ai-section-table { margin-top: 12px; overflow-x: auto; }
.ai-section-table table { width: 100%; border-collapse: collapse; font-size: 9.5px; }
.ai-section-table th, .ai-section-table td { padding: 6px 7px; border: 1px solid #e0d6c6; text-align: left; vertical-align: top; }
.ai-section-table th { background: #e8f0e8; color: var(--green); font-size: 8.5px; text-transform: uppercase; letter-spacing: .03em; }
.ai-preview-card ul { margin: 5px 0 0 15px; color: var(--muted); font-size: 10px; line-height: 1.45; }
@media (max-width: 650px) {
  .ai-section-bar { align-items: flex-start; flex-direction: column; }
  .ai-section-bar .btn { width: 100%; justify-content: center; }
}

/* ---------- Очистка конструктора ---------- */
.reset-warning { margin: 4px 0 14px; padding: 11px 13px; border: 1px solid #ecc8bd; border-radius: 9px; background: var(--danger-soft); color: #7d372b; font-size: 10.5px; line-height: 1.55; }
.reset-warning strong { display: block; margin-bottom: 2px; }
.reset-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; border: 1px solid #d9cdb9; border-radius: 9px; background: #fdfaf4; cursor: pointer; }
.reset-option input { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; accent-color: var(--green); }
.reset-option strong { display: block; color: var(--ink-soft); font-size: 11.5px; }
.reset-option small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.reset-note { margin-top: 10px; color: var(--muted-2); font-size: 10px; line-height: 1.5; }
.type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 650px) { .type-grid { grid-template-columns: 1fr; } }

/* ---------- Справка и подсказки ---------- */
.step-head { position: relative; padding-right: 54px; }
.step-help-btn { position: absolute; top: 0; right: 0; display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid #d8cdbb; border-radius: 50%; background: #fffdf8; color: var(--green); cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.step-help-btn:hover { background: var(--green-pale); border-color: #bad3c4; }
.step-help-btn .icon { width: 17px; height: 17px; }
.help-lead { margin-bottom: 13px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.help-intro { margin-bottom: 10px; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.help-steps { margin: 0 0 12px 19px; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.help-steps li { margin-bottom: 5px; padding-left: 3px; }
.help-tip { padding: 11px 13px; border: 1px solid #e5d5b8; border-radius: 9px; background: #fdf7ec; color: #6f552f; font-size: 11px; line-height: 1.55; }
.help-section { margin-bottom: 8px; border: 1px solid #e4dacb; border-radius: 9px; background: #fffefb; overflow: hidden; }
.help-section summary { padding: 11px 13px; color: var(--green); font-size: 12px; font-weight: 700; cursor: pointer; list-style: none; }
.help-section summary::-webkit-details-marker { display: none; }
.help-section summary::before { content: '+'; display: inline-block; width: 18px; color: var(--terracotta); font-family: var(--serif); }
.help-section[open] summary::before { content: '−'; }
.help-section-body { padding: 0 13px 12px 31px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.help-section-body p { margin-bottom: 8px; }
.help-section-body ul, .help-section-body ol { margin: 0 0 8px 17px; }
.help-section-body li { margin-bottom: 4px; }
.help-terms { margin: 0; }
.help-terms dt { margin-top: 8px; color: var(--ink-soft); font-weight: 700; }
.help-terms dd { margin: 2px 0 0 0; }
.help-shortcuts { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #f6f1e7; color: var(--ink-soft); font-size: 10.5px; }
.onboarding-card { margin-bottom: 18px; padding: 15px 17px; border: 1px solid #cbded2; border-radius: 12px; background: linear-gradient(135deg, #f7fbf5, #f2f8ee); }
.onboarding-head { display: flex; align-items: flex-start; gap: 11px; }
.onboarding-head > div { flex: 1; }
.onboarding-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: #dcecdf; color: var(--green); font-family: var(--serif); font-size: 16px; }
.onboarding-head strong { display: block; color: var(--green); font-size: 13px; }
.onboarding-head p { margin-top: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.onboarding-steps { margin: 11px 0 12px 20px; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.onboarding-steps li { margin-bottom: 3px; }
.onboarding-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 650px) {
  .step-head { padding-right: 42px; }
  .step-help-btn { width: 31px; height: 31px; }
  .step-help-btn .icon { width: 15px; height: 15px; }
  .help-section-body { padding-left: 13px; }
}
@media (min-width: 701px) {
  .side-actions { display: none; }
}
.top-new { font-weight: 700; }
@media (max-width: 1180px) {
  .top-actions .top-action .btn-label { display: none; }
  .top-new .btn-label { display: inline; }
}
@media (max-width: 700px) {
  .top-new .btn-label { display: none; }
  .top-new { padding-left: 11px; padding-right: 11px; }
}

/* ---------- Подключение нейросети ---------- */
.ai-status-actions { margin-top: 10px; }
.ai-status-note { margin-top: 8px; color: var(--muted-2); font-size: 9.5px; line-height: 1.45; }
.ai-settings { display: grid; gap: 10px; }
.ai-settings-field { display: flex; flex-direction: column; gap: 4px; }
.ai-settings-field > span { color: var(--ink-soft); font-size: 10.5px; font-weight: 700; }
.ai-settings-field select, .ai-settings-field input { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid #dcd2c2; border-radius: 7px; background: #fffefb; color: var(--ink); font-size: 12px; outline: none; }
.ai-settings-field input:focus, .ai-settings-field select:focus { border-color: var(--green-2); box-shadow: 0 0 0 2px rgba(26,106,88,.08); }
.ai-settings-field small { color: var(--muted-2); font-size: 9px; line-height: 1.4; }
.ai-settings-wide { grid-column: 1 / 3; }
.ai-settings-check { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 10.5px; line-height: 1.45; cursor: pointer; }
.ai-settings-check input { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 1px; accent-color: var(--green); }
.ai-settings-warning { padding: 10px 12px; border: 1px solid #e6d1aa; border-radius: 8px; background: var(--warn-soft); color: #74501b; font-size: 9.5px; line-height: 1.5; }
.ai-settings-result { min-height: 18px; font-size: 10.5px; line-height: 1.5; }
.ai-settings-result .is-error { color: var(--danger); }
.ai-settings-result .is-loading { color: var(--muted); }
@media (max-width: 560px) { .ai-settings-wide { grid-column: auto; } }

/* ---------- Титульный лист не нужен ---------- */
.title-skip-toggle { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid #d6cbb9; border-radius: 11px; background: #fffdf8; cursor: pointer; }
.title-skip-toggle.is-checked { border-color: #bad3c4; background: var(--green-pale); }
.title-skip-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.title-skip-box { position: relative; width: 19px; height: 19px; flex: 0 0 19px; margin-top: 1px; border: 1.5px solid #bdb3a3; border-radius: 5px; background: #fff; }
.title-skip-toggle input:checked + .title-skip-box { border-color: var(--green); background: var(--green); }
.title-skip-toggle input:checked + .title-skip-box::after { content: '✓'; position: absolute; inset: -2px 0 0 0; color: #fff; font-size: 14px; text-align: center; line-height: 19px; }
.title-skip-toggle input:focus-visible + .title-skip-box { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.title-skip-text strong { display: block; color: var(--ink-soft); font-size: 12.5px; }
.title-skip-text small { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.title-skip-notice { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 15px; padding: 15px 17px; border: 1px solid #cfe1d5; border-radius: 11px; background: var(--ok-soft); }
.title-skip-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: #cde4d4; color: var(--green); font-size: 15px; }
.title-skip-notice strong { display: block; color: #2f6249; font-size: 12px; }
.title-skip-notice p { margin-top: 3px; color: #527462; font-size: 10.5px; line-height: 1.55; }
.title-skip-preview { padding: 14px 17px; border: 1px dashed #d7c9b7; border-radius: 10px; background: #fdfaf4; }
.title-skip-preview > span { color: var(--terracotta); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.title-skip-preview ol { margin: 8px 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.6; }

/* Регион и AI-поиск региональных актов */
.norm-ai-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 12px 0 16px; padding: 14px 15px; border: 1px dashed #c9d9cd; border-radius: 11px; background: #fbfdf9; }
.norm-ai-row > div { min-width: 0; }
.norm-ai-row strong { display: block; color: var(--green); font-size: 12px; }
.norm-ai-row p { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.regional-docs-list { display: grid; gap: 8px; margin: 15px 0; }
.regional-doc-item { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fffdf8; cursor: pointer; }
.regional-doc-item input { margin-top: 2px; accent-color: var(--green); }
.regional-doc-text { display: grid; gap: 3px; min-width: 0; }
.regional-doc-text strong { color: var(--ink-soft); font-size: 11.5px; line-height: 1.4; }
.regional-doc-text small { color: var(--muted); font-size: 9.5px; line-height: 1.4; }
.regional-doc-text em { color: var(--ink-soft); font-size: 10px; font-style: normal; line-height: 1.4; }
.regional-doc-source { color: var(--green) !important; }
.regional-doc-source a { color: var(--green); text-decoration: underline; }
.ai-modal-note { margin: 12px 0 0; color: var(--warn); font-size: 9.5px; line-height: 1.5; }
@media (max-width: 700px) {
  .norm-ai-row { align-items: flex-start; flex-direction: column; }
  .norm-ai-row .btn { width: 100%; }
}
