/* Рабочий интерфейс: белые поверхности на светло-сером фоне, тонкие рамки, одна лёгкая тень у
   карточек. Цвет несёт смысл: акцент — действие и выбор, красный — критично, жёлтый — важно,
   зелёный — исправлено, серый — не ошибка. Текст контрастный: в инструменте читают весь день. */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --subtle: #f8f9fb;
  --hover: #f1f3f6;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --ink: #101828;
  --muted: #475467;
  --faint: #98a2b3;
  --accent: #0f6f66;
  --accent-hover: #0b5c55;
  --accent-soft: #e7f3f1;
  --accent-line: #a9d3cd;
  --critical: #b42318;
  --critical-soft: #fef3f2;
  --critical-line: #fecdca;
  --important: #b54708;
  --important-soft: #fffaeb;
  --important-line: #fedf89;
  --low: #475467;
  --low-soft: #f2f4f7;
  --wrong-bg: #fee4e2;
  --wrong-ink: #912018;
  --right-bg: #dcfae6;
  --right-ink: #085d3a;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-raised: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-pop: 0 12px 24px -6px rgba(16, 24, 40, 0.16), 0 4px 8px -4px rgba(16, 24, 40, 0.06);
  --focus: 0 0 0 3px rgba(15, 111, 102, 0.18);
  --radius: 10px;
  --radius-small: 8px;
  --nav: 240px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  /* PT Sans входит в macOS и рисовался под кириллицу. */
  font: 15px/1.5 "PT Sans", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: none; box-shadow: var(--focus); }
.raised { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- каркас: меню слева на всю высоту, страница справа */
.app { display: grid; grid-template-columns: var(--nav) minmax(0, 1fr); min-height: 100vh; }
.page { min-width: 0; padding: 24px 28px 40px; }

.nav {
  position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; gap: 20px; padding: 18px 12px; overflow: auto;
  border-radius: 0; border-width: 0 1px 0 0; box-shadow: none;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 2px 8px 0; }
.logo {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-small);
  background: var(--accent); color: #fff; font-weight: 700; font-size: 11px; line-height: 1.05; text-align: center;
}
.brand h1 { font-size: 15px; line-height: 1.25; }
.brand p { color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 2px; }

.tabs { display: flex; flex-direction: column; gap: 2px; }
.tab {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  font: inherit; text-align: left; color: var(--muted); background: none;
  border: 0; border-radius: var(--radius-small); cursor: pointer; transition: background 0.12s ease, color 0.12s ease;
}
.tab svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab b { display: block; font-size: 14px; font-weight: 700; color: var(--ink); }
.tab small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.tab:hover { background: var(--hover); }
.tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.tab[aria-selected="true"] b { color: var(--accent); }
.tab[aria-selected="true"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }

.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.label { color: var(--muted); font-size: 12px; font-weight: 700; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- заголовок страницы */
.page-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { font-size: 24px; line-height: 1.2; letter-spacing: -0.015em; }
.page-head p { color: var(--muted); font-size: 14px; max-width: 900px; }

/* ---------- кнопки и поля */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-small);
  padding: 7px 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow); transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.button:hover { background: var(--hover); color: var(--ink); }
.button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); font-weight: 700; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.button.small { padding: 4px 10px; font-size: 13px; border-radius: 7px; }
.button.wide { width: 100%; }
.button:disabled { color: var(--faint); background: var(--subtle); border-color: var(--line); cursor: default; box-shadow: none; }
.link { font: inherit; font-size: 13px; font-weight: 700; color: var(--accent); background: none; border: 0; padding: 4px 2px; cursor: pointer; text-align: left; }
.link:hover { color: var(--accent-hover); text-decoration: underline; }

.field {
  width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-small); padding: 7px 11px;
  box-shadow: var(--shadow); transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.field:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.field::placeholder { color: var(--faint); }
.field[readonly] { background: var(--subtle); color: var(--muted); }
.field.narrow { max-width: 320px; }
select.field { appearance: none; cursor: pointer; margin-bottom: 8px; padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.field { resize: vertical; min-height: 70px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

kbd {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 5px; font: 700 11px/17px "PT Mono", ui-monospace, monospace;
  text-align: center; color: var(--muted); background: var(--subtle); border: 1px solid var(--line); border-bottom-width: 2px;
}

/* ---------- плитки категорий */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 12px; align-items: center;
  font: inherit; text-align: left; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow-raised); }
.tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.tile[aria-pressed="true"] .glyph { background: var(--accent); color: #fff; }
.tile[aria-pressed="true"] .tile-name { color: var(--accent); }
.glyph {
  grid-row: 1 / 3; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-small);
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px;
}
.tile-name { font-size: 13px; font-weight: 700; color: var(--muted); line-height: 1.25; }
.tile .count { font-size: 22px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile .count small { font-size: 13px; font-weight: 400; color: var(--muted); }
.tile .about { grid-column: 1 / -1; color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.35; }
.tile.progress { cursor: default; display: block; }
.tile.progress:hover { border-color: var(--line); box-shadow: var(--shadow); }
.tile.progress .tile-name { display: block; margin-bottom: 2px; }
.tile.zero { opacity: 0.55; }

/* ---------- рабочая область находок */
.workspace { display: grid; grid-template-columns: 250px minmax(0, 1fr) 390px; gap: 16px; align-items: start; }
.workspace.with-card { grid-template-columns: minmax(0, 1fr) 390px; }
.single { padding: 20px; }

.filters { padding: 16px; position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.facet { margin-top: 16px; }
.facet h3, .facet summary { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.facet summary { cursor: pointer; list-style: none; }
.facet summary::before { content: "▸ "; }
.facet[open] summary::before { content: "▾ "; }
.facet h3 em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--accent); }
#reset { margin-top: 18px; }

/* Выбранный фильтр отмечен галочкой и цветом, а не только фоном. */
.check {
  display: flex; justify-content: space-between; gap: 8px; width: 100%;
  font: inherit; font-size: 14px; text-align: left; color: var(--ink); background: none;
  border: 1px solid transparent; border-radius: 7px; padding: 4px 8px; cursor: pointer;
}
.check:hover { background: var(--hover); }
.check[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); font-weight: 700; }
.check[aria-pressed="true"] > span:first-child::before { content: "✓ "; }
.check .n { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 400; }
.check.inline { width: auto; white-space: nowrap; border-color: var(--line-strong); background: var(--surface); }
.check.inline[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); }

.list { padding: 14px 0 6px; min-width: 0; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 0 16px 12px; color: var(--muted); }
.list-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 16px 12px; color: var(--muted); font-size: 14px; }
.single .list-head, .single .list-sub { padding-left: 0; padding-right: 0; }
.pager { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; font-size: 14px; }
.pager span, .pager .check { white-space: nowrap; }
.pager .field { width: 220px; }

/* Переключатель приоритета */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 9px; background: var(--low-soft); border: 1px solid var(--line); }
.segmented button {
  display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 13px; color: var(--muted);
  background: none; border: 0; border-radius: 6px; padding: 5px 11px; cursor: pointer; white-space: nowrap;
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-raised); }
.segmented .n { color: var(--faint); font-weight: 400; font-variant-numeric: tabular-nums; }

/* Выбранные фильтры над таблицей */
.active { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 999px; padding: 2px 5px 2px 10px; cursor: pointer;
}
.chip .x { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; }
.chip:hover .x { background: var(--accent); color: #fff; }
.bulk { display: flex; align-items: center; gap: 8px; color: var(--ink); margin-left: auto; }

/* ---------- таблицы */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.05em;
  padding: 8px 12px; background: var(--subtle); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 10px 12px; vertical-align: top; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
#rows tr { cursor: pointer; }
#rows tr:hover td { background: var(--subtle); }
#rows tr[aria-selected="true"] td { background: var(--accent-soft); }
#rows tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
#rows tr.done td { color: var(--muted); }
#view-findings table { table-layout: fixed; min-width: 680px; }
#view-findings th { white-space: normal; }
#view-findings th:nth-child(1) { width: 40px; }
#view-findings th:nth-child(2) { width: 100px; }
#view-findings th:nth-child(3) { width: 22%; }
#view-findings th:nth-child(4) { width: 19%; }
#view-findings th:nth-child(6) { width: 120px; }
#rows .fix { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
#rows .arrow { color: var(--accent); font-weight: 700; }
#view-patterns td:nth-child(2) { width: 34%; }

.card-id { font-family: "PT Mono", ui-monospace, monospace; font-size: 12px; color: var(--muted); white-space: nowrap; }
.name { display: block; font-weight: 700; overflow-wrap: anywhere; }
.name.guess { font-weight: 400; color: var(--muted); }
.sub { display: block; color: var(--muted); font-size: 12px; }
.text { overflow-wrap: anywhere; }
mark { background: var(--wrong-bg); color: var(--wrong-ink); font-weight: 700; border-radius: 3px; padding: 0 2px; }
ins { background: var(--right-bg); color: var(--right-ink); font-weight: 700; border-radius: 3px; padding: 0 2px; text-decoration: none; }
.status { white-space: nowrap; font-size: 13px; }
a.sub { margin-top: 4px; }
.empty, .hint { color: var(--muted); padding: 24px 16px; text-align: center; }
.note { color: var(--muted); font-size: 13px; }

/* Приоритет и статус словом, а не только цветом */
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; white-space: nowrap;
  border-radius: 999px; padding: 1px 8px 1px 7px; background: var(--low-soft); color: var(--low); border: 1px solid var(--line);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.critical { background: var(--critical-soft); color: var(--critical); border-color: var(--critical-line); }
.pill.important { background: var(--important-soft); color: var(--important); border-color: var(--important-line); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--low); }
.dot.critical { background: var(--critical); }
.dot.important { background: var(--important); }
.state { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; color: var(--faint); border: 1px solid transparent; }
.state.fix { background: var(--important-soft); color: var(--important); border-color: var(--important-line); }
.state.no { background: var(--low-soft); color: var(--low); border-color: var(--line); }
.state.done { background: var(--right-bg); color: var(--right-ink); border-color: #a6f4c5; }

/* ---------- карточка находки справа */
.detail { padding: 18px; position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow: auto; }
.detail-head { display: flex; flex-direction: column; gap: 4px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.detail .title { font-size: 18px; font-weight: 700; line-height: 1.3; }
.detail .where { color: var(--muted); font-size: 13px; }
.block { padding-top: 16px; }
.block h3 { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.quote { border-radius: var(--radius-small); padding: 10px 12px; background: var(--subtle); border: 1px solid var(--line); overflow-wrap: anywhere; }
.quote.none { color: var(--muted); font-size: 14px; }
.status-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.decide { margin-top: 18px; padding: 14px; border-radius: var(--radius); background: var(--subtle); border: 1px solid var(--line); }
.decide h3 { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.verdicts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.verdicts .button { flex-direction: column; gap: 3px; padding: 8px 6px; font-size: 13px; }
.verdicts .button[data-status="исправить"][aria-pressed="true"] { background: var(--important-soft); border-color: var(--important-line); color: var(--important); }
.verdicts .button[data-status="исправлено"][aria-pressed="true"] { background: var(--right-bg); border-color: #a6f4c5; color: var(--right-ink); }
.verdicts .button[data-status="не ошибка"][aria-pressed="true"] { background: var(--low-soft); border-color: var(--line-strong); color: var(--low); }
.keys { margin-top: 16px; color: var(--muted); font-size: 13px; }
.keys summary { cursor: pointer; }
.keys ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }

/* ---------- карточка целиком */
.card-view { padding: 18px 20px; min-width: 0; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 12px 0; border-top: 1px solid var(--line); }
.columns.head { border-top: 0; color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding-bottom: 4px; }
.columns.calm { color: var(--muted); }
.side { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.55; }
.side::first-line { font-weight: 700; }
.card-view mark { cursor: pointer; }
.card-view mark.important { background: #fef0c7; color: #93370d; }
.card-view mark.low { background: var(--low-soft); color: var(--ink); box-shadow: inset 0 -2px 0 var(--line-strong); }
.card-view mark.active { outline: 2px solid var(--accent); outline-offset: 1px; }
.card-view mark.done { opacity: 0.5; text-decoration: line-through; }
.loose { margin: 10px 0; }

/* ---------- вкладка «Страницы» */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .n { color: var(--faint); font-weight: 400; }
.page-row { cursor: pointer; }
.page-row:hover td { background: var(--subtle); }
.page-row.done td { color: var(--muted); }
.page-row .card-id { display: block; margin-top: 2px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
#view-pages td:first-child { width: 38%; }

/* Ошибки одной страницы списком, по категориям */
.errors { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.error-group { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.error-group h3 { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; padding: 8px 12px; background: var(--subtle); border-bottom: 1px solid var(--line); }
.error-row {
  display: grid; grid-template-columns: 100px 210px minmax(0, 1fr) auto; gap: 12px; align-items: start; width: 100%;
  font: inherit; font-size: 14px; text-align: left; color: var(--ink); background: var(--surface); border: 0;
  border-bottom: 1px solid var(--line); padding: 10px 12px; cursor: pointer;
}
.error-row:last-child { border-bottom: 0; }
.error-row:hover { background: var(--subtle); }
.error-row.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.error-row.done { color: var(--muted); }
.error-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.error-actions .button[aria-pressed="true"] { background: var(--right-bg); border-color: #a6f4c5; color: var(--right-ink); }
.page-banner { margin: 12px 0 4px; padding: 10px 14px; border-radius: var(--radius-small); background: var(--subtle); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.page-banner.processed { color: var(--right-ink); background: var(--right-bg); border-color: #a6f4c5; font-weight: 700; }
.error-row .pill { justify-self: start; }
.error-type { font-weight: 700; }
.error-type .sub { font-weight: 400; }
.error-text { overflow-wrap: anywhere; }
@media (max-width: 1100px) {
  .error-row { grid-template-columns: 100px minmax(0, 1fr); }
  .error-text, .error-actions { grid-column: 2; }
  .error-actions { flex-direction: row; justify-content: flex-start; }
}

/* ---------- сводка, полосы */
.section-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.gap { margin-top: 28px; }
.single .note { margin-bottom: 12px; }
.meter { display: block; height: 6px; border-radius: 3px; background: var(--low-soft); overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s ease; }
.meter.big { height: 10px; border-radius: 5px; margin: 14px 0 8px; }
.bar-head, .bar-cell { width: 220px; }
.bar { display: inline-block; vertical-align: middle; width: 120px; height: 6px; border-radius: 3px; background: var(--low-soft); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.bar.critical > span { background: var(--critical); }
.bar.important > span { background: var(--important); }
.bar.low > span { background: var(--faint); }

/* ---------- запуск и уведомления */
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 24px; width: min(620px, 92vw); color: var(--ink); box-shadow: var(--shadow-pop); }
dialog::backdrop { background: rgba(16, 24, 40, 0.45); }
dialog h2 { font-size: 18px; margin-bottom: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.sources { list-style: none; padding: 0; margin: 10px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: 14px; }
.sources .missing { color: var(--critical); }
.upload { padding: 14px 16px; margin-bottom: 16px; border-radius: var(--radius); background: var(--subtle); border: 1px solid var(--line); }
.upload input[type="file"] { font: inherit; font-size: 13px; display: block; margin: 4px 0 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 16px; z-index: 10; max-width: 80vw;
  background: var(--ink); color: #fff; border: 0; box-shadow: var(--shadow-pop); font-size: 14px; }

/* ---------- компактный режим: больше строк на экране */
body.compact td { padding: 5px 12px; }
body.compact #rows .text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
body.compact #rows .fix { margin-top: 2px; padding-top: 0; border: 0; }
body.compact #rows .sub, body.compact #rows .name { display: inline; margin-left: 6px; }
body.compact .tiles, body.compact .page-head p { display: none; }

/* ---------- узкие экраны */
@media (max-width: 1760px) {
  .workspace { grid-template-columns: 220px minmax(0, 1fr) 350px; }
  .workspace.with-card { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 1560px) {
  :root { --nav: 68px; }
  .page { padding: 20px 22px 36px; }
  .workspace { grid-template-columns: 220px minmax(0, 1fr) 350px; }
  .workspace.with-card { grid-template-columns: minmax(0, 1fr) 350px; }
  .tab span, .brand-text, .nav-foot .label, .nav-foot .field, .nav-foot .pair, #logout { display: none; }
  .tab { justify-content: center; padding: 10px 0; }
  .tab[aria-selected="true"]::before { left: -12px; }
  .brand { justify-content: center; padding: 0; }
  #open-run, #export, #fixed { font-size: 0; padding: 9px 0; min-width: 0; }
  #fixed::before { content: "✓"; font-size: 16px; }
  #open-run::before { content: "▶"; font-size: 13px; }
  #export::before { content: "⤓"; font-size: 16px; }
}
@media (max-width: 1280px) {
  .workspace { grid-template-columns: 230px minmax(0, 1fr); }
  .workspace.with-card { grid-template-columns: 1fr; }
  .detail { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 1000px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; max-height: none; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .page { padding: 16px; }
  .nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-width: 0 0 1px; }
  .tabs { flex-direction: row; flex-wrap: wrap; }
  .tab { width: auto; padding: 8px 10px; }
  .tab[aria-selected="true"]::before { display: none; }
  .nav-foot { margin: 0; padding: 0; border: 0; flex-direction: row; }
  .workspace { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.check-line { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; cursor: pointer; }

/* Аналитика */
.period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.period .label.inline { margin-left: 6px; }
.field.date { width: auto; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.metric { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.metric .count { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric .count small { font-size: 13px; font-weight: 400; color: var(--muted); }
.metric .about { color: var(--muted); font-size: 12px; }
tr.idle td { color: var(--faint); }
mark.right { background: var(--right-bg); color: var(--right-ink); }
.day-chart { display: grid; gap: 6px; }
.legends { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.legend { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.day-line { display: grid; grid-template-columns: 96px 1fr 48px; align-items: center; gap: 10px; font-size: 13px; }
.day-line .day { color: var(--muted); font-variant-numeric: tabular-nums; }
.day-line .stack { display: flex; height: 14px; border-radius: 4px; background: var(--low-soft); overflow: hidden; }
.day-line .num { text-align: right; font-variant-numeric: tabular-nums; }
#people-rows .actions { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
