:root {
  --bg: #f6f7f9; --panel: #fff; --ink: #1d232b; --muted: #6a7480; --line: #dfe3e8;
  --accent: #1f6feb; --accent-soft: #e7f0fe;
  --same: #e6f4ea; --same-ink: #1e6b34; --diff: #fdecea; --diff-ink: #a42a1d;
  --unk: #f2f2f2; --unk-ink: #6a7480; --warn: #fff6e0; --warn-ink: #8a5a00;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header.top { display: flex; align-items: center; gap: 18px; padding: 8px 16px; background: #14202e; color: #fff; flex-wrap: wrap; }
header.top a { color: #d6e2f0; }
header.top a.on { color: #fff; font-weight: 600; }
header.top .brand { font-weight: 700; color: #fff; margin-right: 8px; }
header.top .sp { flex: 1; }
header.top select { background: #22324a; color: #fff; border: 1px solid #3a4d68; border-radius: 4px; padding: 2px 6px; }
.badge { display: inline-block; padding: 0 6px; border-radius: 10px; font-size: 12px; background: #e9edf2; color: #344; line-height: 18px; }
header.top .badge { background: #ffb02e; color: #222; }
.wrap { padding: 14px 16px; max-width: 1600px; margin: 0 auto; }
.cols { display: flex; gap: 16px; align-items: flex-start; }
.side { width: 290px; flex: none; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px; max-height: calc(100vh - 90px); overflow: auto; position: sticky; top: 8px; }
.main { flex: 1; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin-bottom: 14px; }
h1 { font-size: 20px; margin: 0 0 10px; } h2 { font-size: 16px; margin: 0 0 8px; } h3 { font-size: 14px; margin: 10px 0 6px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
table.t { border-collapse: collapse; width: 100%; }
table.t th, table.t td { border-bottom: 1px solid var(--line); padding: 5px 6px; text-align: left; vertical-align: top; }
table.t th { font-weight: 600; color: #3b4652; background: #fafbfc; font-size: 13px; }
table.t tr:hover td { background: #fbfcfe; }
.tree a { display: block; padding: 2px 4px; border-radius: 3px; color: var(--ink); }
.tree a.on { background: var(--accent-soft); font-weight: 600; }
.tree .cnt { float: right; font-size: 11px; color: var(--muted); }
.acc { padding: 0 6px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.acc-exact { background: #d3f0dc; color: #145c2a; } .acc-close { background: #e0efff; color: #164f9c; }
.acc-approx { background: #fff0cf; color: #7a5200; } .acc-not_analog { background: #f6d9d6; color: #8c2116; }
.st-mapped { color: var(--same-ink); } .st-absent { color: var(--diff-ink); font-weight: 600; } .st-unparsed { color: var(--muted); }
.btn { display: inline-block; padding: 5px 11px; border: 1px solid #c7cfd8; border-radius: 5px; background: #fff; color: var(--ink); cursor: pointer; font: inherit; }
.btn:hover { background: #f3f6f9; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #185ec9; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 2px 7px; font-size: 12px; }
input, select, textarea { font: inherit; padding: 4px 6px; border: 1px solid #c7cfd8; border-radius: 4px; }
input.num { width: 64px; }
form.inline { display: inline; }
.warn { background: var(--warn); color: var(--warn-ink); border: 1px solid #f1d58a; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
.info { background: var(--accent-soft); border: 1px solid #c4d8f7; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
.err { background: var(--diff); color: var(--diff-ink); border: 1px solid #f0b8b1; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px 6px 0 0; background: #eef1f4; color: var(--ink); }
.tabs a.on { background: var(--panel); font-weight: 600; border-bottom-color: var(--panel); }
footer { padding: 10px 16px; color: var(--muted); font-size: 12px; }

/* карточка решения */
.cmp { overflow-x: auto; }
table.cmp-t { border-collapse: separate; border-spacing: 0; min-width: 100%; }
table.cmp-t th, table.cmp-t td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px 8px; vertical-align: top; min-width: 190px; max-width: 260px; }
table.cmp-t th.rowh { min-width: 130px; width: 130px; background: #fafbfc; font-weight: 600; color: #3b4652; position: sticky; left: 0; z-index: 1; }
table.cmp-t td.anchor { background: #f7f9fc; min-width: 230px; }
table.cmp-t td.same { background: var(--same); } table.cmp-t td.diff { background: var(--diff); } table.cmp-t td.unknown { background: var(--unk); color: var(--unk-ink); }
table.cmp-t td .o { display: block; font-size: 11px; color: var(--muted); }
table.cmp-t td.diff .d { color: var(--diff-ink); font-weight: 600; }
table.cmp-t .colhead { font-weight: 600; }
table.cmp-t td.focus, table.cmp-t th.focus { outline: 2px solid var(--accent); outline-offset: -2px; }
table.cmp-t td.marked { box-shadow: inset 0 3px 0 var(--accent); }
.accbtns { display: flex; gap: 3px; flex-wrap: wrap; margin: 4px 0; }
.accbtns button { padding: 2px 6px; font-size: 12px; border: 1px solid #c7cfd8; border-radius: 4px; background: #fff; cursor: pointer; }
.accbtns button.on.exact { background: #d3f0dc; border-color: #5aa772; }
.accbtns button.on.close { background: #e0efff; border-color: #6c9de0; }
.accbtns button.on.approx { background: #fff0cf; border-color: #d9a73b; }
.accbtns button.on.not_analog { background: #f6d9d6; border-color: #d07267; }
.kbd { font: 11px monospace; background: #eef1f4; border: 1px solid #ccd3db; border-radius: 3px; padding: 0 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.modal-bg { position: fixed; inset: 0; background: rgba(20,30,45,.45); display: none; align-items: center; justify-content: center; z-index: 50; }
.modal-bg.on { display: flex; }
.modal { background: #fff; border-radius: 8px; padding: 18px 20px; width: min(640px, 94vw); max-height: 85vh; overflow: auto; }
.modal ul { padding-left: 18px; }
.toast { position: fixed; right: 16px; bottom: 16px; background: #14202e; color: #fff; padding: 12px 16px; border-radius: 8px; display: none; z-index: 60; max-width: 520px; }
.toast.on { display: block; }
.toast .btn { margin-left: 10px; }
.acc-far { background: #eceff3; color: #4a5562; }
.unconf { background: #fde8d7; color: #8a3d00; }
td.pre, tr.pre td { font-style: italic; }
.sim { background: #efe6ff; color: #4b2a8c; }
img.mini { width: 44px; height: 44px; object-fit: contain; float: left; margin: 0 8px 0 0; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.clear { display: flow-root; }
img.photo { float: right; max-width: 220px; max-height: 220px; margin: 0 0 8px 14px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.nophoto { display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; line-height: 1.2; color: var(--muted); border: 1px dashed var(--line); border-radius: 4px; box-sizing: border-box; }
.nophoto.mini { width: 44px; height: 44px; float: left; margin: 0 8px 0 0; font-size: 9px; }
.nophoto.photo { float: right; width: 160px; height: 120px; margin: 0 0 8px 14px; }
.nophoto.thumb { width: 140px; height: 70px; margin: 4px 0; }
img.thumb { max-width: 180px; max-height: 140px; display: block; margin: 4px 0; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.btn.primary .kbd { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5); color: #fff; }
tr.deep { display: none; }
.show-deep tr.deep { display: table-row; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .cols { flex-direction: column; } .side { width: 100%; position: static; max-height: none; } .grid2 { grid-template-columns: 1fr; } }
