:root { --bg:#f4f6f9; --card:#fff; --line:#dde3ea; --text:#1d2833; --muted:#5f6b78; --accent:#1f5fbf; --accent-bg:#e8f0fc;
  --high:#c62828; --high-bg:#fdecea; --medium:#b26a00; --medium-bg:#fff4e0; --low:#2e7d32; --low-bg:#e8f5e9; --p1:#c62828; --p2:#b26a00; --p3:#546e7a; }
* { box-sizing:border-box; }
html,body { margin:0; padding:0; background:var(--bg); color:var(--text); font:14px/1.45 -apple-system,"Segoe UI",Roboto,Arial,sans-serif; }
a { color:var(--accent); text-decoration:none; } a:hover { text-decoration:underline; }
.layout { display:flex; min-height:100vh; }
.sidebar { width:220px; flex:0 0 220px; background:#1b2a3d; color:#dfe7f1; padding:14px 0; position:sticky; top:0; height:100vh; overflow:auto; }
.sidebar .brand { padding:8px 18px 14px; border-bottom:1px solid #2c3f57; }
.sidebar .brand-link { display:flex; flex-direction:column; align-items:flex-start; gap:8px; color:#fff; text-decoration:none; }
.sidebar .brand-logo { height:34px; width:auto; }
.sidebar .brand-text { font-weight:700; font-size:15px; line-height:1.15; white-space:nowrap; }
.sidebar .brand small { display:block; font-weight:400; color:#9fb0c5; font-size:11px; margin-top:2px; }
.page-logo { height:26px; width:auto; vertical-align:-4px; margin-right:10px; }
.sidebar nav a { display:block; padding:9px 18px; color:#dfe7f1; border-left:3px solid transparent; }
.sidebar nav a:hover, .sidebar nav a.active { background:#243a55; border-left-color:#5fa1ff; text-decoration:none; }
.sidebar .meta { padding:14px 18px; font-size:11px; color:#9fb0c5; border-top:1px solid #2c3f57; margin-top:10px; }
.sidebar .meta .warn { color:#ffb74d; }
main { flex:1; padding:22px 28px; min-width:0; }
h1 { font-size:22px; margin:0 0 6px; } h2 { font-size:16px; margin:22px 0 10px; } h3 { font-size:14px; margin:14px 0 6px; }
.sub { color:var(--muted); margin-bottom:14px; }
.grid { display:grid; gap:14px; } .grid-2 { grid-template-columns:1fr 1fr; } .grid-3 { grid-template-columns:repeat(3,1fr); } .grid-4 { grid-template-columns:repeat(4,1fr); }
@media (max-width:1200px) { .grid-3, .grid-4 { grid-template-columns:1fr 1fr; } } @media (max-width:800px) { .grid-2,.grid-3,.grid-4 { grid-template-columns:1fr; } .sidebar{display:none;} }
.card { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:14px 16px; }
.card h2 { margin-top:0; } .card.compact { padding:10px 12px; }
.kpi { display:flex; flex-direction:column; gap:2px; } .kpi .v { font-size:24px; font-weight:700; } .kpi .l { color:var(--muted); font-size:12px; } .kpi .d { font-size:12px; color:var(--muted); }
.badge { display:inline-block; padding:1px 8px; border-radius:10px; font-size:11px; font-weight:600; white-space:nowrap; }
.sev-high { background:var(--high-bg); color:var(--high); } .sev-medium { background:var(--medium-bg); color:var(--medium); } .sev-low { background:var(--low-bg); color:var(--low); }
.pr-P1 { background:var(--high-bg); color:var(--p1); } .pr-P2 { background:var(--medium-bg); color:var(--p2); } .pr-P3 { background:#eceff1; color:var(--p3); }
.st { background:#eceff1; color:#37474f; } .st-new { background:var(--accent-bg); color:var(--accent); } .st-accepted, .st-done, .st-approved { background:var(--low-bg); color:var(--low); }
.st-rejected { background:#eceff1; color:#78909c; } .st-in_research, .st-research, .st-in_progress { background:var(--medium-bg); color:var(--medium); }
.fk { background:#f1f3f5; color:#455a64; } .fk-fact { background:var(--low-bg); color:var(--low); } .fk-inference { background:var(--accent-bg); color:var(--accent); } .fk-hypothesis { background:#f3e5f5; color:#6a1b9a; }
.src-ok { background:var(--low-bg); color:var(--low); } .src-error { background:var(--high-bg); color:var(--high); } .src-needs_auth, .src-manual_import, .src-paid { background:var(--medium-bg); color:var(--medium); } .src-blocked, .src-disabled, .src-unknown { background:#eceff1; color:#546e7a; }
.conf { display:inline-block; width:56px; height:8px; background:#e3e8ee; border-radius:4px; vertical-align:middle; margin-right:4px; overflow:hidden; } .conf i { display:block; height:100%; background:var(--accent); }
table { width:100%; border-collapse:collapse; font-size:13px; } th, td { text-align:left; padding:7px 8px; border-bottom:1px solid var(--line); vertical-align:top; }
th { color:var(--muted); font-weight:600; font-size:12px; background:#f8fafc; position:sticky; top:0; } tr:hover td { background:#fafbfd; } td.num, th.num { text-align:right; white-space:nowrap; }
.tbl-wrap { overflow-x:auto; }
.sig { border-left:4px solid var(--line); padding:10px 12px; margin-bottom:10px; background:var(--card); border-radius:0 8px 8px 0; border-top:1px solid var(--line); border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.sig.sev-high { border-left-color:var(--high); background:var(--card); } .sig.sev-medium { border-left-color:var(--medium); background:var(--card); } .sig.sev-low { border-left-color:var(--low); background:var(--card); }
.sig .t { font-weight:600; margin-bottom:4px; } .sig .w { color:var(--text); } .sig .why { color:var(--muted); font-size:13px; margin-top:4px; } .sig .act { margin-top:6px; padding:6px 8px; background:#f5f8fc; border-radius:6px; font-size:13px; }
.sig .m { color:var(--muted); font-size:12px; margin-top:6px; display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; }
.filters { display:flex; flex-wrap:wrap; gap:8px; align-items:flex-end; background:var(--card); border:1px solid var(--line); border-radius:8px; padding:10px 12px; margin-bottom:14px; }
.filters label { display:flex; flex-direction:column; font-size:11px; color:var(--muted); gap:2px; } .filters select, .filters input { padding:5px 7px; border:1px solid var(--line); border-radius:6px; font-size:13px; min-width:120px; background:#fff; }
button, .btn { padding:6px 12px; border:1px solid var(--accent); background:var(--accent); color:#fff; border-radius:6px; cursor:pointer; font-size:13px; }
button.sec, .btn.sec { background:#fff; color:var(--accent); } button.danger { background:#fff; color:var(--high); border-color:var(--high); } button.small, .btn.small { padding:3px 8px; font-size:12px; }
form.inline { display:inline; } .actions-row { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
textarea, input[type=text], input[type=url], input[type=date], select { padding:6px 8px; border:1px solid var(--line); border-radius:6px; font-size:13px; width:100%; font-family:inherit; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px 12px; } .form-grid .full { grid-column:1/-1; } .form-grid label { font-size:12px; color:var(--muted); display:block; }
.muted { color:var(--muted); } .small { font-size:12px; } .nowrap { white-space:nowrap; } .right { text-align:right; }
.kv { display:grid; grid-template-columns:200px 1fr; gap:4px 12px; font-size:13px; } .kv dt { color:var(--muted); } .kv dd { margin:0; }
.note { background:var(--medium-bg); border:1px solid #f0d9a8; border-radius:8px; padding:10px 12px; font-size:13px; margin-bottom:12px; }
.ok-note { background:var(--low-bg); border:1px solid #bfe3c3; }
.comment { border-bottom:1px solid var(--line); padding:6px 0; font-size:13px; } .comment .a { color:var(--muted); font-size:12px; }
.spark { vertical-align:middle; } .tabs { display:flex; gap:6px; margin-bottom:10px; flex-wrap:wrap; } .tabs a { padding:5px 10px; border:1px solid var(--line); border-radius:16px; background:#fff; font-size:13px; } .tabs a.active { background:var(--accent); color:#fff; border-color:var(--accent); }
details summary { cursor:pointer; color:var(--accent); font-size:13px; }
.topbar { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.pill-list { display:flex; flex-wrap:wrap; gap:6px; } .pill { background:#eef2f7; border-radius:12px; padding:2px 9px; font-size:12px; }
.q-answer { display:grid; grid-template-columns:repeat(5,1fr); gap:10px; margin-bottom:16px; } .q-answer .card { padding:10px 12px; } .q-answer .q { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; } .q-answer .a { font-size:13px; margin-top:4px; }
@media (max-width:1200px) { .q-answer { grid-template-columns:1fr 1fr; } }
.offers { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:10px; }
.offer { display:flex; gap:10px; border:1px solid var(--line); border-radius:8px; padding:8px; align-items:flex-start; }
.offer img { width:84px !important; height:84px !important; max-width:84px; object-fit:contain; background:#fff; border:1px solid var(--line); border-radius:6px; flex:0 0 84px; }
.offer .noimg { width:84px; height:84px; flex:0 0 84px; border:1px dashed var(--line); border-radius:6px; font-size:11px; color:var(--muted); display:flex; align-items:center; justify-content:center; }
.offer .ob { font-size:13px; min-width:0; word-break:break-word; }
img.thumb { width:48px; height:48px; object-fit:contain; vertical-align:middle; border:1px solid var(--line); border-radius:4px; margin-right:6px; }
.col-grip { position:absolute; right:0; top:0; width:6px; height:100%; cursor:col-resize; user-select:none; }
.col-grip:hover { background:#c5d6f2; }
tr.usp-row td { border-top:0; padding-top:0; color:#4b5563; } tr.usp-row:hover td { background:transparent; }
td.better { background:#e8f5e9; font-weight:600; color:var(--low); } td.worse { background:#fff4e0; }
.print-only { display:none; } @media print { .sidebar, .filters, form, .no-print { display:none !important; } main { padding:0; } .print-only { display:block; } }

table.sticky-col th:nth-child(2), table.sticky-col td:nth-child(2) { position:sticky; left:0; background:#fff; z-index:2; box-shadow:2px 0 0 #e5e7eb; } table.sticky-col th:nth-child(2) { z-index:3; background:#f8fafc; }
table.sticky-col tr.usp-row td:nth-child(2) { position:static; box-shadow:none; }
.recs-card { border-left:4px solid #2a9d6b; margin-bottom:12px; } .rec-list { display:grid; grid-template-columns:repeat(auto-fit, minmax(340px, 1fr)); gap:8px 14px; } .rec { padding:6px 0; border-bottom:1px dashed var(--line); } .rec-head { margin-bottom:2px; } .rec-action { color:#374151; } .rec-unique .attr.better { background:#fde68a; }
.kpis { display:grid; grid-template-columns:repeat(auto-fit, minmax(190px, 1fr)); gap:10px; margin:0 0 12px; } .kpi { background:#fff; border:1px solid var(--line); border-radius:10px; padding:10px 12px; } .kpi-v { font-size:22px; font-weight:700; } .kpi-l { font-size:12px; color:var(--muted); margin-top:2px; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; } @media (max-width:1100px) { .grid2 { grid-template-columns:1fr; } }
.section-tabs a { padding:5px 12px; }
.attr-line { display:flex; flex-wrap:wrap; gap:4px 6px; } .attr { display:inline-block; padding:1px 7px; border-radius:8px; background:#eef2f7; font-size:11px; color:#1f2937; white-space:nowrap; } .attr.better { background:#d7efdb; } .attr.worse { background:#fde7c8; } .attr.nodata { background:#f3f4f6; color:#9ca3af; }

th.sortable { cursor:pointer; user-select:none; padding-right:16px; } th.sortable:hover { color:var(--accent); } th.sort-asc::after { content:' ▲'; font-size:9px; color:var(--accent); } th.sort-desc::after { content:' ▼'; font-size:9px; color:var(--accent); }

/* ---------- тёмная тема (переключатель в сайдбаре и на главной; выбор хранится в браузере) ---------- */
html[data-theme="dark"] { --bg:#0f1520; --card:#171f2b; --line:#2a3546; --text:#e6ebf2; --muted:#93a1b3; --accent:#7fb0ff; --accent-bg:#1e2c44;
  --high:#ff7b7b; --high-bg:#3a1f22; --medium:#ffb85c; --medium-bg:#3a2e17; --low:#7fd39a; --low-bg:#1c3324; --p1:#ff7b7b; --p2:#ffb85c; --p3:#9fb0c0; color-scheme:dark; }
html[data-theme="dark"] .sidebar { background:#0b1119; }
html[data-theme="dark"] th { background:#1c2634; color:var(--muted); }
html[data-theme="dark"] tr:hover td { background:#1c2634; }
html[data-theme="dark"] td.better { background:#1c3324; } html[data-theme="dark"] td.worse { background:#3a2e17; }
html[data-theme="dark"] .attr { background:#243042; color:#e6ebf2; } html[data-theme="dark"] .attr.better { background:#1c3324; } html[data-theme="dark"] .attr.worse { background:#3a2e17; } html[data-theme="dark"] .attr.nodata { background:#1c2634; color:#7c8a9c; }
html[data-theme="dark"] .kpi, html[data-theme="dark"] .rec-list, html[data-theme="dark"] .card { background:var(--card); border-color:var(--line); }
html[data-theme="dark"] .rec-action { color:#c9d3df; } html[data-theme="dark"] .rec-unique .attr.better { background:#4a3a10; }
html[data-theme="dark"] .offer img, html[data-theme="dark"] img.thumb { background:#fff; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background:#111927; color:var(--text); border-color:var(--line); }
html[data-theme="dark"] .btn.sec { background:#1c2634; color:var(--text); border-color:var(--line); }
html[data-theme="dark"] .tabs a { background:#1c2634; color:var(--text); border-color:var(--line); } html[data-theme="dark"] .tabs a.active { background:var(--accent); color:#0b1119; }
html[data-theme="dark"] .col-grip:hover { background:#31425a; }
html[data-theme="dark"] .usp-row td { color:#c9d3df; }
html[data-theme="dark"] svg text { fill:#e6ebf2; }
html[data-theme="dark"] .note, html[data-theme="dark"] .hint, html[data-theme="dark"] .q-answer { background:#1c2634; border-color:var(--line); }
.theme-toggle { display:inline-flex; align-items:center; gap:6px; cursor:pointer; border:1px solid var(--line); border-radius:16px; padding:3px 10px; font-size:12px; background:var(--card); color:var(--text); user-select:none; }
.theme-toggle:hover { border-color:var(--accent); }
.sidebar .theme-toggle { background:transparent; color:#dfe7f1; border-color:#33465e; margin-top:8px; }
html[data-theme="dark"] .act { background:#2a1d1f; border-color:#5a2a2e; color:var(--text); }
html[data-theme="dark"] .filters select, html[data-theme="dark"] .filters input, html[data-theme="dark"] button.danger { background:#111927; color:var(--text); }
html[data-theme="dark"] .sidebar .theme-toggle { color:#dfe7f1; }

/* тёмная тема: элементы с фиксированным светлым фоном */
html[data-theme="dark"] .pill { background:#243042; color:var(--text); }
html[data-theme="dark"] .st, html[data-theme="dark"] .st-rejected { background:#243042; color:var(--text); }
html[data-theme="dark"] .fk { background:#243042; color:var(--text); }
html[data-theme="dark"] .conf { background:#2a3546; }
html[data-theme="dark"] .col-grip:hover { background:#31425a; }
html[data-theme="dark"] table.sticky-col th:nth-child(2), html[data-theme="dark"] table.sticky-col td:nth-child(2) { background:var(--card); box-shadow:2px 0 0 var(--line); }
html[data-theme="dark"] table.sticky-col th:nth-child(2) { background:#1c2634; }
html[data-theme="dark"] .note { background:#3a2e17; border-color:#5a4a20; color:var(--text); }
html[data-theme="dark"] .badge.st { background:#243042; color:var(--text); }
html[data-theme="dark"] .sig .act { background:#1c2634; }
html[data-theme="dark"] .sig .act b { color:var(--high); }
html[data-theme="dark"] .q-answer .card { background:var(--card); }
html[data-theme="dark"] button, html[data-theme="dark"] .btn { border-color:var(--line); }
html[data-theme="dark"] button.sec:hover, html[data-theme="dark"] .btn.sec:hover { background:#243042; }
html[data-theme="dark"] .brand-text, html[data-theme="dark"] .sidebar nav a { color:#dfe7f1; }
html[data-theme="dark"] .sidebar .meta { color:#93a1b3; }
html[data-theme="dark"] hr { border-color:var(--line); }
html[data-theme="dark"] .thumb, html[data-theme="dark"] .offer img { background:#fff; }
html[data-theme="dark"] .rec { border-color:var(--line); }
html[data-theme="dark"] .kpi-v { color:var(--text); }
html[data-theme="dark"] a.btn.small, html[data-theme="dark"] .btn.small { color:var(--accent); }
html[data-theme="dark"] .btn:not(.sec), html[data-theme="dark"] button:not(.sec):not(.danger):not(.theme-toggle) { background:var(--accent); color:#0b1119; }
/* Наши сайты: список замечаний с карточками */
.audit-list { display:flex; flex-direction:column; gap:10px; }
.audit { padding:10px 14px; border-left:4px solid var(--line); }
.audit-P1 { border-left-color:var(--high); } .audit-P2 { border-left-color:var(--medium); } .audit-P3 { border-left-color:var(--low); }
.audit-dismissed { opacity:.55; }
.audit-head { display:flex; gap:10px; align-items:center; flex-wrap:wrap; } .audit-dismiss { margin-left:auto; }
.audit-what { font-weight:600; margin:6px 0 2px; font-size:14px; } .audit-fix { font-size:13px; color:#374151; }
.audit-cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(300px, 1fr)); gap:8px; margin-top:8px; }
.audit-card { display:flex; gap:10px; border:1px solid var(--line); border-radius:8px; padding:6px 8px; background:#fff; }
.audit-card img { width:72px; height:72px; object-fit:contain; border:1px solid var(--line); border-radius:6px; background:#fff; flex:none; }
.audit-noimg { width:72px; height:72px; border:1px dashed var(--line); border-radius:6px; font-size:11px; color:var(--muted); display:flex; align-items:center; justify-content:center; flex:none; }
.audit-card-body { min-width:0; } .audit-card-body a b { font-size:13px; }
.audit-ev { margin-top:6px; word-break:break-word; }
html[data-theme="dark"] .audit-card { background:var(--card); } html[data-theme="dark"] .audit-fix { color:#c9d3df; }

.cat-pills { flex-basis:100%; display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-top:6px; }
.pill-check { display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border:1px solid var(--line); border-radius:14px; font-size:12px; cursor:pointer; background:#fff; }
.pill-check:has(input:checked) { background:var(--accent); color:#fff; border-color:var(--accent); }
html[data-theme="dark"] .pill-check { background:#1c2634; color:var(--text); }
html[data-theme="dark"] .pill-check:has(input:checked) { background:var(--accent); color:#0b1119; }

/* стрелка «Назад» над каждым экраном */
.backbar { margin:0 0 8px; font-size:13px; } .backbar a { font-weight:600; text-decoration:none; padding:3px 10px 3px 8px; border:1px solid var(--line); border-radius:14px; background:#fff; display:inline-block; }
.backbar a:hover { border-color:var(--accent, #2563eb); }
html[data-theme="dark"] .backbar a { background:var(--card); color:var(--text); }

/* фото в событиях «что ввести» */
.sig-photos { display:flex; gap:12px; align-items:flex-start; flex-wrap:wrap; margin:6px 0 8px; }
.sig-photo { display:flex; gap:8px; align-items:center; max-width:300px; } .sig-photo img { width:84px; height:84px; object-fit:contain; border:1px solid var(--line); border-radius:8px; background:#fff; flex:none; }
.sig-photos.big .sig-photo img { width:160px; height:160px; } .sig-photos.big .sig-photo { max-width:420px; }
.sig-vs { align-self:center; font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; padding:0 4px; }
.th-photo { width:64px; height:64px; object-fit:contain; border:1px solid var(--line); border-radius:6px; background:#fff; display:block; margin-bottom:4px; }
.home-multi { display:flex; gap:8px; align-items:flex-start; margin-bottom:8px; } .home-multi > img { width:56px; height:56px; object-fit:contain; border:1px solid var(--line); border-radius:6px; background:#fff; flex:none; }
.home-multi img.mini { width:28px; height:28px; object-fit:contain; border:1px solid var(--line); border-radius:4px; background:#fff; vertical-align:middle; margin-right:3px; }
html[data-theme="dark"] .sig-photo img, html[data-theme="dark"] .th-photo, html[data-theme="dark"] .home-multi img { background:#fff; }
