/* [2026-10-28][CLX][Н-01-261028] Окно сопоставления. Цвета — только смысловые роли (фирменных у Мира Техники нет). */
:root {
  --bg: #f6f7f9; --panel: #fff; --line: #e3e6eb; --line-2: #cfd5dd;
  --text: #1d232b; --muted: #677282; --faint: #98a1ad;
  --accent: #2459c9; --accent-bg: #e9f0fd;         /* выбор */
  --warn: #9a5b00; --warn-bg: #fff4dc;             /* нужен разбор */
  --bad: #b3261e; --bad-bg: #fde9e7;               /* противоречие / конфликт */
  --ok: #1f6f43; --ok-bg: #e5f4ec;                 /* решено человеком */
  --radius: 6px; --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "Roboto Mono", monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.4 var(--font); color: var(--text); background: var(--bg); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--bad); min-height: 1.4em; }
.grow { flex: 1; }
.mono { font-family: var(--mono); }

.btn { font: inherit; border: 1px solid var(--line-2); background: var(--panel); color: var(--text);
  border-radius: var(--radius); padding: 0 12px; height: 32px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); border-color: #e9b5b0; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #eef1f5; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
input, select { font: inherit; height: 32px; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 0 8px; background: #fff; color: var(--text); }

/* вход */
.login { display: grid; place-items: center; height: 100%; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 28px; width: 340px; display: grid; gap: 12px; }
.login-card h1 { margin: 0; font-size: 22px; }
.login-card label { display: grid; gap: 4px; color: var(--muted); }

/* каркас */
.app { display: grid; grid-template-rows: auto auto 1fr auto auto; height: 100vh; }
.top { display: flex; align-items: center; gap: 24px; padding: 0 16px; height: 48px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 600; }
.tabs { display: flex; gap: 4px; }
.tabs button { font: inherit; border: 0; background: none; padding: 0 14px; height: 32px; color: var(--muted); border-radius: var(--radius); cursor: pointer; }
.tabs button:hover { background: #eef1f5; }
.tabs button[aria-selected="true"] { color: var(--accent); background: var(--accent-bg); font-weight: 600; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.who { font-weight: 600; }

.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.filters label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.filters input[type=search] { width: 320px; }
.progress { margin-left: auto; color: var(--muted); }
.progress b { color: var(--text); }

.split { display: grid; grid-template-columns: var(--left, 58%) 6px 1fr; min-height: 0; }
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel); }
.pane-head { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--line); min-height: 40px; }
.gutter { cursor: col-resize; background: var(--line); }
.gutter:hover { background: var(--line-2); }
.grid { flex: 1; min-height: 0; }
.right { overflow: auto; padding: 0; }
.right.tree-mode { display: flex; flex-direction: column; overflow: hidden; }
.right.tree-mode .grid { flex: 1; }

/* правая часть */
.rsec { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.rsec h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.target { border: 1px solid #b9cdf3; background: var(--accent-bg); border-radius: var(--radius); padding: 10px 12px; }
.target.empty { border-style: dashed; border-color: var(--line-2); background: #fafbfc; color: var(--muted); }
.target .code { font: 600 16px var(--mono); }
.target .path { font-weight: 600; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 2px 10px; margin: 6px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.chip { display: inline-block; padding: 0 7px; border-radius: 10px; font-size: 12px; line-height: 20px; background: #eef1f5; color: #3d4652; white-space: nowrap; }
.chip.manual { background: var(--ok-bg); color: var(--ok); }
.chip.queue { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.sel { background: var(--accent-bg); color: var(--accent); }
.list { border: 1px solid var(--line); border-radius: var(--radius); max-height: 260px; overflow: auto; }
.list .it { padding: 5px 10px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; gap: 8px; align-items: baseline; }
.list .it:last-child { border-bottom: 0; }
.list .it:hover { background: #f3f5f8; }
.list .it.on { background: var(--accent-bg); }
.list .it .mono { min-width: 150px; }
.contra { color: var(--bad); }
.wit { color: var(--ok); }
.cmp { border-collapse: collapse; width: 100%; font-size: 13px; }
.cmp th, .cmp td { border: 1px solid var(--line); padding: 4px 6px; vertical-align: top; text-align: left; }
.cmp th { background: #f3f5f8; font-weight: 600; color: var(--muted); }
.cmp td.diff { background: var(--warn-bg); }

/* предпросмотр */
.preview { background: #fff; border-top: 1px solid var(--line-2); box-shadow: 0 -6px 18px rgba(20, 30, 50, .08); max-height: 42vh; display: flex; flex-direction: column; }
.pv-head { display: flex; gap: 14px; align-items: center; padding: 10px 16px; background: var(--accent-bg); flex-wrap: wrap; }
.pv-head h2 { margin: 0; font-size: 16px; }
.pv-body { overflow: auto; padding: 0 16px; }
.pv-body table { border-collapse: collapse; width: 100%; font-size: 13px; }
.pv-body th, .pv-body td { border-bottom: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
.pv-body th { position: sticky; top: 0; background: #fff; color: var(--muted); font-weight: 600; }
.pv-body tr.same td { color: var(--faint); }
.pv-foot { display: flex; gap: 10px; align-items: center; white-space: nowrap; padding: 10px 16px; border-top: 1px solid var(--line); }
.pv-foot input[type=text] { flex: 1; }
.pv-warn { color: var(--bad); font-weight: 600; }

/* нижняя панель */
.bar { display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: var(--panel); border-top: 1px solid var(--line); min-height: 52px; }
.sel-info { flex: 1; min-width: 0; }
.actions { display: flex; gap: 8px; align-items: center; }
.menu { position: relative; }
.menu-list { position: absolute; bottom: 38px; right: 0; background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(20,30,50,.15); padding: 4px; min-width: 260px; z-index: 20; }
.menu-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; font: inherit; cursor: pointer; border-radius: 4px; }
.menu-list button:hover { background: #f1f4f8; }
.menu-list small { color: var(--muted); display: block; }

/* выдвижные */
.drawer { position: fixed; top: 48px; right: 0; bottom: 0; width: 480px; background: #fff; border-left: 1px solid var(--line-2); box-shadow: -8px 0 24px rgba(20,30,50,.1); z-index: 30; display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.drawer-body { overflow: auto; padding: 10px 14px; }
.hist { border-bottom: 1px solid var(--line); padding: 8px 0; display: grid; grid-template-columns: 1fr auto; gap: 4px; }
.hist .when { color: var(--muted); font-size: 12px; }
.help table { border-collapse: collapse; }
.help td { padding: 5px 10px 5px 0; border-bottom: 1px solid var(--line); }
.help td:first-child { font-weight: 600; white-space: nowrap; }

.toast { position: fixed; left: 16px; bottom: 64px; background: #1d232b; color: #fff; padding: 10px 16px; border-radius: var(--radius); z-index: 40; display: flex; gap: 12px; align-items: center; max-width: 70vw; }
.toast.bad { background: var(--bad); }
.toast button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); }

/* таблица */
.ag-theme-quartz { --ag-font-family: var(--font); --ag-font-size: 13px; --ag-row-height: 36px; --ag-header-height: 36px;
  --ag-selected-row-background-color: var(--accent-bg); --ag-active-color: var(--accent); --ag-wrapper-border-radius: 0; }
.cell-path { color: var(--muted); }
.cell-path b { color: var(--text); font-weight: 600; }
.ind { display: inline-block; width: 16px; text-align: center; color: var(--muted); cursor: pointer; }
.tree-hit { background: #fff6c8; border-radius: 2px; }
.tree-target { font-weight: 700; color: var(--accent); }
.pv-foot label { display: flex; align-items: center; gap: 6px; }

/* обзор бренда: вид прибора × источник */
.overview { overflow: auto; padding: 16px; min-height: 0; }
.ov-sum { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: baseline; margin-bottom: 14px; }
.ov-sum .big { font-size: 20px; font-weight: 600; }
.ov-sum .lnk { color: var(--accent); cursor: pointer; }
.ov { border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.ov th, .ov td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.ov tr > :last-child { border-right: 0; }
.ov thead th { background: #f3f5f8; color: var(--muted); font-weight: 600; white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.ov tbody th { font-weight: 600; white-space: nowrap; }
.ov tfoot th, .ov tfoot td { background: #fafbfc; font-weight: 600; border-bottom: 0; }
.ov td.c { min-width: 128px; cursor: pointer; }
.ov td.c:hover { background: #f3f5f8; outline: 1px solid var(--line-2); }
.ov td.c.empty { cursor: default; color: var(--faint); }
.ov td.c.empty:hover { background: none; outline: 0; }
.ov .n { display: block; line-height: 1.5; white-space: nowrap; }
.ov .n.ok b { color: var(--ok); }
.ov .n.q { color: var(--warn); }
.ov .n.q b { color: var(--warn); }
.ov .n.small { color: var(--muted); font-size: 12px; }
.ov .n[data-view]:hover { text-decoration: underline; }
.ov .models { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ov-other { margin-top: 14px; }
.ov-other summary { cursor: pointer; color: var(--muted); }
.ov-other .ov { margin-top: 8px; }
.ov-note { color: var(--muted); margin-top: 12px; max-width: 900px; }
.form { display: grid; gap: 10px; margin: 10px 0 16px; }
.form label { display: grid; gap: 4px; color: var(--muted); }
.form textarea { font: inherit; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 6px 8px; resize: vertical; }
.breq { border-bottom: 1px solid var(--line); padding: 6px 0; }
.breq .when { color: var(--muted); font-size: 12px; }
.tree-cell { display: inline-flex; flex-direction: column; line-height: 1.3; vertical-align: middle; }
.tree-path { display: block; color: var(--muted); font-size: 12px; padding-left: 16px; }
.list button.it { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; }
.list button.it:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cmp .cmp-model { background: var(--accent-bg); }
kbd { font: 11px var(--mono); border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; margin-left: 6px; opacity: .7; }
