:root {
  --fs: 15px;
  --bg: #f2f2f2; --panel: #fff; --text: #1b1b1b; --muted: #6d6d6d; --line: #d8d8d8; --line2: #e8e8e8;
  --link: #2a2aa8; --link-hover: #d4272b; --accent: #4b48a8; --accent-bg: #e7e8f6; --sel: #d3d8ef;
  --orange: #f5bf57; --orange-bg: #fcd88f; --orange-soft: #fff4dc; --red: #d0242b;
  --chrome1: #f8f8f8; --chrome2: #e4e4e4; --tab: #e2e2e2; --tab-on: #f8f8f8;
  --note: #6b5d2f; --note-bg: #f7f2e2; --chg-bg: #f1f1f7;
  --ok: #2d7a3e; --bad: #b0302a; --warn: #9a6a12; --add-bg: #e6f4e8; --del-bg: #fbe9e7;
  --m-yellow: #fff200; --m-green: #b9f0a3; --m-pink: #ffc4e1; --m-blue: #bfe3ff;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Times New Roman", "PT Serif", Times, serif;
  --sans: "Segoe UI", -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --chrome-h: 72px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #18191b; --panel: #222327; --text: #e6e4de; --muted: #9b9990; --line: #3a3b41; --line2: #2e2f34;
    --link: #a9a7ff; --link-hover: #ff8a80; --accent: #a9a7ff; --accent-bg: #2b2b45; --sel: #34365a;
    --orange: #c98f2a; --orange-bg: #6b4b14; --orange-soft: #2f2716; --red: #ff7a72;
    --chrome1: #2a2b2f; --chrome2: #222327; --tab: #1d1e21; --tab-on: #2a2b2f;
    --note: #d2bd82; --note-bg: #2a2619; --chg-bg: #26263a;
    --ok: #7cc68b; --bad: #ec8a80; --warn: #e0b45c; --add-bg: #1e3323; --del-bg: #3a2220;
    --m-yellow: #b9a800; --m-green: #3f7d2e; --m-pink: #8c3d66; --m-blue: #2e6690;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: var(--fs)/1.5 var(--sans); }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid #c4c4c4; background: linear-gradient(var(--chrome1), var(--chrome2)); border-radius: 3px; padding: 4px 14px; }
button:hover { border-color: #a9a9a9; }
button.link { border: 0; background: none; color: var(--link); padding: 0 4px; }
button.orange, button.primary, form button[type=submit].orange { background: linear-gradient(#fde2a6, var(--orange-bg)); border-color: #e2b45d; color: #1b1b1b; padding: 6px 16px; }
button.soft { background: linear-gradient(var(--chrome1), var(--chrome2)); }
input, select, textarea { border: 1px solid #c9c9c9; background: var(--panel); border-radius: 2px; padding: 5px 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-bg); border-color: var(--accent); }
.ic { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.caret { display: inline-block; width: 0; height: 0; border: 4px solid transparent; border-top: 5px solid currentColor; border-bottom: 0; margin-left: 4px; vertical-align: middle; }
.err { color: var(--bad); }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.red { color: var(--red); font-weight: 400; }
.loading { color: var(--muted); padding: 30px 0; }
.hint { color: var(--muted); font-size: .87em; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }

/* ---------------------------------------------------------------- оболочка: вкладки и панель инструментов */
.chrome { position: sticky; top: 0; z-index: 20; background: var(--chrome2); border-bottom: 1px solid #c8c8c8; }
.tabbar { display: flex; align-items: flex-end; gap: 0; height: 32px; padding: 0 6px; background: var(--chrome2); }
.menubtn { height: 26px; margin: 0 4px 3px 0; padding: 0 6px; border: 1px solid #c4c4c4; background: var(--chrome1); font-size: 16px; line-height: 1; }
.brand { align-self: stretch; display: flex; align-items: center; padding: 0 18px 0 12px; color: var(--accent); font-weight: 600; letter-spacing: -.2px;
  background: var(--tab-on); border: 1px solid #c8c8c8; border-bottom: 0; border-radius: 5px 5px 0 0; margin-top: 3px; white-space: nowrap; font-size: 14px; }
.brand b { color: var(--accent); }
.brand:hover { text-decoration: none; color: var(--accent); }
.tabs-row { display: flex; align-items: flex-end; min-width: 0; overflow: hidden; }
.tab { display: flex; align-items: center; gap: 6px; height: 27px; max-width: 240px; min-width: 60px; padding: 0 6px 0 10px; margin-left: -1px;
  background: var(--tab); border: 1px solid #c8c8c8; border-bottom: 0; border-radius: 5px 5px 0 0; font-size: 12.5px; cursor: pointer; color: var(--text); }
.tab .ic { width: 15px; height: 15px; }
.tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tab.on { background: var(--tab-on); height: 29px; }
.tab .x { border: 0; background: none; padding: 0 3px; color: var(--muted); font-size: 15px; line-height: 1; }
.tab .x:hover { color: var(--red); }
.newtab { height: 24px; margin: 0 0 3px 4px; padding: 0 8px; font-size: 16px; line-height: 1; background: var(--tab); }
#user { margin-left: auto; align-self: center; padding-left: 8px; }
.userbtn { display: flex; align-items: center; gap: 6px; border: 0; background: none; font-size: 13px; padding: 2px 6px; color: var(--muted); }
.userbtn .ic { width: 16px; height: 16px; }
.toolbar { display: flex; align-items: center; gap: 2px; height: 40px; padding: 0 8px; background: linear-gradient(var(--chrome1), var(--chrome2)); border-top: 1px solid #cfcfcf; overflow-x: auto; }
.tb { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 9px; border: 1px solid transparent; border-radius: 3px; background: none;
  color: var(--text); font-size: 13px; white-space: nowrap; }
.tb:hover { background: rgba(255, 255, 255, .55); border-color: #c4c4c4; text-decoration: none; color: var(--text); }
.tb .ic { width: 22px; height: 22px; }
.tb.only { padding: 0 6px; }
.tb.font { font-size: 15px; padding: 0 6px; color: var(--muted); }
.tb.font.big { font-size: 19px; }
.toolbar .grow { flex: 1; }
body.anon .toolbar, body.anon #tabs, body.anon #newtab, body.anon #mainmenu { visibility: hidden; }

.pop { position: absolute; z-index: 50; }
.menu, .menu ul { list-style: none; margin: 0; padding: 3px 0; min-width: 230px; background: var(--panel); border: 1px solid #b9b9b9; box-shadow: 2px 3px 8px rgba(0, 0, 0, .18); font-size: 13px; }
.menu li { position: relative; display: flex; align-items: center; gap: 8px; padding: 3px 14px 3px 6px; cursor: default; white-space: nowrap; }
.menu li:hover { background: #0a64d0; color: #fff; }
.menu li.off { color: var(--muted); } .menu li.off:hover { background: none; color: var(--muted); }
.menu li.on .ml { font-weight: 600; }
.menu li.sep { height: 1px; padding: 0; margin: 3px 0; background: var(--line); }
.menu .mi { width: 20px; display: inline-flex; justify-content: center; } .menu .mi .ic { width: 16px; height: 16px; }
.menu .ml { flex: 1; } .menu .mk { color: inherit; opacity: .7; padding-left: 16px; }
.menu li > ul { display: none; position: absolute; left: 100%; top: -4px; color: var(--text); }
.menu li.has-sub:hover > ul { display: block; }
.menu li > ul li { color: var(--text); } .menu li > ul li:hover { color: #fff; }

main { padding: 0; }
.page { max-width: 1400px; margin: 0 auto; padding: 18px 28px 40px; }
.page.narrow { max-width: 1000px; }
.phead { display: flex; align-items: center; gap: 14px; margin: 6px 0 18px; flex-wrap: wrap; }
.phead .ic { width: 40px; height: 40px; }
.phead h1 { margin: 0; font-size: 1.45em; font-weight: 400; white-space: pre-line; line-height: 1.15; }
.lead { font-size: 1.05em; }
.badge { display: inline-block; font-size: 12px; padding: 0 7px; border-radius: 10px; border: 1px solid currentColor; white-space: nowrap; vertical-align: middle; }
.badge.active { color: var(--ok); } .badge.repealed, .badge.repealed_de_facto { color: var(--bad); }
.badge.not_in_force, .badge.amending, .badge.warn { color: var(--warn); }
.seg { display: inline-flex; border: 1px solid #c4c4c4; border-radius: 3px; overflow: hidden; vertical-align: middle; }
.seg > * { border: 0; border-radius: 0; padding: 3px 10px; background: var(--panel); color: var(--text); border-right: 1px solid #d0d0d0; display: inline-flex; gap: 5px; align-items: center; }
.seg > *:last-child { border-right: 0; }
.seg > .on { background: var(--sel); font-weight: 600; }
.seg .ic { width: 16px; height: 16px; }

/* поисковые строки с оранжевой рамкой */
.bigsearch, .osearch { display: flex; align-items: center; gap: 4px; padding: 4px; background: var(--orange); border-radius: 3px; }
.bigsearch input, .osearch input { flex: 1; min-width: 0; border: 1px solid #c9a050; padding: 6px 10px 6px 34px; font-size: 1.05em; border-radius: 2px; }
.osearch input { padding-left: 10px; }
.osearch .lens + input { padding-left: 34px; }
.bigsearch button, .osearch button { padding: 6px 30px; background: linear-gradient(#fbfbfb, #e6e6e6); border-color: #b9b9b9; color: #1b1b1b; }
.bigsearch, .osearch { position: relative; }
.lens { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #8a8a8a; display: flex; pointer-events: none; }
.lens .ic { width: 17px; height: 17px; }

/* ---------------------------------------------------------------- стартовая страница */
.home { max-width: 1400px; margin: 0 auto; padding: 24px 28px 20px; }
.home-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.home-head > .ic { width: 64px; height: 64px; }
.home-title { font-size: 1.9em; font-weight: 700; color: var(--accent); letter-spacing: -.5px; line-height: 1.1; }
.home-sub { color: var(--muted); }
.home-upd { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.vsep { width: 1px; height: 18px; background: var(--line); }
.cardlink { display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 22px; text-decoration: underline; }
.cardlink .ic { width: 18px; height: 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 340px)); gap: 20px; margin-bottom: 22px; }
.tile { background: var(--panel); border-radius: 4px; padding: 18px 20px 20px; box-shadow: 0 0 0 1px var(--line2); min-height: 180px; }
.tile h2 { margin: 0 0 12px; font-size: 1.2em; font-weight: 600; }
.tlinks { display: flex; flex-direction: column; gap: 8px; }
a.all { display: inline-block; margin-top: 8px; }
a.all::before { content: "→ "; color: var(--muted); }
.htabs { display: flex; gap: 0; }
.htabs button { border: 0; border-radius: 0; background: var(--chrome2); padding: 10px 22px; font-size: 1.1em; display: inline-flex; align-items: center; gap: 8px; }
.htabs button.on { background: var(--panel); font-weight: 600; }
.htabs .ic { width: 16px; height: 16px; }
.hpanel { background: var(--panel); padding: 16px 20px; min-height: 240px; }
.hlist { list-style: none; margin: 0; padding: 0; }
.hlist li { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.hlist li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hlist .ic { width: 15px; height: 15px; color: var(--muted); }
.foot { margin-top: 18px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: right; }

/* ---------------------------------------------------------------- списки документов */
.results { margin-top: 14px; }
.dlist { list-style: none; margin: 0 0 12px; padding: 0; }
.ditem { display: flex; gap: 10px; padding: 9px 12px; border: 1px dashed transparent; }
.ditem:hover { border-color: #9a9a9a; }
.ditem > .ic { width: 16px; height: 16px; margin-top: 3px; color: var(--muted); }
.ditem > div { min-width: 0; flex: 1; }
.ditem a { color: var(--text); }
.ditem a:hover { color: var(--link-hover); text-decoration: none; }
.ditem .dt { color: var(--text); }
.ditem .dn { display: block; }
.ditem .match { display: block; margin-top: 3px; font-family: var(--serif); color: var(--muted); }
.ditem .snip { margin-top: 4px; font-family: var(--serif); white-space: pre-wrap; }
mark { background: #fde68a; color: #1b1b1b; border-radius: 1px; padding: 0 1px; }
.pager { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.help ul { list-style: none; padding: 0; margin: 8px 0 18px; } .help li::before { content: "• "; }

.qsearch { flex: 1; min-width: 300px; max-width: 980px; display: flex; flex-direction: column; gap: 8px; }
.qopts { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: .9em; }

/* карточка поиска и списки с левым деревом */
.cardpage, .listpage { display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: calc(100vh - var(--chrome-h)); }
.cside, .lside { padding: 18px 20px; background: var(--panel); border-right: 1px solid var(--line2); }
.listpage .lside { background: var(--bg); }
.cmain { padding: 18px 28px; }
.lmain { padding: 18px 24px; background: var(--panel); }
.ctotal { font-weight: 600; margin-bottom: 14px; }
.tree { font-size: .95em; }
.tnode { padding: 3px 0; }
.tleaf, .tkinds a { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 26px; color: var(--text); clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); }
.tleaf .ic { width: 16px; height: 16px; }
.tleaf.on, .tkinds a.on { background: var(--sel); }
.tleaf:hover, .tkinds a:hover { background: var(--accent-bg); text-decoration: none; color: var(--text); }
.tkinds a { padding-left: 42px; font-size: .92em; }
.cnt { color: var(--link); font-size: .85em; margin-left: auto; }
.cbar { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.cbar button { background: linear-gradient(#fdebc4, var(--orange-bg)); border-color: #e2b45d; display: inline-flex; align-items: center; gap: 6px; }
.cbar .ic { width: 16px; height: 16px; }
.cform { background: var(--panel); border-radius: 4px; padding: 26px 18px 30px 46px; box-shadow: 0 0 0 1px var(--line2); }
.crow { display: grid; grid-template-columns: 180px minmax(0, 1fr); align-items: center; gap: 4px; margin-bottom: 15px; }
.crow input, .crow select { width: 100%; padding: 7px 9px; }
.crow input.short { max-width: 700px; }
.cbtns { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 26px 0 0 184px; }
.lhead { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.lhead h2 { margin: 0; font-size: 1.15em; }
.lhead label { margin-left: auto; }
.lsearch { display: flex; gap: 4px; align-items: center; padding: 4px; background: var(--orange); margin-bottom: 14px; border-radius: 3px; }
.lsearch .tag { background: var(--orange-soft); padding: 4px 10px; font-size: .85em; border: 1px solid #e2b45d; }
.lsearch input { flex: 1; min-width: 0; }
.ib { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 30px; min-width: 32px; padding: 0 6px; }
.ib .ic { width: 20px; height: 20px; }
.btnlink { display: inline-block; padding: 4px 12px; border: 1px solid #c4c4c4; border-radius: 3px; background: linear-gradient(var(--chrome1), var(--chrome2)); color: var(--text); margin-bottom: 14px; }
.periods { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; }
.periods a { padding: 4px 8px; display: flex; flex-direction: column; color: var(--text); }
.periods a.on { background: var(--sel); }

/* кодексы, справочная информация, обзоры */
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 0 60px; padding-left: 64px; }
.twocol a { display: block; padding: 6px 0; font-size: 1.12em; }
.refsec { padding-left: 64px; margin-bottom: 22px; }
.refsec h3 { text-transform: uppercase; font-size: .95em; margin: 0 0 6px; }
.refent { padding: 3px 0; font-size: 1.12em; }
.refent details { display: inline; }
.refent details[open] { display: block; padding: 4px 0 6px 18px; }
.refent details a { display: block; }
.revsec h3 { border-bottom: 1px solid var(--line); padding-bottom: 4px; }

/* словарь терминов */
.termspage { padding: 16px 28px; }
.thead { display: flex; align-items: center; gap: 40px; flex-wrap: wrap; }
.thead .osearch { flex: 1; max-width: 860px; }
.tgrid { display: grid; grid-template-columns: 22px minmax(260px, 820px) minmax(0, 1fr); gap: 4px 24px; align-items: start; }
.abc { display: flex; flex-direction: column; position: sticky; top: calc(var(--chrome-h) + 10px); }
.abc a { font-size: 11px; text-align: center; border: 1px solid var(--line); margin-bottom: 1px; color: var(--text); line-height: 16px; }
.abc a.on { background: var(--sel); }
.tlist { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 190px); overflow: auto; }
.tlist a { display: block; padding: 4px 8px; color: var(--text); font-size: 1.05em; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); }
.tlist a.on { background: var(--sel); }
.tlist a:hover { background: var(--accent-bg); text-decoration: none; color: var(--text); }
.tdef { position: sticky; top: calc(var(--chrome-h) + 10px); padding: 0 6px; }
.tdef h2 { font-size: 1.05em; margin: 4px 0 14px; padding-bottom: 4px; border-bottom: 1px solid var(--line2); }
.tq { text-indent: 2.2em; text-align: justify; }
.tsrc { margin-bottom: 26px; }
.tsrc a { text-decoration: underline; }

/* избранное */
.fgroup summary { cursor: pointer; padding: 5px 0; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.fgroup summary .ic { width: 18px; height: 18px; }
.nlist { list-style: none; padding: 0 0 0 24px; margin: 0 0 10px; }
.nlist li { padding: 8px 0; border-bottom: 1px solid var(--line2); }
.excerpt { display: block; font-family: var(--serif); color: var(--text); margin: 3px 0; }
.ucomment { display: flex; gap: 6px; align-items: flex-start; font-size: .9em; color: var(--note); background: var(--note-bg); padding: 4px 10px; margin: 2px 0 8px; border-left: 3px solid var(--orange); }
.ucomment .ic { width: 16px; height: 16px; }
.ucomment span { flex: 1; white-space: pre-wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--text); border-color: var(--accent); }

/* ---------------------------------------------------------------- документ */
.docpage { padding: 0 16px 40px; }
.dtop { position: sticky; top: var(--chrome-h); z-index: 10; display: grid; grid-template-columns: minmax(0, 940px) minmax(260px, 420px); gap: 0 24px;
  justify-content: center; align-items: center; padding: 12px 0 10px; background: var(--bg); }
.dtl { grid-column: 1; grid-row: 1; display: flex; gap: 14px; align-items: center; min-width: 0; }
.insearch { flex: 1; min-width: 200px; display: flex; gap: 4px; padding: 4px; background: var(--orange); border-radius: 3px; position: relative; }
.insearch input { flex: 1; min-width: 0; border-color: #c9a050; }
.insearch button { padding: 4px 22px; }
.insearch #isn { align-self: center; white-space: nowrap; padding: 0 4px; }
.ibar { flex: none; display: flex; gap: 6px; align-items: center; }
.ibg { display: inline-flex; }
.ibg .ib:first-child { border-radius: 3px 0 0 3px; }
.ibg .ib.dd { border-radius: 0 3px 3px 0; border-left: 0; min-width: 20px; padding: 0 4px; }
.ib.txt { font-size: 12.5px; }
.ib .swatch { width: 6px; height: 18px; border-radius: 1px; margin-left: -3px; }
i.swatch { display: inline-block; width: 14px; height: 14px; border: 1px solid #9a9a9a; }
.hm-yellow { background: var(--m-yellow); } .hm-green { background: var(--m-green); } .hm-pink { background: var(--m-pink); } .hm-blue { background: var(--m-blue); }
.ptabs { grid-column: 2; grid-row: 1; display: inline-flex; justify-self: start; padding: 3px; background: var(--orange); border-radius: 3px; gap: 1px; }
.ptabs button { border-radius: 0; background: var(--panel); border-color: #e2b45d; padding: 3px 10px; }
.ptabs button.on { background: var(--sel); font-weight: 600; }
.dgrid { display: grid; grid-template-columns: minmax(0, 940px) minmax(260px, 420px); gap: 24px; justify-content: center; align-items: start; }
.paper { position: relative; background: var(--panel); border: 1px solid var(--line2); min-height: 70vh; }
.dhead { background: #ececec; padding: 8px 20px 8px 30px; color: #333; font-size: .97em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dhead { background: #2b2c30; color: var(--text); } }
.dtitle { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dline { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 8px 30px 0 150px; font-size: .9em; }
.dline select { padding: 2px 6px; }
.warnlink { color: var(--red); }
.iicon { position: absolute; left: 34px; top: 60px; }
.iicon .ic { width: 34px; height: 24px; }
.gstar { position: absolute; left: 108px; width: 26px; height: 26px; padding: 2px; border: 0; background: none; color: var(--muted); }
.gstar .ic { width: 20px; height: 20px; }
.gstar:hover { color: #f2a227; }
.text { padding: 14px 54px 40px 150px; font-family: var(--serif); font-size: 1.1em; line-height: 1.45; }
.text p { margin: 0 0 7px; text-align: justify; hyphens: auto; text-indent: 2.2em; position: relative; }
.text p.empty { height: 8px; }
.text p.h { text-align: center; font: 700 1.03em/1.35 var(--sans); margin: 14px 0 6px; text-indent: 0; }
.text p.a { font-weight: 700; margin-top: 14px; }
.text p.note { font-family: var(--serif); font-size: .9em; color: var(--muted); text-align: left; text-indent: 0; }
.text p.note.box { background: var(--note-bg); color: var(--note); padding: 4px 10px; border-left: 3px solid var(--note); margin: 8px 0; font-family: var(--sans); }
.text p.bm::before { content: "★"; position: absolute; left: -38px; top: 0; color: #f2a227; text-indent: 0; font-size: 18px; }
.text pre { font-family: var(--mono); font-size: 12px; line-height: 1.25; margin: 0; overflow-x: auto; }
.text .flash { background: var(--accent-bg); outline: 4px solid var(--accent-bg); }
.text a.ref { color: var(--link); text-decoration: underline; }
.text a.ref:hover { color: var(--link-hover); }
.text .picked { box-shadow: -10px 0 0 -6px var(--orange); background: var(--orange-soft); }
.text mark.um { color: inherit; padding: 0; border-radius: 0; }
.text mark.um.hm-yellow { background: var(--m-yellow); } .text mark.um.hm-green { background: var(--m-green); }
.text mark.um.hm-pink { background: var(--m-pink); } .text mark.um.hm-blue { background: var(--m-blue); }
.text mark.found { background: #ffd0a0; } .text mark.found.cur { background: #ff9640; }
.text .ucomment { text-indent: 0; font-family: var(--sans); }
details.chg { background: var(--chg-bg); border-left: 3px solid #b8b6e6; margin: 14px 0; padding: 12px 18px; text-align: center; }
details.chg summary { cursor: pointer; color: var(--link); font-family: var(--serif); list-style: none; }
details.chg summary::before { content: "+"; display: inline-block; width: 15px; height: 15px; line-height: 14px; margin-right: 8px; background: #6c69c9; color: #fff; font: 700 13px var(--sans); border-radius: 2px; }
details.chg[open] summary::before { content: "−"; }
details.chg[open] { text-align: left; }
details.chg p.note { text-align: center; }
.dside { position: sticky; top: calc(var(--chrome-h) + 58px); display: flex; flex-direction: column; gap: 12px; }
.sbox { border: 2px solid var(--orange); background: var(--panel); padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; font-size: .88em; }
.sbox a { display: flex; align-items: center; gap: 6px; color: var(--text); }
.sbox a:hover { color: var(--link-hover); }
.sbox .ic { width: 16px; height: 16px; }
.spanel { background: var(--panel); border: 1px solid var(--line2); max-height: calc(100vh - var(--chrome-h) - 170px); overflow: auto; font-size: .9em; }
.spanel:empty { display: none; }
.spanel input { width: calc(100% - 16px); margin: 8px; }
.toc a { display: block; padding: 2px 10px; color: var(--text); }
.toc a:hover { background: var(--accent-bg); text-decoration: none; }
.toc .l0, .toc .l1 { font-weight: 600; } .toc .l2 { padding-left: 18px; } .toc .l3 { padding-left: 24px; }
.toc .l4 { padding-left: 32px; } .toc .l5 { padding-left: 42px; color: var(--muted); }
.plist a { display: block; padding: 5px 12px; color: var(--text); } .plist a.on { background: var(--sel); } .plist a.sub { padding: 0 12px 6px 26px; color: var(--link); }
.pinfo { padding: 10px 12px; }
.kv { display: grid; grid-template-columns: 220px 1fr; gap: 6px 16px; }
.kv.one { grid-template-columns: 1fr; gap: 0; } .kv.one dd { margin-bottom: 8px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
#dbody > .card, #dbody > .links, #dbody > table { margin: 16px 30px; }
.card { background: var(--panel); border: 1px solid var(--line2); border-radius: 3px; padding: 16px 20px; margin-bottom: 14px; }
.card h1 { font-size: 1.3em; margin: 0 0 6px; font-weight: 600; }
.card .line { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 10px; }
table { border-collapse: collapse; width: 100%; background: var(--panel); }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line2); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: .87em; }
tr.cur td { background: var(--accent-bg); }
body.hide-notes .text p.note, body.hide-notes details.chg, body.hide-notes .text .ucomment { display: none; }

/* сравнение */
.diff .op { background: var(--panel); border: 1px solid var(--line2); margin-bottom: 10px; overflow: hidden; }
.diff .op .hd { font-size: 12px; color: var(--muted); padding: 4px 12px; border-bottom: 1px solid var(--line2); }
.diff .del, .diff .add { font-family: var(--serif); padding: 6px 12px; white-space: pre-wrap; }
.diff .del { background: var(--del-bg); } .diff .add { background: var(--add-bg); }
.diff .del::before { content: "− "; color: var(--bad); } .diff .add::before { content: "+ "; color: var(--ok); }

/* диалоги */
dialog { border: 1px solid #a9a9a9; border-radius: 3px; background: var(--panel); color: var(--text); max-width: 460px; width: calc(100% - 32px); padding: 18px 20px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
dialog.wide { max-width: 720px; }
dialog::backdrop { background: rgba(0, 0, 0, .25); }
dialog h3 { margin-top: 0; font-weight: 600; }
dialog textarea { width: 100%; }
.dbtns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.favdlg .fhead { display: flex; gap: 10px; align-items: flex-start; font-size: 1.05em; margin-bottom: 10px; }
.favdlg .fhead .ic { width: 18px; margin-top: 3px; }
.fto { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line2); margin-bottom: 12px; flex-wrap: wrap; }
.fbody { display: flex; flex-direction: column; gap: 10px; }
.fquote { border: 1px solid var(--line); padding: 6px 10px; max-height: 70px; overflow: auto; font-size: .92em; }
.frow { display: flex; gap: 8px; } .frow input { flex: 1; }
.ftree { border: 1px solid var(--line2); min-height: 140px; max-height: 220px; overflow: auto; padding: 8px; }
.fitem { display: flex; gap: 8px; align-items: center; padding: 5px 10px; cursor: pointer; }
.fitem.on { background: var(--sel); }
.fitem .ic { width: 16px; height: 16px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #333; color: #fff; padding: 8px 18px; border-radius: 3px; z-index: 60; font-size: 14px; box-shadow: 0 3px 12px rgba(0, 0, 0, .3); }

/* вход, кабинет, администрирование */
.auth { max-width: 460px; margin: 40px auto; padding: 0 16px; }
.stack { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
button.big { width: 100%; padding: 11px; font-size: 16px; }
details summary { cursor: pointer; }
.auth details summary { color: var(--link); margin-top: 14px; }
.otp { border-color: var(--warn); background: var(--note-bg); }
.otp code { font-size: 17px; padding: 2px 6px; background: var(--panel); border-radius: 4px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
#view > h2, #view > nav.tabs, #view > #tab { max-width: 1400px; margin-left: auto; margin-right: auto; padding-left: 28px; padding-right: 28px; }
#view > h2 { padding-top: 18px; font-weight: 400; }
.res { background: var(--panel); border: 1px solid var(--line2); padding: 10px 14px; margin-bottom: 8px; }
.res h3 { margin: 0 0 4px; font-size: 1em; }
table.act td.cell { text-align: center; font-size: 12px; min-width: 26px; background: color-mix(in srgb, var(--accent) calc(var(--a) * 100%), transparent); }
.bars { display: flex; gap: 3px; align-items: flex-end; height: 120px; padding: 6px 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.bar { position: relative; flex: 0 1 44px; min-width: 18px; height: 100%; display: flex; gap: 1px; align-items: flex-end; }
.bar i, .legend i { display: inline-block; flex: 1; min-height: 1px; border-radius: 2px 2px 0 0; }
.bar span { position: absolute; bottom: -17px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.legend i { width: 10px; height: 10px; margin: 0 4px 0 10px; border-radius: 2px; }
i.ok { background: var(--ok); } i.bad { background: var(--bad); } i.accent { background: var(--accent); } i.warn { background: var(--warn); }

/* ---------------------------------------------------------------- узкий экран */
@media (max-width: 1100px) {
  .dtop, .dgrid { grid-template-columns: minmax(0, 1fr); }
  .dtop { position: static; gap: 8px; }
  .dtl { flex-wrap: wrap; } .ibar { flex-wrap: wrap; }
  .ptabs { grid-column: 1; grid-row: 2; }
  .dside { position: static; order: -1; }
  .spanel { max-height: 300px; }
}
@media (max-width: 860px) {
  :root { --chrome-h: 72px; }
  .tb span:not(.caret) { display: none; }
  .brand { padding: 0 8px; font-size: 12px; } .brand b { display: none; }
  .tab { max-width: 120px; }
  .userbtn span:not(.caret) { display: none; }
  .page, .home { padding: 12px 16px 30px; }
  .cardpage, .listpage { grid-template-columns: 1fr; }
  .cside, .lside { border-right: 0; border-bottom: 1px solid var(--line2); }
  .cmain, .lmain { padding: 12px 16px; }
  .cform { padding: 16px; }
  .crow { grid-template-columns: 1fr; }
  .cbtns { margin-left: 0; }
  .twocol, .refsec { padding-left: 0; } .twocol { grid-template-columns: 1fr; }
  .tgrid { grid-template-columns: 20px minmax(0, 1fr); } .tdef { grid-column: 1 / -1; position: static; }
  .tlist { max-height: 40vh; }
  .docpage { padding: 0 0 30px; }
  .text { padding: 10px 16px 30px 34px; }
  .text p.bm::before { left: -26px; }
  .dline { padding: 8px 16px 0; }
  .gstar { left: 4px; } .iicon { display: none; }
  .kv { grid-template-columns: 1fr; }
  .home-upd { margin-left: 0; }
  .bigsearch button, .osearch button { padding: 6px 14px; }
}

/* ---------------------------------------------------------------- печать */
@media print {
  .chrome, .dtop, .dside, .gstar, .iicon, .dline, .pop, .toast, .lside, .lsearch, .phead .osearch { display: none !important; }
  body, .paper, .lmain { background: #fff; color: #000; }
  .dgrid { display: block; } .paper { border: 0; }
  .text { padding: 0; font-size: 12pt; }
  .dhead { background: none; padding: 0 0 10px; } .dtitle { white-space: normal; }
  details.chg { display: block; } details.chg > * { display: block; }
  .listpage { display: block; }
  body.print-clean .text mark.um { background: none !important; }
  body.print-clean .ucomment, body.print-clean .text p.bm::before { display: none !important; }
  .text .picked { background: none; box-shadow: none; }
}
