/* Редактор регламента, проверка изменений, отметка «Регламент обновлён» и история.
   Классы ed-* (редактор) и dch-* (изменения). Примитивы дизайн-системы
   (ho-btn, cab-card, cab-chip, cab-field, cab-doc) не переопределяются. */

/* ── редактор ─────────────────────────────────────────────────────────── */
.ed{position:relative}
.ed-note{display:flex;align-items:center;gap:10px 14px;flex-wrap:wrap;background:var(--ho-yellow-bg);color:var(--fg-1);border-radius:var(--radius-md);padding:10px 14px;margin:14px 0 10px;font-size:13.5px;line-height:1.5}
.ed-note-ic{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;flex:none;border-radius:var(--radius-sm);background:var(--bg-1);color:var(--ho-yellow-ink)}
.ed-note-t{flex:1 1 320px;min-width:0}
.ed-note-acts{display:flex;gap:8px;flex-wrap:wrap}
.page .ed-note .ho-btn{height:32px;min-height:32px;background:var(--bg-1)}

.ed-bar{position:sticky;top:64px;z-index:25;display:flex;align-items:center;flex-wrap:wrap;gap:6px 14px;background:var(--bg-1);border-radius:0 0 var(--radius-md) var(--radius-md);box-shadow:var(--shadow-1);padding:6px 8px;margin:0 0 14px}
.ed-tools{display:flex;align-items:center;gap:2px;flex-wrap:wrap;min-width:0}
.ed-group{display:inline-flex;gap:2px}
.ed-tb{all:unset;box-sizing:border-box;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px;height:34px;min-width:34px;padding:0 7px;border-radius:var(--radius-sm);color:var(--fg-2);font:600 13px/1 var(--font-sans);white-space:nowrap;transition:background .12s ease,color .12s ease}
.ed-tb--txt{padding:0 11px}
.ed-tb svg{width:18px;height:18px;flex:none}
.ed-tb:hover{background:var(--bg-2);color:var(--fg-1)}
.ed-tb:focus-visible{background:var(--bg-2);color:var(--fg-1)}
.ed-tb.is-on{background:var(--ho-yellow-bg);color:var(--fg-1)}
.ed-tb:disabled{opacity:.35;cursor:default;background:none}
.ed-sep{width:1px;height:20px;background:var(--border-1);margin:0 6px;flex:none}
.ed-side{display:flex;align-items:center;gap:12px;margin-left:auto;min-width:0}
.ed-status{font-size:12.5px;color:var(--fg-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:340px}
.ed-status.is-err{color:var(--ho-red-text);white-space:normal}

.ed-linkbar{flex:1 1 100%;display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px;background:var(--bg-2);border-radius:var(--radius-sm);padding:8px 10px}
.ed-link-l{font-size:12.5px;font-weight:700;color:var(--fg-2)}
.ed-linkbar .ed-link-in{flex:1 1 260px;min-width:0;height:36px;padding:0 12px;background:var(--bg-1)}
.ed-link-acts{display:flex;gap:8px;flex-wrap:wrap}
.page .ed-link-acts .ho-btn{background:var(--bg-1)}
.page .ed-link-acts .ho-btn--primary{background:var(--ho-primary-alpha)}
.ed-link-err{flex:1 1 100%;font-size:12.5px;font-weight:600;color:var(--ho-red-text)}

/* лист регламента: те же отступы и типографика, что у читалки (.learn-doc) */
.ed-sheet{padding:26px 30px 30px;margin-bottom:14px}
.ed-doc .ed-title{display:block;width:100%;box-sizing:border-box;border:0;outline:none;resize:none;overflow:hidden;background:transparent;padding:0;font-family:inherit;font-size:26px;line-height:1.25;font-weight:800;color:var(--fg-1);letter-spacing:-.01em;margin:0 0 18px}
.ed-doc .ed-title::placeholder{color:var(--fg-4)}
.ed-area{position:relative;outline:none;min-height:40vh;caret-color:var(--fg-1);word-break:break-word}
/* в читалке первым идёт название, поэтому у первого заголовка текста обычный отступ сверху */
.cab-doc .ed-area > h2:first-child,.cab-doc .ed-area > h3:first-child{margin-top:22px}
.ed-area.is-empty::before{content:attr(data-ph);position:absolute;left:0;top:0;color:var(--fg-4);font-size:14.5px;line-height:1.62;pointer-events:none}
/* Браузер при правке и вставке оставляет span и font со своими стилями.
   В разметке их нет, поэтому и на экране они не должны ничего менять. */
.ed-area span,.ed-area font{font:inherit!important;color:inherit!important;background:transparent!important;letter-spacing:inherit!important;text-decoration:none!important;vertical-align:baseline!important}
.ed-area b[style],.ed-area strong[style],.ed-area i[style],.ed-area em[style],.ed-area a[style]{font-size:inherit!important;font-family:inherit!important;line-height:inherit!important;letter-spacing:inherit!important;background:transparent!important}
.ed-area b[style],.ed-area strong[style]{color:var(--fg-1)!important}
.ed-area i[style],.ed-area em[style]{color:inherit!important}
.ed-area a[style]{color:var(--ho-blue)!important}
.ed-area u,.ed-area s,.ed-area strike{text-decoration:none}
.ed-area li > ul,.ed-area li > ol{margin:5px 0 0}
.ed-area a{cursor:text}
.ed-area td,.ed-area th{transition:background .12s ease}
.ed-area .ed-cur-cell{background:var(--ho-yellow-bg)}
.ed-area .cab-scrollx{overflow-x:auto}

.ed-foot{display:flex;align-items:center;justify-content:space-between;gap:12px 20px;flex-wrap:wrap;margin:0 0 24px}
.ed-foot-t{flex:1 1 360px;font-size:12.5px;line-height:1.5;color:var(--fg-3)}
.ed-foot-b{display:flex;gap:10px;flex-wrap:wrap}
/* страница серая: вторичная кнопка белая с мягкой тенью, как ho-btn--white */
.page .ed-foot .ho-btn--soft{background:var(--bg-1);box-shadow:var(--shadow-soft)}
.page .ed-foot .ho-btn--soft:hover{background:var(--bg-hover)}
.ed-fail-back{margin-top:12px}

/* ── проверка перед публикацией ───────────────────────────────────────── */
.ed-review{margin-top:14px}
.ed-rv-head{padding:20px 22px}
.ed-rv-t{margin:0 0 10px;font-size:20px;font-weight:800;line-height:1.3;color:var(--fg-1)}
.ed-rv-meta{display:flex;align-items:center;gap:6px 18px;flex-wrap:wrap;font-size:13.5px;font-weight:600;color:var(--fg-1)}
.ed-rv-meta > span{display:inline-flex;align-items:center;gap:7px}
.ed-rv-meta svg{width:16px;height:16px;color:var(--fg-3)}
.ed-rv-sub{font-size:12.5px;line-height:1.5;color:var(--fg-3);margin-top:6px}
.ed-rv-chips{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}
.ed-rv-list{margin-bottom:14px}
.ed-rv-pub{padding:20px 22px}
.ed-rv-l{display:block;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;color:var(--fg-4);margin:0 0 8px}
.ed-rv-pub .ed-rv-sum{margin-bottom:18px}
.ed-choice{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.ed-opt{all:unset;box-sizing:border-box;cursor:pointer;display:flex;align-items:flex-start;gap:12px;padding:13px 15px;border-radius:var(--radius-md);background:var(--bg-2);transition:background .12s ease}
.ed-opt:hover{background:var(--bg-hover)}
.ed-opt.is-on{background:var(--ho-yellow-bg)}
.ed-opt-mark{width:18px;height:18px;flex:none;margin-top:1px;border-radius:50%;background:var(--bg-1);box-shadow:inset 0 0 0 1.5px var(--border-2);display:flex;align-items:center;justify-content:center}
.ed-opt.is-on .ed-opt-mark{background:var(--ho-primary-alpha);box-shadow:none}
.ed-opt.is-on .ed-opt-mark::after{content:"";width:8px;height:8px;border-radius:50%;background:var(--fg-1)}
.ed-opt-b{display:flex;flex-direction:column;gap:4px;min-width:0}
.ed-opt-b b{font-size:14px;font-weight:700;color:var(--fg-1);line-height:1.35}
.ed-opt-b span{font-size:12.5px;line-height:1.5;color:var(--fg-3)}
.ed-rv-hint{margin-top:12px;font-size:12.5px;line-height:1.5;color:var(--fg-2);background:var(--bg-2);border-radius:var(--radius-sm);padding:9px 12px}
.ed-rv-err{margin-top:12px;font-size:13px;line-height:1.5;font-weight:600;color:var(--ho-red-text);background:var(--ho-red-light);border-radius:var(--radius-sm);padding:10px 12px}
.ed-rv-acts{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.ed-rv-none{display:flex;flex-direction:column;gap:6px;padding:20px 22px}
.ed-rv-none b{font-size:16px;color:var(--fg-1)}
.ed-rv-none span{font-size:13.5px;line-height:1.55;color:var(--fg-2)}
.ed-rv-none .ed-rv-acts{margin-top:12px}

/* ── блоки «было / стало» ─────────────────────────────────────────────── */
.dch-blocks{display:flex;flex-direction:column;gap:10px}
.dch-b{background:var(--bg-1);border-radius:var(--radius-md);box-shadow:var(--shadow-1);padding:12px 16px 10px}
.dch-change .dch-b,.dch-item-b .dch-b{box-shadow:none;background:var(--bg-2)}
.dch-where{font-size:12px;line-height:1.45;color:var(--fg-3);margin-bottom:6px}
.dch-kind{display:inline-block;margin-left:6px;font-weight:700;color:var(--fg-2)}
.dch-row{display:grid;grid-template-columns:78px minmax(0,1fr);gap:10px;padding:5px 0}
.dch-row + .dch-row{box-shadow:inset 0 1px 0 var(--border-1)}
.dch-lbl{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;padding-top:4px;color:var(--fg-4)}
.dch-row.is-was .dch-lbl{color:var(--ho-red-text)}
.dch-row.is-now .dch-lbl{color:var(--ho-green-text)}
.dch-txt{font-size:14.5px;line-height:1.62;color:var(--fg-1);word-break:break-word}
.dch-txt del{background:var(--ho-red-light);color:var(--ho-red-text);text-decoration:line-through;text-decoration-thickness:1px;border-radius:var(--radius-sm);padding:1px 3px;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.dch-txt ins{background:var(--ho-green-light);color:var(--ho-green-text);text-decoration:none;border-radius:var(--radius-sm);padding:1px 3px;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.dch-none{color:var(--fg-4)}
.dch-show{all:unset;box-sizing:border-box;cursor:pointer;display:inline-flex;align-items:center;gap:4px;min-height:32px;margin-top:4px;padding:0 10px;border-radius:var(--radius-sm);background:var(--bg-1);font-size:12.5px;font-weight:700;color:var(--fg-2)}
.dch-show:hover{color:var(--fg-1);background:var(--bg-hover)}
.dch-show svg{width:15px;height:15px;transform:rotate(-90deg)}
.dch-fmt{background:var(--bg-1);border-radius:var(--radius-md);box-shadow:var(--shadow-1);overflow:hidden}
.dch-change .dch-fmt,.dch-item-b .dch-fmt{box-shadow:none;background:var(--bg-2)}
.dch-fmt-h{all:unset;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:44px;padding:10px 16px;font-size:13px;font-weight:600;line-height:1.4;color:var(--fg-2)}
.dch-fmt-h:hover{color:var(--fg-1)}
.dch-fmt-h svg{flex:none;color:var(--fg-3);transition:transform .15s ease}
.dch-fmt.is-open .dch-fmt-h svg{transform:rotate(180deg)}
.dch-fmt-b{display:flex;flex-direction:column;gap:8px;padding:0 12px 12px}
.dch-fmt-b .dch-b{box-shadow:none;background:var(--bg-2)}
.dch-change .dch-fmt-b .dch-b,.dch-item-b .dch-fmt-b .dch-b{background:var(--bg-1)}
.dch-md > :last-child{margin-bottom:0}
.dch-md .cab-table{box-shadow:none}

/* ── отметка «Регламент обновлён» ─────────────────────────────────────── */
.dch-notice{padding:0;overflow:hidden;transition:opacity .2s ease,transform .2s ease}
.dch-notice.is-gone{opacity:0;transform:translateY(-6px)}
.dch-notice-h{display:flex;align-items:flex-start;gap:12px;background:var(--ho-yellow-bg);padding:14px 20px}
.dch-notice-ic{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;flex:none;border-radius:var(--radius-md);background:var(--bg-1);color:var(--ho-yellow-ink)}
.dch-notice-ht{display:flex;flex-direction:column;gap:3px;min-width:0}
.dch-notice-ht b{font-size:15.5px;font-weight:800;line-height:1.35;color:var(--fg-1)}
.dch-notice-ht span{font-size:13px;line-height:1.5;color:var(--fg-2)}
.dch-notice-b{display:flex;flex-direction:column;gap:16px;padding:16px 20px 4px}
.dch-change{display:flex;flex-direction:column;gap:8px}
.dch-change-h{display:flex;gap:4px 14px;flex-wrap:wrap;font-size:12.5px;font-weight:700;color:var(--fg-3)}
.dch-change-s{font-size:14px;font-weight:600;line-height:1.5;color:var(--fg-1)}
.dch-notice-f{display:flex;justify-content:flex-end;padding:14px 20px 18px}
.dch-chip{white-space:nowrap;align-self:flex-start;width:max-content;max-width:100%}

/* ── история изменений ────────────────────────────────────────────────── */
.dch-hist .cab-card-h{margin-bottom:6px}
.dch-list{display:flex;flex-direction:column}
.dch-item + .dch-item{box-shadow:inset 0 1px 0 var(--border-1)}
.dch-item-h{all:unset;box-sizing:border-box;cursor:pointer;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;width:100%;padding:12px 4px;min-height:44px;border-radius:var(--radius-sm)}
.dch-item-h:hover .dch-item-s{color:var(--fg-1)}
.dch-item-m{display:flex;align-items:center;gap:4px 12px;flex-wrap:wrap;font-size:12.5px;color:var(--fg-3)}
.dch-item-d{font-weight:700;color:var(--fg-1)}
.dch-item-s{grid-column:1;font-size:14px;line-height:1.5;color:var(--fg-2)}
.dch-item-go{grid-column:2;grid-row:1 / span 2;align-self:center;display:inline-flex;color:var(--fg-3);transition:transform .15s ease}
.dch-item.is-open .dch-item-go{transform:rotate(180deg)}
.dch-item-b{padding:2px 0 14px}
.dch-item-sub{font-size:12.5px;color:var(--fg-3);margin:0 0 8px}
.dch-item.is-hidden .dch-item-s{color:var(--fg-3)}
.dch-empty{line-height:1.55}

@media (max-width:768px){
  .ed-note{margin:12px 0 8px;align-items:flex-start}
  .ed-note-t{flex:1 1 200px}
  .ed-note-acts{flex:1 1 100%}
  .page .ed-note .ho-btn{height:40px;min-height:40px}
  .ed-bar{margin:0 -16px 12px;border-radius:0;padding:4px 8px 6px;gap:2px}
  .ed-tools{flex-wrap:nowrap;overflow-x:auto;width:100%;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .ed-tools::-webkit-scrollbar{display:none}
  .ed-tools.is-more{-webkit-mask-image:linear-gradient(to right,#000 82%,transparent);mask-image:linear-gradient(to right,#000 82%,transparent)}
  .ed-tb{height:44px;min-width:44px}
  .ed-sep{margin:0 3px}
  .ed-side{width:100%;margin:0;padding:0 6px}
  .ed-side .ed-go{display:none}
  .ed-status{max-width:none;font-size:12px}
  .ed-linkbar{margin:4px 0 0}
  .ed-linkbar .ed-link-in{flex-basis:100%;height:44px}
  .ed-link-acts{width:100%}
  .ed-link-acts .ho-btn{flex:1}
  .ed-sheet{padding:18px 16px 22px}
  .ed-doc .ed-title{font-size:21px;margin-bottom:14px}
  .ed-foot{position:sticky;bottom:0;z-index:20;margin:0 -16px;padding:10px 16px calc(10px + env(safe-area-inset-bottom));background:var(--bg-1);box-shadow:var(--shadow-up)}
  .ed-foot-t{display:none}
  .ed-foot-b{width:100%;display:grid;grid-template-columns:auto 1fr}
  .page .ed-foot .ho-btn--soft{background:var(--bg-2);box-shadow:none}
  .ed-rv-head,.ed-rv-pub,.ed-rv-none{padding:16px}
  .ed-rv-t{font-size:18px}
  .ed-choice{grid-template-columns:1fr}
  .ed-rv-acts .ho-btn{flex:1 1 100%}
  .dch-b{padding:10px 12px 8px}
  .dch-row{grid-template-columns:1fr;gap:2px}
  .dch-lbl{padding-top:0}
  .dch-notice-h{padding:14px 16px}
  .dch-notice-b{padding:14px 16px 4px}
  .dch-notice-f{padding:12px 16px 16px}
  .dch-notice-f .ho-btn{width:100%}
  .dch-show{min-height:40px}
}
@media (prefers-reduced-motion:reduce){
  .dch-notice,.ed-tb,.ed-opt,.dch-fmt-h svg,.dch-item-go{transition:none}
}
