/* Стенд правок. Только классы: политика CSP запрещает атрибуты style и встроенные стили. */
:root {
  --bg: #f6f5f1;
  --card: #ffffff;
  --fg: #1d2329;
  --muted: #5d6670;
  --faint: #8a939b;
  --line: #dcdad3;
  --accent: #1f5f8b;
  --accent-fg: #ffffff;
  --accent-soft: #e3eef6;
  --sel: #fff6d8;
  --ok: #2f7d4a;
  --ok-soft: #e2f2e7;
  --warn: #9a5b00;
  --warn-soft: #fbefd9;
  --bad: #a3322c;
  --bad-soft: #f8e3e1;
  --del-fg: #a3322c;
  --del-bg: #fbe4e2;
  --ins-fg: #1c5f33;
  --ins-bg: #dff2e4;
  --h0: #f1f3f4;
  --radius: 10px;
  --tap: 44px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15191d; --card: #1e2429; --fg: #e8ecef; --muted: #a7b0b8; --faint: #7d8790; --line: #343c43;
    --accent: #6fb0dc; --accent-fg: #0d1a24; --accent-soft: #1d3446; --sel: #3a3420;
    --ok: #7cc795; --ok-soft: #1d3326; --warn: #e6b45a; --warn-soft: #3a2f1b; --bad: #f08a83; --bad-soft: #3d2221;
    --del-fg: #f2a19b; --del-bg: #45201e; --ins-fg: #9be0b0; --ins-bg: #193726;
    --h0: #22292f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; }
.wrap { max-width: 820px; margin: 0 auto; padding: 12px 16px 96px; }
.wrap:focus { outline: none; }
.loading, .muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }
body.noscroll { overflow: hidden; }

/* ── шапка и навигация ───────────────────────────────────────── */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 820px; margin: 0 auto; padding: 8px 16px 0; display: flex; gap: 8px; align-items: baseline;
  justify-content: space-between; flex-wrap: wrap; }
.brand { font-weight: 700; text-decoration: none; color: var(--fg); }
.brand-sub { font-weight: 400; color: var(--muted); font-size: 14px; }
.who { color: var(--muted); font-size: 14px; }
.nav { max-width: 820px; margin: 0 auto; padding: 0 8px; display: flex; gap: 2px; overflow-x: auto;
  scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 10px; white-space: nowrap;
  text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; font-size: 15px; }
.nav a.on { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }

/* ── общие элементы ─────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  margin: 12px 0; }
.card h2, .card h3 { margin: 0 0 8px; }
.section-title { margin: 28px 0 8px; font-size: 22px; }
.lead { font-size: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap);
  min-width: var(--tap); padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card);
  color: var(--fg); font: inherit; font-size: 16px; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.btn-ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--accent); }
.btn-small { min-height: 36px; font-size: 15px; padding: 0 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-end { justify-content: flex-end; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 13px; background: var(--h0);
  color: var(--muted); white-space: nowrap; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.chip-acc { background: var(--accent-soft); color: var(--accent); }
.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; }
.note-mark { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; color: var(--muted); }
ul.plain { padding-left: 20px; margin: 6px 0; }
.err { color: var(--bad); }

/* ── список страниц ─────────────────────────────────────────── */
.list-title { font-size: 26px; margin: 10px 0 6px; }
.plist { list-style: none; padding: 0; margin: 14px 0 0; counter-reset: pg; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.plist li { counter-increment: pg; border-top: 1px solid var(--line); }
.plist li:first-child { border-top: 0; }
.plist-item { display: grid; grid-template-columns: 26px 1fr 16px; gap: 2px 8px; align-items: center;
  padding: 12px 14px; min-height: 64px; text-decoration: none; color: var(--fg); }
.plist-item::before { content: counter(pg) "."; grid-column: 1; grid-row: 1 / span 2; align-self: start;
  color: var(--faint); }
.plist-item::after { content: "›"; grid-column: 3; grid-row: 1 / span 2; color: var(--accent); font-size: 26px;
  line-height: 1; }
.plist-title { grid-column: 2; grid-row: 1; font-weight: 600; line-height: 1.3; }
.plist-meta { grid-column: 2; grid-row: 2; display: flex; flex-wrap: wrap; gap: 0 12px; font-size: 14px;
  color: var(--muted); }
.plist-meta .ok { color: var(--ok); }
.plist-meta .acc { color: var(--accent); }
.plist-item:hover, .plist-item:focus { background: var(--accent-soft); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; }

/* ── страница-текст ─────────────────────────────────────────── */
.hint { background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; font-size: 15px; }
.doc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 0; }
.blk { position: relative; padding: 6px 52px 6px 16px; border-left: 4px solid transparent; }
.blk.sel { background: var(--sel); border-left-color: var(--accent); }
.blk.has-notes { border-left-color: var(--ok); }
.blk .bid { position: absolute; right: 8px; top: 4px; font: 11px ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--faint); }
/* «+» у каждого абзаца видно сразу: место для правки рядом с текстом, а не по наведению */
.blk .plus { position: absolute; right: 4px; top: 20px; width: 40px; height: 40px; border: 1px solid var(--accent);
  background: var(--accent-soft); color: var(--accent); font-size: 24px; line-height: 1; cursor: pointer;
  border-radius: 50%; padding: 0; }
.blk .plus:hover, .blk .plus:focus { background: var(--accent); color: var(--accent-fg); }
.blk.sel .plus { background: var(--accent); color: var(--accent-fg); }
.blk-body { cursor: pointer; }
.blk-body h1 { font-size: 26px; margin: 6px 0; }
.blk-body h2 { font-size: 21px; margin: 14px 0 4px; }
.blk-body h3 { font-size: 18px; margin: 10px 0 2px; }
.blk-body p { margin: 4px 0; }
.blk.k-li .blk-body { display: list-item; margin-left: 20px; }
.blk.k-faq_q .blk-body h3 { color: var(--accent); }
.kadr { border: 1px dashed var(--faint); border-radius: 8px; padding: 8px 10px; color: var(--muted); font-size: 15px; }
.kadr b { color: var(--fg); font-weight: 600; }
.slot { border: 1px dashed var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 8px 10px; font-size: 15px; }
.footer-line { font-style: italic; color: var(--muted); }
.lnk { color: var(--accent); text-decoration: underline dotted; cursor: help; }
.blk-actions { display: flex; gap: 8px; margin: 8px 0 4px; flex-wrap: wrap; }
.notes-under { margin: 6px 0 2px; }
.ncard { border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 8px; padding: 8px 10px;
  margin: 6px 0; background: var(--card); font-size: 15px; }
.ncard.withdrawn { opacity: .6; border-left-color: var(--faint); }
.ncard.imp-critical { border-left-color: var(--bad); }
.ncard .nhead { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; }
.ncard .ntext { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ncard .nquote { color: var(--muted); font-size: 14px; border-left: 3px solid var(--line); padding-left: 8px; margin: 4px 0; }
.ncard .verdict { background: var(--accent-soft); border-radius: 6px; padding: 6px 8px; margin-top: 6px; }
.diff { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.diff del { color: var(--del-fg); background: var(--del-bg); text-decoration: line-through; }
.diff ins { color: var(--ins-fg); background: var(--ins-bg); text-decoration: underline; }
.done-box { margin: 18px 0; }
.done-box .row .btn { flex: 1 1 160px; }
.btn-next { height: auto; padding: 8px 16px; text-align: left; }

/* ── формы ──────────────────────────────────────────────────── */
label.field { display: block; margin: 10px 0 4px; font-weight: 600; font-size: 15px; }
textarea, input[type=text], input[type=date], select {
  width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--fg); }
textarea { min-height: 110px; resize: vertical; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choices label { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 15px; background: var(--card); }
.choices input { width: 18px; height: 18px; margin: 0; }
.choices label.on { border-color: var(--accent); background: var(--accent-soft); }
.counter { font-size: 13px; color: var(--faint); text-align: right; }
.form-error { color: var(--bad); margin: 8px 0; }

/* ── выдвижная панель ───────────────────────────────────────── */
.sheet { position: fixed; inset: 0; background: rgba(10, 14, 18, .45); z-index: 50; display: flex;
  align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-panel { background: var(--card); width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto;
  border-radius: 16px 16px 0 0; padding: 14px 16px 24px; }
.sheet-panel h2 { margin: 4px 0 8px; font-size: 20px; }
.sheet-panel > .nquote { color: var(--muted); font-size: 15px; border-left: 3px solid var(--line); padding-left: 10px;
  margin: 4px 0 8px; }
@media (min-width: 760px) {
  .sheet { align-items: center; }
  .sheet-panel { border-radius: 14px; }
}

/* ── таблицы владельца ──────────────────────────────────────── */
.cov { font-size: 14px; }
.cov th, .cov td { border: 1px solid var(--line); padding: 4px 6px; text-align: center; white-space: nowrap; }
.cov th.who-col, .cov td.who-col { text-align: left; position: sticky; left: 0; background: var(--card); }
.cov td.s-none { color: var(--faint); }
.cov td.s-unopened { background: var(--bad-soft); color: var(--bad); }
.cov td.s-opened { background: var(--warn-soft); color: var(--warn); }
.cov td.s-done_clean { background: var(--ok-soft); color: var(--ok); }
.cov td.s-done_with_notes { background: var(--accent-soft); color: var(--accent); }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

.toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); background: var(--fg); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-size: 15px; z-index: 60; max-width: calc(100% - 32px);
  opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.on { opacity: 1; }

/* ── заглушка без доступа ───────────────────────────────────── */
body.landing .wrap { padding-top: 48px; }

@media (min-width: 760px) {
  .wrap { padding-top: 18px; }
  .blk { padding-right: 64px; }
}
@media print {
  .top, .plus, .blk-actions, .btn { display: none !important; }
}
