/* ===== Оболочка в духе Figma ===== */
:root {
  --canvas: #f5f5f5; --panel: #ffffff; --line: #e6e6e6; --text: #1e1e1e; --muted: #757575; --faint: #b3b3b3;
  --hover: #f2f2f2; --sel: #0d99ff; --sel-weak: #e5f4ff; --section: rgba(0, 0, 0, .035); --section-line: rgba(0, 0, 0, .07);
  --chip: #ffffff; --shadow: 0 2px 8px rgba(0, 0, 0, .08), 0 0 0 .5px rgba(0, 0, 0, .14); --input: #f5f5f5;
  --gold: #b08d3c; --gold-dark: #7d6224; --switch-off: #dcdce1; --track: #e3e3e8;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #1e1e1e; --panel: #2c2c2c; --line: #3a3a3a; --text: #f5f5f5; --muted: #a3a3a3; --faint: #7a7a7a;
    --hover: #383838; --sel: #0c8ce9; --sel-weak: #1d3a55; --section: rgba(255, 255, 255, .04); --section-line: rgba(255, 255, 255, .07);
    --chip: #383838; --shadow: 0 2px 10px rgba(0, 0, 0, .4), 0 0 0 .5px rgba(255, 255, 255, .12); --input: #383838;
    --switch-off: #4a4a50; --track: #4a4a50;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #1e1e1e; --panel: #2c2c2c; --line: #3a3a3a; --text: #f5f5f5; --muted: #a3a3a3; --faint: #7a7a7a;
  --hover: #383838; --sel: #0c8ce9; --sel-weak: #1d3a55; --section: rgba(255, 255, 255, .04); --section-line: rgba(255, 255, 255, .07);
  --chip: #383838; --shadow: 0 2px 10px rgba(0, 0, 0, .4), 0 0 0 .5px rgba(255, 255, 255, .12); --input: #383838;
  --switch-off: #4a4a50; --track: #4a4a50;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: var(--canvas); color: var(--text); font: 13px/1.4 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); }

#canvas { position: fixed; inset: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: default; }
#canvas.panning, body.tool-hand #canvas { cursor: grab; }
#canvas.panning:active { cursor: grabbing; }
body.tool-text #canvas .f { cursor: text; }
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; display: flex; flex-direction: column; gap: 220px; }
.row { display: flex; gap: 160px; align-items: flex-start; }
.section { position: relative; display: flex; gap: 120px; align-items: flex-start; padding: 110px 90px 90px; background: var(--section);
  border: calc(1px / var(--z)) solid var(--section-line); border-radius: 8px; }
.section.sel { border-color: var(--sel); box-shadow: 0 0 0 calc(1px / var(--z)) var(--sel); }
.sec-chip { position: absolute; left: 0; bottom: 100%; margin-bottom: min(calc(8px / var(--z)), 40px); display: flex; align-items: center;
  gap: .5em; font-size: min(calc(12px / var(--z)), 64px); font-weight: 500; padding: .35em .75em; border-radius: .5em; background: var(--chip);
  box-shadow: var(--shadow); white-space: nowrap; color: var(--text); }
.sec-chip i { width: .7em; height: .7em; border-radius: 50%; background: var(--accent); display: inline-block; }
.sec-chip small { color: var(--muted); font-weight: 400; }
.frame { position: relative; flex: none; }
.frame-label { position: absolute; left: 0; bottom: 100%; margin-bottom: calc(5px / var(--z)); font-size: calc(11.5px / var(--z)); white-space: nowrap;
  color: var(--muted); display: flex; gap: .8em; pointer-events: auto; max-width: calc(100% + 0px); }
.frame-label b { font-weight: 500; }
.frame-label span { color: var(--faint); }
.frame:hover .frame-label { color: var(--text); }
.frame.sel .frame-label, .frame.sel .frame-label span { color: var(--sel); }
.frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 6px 24px rgba(0, 0, 0, .08); }
.frame:hover::after { box-shadow: 0 0 0 calc(1.5px / var(--z)) var(--sel), 0 6px 24px rgba(0, 0, 0, .08); }
.frame.sel::after { box-shadow: 0 0 0 calc(2px / var(--z)) var(--sel), 0 6px 24px rgba(0, 0, 0, .1); }
.frame.sel .handle { position: absolute; width: calc(8px / var(--z)); height: calc(8px / var(--z)); background: #fff; border: calc(1.5px / var(--z)) solid var(--sel);
  z-index: 3; pointer-events: none; }
.frame:not(.sel) .handle { display: none; }
.handle.tl { left: calc(-4px / var(--z)); top: calc(-4px / var(--z)); } .handle.tr { right: calc(-4px / var(--z)); top: calc(-4px / var(--z)); }
.handle.bl { left: calc(-4px / var(--z)); bottom: calc(-4px / var(--z)); } .handle.br { right: calc(-4px / var(--z)); bottom: calc(-4px / var(--z)); }
.size-tag { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: calc(6px / var(--z)); background: var(--sel); color: #fff;
  font-size: calc(11px / var(--z)); padding: .15em .5em; border-radius: .3em; white-space: nowrap; pointer-events: none; }
.frame:not(.sel) .size-tag { display: none; }

/* поля текста */
.f { outline: none; border-radius: 2px; }
.f[contenteditable="true"] { user-select: text; -webkit-user-select: text; cursor: text; box-shadow: 0 0 0 1.5px var(--sel); background: rgba(13, 153, 255, .04); }
body.show-vars .doc:not(.exporting) .var { background: rgba(255, 205, 41, .32); box-shadow: 0 0 0 1px rgba(214, 160, 0, .25); border-radius: 2px; }
/* имя подписанта из шаблона — образец (sampleSigner в app.js): жёлтым только по тексту, без сдвигов раскладки оформлений */
body.show-vars .doc:not(.exporting) .f.smp::first-line { background: rgba(255, 205, 41, .32); }
body.tool-text .doc .f:hover { box-shadow: 0 0 0 1px rgba(13, 153, 255, .55); }

/* панели */
.panel { position: fixed; top: 12px; bottom: 12px; width: 252px; background: var(--panel); border-radius: 13px; box-shadow: var(--shadow); display: flex;
  flex-direction: column; overflow: hidden; z-index: 10; }
#left { left: 12px; }
#right { right: 12px; width: 268px; }
.p-head { padding: 12px 12px 10px; border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 10px; align-items: center; }
.brand img { width: 26px; height: 30px; object-fit: contain; }
.brand b { display: block; font-size: 13px; font-weight: 600; }
.brand span { display: block; color: var(--muted); font-size: 12px; }
.p-sec { padding: 8px 8px; border-bottom: 1px solid var(--line); }
.p-sec.grow { flex: 1; overflow: auto; border-bottom: 0; }
.p-title { font-size: 12px; font-weight: 600; padding: 4px 8px 6px; display: flex; justify-content: space-between; align-items: center; }
.p-title small { color: var(--muted); font-weight: 400; }
.page-btn { display: flex; width: 100%; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; text-align: left; }
.page-btn:hover { background: var(--hover); }
.page-btn.on { font-weight: 600; }
.page-btn.on::after { content: "✓"; margin-left: auto; color: var(--muted); }
.layer { display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 8px; border-radius: 6px; text-align: left; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-height: 28px; }
.layer:hover { background: var(--hover); }
.layer.on { background: var(--sel-weak); }
.layer .ic { width: 16px; flex: none; color: var(--muted); display: grid; place-items: center; }
.layer.sec { font-weight: 500; }
.layer.sec .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.layer.child { padding-left: 26px; }
.layer .lbl { overflow: hidden; text-overflow: ellipsis; }
.layer .tag { margin-left: auto; color: var(--muted); font-size: 11px; }
.caret { transition: transform .15s; }
.collapsed .caret { transform: rotate(-90deg); }
.layer-group.collapsed .layer.child { display: none; }

.r-tabs { display: flex; align-items: center; gap: 4px; padding: 10px 10px 8px 12px; border-bottom: 1px solid var(--line); }
.r-tabs b { font-weight: 600; }
.r-tabs .sp { flex: 1; }
.zoom-btn { padding: 4px 8px; border-radius: 6px; color: var(--muted); }
.zoom-btn:hover { background: var(--hover); color: var(--text); }
/* «Все на холсте» убрано: в редакторе масштаб холста в шапке свойств ни к чему — у листа свой масштаб сверху */
body.view-editor #zoom-btn { display: none; }
#props { flex: 1; overflow: auto; }
.r-sec { padding: 12px; border-bottom: 1px solid var(--line); }
.r-sec:last-child { border-bottom: 0; }
.r-h { font-size: 12px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.r-h small { font-weight: 400; color: var(--muted); }
.r-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.r-row label { width: 74px; flex: none; color: var(--muted); font-size: 12px; }
.r-in { flex: 1; min-width: 0; height: 30px; border: 1px solid transparent; background: var(--input); border-radius: 6px; padding: 0 8px; outline: none; }
.r-in:focus { border-color: var(--sel); background: var(--panel); }
textarea.r-in { height: auto; min-height: 52px; padding: 6px 8px; resize: vertical; line-height: 1.35; }
.seg { display: flex; background: var(--input); border-radius: 8px; padding: 2px; gap: 2px; flex: 1; }
.seg button { flex: 1; padding: 5px 6px; border-radius: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .15), 0 1px 2px rgba(0, 0, 0, .08); font-weight: 500; }
.chk { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; }
.chk input { accent-color: var(--sel); width: 15px; height: 15px; margin: 0; }
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel); font-weight: 500; font-size: 12px; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--sel); border-color: var(--sel); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.wide { width: 100%; }
.btn.danger { color: #e03e3e; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.btns .wide2 { grid-column: span 2; }
.link { color: var(--sel); font-size: 12px; font-weight: 500; padding: 0; }
.link:hover { text-decoration: underline; }
.btn:disabled { opacity: .45; cursor: default; }
.r-note { color: var(--muted); font-size: 12px; line-height: 1.45; }
.r-note kbd { font: 11px Inter, sans-serif; background: var(--input); border-radius: 4px; padding: 1px 5px; border: 1px solid var(--line); }
.doc-chip { display: flex; align-items: center; gap: 10px; }
.doc-chip img { width: 30px; height: 34px; object-fit: contain; }
.doc-chip b { display: block; font-size: 13px; }
.doc-chip span { color: var(--muted); font-size: 12px; }
.swatch { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); padding: 0; overflow: hidden; flex: none; }
.swatch input { width: 44px; height: 44px; margin: -7px; border: 0; padding: 0; cursor: pointer; background: none; }
.shortcuts { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 12px; color: var(--muted); }

#toolbar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 6px;
  background: var(--panel); border-radius: 13px; box-shadow: var(--shadow); z-index: 11; }
.tb { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--text); position: relative; }
.tb:hover { background: var(--hover); }
.tb.on { background: var(--sel); color: #fff; }
.tb svg { width: 18px; height: 18px; }
.tb-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
#toolbar .seg { flex: none; }
#toolbar .seg button { padding: 6px 10px; }
.tb[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #1e1e1e; color: #fff; font-size: 11px; padding: 4px 8px; border-radius: 5px; white-space: nowrap; pointer-events: none; }

.mob { display: none; }
#toast { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%) translateY(10px); background: #1e1e1e; color: #fff; padding: 8px 14px;
  border-radius: 8px; font-size: 12px; opacity: 0; transition: .2s; pointer-events: none; z-index: 30; max-width: 90vw; }
#toast.on { opacity: 1; transform: translateX(-50%); }
.menu { position: fixed; z-index: 40; background: #1e1e1e; color: #fff; border-radius: 8px; padding: 6px; min-width: 190px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.menu button { display: flex; justify-content: space-between; width: 100%; padding: 6px 10px; border-radius: 5px; font-size: 12px; gap: 16px; }
.menu button:hover { background: var(--sel); }
.menu button span { opacity: .6; }

@media (max-width: 899px) {
  .panel { display: none; top: 58px; bottom: 8px; width: min(320px, 88vw); }
  #left { left: 8px; } #right { right: 8px; width: min(320px, 88vw); }
  body.open-left #left, body.open-right #right { display: flex; z-index: 25; }
  .mob { display: grid; position: fixed; top: 10px; z-index: 12; width: 40px; height: 40px; border-radius: 12px; background: var(--panel);
    box-shadow: var(--shadow); place-items: center; }
  .mob svg { width: 20px; height: 20px; }
  #mob-left { left: 10px; } #mob-right { right: 10px; }
  #mob-title { left: 58px; right: 58px; width: auto; padding: 0 12px; font-weight: 600; display: flex; align-items: center; justify-content: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #toolbar { bottom: 10px; max-width: calc(100vw - 16px); overflow-x: auto; }
  #toolbar .hide-m { display: none; }
}

/* ===== Бланки ===== */
.doc { -webkit-print-color-adjust: exact; print-color-adjust: exact; position: relative; width: 794px; min-height: 1123px; background: #fff; color: #111; overflow: hidden;
  font-family: Tinos, "Times New Roman", Times, serif; --gold: #b08d3c; --gold-dark: #7d6224; }
.doc p { margin: 0; }
.doc ul { list-style: none; margin: 2px 0; padding: 0; }
.doc .tbl { width: 100%; border-collapse: collapse; text-indent: 0; text-align: left; }
.doc .var { border-radius: 2px; }
.doc .nw, .doc .date, .s-meta > span { white-space: nowrap; }

/* — строгое: как бланк Офиса Генпрокурора — */
.strict { padding: 66px 70px 80px 92px; font-size: 17.4px; line-height: 1.39; }
.strict .s-emblem { display: block; height: 108px; margin: 18px auto 30px; }
.strict .s-org { text-align: center; font-weight: 700; font-size: 21.5px; text-transform: uppercase; margin: 0 0 16px; line-height: 1.25; }
.strict .s-place { text-align: center; }
.strict .s-meta { display: flex; justify-content: space-between; gap: 20px; }
.strict .s-kind { text-align: center; font-weight: 700; font-size: 21.5px; text-transform: uppercase; }
.strict .s-title { text-align: center; margin: 2px 64px 34px; }
.strict .pre, .strict .body > p, .strict .body .pt, .strict .closing p { text-align: justify; text-indent: 1.25cm; }
.strict .verb { text-align: center; font-weight: 700; letter-spacing: .34em; margin: 26px 0 22px; padding-left: .34em; }
.strict .body { counter-reset: pt; }
.strict .body .pt { counter-increment: pt; }
.strict .body .pt::before { content: counter(pt) ". "; }
.strict .body ul { text-indent: 0; padding-left: 1.25cm; }
.strict .body li { padding-left: 1.1em; text-indent: -1.1em; text-align: justify; }
.strict .body li::before { content: "— "; }
.strict .tbl { margin: 10px 0 8px; font-size: 16px; line-height: 1.3; }
.strict .tbl th, .strict .tbl td { border: 1px solid #222; padding: 5px 10px; }
.strict .tbl th { font-weight: 700; background: #f2f2f2; }
.strict .closing { margin-top: 2px; }
.strict .s-sign { display: grid; grid-template-columns: minmax(0, 1fr) 190px auto; align-items: center; gap: 14px; margin-top: 44px; }
.strict .s-sign .name { text-align: right; white-space: nowrap; }
.sig { position: relative; display: flex; align-items: center; justify-content: center; height: 70px; }
.sig-font { font-size: 40px; line-height: 1; color: #1c2a5c; white-space: nowrap; transform: rotate(-4deg); display: inline-block; letter-spacing: 0; }
.sig-img { max-height: 84px; max-width: 220px; object-fit: contain; }
.stamp { position: absolute; width: 150px; height: 150px; left: -70px; top: -42px; transform: rotate(-9deg); opacity: .82; pointer-events: none; mix-blend-mode: multiply; }

/* — парадное — */
.gala { display: flex; flex-direction: column; padding: 54px 70px 40px; background: #fffdf7; font-size: 16.2px; line-height: 1.45; }
.gala::before { content: ""; position: absolute; inset: 16px; border: 2px solid var(--accent); pointer-events: none; z-index: 2; }
.gala::after { content: ""; position: absolute; inset: 22px; border: 1px solid var(--gold); pointer-events: none; z-index: 2; }
.gala .g-corner { position: absolute; width: 26px; height: 26px; z-index: 3; color: var(--gold); background: #fffdf7; display: grid; place-items: center;
  font-size: 14px; line-height: 1; }
.gala .g-corner.c1 { left: 6px; top: 6px; } .gala .g-corner.c2 { right: 6px; top: 6px; }
.gala .g-corner.c3 { left: 6px; bottom: 6px; } .gala .g-corner.c4 { right: 6px; bottom: 6px; }
.gala .g-wm { position: absolute; left: 50%; top: 54%; width: 470px; transform: translate(-50%, -50%); opacity: .05; pointer-events: none; }
.gala > * { position: relative; z-index: 1; }
.gala .g-head { text-align: center; }
.gala .ring { display: block; width: 122px; height: 122px; margin: 0 auto 10px; }
.gala .g-state { font-family: "Cormorant Garamond", serif; font-weight: 600; font-size: 13px; letter-spacing: .42em; color: var(--gold-dark); padding-left: .42em; }
.gala .g-org { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 25px; line-height: 1.12; color: var(--accent); text-transform: uppercase;
  letter-spacing: .035em; margin: 6px 26px 3px; }
.gala .g-en { font-family: "Cormorant Garamond", serif; font-style: italic; font-weight: 500; font-size: 16px; color: #6d6455; }
.gala .g-rule { display: flex; align-items: center; gap: 12px; color: var(--gold); margin: 14px 0 10px; font-size: 13px; }
.gala .g-rule::before, .gala .g-rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.gala .g-rule::after { background: linear-gradient(270deg, transparent, var(--gold)); }
.gala .g-meta { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 12px; font-family: "Cormorant Garamond", serif;
  font-weight: 600; font-size: 15.5px; color: #3b362d; letter-spacing: .04em; }
.gala .g-meta > :first-child { text-align: left; } .gala .g-meta > :last-child { text-align: right; }
.gala .g-meta .g-place { font-weight: 500; font-style: italic; color: #6d6455; font-size: 14.5px; }
.gala .g-kind { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 40px; letter-spacing: .28em; padding-left: .28em; text-align: center;
  color: var(--accent); margin-top: 22px; line-height: 1.1; }
.gala .g-title { text-align: center; font-weight: 700; font-size: 16.5px; text-transform: uppercase; letter-spacing: .03em; line-height: 1.35; margin: 8px 30px 0; }
.gala .g-stars { text-align: center; color: var(--gold); letter-spacing: .6em; padding-left: .6em; font-size: 12px; margin: 12px 0 18px; }
.gala .pre { text-align: justify; }
.gala .verb { display: flex; align-items: center; justify-content: center; gap: 14px; font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 20px;
  letter-spacing: .3em; color: var(--accent); margin: 20px 0 16px; }
.gala .verb::before, .gala .verb::after { content: "★"; font-size: 12px; color: var(--gold); letter-spacing: 0; }
.gala .body { counter-reset: pt; }
.gala .body .pt, .gala .body > p { counter-increment: pt; position: relative; padding-left: 58px; margin: 0 0 11px; text-align: justify; min-height: 26px; }
.gala .body .pt::before, .gala .body > p::before { content: counter(pt, upper-roman) "."; position: absolute; left: 0; top: -1px; bottom: 0; width: 44px;
  padding-right: 9px; text-align: right; border-right: 1.5px solid var(--gold); font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 18px;
  color: var(--accent); }
.gala .body ul { margin: 3px 0 2px; }
.gala .body li { padding-left: 1.1em; text-indent: -1.1em; }
.gala .body li::before { content: "◆ "; color: var(--gold); font-size: .7em; vertical-align: .15em; }
.gala .tbl { margin: 10px 0 6px; font-size: 15px; line-height: 1.3; }
.gala .tbl th { background: var(--accent); color: #fff; font-family: "Cormorant Garamond", serif; font-weight: 700; letter-spacing: .06em; font-size: 15.5px;
  padding: 6px 10px; border: 1px solid var(--accent); }
.gala .tbl td { border: 1px solid #d9cfb8; padding: 5px 10px; background: rgba(255, 255, 255, .7); }
.gala .closing { margin-top: 4px; }
.gala .closing p { text-align: justify; margin-bottom: 4px; }
.gala .g-foot { margin-top: auto; padding-top: 34px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.gala .g-seal svg { width: 158px; height: 158px; display: block; }
.gala .g-sign { width: 330px; text-align: center; margin-left: auto; }
.gala .g-sign .sig { height: 72px; align-items: flex-end; }
.gala .g-sign .s-line { border-top: 1.5px solid #2a2a2a; margin-top: 2px; }
.gala .g-sign .name { font-weight: 700; margin-top: 6px; }
.gala .g-sign .role { font-style: italic; font-size: 14px; line-height: 1.3; color: #4a4438; }
.gala .g-capitol { text-align: center; margin-top: 10px; }
.gala .g-capitol img { height: 86px; display: block; margin: 0 auto; opacity: .9; }
.gala .g-capitol span { display: block; font-family: "Cormorant Garamond", serif; font-weight: 600; letter-spacing: .34em; font-size: 11px; color: #5c5446; margin-top: 3px; }
.gala .g-band { margin: 12px -48px 0; background: var(--accent); color: #f2e6c3; font-family: "Cormorant Garamond", serif; font-weight: 600; font-size: 11px;
  letter-spacing: .2em; text-align: center; padding: 8px 10px; }

/* печать / PDF */
body.print { overflow: visible; height: auto; background: #fff; }
body.print .doc { margin: 0 auto; }
body.print .var { background: none !important; box-shadow: none !important; }
body.print .f.smp::first-line { background: none !important; }
@media print { body.print { margin: 0; } }

/* страница «Гербы и печати» */
.kit { width: 940px; background: #fff; color: #1b1b1b; padding: 28px; font-family: Inter, sans-serif; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.kit h3 { grid-column: span 2; margin: 0 0 4px; font-family: "Cormorant Garamond", serif; font-size: 30px; }
.kit-card { border: 1px solid #ececec; border-radius: 10px; padding: 14px; }
.kit-card .kn { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.kit-card .kn i { width: 12px; height: 12px; border-radius: 3px; background: var(--accent); }
.kit-card .kn small { color: #888; font-weight: 400; margin-left: auto; }
.kit-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.kit-row .asset { width: 82px; height: 82px; display: grid; place-items: center; border-radius: 8px; cursor: pointer; }
.kit-row .asset:hover { background: #f4f8ff; box-shadow: 0 0 0 1.5px #0d99ff; }
.kit-row .asset img { max-width: 70px; max-height: 76px; }
.kit-row .asset svg { width: 78px; height: 78px; }

/* ===== v2: раскладка, выбор оформления ===== */
.section { flex-wrap: wrap; row-gap: 170px; max-width: 4640px; }
.section.wrap4 { max-width: 3730px; }
.vgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.vgrid button { padding: 7px 9px; border-radius: 6px; background: var(--input); text-align: left; font-size: 12px; color: var(--text); }
.vgrid button:hover { box-shadow: inset 0 0 0 1px var(--line); }
.vgrid button.on { background: var(--sel-weak); box-shadow: inset 0 0 0 1.5px var(--sel); font-weight: 500; }
.tb-wide { height: 34px; padding: 0 10px; border-radius: 8px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tb-wide:hover { background: var(--hover); }
.tb-wide span { color: var(--muted); }
.tb-wide b { font-weight: 500; }
.btn.wrap { white-space: normal; height: auto; min-height: 30px; padding: 6px 10px; line-height: 1.3; }
.page-btn small { color: var(--muted); font-weight: 400; }

/* ===== Американское (Executive Order) ===== */
.doc.exec { display: flex; flex-direction: column; padding: 62px 78px 46px; font-size: 16.2px; line-height: 1.45; }
.exec::before { content: ""; position: absolute; inset: 22px; border: 2.5px solid var(--accent); pointer-events: none; }
.exec .e-head { text-align: center; }
.exec .ring { display: block; width: 136px; height: 136px; margin: 0 auto 16px; }
.exec .e-state { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 40px; letter-spacing: .12em; color: var(--accent); line-height: 1; }
.exec .e-state i { font-weight: 600; letter-spacing: 0; font-size: .9em; }
.exec .e-office { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 17px; letter-spacing: .2em; color: var(--accent); margin-top: 10px; }
.exec .e-org { font-size: 12.5px; letter-spacing: .14em; color: #6b6255; margin-top: 4px; }
.exec .e-no { text-align: center; font-weight: 700; font-size: 20px; margin-top: 28px; letter-spacing: .03em; }
.exec .e-no .f, .exec .e-date .f, .exec .e-who > * { display: inline; }
.exec .e-title { text-align: center; font-weight: 700; margin: 4px 40px 0; }
.exec .e-date { text-align: center; font-style: italic; color: #555; font-size: 15px; margin: 6px 0 26px; }
.exec .pre { text-align: justify; }
.exec .verb { font-weight: 700; margin: 22px 0 14px; letter-spacing: .02em; }
.exec .verb::before { content: "НАСТОЯЩИМ "; }
.exec .body { counter-reset: pt; }
.exec .body .pt, .exec .body > p { counter-increment: pt; margin: 0 0 12px; text-align: justify; }
.exec .body .pt::before, .exec .body > p::before { content: "Sec. " counter(pt) ". "; font-weight: 700; }
.exec .body ul { margin: 4px 0 0 26px; }
.exec .body li { padding-left: 1em; text-indent: -1em; }
.exec .body li::before { content: "• "; }
.exec .tbl { margin: 8px 0; font-size: 15px; }
.exec .tbl th, .exec .tbl td { border: 1px solid #bdb6a8; padding: 4px 9px; }
.exec .tbl th { background: #f4f1ea; }
.exec .closing p { margin-top: 4px; text-align: justify; }
.exec .e-foot { margin-top: auto; padding-top: 40px; display: grid; grid-template-columns: 200px 1fr; gap: 34px; align-items: end; }
.exec .e-seal svg { width: 196px; height: 196px; display: block; }
.exec .e-witness p { font-size: 16.5px; line-height: 1.5; margin: 0 0 12px; text-align: justify; }
.exec .e-witness .sig { justify-content: flex-start; height: 66px; padding-left: 12px; }
.exec .e-witness .s-line { border-top: 2px solid #111; width: 94%; }
.exec .e-who { font-style: italic; margin-top: 6px; }
.exec .e-cap { text-align: center; margin-top: 16px; }
.exec .e-cap img { height: 66px; display: block; margin: 0 auto 2px; }
.exec .e-cap span { font-family: "Cormorant Garamond", serif; font-variant: small-caps; letter-spacing: .08em; font-size: 16px; }

/* ===== Ведомственное (панель с QR) ===== */
.doc.modern { display: flex; flex-direction: column; background: #fbfcfe; font-family: Inter, sans-serif; font-size: 13.6px; line-height: 1.5; color: #1d2433;
  padding: 40px 44px 12px; }
.modern::before { content: ""; position: absolute; inset: 12px; border: 1px solid #cfd8e6; pointer-events: none; z-index: 3; }
.modern > * { position: relative; }
.modern .md-dome { position: absolute; right: 22px; top: 18px; width: 236px; opacity: .6; pointer-events: none; }
.modern .md-head { display: flex; align-items: center; gap: 18px; margin-right: 230px; }
.modern .ring { width: 112px; height: 112px; flex: none; }
.modern .md-state { font-family: "Cormorant Garamond", serif; font-weight: 600; font-size: 20px; letter-spacing: .03em; color: var(--accent); }
.modern .md-office { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 29px; line-height: 1.05; color: var(--accent); }
.modern .md-dept { font-family: "Cormorant Garamond", serif; font-weight: 600; font-size: 15px; letter-spacing: .1em; color: var(--gold-dark); margin-top: 4px; }
.modern .md-no { display: flex; align-items: baseline; gap: 14px; margin: 16px 244px 0 0; padding: 9px 0; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); }
.modern .md-kindsm { font-weight: 700; font-size: 11.5px; letter-spacing: .14em; color: var(--accent); text-transform: uppercase; }
.modern .md-num { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 23px; line-height: 1; }
.modern .md-num small { font-size: 14px; }
.modern .md-rule { flex: 1; }
.modern .md-no .date { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 15px; letter-spacing: .03em; }
.modern .md-grid { display: grid; grid-template-columns: minmax(0, 1fr) 196px; gap: 26px; margin-top: 8px; }
.modern .md-orn { display: flex; align-items: center; gap: 10px; color: var(--gold); font-size: 13px; margin: 10px 0 8px; justify-content: center; }
.modern .md-orn::before, .modern .md-orn::after { content: ""; flex: 1; height: 1.5px; background: var(--gold); opacity: .8; }
.modern .md-orn.three { letter-spacing: .4em; margin: 12px 30px 16px; }
.modern .md-kind { text-align: center; font-weight: 800; font-size: 21px; letter-spacing: .1em; color: var(--accent); text-transform: uppercase; }
.modern .md-title { text-align: center; font-weight: 800; font-size: 18.5px; line-height: 1.25; letter-spacing: .03em; color: var(--accent); text-transform: uppercase; margin-top: 4px; }
.modern .pre { text-align: justify; }
.modern .verb { display: flex; align-items: center; justify-content: center; gap: 14px; font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 25px;
  letter-spacing: .06em; margin: 16px 0 14px; }
.modern .verb::before, .modern .verb::after { content: "★ ★"; font-size: 14px; color: var(--accent); letter-spacing: .3em; }
.modern .body { counter-reset: pt; }
.modern .body .pt, .modern .body > p { counter-increment: pt; position: relative; padding-left: 88px; margin: 0 0 14px; min-height: 42px; text-align: justify; }
.modern .body .pt::before, .modern .body > p::before { content: "SECTION\A" counter(pt, upper-roman) "."; white-space: pre; position: absolute; left: 0; top: 0; bottom: 0;
  width: 74px; padding-right: 8px; text-align: center; border-right: 1.5px solid #8b93a6; font-family: Tinos, serif; font-weight: 700; font-size: 14px; line-height: 1.3; color: #1d2433; }
.modern .body ul { margin: 2px 0; }
.modern .body li { padding-left: 1em; text-indent: -1em; }
.modern .body li::before { content: "• "; color: var(--accent); }
.modern .tbl { margin: 8px 0; font-size: 12.8px; }
.modern .tbl th { background: var(--accent); color: #fff; font-weight: 600; padding: 5px 8px; }
.modern .tbl td { border-bottom: 1px solid #dfe5ef; padding: 4px 8px; }
.modern .closing p { margin-top: 4px; }
.modern .md-side { align-self: start; margin-top: 128px; background: color-mix(in srgb, var(--accent) 7%, #fff); border: 1px solid color-mix(in srgb, var(--accent) 22%, #fff);
  padding: 20px 14px 18px; text-align: center; }
.modern .md-side-ic { width: 44px; display: block; margin: 0 auto 10px; }
.modern .md-auth { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; color: #2b3550; }
.modern .md-auth b { display: block; font-size: 13px; font-weight: 800; color: var(--accent); letter-spacing: .05em; line-height: 1.25; margin-top: 4px; }
.modern .md-gr { width: 40px; height: 2px; background: var(--gold); margin: 14px auto; }
.modern .qr { width: 108px; height: 108px; display: block; margin: 0 auto; }
.modern dl { margin: 0; }
.modern dt { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; color: var(--accent); margin-top: 12px; }
.modern dd { margin: 3px 0 0; font-size: 11px; letter-spacing: .05em; color: #3a4256; }
.modern .md-motto { margin-top: 16px; border-top: 2px solid var(--accent); padding-top: 10px; font-size: 10px; font-weight: 600; letter-spacing: .12em; }
.modern .md-motto i, .modern .md-band i { color: var(--gold); font-style: normal; }
.modern .md-foot { margin: 30px -32px 0; padding: 16px 32px; background: color-mix(in srgb, var(--accent) 9%, #fff); display: flex; align-items: center; gap: 22px; }
.modern .md-seal svg { width: 134px; height: 134px; display: block; }
.modern .md-sign { flex: 1; text-align: center; padding-right: 18px; border-right: 1px solid color-mix(in srgb, var(--accent) 25%, #fff); }
.modern .md-sign .sig { height: 60px; }
.modern .md-sign .name { font-family: "Cormorant Garamond", serif; font-weight: 700; font-style: italic; font-size: 19px; color: var(--accent); }
.modern .md-sign .role { font-family: "Cormorant Garamond", serif; font-style: italic; font-size: 15px; color: #5a6276; }
.modern .md-cap { width: 220px; opacity: .55; }
.modern .md-band { margin: 0 -32px; background: var(--accent); color: #e8ecf5; font-family: Tinos, serif; font-size: 9.5px; letter-spacing: .1em; text-align: center; padding: 10px 14px; }

/* ===== Гербовая бумага ===== */
.doc.bond { display: flex; flex-direction: column; background: #fbf6e6; padding: 90px 96px 84px; font-size: 15.6px; line-height: 1.45; color: #2a261d; }
.bond .b-band { position: absolute; inset: 18px; background-color: #f3ead0; border: 1.5px solid var(--accent); }
.bond .b-paper { position: absolute; inset: 50px; background-color: #fbf6e6; border: 1px solid var(--gold); box-shadow: 0 0 0 4px #fbf6e6, 0 0 0 5px var(--accent); }
.bond .b-ros { position: absolute; width: 64px; height: 64px; z-index: 1; }
.bond .r1 { left: 2px; top: 2px; } .bond .r2 { right: 2px; top: 2px; } .bond .r3 { left: 2px; bottom: 2px; } .bond .r4 { right: 2px; bottom: 2px; }
.bond .b-wm { position: absolute; left: 50%; top: 56%; width: 430px; transform: translate(-50%, -50%); opacity: .06; z-index: 1; }
.bond > :not(.b-band):not(.b-paper):not(.b-ros):not(.b-wm):not(.fx):not(.st):not(.wm-x):not(.pg-no) { position: relative; z-index: 2; }
.bond .b-head { display: grid; grid-template-columns: 1fr 128px 1fr; align-items: center; gap: 14px; }
.bond .b-head svg { width: 128px; height: 128px; display: block; }
.bond .b-side { font-family: "Cormorant Garamond", serif; font-weight: 600; font-size: 13.5px; letter-spacing: .16em; color: #5d5440; text-align: center; line-height: 1.35; }
.bond .b-org { text-align: center; font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 15px; letter-spacing: .1em; color: var(--accent); margin-top: 14px; }
.bond .b-kind { text-align: center; font-family: "Cormorant Garamond", serif; font-weight: 500; font-size: 34px; letter-spacing: .07em; color: var(--accent); margin-top: 6px; line-height: 1.15; }
.bond .b-kind .f, .bond .b-place .f { display: inline; }
.bond .b-title { text-align: center; font-weight: 700; margin: 4px 30px 0; }
.bond .b-place { text-align: center; font-size: 14px; color: #6a6150; font-style: italic; margin: 6px 0 20px; }
.bond .pre { text-align: center; font-size: 15px; margin: 0 16px; }
.bond .verb { font-weight: 700; letter-spacing: .1em; margin: 18px 0 8px; }
.bond .body { counter-reset: pt; }
.bond .body .pt, .bond .body > p { counter-increment: pt; position: relative; padding-left: 26px; margin-bottom: 6px; text-align: justify; }
.bond .body .pt::before, .bond .body > p::before { content: counter(pt) "."; position: absolute; left: 0; font-weight: 700; color: var(--accent); }
.bond .body li { padding-left: 1em; text-indent: -1em; }
.bond .body li::before { content: "— "; }
.bond .tbl { margin: 8px 0; font-size: 14.5px; }
.bond .tbl th { background: color-mix(in srgb, var(--accent) 12%, #fbf6e6); border: 1px solid #cdbf98; padding: 4px 8px; }
.bond .tbl td { border: 1px solid #d8cba6; padding: 4px 8px; }
.bond .closing p { margin-top: 4px; }
.bond .b-foot { margin-top: auto; padding-top: 30px; display: grid; grid-template-columns: 1fr 160px 1fr; align-items: end; gap: 10px; }
.bond .b-sign .sig { justify-content: flex-start; height: 62px; }
.bond .b-sign .s-line { border-top: 1.5px solid #3a3326; width: 220px; }
.bond .b-sign .name { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 20px; margin-top: 4px; }
.bond .b-sign .role { font-style: italic; font-size: 13.5px; line-height: 1.3; }
.bond .b-cap { width: 160px; opacity: .75; }
.bond .b-stamp { text-align: right; }
.bond .b-stamp svg { width: 126px; height: 126px; transform: rotate(-10deg); display: inline-block; }

/* ===== Служебное (машинопись) ===== */
.doc.memo { display: flex; flex-direction: column; font-family: Cousine, "Courier New", monospace; font-size: 14px; line-height: 1.55; padding: 0 64px; color: #1a1a1a; }
.memo .mm-bar { margin: 0 -64px; background: #a5221c; color: #fff; text-align: center; font-weight: 700; letter-spacing: .3em; font-size: 13px; padding: 7px 10px; }
.memo .mm-head { display: flex; align-items: center; gap: 16px; padding: 28px 0 16px; border-bottom: 3px double #1a1a1a; }
.memo .mm-head img { width: 60px; }
.memo .mm-names { flex: 1; }
.memo .mm-org { font-weight: 700; font-size: 15px; line-height: 1.3; }
.memo .mm-en { font-size: 11px; letter-spacing: .06em; color: #555; margin-top: 3px; }
.memo .mm-copy { align-self: flex-start; border: 1.5px solid #1a1a1a; padding: 2px 8px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.memo .mm-meta { width: 100%; border-collapse: collapse; margin: 14px 0 18px; }
.memo .mm-meta th { text-align: left; width: 118px; font-weight: 700; vertical-align: top; padding: 3px 0; font-size: 12.5px; letter-spacing: .06em; }
.memo .mm-meta td { padding: 3px 0; border-bottom: 1px dotted #8a8a8a; }
.memo .mm-t { font-weight: 700; }
.memo .verb { font-weight: 700; margin: 14px 0 8px; letter-spacing: .12em; }
.memo .body { counter-reset: pt; }
.memo .body .pt, .memo .body > p { counter-increment: pt; padding-left: 3ch; text-indent: -3ch; margin-bottom: 6px; }
.memo .body .pt::before, .memo .body > p::before { content: counter(pt) ". "; font-weight: 700; }
.memo .body ul { margin: 2px 0; text-indent: 0; }
.memo .body li { padding-left: 2ch; text-indent: -2ch; }
.memo .body li::before { content: "- "; }
.memo .tbl { margin: 6px 0; text-indent: 0; font-size: 12.5px; }
.memo .tbl th, .memo .tbl td { border: 1px solid #1a1a1a; padding: 2px 7px; }
.memo .tbl th { background: #ececec; }
.memo .closing { margin-top: 8px; }
.memo .mm-sign { position: relative; margin-top: 34px; }
.memo .mm-sign .role { font-weight: 700; font-size: 13px; max-width: 62%; }
.memo .mm-sigrow { display: flex; align-items: flex-end; gap: 16px; margin-top: 4px; }
.memo .mm-line { width: 220px; border-bottom: 1.5px solid #1a1a1a; display: flex; justify-content: center; align-items: flex-end; height: 58px; }
.memo .mm-sigrow .name { font-weight: 700; }
.memo .mm-stamp { position: absolute; right: 6px; top: -12px; transform: rotate(-8deg); border: 3px double #b3261e; color: #b3261e; padding: 6px 16px;
  text-align: center; opacity: .86; mix-blend-mode: multiply; border-radius: 4px; }
.memo .mm-stamp b { display: block; font-size: 22px; letter-spacing: .14em; }
.memo .mm-stamp span { font-size: 12px; letter-spacing: .08em; font-weight: 700; }
.memo .mm-foot { margin-top: auto; padding: 30px 0 10px; display: flex; justify-content: space-between; font-size: 11.5px; color: #555; }

/* ===== Вестник ===== */
.doc.gazette { display: flex; flex-direction: column; background: #fcfbf7; padding: 34px 54px 30px; font-size: 14.6px; line-height: 1.45; color: #1c1b19; }
.gazette .z-top { display: flex; justify-content: space-between; font-family: Inter, sans-serif; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: #6b665c; border-bottom: 1px solid #1c1b19; padding-bottom: 6px; }
.gazette .z-mast { text-align: center; font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 88px; line-height: .95; letter-spacing: .05em;
  text-transform: uppercase; margin-top: 12px; color: #141310; padding-left: .05em; }
.gazette .z-sub { text-align: center; font-family: "Cormorant Garamond", serif; font-weight: 600; font-size: 17px; letter-spacing: .34em; text-transform: uppercase;
  margin-top: 4px; padding-left: .34em; }
.gazette .z-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 12px; padding: 6px 0; border-top: 3px solid #141310;
  border-bottom: 1px solid #141310; font-family: Inter, sans-serif; font-size: 11.5px; font-weight: 500; letter-spacing: .03em; }
.gazette .z-line .f { display: inline; }
.gazette .z-kicker { display: flex; align-items: center; gap: 10px; margin-top: 24px; color: var(--accent); }
.gazette .z-kicker img { width: 30px; }
.gazette .z-org { font-family: Inter, sans-serif; font-weight: 700; font-size: 12px; letter-spacing: .08em; }
.gazette .z-hl { margin-top: 8px; border-bottom: 1px solid #c9c3b4; padding-bottom: 14px; }
.gazette .z-kind { font-family: Inter, sans-serif; font-weight: 700; font-size: 12px; letter-spacing: .18em; color: #8a1c1c; text-transform: uppercase; }
.gazette .z-title { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 34px; line-height: 1.08; margin-top: 4px; }
.gazette .z-cols { column-count: 2; column-gap: 30px; column-rule: 1px solid #d8d2c3; margin: 18px 0 26px; text-align: justify; }
.gazette .pre::first-letter { float: left; font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 60px; line-height: .78; padding: 6px 8px 0 0; color: var(--accent); }
.gazette .verb { font-weight: 700; letter-spacing: .12em; margin: 10px 0 6px; text-align: center; }
.gazette .body { counter-reset: pt; }
.gazette .body .pt, .gazette .body > p { counter-increment: pt; margin-bottom: 6px; }
.gazette .body .pt::before, .gazette .body > p::before { content: counter(pt) ". "; font-weight: 700; }
.gazette .body li { padding-left: 1em; text-indent: -1em; text-align: left; }
.gazette .body li::before { content: "— "; }
.gazette .tbl { font-size: 12.3px; margin: 6px 0; break-inside: avoid; }
.gazette .tbl th, .gazette .tbl td { border-bottom: 1px solid #c9c3b4; padding: 3px 4px; text-align: left; }
.gazette .tbl th { font-family: Inter, sans-serif; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.gazette .closing p { margin-top: 4px; }
.gazette .z-sign { break-inside: avoid; margin-top: 18px; text-align: right; }
.gazette .z-sign .sig { justify-content: flex-end; height: 54px; }
.gazette .z-sign .role { font-style: italic; font-size: 13px; text-align: right; }
.gazette .z-sign .name { font-weight: 700; }
.gazette .z-foot { margin-top: auto; padding-top: 10px; border-top: 3px solid #141310; display: flex; justify-content: space-between; gap: 16px; font-family: Inter, sans-serif;
  font-size: 10.5px; letter-spacing: .04em; color: #6b665c; }
/* в колонках «Вестника» блоки не рвём: выгрузка PNG копирует высоты блоков, разорванный блок наезжает на соседний */
.gazette .z-cols .pt, .gazette .z-cols .pre, .gazette .z-cols p, .gazette .z-cols .verb, .gazette .z-cols li, .gazette .z-cols .tbl { break-inside: avoid; }
.gazette .z-cols-export { display: grid; grid-template-columns: 1fr 1fr; column-gap: 30px; margin: 18px 0 26px; text-align: justify; counter-reset: pt; }
.gazette .z-cols-export > div + div { border-left: 1px solid #d8d2c3; padding-left: 15px; margin-left: -15px; }
.gazette .z-cols-export .body { counter-reset: none; }

/* ===== v3: возможности ===== */
.r-in.search { width: calc(100% - 8px); margin: 0 4px 6px; height: 28px; font-size: 12px; }
.layer-group.searching.collapsed .layer.child { display: flex; }
.r-row .seg { flex: 1; }
.fill { max-height: 320px; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.fill-row { margin-bottom: 6px; }
.fill-row label { display: block; font-size: 11px; color: var(--muted); margin: 0 0 2px 2px; }
.fill .r-in { width: 100%; }
#fmt { position: fixed; z-index: 20; display: flex; align-items: center; gap: 2px; padding: 4px; background: #1e1e1e; color: #fff; border-radius: 9px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3); font-size: 12px; max-width: calc(100vw - 16px); overflow-x: auto; }
#fmt[hidden], #fmt [hidden] { display: none; }
#fmt button { height: 28px; min-width: 28px; padding: 0 8px; border-radius: 6px; white-space: nowrap; color: #fff; }
#fmt button:hover { background: #0d99ff; }
#fmt .fs { width: 1px; height: 18px; background: #444; margin: 0 3px; }
.modal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .42); display: grid; place-items: center; padding: 16px; }
.modal { width: min(580px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.modal .m-h { padding: 14px 16px; font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--line); }
.modal .m-b { padding: 14px 16px; }
.modal .m-f { padding: 12px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.sigpad { width: 100%; aspect-ratio: 1200 / 420; background: #fff; border: 1px dashed #b9b9b9; border-radius: 10px; touch-action: none; cursor: crosshair;
  background-image: linear-gradient(transparent calc(100% - 26%), #e6e6e6 calc(100% - 26%), #e6e6e6 calc(100% - 25.6%), transparent calc(100% - 25.6%)); }
.mform { display: grid; gap: 10px; }
.mform label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.mform label.chk { display: flex; font-size: 13px; color: var(--text); }
.mform [hidden] { display: none; }
.mform .r-in { height: 32px; }
.mform input[type="color"] { padding: 2px 4px; }
.mrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-em-h { font-size: 12px; color: var(--muted); }
.m-em { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.m-em label { display: block; cursor: pointer; }
.m-em input { position: absolute; opacity: 0; pointer-events: none; }
.m-em img { width: 46px; height: 52px; object-fit: contain; padding: 4px; border-radius: 8px; border: 1.5px solid transparent; background: #fff; }
.m-em input:checked + img { border-color: var(--sel); box-shadow: 0 0 0 2px var(--sel-weak); }

/* отметки на бланке */
.doc .st { position: absolute; z-index: 6; pointer-events: none; mix-blend-mode: multiply; }
.doc .st-draft { left: 50%; top: 46%; transform: translate(-50%, -50%) rotate(-32deg); font-family: Inter, sans-serif; font-weight: 800; font-size: 150px;
  letter-spacing: .12em; color: rgba(120, 120, 120, .14); white-space: nowrap; }
.doc .st-revoked, .doc .st-copy { right: 54px; top: 46px; transform: rotate(-8deg); border: 4px double #b3261e; color: #b3261e; padding: 8px 18px; text-align: center;
  border-radius: 6px; opacity: .88; font-family: Inter, sans-serif; background: rgba(255, 255, 255, .35); }
.doc .st-copy { border-color: #2741a6; color: #2741a6; }
.doc .st b { display: block; font-size: 24px; font-weight: 800; letter-spacing: .1em; }
.doc .st span { font-size: 13px; font-weight: 700; letter-spacing: .08em; }
/* «Согласовано» */
.doc .visa { margin-top: 18px; font-size: .92em; line-height: 1.4; break-inside: avoid; }
.doc .visa-h { font-weight: 700; letter-spacing: .08em; margin-bottom: 2px; }
.doc .visa-f p { margin: 2px 0; text-indent: 0; }

/* реестр */
.doc.reg { width: 1123px; min-height: 794px; padding: 46px 52px; font-family: Inter, sans-serif; font-size: 13px; color: #1b1b1b; }
.reg .rg-head { display: flex; align-items: center; gap: 16px; border-bottom: 2px solid #1c2f5a; padding-bottom: 14px; margin-bottom: 18px; }
.reg .rg-head img { width: 54px; }
.reg h2 { margin: 0; font-family: "Cormorant Garamond", serif; font-size: 32px; color: #1c2f5a; }
.reg .rg-head p { margin: 2px 0 0; color: #666; }
.reg table.rg { width: 100%; border-collapse: collapse; }
.reg .rg th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #555; padding: 8px 10px; border-bottom: 1.5px solid #222; }
.reg .rg td { padding: 9px 10px; border-bottom: 1px solid #e5e5e5; vertical-align: top; }
.reg .rg tr[data-goto] { cursor: pointer; }
.reg .rg tr[data-goto]:hover td { background: #f2f8ff; }
.reg .rg-st { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; background: #eee; }
.reg .rg-st.draft { background: #f1f1f1; color: #555; } .reg .rg-st.revoked { background: #fde8e7; color: #a5221c; } .reg .rg-st.copy { background: #e8edfb; color: #2741a6; }
.reg .rg-empty { color: #777; font-size: 15px; margin-top: 40px; text-align: center; }

/* ===== v4: дизайн и правка ===== */
details.r-sec > summary { list-style: none; cursor: pointer; margin-bottom: 0; user-select: none; }
details.r-sec > summary::-webkit-details-marker { display: none; }
details.r-sec > summary::before { content: "▸"; color: var(--muted); font-size: 10px; margin-right: 6px; transition: transform .15s; display: inline-block; }
details.r-sec[open] > summary::before { transform: rotate(90deg); }
details.r-sec[open] > summary { margin-bottom: 8px; }
details.r-sec > summary small { margin-left: auto; }
.r-row.stack { flex-direction: column; align-items: stretch; gap: 4px; }
.r-row.stack label { width: auto; }
.r-row .seg button { padding: 5px 4px; font-size: 11.5px; }
.rng { flex: 1; min-width: 0; accent-color: var(--sel); }
.rv { width: 40px; text-align: right; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.sws { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.sw { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); background: var(--input); font-size: 11px; color: var(--muted); padding: 0; display: grid; place-items: center; position: relative; overflow: hidden; cursor: pointer; }
.sw.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--sel); }
.sw.pick { background: conic-gradient(#e33, #ec3, #3c6, #3ae, #93e, #e33); }
.sw.pick input { position: absolute; inset: -6px; width: 40px; height: 40px; opacity: 0; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.chip { padding: 4px 9px; border-radius: 12px; background: var(--input); font-size: 11.5px; }
.chip:hover { box-shadow: inset 0 0 0 1px var(--sel); }
.fontpick { text-align: left; cursor: pointer; font-size: 13px; }
.menu .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; box-shadow: 0 0 0 1px rgba(255,255,255,.3); }
.menu button { align-items: center; }
#fmt { flex-wrap: wrap; max-width: min(620px, calc(100vw - 16px)); }
#fmt .fbr { flex-basis: 100%; height: 0; }
#fmt .ab { border-bottom: 3px solid #e2554f; line-height: 1; }
#fmt .mk { background: #f6e05e; color: #1e1e1e; padding: 0 3px; border-radius: 2px; }

/* дизайн бланка (data-атрибуты и переменные от панели «Текст и шрифты», «Страница и цвета») */
.doc { isolation: isolate; }
.doc[data-fs] :is(.pre, .body, .closing) { font-size: calc(1em * var(--fs, 1)); }
.doc[data-fs] .visa { font-size: calc(.92em * var(--fs, 1)); }
.doc[data-tf] :is(.pre, .body, .closing, .visa, .verb, .s-title, .b-title, .e-title) { font-family: var(--tf); }
.doc[data-hf] :is(.f[data-f="org"], .f[data-f="kind"], .f[data-f="title"], .e-state, .e-office, .md-state, .md-office, .z-mast, .z-sub, .g-state) { font-family: var(--hf); }
.doc[data-lh] :is(.pre, .body, .closing) { line-height: var(--lh); }
.doc[data-al="left"] :is(.pre, .body .pt, .body > p, .body li, .closing p) { text-align: left !important; }
.doc[data-al="justify"] :is(.pre, .body .pt, .body > p, .body li, .closing p) { text-align: justify !important; }
.doc[data-al="center"] :is(.pre, .body .pt, .body > p, .closing p) { text-align: center !important; }
.doc[data-paper] { background-color: var(--paper) !important; }
.doc[data-paper] :is(.g-corner, .b-paper) { background-color: var(--paper); }
.doc[data-ink] { color: var(--ink) !important; }
.doc[data-tex="paper"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .36 0 0 0 0 .24 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.doc[data-tex="guilloche"] { background-image: var(--gbg); }
.doc[data-tex="dots"] { background-image: radial-gradient(rgba(0, 0, 0, .09) 1px, transparent 1.3px); background-size: 14px 14px; }
.doc .fx { display: none; position: absolute; inset: 14px; pointer-events: none; z-index: 4; }
.doc[data-fx] .fx { display: block; }
.doc[data-fx="thin"] .fx { border: 1.2px solid var(--accent); }
.doc[data-fx="double"] .fx { border: 5px double var(--accent); }
.doc[data-fx="wide"] .fx { border: 9px solid var(--accent); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 4.5px var(--accent); }
.doc .wm-x { display: none; position: absolute; left: 50%; top: 54%; width: 440px; transform: translate(-50%, -50%); z-index: -1; pointer-events: none; }
.doc[data-wm] .wm-x { display: block; opacity: var(--wmo, .06); }
.doc .g-wm { opacity: var(--wmo, .05); }
.doc .b-wm { opacity: var(--wmo, .06); }
.doc:not([data-wm]) :is(.g-wm, .b-wm) { display: none; }
.doc .sig-font { color: var(--sc, #1c2a5c); transform: rotate(calc(-4deg + var(--sr, 0deg))) scale(var(--ss, 1)); }
.doc .sig-img { transform: rotate(var(--sr, 0deg)) scale(var(--ss, 1)); }
.strict .s-emblem { height: calc(108px * var(--es, 1)); }
.gala .ring { width: calc(122px * var(--es, 1)); height: calc(122px * var(--es, 1)); }
.exec .ring { width: calc(136px * var(--es, 1)); height: calc(136px * var(--es, 1)); }
.modern .ring { width: calc(112px * var(--es, 1)); height: calc(112px * var(--es, 1)); }
.bond .b-head { grid-template-columns: 1fr calc(128px * var(--es, 1)) 1fr; }
.bond .b-head svg { width: calc(128px * var(--es, 1)); height: calc(128px * var(--es, 1)); }
.memo .mm-head img { width: calc(60px * var(--es, 1)); }
.gazette .z-kicker img { width: calc(30px * var(--es, 1)); }
.m-scope { display: grid; gap: 2px; }

/* ===== Фирменный бланк ===== */
.doc.letter { display: flex; flex-direction: column; padding: 50px 64px 34px; font-size: 16px; line-height: 1.45; }
.letter .lt-head { display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.letter .lt-left { display: flex; gap: 14px; align-items: center; flex: 1; }
.letter .lt-left img { width: calc(62px * var(--es, 1)); }
.letter .lt-org { font-family: Inter, sans-serif; font-weight: 800; font-size: 15px; line-height: 1.25; color: var(--accent); }
.letter .lt-en { font-family: Inter, sans-serif; font-size: 10.5px; letter-spacing: .08em; color: #777; margin-top: 3px; }
.letter .lt-right { width: 210px; border-left: 3px solid var(--accent); padding-left: 14px; font-family: Inter, sans-serif; font-size: 11.5px; line-height: 1.5; color: #555; }
.letter .lt-right > .f, .letter .lt-right > .date { display: block; }
.letter .lt-line { height: 3px; background: var(--accent); margin: 18px 0 2px; box-shadow: 0 5px 0 -4px var(--gold); }
.letter .lt-kind { font-family: Inter, sans-serif; font-weight: 700; font-size: 13px; letter-spacing: .26em; color: var(--accent); margin-top: 30px; }
.letter .lt-title { font-weight: 700; font-size: 22px; line-height: 1.25; margin: 6px 0 22px; }
.letter .pre { text-align: justify; }
.letter .verb { font-weight: 700; letter-spacing: .14em; margin: 16px 0 10px; }
.letter .body { counter-reset: pt; }
.letter .body .pt, .letter .body > p { counter-increment: pt; position: relative; padding-left: 30px; margin-bottom: 8px; text-align: justify; }
.letter .body .pt::before, .letter .body > p::before { content: counter(pt) "."; position: absolute; left: 0; font-family: Inter, sans-serif; font-weight: 800; color: var(--accent); font-size: .92em; }
.letter .body li { padding-left: 1em; text-indent: -1em; } .letter .body li::before { content: "— "; }
.letter .tbl { margin: 8px 0; font-size: 14.5px; } .letter .tbl th { background: var(--accent); color: #fff; padding: 5px 8px; } .letter .tbl td { border-bottom: 1px solid #ddd; padding: 4px 8px; }
.letter .closing p { margin-top: 4px; }
.letter .lt-sign { margin-top: auto; padding-top: 40px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.letter .lt-who .role { font-size: 14px; color: #555; max-width: 330px; }
.letter .lt-who .name { font-weight: 700; font-size: 17px; margin-top: 2px; }
.letter .lt-sign .sig { width: 230px; }
.letter .stamp { left: -40px; top: -48px; }
.letter .lt-foot { display: flex; justify-content: space-between; margin-top: 26px; padding-top: 10px; border-top: 1px solid #ddd; font-family: Inter, sans-serif; font-size: 10.5px; color: #888; letter-spacing: .04em; }

/* ===== Лента ===== */
.doc.ribbon { display: grid; grid-template-columns: 96px minmax(0, 1fr); font-size: 15.8px; line-height: 1.45; }
.ribbon .rb-band { background: var(--accent); background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 10px, transparent 10px 20px); display: flex; flex-direction: column; align-items: center; padding: 34px 0; gap: 26px; }
.ribbon .rb-band .ring { width: calc(78px * var(--es, 1)); height: calc(78px * var(--es, 1)); }
.ribbon .rb-vert { writing-mode: vertical-rl; transform: rotate(180deg); color: rgba(255, 255, 255, .85); font-family: "Cormorant Garamond", serif; font-weight: 700; letter-spacing: .38em; font-size: 14px; }
.ribbon .rb-main { display: flex; flex-direction: column; padding: 50px 58px 44px 46px; }
.ribbon .rb-top { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1.5px solid var(--accent); padding-bottom: 14px; }
.ribbon .rb-org { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 21px; line-height: 1.15; color: var(--accent); }
.ribbon .rb-place { font-size: 13px; color: #666; margin-top: 4px; font-style: italic; }
.ribbon .rb-no { text-align: right; font-size: 13.5px; white-space: nowrap; color: #444; }
.ribbon .rb-no b { display: block; font-size: 16px; color: #111; }
.ribbon .rb-kind { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 34px; letter-spacing: .14em; color: var(--accent); margin-top: 26px; }
.ribbon .rb-title { font-weight: 700; font-size: 17px; margin: 4px 0 20px; }
.ribbon .pre { text-align: justify; }
.ribbon .verb { font-weight: 700; letter-spacing: .2em; margin: 16px 0 10px; color: var(--accent); }
.ribbon .body { counter-reset: pt; }
.ribbon .body .pt, .ribbon .body > p { counter-increment: pt; position: relative; padding-left: 34px; margin-bottom: 9px; text-align: justify; }
.ribbon .body .pt::before, .ribbon .body > p::before { content: counter(pt); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; line-height: 22px; text-align: center; }
.ribbon .body li { padding-left: 1em; text-indent: -1em; } .ribbon .body li::before { content: "▪ "; color: var(--accent); }
.ribbon .tbl { margin: 8px 0; font-size: 14.5px; } .ribbon .tbl th { border-bottom: 2px solid var(--accent); text-align: left; padding: 4px 8px; } .ribbon .tbl td { border-bottom: 1px solid #e3e3e3; padding: 4px 8px; }
.ribbon .closing p { margin-top: 4px; }
.ribbon .rb-sign { margin-top: auto; padding-top: 34px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.ribbon .rb-seal svg { width: 128px; height: 128px; display: block; }
.ribbon .rb-who { width: 300px; margin-left: auto; text-align: center; }
.ribbon .rb-who .sig { height: 64px; } .ribbon .rb-who .s-line { border-top: 1.5px solid #222; }
.ribbon .rb-who .name { font-weight: 700; margin-top: 6px; } .ribbon .rb-who .role { font-style: italic; font-size: 13.5px; color: #555; }

/* ===== Флаг штата ===== */
.doc.flag { display: flex; flex-direction: column; padding: 0 58px 0; font-size: 15.8px; line-height: 1.45; }
.flag .fl-head { margin: 0 -58px; padding: 30px 58px 28px; background: var(--accent); background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .06) 0 14px, transparent 14px 28px); display: flex; align-items: center; gap: 22px; color: #fff; }
.flag .fl-head .ring { width: calc(104px * var(--es, 1)); height: calc(104px * var(--es, 1)); flex: none; }
.flag .fl-state { font-family: "Cormorant Garamond", serif; font-weight: 600; letter-spacing: .4em; font-size: 13px; color: #f0d58c; }
.flag .fl-org { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 25px; line-height: 1.12; margin-top: 4px; }
.flag .fl-en { font-family: "Cormorant Garamond", serif; font-style: italic; font-size: 15px; opacity: .85; }
.flag .fl-tri { margin: 0 -58px; display: grid; }
.flag .fl-tri i { display: block; height: 6px; background: var(--gold); } .flag .fl-tri i:nth-child(2) { height: 4px; background: #fff; } .flag .fl-tri i:nth-child(3) { background: #a5221c; }
.flag .fl-meta { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; margin-top: 18px; font-size: 13.5px; color: #555; }
.flag .fl-meta > :last-child { text-align: right; } .flag .fl-meta .fl-place { font-style: italic; text-align: center; }
.flag .fl-kind { text-align: center; font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 38px; letter-spacing: .24em; padding-left: .24em; color: var(--accent); margin-top: 18px; }
.flag .fl-title { text-align: center; font-weight: 700; margin: 2px 40px 20px; text-transform: uppercase; font-size: 15.5px; letter-spacing: .03em; }
.flag .pre { text-align: justify; }
.flag .verb { text-align: center; font-weight: 700; letter-spacing: .3em; margin: 16px 0 12px; }
.flag .body { counter-reset: pt; }
.flag .body .pt, .flag .body > p { counter-increment: pt; position: relative; padding-left: 40px; margin-bottom: 9px; text-align: justify; }
.flag .body .pt::before, .flag .body > p::before { content: counter(pt, upper-roman); position: absolute; left: 0; top: 0; width: 28px; text-align: center; font-weight: 700; color: #fff; background: var(--accent); border-radius: 3px; font-size: 12.5px; line-height: 21px; }
.flag .body li { padding-left: 1em; text-indent: -1em; } .flag .body li::before { content: "★ "; color: var(--gold); font-size: .8em; }
.flag .tbl { margin: 8px 0; font-size: 14.5px; } .flag .tbl th { background: var(--accent); color: #fff; padding: 5px 8px; } .flag .tbl td { border: 1px solid #ddd; padding: 4px 8px; }
.flag .closing p { margin-top: 4px; }
.flag .fl-foot { margin-top: auto; padding-top: 30px; display: flex; justify-content: space-between; align-items: flex-end; }
.flag .fl-seal svg { width: 134px; height: 134px; display: block; }
.flag .fl-sign { width: 310px; text-align: center; } .flag .fl-sign .sig { height: 64px; } .flag .fl-sign .s-line { border-top: 1.5px solid #222; }
.flag .fl-sign .name { font-weight: 700; margin-top: 6px; } .flag .fl-sign .role { font-style: italic; font-size: 13.5px; color: #555; }
.flag .fl-band { margin: 24px -58px 0; background: var(--accent); color: #f3e7c4; text-align: center; font-family: "Cormorant Garamond", serif; font-weight: 600; letter-spacing: .3em; font-size: 12px; padding: 10px; }
.flag .fl-band i { color: var(--gold); font-style: normal; }

/* ===== Грамота ===== */
.doc.award { display: flex; flex-direction: column; padding: 66px 84px 60px; background: #fffdf6; font-size: 15.8px; line-height: 1.5; text-align: center; }
.award .aw-frame { position: absolute; inset: 22px; border: 2px solid var(--gold); box-shadow: inset 0 0 0 5px #fffdf6, inset 0 0 0 6px var(--gold); pointer-events: none; }
.award .aw-c { position: absolute; width: 90px; height: 90px; pointer-events: none; }
.award .aw-c.c1 { left: 14px; top: 14px; } .award .aw-c.c2 { right: 14px; top: 14px; transform: scaleX(-1); }
.award .aw-c.c3 { left: 14px; bottom: 14px; transform: scaleY(-1); } .award .aw-c.c4 { right: 14px; bottom: 14px; transform: scale(-1, -1); }
.award > :not(.aw-frame):not(.aw-c):not(.fx):not(.st):not(.wm-x):not(.pg-no) { position: relative; z-index: 1; }
.award .laurel { width: calc(150px * var(--es, 1)); height: calc(150px * var(--es, 1)); display: block; margin: 0 auto; }
.award .aw-state { font-family: "Cormorant Garamond", serif; font-weight: 600; letter-spacing: .42em; font-size: 13px; color: var(--gold-dark); margin-top: 4px; }
.award .aw-org { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 20px; color: var(--accent); margin-top: 2px; }
.award .aw-kind { font-family: "Playfair Display", serif; font-style: italic; font-weight: 700; font-size: 52px; color: var(--accent); margin-top: 14px; line-height: 1.05; letter-spacing: .02em; }
.award .aw-title { font-family: "Playfair Display", serif; font-size: 19px; margin: 8px 30px 0; line-height: 1.3; }
.award .aw-meta { font-size: 13px; color: #6b6255; margin-top: 10px; font-style: italic; }
.award .aw-meta span { margin: 0 8px; } .award .aw-meta .f { display: inline; }
.award .aw-orn { color: var(--gold); font-size: 22px; margin: 8px 0 6px; }
.award .pre { text-align: center; font-style: italic; margin: 0 20px; }
.award .verb { font-family: "Cormorant Garamond", serif; font-weight: 700; letter-spacing: .3em; font-size: 19px; color: var(--accent); margin: 16px 0 10px; }
.award .body { counter-reset: pt; text-align: left; }
.award .body .pt, .award .body > p { counter-increment: pt; position: relative; padding-left: 30px; margin-bottom: 8px; text-align: justify; }
.award .body .pt::before, .award .body > p::before { content: counter(pt) "."; position: absolute; left: 0; font-family: "Playfair Display", serif; font-weight: 700; color: var(--gold-dark); }
.award .body li { padding-left: 1em; text-indent: -1em; } .award .body li::before { content: "❧ "; color: var(--gold); }
.award .tbl { margin: 8px 0; font-size: 14.5px; } .award .tbl th { border-bottom: 1.5px solid var(--gold); padding: 4px 8px; } .award .tbl td { border-bottom: 1px solid #e8dfc8; padding: 4px 8px; }
.award .closing { text-align: center; font-style: italic; } .award .closing p { margin-top: 4px; }
.award .aw-foot { margin-top: auto; padding-top: 30px; display: flex; justify-content: space-between; align-items: flex-end; }
.award .aw-sign { width: 300px; text-align: center; } .award .aw-sign .sig { height: 64px; } .award .aw-sign .s-line { border-top: 1.5px solid #3a3326; }
.award .aw-sign .name { font-family: "Playfair Display", serif; font-weight: 700; margin-top: 6px; } .award .aw-sign .role { font-style: italic; font-size: 13.5px; color: #5a5244; }
.award .aw-seal { position: relative; width: 150px; height: 170px; }
.award .aw-seal svg { position: relative; width: 150px; height: 150px; display: block; z-index: 1; }
.award .aw-seal i { position: absolute; top: 110px; width: 34px; height: 64px; background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%); }
.award .aw-seal .t1 { left: 38px; transform: rotate(14deg); } .award .aw-seal .t2 { right: 38px; transform: rotate(-14deg); }

/* ===== Минимализм ===== */
.doc.minimal { display: flex; flex-direction: column; padding: 0 72px 56px; font-family: Inter, sans-serif; font-size: 14.4px; line-height: 1.6; color: #1d1d1f; }
.minimal .mn-bar { height: 8px; background: var(--accent); margin: 0 -72px 50px; }
.minimal .mn-head { display: flex; align-items: center; gap: 16px; }
.minimal .mn-head img { width: calc(42px * var(--es, 1)); }
.minimal .mn-org-w { flex: 1; }
.minimal .mn-org { font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.minimal .mn-place { font-size: 12px; color: #86868b; }
.minimal .mn-no { text-align: right; font-size: 12px; color: #86868b; } .minimal .mn-no > span:first-child { display: block; color: #1d1d1f; font-weight: 600; }
.minimal .mn-kind { font-size: 12px; font-weight: 700; letter-spacing: .34em; color: var(--accent); margin-top: 64px; }
.minimal .mn-title { font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: -.015em; margin: 10px 0 34px; }
.minimal .pre { color: #45454a; }
.minimal .verb { font-size: 12px; font-weight: 700; letter-spacing: .3em; color: #86868b; margin: 26px 0 14px; }
.minimal .body { counter-reset: pt; }
.minimal .body .pt, .minimal .body > p { counter-increment: pt; position: relative; padding-left: 52px; margin-bottom: 16px; }
.minimal .body .pt::before, .minimal .body > p::before { content: counter(pt, decimal-leading-zero); position: absolute; left: 0; top: -3px; font-size: 22px; font-weight: 300; color: var(--accent); }
.minimal .body li { padding-left: 1em; text-indent: -1em; color: #45454a; } .minimal .body li::before { content: "– "; }
.minimal .tbl { margin: 10px 0; font-size: 13px; } .minimal .tbl th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #86868b; border-bottom: 1px solid #1d1d1f; padding: 6px 8px 6px 0; } .minimal .tbl td { border-bottom: 1px solid #e5e5ea; padding: 7px 8px 7px 0; }
.minimal .closing { color: #45454a; margin-top: 10px; } .minimal .closing p { margin-top: 4px; }
.minimal .mn-sign { margin-top: auto; padding-top: 50px; display: flex; align-items: flex-end; gap: 24px; border-top: 1px solid #e5e5ea; }
.minimal .mn-who { flex: 1; padding-top: 14px; } .minimal .mn-who .role { font-size: 12px; color: #86868b; } .minimal .mn-who .name { font-weight: 700; font-size: 16px; }
.minimal .mn-sign .sig { width: 220px; height: 70px; }
.minimal .mn-seal svg { width: 86px; height: 86px; display: block; }

/* ===== Ордер ===== */
.doc.warrant { display: flex; flex-direction: column; padding: 40px 48px 30px; font-size: 15px; line-height: 1.45; }
.warrant .wr-top { display: flex; align-items: center; gap: 16px; border: 2px solid #111; padding: 12px 16px; }
.warrant .wr-top > img { width: calc(58px * var(--es, 1)); }
.warrant .wr-t { flex: 1; } .warrant .wr-org { font-weight: 700; font-size: 15.5px; line-height: 1.25; } .warrant .wr-en { font-family: Inter, sans-serif; font-size: 10.5px; color: #666; letter-spacing: .06em; margin-top: 3px; }
.warrant .wr-code { width: 150px; text-align: center; font-family: Cousine, monospace; font-size: 11px; }
.warrant .barcode { width: 150px; height: 42px; display: block; }
.warrant .wr-kind { margin-top: 14px; background: #111; color: #fff; text-align: center; font-family: Inter, sans-serif; font-weight: 800; letter-spacing: .4em; font-size: 18px; padding: 8px 0 8px .4em; }
.warrant .wr-grid { width: 100%; border-collapse: collapse; margin-top: -1px; font-size: 14px; }
.warrant .wr-grid th { width: 90px; text-align: left; font-family: Inter, sans-serif; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #555; background: #f3f3f3; border: 1.5px solid #111; padding: 6px 8px; font-weight: 700; }
.warrant .wr-grid td { border: 1.5px solid #111; padding: 6px 10px; }
.warrant .wr-title { font-weight: 700; }
.warrant .wr-box { border: 1.5px solid #111; border-top: 0; padding: 14px 18px 18px; }
.warrant .wr-cap { font-family: Inter, sans-serif; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #555; font-weight: 700; margin-bottom: 8px; }
.warrant .pre { text-align: justify; }
.warrant .verb { font-weight: 700; letter-spacing: .14em; margin: 12px 0 8px; }
.warrant .body { counter-reset: pt; }
.warrant .body .pt, .warrant .body > p { counter-increment: pt; position: relative; padding-left: 30px; margin-bottom: 7px; text-align: justify; }
.warrant .body .pt::before, .warrant .body > p::before { content: counter(pt) ")"; position: absolute; left: 0; font-weight: 700; }
.warrant .body li { padding-left: 1em; text-indent: -1em; } .warrant .body li::before { content: "— "; }
.warrant .tbl { margin: 6px 0; font-size: 13.5px; } .warrant .tbl th, .warrant .tbl td { border: 1px solid #111; padding: 3px 7px; } .warrant .tbl th { background: #eee; }
.warrant .closing p { margin-top: 4px; }
.warrant .wr-bottom { display: grid; grid-template-columns: 1fr 190px; border: 1.5px solid #111; border-top: 0; margin-top: auto; }
.warrant .wr-sign { padding: 14px 18px; } .warrant .wr-sign .role { font-size: 13.5px; }
.warrant .wr-sigrow { display: flex; align-items: flex-end; gap: 16px; margin-top: 6px; }
.warrant .wr-sigrow .sig { width: 200px; height: 60px; border-bottom: 1.5px solid #111; } .warrant .wr-sigrow .name { font-weight: 700; }
.warrant .wr-mp { border-left: 1.5px solid #111; position: relative; display: grid; place-items: center; min-height: 150px; }
.warrant .wr-mp span { font-family: Inter, sans-serif; font-size: 12px; color: #999; letter-spacing: .2em; }
.warrant .wr-mp .stamp { left: 16px; top: 2px; width: 150px; height: 150px; }
.warrant .wr-foot { display: flex; justify-content: space-between; margin-top: 10px; font-family: Inter, sans-serif; font-size: 10px; color: #777; letter-spacing: .06em; }
.doc.warrant .wr-bottom { margin-top: 0; }
.doc.warrant .wr-box { flex: 1; }

/* ===== Тёмное ===== */
.doc.night { display: flex; flex-direction: column; padding: 56px 70px 48px; background: #0e1522; background-image: radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--accent) 55%, #0e1522) 0%, #0e1522 70%); color: #e8ecf4; font-size: 15.8px; line-height: 1.5; }
.night .nt-glow { position: absolute; inset: 16px; border: 1px solid rgba(217, 184, 102, .5); pointer-events: none; box-shadow: inset 0 0 0 5px rgba(0, 0, 0, 0), inset 0 0 0 6px rgba(217, 184, 102, .25); }
.night .nt-head { text-align: center; }
.night .nt-head > svg { width: calc(118px * var(--es, 1)); height: calc(118px * var(--es, 1)); display: block; margin: 0 auto 12px; }
.night .nt-state { font-family: "Cormorant Garamond", serif; font-weight: 600; letter-spacing: .42em; padding-left: .42em; font-size: 13px; color: #d9b866; }
.night .nt-org { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 25px; line-height: 1.15; margin-top: 6px; color: #fff; }
.night .nt-en { font-family: "Cormorant Garamond", serif; font-style: italic; color: #aab3c5; }
.night .nt-rule { display: flex; align-items: center; gap: 12px; color: #d9b866; margin: 14px 0 8px; }
.night .nt-rule::before, .night .nt-rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #d9b866); }
.night .nt-rule::after { background: linear-gradient(270deg, transparent, #d9b866); }
.night .nt-meta { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; font-size: 13.5px; color: #aab3c5; }
.night .nt-meta > :last-child { text-align: right; } .night .nt-meta .nt-place { font-style: italic; }
.night .nt-kind { text-align: center; font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 40px; letter-spacing: .28em; padding-left: .28em; color: #d9b866; margin-top: 18px; }
.night .nt-title { text-align: center; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin: 4px 30px 20px; color: #fff; }
.night .pre { text-align: justify; color: #d5dbe7; }
.night .verb { text-align: center; font-family: "Cormorant Garamond", serif; font-weight: 700; letter-spacing: .3em; font-size: 20px; color: #d9b866; margin: 16px 0 12px; }
.night .body { counter-reset: pt; }
.night .body .pt, .night .body > p { counter-increment: pt; position: relative; padding-left: 52px; margin-bottom: 10px; text-align: justify; }
.night .body .pt::before, .night .body > p::before { content: counter(pt, upper-roman) "."; position: absolute; left: 0; width: 40px; text-align: right; padding-right: 8px; border-right: 1.5px solid #d9b866; font-family: "Cormorant Garamond", serif; font-weight: 700; color: #d9b866; top: 0; bottom: 0; }
.night .body li { padding-left: 1em; text-indent: -1em; } .night .body li::before { content: "◆ "; color: #d9b866; font-size: .7em; vertical-align: .15em; }
.night .tbl { margin: 8px 0; font-size: 14.5px; } .night .tbl th { border-bottom: 1.5px solid #d9b866; color: #d9b866; padding: 5px 8px; text-align: left; } .night .tbl td { border-bottom: 1px solid rgba(255, 255, 255, .14); padding: 5px 8px; }
.night .closing { color: #d5dbe7; } .night .closing p { margin-top: 4px; }
.night .visa { color: #d5dbe7; }
.night .nt-foot { margin-top: auto; padding-top: 34px; display: flex; justify-content: space-between; align-items: flex-end; }
.night .nt-sign { width: 310px; text-align: center; } .night .nt-sign .sig { height: 64px; } .night .nt-sign .s-line { border-top: 1.5px solid #d9b866; }
.night .nt-sign .name { font-weight: 700; margin-top: 6px; color: #fff; } .night .nt-sign .role { font-style: italic; font-size: 13.5px; color: #aab3c5; }
.night .nt-seal svg { width: 120px; height: 120px; display: block; }
.doc.night .sig-font { color: var(--sc, #e9d18a); }
.doc.night .sig-img { filter: invert(1) hue-rotate(180deg) brightness(1.2); }
body.show-vars .doc.night:not(.exporting) .var { color: #111; }
body.show-vars .doc.night:not(.exporting) .f.smp::first-line { color: #111; }
details.r-sec > summary.r-h { justify-content: flex-start; }
.r-row .sws .sw.pick { width: 24px; flex: none; }
#fmt { max-width: min(720px, calc(100vw - 16px)); }
#world { width: max-content; }
.frame-label { max-width: 100%; overflow: hidden; } .frame-label span { overflow: hidden; text-overflow: ellipsis; }

/* ===== v8: общее для оформлений (агент C) ===== */
/* «Без герба» (emblem: 'none'): картинки герба нет — и места под неё нет */
.doc img:is([src=""], [src$="/none.webp"], [src$="/none-gold.webp"]) { display: none !important; }
/* «Номера листов» выключены (класс .no-pagenums на листе): ни «Лист N из M», ни шапки продолжения, ни номеров в лентах */
.doc.no-pagenums :is(.pg-no, .cont-head, .pgn) { display: none !important; }
/* водяной знак — гравюрой: видны линии рисунка, а не тёмный силуэт щита (был серый «прямоугольник» у «Гербовой бумаги»); золотой герб — тоже серым */
.doc[data-wm] .wm-x:not([src^="data:"]), .doc .g-wm:not([src^="data:"]), .doc .b-wm:not([src^="data:"]) { filter: grayscale(1) contrast(2.5) invert(1); mix-blend-mode: multiply; opacity: calc(var(--wmo, .06) * 1.7); }
.doc:is(.night, .midnight, .graphite)[data-wm] .wm-x:not([src^="data:"]) { filter: grayscale(1) contrast(2.5); mix-blend-mode: screen; opacity: calc(var(--wmo, .06) * 1.4); }
/* значок пункта списка не растягивается выключкой по ширине (был пробел-«дыра» после ◆ и —) */
.doc .body li { position: relative; text-indent: 0 !important; }
.doc .body li::before { position: absolute; left: 0; top: 0; }
:is(.strict, .bond, .gazette, .letter, .warrant) .body li { padding-left: 1.35em; }
.award .body li { padding-left: 1.3em; }
:is(.gala, .night) .body li::before { top: .32em; }
.flag .body li::before { top: .16em; }
/* тёмные оформления: жёлтые места читаемы, «Проект» виден, фон листа — светлым узором */
body.show-vars .doc:is(.night, .midnight, .graphite):not(.exporting) .var { color: #111; }
body.show-vars .doc:is(.night, .midnight, .graphite):not(.exporting) .f.smp::first-line { color: #111; }
.doc:is(.night, .midnight, .graphite) .st-draft { color: rgba(255, 255, 255, .07); mix-blend-mode: normal; }
/* «Полночь» и «Графит»: базовый цвет — слоем фона-картинки (--base): его не затирает backgroundColor выгрузки; «Фон листа» — поверх */
.doc.midnight { --base: linear-gradient(#0c1016, #0c1016); }
.doc.graphite { --base: linear-gradient(#1e1f22, #1e1f22); }
.doc:is(.midnight, .graphite) { background-image: var(--base); }
.doc:is(.midnight, .graphite)[data-tex="paper"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .96 0 0 0 0 .86 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), var(--base); }
.doc:is(.midnight, .graphite)[data-tex="guilloche"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22180%22%20height%3D%2226%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%23d9b866%22%20stroke-width%3D%22.5%22%20stroke-opacity%3D%22.16%22%3E%3Cpath%20d%3D%22M0.0%2C16.89L2.0%2C18.14L4.0%2C19.28L6.0%2C20.30L8.0%2C21.18L10.0%2C21.90L12.0%2C22.45L14.0%2C22.81L16.0%2C22.99L18.0%2C22.96L20.0%2C22.75L22.0%2C22.34L24.0%2C21.75L26.0%2C20.99L28.0%2C20.08L30.0%2C19.03L32.0%2C17.86L34.0%2C16.60L36.0%2C15.26L38.0%2C13.89L40.0%2C12.49L42.0%2C11.11L44.0%2C9.76L46.0%2C8.47L48.0%2C7.28L50.0%2C6.19L52.0%2C5.24L54.0%2C4.44L56.0%2C3.80L58.0%2C3.34L60.0%2C3.08L62.0%2C3.00L64.0%2C3.12L66.0%2C3.43L68.0%2C3.93L70.0%2C4.61L72.0%2C5.44L74.0%2C6.43L76.0%2C7.54L78.0%2C8.76L80.0%2C10.06L82.0%2C11.42L84.0%2C12.81L86.0%2C14.20L88.0%2C15.57L90.0%2C16.89L92.0%2C18.14L94.0%2C19.28L96.0%2C20.30L98.0%2C21.18L100.0%2C21.90L102.0%2C22.45L104.0%2C22.81L106.0%2C22.99L108.0%2C22.96L110.0%2C22.75L112.0%2C22.34L114.0%2C21.75L116.0%2C20.99L118.0%2C20.08L120.0%2C19.03L122.0%2C17.86L124.0%2C16.60L126.0%2C15.26L128.0%2C13.89L130.0%2C12.49L132.0%2C11.11L134.0%2C9.76L136.0%2C8.47L138.0%2C7.28L140.0%2C6.19L142.0%2C5.24L144.0%2C4.44L146.0%2C3.80L148.0%2C3.34L150.0%2C3.08L152.0%2C3.00L154.0%2C3.12L156.0%2C3.43L158.0%2C3.93L160.0%2C4.61L162.0%2C5.44L164.0%2C6.43L166.0%2C7.54L168.0%2C8.76L170.0%2C10.06L172.0%2C11.42L174.0%2C12.81L176.0%2C14.20L178.0%2C15.57L180.0%2C16.89%22%2F%3E%3Cpath%20d%3D%22M0.0%2C19.03L2.0%2C17.86L4.0%2C16.60L6.0%2C15.26L8.0%2C13.89L10.0%2C12.49L12.0%2C11.11L14.0%2C9.76L16.0%2C8.47L18.0%2C7.28L20.0%2C6.19L22.0%2C5.24L24.0%2C4.44L26.0%2C3.80L28.0%2C3.34L30.0%2C3.08L32.0%2C3.00L34.0%2C3.12L36.0%2C3.43L38.0%2C3.93L40.0%2C4.61L42.0%2C5.44L44.0%2C6.43L46.0%2C7.54L48.0%2C8.76L50.0%2C10.06L52.0%2C11.42L54.0%2C12.81L56.0%2C14.20L58.0%2C15.57L60.0%2C16.89L62.0%2C18.14L64.0%2C19.28L66.0%2C20.30L68.0%2C21.18L70.0%2C21.90L72.0%2C22.45L74.0%2C22.81L76.0%2C22.99L78.0%2C22.96L80.0%2C22.75L82.0%2C22.34L84.0%2C21.75L86.0%2C20.99L88.0%2C20.08L90.0%2C19.03L92.0%2C17.86L94.0%2C16.60L96.0%2C15.26L98.0%2C13.89L100.0%2C12.49L102.0%2C11.11L104.0%2C9.76L106.0%2C8.47L108.0%2C7.28L110.0%2C6.19L112.0%2C5.24L114.0%2C4.44L116.0%2C3.80L118.0%2C3.34L120.0%2C3.08L122.0%2C3.00L124.0%2C3.12L126.0%2C3.43L128.0%2C3.93L130.0%2C4.61L132.0%2C5.44L134.0%2C6.43L136.0%2C7.54L138.0%2C8.76L140.0%2C10.06L142.0%2C11.42L144.0%2C12.81L146.0%2C14.20L148.0%2C15.57L150.0%2C16.89L152.0%2C18.14L154.0%2C19.28L156.0%2C20.30L158.0%2C21.18L160.0%2C21.90L162.0%2C22.45L164.0%2C22.81L166.0%2C22.99L168.0%2C22.96L170.0%2C22.75L172.0%2C22.34L174.0%2C21.75L176.0%2C20.99L178.0%2C20.08L180.0%2C19.03%22%2F%3E%3Cpath%20d%3D%22M0.0%2C3.08L2.0%2C3.00L4.0%2C3.12L6.0%2C3.43L8.0%2C3.93L10.0%2C4.61L12.0%2C5.44L14.0%2C6.43L16.0%2C7.54L18.0%2C8.76L20.0%2C10.06L22.0%2C11.42L24.0%2C12.81L26.0%2C14.20L28.0%2C15.57L30.0%2C16.89L32.0%2C18.14L34.0%2C19.28L36.0%2C20.30L38.0%2C21.18L40.0%2C21.90L42.0%2C22.45L44.0%2C22.81L46.0%2C22.99L48.0%2C22.96L50.0%2C22.75L52.0%2C22.34L54.0%2C21.75L56.0%2C20.99L58.0%2C20.08L60.0%2C19.03L62.0%2C17.86L64.0%2C16.60L66.0%2C15.26L68.0%2C13.89L70.0%2C12.49L72.0%2C11.11L74.0%2C9.76L76.0%2C8.47L78.0%2C7.28L80.0%2C6.19L82.0%2C5.24L84.0%2C4.44L86.0%2C3.80L88.0%2C3.34L90.0%2C3.08L92.0%2C3.00L94.0%2C3.12L96.0%2C3.43L98.0%2C3.93L100.0%2C4.61L102.0%2C5.44L104.0%2C6.43L106.0%2C7.54L108.0%2C8.76L110.0%2C10.06L112.0%2C11.42L114.0%2C12.81L116.0%2C14.20L118.0%2C15.57L120.0%2C16.89L122.0%2C18.14L124.0%2C19.28L126.0%2C20.30L128.0%2C21.18L130.0%2C21.90L132.0%2C22.45L134.0%2C22.81L136.0%2C22.99L138.0%2C22.96L140.0%2C22.75L142.0%2C22.34L144.0%2C21.75L146.0%2C20.99L148.0%2C20.08L150.0%2C19.03L152.0%2C17.86L154.0%2C16.60L156.0%2C15.26L158.0%2C13.89L160.0%2C12.49L162.0%2C11.11L164.0%2C9.76L166.0%2C8.47L168.0%2C7.28L170.0%2C6.19L172.0%2C5.24L174.0%2C4.44L176.0%2C3.80L178.0%2C3.34L180.0%2C3.08%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"), var(--base); }
.doc:is(.midnight, .graphite)[data-tex="dots"] { background-image: radial-gradient(rgba(255, 255, 255, .1) 1px, transparent 1.3px), var(--base); }
/* «Тёмное»: «Фон листа» поверх своего градиента (раньше градиент его закрывал) */
.doc.night[data-tex="paper"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .96 0 0 0 0 .86 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"), radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--accent) 55%, #0e1522) 0%, #0e1522 70%); }
.doc.night[data-tex="guilloche"] { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22180%22%20height%3D%2226%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%23d9b866%22%20stroke-width%3D%22.5%22%20stroke-opacity%3D%22.16%22%3E%3Cpath%20d%3D%22M0.0%2C16.89L2.0%2C18.14L4.0%2C19.28L6.0%2C20.30L8.0%2C21.18L10.0%2C21.90L12.0%2C22.45L14.0%2C22.81L16.0%2C22.99L18.0%2C22.96L20.0%2C22.75L22.0%2C22.34L24.0%2C21.75L26.0%2C20.99L28.0%2C20.08L30.0%2C19.03L32.0%2C17.86L34.0%2C16.60L36.0%2C15.26L38.0%2C13.89L40.0%2C12.49L42.0%2C11.11L44.0%2C9.76L46.0%2C8.47L48.0%2C7.28L50.0%2C6.19L52.0%2C5.24L54.0%2C4.44L56.0%2C3.80L58.0%2C3.34L60.0%2C3.08L62.0%2C3.00L64.0%2C3.12L66.0%2C3.43L68.0%2C3.93L70.0%2C4.61L72.0%2C5.44L74.0%2C6.43L76.0%2C7.54L78.0%2C8.76L80.0%2C10.06L82.0%2C11.42L84.0%2C12.81L86.0%2C14.20L88.0%2C15.57L90.0%2C16.89L92.0%2C18.14L94.0%2C19.28L96.0%2C20.30L98.0%2C21.18L100.0%2C21.90L102.0%2C22.45L104.0%2C22.81L106.0%2C22.99L108.0%2C22.96L110.0%2C22.75L112.0%2C22.34L114.0%2C21.75L116.0%2C20.99L118.0%2C20.08L120.0%2C19.03L122.0%2C17.86L124.0%2C16.60L126.0%2C15.26L128.0%2C13.89L130.0%2C12.49L132.0%2C11.11L134.0%2C9.76L136.0%2C8.47L138.0%2C7.28L140.0%2C6.19L142.0%2C5.24L144.0%2C4.44L146.0%2C3.80L148.0%2C3.34L150.0%2C3.08L152.0%2C3.00L154.0%2C3.12L156.0%2C3.43L158.0%2C3.93L160.0%2C4.61L162.0%2C5.44L164.0%2C6.43L166.0%2C7.54L168.0%2C8.76L170.0%2C10.06L172.0%2C11.42L174.0%2C12.81L176.0%2C14.20L178.0%2C15.57L180.0%2C16.89%22%2F%3E%3Cpath%20d%3D%22M0.0%2C19.03L2.0%2C17.86L4.0%2C16.60L6.0%2C15.26L8.0%2C13.89L10.0%2C12.49L12.0%2C11.11L14.0%2C9.76L16.0%2C8.47L18.0%2C7.28L20.0%2C6.19L22.0%2C5.24L24.0%2C4.44L26.0%2C3.80L28.0%2C3.34L30.0%2C3.08L32.0%2C3.00L34.0%2C3.12L36.0%2C3.43L38.0%2C3.93L40.0%2C4.61L42.0%2C5.44L44.0%2C6.43L46.0%2C7.54L48.0%2C8.76L50.0%2C10.06L52.0%2C11.42L54.0%2C12.81L56.0%2C14.20L58.0%2C15.57L60.0%2C16.89L62.0%2C18.14L64.0%2C19.28L66.0%2C20.30L68.0%2C21.18L70.0%2C21.90L72.0%2C22.45L74.0%2C22.81L76.0%2C22.99L78.0%2C22.96L80.0%2C22.75L82.0%2C22.34L84.0%2C21.75L86.0%2C20.99L88.0%2C20.08L90.0%2C19.03L92.0%2C17.86L94.0%2C16.60L96.0%2C15.26L98.0%2C13.89L100.0%2C12.49L102.0%2C11.11L104.0%2C9.76L106.0%2C8.47L108.0%2C7.28L110.0%2C6.19L112.0%2C5.24L114.0%2C4.44L116.0%2C3.80L118.0%2C3.34L120.0%2C3.08L122.0%2C3.00L124.0%2C3.12L126.0%2C3.43L128.0%2C3.93L130.0%2C4.61L132.0%2C5.44L134.0%2C6.43L136.0%2C7.54L138.0%2C8.76L140.0%2C10.06L142.0%2C11.42L144.0%2C12.81L146.0%2C14.20L148.0%2C15.57L150.0%2C16.89L152.0%2C18.14L154.0%2C19.28L156.0%2C20.30L158.0%2C21.18L160.0%2C21.90L162.0%2C22.45L164.0%2C22.81L166.0%2C22.99L168.0%2C22.96L170.0%2C22.75L172.0%2C22.34L174.0%2C21.75L176.0%2C20.99L178.0%2C20.08L180.0%2C19.03%22%2F%3E%3Cpath%20d%3D%22M0.0%2C3.08L2.0%2C3.00L4.0%2C3.12L6.0%2C3.43L8.0%2C3.93L10.0%2C4.61L12.0%2C5.44L14.0%2C6.43L16.0%2C7.54L18.0%2C8.76L20.0%2C10.06L22.0%2C11.42L24.0%2C12.81L26.0%2C14.20L28.0%2C15.57L30.0%2C16.89L32.0%2C18.14L34.0%2C19.28L36.0%2C20.30L38.0%2C21.18L40.0%2C21.90L42.0%2C22.45L44.0%2C22.81L46.0%2C22.99L48.0%2C22.96L50.0%2C22.75L52.0%2C22.34L54.0%2C21.75L56.0%2C20.99L58.0%2C20.08L60.0%2C19.03L62.0%2C17.86L64.0%2C16.60L66.0%2C15.26L68.0%2C13.89L70.0%2C12.49L72.0%2C11.11L74.0%2C9.76L76.0%2C8.47L78.0%2C7.28L80.0%2C6.19L82.0%2C5.24L84.0%2C4.44L86.0%2C3.80L88.0%2C3.34L90.0%2C3.08L92.0%2C3.00L94.0%2C3.12L96.0%2C3.43L98.0%2C3.93L100.0%2C4.61L102.0%2C5.44L104.0%2C6.43L106.0%2C7.54L108.0%2C8.76L110.0%2C10.06L112.0%2C11.42L114.0%2C12.81L116.0%2C14.20L118.0%2C15.57L120.0%2C16.89L122.0%2C18.14L124.0%2C19.28L126.0%2C20.30L128.0%2C21.18L130.0%2C21.90L132.0%2C22.45L134.0%2C22.81L136.0%2C22.99L138.0%2C22.96L140.0%2C22.75L142.0%2C22.34L144.0%2C21.75L146.0%2C20.99L148.0%2C20.08L150.0%2C19.03L152.0%2C17.86L154.0%2C16.60L156.0%2C15.26L158.0%2C13.89L160.0%2C12.49L162.0%2C11.11L164.0%2C9.76L166.0%2C8.47L168.0%2C7.28L170.0%2C6.19L172.0%2C5.24L174.0%2C4.44L176.0%2C3.80L178.0%2C3.34L180.0%2C3.08%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"), radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--accent) 55%, #0e1522) 0%, #0e1522 70%); }
.doc.night[data-tex="dots"] { background-image: radial-gradient(rgba(255, 255, 255, .1) 1px, transparent 1.3px), radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--accent) 55%, #0e1522) 0%, #0e1522 70%); background-size: 14px 14px, 100% 100%; }
/* листы продолжения старых оформлений: рамки и полосы те же, что на первом листе (CONT в app.js) */
.doc.minimal .cont-head { margin-top: 0; }
.flag .fl-thin { margin: 0 -58px; height: 16px; background: var(--accent); background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .06) 0 14px, transparent 14px 28px); }
.doc.flag .cont-head { margin-top: 24px; }
.bond .b-head .b-star { font-style: normal; font-size: 30px; color: var(--gold); text-align: center; }
.doc.night .pg-no, .night .cont-head { z-index: 2; }
/* номер листа у рамочных видов — внутри рамки, по центру низа (был снаружи рамки или посреди текста) */
.doc:is(.bond, .award, .night, .exec, .deco, .license) .pg-no { left: 0; right: 0; text-align: center; }
.doc.bond .pg-no { bottom: 58px; } .doc.award .pg-no { bottom: 30px; } .doc.night .pg-no { bottom: 24px; color: #8f99ab; } .doc.exec .pg-no { bottom: 30px; } .doc.deco .pg-no { bottom: 34px; }

/* ===== Угловой бланк ===== */
.doc.corner { padding: 58px 66px 70px 86px; font-family: "PT Serif", Tinos, serif; font-size: 16px; line-height: 1.45; }
.corner .cn-top { display: grid; grid-template-columns: 292px minmax(0, 1fr); gap: 28px; align-items: start; }
.corner .cn-stamp { text-align: center; }
.corner .cn-emb { display: block; height: calc(74px * var(--es, 1)); margin: 0 auto 10px; }
.corner .cn-org { font-weight: 700; font-size: 14px; line-height: 1.3; text-transform: uppercase; letter-spacing: .02em; }
.corner .cn-place { font-size: 12.5px; line-height: 1.35; margin-top: 5px; color: #333; }
.corner .cn-reg { display: flex; justify-content: center; gap: 12px; margin-top: 12px; font-size: 13px; }
.corner .cn-reg > span { border-bottom: 1px solid #222; padding: 0 4px 1px; }
.corner .cn-reg .f { display: inline; }
.corner .cn-kindbox { text-align: right; padding-top: 4px; }
.corner .cn-kind { font-weight: 700; font-size: 28px; letter-spacing: .3em; margin-right: -.3em; color: var(--accent); line-height: 1.15; }
.corner .cn-kind.long { font-size: 21px; letter-spacing: .14em; margin-right: -.14em; }  /* v12: «ПОСТАНОВЛЕНИЕ» в одну строку */
.corner .cn-en { display: inline-block; font-family: Inter, sans-serif; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #8a8f99;
  margin-top: 10px; padding-top: 8px; border-top: 2px solid var(--accent); }
.corner .cn-title { font-weight: 700; margin: 36px 0 22px; max-width: 74%; line-height: 1.35; }
.corner .pre, .corner .body > p, .corner .body .pt, .corner .closing p { text-align: justify; text-indent: 1.25cm; }
.corner .verb { font-weight: 700; letter-spacing: .3em; margin: 20px 0 14px; }
.corner .body { counter-reset: pt; }
.corner .body .pt { counter-increment: pt; }
.corner .body .pt::before { content: counter(pt) ". "; font-weight: 700; }
.corner .body ul { padding-left: 1.25cm; }
.corner .body li { padding-left: 1.2em; text-align: justify; }
.corner .body li::before { content: "–"; }
.corner .tbl { margin: 10px 0 8px; font-size: 14.5px; line-height: 1.3; }
.corner .tbl th, .corner .tbl td { border: 1px solid #333; padding: 5px 9px; }
.corner .tbl th { background: color-mix(in srgb, var(--accent) 8%, #fff); }
.corner .closing { margin-top: 4px; }
.corner .cn-sign { display: grid; grid-template-columns: minmax(0, 1fr) 200px auto; align-items: center; gap: 14px; margin-top: 46px; }
.corner .cn-sign .role { font-size: 15px; line-height: 1.3; }
.corner .cn-sign .name { white-space: nowrap; }
.corner .stamp { left: -54px; top: -40px; }

/* ===== Дипломатическая нота ===== */
.doc.note { display: flex; flex-direction: column; padding: 66px 92px 64px; background: #fffdf8; font-family: "EB Garamond", Tinos, serif; font-size: 17.5px; line-height: 1.55; color: #1f1b16; }
.doc.note::before { content: ""; position: absolute; inset: 26px; border: 1px solid color-mix(in srgb, var(--gold) 75%, transparent); pointer-events: none; }
.doc.note::after { content: ""; position: absolute; inset: 31px; border: .6px solid color-mix(in srgb, var(--gold) 45%, transparent); pointer-events: none; }
.note .dn-head { text-align: center; }
.note .dn-emb { display: block; height: calc(66px * var(--es, 1)); margin: 0 auto 12px; }
.note .dn-org { font-variant: small-caps; font-weight: 700; font-size: 21px; letter-spacing: .07em; line-height: 1.2; color: var(--accent); text-transform: lowercase; }
.note .dn-org::first-letter { text-transform: uppercase; }
.note .dn-en { font-style: italic; font-size: 14.5px; color: #7a6f5d; margin-top: 3px; }
.note .dn-orn { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--gold); font-size: 9px; margin: 14px auto 0; width: 220px; }
.note .dn-orn i { flex: 1; height: 1px; background: var(--gold); }
.note .dn-no { text-align: right; font-style: italic; margin-top: 22px; font-size: 16px; color: #4a4236; }
.note .dn-no .f { display: inline; }
.note .dn-kind { text-align: center; font-variant: small-caps; font-weight: 700; font-size: 26px; letter-spacing: .3em; padding-left: .3em; margin-top: 14px; color: var(--accent); text-transform: lowercase; }
.note .dn-title { text-align: center; font-style: italic; font-size: 18.5px; margin: 6px 40px 26px; line-height: 1.4; }
.note .pre, .note .body > p, .note .body .pt, .note .closing p { text-align: justify; text-indent: 2.2em; }
.note .verb { text-align: center; font-variant: small-caps; letter-spacing: .2em; font-weight: 700; margin: 18px 0 12px; text-transform: lowercase; color: var(--accent); }
.note .body { counter-reset: pt; }
.note .body .pt { counter-increment: pt; margin-bottom: 4px; }
.note .body .pt::before { content: counter(pt) ". "; color: var(--gold-dark); font-weight: 700; }
.note .body ul { padding-left: 2.2em; }
.note .body li { padding-left: 1.1em; }
.note .body li::before { content: "·"; color: var(--gold-dark); font-weight: 700; }
.note .tbl { margin: 10px 0; font-size: 15.5px; line-height: 1.35; }
.note .tbl th { border-bottom: 1px solid var(--gold); font-variant: small-caps; padding: 4px 8px; text-align: left; }
.note .tbl td { border-bottom: 1px solid #e9e0cc; padding: 4px 8px; }
.note .closing { margin-top: 6px; }
.note .dn-foot { margin-top: auto; padding-top: 40px; display: grid; grid-template-columns: minmax(0, 1fr) 290px; align-items: end; gap: 26px; }
.note .dn-where { font-style: italic; font-size: 15.5px; line-height: 1.45; color: #4a4236; }
.note .dn-where > * { display: block; }
.note .dn-sign { position: relative; text-align: center; }
.note .dn-sign .sig { height: 66px; }
.note .dn-sign .name { font-variant: small-caps; font-weight: 700; letter-spacing: .04em; border-top: 1px solid #3a3326; padding-top: 4px; }
.note .dn-sign .role { font-style: italic; font-size: 14.5px; line-height: 1.3; color: #5a5040; }
.note .dn-seal { position: absolute; right: -46px; top: -44px; z-index: 1; mix-blend-mode: multiply; opacity: .9; pointer-events: none; }
.note .dn-seal svg { width: 112px; height: 112px; display: block; transform: rotate(-10deg); }
.doc.note .pg-no { right: 42px; bottom: 34px; color: #9a8f7a; }

/* ===== Протокол заседания: графы слева ===== */
.doc.minutes { display: flex; flex-direction: column; padding: 52px 64px 60px; font-family: "PT Serif", Tinos, serif; font-size: 15.5px; line-height: 1.5; }
.minutes .mt-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 14px; border-bottom: 2px solid #1d1d1d; }
.minutes .mt-from { display: flex; align-items: center; gap: 14px; min-width: 0; }
.minutes .mt-emb { width: calc(52px * var(--es, 1)); flex: none; }
.minutes .mt-org { font-family: Inter, sans-serif; font-weight: 700; font-size: 14px; line-height: 1.3; text-transform: uppercase; letter-spacing: .02em; }
.minutes .mt-en { font-family: Inter, sans-serif; font-size: 10.5px; letter-spacing: .1em; color: #8a8f99; margin-top: 3px; }
.minutes .mt-no { font-family: Inter, sans-serif; font-weight: 700; font-size: 14px; white-space: nowrap; color: var(--accent); }
.minutes .mt-no .f { display: inline; }
.minutes .mt-kind { text-align: center; font-weight: 700; font-size: 30px; letter-spacing: .4em; padding-left: .4em; margin-top: 30px; color: var(--accent); line-height: 1.2; }
.minutes .mt-meta { display: flex; justify-content: center; align-items: center; gap: 14px; font-size: 14px; color: #555; margin: 6px 0 24px; }
.minutes .mt-meta i { width: 5px; height: 5px; background: var(--accent); transform: rotate(45deg); flex: none; }
.minutes .mt-meta .f { display: inline; }
.minutes :is(.mt-row, .pre, .verb, .body, .closing, .visa) { position: relative; margin-left: 150px; padding: 7px 0 7px 20px; border-left: 1px solid #cfd3da; }
.minutes .mt-row { padding-top: 2px; }
.minutes .mt-l, .minutes .pre::before, .minutes .body:is(:not([data-part]), [data-part="2"])::before, .minutes .closing::before { position: absolute; left: -150px; top: 9px; width: 134px; text-align: right;
  font-family: Inter, sans-serif; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); line-height: 1.5; text-indent: 0; }
.minutes .mt-row > .mt-l { top: 4px; }
.minutes .pre::before { content: "Основание"; }
.minutes .body:is(:not([data-part]), [data-part="2"])::before { content: "Решение"; }
.minutes .closing::before { content: "Итог"; }
.minutes :is(.pre, .closing):empty::before { content: none; }
.minutes .mt-title { font-weight: 700; }
.minutes .pre { text-align: justify; }
.minutes .verb { font-weight: 700; letter-spacing: .2em; padding-top: 10px; }
.minutes .body { counter-reset: pt; }
.minutes .body .pt, .minutes .body > p { counter-increment: pt; position: relative; padding-left: 30px; margin-bottom: 8px; text-align: justify; }
.minutes .body .pt::before, .minutes .body > p::before { content: counter(pt) "."; position: absolute; left: 0; font-weight: 700; color: var(--accent); }
.minutes .body li { padding-left: 1em; } .minutes .body li::before { content: "–"; }
.minutes .tbl { margin: 8px 0; font-size: 14px; } .minutes .tbl th, .minutes .tbl td { border: 1px solid #c4c9d2; padding: 4px 8px; } .minutes .tbl th { background: #f3f5f8; }
.minutes .closing p { text-align: justify; margin-bottom: 4px; }
.minutes .visa { margin-top: 0; }
.minutes .mt-sign { margin-top: auto; border-left-color: transparent; padding-top: 34px; }
.minutes .mt-sign > .mt-l { top: 36px; }
.minutes .mt-sg .role { font-size: 14px; color: #444; }
.minutes .mt-sgrow { display: flex; align-items: flex-end; gap: 18px; margin-top: 4px; }
.minutes .mt-sgrow .sig { width: 210px; height: 64px; border-bottom: 1px solid #222; }
.minutes .mt-sgrow .name { font-weight: 700; }
.minutes .stamp { left: 50px; top: -34px; }
.doc.minutes .cont-head { margin-bottom: 14px; }

/* ===== Конституционное: арка ===== */
.doc.charter { display: flex; flex-direction: column; padding: 40px 84px 66px; background: #fffdf8; font-family: "EB Garamond", Tinos, serif; font-size: 16.5px; line-height: 1.5; color: #221d16; }
.charter .ch-arch { position: absolute; left: 28px; top: 28px; width: 738px; height: 300px; pointer-events: none; }
.charter .ch-sides { position: absolute; left: 28px; right: 28px; top: 328px; bottom: 28px; border: 2.5px solid var(--accent); border-top: 0; pointer-events: none; }
.charter .ch-sides::before { content: ""; position: absolute; left: 6.5px; right: 6.5px; top: 0; bottom: 6.5px; border: 1px solid var(--gold); border-top: 0; }
.charter .ch-sides.full { top: 28px; border-top: 2.5px solid var(--accent); }
.charter .ch-sides.full::before { top: 6.5px; border-top: 1px solid var(--gold); }
.charter .ch-head { text-align: center; position: relative; }
.charter .ch-key { width: calc(96px * var(--es, 1)); height: calc(96px * var(--es, 1)); margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: #fffdf8;
  border: 1.5px solid var(--gold); box-shadow: 0 0 0 5px #fffdf8, 0 0 0 6.5px var(--accent); }
.charter .ch-key img { width: 62%; }
.charter .ch-key b { color: var(--gold); font-size: 40px; line-height: 1; }
.charter .ch-state { font-family: "Cormorant Garamond", serif; font-weight: 600; font-size: 13px; letter-spacing: .44em; padding-left: .44em; color: var(--gold-dark); margin-top: 16px; }
.charter .ch-org { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 24px; line-height: 1.15; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin: 6px 40px 2px; }
.charter .ch-en { font-family: "Cormorant Garamond", serif; font-style: italic; font-weight: 500; font-size: 16px; color: #75695a; }
.charter .ch-kind { text-align: center; font-family: "Playfair Display", serif; font-weight: 700; font-size: 40px; letter-spacing: .2em; padding-left: .2em; text-transform: uppercase;
  color: var(--accent); margin-top: 34px; line-height: 1.1; }
.charter .ch-meta { display: flex; justify-content: center; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 14.5px; font-style: italic; color: #5d5446; margin-top: 8px; }
.charter .ch-meta i { color: var(--gold); font-style: normal; font-size: 10px; }
.charter .ch-meta .f { display: inline; }
.charter .ch-title { text-align: center; font-weight: 700; font-size: 17.5px; line-height: 1.35; margin: 12px 36px 0; }
.charter .ch-orn { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--gold); font-size: 15px; margin: 14px auto 18px; width: 260px; }
.charter .ch-orn i { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.charter .ch-orn i:last-child { background: linear-gradient(270deg, transparent, var(--gold)); }
.charter .pre { text-align: justify; text-indent: 2em; }
.charter .verb { text-align: center; font-family: "Playfair Display", serif; font-weight: 700; letter-spacing: .26em; padding-left: .26em; font-size: 17px; color: var(--accent); margin: 18px 0 12px; }
.charter .body { counter-reset: pt; }
.charter .body .pt, .charter .body > p { counter-increment: pt; margin: 0 0 10px; text-align: justify; }
.charter .body .pt::before, .charter .body > p::before { content: "Статья " counter(pt) ". "; font-family: "Playfair Display", serif; font-weight: 700; font-size: .9em; color: var(--accent); }
.charter .body ul { margin: 4px 0 2px 1.6em; }
.charter .body li { padding-left: 1.3em; } .charter .body li::before { content: "❖"; color: var(--gold); font-size: .8em; top: .12em; }
.charter .tbl { margin: 10px 0; font-size: 15px; } .charter .tbl th { background: var(--accent); color: #fff; padding: 5px 9px; font-weight: 600; } .charter .tbl td { border: 1px solid #ddd2bb; padding: 4px 9px; }
.charter .closing p { text-align: justify; margin-top: 4px; text-indent: 2em; }
.charter .ch-foot { margin-top: auto; padding-top: 30px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.charter .ch-seal svg { width: 138px; height: 138px; display: block; }
.charter .ch-sign { width: 310px; margin-left: auto; text-align: center; }
.charter .ch-sign .sig { height: 66px; align-items: flex-end; }
.charter .ch-sign .s-line { border-top: 1.5px solid #2c261d; }
.charter .ch-sign .name { font-weight: 700; margin-top: 6px; font-variant: small-caps; letter-spacing: .04em; }
.charter .ch-sign .role { font-style: italic; font-size: 14px; line-height: 1.3; color: #5d5446; }
.doc.charter .cont-head { margin-top: 26px; }
.doc.charter .pg-no { right: 54px; bottom: 44px; color: var(--gold-dark); }

/* ===== Сертификат: рамка-сетка на всех листах ===== */
.doc.license { display: flex; flex-direction: column; padding: 66px 80px 64px; background: #fffef9; font-family: Lora, "PT Serif", serif; font-size: 15.5px; line-height: 1.5; color: #1e1b16; }
.doc.license::before { content: ""; position: absolute; inset: 18px; border: 3px solid var(--accent); pointer-events: none; }
.license .lc-s { position: absolute; pointer-events: none; }
.license .lc-s.t, .license .lc-s.b { left: 21px; right: 21px; height: 18px; } .license .lc-s.t { top: 21px; } .license .lc-s.b { bottom: 21px; }
.license .lc-s.l, .license .lc-s.r { top: 39px; bottom: 39px; width: 18px; } .license .lc-s.l { left: 21px; } .license .lc-s.r { right: 21px; }
.doc.license::after { content: ""; position: absolute; inset: 40px; border: 1.5px solid var(--accent); outline: 1px solid var(--gold); outline-offset: 3px; pointer-events: none; }
.license .lc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.license .lc-emb { height: calc(80px * var(--es, 1)); }
.license .lc-serial { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--accent); padding: 6px 12px 6px 8px; background: #fff; }
.license .lc-serial small { display: block; font-family: Inter, sans-serif; font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #777; }
.license .lc-serial b { display: block; font-family: Cousine, monospace; font-size: 17px; color: #a5221c; letter-spacing: .05em; }
.license .lc-holo { flex: none; width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
  background: conic-gradient(from 30deg, #e9eef6, #c9d6ff, #ffd6f0, #fff3c4, #c8f5e4, #d6e2ff, #e9eef6); }
.license .lc-state { text-align: center; font-family: "Cormorant Garamond", serif; font-weight: 600; font-size: 13px; letter-spacing: .44em; padding-left: .44em; color: var(--gold-dark); margin-top: 8px; }
.license .lc-banner { display: flex; align-items: stretch; justify-content: center; margin: 10px auto 0; max-width: 580px; }
.license .lc-banner .lc-org { background: var(--accent); color: #fff; font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 18px; letter-spacing: .06em; text-transform: uppercase;
  padding: 7px 18px; line-height: 1.2; text-align: center; }
.license .lc-banner i { flex: none; width: 26px; background: color-mix(in srgb, var(--accent) 72%, #000); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 42% 50%); margin: 7px 0 -7px; }
.license .lc-banner i:last-child { clip-path: polygon(0 0, 100% 0, 58% 50%, 100% 100%, 0 100%); }
.license .lc-kind { text-align: center; font-family: "Playfair Display", serif; font-weight: 700; font-size: 48px; letter-spacing: .12em; padding-left: .12em; text-transform: uppercase;
  color: var(--accent); margin-top: 22px; line-height: 1.05; }
.license .lc-title { text-align: center; font-family: "Playfair Display", serif; font-style: italic; font-size: 19px; line-height: 1.35; margin: 10px 30px 0; }
.license .lc-meta { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: #6b6255; margin-top: 8px; font-style: italic; }
.license .lc-meta .f { display: inline; }
.license .lc-orn { height: 10px; margin: 14px auto 16px; width: 180px; background: radial-gradient(circle, var(--gold) 2px, transparent 2.4px) center / 15px 10px repeat-x; }
.license .pre { text-align: justify; }
.license .verb { text-align: center; font-weight: 700; letter-spacing: .26em; padding-left: .26em; color: var(--accent); margin: 14px 0 10px; }
.license .body { counter-reset: pt; }
.license .body .pt, .license .body > p { counter-increment: pt; position: relative; padding-left: 36px; margin-bottom: 8px; text-align: justify; }
.license .body .pt::before, .license .body > p::before { content: counter(pt); position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 11.5px; font-weight: 700; display: grid; place-items: center; line-height: 1; box-shadow: 0 0 0 2px #fffef9, 0 0 0 3px var(--gold); }
.license .body li { padding-left: 1.2em; } .license .body li::before { content: "◇"; color: var(--accent); font-size: .85em; top: .1em; }
.license .tbl { margin: 8px 0; font-size: 14.5px; } .license .tbl th { background: color-mix(in srgb, var(--accent) 10%, #fff); border: 1px solid var(--accent); padding: 4px 8px; } .license .tbl td { border: 1px solid #d9d2c0; padding: 4px 8px; }
.license .closing p { text-align: justify; margin-top: 4px; }
.license .lc-foot { margin-top: auto; padding-top: 26px; display: grid; grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr); align-items: end; gap: 16px; }
.license .lc-sign { text-align: center; } .license .lc-sign .sig { height: 62px; } .license .lc-sign .s-line { border-top: 1.5px solid #2a2620; }
.license .lc-sign .name { font-weight: 700; margin-top: 4px; } .license .lc-sign .role { font-style: italic; font-size: 13px; line-height: 1.3; color: #5a5244; }
.license .lc-seal svg { width: 150px; height: 150px; display: block; }
/* гильош-марка с номером бланка (без QR: проверки подлинности на сайте нет) */
.license .lc-mark { justify-self: end; text-align: center; }
.license .lc-ros { position: relative; width: 104px; height: 104px; margin: 0 auto 4px; }
.license .lc-ros svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.license .lc-ros b { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 78px; padding: 3px 6px; background: #fffef9; border: 1px solid var(--accent);
  font-family: Cousine, monospace; font-size: 12px; line-height: 1.2; color: #a5221c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.license .lc-mark > span { font-family: Inter, sans-serif; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #777; }
.doc.license .cont-head { margin-top: 6px; }
.doc.license .pg-no { bottom: 46px; }

/* ===== Ар-деко Лос-Сантоса ===== */
.doc.deco { display: flex; flex-direction: column; padding: 44px 86px 62px; background: #fbf7ee; font-family: Montserrat, Inter, sans-serif; font-size: 14.5px; line-height: 1.6; color: #1d1b17; }
.doc.deco::before { content: ""; position: absolute; inset: 22px; border: 1.5px solid var(--accent); box-shadow: inset 0 0 0 5px transparent, inset 0 0 0 6px var(--gold); pointer-events: none; }
.doc.deco::after { content: ""; position: absolute; inset: 30px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23b08d3c' stroke-width='1.4'%3E%3Cpath d='M1 59V1h58'/%3E%3Cpath d='M7 59V13h6V7h46'/%3E%3Cpath d='M13 59V25h6v-6h6v-6h34'/%3E%3C/g%3E%3Cpath d='M19 25h6v6h-6z' fill='%23b08d3c'/%3E%3C/svg%3E") left top / 60px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cg transform='matrix(-1 0 0 1 60 0)'%3E%3Cg fill='none' stroke='%23b08d3c' stroke-width='1.4'%3E%3Cpath d='M1 59V1h58'/%3E%3Cpath d='M7 59V13h6V7h46'/%3E%3Cpath d='M13 59V25h6v-6h6v-6h34'/%3E%3C/g%3E%3Cpath d='M19 25h6v6h-6z' fill='%23b08d3c'/%3E%3C/g%3E%3C/svg%3E") right top / 60px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cg transform='matrix(1 0 0 -1 0 60)'%3E%3Cg fill='none' stroke='%23b08d3c' stroke-width='1.4'%3E%3Cpath d='M1 59V1h58'/%3E%3Cpath d='M7 59V13h6V7h46'/%3E%3Cpath d='M13 59V25h6v-6h6v-6h34'/%3E%3C/g%3E%3Cpath d='M19 25h6v6h-6z' fill='%23b08d3c'/%3E%3C/g%3E%3C/svg%3E") left bottom / 60px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cg transform='matrix(-1 0 0 -1 60 60)'%3E%3Cg fill='none' stroke='%23b08d3c' stroke-width='1.4'%3E%3Cpath d='M1 59V1h58'/%3E%3Cpath d='M7 59V13h6V7h46'/%3E%3Cpath d='M13 59V25h6v-6h6v-6h34'/%3E%3C/g%3E%3Cpath d='M19 25h6v6h-6z' fill='%23b08d3c'/%3E%3C/g%3E%3C/svg%3E") right bottom / 60px no-repeat; }
.deco .dk-head { position: relative; width: 400px; height: 182px; margin: 0 auto; flex: none; }
.deco .dk-sun { position: absolute; inset: 0; width: 100%; height: 100%; }
.deco .dk-emb { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 108px; height: 110px; display: flex; align-items: flex-end; justify-content: center; }
.deco .dk-emb img { width: calc(66px * var(--es, 1)); margin-bottom: 8px; }
.deco .dk-emb b { color: var(--gold); font-size: 30px; line-height: 1; margin-bottom: 12px; }
.deco .dk-state { display: flex; align-items: center; justify-content: center; gap: 14px; font-weight: 700; font-size: 11px; letter-spacing: .5em; padding-left: .5em; color: var(--gold-dark); margin-top: 16px; }
.deco .dk-state i { width: 46px; height: 7px; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); }
.deco .dk-org { text-align: center; font-weight: 700; font-size: 16.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 8px 30px 0; line-height: 1.35; }
.deco .dk-kind { text-align: center; font-family: "Playfair Display", serif; font-weight: 400; font-size: 50px; letter-spacing: .28em; padding-left: .28em; text-transform: uppercase; line-height: 1.1; margin-top: 22px; color: #15130f; }
.deco .dk-meta { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: #6b6458; margin-top: 10px; }
.deco .dk-meta b { color: var(--gold); font-size: 8px; }
.deco .dk-meta .f { display: inline; }
.deco .dk-title { text-align: center; font-weight: 700; font-size: 16px; line-height: 1.45; margin: 14px 30px 0; }
.deco .dk-rule { display: flex; align-items: center; width: 300px; margin: 20px auto; }
.deco .dk-rule i { flex: 1; height: 5px; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold); }
.deco .dk-rule b { width: 11px; height: 11px; background: var(--accent); transform: rotate(45deg); margin: 0 12px; box-shadow: 0 0 0 3px #fbf7ee, 0 0 0 4px var(--gold); }
.deco .pre { text-align: justify; }
.deco .verb { text-align: center; font-weight: 700; letter-spacing: .4em; padding-left: .4em; font-size: 13px; color: var(--accent); margin: 18px 0 12px; }
.deco .body { counter-reset: pt; }
.deco .body .pt, .deco .body > p { counter-increment: pt; position: relative; padding-left: 50px; margin-bottom: 10px; text-align: justify; }
.deco .body .pt::before, .deco .body > p::before { content: counter(pt, upper-roman); position: absolute; left: 0; top: 1px; width: 34px; height: 22px; display: grid; place-items: center;
  font-family: "Playfair Display", serif; font-weight: 700; font-size: 12px; line-height: 1; color: #fbf7ee; background: var(--accent); clip-path: polygon(16% 0, 84% 0, 100% 50%, 84% 100%, 16% 100%, 0 50%); }
.deco .body li { padding-left: 1.3em; } .deco .body li::before { content: "◆"; color: var(--gold); font-size: .7em; top: .32em; }
.deco .tbl { margin: 8px 0; font-size: 13.5px; } .deco .tbl th { background: #15130f; color: #e8d9a8; padding: 5px 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 11.5px; }
.deco .tbl td { border-bottom: 1px solid #e0d6bf; padding: 5px 8px; }
.deco .closing p { text-align: justify; margin-top: 4px; }
.deco .dk-foot { margin-top: auto; padding-top: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.deco .dk-seal svg { width: 134px; height: 134px; display: block; }
.deco .dk-sign { width: 300px; margin-left: auto; text-align: center; }
.deco .dk-sign .sig { height: 64px; align-items: flex-end; }
.deco .dk-sign .s-line { height: 5px; border-top: 1px solid #15130f; border-bottom: 1px solid #15130f; }
.deco .dk-sign .name { font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; margin-top: 8px; }
.deco .dk-sign .role { font-size: 12.5px; color: #6b6458; line-height: 1.35; margin-top: 2px; }
.doc.deco .cont-head { margin-top: 18px; }

/* ===== Судебное ===== */
.doc.court { display: flex; flex-direction: column; padding: 50px 74px 64px 112px; font-family: Tinos, "Times New Roman", serif; font-size: 16px; line-height: 1.6; }
.doc.court::before { content: ""; position: absolute; left: 82px; top: 0; bottom: 0; width: 3px; border-left: 1px solid color-mix(in srgb, var(--accent) 70%, #fff); border-right: 1px solid color-mix(in srgb, var(--accent) 70%, #fff); pointer-events: none; }
.doc.court::after { content: ""; position: absolute; right: 52px; top: 0; bottom: 0; border-left: 1px solid color-mix(in srgb, var(--accent) 40%, #fff); pointer-events: none; }
.court .ct-head { text-align: center; }
.court .ct-emb { height: calc(66px * var(--es, 1)); display: block; margin: 0 auto 8px; }
.court .ct-org { font-weight: 700; font-size: 18px; text-transform: uppercase; letter-spacing: .06em; line-height: 1.25; }
.court .ct-en { font-size: 12px; letter-spacing: .16em; color: #666; margin-top: 3px; text-transform: uppercase; }
.court .ct-cap { width: 100%; border-collapse: collapse; margin: 26px 0 22px; line-height: 1.4; }
.court .ct-cap td { vertical-align: top; padding: 0; }
.court .ct-l { width: 55%; padding: 4px 14px 12px 0 !important; border-bottom: 1px solid #222; }
.court .ct-lbl { font-family: Inter, sans-serif; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #777; margin-top: 10px; }
.court .ct-lbl:first-child { margin-top: 0; }
.court .ct-place { font-style: italic; }
.court .ct-title { font-weight: 700; }
.court .ct-par { position: relative; width: 22px; overflow: hidden; }
.court .ct-par::before { content: ")\A)\A)\A)\A)\A)\A)\A)\A)\A)\A)\A)\A)\A)"; white-space: pre; position: absolute; left: 5px; top: 2px; font-size: 16px; line-height: 22px; }
.court .ct-par::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16px; background: linear-gradient(transparent, var(--paper, #fff)); }
.court .ct-r { padding: 4px 0 12px 18px !important; }
.court .ct-no { font-weight: 700; font-size: 15px; }
.court .ct-no .f { display: inline; }
.court .ct-kind { font-weight: 700; font-size: 22px; letter-spacing: .12em; margin-top: 12px; color: var(--accent); text-transform: uppercase; line-height: 1.2; }
.court .ct-date { margin-top: 8px; font-size: 14.5px; }
.court .pre, .court .body > p, .court .body .pt, .court .closing p { text-align: justify; text-indent: 1.25cm; }
.court .verb { text-align: center; font-weight: 700; letter-spacing: .3em; padding-left: .3em; margin: 18px 0 12px; }
.court .body { counter-reset: pt; }
.court .body .pt { counter-increment: pt; }
.court .body .pt::before { content: counter(pt) ". "; font-weight: 700; }
.court .body ul { padding-left: 1.25cm; } .court .body li { padding-left: 1.3em; text-align: justify; } .court .body li::before { content: "–"; }
.court .tbl { margin: 8px 0; font-size: 14.5px; line-height: 1.35; } .court .tbl th, .court .tbl td { border: 1px solid #222; padding: 4px 8px; } .court .tbl th { background: #f2f2f2; }
.court .ct-sign { margin-top: 40px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.court .ct-who { flex: 1; } .court .ct-who .role { font-size: 15px; line-height: 1.35; }
.court .ct-line { width: 270px; border-bottom: 1px solid #111; margin: 4px 0; }
.court .ct-line .sig { height: 64px; }
.court .ct-who .name { font-weight: 700; }
.court .ct-seal svg { width: 126px; height: 126px; display: block; transform: rotate(-6deg); }
.doc.court .cont-head { margin-bottom: 18px; }
.doc.court .pg-no { right: 64px; bottom: 24px; }

/* ===== Полицейский рапорт ===== */
.doc.report { display: flex; flex-direction: column; padding: 34px 40px 40px; font-family: "PT Sans", Inter, sans-serif; font-size: 14.5px; line-height: 1.5; color: #15181d; }
.report .rp-band { display: flex; align-items: center; gap: 14px; background: var(--accent); color: #fff; padding: 12px 16px; }
.report .rp-band img { width: calc(48px * var(--es, 1)); flex: none; }
.report .rp-t { flex: 1; min-width: 0; }
.report .rp-org { font-family: Inter, sans-serif; font-weight: 700; font-size: 15px; line-height: 1.25; text-transform: uppercase; letter-spacing: .03em; }
.report .rp-en { font-family: Inter, sans-serif; font-size: 10.5px; letter-spacing: .12em; opacity: .82; margin-top: 2px; }
.report .rp-form { text-align: right; border-left: 1px solid rgba(255, 255, 255, .4); padding-left: 14px; font-family: Inter, sans-serif; }
.report .rp-form small { display: block; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .82; }
.report .rp-form b { font-size: 15px; letter-spacing: .06em; white-space: nowrap; }
.report .rp-band.slim { padding: 8px 14px; margin-bottom: 18px; }
.report .rp-band.slim .rp-org { font-size: 12.5px; }
.report .rp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-left: 1.5px solid #15181d; border-top: 1.5px solid #15181d; margin-top: 10px; }
.report .rp-c { border-right: 1.5px solid #15181d; border-bottom: 1.5px solid #15181d; padding: 5px 10px 7px; min-width: 0; }
.report .rp-c.w2 { grid-column: span 2; } .report .rp-c.w3 { grid-column: span 3; }
.report .rp-l { display: block; font-family: Inter, sans-serif; font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #6a717d; margin-bottom: 2px; }
.report .rp-kind { font-weight: 700; letter-spacing: .08em; color: var(--accent); }
.report .rp-title { font-weight: 700; }
.report .rp-chk { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font-size: 13.5px; }
.report .rp-chk::before { content: ""; flex: none; width: 12px; height: 12px; border: 1.5px solid #15181d; border-radius: 2px; }
.report .rp-chk.on::before { background: linear-gradient(45deg, transparent 43%, #15181d 43% 57%, transparent 57%), linear-gradient(-45deg, transparent 43%, #15181d 43% 57%, transparent 57%); }
.report .rp-sec { margin: 18px 0 10px; background: #e9ecf1; border-left: 4px solid var(--accent); padding: 5px 12px; font-family: Inter, sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #3b4250; }
.report .pre { text-align: justify; }
.report .verb { font-weight: 700; letter-spacing: .14em; margin: 12px 0 8px; }
.report .body { counter-reset: pt; }
.report .body .pt, .report .body > p { counter-increment: pt; position: relative; padding-left: 38px; margin-bottom: 7px; text-align: justify; }
.report .body .pt::before, .report .body > p::before { content: counter(pt, decimal-leading-zero); position: absolute; left: 0; top: 2px; font-family: Inter, sans-serif; font-weight: 700; font-size: 11.5px; line-height: 1.5;
  color: #fff; background: #3b4250; border-radius: 3px; padding: 0 5px; }
.report .body li { padding-left: 1em; } .report .body li::before { content: "▪"; color: var(--accent); }
.report .tbl { margin: 8px 0; font-size: 13.5px; } .report .tbl th, .report .tbl td { border: 1px solid #15181d; padding: 3px 7px; } .report .tbl th { background: #e9ecf1; font-family: Inter, sans-serif; font-size: 11.5px; }
.report .closing p { margin-top: 4px; text-align: justify; }
.report .rp-signw { margin-top: auto; padding-top: 26px; }
.report .rp-sign { display: grid; grid-template-columns: minmax(0, 1fr) 210px; border-left: 1.5px solid #15181d; border-top: 1.5px solid #15181d; }
.report .rp-sign .rp-c { padding: 8px 12px 10px; }
.report .rp-sign .role { font-size: 13.5px; line-height: 1.35; }
.report .rp-sg { display: flex; align-items: flex-end; gap: 14px; margin-top: 6px; }
.report .rp-sg .sig { width: 200px; height: 58px; border-bottom: 1px solid #15181d; }
.report .rp-sg .name { font-weight: 700; }
.report .rp-mp { position: relative; min-height: 132px; }
.report .rp-mp .stamp { left: 34px; top: 12px; width: 140px; height: 140px; }
.doc.report .pg-no { right: 40px; bottom: 16px; }

/* ===== Медицинское (EMS) ===== */
.doc.ems { display: flex; flex-direction: column; padding: 40px 56px 44px; font-family: Inter, sans-serif; font-size: 14px; line-height: 1.6; color: #172030; }
.ems .ms-wm { position: absolute; right: -70px; bottom: 140px; width: 430px; height: 430px; opacity: .045; pointer-events: none; }
.ems .ms-head { display: flex; align-items: center; gap: 16px; }
.ems .ms-emb { width: calc(56px * var(--es, 1)); flex: none; }
.ems .ms-t { flex: 1; min-width: 0; }
.ems .ms-org { font-weight: 700; font-size: 17px; line-height: 1.25; color: #101826; }
.ems .ms-en { font-size: 10.5px; letter-spacing: .12em; color: #7b8494; margin-top: 3px; text-transform: uppercase; }
.ems .ms-star { width: calc(72px * var(--es, 1)); height: calc(72px * var(--es, 1)); flex: none; }
.ems .ms-ecg { display: block; width: calc(100% + 112px); height: 40px; margin: 12px -56px 0; }
.ems .ms-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ems .ms-chips > span { background: color-mix(in srgb, var(--accent) 8%, #fff); border: 1px solid color-mix(in srgb, var(--accent) 24%, #fff); border-radius: 999px; padding: 3px 12px; font-size: 12.5px; font-weight: 500; color: #263042; }
.ems .ms-chips .f { display: inline; }
.ems .ms-kind { font-weight: 700; font-size: 22px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-top: 22px; }
.ems .ms-title { font-weight: 700; font-size: 18px; line-height: 1.35; margin: 4px 0 18px; }
.ems .pre { text-align: justify; color: #2c3546; }
.ems .verb { font-weight: 700; letter-spacing: .16em; margin: 16px 0 10px; color: var(--accent); }
.ems .body { counter-reset: pt; }
.ems .body .pt, .ems .body > p { counter-increment: pt; position: relative; padding-left: 38px; margin-bottom: 9px; text-align: justify; }
.ems .body .pt::before, .ems .body > p::before { content: counter(pt); position: absolute; left: 0; top: 1px; width: 24px; height: 22px; border: 1.5px solid var(--accent); border-radius: 6px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--accent); line-height: 1; }
.ems .body li { padding-left: 1.1em; } .ems .body li::before { content: "+"; font-weight: 700; color: var(--accent); }
.ems .tbl { margin: 8px 0; font-size: 13px; } .ems .tbl th { background: var(--accent); color: #fff; padding: 5px 8px; text-align: left; font-weight: 600; } .ems .tbl td { border-bottom: 1px solid #e3e8ef; padding: 4px 8px; }
.ems .closing p { margin-top: 4px; }
.ems .ms-sign { margin-top: auto; padding-top: 30px; display: flex; align-items: flex-end; gap: 26px; }
.ems .ms-seal svg { width: 118px; height: 118px; display: block; }
.ems .ms-who { flex: 1; text-align: right; }
.ems .ms-who .role { font-size: 13px; color: #556075; }
.ems .ms-who .sig { justify-content: flex-end; height: 62px; }
.ems .ms-who .name { display: inline-block; min-width: 240px; font-weight: 700; font-size: 15.5px; border-top: 2px solid var(--accent); padding-top: 4px; }
.doc.ems .cont-head { margin-top: 8px; }

/* ===== Приказ по части ===== */
.doc.order { display: flex; flex-direction: column; padding: 46px 62px 56px; font-family: "PT Serif", Tinos, serif; font-size: 15.5px; line-height: 1.5; }
.doc.order::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14px; pointer-events: none;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 12px, color-mix(in srgb, var(--accent) 40%, #ece6cf) 12px 24px); }
.doc.order::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 12px, color-mix(in srgb, var(--accent) 40%, #ece6cf) 12px 24px) left bottom / 100% 14px no-repeat,
    linear-gradient(color-mix(in srgb, var(--accent) 7%, transparent) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, transparent) 1px, transparent 1px) 0 0 / 28px 28px; }
.order .od-top { display: flex; justify-content: space-between; gap: 16px; font-family: Inter, sans-serif; font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #6b6f62; }
.order .od-head { text-align: center; margin-top: 18px; }
.order .od-emb { height: calc(70px * var(--es, 1)); display: block; margin: 0 auto 10px; }
.order .od-org { font-family: Montserrat, Inter, sans-serif; font-weight: 700; font-size: 15px; line-height: 1.35; letter-spacing: .1em; text-transform: uppercase; }
.order .od-kindrow { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.order .od-kindrow i { flex: 1; height: 8px; background: repeating-linear-gradient(-45deg, var(--accent) 0 4px, transparent 4px 8px); }
.order .od-kind { font-family: Montserrat, Inter, sans-serif; font-weight: 700; font-size: 34px; letter-spacing: .3em; padding-left: .3em; color: var(--accent); text-transform: uppercase; line-height: 1.1; }
.order .od-meta { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; margin-top: 14px; padding: 8px 0; border-top: 2px solid #1b1d17; border-bottom: 1px solid #1b1d17; font-size: 14px; }
.order .od-meta > :nth-child(2) { text-align: center; font-style: italic; } .order .od-meta > :last-child { text-align: right; font-weight: 700; }
.order .od-meta .f { display: inline; }
.order .od-title { text-align: center; font-weight: 700; margin: 18px 40px 16px; line-height: 1.35; }
.order .pre, .order .closing p { text-align: justify; text-indent: 1.25cm; }
.order .verb { font-family: Montserrat, Inter, sans-serif; font-weight: 700; letter-spacing: .3em; margin: 18px 0 12px; }
.order .body { counter-reset: pt; }
.order .body .pt, .order .body > p { counter-increment: pt; position: relative; padding-left: 52px; margin-bottom: 9px; text-align: justify; }
.order .body .pt::before, .order .body > p::before { content: "§" counter(pt); position: absolute; left: 0; top: 0; width: 34px; padding-right: 7px; text-align: right; border-right: 2px solid var(--accent);
  font-family: Montserrat, Inter, sans-serif; font-weight: 700; font-size: 14px; color: var(--accent); }
.order .body li { padding-left: 1.1em; } .order .body li::before { content: "▸"; color: var(--accent); }
.order .tbl { margin: 8px 0; font-size: 14px; } .order .tbl th, .order .tbl td { border: 1px solid #1b1d17; padding: 4px 8px; }
.order .tbl th { background: color-mix(in srgb, var(--accent) 12%, #fff); font-family: Montserrat, sans-serif; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.order .closing { margin-top: 6px; }
.order .od-sign { margin-top: auto; padding-top: 36px; }
.order .od-sign .role { font-family: Montserrat, Inter, sans-serif; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; max-width: 70%; line-height: 1.4; }
.order .od-sgrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 8px; }
.order .od-sgrow .sig { width: 240px; height: 66px; border-bottom: 1.5px solid #1b1d17; }
.order .od-sgrow .name { font-weight: 700; font-size: 16px; }
.order .stamp { left: 272px; top: -46px; width: 128px; height: 128px; }
.doc.order .cont-head { margin-top: 6px; }
.doc.order .pg-no { right: 34px; bottom: 22px; }

/* ===== Пресс-релиз ===== */
.doc.press { display: flex; flex-direction: column; padding: 0 64px 48px; font-family: Inter, sans-serif; font-size: 14.5px; line-height: 1.65; color: #16191f; }
.doc.press::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: var(--accent); box-shadow: 0 5px 0 -2px #e2402b; pointer-events: none; }
.press .pr-mast { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 42px 0 14px; border-bottom: 3px solid #16191f; }
.press .pr-word { font-family: Montserrat, Inter, sans-serif; font-weight: 700; font-size: 46px; line-height: .95; letter-spacing: -.01em; text-transform: uppercase; color: var(--accent); }
.press .pr-from { display: flex; align-items: center; gap: 10px; text-align: right; max-width: 320px; }
.press .pr-from img { width: calc(46px * var(--es, 1)); flex: none; order: 2; }
.press .pr-org { font-weight: 700; font-size: 13px; line-height: 1.3; }
.press .pr-en { font-size: 10.5px; letter-spacing: .08em; color: #7a808c; margin-top: 2px; }
.press .pr-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px 0; border-bottom: 1px solid #d5d9e0; font-size: 12.5px; font-weight: 600; color: #4a5160; }
.press .pr-now { color: #e2402b; letter-spacing: .14em; text-transform: uppercase; font-size: 11px; font-weight: 700; }
.press .pr-eyebrow { display: flex; gap: 10px; align-items: baseline; margin-top: 30px; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.press .pr-eyebrow .f { display: inline; } .press .pr-eyebrow > span { color: #7a808c; letter-spacing: .06em; }
.press .pr-title { font-family: "Playfair Display", serif; font-weight: 700; font-size: 30px; line-height: 1.15; margin: 8px 0 18px; color: #101318; }
.press .pr-dl { font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.press .pr-dl .f { display: inline; }
.press .pr-dl::after { content: " —"; }
.press .pre { font-size: 16px; line-height: 1.6; color: #252a33; }
.press .verb { font-weight: 700; letter-spacing: .14em; margin: 16px 0 8px; font-size: 13px; color: var(--accent); }
.press .body { counter-reset: pt; }
.press .body .pt, .press .body > p { counter-increment: pt; position: relative; padding-left: 26px; margin-bottom: 9px; }
.press .body .pt::before, .press .body > p::before { content: ""; position: absolute; left: 3px; top: .62em; width: 9px; height: 9px; background: var(--accent); }
.press .body li { padding-left: 1em; } .press .body li::before { content: "–"; color: #7a808c; }
.press .tbl { margin: 10px 0; font-size: 13px; } .press .tbl th { text-align: left; border-bottom: 2px solid #16191f; padding: 5px 8px 5px 0; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.press .tbl td { border-bottom: 1px solid #e3e6eb; padding: 5px 8px 5px 0; }
.press .closing { color: #3a404c; } .press .closing p { margin-top: 4px; }
.press .pr-end { text-align: center; font-weight: 700; letter-spacing: .5em; padding-left: .5em; color: #9aa1ad; margin: 20px 0 0; font-size: 14px; }
.press .pr-contact { margin-top: auto; padding-top: 30px; display: flex; align-items: flex-end; gap: 24px; }
.press .pr-sg { flex: 1; border-left: 3px solid var(--accent); padding-left: 16px; }
.press .pr-cl { font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #9aa1ad; }
.press .pr-sg .sig { justify-content: flex-start; height: 58px; }
.press .pr-sg .name { font-weight: 700; font-size: 15px; } .press .pr-sg .role { font-size: 12.5px; color: #5d6472; line-height: 1.35; }
.press .pr-seal svg { width: 110px; height: 110px; display: block; }
.doc.press .cont-head { margin-top: 36px; }
.doc.press .pg-no { right: 40px; bottom: 18px; }

/* ===== Казначейский чек ===== */
.doc.cheque { display: flex; flex-direction: column; padding: 44px 58px 46px; background: #f7f8f2; font-family: "PT Serif", Tinos, serif; font-size: 15px; line-height: 1.5; color: #1b2220; }
.cheque .cq-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.cheque .cq-micro { position: absolute; left: 0; right: 0; top: 16px; height: 9px; overflow: hidden; white-space: nowrap; text-align: center; pointer-events: none;
  font-family: Inter, sans-serif; font-size: 6.5px; line-height: 9px; letter-spacing: .1em; color: color-mix(in srgb, var(--accent) 70%, #fff); }
.cheque .cq-head { display: grid; grid-template-columns: 104px minmax(0, 1fr) 190px; align-items: center; gap: 18px; border: 1.5px solid var(--accent); background: rgba(255, 255, 255, .72); padding: 12px 14px; }
.cheque .cq-ros { position: relative; width: 104px; height: 104px; }
.cheque .cq-ros svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cheque .cq-ros img { position: absolute; left: 50%; top: 50%; width: calc(52px * var(--es, 1)); transform: translate(-50%, -50%); }
.cheque .cq-state { font-family: Inter, sans-serif; font-size: 10.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.cheque .cq-org { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 21px; line-height: 1.15; margin-top: 4px; text-transform: uppercase; }
.cheque .cq-en { font-family: "Cormorant Garamond", serif; font-style: italic; font-size: 14px; color: #5c6762; }
.cheque .cq-serial { text-align: right; border-left: 1px dashed color-mix(in srgb, var(--accent) 60%, #fff); padding-left: 14px; font-size: 13px; }
.cheque .cq-serial small { display: block; font-family: Inter, sans-serif; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: #6e7a75; }
.cheque .cq-serial b { display: block; font-family: Cousine, monospace; font-size: 19px; color: #b3261e; letter-spacing: .04em; margin: 2px 0 4px; }
.cheque .cq-serial b .f { display: inline; }
.cheque .cq-kindrow { display: flex; align-items: center; gap: 14px; margin: 22px 0 14px; }
.cheque .cq-kindrow i { flex: 1; height: 7px; border-top: 1px solid var(--accent); border-bottom: 1px solid var(--accent); }
.cheque .cq-kind { font-family: "Cormorant Garamond", serif; font-weight: 700; font-size: 38px; letter-spacing: .24em; padding-left: .24em; color: var(--accent); text-transform: uppercase; line-height: 1; }
.cheque .cq-line { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; align-items: baseline; border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, #fff); padding: 4px 0; }
.cheque .cq-l { font-family: Inter, sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #6e7a75; }
.cheque .cq-title { font-weight: 700; }
.cheque .pre { text-align: justify; margin-top: 16px; }
.cheque .verb { font-weight: 700; letter-spacing: .2em; margin: 14px 0 8px; color: var(--accent); }
.cheque .body { counter-reset: pt; }
.cheque .body .pt, .cheque .body > p { counter-increment: pt; position: relative; padding-left: 34px; margin-bottom: 8px; text-align: justify; }
.cheque .body .pt::before, .cheque .body > p::before { content: counter(pt, decimal-leading-zero); position: absolute; left: 0; top: 0; font-family: Cousine, monospace; font-weight: 700; font-size: 14px; color: #b3261e; }
.cheque .body li { padding-left: 1em; } .cheque .body li::before { content: "·"; font-weight: 700; color: var(--accent); }
.cheque .tbl { margin: 8px 0; font-size: 14px; } .cheque .tbl th { background: color-mix(in srgb, var(--accent) 12%, #fff); border: 1px solid color-mix(in srgb, var(--accent) 50%, #fff); padding: 4px 8px; }
.cheque .tbl td { border: 1px solid color-mix(in srgb, var(--accent) 30%, #fff); padding: 4px 8px; background: rgba(255, 255, 255, .6); }
.cheque .closing p { margin-top: 4px; text-align: justify; }
.cheque .cq-foot { margin-top: auto; padding-top: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.cheque .cq-sign { width: 320px; } .cheque .cq-sign .sig { height: 62px; justify-content: flex-start; } .cheque .cq-sign .s-line { border-top: 1.5px solid #1b2220; }
.cheque .cq-sign .name { font-weight: 700; margin-top: 4px; } .cheque .cq-sign .role { font-style: italic; font-size: 13.5px; color: #4e5955; line-height: 1.3; }
.cheque .cq-seal svg { width: 124px; height: 124px; display: block; }
.cheque .cq-micr { margin: 18px -58px 0; padding: 10px 58px 0; border-top: 1px dashed color-mix(in srgb, var(--accent) 60%, #fff); font-family: Cousine, monospace; font-size: 16px; letter-spacing: .24em; white-space: nowrap; overflow: hidden; }
.doc.cheque .cont-head { margin-top: 4px; }
.doc.cheque .pg-no { right: 34px; bottom: 14px; }

/* ===== Объявление ===== */
.doc.poster { display: flex; flex-direction: column; padding: 0 56px 46px; font-family: Montserrat, Inter, sans-serif; font-size: 16px; line-height: 1.55; color: #121417; }
.poster .ps-top { margin: 0 -56px; padding: 34px 56px 28px; background: var(--accent); color: #fff; background-image: radial-gradient(rgba(255, 255, 255, .09) 1.2px, transparent 1.4px); background-size: 12px 12px; }
.poster .ps-from { display: flex; align-items: center; gap: 12px; }
.poster .ps-from img { width: calc(46px * var(--es, 1)); }
.poster .ps-org { font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; line-height: 1.3; }
.poster .ps-en { font-size: 11px; letter-spacing: .1em; opacity: .82; }
.poster .ps-kindw { margin-top: 20px; font-weight: 700; line-height: .98; letter-spacing: .01em; text-transform: uppercase; }
.poster .ps-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 12px 0; border-bottom: 4px solid #121417; font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.poster .ps-meta .f { display: inline; }
.poster .ps-title { font-family: "Playfair Display", serif; font-weight: 700; font-size: 31px; line-height: 1.15; margin: 22px 0 4px; }
.poster .ps-rule { width: 120px; height: 8px; background: var(--accent); margin: 14px 0 20px; }
.poster .pre { font-size: 17px; }
.poster .verb { font-weight: 700; font-size: 18px; letter-spacing: .1em; margin: 18px 0 10px; color: var(--accent); }
.poster .body { counter-reset: pt; }
.poster .body .pt, .poster .body > p { counter-increment: pt; position: relative; padding-left: 58px; margin-bottom: 14px; min-height: 40px; }
.poster .body .pt::before, .poster .body > p::before { content: counter(pt); position: absolute; left: 0; top: -5px; font-weight: 700; font-size: 38px; line-height: 1; color: var(--accent); }
.poster .body li { padding-left: 1.1em; } .poster .body li::before { content: "●"; color: var(--accent); font-size: .55em; top: .55em; }
.poster .tbl { margin: 10px 0; font-size: 14px; } .poster .tbl th { background: #121417; color: #fff; padding: 6px 10px; text-align: left; } .poster .tbl td { border-bottom: 2px solid #e5e7eb; padding: 6px 10px; }
.poster .closing { font-weight: 700; } .poster .closing p { margin-top: 6px; }
.poster .ps-foot { margin-top: auto; padding-top: 30px; display: flex; align-items: flex-end; gap: 24px; }
.poster .ps-who { flex: 1; } .poster .ps-who .role { font-size: 13px; color: #5b616b; line-height: 1.35; } .poster .ps-who .name { font-weight: 700; font-size: 18px; }
.poster .ps-foot .sig { width: 220px; height: 70px; }
.poster .ps-seal svg { width: 104px; height: 104px; display: block; }
.poster .ps-strip { margin: 0 -56px 28px; height: 18px; background: var(--accent); }
.doc.poster .pg-no { right: 30px; bottom: 16px; }

/* ===== Секретно: папка дела ===== */
.doc.secret { display: flex; flex-direction: column; padding: 60px 64px 48px; background: #f1e7cf; font-family: Cousine, "Courier New", monospace; font-size: 14px; line-height: 1.55; color: #1f1b14; }
.doc.secret::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(120% 85% at 50% 40%, transparent 60%, rgba(120, 90, 40, .14) 100%); }
.secret .sk-tab { position: absolute; top: 0; right: 76px; background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .1em; padding: 6px 16px 7px; border-radius: 0 0 8px 8px; text-transform: uppercase; }
.secret .sk-clip { position: absolute; left: 46px; top: -12px; width: 26px; height: 76px; transform: rotate(-6deg); pointer-events: none; }
.secret .sk-stamp { position: absolute; right: 64px; top: 64px; z-index: 3; transform: rotate(-11deg); max-width: 300px; border: 4px double #b3261e; border-radius: 4px; padding: 4px 14px;
  color: #b3261e; font-family: Inter, sans-serif; font-weight: 700; font-size: 25px; line-height: 1.15; letter-spacing: .16em; text-align: center; mix-blend-mode: multiply; opacity: .86; }
.secret .sk-head { display: flex; align-items: center; gap: 14px; padding-right: 260px; min-height: 60px; }
.secret .sk-head img { width: calc(54px * var(--es, 1)); }
.secret .sk-org { font-weight: 700; font-size: 15px; line-height: 1.3; text-transform: uppercase; }
.secret .sk-en { font-size: 11px; letter-spacing: .06em; color: #6b604c; margin-top: 3px; }
.secret .sk-meta { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 3px 12px; margin: 22px 0 20px; padding: 12px 16px; border: 1.5px dashed #6b604c; background: rgba(255, 255, 255, .35); }
.secret .sk-l { font-weight: 700; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: #6b604c; }
.secret .sk-t { font-weight: 700; }
.secret .verb { font-weight: 700; letter-spacing: .14em; margin: 14px 0 8px; }
.secret .body { counter-reset: pt; }
.secret .body .pt, .secret .body > p { counter-increment: pt; padding-left: 4ch; text-indent: -4ch; margin-bottom: 7px; }
.secret .body .pt::before, .secret .body > p::before { content: counter(pt) "."; display: inline-block; width: 4ch; text-indent: 0; font-weight: 700; }
.secret .body ul { margin: 2px 0; text-indent: 0; }
.secret .body li { padding-left: 2ch; } .secret .body li::before { content: "-"; }
.secret .tbl { margin: 6px 0; font-size: 12.5px; text-indent: 0; } .secret .tbl th, .secret .tbl td { border: 1px solid #3a3326; padding: 2px 7px; } .secret .tbl th { background: rgba(0, 0, 0, .06); }
.secret .closing { margin-top: 8px; }
.secret .sk-sign { position: relative; margin-top: auto; padding-top: 34px; }
.secret .sk-sign .role { font-weight: 700; font-size: 13px; max-width: 60%; }
.secret .sk-sgrow { display: flex; align-items: flex-end; gap: 16px; margin-top: 4px; }
.secret .sk-line { width: 230px; border-bottom: 1.5px solid #1f1b14; display: flex; justify-content: center; align-items: flex-end; height: 60px; }
.secret .sk-sgrow .name { font-weight: 700; }
.secret .sk-seal { position: absolute; right: 6px; bottom: -10px; }
.secret .sk-seal .stamp { position: static; display: block; transform: rotate(-8deg); }
.secret .sk-foot { display: flex; justify-content: space-between; margin-top: 18px; padding-top: 8px; border-top: 1px dashed #6b604c; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: #6b604c; }
.doc.secret .cont-head { border-color: #b9ab8a; margin-top: 4px; }
.doc.secret .pg-no { right: 30px; bottom: 14px; color: #6b604c; }

/* ===== Ретро 50-х ===== */
.doc.retro { display: flex; flex-direction: column; padding: 46px 64px 54px; background: #f7f0de; font-family: "PT Sans", Inter, sans-serif; font-size: 15px; line-height: 1.55; color: #24211c; }
.doc.retro::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; pointer-events: none; background: linear-gradient(var(--accent) 0 5px, transparent 5px 7px, #e0613a 7px 10px, transparent 10px); }
.doc.retro::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; pointer-events: none; background: linear-gradient(transparent 0 2px, #e0613a 2px 5px, transparent 5px 7px, var(--accent) 7px); }
.retro .rt-atom { position: absolute; width: 34px; height: 34px; pointer-events: none; }
.retro .rt-atom.a1 { right: 70px; top: 42px; } .retro .rt-atom.a2 { right: 122px; top: 92px; width: 20px; height: 20px; } .retro .rt-atom.a3 { right: 46px; top: 120px; width: 16px; height: 16px; }
.retro .rt-badge { display: flex; align-self: flex-start; align-items: center; gap: 14px; max-width: 540px; background: var(--accent); color: #fff; border-radius: 999px; padding: 10px 28px 10px 12px; box-shadow: 5px 5px 0 #e0613a; }
.retro .rt-badge img { width: calc(52px * var(--es, 1)); }
.retro .rt-org { font-family: "Playfair Display", serif; font-style: italic; font-weight: 700; font-size: 18px; line-height: 1.2; }
.retro .rt-en { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .85; margin-top: 2px; }
.retro .rt-kindw { margin-top: 24px; }
.retro .rt-kind { font-family: "Marck Script", "Great Vibes", cursive; font-size: 62px; line-height: 1.05; color: var(--accent); text-transform: lowercase; }
.retro .rt-kind::first-letter { text-transform: uppercase; }
.retro .rt-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.retro .rt-meta > span { border: 2px solid #24211c; border-radius: 999px; padding: 1px 12px; font-size: 12.5px; font-weight: 700; background: #fff8e6; }
.retro .rt-meta .f { display: inline; }
.retro .rt-title { font-family: "Playfair Display", serif; font-weight: 700; font-size: 22px; line-height: 1.25; margin: 16px 0 2px; }
.retro .rt-wave { display: block; width: 180px; height: 14px; margin: 10px 0 16px; }
.retro .pre { text-align: justify; }
.retro .verb { font-family: "Playfair Display", serif; font-style: italic; font-weight: 700; font-size: 20px; color: #e0613a; margin: 14px 0 10px; }
.retro .body { counter-reset: pt; }
.retro .body .pt, .retro .body > p { counter-increment: pt; position: relative; padding-left: 46px; margin-bottom: 10px; min-height: 30px; text-align: justify; }
.retro .body .pt::before, .retro .body > p::before { content: counter(pt); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 14px; line-height: 1; display: grid; place-items: center; box-shadow: 3px 3px 0 #e0613a; }
.retro .body li { padding-left: 1.3em; } .retro .body li::before { content: "✦"; color: #e0613a; font-size: .85em; top: .08em; }
.retro .tbl { margin: 8px 0; font-size: 14px; } .retro .tbl th { background: var(--accent); color: #fff; padding: 5px 9px; } .retro .tbl td { border-bottom: 2px dotted #c9bd9c; padding: 5px 9px; }
.retro .closing p { margin-top: 4px; }
.retro .rt-foot { margin-top: auto; padding-top: 30px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.retro .rt-seal svg { width: 118px; height: 118px; display: block; transform: rotate(-8deg); }
.retro .rt-sign { width: 300px; margin-left: auto; text-align: center; }
.retro .rt-sign .sig { height: 64px; } .retro .rt-sign .s-line { border-top: 2px solid #24211c; }
.retro .rt-sign .name { font-weight: 700; margin-top: 4px; } .retro .rt-sign .role { font-size: 13px; color: #6b6352; line-height: 1.3; }
.doc.retro .cont-head { margin-top: 10px; }
.doc.retro .pg-no { right: 30px; bottom: 18px; }

/* ===== Телеграмма: текст наклеенными полосками ===== */
.doc.telegram { display: flex; flex-direction: column; padding: 40px 50px 46px; background: #f3edd6; font-family: Cousine, monospace; font-size: 14px; line-height: 1.5; color: #1d1a12; }
.telegram .tg-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 3px double var(--accent); padding-bottom: 10px; color: var(--accent); }
.telegram .tg-word { font-family: "Old Standard TT", Tinos, serif; font-weight: 700; font-size: 44px; letter-spacing: .14em; text-transform: uppercase; line-height: 1; }
.telegram .tg-svc { display: flex; align-items: center; gap: 10px; text-align: right; font-family: Inter, sans-serif; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; line-height: 1.5; }
.telegram .tg-svc img { width: calc(44px * var(--es, 1)); order: 2; }
.telegram .tg-head.slim { margin-bottom: 16px; } .telegram .tg-head.slim .tg-word { font-size: 24px; }
.telegram .tg-form { width: 100%; border-collapse: collapse; margin: 12px 0 16px; font-size: 13.5px; }
.telegram .tg-form td { border: 1px solid color-mix(in srgb, var(--accent) 55%, #f3edd6); padding: 4px 8px 6px; vertical-align: top; }
.telegram .tg-n { width: 150px; } .telegram .tg-d { width: 210px; }
.telegram .tg-l { display: block; font-family: Inter, sans-serif; font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--accent) 80%, #555); }
.telegram .tg-org { font-weight: 700; }
.telegram :is(.tg-subj, .pre, .verb, .body .pt, .body > p, .closing p) { background: #fffef9; box-shadow: 0 1px 1.5px rgba(60, 50, 20, .24); padding: 3px 10px; text-transform: uppercase; letter-spacing: .02em; }
.telegram .tg-subj { font-weight: 700; margin-bottom: 12px; }
.telegram .pre { margin-bottom: 8px; }
.telegram .verb { font-weight: 700; display: table; margin: 6px 0 8px; }
.telegram .body { counter-reset: pt; }
.telegram .body .pt, .telegram .body > p { counter-increment: pt; margin-bottom: 6px; }
.telegram .body .pt::before, .telegram .body > p::before { content: counter(pt) ". "; font-weight: 700; }
.telegram .body ul { margin: 2px 0 0 2ch; }
.telegram .body li { padding-left: 2ch; } .telegram .body li::before { content: "-"; }
.telegram .tbl { margin: 6px 0; font-size: 12.5px; background: #fffef9; } .telegram .tbl th, .telegram .tbl td { border: 1px solid #b9b090; padding: 2px 6px; }
.telegram .closing { margin-top: 6px; } .telegram .closing p { margin-bottom: 6px; }
.telegram .tg-sign { position: relative; margin-top: auto; padding-top: 24px; }
.telegram .tg-sign > .tg-l { border-top: 1px solid color-mix(in srgb, var(--accent) 55%, #f3edd6); padding-top: 6px; }
.telegram .tg-row { display: flex; align-items: flex-end; gap: 20px; margin-top: 6px; }
.telegram .tg-who { flex: 1; } .telegram .tg-who .role { font-size: 13px; } .telegram .tg-who .name { font-weight: 700; }
.telegram .tg-row .sig { width: 230px; height: 62px; border-bottom: 1px solid #1d1a12; }
.telegram .tg-seal { position: absolute; right: 230px; top: 10px; }
.telegram .tg-seal .stamp { position: static; display: block; width: 118px; height: 118px; }
.doc.telegram .pg-no { right: 30px; bottom: 16px; }

/* ===== Полночь ===== */
.doc.midnight { display: flex; flex-direction: column; padding: 56px 66px 52px 88px; background-color: #0c1016; color: #e6e9ef; font-family: Inter, sans-serif; font-size: 14.5px; line-height: 1.6;
  --gold: #d4b062; --gold-dark: #b8914a; }
.doc.midnight::before { content: ""; position: absolute; left: 46px; top: 40px; bottom: 40px; width: 2px; pointer-events: none; background: linear-gradient(var(--gold), color-mix(in srgb, var(--gold) 25%, transparent)); }
.doc.midnight::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(90% 50% at 100% 0%, color-mix(in srgb, var(--accent) 50%, transparent), transparent 70%); }
.midnight .mi-head { display: flex; align-items: center; gap: 20px; }
.midnight .mi-seal svg { width: calc(92px * var(--es, 1)); height: calc(92px * var(--es, 1)); display: block; }
.midnight .mi-state { font-size: 10.5px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.midnight .mi-org { font-family: "Playfair Display", serif; font-weight: 700; font-size: 22px; line-height: 1.2; color: #fff; margin-top: 4px; }
.midnight .mi-en { font-size: 11.5px; letter-spacing: .06em; color: #8f99ab; margin-top: 2px; }
.midnight .mi-rule { height: 1px; background: linear-gradient(90deg, var(--gold), transparent); margin: 26px 0 22px; }
.midnight .mi-kind { font-family: "Playfair Display", serif; font-weight: 700; font-size: 46px; letter-spacing: .12em; line-height: 1; text-transform: uppercase; color: var(--gold); }
.midnight .mi-title { font-weight: 600; font-size: 18px; line-height: 1.35; color: #fff; margin-top: 12px; max-width: 94%; }
.midnight .mi-meta { display: flex; flex-wrap: wrap; gap: 6px 0; margin: 14px 0 22px; font-size: 12.5px; color: #8f99ab; }
.midnight .mi-meta > span + span::before { content: "◆"; color: var(--gold); font-size: 8px; margin: 0 14px; vertical-align: 2px; }
.midnight .mi-meta .f { display: inline; }
.midnight .pre { color: #cdd3de; text-align: justify; }
.midnight .verb { font-weight: 700; letter-spacing: .3em; color: var(--gold); margin: 16px 0 10px; font-size: 13px; }
.midnight .body { counter-reset: pt; }
.midnight .body .pt, .midnight .body > p { counter-increment: pt; position: relative; padding-left: 46px; margin-bottom: 11px; text-align: justify; }
.midnight .body .pt::before, .midnight .body > p::before { content: counter(pt, decimal-leading-zero); position: absolute; left: 0; top: -2px; font-family: "Playfair Display", serif; font-size: 20px; line-height: 1.3; color: var(--gold); }
.midnight .body li { padding-left: 1.3em; color: #cdd3de; } .midnight .body li::before { content: "—"; color: var(--gold); }
.midnight .tbl { margin: 8px 0; font-size: 13.5px; } .midnight .tbl th { border-bottom: 1.5px solid var(--gold); color: var(--gold); padding: 5px 8px; text-align: left; font-weight: 600; }
.midnight .tbl td { border-bottom: 1px solid rgba(255, 255, 255, .12); padding: 5px 8px; }
.midnight .closing, .midnight .visa { color: #cdd3de; } .midnight .closing p { margin-top: 4px; }
.midnight .mi-foot { margin-top: auto; padding-top: 34px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.midnight .mi-sign { width: 320px; } .midnight .mi-sign .sig { height: 64px; justify-content: flex-start; } .midnight .mi-sign .s-line { border-top: 1px solid var(--gold); }
.midnight .mi-sign .name { font-weight: 700; color: #fff; margin-top: 6px; } .midnight .mi-sign .role { font-size: 12.5px; color: #8f99ab; line-height: 1.35; }
.midnight .mi-stamp svg { width: 108px; height: 108px; display: block; }
.doc.midnight .sig-font { color: var(--sc, #e9d18a); }
.doc.midnight .sig-img, .doc.graphite .sig-img { filter: invert(1) hue-rotate(180deg) brightness(1.2); }
.doc.doc.midnight .cont-head { color: #8f99ab; border-color: rgba(255, 255, 255, .14); } .midnight .cont-head span:first-child { color: var(--gold); }
.doc.midnight .pg-no { color: #6f7889; }

/* ===== Графит ===== */
.doc.graphite { --acc-l: color-mix(in srgb, var(--accent) 62%, #fff); display: flex; flex-direction: column; padding: 40px 44px 44px; background-color: #1e1f22; color: #dbdee1; font-family: Inter, sans-serif; font-size: 14.5px; line-height: 1.6; --gold: #e3c06f; }
.graphite .gp-card { background: #2b2d31; border-radius: 14px; padding: 16px 18px; }
.graphite .gp-head { display: flex; align-items: center; gap: 14px; }
.graphite .gp-head img { width: calc(50px * var(--es, 1)); }
.graphite .gp-t { flex: 1; min-width: 0; }
.graphite .gp-org { font-weight: 700; font-size: 16px; line-height: 1.3; color: #f2f3f5; }
.graphite .gp-en { font-size: 12px; color: #949ba4; margin-top: 2px; }
.graphite .gp-no { font-weight: 700; font-size: 14px; color: #949ba4; white-space: nowrap; }
.graphite .gp-no .f { display: inline; color: #f2f3f5; }
.graphite .gp-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.graphite .gp-pill { background: #2b2d31; border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; color: #b5bac1; }
.graphite .gp-pill.acc { background: color-mix(in srgb, var(--accent) 78%, #fff); color: #fff; letter-spacing: .12em; }
.graphite .gp-pill .f { display: inline; }
.graphite .gp-title { font-weight: 700; font-size: 22px; line-height: 1.3; color: #f2f3f5; margin: 14px 0 16px; }
.graphite .pre { color: #c4c9ce; }
.graphite .verb { font-weight: 700; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: #949ba4; margin: 16px 0 10px; }
.graphite .body { counter-reset: pt; }
.graphite .body .pt, .graphite .body > p { counter-increment: pt; position: relative; padding: 2px 0 2px 44px; margin-bottom: 10px; }
.graphite .body .pt::before, .graphite .body > p::before { content: counter(pt); position: absolute; left: 0; top: 2px; bottom: 2px; width: 28px; border-left: 4px solid var(--acc-l); border-radius: 3px; padding-left: 9px;
  font-weight: 700; color: #f2f3f5; font-size: 13.5px; }
.graphite .body li { padding-left: 1.1em; color: #c4c9ce; } .graphite .body li::before { content: "•"; color: var(--acc-l); }
.graphite .tbl { margin: 8px 0; font-size: 13.5px; } .graphite .tbl th { background: #2b2d31; color: #f2f3f5; padding: 6px 10px; text-align: left; } .graphite .tbl td { border-bottom: 1px solid #3f4147; padding: 6px 10px; }
.graphite .closing, .graphite .visa { color: #c4c9ce; } .graphite .closing p { margin-top: 4px; }
.graphite .gp-signw { margin-top: auto; padding-top: 28px; }
.graphite .gp-sign { display: flex; align-items: center; gap: 18px; }
.graphite .gp-who { flex: 1; } .graphite .gp-who .role { font-size: 12.5px; color: #949ba4; line-height: 1.35; } .graphite .gp-who .name { font-weight: 700; color: #f2f3f5; font-size: 15.5px; }
.graphite .gp-sign .sig { width: 220px; height: 64px; }
.graphite .gp-seal svg { width: 90px; height: 90px; display: block; }
.doc.graphite .sig-font { color: var(--sc, #c9cdfb); }
.doc.doc.graphite .cont-head { color: #949ba4; border-color: #3f4147; } .graphite .cont-head span:first-child { color: #f2f3f5; }
.doc.graphite .pg-no { color: #6d727a; }

/* ===== v5: листы A4 ===== */
.pages { display: flex; flex-direction: column; gap: 40px; }
.measure-box { position: fixed; left: -30000px; top: 0; visibility: hidden; pointer-events: none; }
.measure-box .doc { min-height: 0 !important; }
.export-stack { display: flex; flex-direction: column; gap: 24px; width: 794px; }
.doc .cont-head { display: flex; justify-content: space-between; gap: 14px; font-family: Inter, sans-serif; font-size: 11px; letter-spacing: .06em; color: #7a7a7a;
  border-bottom: 1px solid #d8d8d8; padding-bottom: 7px; margin-bottom: 20px; text-transform: uppercase; }
.doc .cont-head span:nth-child(2) { flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .cont-head span:first-child { color: var(--accent); font-weight: 700; }
.doc .cont-foot { margin-top: auto; }
.doc .pg-no { position: absolute; right: 26px; bottom: 5px; font-family: Inter, sans-serif; font-size: 10px; color: #8a8a8a; z-index: 5; letter-spacing: .06em; pointer-events: none; }
.memo .pg-no { display: none; }
.memo .cont-head { margin-top: 26px; } .flag .cont-head { margin-top: 32px; } .minimal .cont-head { margin-top: 44px; }
.night .cont-head { color: #aab3c5; border-color: rgba(255, 255, 255, .18); } .night .cont-head span:first-child { color: #d9b866; }
.flag .pg-no { color: rgba(255, 255, 255, .8); }
.award > :not(.aw-frame):not(.aw-c):not(.fx):not(.st):not(.wm-x):not(.pg-no) { position: relative; z-index: 1; }
.award > .pg-no { position: absolute; }
.bond > .pg-no { position: absolute; z-index: 5; }
body.print .doc + .doc { break-before: page; }

/* ===== v5: редактор листа ===== */
#editor { position: fixed; top: 12px; bottom: 12px; left: 276px; right: 292px; display: none; flex-direction: column; gap: 8px; z-index: 5; }
body.view-editor #editor { display: flex; }
body.view-editor #canvas, body.view-editor #toolbar { display: none; }
.ed-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); min-height: 46px; flex-wrap: wrap; }
.ed-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ed-title b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-title span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-warn { font-size: 11.5px; color: #b54708; background: #fef0c7; padding: 4px 8px; border-radius: 6px; }
.ed-zoom { display: flex; align-items: center; background: var(--input); border-radius: 8px; }
.ed-zoom button { height: 30px; min-width: 30px; padding: 0 8px; border-radius: 8px; font-size: 12px; color: var(--muted); }
.ed-zoom button:hover { background: var(--hover); color: var(--text); }
.ai-btn { background: linear-gradient(135deg, #7c5cff, #0d99ff); border: 0; color: #fff; }
.ai-btn:hover { filter: brightness(1.08); background: linear-gradient(135deg, #7c5cff, #0d99ff); }
.ed-fmt:empty { display: none; }
.ed-fmt #fmt { position: static; max-width: none; width: 100%; background: var(--panel); color: var(--text); box-shadow: var(--shadow); border-radius: 12px; padding: 5px 6px; }
.ed-fmt #fmt button { color: var(--text); }
.ed-fmt #fmt button:hover { background: var(--hover); }
.ed-fmt #fmt .fs { background: var(--line); }
.ed-fmt #fmt .fbr { flex-basis: auto; width: 1px; height: 18px; background: var(--line); margin: 0 3px; }
.ed-fmt #fmt [data-body][disabled] { opacity: .35; }
.ed-scroll { flex: 1; overflow: auto; border-radius: 12px; padding: 24px 0 120px; }
.ed-pages { width: 794px; margin: 0 auto; }
.ed-pages .frame::after { box-shadow: none; }
.ed-pages .pages { gap: 28px; }
.ed-pages .doc { box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 10px 30px rgba(0, 0, 0, .1); }
.ed-pages .f { border-radius: 3px; cursor: text; }
.ed-pages .f:hover { box-shadow: 0 0 0 1px rgba(13, 153, 255, .35); }
.ed-pages .f:focus { box-shadow: 0 0 0 1.5px var(--sel); background: rgba(13, 153, 255, .04); }
.ed-pages .date { cursor: pointer; border-bottom: 1px dashed rgba(13, 153, 255, .5); }
.doc.over { box-shadow: 0 0 0 2px #f79009 !important; }
@media (max-width: 899px) {
  #editor { top: 58px; left: 6px; right: 6px; bottom: 6px; }
  .ed-bar { padding: 6px; }
  .ed-title { flex-basis: 100%; }
  .ed-scroll { padding-top: 12px; }
}

/* ИИ-помощник */
.ai-modal .modal { width: min(680px, 100%); }
.ai-req { width: 100%; min-height: 96px; resize: vertical; padding: 10px 12px; line-height: 1.45; font-size: 14px; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ai-res { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; max-height: 46vh; overflow: auto; font-size: 13px; line-height: 1.5; }
.ai-res h4 { margin: 0 0 4px; font-size: 13px; }
.ai-res .ai-kind { font-weight: 700; letter-spacing: .12em; color: var(--sel); font-size: 11.5px; }
.ai-res ol { margin: 6px 0; padding-left: 20px; }
.ai-res .var { background: rgba(255, 205, 41, .35); border-radius: 2px; }
.ai-res .tbl { border-collapse: collapse; margin: 6px 0 4px; }
.ai-res .tbl th, .ai-res .tbl td { border: 1px solid var(--line); padding: 3px 8px; text-align: left; vertical-align: top; }
.ai-res .tbl th { font-weight: 600; background: var(--hover); }
.ai-remarks { margin: 0; padding-left: 18px; color: #b54708; }
.ai-ans { color: var(--muted); margin: 0 0 8px; }
.ai-load { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.ai-load i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--sel); border-right-color: transparent; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* абзац, перенесённый на следующий лист, продолжается без отступа и без нового номера */
.doc .cont { text-indent: 0 !important; margin-top: 0 !important; }
.doc .pt.cont { counter-increment: none !important; }
.doc .pt.cont::before { content: none !important; }
.doc [data-split]:not(.cont) { margin-bottom: 0 !important; }
/* в редакторе поля без рамок, рамка — при наведении и в правке */
.ed-pages .f[contenteditable="true"] { box-shadow: none; background: none; }
.ed-pages .f[contenteditable="true"]:hover { box-shadow: 0 0 0 1px rgba(13, 153, 255, .35); }
.ed-pages .f[contenteditable="true"]:focus { box-shadow: 0 0 0 1.5px var(--sel); background: rgba(13, 153, 255, .04); }
@media (max-width: 899px) { .ed-fmt #fmt { flex-wrap: nowrap; overflow-x: auto; } .ed-fmt #fmt .fbr { flex: none; } }
.ribbon .rb-band { contain: size; overflow: hidden; }
.flow-mark { padding-top: .1px; }
.modern .md-side { margin-top: 100px; }

/* вход через Discord и облако — низ левой панели, как в самом Discord */
.p-foot { padding: 10px; border-top: 1px solid var(--line); }
.dc-btn { width: 100%; height: 36px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; background: #5865f2;
  color: #fff; font-weight: 600; font-size: 13px; transition: background .15s; }
.dc-btn:hover { background: #4752c4; }
.dc-btn svg { width: 20px; height: 20px; }
.acct-note { margin: 7px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.35; text-align: center; }
.acct-me { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 8px; text-align: left; }
.acct-me:hover { background: var(--hover); }
.acct-me img, .acct-me i { width: 32px; height: 32px; border-radius: 50%; flex: none; object-fit: cover; }
.acct-me i { display: grid; place-items: center; background: #5865f2; color: #fff; font-style: normal; font-weight: 600; }
.acct-me span { flex: 1; min-width: 0; }
.acct-me b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-me small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.acct-me small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #23a55a; flex: none; }
.acct-me small.cs-saving::before { background: var(--sel); animation: blink 1s ease-in-out infinite; }
.acct-me small.cs-wait::before { background: #f0b232; }
.acct-me small.cs-err::before { background: #f23f43; }
.acct-me > svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
@keyframes blink { 50% { opacity: .25; } }
.lnk { color: var(--sel); text-decoration: underline; padding: 0; font: inherit; }

/* переключатели вместо квадратных галочек и ползунки со своей дорожкой — одинаково во всех браузерах и обеих темах */
.chk { flex-direction: row-reverse; justify-content: space-between; gap: 12px; }
.chk input[type="checkbox"] { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 36px; height: 22px; margin: 0;
  border-radius: 11px; background: var(--switch-off); cursor: pointer; transition: background .2s; }
.chk input[type="checkbox"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s cubic-bezier(.3, .7, .4, 1); }
.chk input[type="checkbox"]:checked { background: var(--sel); }
.chk input[type="checkbox"]:checked::after { transform: translateX(14px); }
.chk input[type="checkbox"]:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }
.rng { -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer; --p: 50%; }
.rng:focus { outline: none; }
.rng::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--sel) var(--p), var(--track) var(--p)); }
.rng::-moz-range-track { height: 4px; border-radius: 2px; background: var(--track); }
.rng::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--sel); }
.rng::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff;
  border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .35), 0 0 0 .5px rgba(0, 0, 0, .12); transition: transform .15s; }
.rng::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.rng:active::-webkit-slider-thumb { transform: scale(1.12); }
.rng:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px color-mix(in srgb, var(--sel) 40%, transparent), 0 1px 4px rgba(0, 0, 0, .35); }
#settings-btn small { color: var(--muted); font-size: 12px; }
.ai-quota { margin: 0; }
.ai-quota.low { color: #b54708; }
.ai-src { margin: 0 0 8px; padding-left: 18px; font-size: 13px; }
.ai-src a { color: var(--sel); }
