/* Модуль ops: «Обзор», «Сервер», «Копии», «Файлы сервера». Цвета - только переменные desk.css: обе темы сами. */

.ops { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ops-dim { opacity: .6; transition: opacity .15s; }
.ops-note { font-size: 12.5px; margin: 0; }
.ops .mono { overflow-wrap: anywhere; }
.ops code, .ops-path { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.ops .banner code { background: var(--surface); padding: 1px 5px; border-radius: 4px; }

/* --- фильтры: одной строкой над всем, что они меняют ------------------------------------------------------------ */
.ops-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ops-seg {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; align-self: flex-start;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--sunken);
}
.ops-seg button {
  border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 5px;
  cursor: pointer; color: var(--ink-2); font-size: 13px; white-space: nowrap;
}
.ops-seg button:hover { color: var(--ink); }
.ops-seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.ops-select { width: auto; min-width: 150px; max-width: 230px; height: 34px; }

/* --- плитки: классы ядра .tiles/.tile, здесь только перенос подсказки ---------------------------------------------- */
.ops .tile { min-width: 0; }
.ops .tile small { line-height: 1.35; }

/* --- карточки ------------------------------------------------------------------------------------------------- */
.ops-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.ops-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ops-card.wide { grid-column: 1 / -1; }
.ops-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ops-card-head h3 { margin: 0; }
.ops-card-head p { margin-top: 2px; }
.ops-table { margin-top: 2px; }

/* --- графики: столбцы и теплокарта --------------------------------------------------------------------------- */
.ops-chart { width: 100%; min-width: 0; }
.ops-chart svg { display: block; }
.ops-chart text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ops-tick line { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.ops-base { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.ops-hit { fill: transparent; }
.ops-slot:hover .ops-hit { fill: var(--sunken); }
.ops-bar { fill: var(--ink-2); }
.ops-slot.now .ops-bar { fill: var(--accent-text); }
.ops-slot:hover .ops-bar { fill: var(--ink); }
.ops-cell { fill: var(--accent-text); }
.ops-cell.l0 { fill: var(--sunken); }
.ops-cell.l1 { fill-opacity: .25; }
.ops-cell.l2 { fill-opacity: .5; }
.ops-cell.l3 { fill-opacity: .75; }
.ops-cell:hover { stroke: var(--ink); stroke-width: 1.5; }
.ops-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.ops-swatch { width: 14px; height: 14px; border-radius: 3px; background: var(--accent-text); }
.ops-swatch.l0 { background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); }
.ops-swatch.l1 { opacity: .25; }
.ops-swatch.l2 { opacity: .5; }
.ops-swatch.l3 { opacity: .75; }
.ops-legend-note { margin-left: auto; }

/* --- полосы: причины ошибок, инструменты, модели ----------------------------------------------------------------- */
.ops-rank { display: flex; flex-direction: column; gap: 7px; }
.ops-rank-row {
  display: grid; grid-template-areas: "label track value"; grid-template-columns: minmax(0, 38%) minmax(40px, 1fr) auto;
  align-items: center; gap: 4px 10px; font-size: 13px;
}
.ops-rank-label { grid-area: label; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-rank-row .ops-track { grid-area: track; }
.ops-rank-value { grid-area: value; white-space: nowrap; text-align: right; }
.ops-rank-value .pill { height: 18px; font-size: 11px; margin-left: 4px; }
.ops-track { display: block; height: 8px; min-width: 0; }
.ops-track > i { display: block; height: 100%; background: var(--ink-2); border-radius: 0 4px 4px 0; }
.ops-rank.bad .ops-track > i { background: var(--bad); }
.ops-rank-row:hover .ops-track > i { background: var(--ink); }
.ops-rank.bad .ops-rank-row:hover .ops-track > i { filter: brightness(.9); }
.ops-cellbar { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }
.ops-cellbar .ops-track { width: 48px; }

.bar.ops-meter { display: block; flex: none; width: 100%; height: 8px; border-radius: 4px; }
.ops-line .bar.ops-meter { flex: 1; width: auto; min-width: 80px; }

/* --- цифры и списки ------------------------------------------------------------------------------------------- */
.ops-figure { gap: 10px; }
.ops-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.ops-big b { font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.ops-big span { color: var(--muted); font-size: 13px; }
.ops-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; font-size: 13px; min-width: 0; }
.ops-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 13px; }
.ops-kv dt { color: var(--muted); }
.ops-kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.ops-who, .ops-anomalies, .ops-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ops-who-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; }
.ops-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; min-width: 0; }
.ops-chips .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ops-anomalies li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.ops-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.ops-live { color: var(--accent-text); }
.ops-disk { display: flex; flex-direction: column; gap: 6px; }
.ops-disk + .ops-disk { padding-top: 10px; border-top: 1px solid var(--line); }
.ops-open { display: flex; flex-direction: column; gap: 2px; }
.ops-pick { max-width: 280px; margin-top: 10px; }

/* --- файлы сервера ------------------------------------------------------------------------------------------- */
.ops-files { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 12px; align-items: start; }
.ops-pane { min-width: 0; }
.ops-files .file-row.on { background: var(--sunken); }
.ops-files .file-row.ops-closed { color: var(--muted); }
.ops-files .file-row.ops-closed small { color: var(--warn); }
.ops-viewer .file-view pre { max-height: 70vh; }

/* --- телефон ------------------------------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .ops-grid, .ops-files { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .ops .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops .tile b { font-size: 20px; }
  .ops-select { flex: 1 1 140px; min-width: 0; max-width: none; }
  .ops-rank-row { grid-template-areas: "label value" "track track"; grid-template-columns: minmax(0, 1fr) auto; }
  .ops-legend-note { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .ops-dim { transition: none; } }
