/* TopLine — ИНТЭК design code, 21.09.2026.
   Corporate tokens; dense operational layouts intentionally retain a wider canvas.
   Fonts and original brand assets are local: no external requests at runtime. */
:root {
  --brand-red: #e30613;
  --brand-dark-surface: radial-gradient(ellipse at 0 0, #e306130d, transparent 62%), #171719;
  --bg: #f6f4ef;
  --bg-card: #fdfcf9;
  --bg-elevated: #ece9e2;
  --bg-sunken: #f0ede6;
  --zebra: #f8f6f1;
  --fg: #181817;
  --fg-muted: #605e59;
  --fg-subtle: #8a877f;
  --signal: #e33b2f;
  --signal-hover: #c92f25;
  --signal-muted: #e33b2f16;
  --destructive: #c9342c;
  --brd: #dcd8cf;
  --brd-hover: #c8c2b8;
  --control-border: #8a877f;
  --grid-line: rgba(24, 24, 23, .055);
  --card: var(--bg-card);
  --surface: var(--bg-card);
  --surface2: var(--bg-elevated);
  --panel-soft: var(--bg-elevated);
  --bg-elev: var(--bg-elevated);
  --hover: var(--bg-elevated);
  --text: var(--fg);
  --text-dim: var(--fg-muted);
  /* Dense captions carry operational information: use readable muted, not the
     corporate subtle color, which is reserved for decorative strokes. */
  --text-mut: var(--fg-muted);
  --muted: var(--fg-muted);
  --border: var(--brd);
  --border-strong: var(--brd-hover);
  --accent: var(--signal);
  --accent-hover: var(--signal-hover);
  --accent-ink: #bc2a21;
  --accent-weak: var(--signal-muted);
  /* Normal-size labels need 4.5:1. This scoped action pair preserves brand red
     while correcting the white-on-signal contrast in the marketing reference. */
  --action-bg: #c92f25;
  --action-hover: #b1261e;
  --action-ink: #ffffff;
  --ok: #246f4c;
  --ok-weak: #2f8f6314;
  --warn: #87500e;
  --warn-weak: #c77b1818;
  --danger: var(--destructive);
  --danger-weak: #c9342c14;
  --v1: #675682;
  --v1-weak: #67568214;
  --v2: #286c7a;
  --v2-weak: #286c7a14;
  --shadow: 0 1px 2px rgba(25,24,21,.05), 0 14px 40px rgba(25,24,21,.06);
  --shadow-sm: 0 2px 4px #18181704;
  --radius: 20px;
  --radius-sm: 12px;
  --font-sans: "Geologica", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --motion-fast: 150ms;
  --motion-ui: 180ms;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --motion-press: 110ms;
  --motion-enter: 200ms;
  --motion-exit: 150ms;
  --motion-tip: 125ms;
  --motion-fade: 120ms;
  --motion-progress-delay: 200ms;
  --shadow-pop: 0 1px 2px rgb(24 24 23 / .06), 0 8px 20px -6px rgb(24 24 23 / .16);
  --workspace-width: 1480px;
  color-scheme: only light;
}

/* ===================================================================
   Base
   =================================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -.012em;
  font-optical-sizing: auto;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--motion-ui) var(--ease-out), color var(--motion-ui) var(--ease-out);
}
:where(h1, h2, h3, h4) { font-variation-settings: "SHRP" 34; text-wrap: balance; }
:where(button, input, select, textarea, summary, a):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
button, input, select, textarea { font-family: inherit; -webkit-tap-highlight-color: transparent; }
:where(code, pre, kbd, samp) { font-family: var(--mono); letter-spacing: 0; }
button { touch-action: manipulation; }
input, select, textarea { min-width: 0; }
:where(input, select, textarea):disabled { cursor: not-allowed; opacity: .6; }

/* Consistent interaction transitions on the common chrome.
   NB: .table-wrap excluded — a box-shadow transition on a scroll container promotes a layer. */
.segment, .topbar, .card, .kpi, .lic-item, .toast,
.btn, .seg-btn, .badge, select, input {
  transition: background-color var(--motion-ui) var(--ease-out), border-color var(--motion-ui) var(--ease-out),
    box-shadow var(--motion-ui) var(--ease-out), color var(--motion-ui) var(--ease-out),
    transform var(--motion-fast) var(--ease-out);
}
canvas { transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:active, .seg-btn:active { transform: none !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Custom thin rounded scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-mut); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* Red selection */
::selection { background: var(--action-bg); color: var(--action-ink); }

/* ===================================================================
   App shell layout (vertical: topbar + horizontal nav + main)
   =================================================================== */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }
.skip-link { position: absolute; top: 8px; left: 16px; z-index: 3000; transform: translateY(-160%); padding: 10px 16px; background: var(--card); color: var(--text); border-radius: 12px; }
.skip-link:focus { transform: translateY(0); }

/* ===================================================================
   Top bar (brand + object + signed-in account)
   =================================================================== */
.topbar {
  /* NOT sticky: a sticky bar over the scrolling table left stale composited tiles (grey ghost
     squares) in Chrome. Correctness beats a pinned header — the artifacts are gone without it. */
  position: relative; z-index: 41;
  display: flex; align-items: center; gap: 12px;
  padding: 16px max(24px, calc((100vw - var(--workspace-width)) / 2 + 24px));
  min-height: 80px;
  /* OPAQUE, no backdrop-filter: a translucent sticky bar with blur() left stale composited tiles
     (grey ghost rectangles) over the scrolling table in Chrome. Solid background = no blur layer. */
  background: var(--brand-dark-surface);
  color: #f4f4f5;
  border-bottom: 1px solid #e3061347;
}
.topbar-spacer { flex: 1 1 auto; }
/* Identity is information, not another shortcut to the existing Settings page. */
.topbar-account { display: flex; align-items: center; gap: 12px; min-width: 0; max-width: 360px; flex: 0 1 auto; }
.topbar-account-name { min-width: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 500; line-height: 1.45; cursor: default; }
.topbar-account-name[hidden], .topbar #logoutBtn[hidden] { display: none; }
.topbar #logoutBtn { min-height: 44px; flex: 0 0 auto; white-space: nowrap; }
/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; min-width: 0; flex: 0 0 auto; }
.topline-logo { display: block; width: 226px; max-width: 100%; height: auto; aspect-ratio: 1026.4903 / 272; object-fit: contain; }
.app-brand-footer { display: flex; justify-content: flex-end; width: 100%; max-width: var(--workspace-width); margin: auto auto 0; padding: 0 24px 20px; }
.intek-endorsement { display: block; width: 240px; max-width: 100%; height: auto; aspect-ratio: 240 / 72; object-fit: contain; }
.intek-endorsement-link { display: block; width: 240px; max-width: 100%; flex: 0 1 auto; border-radius: 8px; text-decoration: none; cursor: pointer; touch-action: manipulation; }
.intek-endorsement-link:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 4px; }
.security-brand-panel .intek-endorsement-link:focus-visible { outline-color: #ff8177; }
.topbar .topbar-intek-credit { display: flex; align-items: center; width: 140px; min-height: 44px; flex: 0 0 auto; }
.topbar .topbar-intek-credit .intek-endorsement { width: 100%; height: auto; }
.topbar .topbar-intek-credit:focus-visible { outline-color: #ff8177; }
@media (max-width: 760px) {
  /* Keep the product and maker together without squeezing the object/account rows. */
  .app-shell header.topbar .brand { flex: 1 1 0; }
  .topbar .topbar-intek-credit { order: 1; }
}
@media (max-width: 640px) {
  .topbar .topbar-intek-credit { width: 120px; }
}
@media print { .app-brand-footer { display: none; } }
.topbar .obj-label { color: #c4c4cb; }
.topbar :is(select, .btn) { color-scheme: dark; background: #202024; color: #f4f4f5; border-color: #74717b; }
.topbar :is(select, .btn):hover { background: #2b2b30; border-color: #a1a1aa; }
.topbar select { min-width: 160px; max-width: 240px; }
/* Client accounts: the header names the client instead of a blank database choice. */
.obj-client { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.topbar .obj-client { color: #f4f4f5; }
.obj-client[hidden], .obj-select select[hidden] { display: none; }
/* The client block mirrors the brand block: name on top, caption below, divider on the left. */
.topbar .obj-select--client {
  display: grid; grid-template-columns: auto auto; grid-template-areas: "name sel" "label sel";
  align-items: center; column-gap: 14px; row-gap: 3px;
  padding-left: 20px; border-left: 1px solid #44413b; line-height: 1.3;
}
.topbar .obj-select--client .obj-client { grid-area: name; font-size: 18px; letter-spacing: -.02em; }
.topbar .obj-select--client .obj-label { display: block; grid-area: label; font-size: 10px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.topbar .obj-select--client select { grid-area: sel; }
@media (max-width: 760px) {
  .topbar .obj-select--client { padding-left: 0; border-left: 0; }
  .topbar-account { order: 4; flex: 1 0 100%; max-width: none; justify-content: space-between; padding-top: 4px; }
  .topbar-account-name { flex: 1 1 auto; }
}

/* ===================================================================
   Horizontal section nav (reuses .segment / .seg-btn hooks)
   =================================================================== */
.segment {
  position: relative; z-index: 40;   /* not sticky — see .topbar note (ghost-tile artifacts) */
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.segment-inner {
  display: flex;
  gap: 6px;
  padding: 10px 24px;
  max-width: var(--workspace-width);
  margin: 0 auto;
  width: 100%;
  overflow-x: auto;
}
.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  flex: 0 0 auto;
  min-height: 44px;
}
.seg-btn .seg-ico { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: 0 0 auto; }
.seg-btn:hover { background: var(--bg-elev); color: var(--text); }
.seg-btn.active { background: var(--accent-weak); color: var(--accent-ink); font-weight: 600; }
.seg-btn.active .seg-ico { color: var(--accent); }
.seg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg-btn:active { transform: scale(.97); }

.obj-select { display: flex; align-items: center; gap: 9px; min-width: 0; }
.obj-label {
  font-size: 13px; color: var(--text-mut); font-family: var(--font-sans);
  text-transform: none; letter-spacing: 0; font-weight: 600; line-height: 1.5;
  white-space: nowrap;
}

/* form controls */
select, input, textarea {
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}
select, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]) { min-height: 48px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--action-bg); }
textarea { line-height: 1.55; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text-mut); opacity: 1; }
select { min-width: 220px; max-width: 46vw; cursor: pointer; }
select:hover, input:hover, textarea:hover { border-color: var(--text-dim); }
select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}

details > summary { min-height: 36px; }

/* buttons */
.btn {
  font: inherit;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--control-border);
  background: var(--card);
  color: var(--text);
  user-select: none;
  white-space: nowrap;
  min-height: 44px;
  justify-content: center;
}
.btn:hover { background: var(--hover); border-color: var(--brd-hover); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--bg-elev); }
.btn-primary {
  background: var(--action-bg);
  border-color: var(--action-bg);
  color: var(--action-ink);
  font-weight: 600;
  box-shadow: none;
}
.btn-primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
.btn-sm { min-height: 36px; padding: 7px 11px; font-size: 12.5px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn:active:not([disabled]):not([aria-disabled="true"]) { transform: scale(.97); }
.ico { display: inline-flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; }
.ico svg { display: block; }

/* ===================================================================
   View + states
   =================================================================== */
.view { padding: 28px 24px 48px; max-width: var(--workspace-width); margin: 0 auto; width: 100%; min-width: 0; }
.view:focus { outline: none; }
.placeholder, .empty, .loading, .error-box { padding: 44px; text-align: center; color: var(--text-mut); }
.loading::after { content: "…"; }
.report-loading-shell,
.report-result-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 112px;
  color: var(--text-dim);
}
.report-loading-shell { margin-top: 14px; }
.report-result-loading { min-height: 150px; }
.report-loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid var(--border-strong);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
.report-error-shell { display: grid; gap: 10px; justify-items: start; margin-top: 14px; }
.report-error-shell .error-box { width: 100%; margin: 0; }
.report-awaiting-run { min-height: 150px; }
@media (prefers-reduced-motion: reduce) {
  .report-loading-spinner { animation-duration: 1.4s; }
}
.error-box {
  color: var(--danger);
  background: var(--danger-weak);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 14px 18px; margin: 12px 0; text-align: left;
}
.directory-card-feedback {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  overflow-wrap: anywhere;
  gap: 10px;
  color: var(--text);
}
.directory-card-feedback > button {
  justify-self: start;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.section-title {
  font-size: 13px; font-weight: 600; color: var(--text-mut); font-family: var(--font-sans);
  text-transform: none; letter-spacing: 0; line-height: 1.5;
  margin: 26px 0 11px;
}
.page-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font-size: clamp(24px, 2.2vw, 30px); font-weight: 600; margin: 0; letter-spacing: -.04em; line-height: 1.2; }
.page-sub { font-size: 13px; color: var(--text-mut); }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.controller-config-audit-tools { margin: -8px 0 14px; display: grid; gap: 8px; }
.controller-config-audit-results:empty { display: none; }
.controller-config-audit-table { max-height: 420px; overflow: auto; }
.controller-config-audit-table table { min-width: 980px; }
.controller-config-audit-details { min-width: 280px; max-width: 520px; white-space: normal; }
.controller-read-job {
  display: grid; gap: 10px; margin: 0 0 16px; padding: 16px;
}
.controller-read-job-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
}
.controller-read-job-title {
  margin: 0 0 3px; font-size: 15px; line-height: 1.35; font-weight: 800;
}
.controller-read-job-count { flex: 0 0 auto; font-size: 16px; }
.controller-read-job-summary { min-height: 20px; font-size: 13px; font-weight: 700; }
.fillings-editor-workspace { min-width: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.fillings-editor-manager { padding: 12px; }
.fillings-editor-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.fillings-editor-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 10px; }
.fillings-editor-workspace .f-field { min-width: 0; margin: 0; gap: 4px; }
.fillings-editor-workspace .f-label { font-size: 12px; line-height: 1.4; }
.fillings-editor-workspace .f-input { width: 100%; min-width: 0; min-height: 36px; padding: 7px 9px; font-size: 13px; }
.fillings-editor-workspace input.f-input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]) { min-height: 36px; }
.fillings-editor-workspace .report-datetime-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(105px, .8fr); gap: 6px; }
.fillings-editor-workspace .report-filter-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.fillings-editor-workspace .btn { min-height: 36px; padding: 7px 11px; font-size: 13px; }
.fillings-editor-workspace .btn-sm { min-height: 32px; padding: 5px 8px; font-size: 12px; }
.fillings-editor-workspace .table-wrap { margin-top: 8px; max-width: 100%; border-radius: 8px; }
.fillings-editor-workspace .report-table { min-width: 900px; font-size: 13px; }
.fillings-editor-workspace .report-table td { vertical-align: middle; white-space: normal; padding: 6px 10px; overflow-wrap: anywhere; min-width: 0; }
.fillings-editor-workspace .report-table th { white-space: nowrap; padding: 8px 10px; }
.fillings-editor-workspace .report-table td:first-child { min-width: 145px; white-space: nowrap; }
.fillings-editor-workspace .report-table .small { font-size: 12px; }
.fillings-editor-workspace .row-actions { flex-wrap: nowrap; min-width: 0; max-width: none; gap: 4px; }
.fillings-editor-workspace .row-actions .btn { white-space: nowrap; }
.fillings-editor-state { font-size: 12px; }
.fillings-editor-workspace .report-pager { margin: 10px 0 0; padding-top: 8px; }
.fillings-editor-workspace .btn:focus-visible, .fillings-editor-workspace .f-input:focus-visible, .fillings-editor-workspace summary:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.fillings-editor-dialog { width: min(600px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 56px rgba(0, 0, 0, .22); overflow: auto; overscroll-behavior: contain; }
.fillings-editor-dialog[hidden], .fillings-editor-dialog:not([open]) { display: none; }
body:has(.fillings-editor-dialog[open]) { overflow: hidden; }
.fillings-editor-dialog::backdrop { background: rgba(20, 18, 16, .42); }
.fillings-editor-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.fillings-editor-dialog-head h3 { margin: 0; min-width: 0; font-size: 17px; line-height: 1.4; }
.fillings-editor-workspace .fillings-editor-close { min-width: 36px; flex: 0 0 auto; padding: 4px; font-size: 24px; line-height: 1; }
.fillings-editor-dialog-body { padding: 14px 16px; }
.fillings-editor-context { margin: 0 0 12px; overflow-wrap: anywhere; }
.fillings-editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin-bottom: 12px; }
.fillings-editor-dialog-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.fillings-editor-dialog-body [role="status"]:not(:empty), .fillings-editor-dialog-body [role="alert"] { margin-top: 10px; }
.fillings-editor-extra { margin: 0 0 12px; }
.fillings-editor-extra summary { cursor: pointer; font-size: 13px; padding: 4px 0; }
.fillings-editor-extra .fillings-editor-fields { margin-top: 8px; margin-bottom: 0; }
.fillings-editor-workspace textarea.f-input { resize: vertical; min-height: 60px; }
.fillings-editor-review h4 { margin: 0 0 8px; font-size: 15px; }
.fillings-editor-review p { margin: 0 0 12px; }
.fillings-editor-diff { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.fillings-editor-diff th, .fillings-editor-diff td { padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; vertical-align: top; }
.fillings-editor-diff th { font-weight: 600; }
.fillings-editor-reason { margin-top: 10px; overflow-wrap: anywhere; white-space: pre-wrap; }
.fillings-editor-history-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.fillings-editor-history-item:first-child { padding-top: 0; }
.fillings-editor-history-item:last-child { border-bottom: 0; }
.fillings-editor-history-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.fillings-editor-history-reason { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fillings-editor-history-item summary { cursor: pointer; font-size: 12px; }
@media (max-width: 1000px) {
  .fillings-editor-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .fillings-editor-manager { padding: 10px; }
  .fillings-editor-filters, .fillings-editor-fields { grid-template-columns: minmax(0, 1fr); }
  .fillings-editor-workspace .btn { min-height: 44px; }
  .fillings-editor-workspace .f-input,
  .fillings-editor-workspace input.f-input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]) { min-height: 44px; font-size: 16px; }
  .fillings-editor-dialog { max-height: calc(100dvh - 20px); }
  .fillings-editor-dialog-head, .fillings-editor-dialog-body { padding: 12px; }
  .fillings-editor-dialog-actions { align-items: stretch; }
  .fillings-editor-dialog-actions .btn { flex: 1 1 auto; }
}
.controller-read-job-progress { height: 7px; }
.controller-read-job-progress .bar {
  transition: width 180ms cubic-bezier(.23, 1, .32, 1);
}
.controller-read-job-table { margin-top: 2px; max-height: 390px; overflow: auto; }
.controller-read-job-table table { min-width: 900px; }
.controller-read-job-table th:nth-child(1) { width: 170px; }
.controller-read-job-table th:nth-child(2) { width: 165px; }
.controller-read-job-table th:nth-child(3),
.controller-read-job-table th:nth-child(4),
.controller-read-job-table th:nth-child(5),
.controller-read-job-table th:nth-child(6) { width: 90px; }
.controller-read-job-reason { min-width: 180px; white-space: normal; }
/* Floating whole-object read queue: stays at the right edge across sections and objects. */
.read-dock {
  position: fixed; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 95;
  width: min(460px, calc(100vw - 24px)); max-height: min(78vh, 720px);
  margin: 0; padding: 12px 14px; gap: 8px; overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
}
.read-dock[hidden] { display: none; }
.read-dock-head { align-items: center; gap: 8px; }
.read-dock-heading { display: grid; min-width: 0; flex: 1 1 auto; }
.read-dock-heading .controller-read-job-title { margin: 0; font-size: 14px; }
.read-dock-object { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.read-dock .controller-read-job-count { font-size: 14px; }
.read-dock-icon { width: 30px; height: 30px; }
.read-dock-icon[hidden] { display: none; }
.read-dock-body { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: hidden; }
.read-dock.is-collapsed .read-dock-body { display: none; }
.read-dock-current:empty { display: none; }
.read-dock-current { white-space: pre-line; }
/* The whole queue is one scrolling list; the summary above and the buttons below stay in place. */
.read-dock-list {
  list-style: none; margin: 0; padding: 0 2px 0 0; display: grid; gap: 4px; align-content: start;
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
}
.read-dock-item {
  padding: 5px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev);
}
.read-dock-item.is-reading { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.read-dock-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.read-dock-item-name { font-size: 13px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.read-dock-item-head .badge { flex: 0 0 auto; }
.read-dock-item-detail { margin-top: 1px; white-space: pre-line; overflow-wrap: anywhere; }
.read-dock-empty { padding: 6px 0; }
.read-dock-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.read-dock-actions .btn[hidden] { display: none; }
.badge.accent {
  background: var(--accent-weak); color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.controller-config-local-sync { margin: 10px 0 14px; }
.controller-config-sync-plan { display: grid; gap: 10px; }
.controller-config-sync-actions { display: grid; gap: 7px; }
.controller-config-sync-action { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.controller-config-sync-action input { margin-top: 3px; }

.row-flex { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row-flex.tight { gap: 8px; }

/* ===================================================================
   KPI cards
   =================================================================== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px; }
.kpi {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 17px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.kpi::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--border-strong); opacity: .8;
}
.kpi.accent::before { background: var(--accent); }
.kpi.v1::before { background: var(--v1); }
.kpi.v2::before { background: var(--v2); }
.kpi .k-label { font-size: 13px; color: var(--text-mut); text-transform: none; letter-spacing: 0; font-weight: 600; line-height: 1.5; }
.kpi .k-value { font-size: 28px; font-weight: 600; margin-top: 8px; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.kpi .k-unit { font-size: 13px; color: var(--text-dim); font-weight: 500; margin-left: 3px; }
.kpi.accent .k-value { color: var(--accent-ink); }
.kpi.v1 .k-value { color: var(--v1); }
.kpi.v2 .k-value { color: var(--v2); }

.kpi-grid.compact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px; }
.kpi-grid.compact .kpi { padding: 16px 18px; }
.kpi-grid.compact .k-value { font-size: 21px; margin-top: 3px; }

/* ===================================================================
   Dashboard reservoirs
   =================================================================== */
.dashboard-statistics-request {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 72px;
}
.dashboard-statistics-error { justify-content: space-between; }
.dashboard-statistic-kpi .k-value { min-block-size: 2.4em; }
.dashboard-fuel-period-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
  margin-block-start: 16px; align-items: stretch; min-width: 0;
}
.dashboard-fuel-metric-card { padding: 16px 18px; min-width: 0; }
.dashboard-fuel-metric-head { min-block-size: 66px; }
.dashboard-fuel-metric-title {
  margin: 0; font-size: 14px; font-weight: 650; line-height: 1.4;
  text-wrap: balance; overflow-wrap: anywhere;
}
.dashboard-fuel-metric-period { margin: 6px 0 14px; color: var(--text-mut); font-size: 12px; }
.dashboard-fuel-metric-list { margin: 0; display: grid; }
.dashboard-fuel-metric-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, max-content);
  align-items: baseline; column-gap: 12px; padding-block: 9px;
  border-block-start: 1px solid var(--border);
}
.dashboard-fuel-metric-name {
  display: flex; align-items: baseline; gap: 7px; min-width: 0;
  font-size: 13px; color: var(--text-dim); overflow-wrap: anywhere;
}
.dashboard-fuel-metric-name .fuel-dot { flex: 0 0 auto; align-self: center; }
.dashboard-fuel-metric-value {
  margin: 0; min-width: 0; text-align: end; font-size: 18px;
  font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.dashboard-fuel-metric-message {
  min-block-size: 88px; padding-block-start: 12px; border-block-start: 1px solid var(--border);
  color: var(--text-mut); font-size: 13px;
}
.dashboard-fuel-metric-message.is-error { color: var(--warn); }
@media (max-width: 1199px) {
  .dashboard-fuel-period-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .dashboard-fuel-period-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-fuel-metric-head { min-block-size: 0; }
}
.dashboard-reservoir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 14px;
  align-items: stretch;
}
.dashboard-reservoir-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  container: reservoir-card / inline-size;
}
.dashboard-reservoir-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 14px 16px; border-bottom: 1px solid var(--border); background: var(--bg-elev);
}
.dashboard-reservoir-title-wrap { flex: 1 1 auto; min-width: 0; }
.dashboard-reservoir-title {
  margin: 0; font-size: 15px; line-height: 1.3; font-weight: 750;
  overflow-wrap: anywhere;
}
.dashboard-reservoir-trk-note {
  margin-top: 6px; max-width: 410px; color: var(--text-mut); font-size: 12px; line-height: 1.4;
}
.badge.dashboard-reservoir-trk { flex: 0 0 auto; margin-top: 1px; font-size: 12px; }
.dashboard-reservoir-installation {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 14px 16px 4px;
}
.dashboard-controller-rack {
  position: relative;
  min-width: 0;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--border-strong) 86%, transparent);
  border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-elev) 88%, transparent), transparent 72%),
    var(--bg-sunken);
}
.dashboard-controller-rack::after {
  content: "";
  position: absolute;
  z-index: 0;
  right: 50%;
  bottom: -19px;
  width: 0;
  height: 18px;
  border-right: 2px solid color-mix(in srgb, var(--text-mut) 64%, var(--border-strong));
}
.dashboard-controller-rack.is-empty::after { border-right-style: dashed; opacity: .7; }
.dashboard-controller-rack-title {
  margin: 0 3px 7px;
  color: var(--text-mut);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .7px;
  line-height: 1.2;
  text-transform: uppercase;
}
.dashboard-controller-unit-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 7px;
  min-width: 0;
}
.dashboard-controller-unit {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 220px;
  min-width: 0;
  padding: 9px 9px 8px;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--text-dim) 62%, var(--border-strong));
  border-radius: 7px;
  background:
    radial-gradient(circle at 6px 6px, var(--text-mut) 0 1.5px, transparent 1.7px),
    radial-gradient(circle at calc(100% - 6px) 6px, var(--text-mut) 0 1.5px, transparent 1.7px),
    linear-gradient(145deg, color-mix(in srgb, var(--bg-elev) 93%, var(--card)), var(--card));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 72%, transparent);
  animation: none !important;
  transition: none !important;
}
.dashboard-controller-unit-head {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}
.dashboard-controller-unit-symbol {
  display: grid;
  grid-template-columns: 18px 5px;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  width: 30px;
  height: 21px;
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--text-dim) 64%, var(--border-strong));
  border-radius: 3px;
  background: var(--bg-sunken);
}
.dashboard-controller-unit-screen {
  width: 18px;
  height: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--border-strong));
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 16%, var(--bg));
}
.dashboard-controller-unit-key {
  width: 5px;
  height: 5px;
  border: 1px solid var(--text-mut);
  border-radius: 50%;
}
.dashboard-controller-unit-name {
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.dashboard-controller-unit-values {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .8fr);
  gap: 5px;
  margin-top: 8px;
}
.dashboard-controller-unit-value {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 4px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: color-mix(in srgb, var(--bg-sunken) 78%, transparent);
  color: var(--text-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.dashboard-controller-unit-value strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 12px;
}
.dashboard-controller-unit-label {
  color: var(--text-mut);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .45px;
  text-transform: uppercase;
}
.dashboard-controller-terminal-strip {
  display: block;
  height: 7px;
  margin: 8px 1px -1px;
  border: 1px solid color-mix(in srgb, var(--text-mut) 72%, var(--border-strong));
  border-radius: 2px;
  background: repeating-linear-gradient(
    90deg,
    color-mix(in srgb, var(--border-strong) 88%, var(--bg-elev)) 0 8px,
    var(--text-mut) 8px 9px
  );
  opacity: .78;
}
.dashboard-controller-rack-empty {
  padding: 15px 7px;
  border: 1px dashed var(--border-strong);
  border-radius: 7px;
  color: var(--text-mut);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
}
.dashboard-reservoir-diagram {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 10px 12px 4px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-elev) 82%, transparent), transparent 78%),
    var(--bg-sunken);
}
.dashboard-reservoir-installation.has-controllers .dashboard-reservoir-diagram::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -1px;
  left: calc(50% - 4px);
  width: 7px;
  height: 7px;
  border: 2px solid color-mix(in srgb, var(--text-mut) 72%, var(--border-strong));
  border-radius: 2px;
  background: var(--bg-sunken);
}
.dashboard-tank-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 190px;
  overflow: visible;
  shape-rendering: geometricPrecision;
}
.dashboard-tank-shadow {
  fill: rgba(0, 0, 0, .3);
  opacity: .7;
}
.dashboard-tank-shell {
  fill: color-mix(in srgb, var(--bg-elev) 72%, var(--card));
  stroke: color-mix(in srgb, var(--text-dim) 68%, var(--border-strong));
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}
.dashboard-tank-fill {
  opacity: .82;
  transition: none !important;
  animation: none !important;
}
.dashboard-tank-unavailable {
  opacity: .9;
}
.dashboard-tank-hatch-line {
  stroke: color-mix(in srgb, var(--text-mut) 62%, var(--border-strong));
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.dashboard-tank-liquid-line {
  stroke: color-mix(in srgb, var(--text) 72%, transparent);
  stroke-width: 1.25;
  opacity: .75;
  vector-effect: non-scaling-stroke;
}
.dashboard-tank-partition {
  fill: none;
  stroke: color-mix(in srgb, var(--text-dim) 54%, var(--border-strong));
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}
.dashboard-tank-detail {
  fill: none;
  stroke: color-mix(in srgb, var(--text-dim) 70%, var(--border-strong));
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.dashboard-tank-leg {
  fill: color-mix(in srgb, var(--border-strong) 82%, var(--bg-elev));
  stroke: color-mix(in srgb, var(--text-dim) 54%, var(--border-strong));
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.dashboard-tank-pipe {
  fill: none;
  stroke: color-mix(in srgb, var(--text-dim) 72%, var(--border-strong));
  stroke-linecap: square;
  stroke-linejoin: round;
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}
.dashboard-tank-label {
  fill: var(--text);
  paint-order: stroke;
  stroke: color-mix(in srgb, var(--bg-sunken) 84%, transparent);
  stroke-width: 3px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 800;
  text-anchor: middle;
  vector-effect: non-scaling-stroke;
}
.dashboard-tank-no-dut-label {
  fill: var(--text-dim);
  paint-order: stroke;
  stroke: color-mix(in srgb, var(--bg-sunken) 94%, transparent);
  stroke-width: 4px;
  stroke-linejoin: round;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .1px;
  text-anchor: middle;
  vector-effect: non-scaling-stroke;
}
.dashboard-tank-no-dut-label.is-compact {
  font-size: 10.5px;
  line-height: 1.2;
}
.dashboard-tank-ground {
  stroke: color-mix(in srgb, var(--text-mut) 50%, var(--border));
  stroke-linecap: round;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.dashboard-reservoir-sections {
  display: grid;
  min-width: 0;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  gap: 1px;
  background: var(--border);
}
.dashboard-reservoir-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 13px 16px 14px;
  border: 0;
  background: var(--card);
}
.dashboard-reservoir-section.is-not-connected { padding-block: 11px; }
.dashboard-reservoir-reading { min-width: 0; }
.dashboard-reservoir-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0;
}
.dashboard-reservoir-section-label {
  color: var(--text-mut); font-size: 13px; font-weight: 600; letter-spacing: 0;
  text-transform: none; line-height: 1.5; white-space: nowrap;
}
.dashboard-reservoir-section-head .fuel-chip {
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.dashboard-reservoir-values {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-top: 9px;
}
.dashboard-reservoir-litres {
  min-width: 0; color: var(--text); font-size: 22px; line-height: 1.15;
  font-weight: 600; letter-spacing: -.035em; font-variant-numeric: tabular-nums;
}
.dashboard-reservoir-percent {
  flex: 0 0 auto;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dashboard-reservoir-status {
  margin-top: 6px; color: var(--text-mut); font-size: 12px; font-weight: 600; overflow-wrap: anywhere;
}
.dashboard-reservoir-status.ok { color: var(--ok); }
.dashboard-reservoir-status.warn { color: var(--warn); }
.dashboard-reservoir-time { margin-top: 3px; color: var(--text-mut); font-size: 12px; line-height: 1.35; }
.dashboard-reservoir-total {
  margin-top: auto;
  padding: 10px 16px; border-top: 1px solid var(--border); background: var(--bg-elev);
  color: var(--text-dim); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.dashboard-reservoir-empty { padding: 22px 16px; color: var(--text-mut); font-size: 12px; }

@container reservoir-card (min-width: 430px) {
  .dashboard-reservoir-card.has-multiple-sections .dashboard-reservoir-sections,
  .dashboard-reservoir-card.has-many-sections .dashboard-reservoir-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-reservoir-card.has-many-sections .dashboard-reservoir-section:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .dashboard-reservoir-head { flex-direction: column; gap: 10px; padding: 12px 13px; }
  .dashboard-reservoir-trk { margin-top: 0; }
  .dashboard-reservoir-installation {
    padding: 12px 10px 2px;
  }
  .dashboard-reservoir-diagram { padding: 8px 6px 2px; }
  .dashboard-reservoir-section { padding: 13px; }
  .dashboard-reservoir-section-head { align-items: flex-start; flex-direction: column; gap: 4px; }
  .dashboard-reservoir-litres { font-size: 19px; }
  .dashboard-reservoir-percent { font-size: 15px; }
}

/* ===================================================================
   Cards
   =================================================================== */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card-pad { padding: 20px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

/* ===================================================================
   Tables (data-dense)
   =================================================================== */
.table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
table { border-collapse: collapse; width: 100%; font-size: 13px; }
/* NB: no position:sticky here. .table-wrap is a scroll container (overflow-x:auto) but never scrolls
   vertically, so a sticky header buys nothing — and combined with the blurred sticky topbar it left
   stale composited tiles (grey ghost rectangles) over the rows in Chrome. */
thead th {
  background: var(--bg-elev);
  color: var(--text-dim);
  text-align: left; font-weight: 600; font-size: 13px; font-family: var(--font-sans); line-height: 1.5;
  text-transform: none; letter-spacing: 0;
  padding: 13px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:nth-child(even) { background: var(--zebra); }
tbody tr:hover { background: var(--hover); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Monospace is reserved for literal technical codes, never dates or UI labels. */
td.mono, .mono { font-family: var(--mono); letter-spacing: 0; }
td.mono { font-size: 12px; color: var(--text-dim); }
/* Date/number alignment without switching away from the common UI typeface. */
.tabular { font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
td.tabular { font-size: 13px; color: var(--text-dim); }
td.nowrap, .nowrap { white-space: nowrap; }
.t-empty td { text-align: center; color: var(--text-mut); padding: 28px; }

/* ===================================================================
   Badges & chips
   =================================================================== */
.badge {
  display: inline-flex; align-items: center; flex: 0 0 auto; width: max-content;
  max-width: none; overflow-wrap: normal; word-break: normal;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 1.6; white-space: nowrap;
  border: 1px solid transparent;
}
.badge.v1 { background: var(--v1-weak); color: var(--v1); border-color: color-mix(in srgb, var(--v1) 30%, transparent); }
.badge.v2 { background: var(--v2-weak); color: var(--v2); border-color: color-mix(in srgb, var(--v2) 30%, transparent); }
.badge.ok { background: var(--ok-weak); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.badge.warn { background: var(--warn-weak); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.badge.danger { background: var(--danger-weak); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.badge.mut { background: var(--bg-elev); color: var(--text-mut); border-color: var(--border); }
.badge.small { font-size: 10px; padding: 1px 7px; }

.fuel-chip { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.fuel-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.litre { font-weight: 600; font-variant-numeric: tabular-nums; }
.litre.hi { color: var(--ok); }

/* ===================================================================
   Controllers rich table
   =================================================================== */
.controller-table-wrap { scrollbar-gutter: auto; }
.controller-workspace { display: grid; gap: 18px; min-width: 0; }
.controller-workspace .page-head { margin-bottom: 0; }
.controller-workspace-tabs { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.controller-workspace-tab {
  border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent;
  color: var(--text-dim); font: inherit; font-weight: 600; min-height: 42px; padding: 9px 16px; cursor: pointer;
}
.controller-workspace-tab.active { background: var(--card); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.controller-workspace-tab:hover { background: var(--hover); }
.controller-workspace-panel { min-width: 0; display: grid; gap: 16px; }
.controller-workspace-panel[hidden] { display: none; }
.controller-list-tools { display: grid; gap: 12px; }
.controller-list-filters { display: grid; grid-template-columns: minmax(200px, 2fr) minmax(140px, 1fr) minmax(170px, 1.4fr) auto; gap: 12px; align-items: end; }
.controller-list-filters .f-field { min-width: 0; }
.controller-list-filters select { width: 100%; max-width: none; }
.controller-list-legend { border-top: 1px solid var(--border); padding-top: 10px; }
.controller-result-count { padding: 0 4px; font-variant-numeric: tabular-nums; }
.controller-workspace .ctl-table td { padding-top: 16px; padding-bottom: 16px; }
.controller-workspace .ctl-table .table-sort-button {
  white-space: normal; overflow-wrap: anywhere; line-height: 1.35; align-items: center;
}
.controller-workspace .ctl-table .table-sort-button > span:first-child { min-width: 0; }
.controller-workspace .ctl-table .table-sort-button > span:last-child { flex: 0 0 auto; }
.controller-workspace .ctl-name { overflow-wrap: anywhere; line-height: 1.4; }
.controller-org { margin-top: 6px; overflow-wrap: anywhere; }
.controller-cpuid { margin-top: 4px; overflow-wrap: anywhere; font-size: 10.5px; }
.controller-equipment-meta { margin-top: 5px; font-variant-numeric: tabular-nums; }
.controller-link-name { margin-bottom: 9px; overflow-wrap: anywhere; font-weight: 600; }
.controller-link-name.btn-link {
  display: block; max-width: 100%; min-height: 24px; padding: 0; border: 0;
  background: transparent; color: var(--text); font: inherit; font-weight: 600;
  text-align: left; cursor: pointer; line-height: 1.4; border-radius: 3px;
}
.controller-link-name.btn-link:hover { color: var(--accent-ink); text-decoration: underline; }
.controller-link-name.btn-link:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
tr[data-profile-id].selected { background: var(--accent-weak); }
.controller-workspace-settings { margin: 0; }
.controller-settings-content { display: grid; gap: 20px; min-width: 0; }
.controller-configuration-workspace { display: grid; gap: 24px; min-width: 0; }
.controller-configuration-read-settings > summary { padding: 16px 18px; cursor: pointer; min-height: 52px; font-weight: 600; }
.controller-configuration-read-settings > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.controller-configuration-read-settings > .card { border: 0; box-shadow: none; border-top: 1px solid var(--border); border-radius: 0; }
.controller-configuration-catalogue { min-width: 0; }
.controller-configuration-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 18px; }
.controller-configuration-head h3 { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 600; }
.controller-configuration-head p { margin: 6px 0 0; max-width: 60ch; }
.controller-configuration-head > .btn { flex-shrink: 0; min-height: 44px; }
.controller-configuration-filters { display: grid; grid-template-columns: minmax(150px, 2fr) minmax(100px, 1fr) minmax(140px, 1.4fr); gap: 12px; padding: 0 18px 18px; align-items: end; }
.controller-configuration-filters > .btn { justify-self: start; min-height: 44px; grid-column: 1 / -1; }
.controller-configuration-status { display: grid; gap: 10px; padding: 0 18px; }
.controller-configuration-status:empty { display: none; }
.controller-configuration-status:not(:empty) { padding-bottom: 18px; }
.controller-configuration-status > .btn { justify-self: start; min-height: 44px; }
.controller-configuration-table-wrap { min-width: 0; }
.controller-configuration-table { width: 100%; table-layout: fixed; }
.controller-configuration-table th { font-size: 13px; white-space: normal; }
.controller-configuration-table th:nth-child(1) { width: 27%; }
.controller-configuration-table th:nth-child(2) { width: 25%; }
.controller-configuration-table th:nth-child(3) { width: 33%; }
.controller-configuration-table th:nth-child(4) { width: 15%; }
.controller-configuration-table td { vertical-align: top; white-space: normal; padding: 16px 14px; overflow-wrap: anywhere; }
.controller-configuration-table .table-sort-button { min-height: 44px; white-space: normal; text-align: left; }
.controller-configuration-identity > * { display: block; line-height: 1.4; }
.controller-configuration-identity > * + * { margin-top: 6px; }
.controller-configuration-details { display: grid; gap: 8px; margin: 0; font-size: 13px; line-height: 1.4; }
.controller-configuration-details > div { display: grid; grid-template-columns: minmax(80px, .9fr) minmax(0, 1.1fr); gap: 8px; }
.controller-configuration-details dt { color: var(--text-dim); font-size: 12px; }
.controller-configuration-details dd { margin: 0; }
.controller-configuration-action .btn { width: 100%; min-height: 44px; padding-inline: 8px; white-space: normal; }
.controller-configuration-count { padding: 12px 18px; border-top: 1px solid var(--border); }
@media (max-width: 1100px) {
  .controller-configuration-table-wrap { padding: 0 14px 14px; }
  .controller-configuration-table, .controller-configuration-table tbody { display: block; width: 100%; }
  .controller-configuration-table thead { display: block; margin-bottom: 10px; }
  .controller-configuration-table thead tr { display: flex; flex-wrap: wrap; gap: 8px; }
  .controller-configuration-table thead th:nth-child(n) { display: block; width: auto; padding: 0; border: 0; background: none; }
  .controller-configuration-table thead th:last-child { display: none; }
  .controller-configuration-table .table-sort-button { padding: 8px 10px; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
  .controller-configuration-table .controller-configuration-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 12px; background: var(--card); }
  .controller-configuration-table .controller-configuration-row td { display: block; padding: 12px 0; border: 0; background: none; }
  .controller-configuration-table .controller-configuration-row td::before { content: attr(data-label); display: block; margin-bottom: 10px; font-size: 12px; color: var(--text-dim); }
  .controller-configuration-table .controller-configuration-identity { grid-column: 1 / -1; }
  .controller-configuration-table .controller-configuration-identity::before { display: none !important; }
  .controller-configuration-table .controller-configuration-action { grid-column: 1 / -1; border-top: 1px solid var(--border) !important; }
  .controller-configuration-table .controller-configuration-action::before { display: none !important; }
  .controller-configuration-action .btn { width: auto; min-width: 140px; }
}
@media (max-width: 600px) {
  .controller-configuration-head { flex-direction: column; }
  .controller-configuration-head > .btn { width: 100%; }
  .controller-configuration-filters { grid-template-columns: minmax(0, 1fr); }
  .controller-configuration-filters > .btn { width: 100%; }
  .controller-configuration-table .controller-configuration-row { grid-template-columns: minmax(0, 1fr); }
  .controller-configuration-table .controller-configuration-action .btn { width: 100%; }
}
.settings-controllers-host { min-width: 0; }
.controller-workspace-embedded .page-head { align-items: start; flex-wrap: wrap; }
.controller-workspace-embedded .page-title { font-size: 17px; }
.controller-workspace-embedded .page-actions { flex-wrap: wrap; }
.controller-workspace-embedded .controller-list-filters { grid-template-columns: minmax(160px, 2fr) minmax(110px, 1fr) minmax(140px, 1.4fr) auto; }
.controller-workspace-embedded .controller-table-wrap { max-width: 100%; }
.controller-workspace-tab:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.controller-manual-settings-host .setting-card { box-shadow: none; }
@media (min-width: 761px) {
  /* Settings has a sidebar: keep row actions reachable while its table scrolls. */
  .controller-workspace-embedded .ctl-table .controller-action,
  .controller-workspace-embedded .ctl-table th:last-child {
    position: sticky; right: 0; z-index: 2; background: var(--card);
    box-shadow: inset 1px 0 var(--border);
  }
  .controller-workspace-embedded .ctl-table th:last-child { background: var(--bg-elev); }
}
@media (max-width: 760px) {
  .controller-list-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .controller-workspace-embedded .controller-list-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .controller-list-filters .f-field:first-child { grid-column: 1 / -1; }
  .controller-list-filters > .btn { grid-column: 1 / -1; justify-self: start; }
  .controller-workspace .page-actions { width: 100%; justify-content: flex-start; }
}
@media (max-width: 420px) {
  .controller-list-filters { grid-template-columns: minmax(0, 1fr); }
  .controller-workspace-embedded .controller-list-filters { grid-template-columns: minmax(0, 1fr); }
}
.ctl-table {
  --ctl-action-width: 242px;
  table-layout: fixed;
  min-width: 1160px;
}
.ctl-table th:nth-child(1) { width: 160px; }
.ctl-table th:nth-child(2) { width: 130px; }
.ctl-table th:nth-child(3) { width: 338px; }
.ctl-table th:nth-child(4) { width: 180px; }
.ctl-table th:nth-child(5) { width: 110px; }
.ctl-table th { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
/* Fixed table layout takes its column widths from the header, not the body cells. */
.ctl-table th:nth-child(6) { width: var(--ctl-action-width); }
.ctl-table td { vertical-align: top; overflow-wrap: anywhere; }
.ctl-name { font-weight: 700; }
.controller-stored-levels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; align-items: start; }
.controller-stored-levels[data-meter-count="1"] { grid-template-columns: minmax(0, 1fr); }
.controller-stored-levels > :not(.controller-level-reading) { grid-column: 1 / -1; }
.controller-level-reading { display: grid; gap: 4px; min-width: 0; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); }
.controller-level-name { color: var(--text-dim); }
.controller-level-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.controller-level-metrics { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.controller-level-metrics > * { min-width: 0; }
.controller-level-temperature { white-space: nowrap; font-variant-numeric: tabular-nums; }
.controller-level-note { line-height: 1.4; }
.controller-level-stamp { font-size: 11px; line-height: 1.4; }
.controller-level-common-stamp, .controller-level-refresh-error { grid-column: 1 / -1; line-height: 1.4; }
.controller-last-data { font-variant-numeric: tabular-nums; line-height: 1.5; }
.controller-workspace .controller-action .row-read-strip { max-width: 100%; }
.controller-workspace .controller-action .read-prog:not(.on) { display: none; }
.controller-workspace .controller-action .read-prog.on { display: block; }
.controller-workspace .controller-action .action-btns { display: grid; grid-template-columns: 1.2fr 1fr; align-items: stretch; }
.controller-workspace .controller-action .action-btns > button { min-width: 0; max-width: 100%; white-space: normal; }
@media (min-width: 1211px) {
  .controller-workspace .ctl-table tr[data-cid] { background: var(--card); }
  .controller-workspace .ctl-table .controller-action,
  .controller-workspace .ctl-table th:last-child {
    position: sticky; right: 0; z-index: 2; background: var(--card); box-shadow: inset 1px 0 var(--border);
  }
  .controller-workspace .ctl-table th:last-child { background: var(--bg-elev); }
}
@media (max-width: 1210px) {
  /* A narrow viewport is a compact card list, not a clipped six-column desktop table. */
  .controller-workspace .controller-table-wrap { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .controller-workspace .ctl-table { display: block; min-width: 0; table-layout: auto; }
  .controller-workspace .ctl-table thead,
  .controller-workspace .ctl-table tbody { display: block; }
  .controller-workspace .ctl-table thead tr { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 8px; }
  .controller-workspace .ctl-table thead th:nth-child(n) { display: block; width: auto; padding: 0; border: 0; background: transparent; }
  .controller-workspace .ctl-table thead th:nth-child(3),
  .controller-workspace .ctl-table thead th:nth-child(6) { display: none; }
  .controller-workspace .ctl-table .table-sort-button { min-height: 44px; padding: 8px 10px; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
  .controller-workspace .ctl-table tr[data-cid] {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0;
    margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--card); box-shadow: var(--shadow-sm); overflow: visible;
  }
  .controller-workspace .ctl-table tr[data-cid] td {
    display: block; min-width: 0; width: auto; max-width: none; padding: 12px;
    border: 0; white-space: normal;
  }
  .controller-workspace .ctl-table tr[data-cid] td::before {
    content: attr(data-label); display: block; margin-bottom: 6px;
    color: var(--text-dim); font-size: 13px; font-family: var(--font-sans); font-weight: 600;
    line-height: 1.5; text-transform: none; letter-spacing: 0;
  }
  .controller-workspace .ctl-table tr[data-cid] .controller-identity,
  .controller-workspace .ctl-table tr[data-cid] .controller-reservoir,
  .controller-workspace .ctl-table tr[data-cid] .controller-levels,
  .controller-workspace .ctl-table tr[data-cid] .controller-action { grid-column: 1 / -1; }
  .controller-workspace .ctl-table tr[data-cid] .controller-identity::before { display: none; }
  .controller-workspace .ctl-table tr[data-cid] .controller-reservoir { padding-top: 0; }
  .controller-workspace .ctl-table tr[data-cid] .controller-action { border-top: 1px solid var(--border); }
  .controller-workspace .controller-action .action-cell,
  .controller-workspace .controller-action .read-prog { width: 100%; max-width: none; }
  .controller-workspace .controller-action .action-btns > button { min-height: 44px; }
  .controller-workspace .controller-reservoir-group { display: block; margin-bottom: 8px; }
  .controller-workspace .controller-reservoir-group td { display: block; padding: 10px 4px; border: 0; background: transparent; }
}

/* reservoirs — compact level-meter volume chips */
.resv-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 120px; }
.resv-chip {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: var(--bg-elev);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}
.resv-chip-btn {
  font: inherit; font-size: 11.5px; font-weight: 600;
  cursor: pointer;
}
.resv-chip-btn:hover { background: var(--hover); border-color: var(--brd-hover); color: var(--text); }
.resv-chip-btn[disabled] { opacity: .6; cursor: default; }

/* signal-strength widget */
.sig-unavailable {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; color: var(--text-dim);
  font-size: 22px; font-weight: 400; line-height: 1; vertical-align: middle;
}
.sig-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.sig-bars {
  display: inline-flex; align-items: flex-end; gap: 2px;
  height: 16px; flex: 0 0 auto;
}
.sig-bar {
  display: inline-block; width: 3px; border-radius: 1px;
  background: var(--border-strong);
}
.sig-bar.on { background: var(--accent); }
/* the empty-bar class is 'off', NOT 'empty': ".empty" is a generic placeholder utility with
   padding:44px, so ".sig-bar.empty" turned each empty bar into an 88x88 grey square. THAT was the
   "ghost square" — a class-name collision, never a GPU artifact. */
.sig-bar.off { background: var(--border); }
.sig-bar:nth-child(1) { height: 20%; }
.sig-bar:nth-child(2) { height: 40%; }
.sig-bar:nth-child(3) { height: 60%; }
.sig-bar:nth-child(4) { height: 80%; }
.sig-bar:nth-child(5) { height: 100%; }
.sig-meta { display: flex; flex-direction: column; gap: 1px; line-height: 1.2; min-width: 0; }
.sig-op { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.controller-action { width: var(--ctl-action-width); max-width: var(--ctl-action-width); white-space: normal; }
.action-cell { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; min-width: 0; max-width: 100%; }
.action-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; min-width: 0; }
.action-btns > button { flex: 0 0 auto; }
.journal-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.journal-limit { width: auto; min-width: 150px; }
.journal-table-wrap { margin-top: 10px; }
.journal-table { min-width: 720px; }
.journal-table th:nth-child(1), .journal-table th:nth-child(2) { width: 92px; }
.journal-table th:nth-child(3) { width: 170px; }
.journal-table th:nth-child(4) { width: 145px; }
.journal-detail { max-width: 420px; overflow-wrap: anywhere; }
.poll-out { color: var(--text-mut); }
.poll-out.ok { color: var(--ok); font-weight: 600; }
.poll-out.err { color: var(--danger); }
.poll-out.muted { color: var(--text-mut); }

/* ===================================================================
   Progress bar (live read)
   =================================================================== */
/* Always laid out (space reserved), only toggled via visibility -> starting a read never resizes the row.
   The label MUST keep its height while empty, otherwise the block still grows once text appears. */
.read-prog { width: 100%; max-width: 300px; min-width: 0; visibility: hidden; }
.read-prog.on { visibility: visible; }
.prog-label {
  display: block; width: 100%; max-width: 100%; min-width: 0;
  min-height: 66px; line-height: 1.5;
  overflow-wrap: anywhere; white-space: pre-line;
}
.progressbar {
  height: 8px; background: var(--bg-elev); border-radius: 5px;
  overflow: hidden; border: 1px solid var(--border);
}
.progressbar .bar {
  height: 100%; width: 0; border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 280ms var(--ease-out);
}
.progressbar .bar.done { background: var(--ok); }
.progressbar .bar.fail { background: var(--danger); }
.progressbar .bar.indeterminate {
  background: repeating-linear-gradient(110deg, var(--border) 0 8px, var(--bg-elev) 8px 16px);
  transition: none;
}
.prog-label { margin-top: 3px; }

/* Persistent latest-read outcome, temporarily replaced by actual in-flight progress. */
.row-read-strip { margin-top: 4px; max-width: 240px; min-width: 0; }
.row-read-strip[hidden] { display: none; }
.row-read-track { height: 3px; background: var(--bg-elev); border-radius: 2px; overflow: hidden; }
.row-read-fill {
  height: 100%; width: 0; border-radius: 2px; background: var(--accent);
  transition: width 280ms var(--ease-out);
}
.row-read-fill.indeterminate {
  background: repeating-linear-gradient(110deg, var(--accent) 0 6px, var(--accent-weak, var(--bg-elev)) 6px 12px);
  background-size: 24px 100%; animation: row-read-run 900ms linear infinite; transition: none;
}
@keyframes row-read-run { from { background-position: 0 0; } to { background-position: 24px 0; } }
@media (prefers-reduced-motion: reduce) { .row-read-fill.indeterminate { animation: none; } }
.row-read-strip.done .row-read-fill { background: var(--ok); }
.row-read-strip.fail .row-read-fill { background: var(--danger); }
.row-read-strip.warn .row-read-fill { background: var(--warn); }
.row-read-strip.mut .row-read-fill { background: var(--text-mut); }
.row-read-text {
  margin-top: 2px; line-height: 1.3; color: var(--text-mut);
  white-space: normal; overflow-wrap: anywhere;
}
.row-read-strip.run .row-read-text { color: var(--accent); }
.row-read-strip.done .row-read-text { color: var(--ok); }
.row-read-strip.fail .row-read-text { color: var(--danger); }
.row-read-strip.warn .row-read-text { color: var(--warn); }

/* ===================================================================
   Settings
   =================================================================== */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.settings-surface { min-width: 0; overflow: visible; }
.settings-surface-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.settings-surface-head h3 { margin: 0; font-size: 18px; line-height: 1.4; }
.settings-surface > .modal-body { max-height: none; overflow: visible; padding: 20px; }
.settings-surface-foot {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
  padding: 16px 20px; border-top: 1px solid var(--border); background: var(--card);
}
.settings-surface[hidden], .settings-category-host > [hidden] { display: none !important; }
.settings-surface .resv-tree, .settings-surface .table-wrap { min-width: 0; }
.settings-surface .modal-body .form-grid { min-width: 0; }
@media (max-width: 720px) {
  .settings-surface-head, .settings-surface > .modal-body, .settings-surface-foot { padding: 12px; }
  .settings-surface-head h3 { font-size: 16px; }
  .settings-surface .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
.settings-grid.stubs { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.setting-card { display: flex; flex-direction: column; gap: 12px; }
.settings-page { display: grid; gap: 20px; min-width: 0; }
.settings-page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.settings-page-header > .page-head { margin: 0; }
.settings-scope-tabs {
  display: flex; width: fit-content; max-width: 100%; gap: 4px; padding: 4px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elev);
}
.settings-scope-tab {
  appearance: none; min-height: 44px; padding: 10px 18px; border: 1px solid transparent;
  border-radius: var(--radius-sm); background: transparent; color: var(--text-dim);
  font: inherit; font-weight: 600; cursor: pointer;
}
.settings-scope-tab.active { border-color: var(--border); background: var(--card); color: var(--text); }
.settings-scope-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.settings-account-host, .settings-admin-host { min-width: 0; overflow-wrap: anywhere; }
.settings-account-host.card-pad, .settings-admin-host.card-pad { padding: 24px; }
.settings-account-host > .security-account-workspace,
.settings-admin-host > .security-administration-workspace {
  width: 100%; min-width: 0; max-height: none; padding: 0; margin: 0;
  border: 0; border-radius: 0; box-shadow: none; overflow: visible;
}
.settings-account-host .security-dialog-body, .settings-admin-host .security-dialog-body { padding: 0; }
.settings-account-host .security-form { max-width: 680px; margin-top: 0; }
.settings-layout {
  display: grid; grid-template-columns: minmax(0, 1fr);
  align-items: start; gap: 24px; min-width: 0;
}
.settings-category-nav {
  display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
}
.settings-category-compact { display: none; }
.settings-category-title {
  padding: 4px 9px 6px; color: var(--text-mut);
  font-size: 13px; line-height: 1.5; font-weight: 600;
  letter-spacing: 0; text-transform: none;
}
.settings-category-tab {
  appearance: none; width: auto; min-width: 0; min-height: 44px;
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--text-dim); font: inherit; text-align: left; cursor: pointer;
  transition: background-color var(--motion-fast), color var(--motion-fast);
}
.settings-category-tab.active { background: var(--accent-weak); color: var(--text); }
.settings-category-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.settings-category-tab:active { transform: scale(.99); }
.settings-category-copy { min-width: 0; }
.settings-category-label { font-size: 14px; line-height: 1.5; font-weight: 500; }
.settings-category-tab.active .settings-category-label { font-weight: 600; }
.settings-category-tab .settings-icon { width: 20px; height: 20px; background: transparent; border: 0; border-radius: 0; }
.settings-category-note {
  display: none;
}
.settings-icon {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  flex: 0 0 auto; color: var(--text-mut); background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: 9px;
}
.settings-icon svg { display: block; width: 19px; height: 19px; }
.settings-category-tab.active .settings-icon {
  color: var(--accent-ink); background: transparent;
}
.settings-content, .settings-panel, .settings-report-grid,
.settings-report-main, .settings-report-header-card { min-width: 0; }
.settings-panel[hidden] { display: none !important; }
.settings-panel-head { margin: 1px 0 14px; }
.settings-panel-head h2 {
  margin: 0; color: var(--text); font-size: 22px; line-height: 1.25;
  font-weight: 600; letter-spacing: -.025em;
}
.settings-panel-head p {
  max-width: 720px; margin: 5px 0 0; color: var(--text-dim);
  font-size: 13px; line-height: 1.45;
}
.settings-groups {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start; gap: 16px;
}
.settings-group { display: flex; min-width: 0; flex-direction: column; }
.settings-group-head {
  padding: 15px 16px 13px; background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.settings-group-head h3 { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 600; }
.settings-group-head p { margin: 4px 0 0; color: var(--text-dim); font-size: 13px; line-height: 1.4; }
.settings-link-list { display: flex; flex: 1 1 auto; flex-direction: column; }
.settings-link {
  appearance: none; width: 100%; min-width: 0; min-height: 72px;
  display: grid; grid-template-columns: 36px minmax(0, 1fr) 18px;
  align-items: center; gap: 12px; padding: 12px 15px;
  border: 0; border-top: 1px solid var(--border); border-radius: 0;
  background: transparent; color: var(--text); font: inherit; text-align: left;
  cursor: pointer; transition: background-color var(--motion-fast);
}
.settings-link:first-child { border-top: 0; }
.settings-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.settings-link:active { background: var(--accent-weak); }
.settings-link .settings-icon { width: 36px; height: 36px; }
.settings-link-copy { display: grid; min-width: 0; gap: 3px; }
.settings-link-title { font-size: 15px; line-height: 1.3; font-weight: 700; }
.settings-link-description { color: var(--text-dim); font-size: 13px; line-height: 1.4; }
.settings-link-arrow {
  color: var(--text-mut); font-size: 25px; font-weight: 300; line-height: 1;
  transition: transform var(--motion-fast), color var(--motion-fast);
}
.settings-link-create .settings-icon { color: var(--accent-ink); }
.settings-group-secondary { grid-column: 1 / -1; }
.settings-group-secondary .settings-link-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
}
.settings-group-secondary .settings-link + .settings-link { border-top: 0; border-left: 1px solid var(--border); }
.settings-report-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
  align-items: start; gap: 16px;
}
.settings-report-grid > .office-auto-reports-card { grid-column: auto; }
.settings-report-header-card { align-self: start; }
.settings-report-header-card .report-header-preview { height: 108px; }
.settings-file-input { width: 100%; min-height: 40px; padding: 5px 7px; font-size: 12px; }
.settings-file-input::file-selector-button {
  min-height: 30px; margin-right: 9px; padding: 5px 10px;
  border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--bg-elev); color: var(--text); font: inherit; cursor: pointer;
}
.settings-progressive-card > .card { min-height: 92px; display: grid; place-items: center; }
@media (hover: hover) {
  .settings-category-tab:hover { background: var(--bg-elev); color: var(--text); }
  .settings-category-tab.active:hover { background: var(--accent-weak); }
  .settings-link:hover { background: var(--bg-elev); }
  .settings-link:hover .settings-link-arrow { color: var(--accent-ink); transform: translateX(2px); }
  .settings-file-input::file-selector-button:hover { border-color: var(--accent); }
}
@media (max-width: 1320px) {
  .settings-report-grid { grid-template-columns: 1fr; }
  .settings-report-header-card { max-width: 520px; }
}
@media (max-width: 980px) {
  .settings-groups { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 760px) {
  .settings-page { gap: 16px; }
  .settings-account-host.card-pad, .settings-admin-host.card-pad { padding: 16px; }
  .settings-scope-tabs { width: 100%; }
  .settings-scope-tab { flex: 1 1 0; padding: 10px 8px; font-size: 13px; }
  .settings-layout { grid-template-columns: 1fr; gap: 18px; }
  .settings-category-nav { display: none; }
  .settings-category-compact { display: grid; gap: 6px; }
  .settings-category-compact > .f-input { min-height: 44px; font-size: 16px; }
  .settings-category-title { display: none; }
  .settings-category-tab {
    min-height: 52px; grid-template-columns: 28px minmax(0, 1fr);
    gap: 7px; padding: 7px;
  }
  .settings-category-tab .settings-icon { width: 28px; height: 28px; border-radius: 7px; }
  .settings-category-tab .settings-icon svg { width: 16px; height: 16px; }
  .settings-category-note { display: none; }
  .settings-category-label { font-size: 12px; }
  .settings-panel-head { margin-bottom: 11px; }
  .settings-panel-head h2 { font-size: 17px; }
  .settings-groups { grid-template-columns: 1fr; gap: 12px; }
  .settings-group-head { padding: 13px 14px 11px; }
  .settings-link { min-height: 68px; padding: 11px 13px; }
  .settings-group-secondary .settings-link-list { grid-template-columns: 1fr; }
  .settings-group-secondary .settings-link + .settings-link {
    border-left: 0; border-top: 1px solid var(--border);
  }
  .settings-report-header-card { max-width: none; }
  .settings-page .office-auto-report-path-field { flex-basis: auto; }
}
.report-header-preview {
  display: block; width: 100%; height: 92px; object-fit: contain;
  padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 8px;
}
.read-state-audit-card { grid-column: 1 / -1; }
.setting-head { display: flex; align-items: center; gap: 10px; }
.setting-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.setting-ico { font-size: 18px; line-height: 1; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 11px 0; border-top: 1px solid var(--border);
}
.setting-label > div:first-child { font-weight: 600; font-size: 13.5px; }
.setting-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.read-now-status { flex: 1 1 100%; }
.autopoll-results-slot:empty, .autopoll-results-empty:empty { display: none; }
.autopoll-results > summary { cursor: pointer; color: var(--text-mut); font-size: 12px; }
.autopoll-results[open] > summary { margin-bottom: 8px; }
.autopoll-results-table { max-height: 420px; overflow: auto; }
.autopoll-results-table table { min-width: 1100px; }
.autopoll-results-table th, .autopoll-results-table td { padding: 7px 9px; }
.interval-input { width: 92px; text-align: right; }
.office-auto-reports-card { grid-column: 1 / -1; }
.office-auto-report-row { align-items: flex-start; }
.office-auto-report-row .setting-label { min-width: 260px; flex: 1 1 420px; }
.office-auto-report-controls {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 12px; flex: 1 1 420px; flex-wrap: wrap;
}
.office-auto-reports-card .autopoll-results { margin-top: 2px; }
.office-auto-reports-card .autopoll-results-table table { min-width: 620px; }
.office-auto-report-toolbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev);
}
.office-auto-report-path-field { display: flex; flex: 1 1 520px; min-width: 0; flex-direction: column; gap: 5px; }
.office-auto-report-path { width: 100%; background: var(--card); color: var(--text-dim); }
.office-auto-report-type { margin-top: 2px; color: var(--text-dim); font-size: 12px; font-weight: 650; }
@media (max-width: 900px) {
  .office-auto-report-toolbar { align-items: stretch; flex-direction: column; }
  .office-auto-report-path-field { flex-basis: auto; }
}
@media (max-width: 760px) {
  .office-auto-report-row { flex-direction: column; }
  .office-auto-report-row .setting-label,
  .office-auto-report-controls { min-width: 0; width: 100%; flex-basis: auto; }
  .office-auto-report-controls { justify-content: flex-start; }
}
.controller-config-truth {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  padding: 10px 12px; border: 1px solid var(--warn); border-radius: var(--radius-sm);
  background: var(--warn-weak); color: var(--text-dim); line-height: 1.45;
}
.controller-config-truth .badge { flex: 0 0 auto; }
.controller-config-truth-text { min-width: 0; overflow-wrap: anywhere; }
.controller-config-truth-text strong { color: var(--text); }
.controller-config-truth.compact { align-items: flex-start; font-size: 12px; }
.controller-config-truth.modal-notice { position: relative; z-index: 1; box-shadow: var(--shadow-sm); }
.inline-warn {
  color: var(--warn); background: var(--warn-weak);
  border: 1px solid var(--warn);
  border-radius: var(--radius-sm); padding: 9px 11px;
}

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch-input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: relative; width: 44px; height: 24px;
  background: var(--border-strong); border-radius: 999px;
  transition: background .18s; flex: 0 0 auto;
}
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; background: #fff; border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.4); transition: transform .18s;
}
.switch-input:checked + .switch-track { background: var(--accent); }
.switch-input:checked + .switch-track::after { transform: translateX(20px); }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-state { font-size: 13px; font-weight: 600; color: var(--text-dim); min-width: 70px; }

/* License card */
.lic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lic-item {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 13px;
}
.lic-item .k-label { font-size: 13px; color: var(--text-mut); text-transform: none; letter-spacing: 0; font-weight: 600; line-height: 1.5; }
.lic-item .k-value { font-size: 22px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.lic-item.accent .k-value { color: var(--accent-ink); }
.lic-item.ok .k-value { color: var(--ok); }
.lic-item.warn .k-value { color: var(--warn); }
.lic-item.danger .k-value { color: var(--danger); }
.lic-gauge {
  height: 8px; background: var(--bg-elev); border-radius: 5px;
  overflow: hidden; border: 1px solid var(--border);
}
.lic-gauge-fill { height: 100%; border-radius: 5px; background: var(--ok); transition: width 280ms var(--ease-out); }
.lic-gauge-fill.warn { background: var(--warn); }
.lic-gauge-fill.danger { background: var(--danger); }
.lic-note { border-top: 1px solid var(--border); padding-top: 8px; }

/* Stub cards */
.setting-card.stub { opacity: .7; position: relative; }
.setting-card.stub .stub-tag { align-self: flex-start; }

.live-config-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.controller-technical-region { padding: 12px 0; border-bottom: 1px solid var(--border); }
.controller-technical-region .section-title { margin: 0 0 10px; }
.controller-technical-region > summary, .controller-critical-disclosure > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.controller-technical-region > summary::before, .controller-critical-disclosure > summary::before { content: '+'; font-size: 18px; }
.controller-technical-region[open] > summary::before, .controller-critical-disclosure[open] > summary::before { content: '−'; }
.controller-technical-region > summary:focus-visible, .controller-critical-disclosure > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.controller-technical-region[open] { padding-bottom: 16px; }
.controller-critical-disclosure { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 16px; }
.controller-technical-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; margin: 0; }
.controller-technical-summary > div { min-width: 0; }
.controller-technical-summary dt { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.controller-technical-summary dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .controller-technical-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .controller-technical-summary { grid-template-columns: minmax(0, 1fr); } }
.live-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.live-config-block {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); padding: 12px;
}
.live-config-values { display: flex; flex-direction: column; }
.live-config-row {
  display: grid; grid-template-columns: minmax(130px, 1fr) minmax(90px, auto);
  align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border);
}
.live-config-row:last-child { border-bottom: none; }
.live-config-row > :last-child { text-align: right; overflow-wrap: anywhere; }

/* Controller settings -> Modem and server. The two sources deliberately stay separate: a failed
   live read must never make the saved PostgreSQL value look like a controller response. */
.config-read-route {
  color: var(--text-dim); background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 12.5px; line-height: 1.45;
}
.config-read-route strong { color: var(--text); }
.config-read-state {
  border: 1px solid var(--border); border-left-width: 4px;
  border-radius: var(--radius-sm); padding: 10px 12px;
  color: var(--text-dim); background: var(--bg-elev);
}
.config-read-state.loading { border-left-color: var(--accent); }
.config-read-state.ok { border-left-color: var(--ok); background: var(--ok-weak); }
.config-read-state.warning { border-left-color: var(--warn); background: var(--warn-weak); }
.config-read-state.error { border-left-color: var(--danger); background: var(--danger-weak); }
.config-read-title { color: var(--text); font-weight: 700; margin-bottom: 2px; }
.controller-config-tabs {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); padding-bottom: 10px;
}
.controller-config-tab {
  appearance: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px; background: var(--card); color: var(--text-dim);
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.controller-config-tab:hover { border-color: var(--border-strong); color: var(--text); }
.controller-config-tab.active {
  border-color: var(--accent); background: var(--accent-weak); color: var(--accent-ink);
}
.controller-config-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.controller-config-panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.controller-settings-toolbar {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev);
}
.controller-settings-toolbar-copy { display: grid; gap: 3px; min-width: 0; flex: 1 1 280px; }
.controller-settings-toolbar > .row-actions { justify-content: flex-end; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.controller-settings-toolbar > .row-actions > .btn { min-width: 0; max-width: 100%; white-space: normal; }
.controller-settings-load-state {
  display: flex; align-items: baseline; gap: 8px 12px; flex-wrap: wrap;
}
.controller-settings-load-state .config-read-title { margin-bottom: 0; }
.controller-settings-workspace {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px;
  align-items: start; min-width: 0;
}
.controller-settings-workspace > .controller-config-tabs {
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: center;
  gap: 4px 8px; padding: 0 0 12px; border: 0; border-bottom: 1px solid var(--border);
}
.controller-settings-workspace > .controller-config-tabs .controller-config-tab {
  width: auto; min-height: 44px; border-color: transparent; text-align: left;
  font-size: 14px; font-weight: 500; padding: 10px 14px;
}
.controller-settings-workspace > .controller-config-tabs .controller-config-tab.active {
  border-color: transparent; background: var(--accent-weak); font-weight: 600;
}
.controller-settings-group-select { display: none; }
.controller-settings-state-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; }
.controller-settings-state-row > .controller-technical-region { order: 3; flex: 1 1 100%; border: 0; padding: 0; }
.controller-settings-state-row > .controller-technical-region > summary { min-height: 36px; font-size: 13px; padding-block: 8px; }
.controller-settings-state-row > .config-read-state.ok { border: 0; background: transparent; padding: 0; font-size: 13px; }
.controller-settings-state-row > .config-read-state.ok .config-read-title { color: var(--text-dim); font-weight: 400; }
.controller-settings-state-row > .live-config-meta { margin: 0; padding: 0; }
.controller-settings-panels, .controller-settings-section { min-width: 0; }
.controller-settings-section { display: grid; gap: 18px; }
.controller-settings-subsection {
  min-width: 0; padding-bottom: 18px; border-bottom: 1px solid var(--border);
}
.controller-settings-subsection:last-child { padding-bottom: 0; border-bottom: 0; }
.controller-setting-fieldset {
  display: grid; gap: 12px; min-width: 0;
  padding: 14px 0; border-bottom: 1px solid var(--border);
  scroll-margin-top: 12px;
}
.controller-setting-fieldset:last-of-type { border-bottom: 0; }
.controller-setting-fieldset > h4 { margin: 0; font-size: 13px; }
.controller-directory-settings { display: grid; gap: 14px; min-width: 0; }
.controller-directory-settings-list {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.controller-directory-settings-list .settings-link {
  min-height: 76px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  scroll-margin-top: 12px;
}
.controller-write-dialog { gap: 14px; min-width: min(620px, 78vw); }
.controller-write-choice-list {
  display: grid; gap: 8px; padding: 4px;
}
.controller-write-choice {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px;
  align-items: start; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); cursor: pointer;
}
.controller-write-choice:hover { border-color: var(--border-strong); }
.controller-write-choice:has(input:disabled) { opacity: .62; cursor: not-allowed; }
.controller-write-choice input { margin: 2px 0 0; }
.controller-write-choice > span { display: grid; gap: 3px; }
.controller-write-choice-title { color: var(--text); font-weight: 650; line-height: 1.35; }
.level-config-awaiting {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 18px; background: var(--bg-elev);
}
.level-config-awaiting.unavailable { border-style: solid; border-left: 4px solid var(--warn); }
.grad-tables-result { display: flex; flex-direction: column; gap: 10px; }
.grad-table-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); overflow: hidden;
}
.grad-table-card > summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 13px; cursor: pointer; background: var(--bg-elev);
}
.grad-table-title { font-weight: 700; margin-right: auto; }
.grad-table-meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px;
  padding: 11px 13px; border-top: 1px solid var(--border);
}
.grad-table-scroll { max-height: 360px; overflow: auto; margin: 0 13px 13px; }
.grad-points-table { min-width: 340px; }
.grad-points-table th, .grad-points-table td { padding-top: 6px; padding-bottom: 6px; }
.grad-table-empty { padding: 4px 13px 13px; }
.grad-table-edit-button { align-self: flex-start; margin: 0 13px 11px; }
.grad-table-editor {
  display: flex; flex-direction: column; gap: 9px; margin: 0 13px 13px;
  padding: 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev);
}
.grad-table-editor.hidden { display: none; }
.grad-table-editor-input {
  width: 100%; min-height: 220px; resize: vertical; box-sizing: border-box;
  padding: 9px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text); line-height: 1.45;
}
.grad-table-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.grad-table-editor-status { min-height: 18px; }
.level-config-result, .level-config-content { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.level-config-note {
  padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev);
}
.level-config-conflicts {
  padding: 11px 13px; border: 1px solid var(--danger); border-left-width: 4px;
  border-radius: var(--radius-sm); background: var(--danger-weak); color: var(--text-dim);
}
.level-config-conflicts ul { margin: 8px 0 0; padding-left: 20px; }
.level-config-conflicts li + li { margin-top: 4px; }
.level-config-section { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.level-config-section h4 { margin: 0; font-size: 13px; color: var(--text); }
.level-config-section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.level-slot-list { display: flex; flex-direction: column; gap: 7px; }
.level-slot-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); overflow: hidden;
}
.level-slot-card > summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px 10px; min-height: 44px;
  padding: 9px 11px; cursor: pointer; user-select: none;
}
.level-slot-card > summary:hover { background: var(--hover); }
.level-slot-card[open] > summary { border-bottom: 1px solid var(--border); }
.level-slot-title { flex: 0 0 160px; font-weight: 700; color: var(--text); }
.level-slot-binding { flex: 1 1 180px; min-width: 0; color: var(--text-mut); }
.level-slot-binding.is-bound { color: var(--ok); }
.level-slot-binding.is-ambiguous { color: var(--warn); font-weight: 650; }
.level-slot-summary { flex: 1 1 auto; min-width: 0; }
.level-slot-type { padding: 9px 11px 0; }
.level-slot-fields, .level-omnicomm-fields { border: none; border-radius: 0; box-shadow: none; }
.level-slot-omnicomm-fields {
  border-top: 1px solid var(--border);
  background: var(--card);
}
.level-slot-omnicomm-fields > .config-read-title { padding: 10px 11px 3px; }
.level-slot-protocol-note { padding: 2px 11px 9px; }
.level-config-empty {
  padding: 11px 12px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg-elev);
}
.level-unbound-channel-section {
  margin-top: 4px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg-sunken); overflow: hidden;
}
.level-unbound-channel-section > summary {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
  gap: 6px 12px; min-height: 44px; padding: 10px 12px; cursor: pointer;
}
.level-unbound-channel-section[open] > summary { border-bottom: 1px solid var(--border); }
.level-unbound-channel-note { padding: 10px 12px 0; }
.level-unbound-channel-section > .level-slot-list { padding: 10px 12px 12px; }
.level-slot-card-ambiguous { border-color: color-mix(in srgb, var(--warn) 68%, var(--border)); }
@media (max-width: 560px) {
  .level-slot-title { flex-basis: calc(100% - 74px); }
  .level-slot-binding, .level-slot-summary { flex-basis: 100%; }
}
.critical-config-result, .critical-config-content {
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
.critical-main-section { display: flex; flex-direction: column; gap: 9px; }
.critical-main-section h4 { margin: 0; font-size: 14px; color: var(--text); }
.critical-entry-list { display: flex; flex-direction: column; gap: 9px; }
.critical-entry-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); overflow: hidden;
}
.critical-entry-card.diagnostic { background: var(--bg-elev); }
.critical-entry-head {
  display: flex; align-items: baseline; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--border); background: var(--bg-elev);
}
.critical-entry-head h5 { flex: 1 1 auto; margin: 0; font-size: 13px; color: var(--text); }
.external-io-status-result { margin-top: 14px; }
.external-io-live-result { display: flex; flex-direction: column; gap: 10px; }
.external-io-live-blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.external-io-position-list { display: grid; gap: 7px; padding: 10px 12px; }
.external-io-position {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 28px; border-bottom: 1px solid var(--border);
}
.external-io-position:last-child { border-bottom: 0; }
@media (max-width: 720px) { .external-io-live-blocks { grid-template-columns: 1fr; } }
.critical-entry-fields, .critical-mask-fields { border: none; border-radius: 0; box-shadow: none; }
.critical-diagnostics {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); overflow: hidden;
}
.critical-diagnostics > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; padding: 9px 11px; cursor: pointer; user-select: none;
}
.critical-diagnostics > summary:hover { background: var(--hover); }
.critical-diagnostics[open] > summary { border-bottom: 1px solid var(--border); }
.critical-diagnostics-note { padding: 10px 12px 0; }
.critical-diagnostics .critical-entry-list { padding: 12px; }
.critical-editor-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 10px;
}
.critical-editor-row {
  display: grid; grid-template-columns: minmax(105px, auto) minmax(150px, 1fr) minmax(110px, 160px);
  align-items: center; gap: 8px; padding: 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card);
}
.critical-editor-enabled { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.critical-editor-enabled input { vertical-align: middle; }
.critical-editor-value { min-width: 0; }
.critical-editor-row .f-error { grid-column: 1 / -1; }
.critical-editor-v1-row {
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr);
  align-items: start;
}
.critical-editor-v1-list { grid-template-columns: 1fr; }
.critical-editor-bound { display: grid; grid-template-columns: 1fr; gap: 5px; min-width: 0; }
.critical-editor-bound .f-error { grid-column: 1; }
@media (max-width: 980px) {
  .critical-editor-list { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .critical-editor-row, .critical-editor-v1-row { grid-template-columns: 1fr; }
  .critical-editor-row .f-error { grid-column: 1; }
}
.trk-config-result, .trk-config-content {
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
.trk-config-section { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.trk-config-section h4 { margin: 0; font-size: 14px; color: var(--text); }
.trk-inline-note {
  padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); overflow-wrap: anywhere;
}
.trk-dispenser-list, .trk-mechanical-list {
  display: flex; flex-direction: column; gap: 9px; min-width: 0;
}
.trk-dispenser-card, .trk-mechanical-section, .trk-mechanical-diagnostic {
  min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); overflow: hidden;
}
.trk-dispenser-card.reserve { background: var(--bg-elev); }
.trk-dispenser-card > summary, .trk-mechanical-diagnostic > summary {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 9px 11px; cursor: pointer; user-select: none; min-width: 0;
}
.trk-dispenser-card > summary:hover, .trk-mechanical-diagnostic > summary:hover { background: var(--hover); }
.trk-dispenser-card[open] > summary, .trk-mechanical-diagnostic[open] > summary { border-bottom: 1px solid var(--border); }
.trk-dispenser-title { flex: 0 0 100px; font-weight: 700; color: var(--text); }
.trk-dispenser-state { flex: 1 1 190px; min-width: 0; overflow-wrap: anywhere; }
.trk-reserve-badge { max-width: 260px; white-space: normal; line-height: 1.25; }
.trk-dispenser-note, .trk-mechanical-note { padding: 10px 12px 0; overflow-wrap: anywhere; }
.trk-dispenser-fields, .trk-mechanical-fields,
.trk-smart-general-fields, .trk-smart-behaviour-fields {
  border: none; border-radius: 0; box-shadow: none;
}
.trk-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px; border-bottom: 1px solid var(--border); background: var(--bg-elev);
}
.trk-section-head h5 { margin: 0; font-size: 13px; color: var(--text); }
.trk-mechanical-diagnostic { background: var(--bg-elev); }
.trk-mechanical-diagnostic > summary { justify-content: space-between; }
.trk-editor-form { gap: 16px; }
.trk-editor-smart-grid,
.trk-editor-mechanical-grid,
.trk-editor-address-grid {
  display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px 12px; min-width: 0;
}
.trk-editor-dispenser > .trk-editor-address-grid,
.trk-mechanical-diagnostic > .trk-editor-mechanical-grid {
  padding: 12px;
}
.trk-mechanical-diagnostic > .modem-editor-check {
  margin: 0 12px 10px;
}
.trk-editor-errors {
  padding: 10px 12px; border: 1px solid var(--danger);
  border-radius: var(--radius-sm); background: var(--danger-weak);
}
@media (max-width: 900px) {
  .trk-editor-smart-grid,
  .trk-editor-mechanical-grid,
  .trk-editor-address-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}
@media (max-width: 600px) {
  .trk-editor-smart-grid,
  .trk-editor-mechanical-grid,
  .trk-editor-address-grid { grid-template-columns: 1fr; }
}
.printer-config-result, .printer-config-content {
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
.printer-config-note {
  padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); overflow-wrap: anywhere;
}
.printer-config-warnings, .printer-wire-differences {
  padding: 11px 13px; border: 1px solid var(--warn); border-left-width: 4px;
  border-radius: var(--radius-sm); background: var(--warn-weak); color: var(--text-dim);
}
.printer-wire-differences { border-color: var(--danger); background: var(--danger-weak); }
.printer-config-warnings ul, .printer-wire-differences ul {
  margin: 8px 0 0; padding-left: 20px;
}
.printer-config-warnings li + li, .printer-wire-differences li + li { margin-top: 4px; }
.printer-config-fields .modem-config-value {
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.printer-editor-form {
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
  padding: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg-elev);
}
.general-editor-form .printer-editor-grid {
  display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 12px;
}
.general-editor-flags {
  display: grid; grid-template-columns: minmax(220px, max-content) minmax(260px, 1fr);
  align-items: center; gap: 7px 16px; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card);
}
.general-editor-flags .check-row {
  display: flex; align-items: center; gap: 9px; font-weight: 650; cursor: pointer;
}
.general-editor-flags input[type="checkbox"] {
  width: 17px; height: 17px; accent-color: var(--accent); flex: 0 0 auto;
}
@media (max-width: 720px) {
  .general-editor-form .printer-editor-grid, .general-editor-flags { grid-template-columns: 1fr; }
}
.printer-editor-heading { display: flex; flex-direction: column; gap: 2px; }
.printer-editor-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.printer-editor-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  color: var(--text-dim); font-size: 12px; font-weight: 650;
}
.printer-editor-type { max-width: 260px; }
.printer-type-input { max-width: 160px; }
.printer-text-input {
  min-height: 58px; resize: vertical; white-space: pre-wrap; font-family: var(--font-sans);
}
.printer-char-count { flex: 0 0 auto; font-weight: 500; }
.printer-editor-status {
  padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); line-height: 1.4;
}
.printer-editor-status.warn { color: var(--danger); border-color: var(--danger); background: var(--danger-weak); }
.printer-editor-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.controller-printer-push .level-config-note.success {
  border-left: 4px solid var(--ok); background: var(--ok-weak);
}
.printer-editor-unavailable { margin-top: 2px; }
.modem-editor-host { margin-top: 12px; }
.modem-editor-form { grid-template-columns: minmax(220px, 1fr) minmax(160px, 260px); }
.modem-editor-form .printer-editor-heading,
.modem-editor-form .printer-editor-status,
.modem-editor-form .printer-editor-actions { grid-column: 1 / -1; }
.modem-editor-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.controller-test-tool { border-left: 4px solid var(--warn); }
.controller-test-tool.success { border-left-color: var(--ok); }
.controller-test-output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.controller-test-output {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
}
.controller-test-output input { accent-color: var(--danger); }
.controller-test-status { margin: 8px 0; }
.level-meter-editor-form {
  margin-top: 14px; padding: 0; border: 0; background: transparent;
  container-type: inline-size; container-name: level-meter-editor;
}
.level-meter-editor-heading { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
.level-meter-editor-heading > div { min-width: 0; }
.level-meter-editor-heading > .btn { flex: 0 0 auto; }
.level-meter-editor-form .modem-editor-check { min-height: 44px; }
.level-meter-common-protocol {
  display: grid; grid-template-columns: minmax(200px, 360px) minmax(0, 1fr); align-items: end; gap: 12px 24px;
}
.level-meter-protocol-help { min-width: 0; color: var(--text-mut); }
.level-meter-protocol-help > summary { min-height: 44px; padding: 10px 0; cursor: pointer; }
.level-meter-protocol-help > .small { margin-bottom: 8px; }
.level-meter-editor-general {
  display: grid; grid-template-columns: minmax(190px, 1fr) minmax(220px, 1fr);
  align-items: end; gap: 10px 16px;
}
.level-meter-auto-write {
  display: grid; grid-column: 1 / -1;
  grid-template-columns: minmax(210px, 1fr) minmax(120px, 180px);
  align-items: end; gap: 8px 12px;
}
.level-meter-auto-write .f-error { grid-column: 1 / -1; }
.level-meter-editor-type { width: 100%; max-width: 360px; }
.level-meter-editor-minutes { max-width: 180px; }
.level-meter-channel-workspace {
  display: grid; grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); align-items: start; gap: 24px; min-width: 0;
}
.level-meter-channel-navigator {
  display: grid; gap: 12px; min-width: 0;
}
.level-meter-channel-navigation-heading { display: grid; gap: 2px; }
.level-meter-channel-mobile-picker { display: none; }
.level-meter-channel-list {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0;
}
.level-meter-channel-item {
  display: grid; align-content: start; gap: 4px; min-width: 0; min-height: 76px;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text); text-align: left; cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .level-meter-channel-item:hover { border-color: var(--border-strong); background: var(--hover); }
}
.level-meter-channel-item:active { background: var(--accent-weak); }
.level-meter-channel-item.is-selected {
  border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); background: var(--accent-weak);
}
.level-meter-channel-item-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0;
}
.level-meter-channel-item-head > .level-slot-title { min-width: 0; width: auto; flex: 1 1 auto; overflow-wrap: anywhere; }
.level-meter-channel-item-head > .level-meter-channel-state { flex: 0 0 auto; }
.level-meter-channel-state { font-size: 12px; font-weight: 650; white-space: nowrap; }
.level-meter-channel-state.is-enabled { color: var(--ok); }
.level-meter-channel-state.is-disabled { color: var(--text-mut); }
.level-meter-channel-summary, .level-meter-channel-binding {
  display: block; min-width: 0; overflow-wrap: anywhere; line-height: 1.35;
}
.level-meter-channel-summary { color: var(--text-mut); }
.level-meter-channel-free {
  min-height: 44px; padding: 8px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: transparent; color: var(--text-dim); text-align: left; cursor: pointer; font: inherit;
}
.level-meter-channel-free[aria-expanded="true"] { border-style: solid; background: var(--bg-sunken); }
.level-meter-channel-binding.is-bound, .level-meter-selected-binding.is-bound { color: var(--ok); }
.level-meter-channel-binding.is-ambiguous, .level-meter-selected-binding.is-ambiguous { color: var(--danger); }
.level-meter-channel-binding.is-unbound, .level-meter-selected-binding.is-unbound,
.level-meter-selected-binding.is-unknown { color: var(--text-mut); }
.level-meter-channel-editor {
  display: grid; gap: 16px; min-width: 0; padding: 20px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card);
}
.level-meter-channel-editor-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.level-meter-channel-editor-head .config-read-title { font-size: 18px; }
.level-meter-selected-summary { margin-top: 2px; color: var(--text); }
.level-meter-selected-binding { margin-top: 2px; overflow-wrap: anywhere; }
.level-meter-binding-help { padding-top: 12px; border-top: 1px solid var(--border); }
.level-meter-channel-editor-host { min-width: 0; }
.level-meter-grad-disclosure { min-width: 0; border-top: 1px solid var(--border); }
.level-meter-grad-disclosure > summary { min-height: 44px; padding: 12px 0; cursor: pointer; font-weight: 600; }
.level-meter-grad-body { display: grid; gap: 12px; min-width: 0; padding-bottom: 4px; }
.level-meter-grad-content { display: grid; gap: 12px; min-width: 0; }
.level-meter-grad-meta { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 0; }
.level-meter-grad-meta > div { min-width: 0; }
.level-meter-grad-meta dt { font-size: 12px; color: var(--text-mut); }
.level-meter-grad-meta dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.level-meter-grad-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.level-meter-grad-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.level-meter-grad-table :is(th, td) { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.level-meter-grad-table th { position: sticky; top: 0; background: var(--bg-sunken); font-weight: 600; }
.level-meter-grad-table tr:last-child td { border-bottom: 0; }
.level-meter-grad-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.level-meter-grad-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.level-meter-grad-status:empty { display: none; }
.level-meter-slot-editor {
  display: grid; grid-template-columns: minmax(0, 1fr) 104px; align-items: end; align-content: start; gap: 6px 10px;
  min-width: 0;
}
.legacy-level-meter-editor .level-meter-slot-editor {
  grid-template-columns: minmax(0, 1fr) minmax(100px, 180px);
}
.level-slot-title { font-weight: 600; }
.level-meter-slot-check { min-width: 0; white-space: normal; }
.level-meter-slot-address { width: 100%; min-width: 0; padding-left: 7px; padding-right: 7px; }
.level-meter-slot-error { grid-column: 1 / -1; }
.omnicomm-editor-fields {
  display: grid; grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; min-width: 0;
  margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--border);
}
.omnicomm-editor-fields > .config-read-title,
.omnicomm-editor-fields > .inline-warn,
.omnicomm-editor-fields > .f-error { grid-column: 1 / -1; }
.omnicomm-editor-fields .f-input { width: 100%; }
.omnicomm-editor-fields .f-input:disabled { opacity: .78; }
.level-meter-general-disclosure { border-top: 1px solid var(--border); }
.level-meter-general-disclosure > summary { min-height: 44px; padding: 12px 0; font-weight: 600; cursor: pointer; }
.level-meter-general-disclosure > .level-meter-editor-general { padding: 4px 0 16px; }
.level-meter-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.level-meter-editor-footer > .printer-editor-status { margin: 0; min-width: 0; }
.level-meter-editor-footer > .btn { flex: 0 0 auto; }
@container level-meter-editor (max-width: 700px) {
  .level-meter-channel-workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .level-meter-channel-navigation-heading, .level-meter-channel-list, .level-meter-channel-free { display: none; }
  .level-meter-channel-mobile-picker { display: grid; gap: 6px; min-width: 0; }
  .level-meter-channel-select { width: 100%; min-width: 0; }
  .level-meter-channel-editor { padding: 16px; }
  .level-meter-editor-heading { align-items: flex-start; }
  .level-meter-editor-heading > .btn { flex: 0 1 160px; white-space: normal; }
  .level-meter-common-protocol { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .level-meter-editor-general, .level-meter-auto-write { grid-template-columns: minmax(0, 1fr); }
  .omnicomm-editor-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container level-meter-editor (max-width: 430px) {
  .level-meter-editor-heading { flex-direction: column; gap: 12px; }
  .level-meter-editor-heading > .btn { flex: 0 0 auto; }
  .level-meter-slot-editor, .legacy-level-meter-editor .level-meter-slot-editor { grid-template-columns: minmax(0, 1fr); }
  .omnicomm-editor-fields { grid-template-columns: minmax(0, 1fr); }
  .level-meter-editor-footer { align-items: stretch; flex-direction: column; gap: 12px; }
}
@media (max-width: 720px) {
  .modem-editor-form { grid-template-columns: 1fr; }
  .modem-editor-form .printer-editor-heading,
  .modem-editor-form .printer-editor-status,
  .modem-editor-form .printer-editor-actions { grid-column: 1; }
  .level-meter-editor-general, .level-meter-auto-write { grid-template-columns: 1fr; }
  .level-meter-auto-write .f-error { grid-column: 1; }
  .level-meter-channel-editor-head { gap: 10px; }
}
.ethernet-io-result, .ethernet-io-content {
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
.ethernet-io-section { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.ethernet-io-section h4 { margin: 0; font-size: 14px; color: var(--text); }
.ethernet-io-devices { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.ethernet-io-device {
  min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); overflow: hidden;
}
.ethernet-io-device.reserve { background: var(--bg-elev); }
.ethernet-io-device > summary {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 9px 11px; cursor: pointer; user-select: none; min-width: 0;
}
.ethernet-io-device > summary:hover { background: var(--hover); }
.ethernet-io-device[open] > summary { border-bottom: 1px solid var(--border); }
.ethernet-io-device-title { flex: 0 0 145px; font-weight: 700; color: var(--text); }
.ethernet-io-device-state { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.ethernet-io-note {
  padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); overflow-wrap: anywhere;
}
.ethernet-io-device .ethernet-io-note { border: none; border-radius: 0; }
.ethernet-io-editor-form { margin-top: 2px; }
.ethernet-io-editor-grid {
  display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 10px 16px;
}
.ethernet-io-editor-grid > .modem-editor-check { align-self: end; }
.ethernet-io-count { width: 180px; }
.ethernet-io-editor-device-body {
  display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 12px 16px;
  padding: 12px;
}
.ethernet-io-bit-field, .ethernet-io-fin-grid {
  min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-elev);
}
.ethernet-io-bit-field legend, .ethernet-io-fin-grid legend {
  padding: 0 5px; color: var(--text-dim); font-size: 12px; font-weight: 650;
}
.ethernet-io-bit-field {
  display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 4px 12px;
}
.ethernet-io-fin-grid {
  display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 8px 12px;
}
.ethernet-io-fin-grid legend { grid-column: 1 / -1; }
.ethernet-io-editor-device.reserve .ethernet-io-editor-device-body { opacity: .62; }
.ethernet-io-editor-error { padding: 9px 11px; }
@media (max-width: 760px) {
  .ethernet-io-editor-grid, .ethernet-io-editor-device-body { grid-template-columns: 1fr; }
  .ethernet-io-fin-grid { grid-template-columns: 1fr; }
  .ethernet-io-fin-grid legend { grid-column: 1; }
}
.hardware-config-result, .hardware-config-content {
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
.hardware-config-sources {
  display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px 16px; min-width: 0;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); overflow-wrap: anywhere;
}
.hardware-config-sources > span { flex: 1 1 220px; min-width: 0; }
.hardware-expanded-result, .hardware-expanded-content {
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.interface-quality-result, .interface-quality-content {
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.maintenance-info-result, .maintenance-info-content {
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.interface-quality-table .modem-config-head,
.interface-quality-table .modem-config-row {
  grid-template-columns: minmax(110px, .55fr) minmax(180px, 1fr) minmax(180px, 1fr);
}
.expanded-hardware-grid {
  display: grid; grid-template-columns: minmax(190px, .8fr) minmax(220px, 1.2fr);
  gap: 9px 18px; min-width: 0; padding: 13px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev);
}
.expanded-hardware-grid > * { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .expanded-hardware-grid { grid-template-columns: 1fr; gap: 3px; }
  .expanded-hardware-grid .modem-config-value { margin-bottom: 8px; }
}
.controller-clock-content, .controller-clock-result {
  display: flex; flex-direction: column; gap: 16px; min-width: 0;
}
.controller-clock-status {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; min-width: 0;
}
.controller-clock-grid {
  display: grid; grid-template-columns: minmax(170px, .7fr) minmax(220px, 1.3fr);
  gap: 10px 18px; min-width: 0; padding: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev);
}
.controller-clock-label { color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.controller-clock-grid .mono, .controller-clock-grid .tabular { min-width: 0; overflow-wrap: anywhere; }
.controller-clock-actions { display: flex; justify-content: flex-start; }
.controller-clock-sync { white-space: normal; text-align: center; }
.controller-clock-note { overflow-wrap: anywhere; }
.controller-directory-content, .controller-directory-result {
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.controller-directory-heading {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; min-width: 0;
}
.controller-directory-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 8px;
}
.controller-directory-stat {
  display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 11px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev);
}
.controller-directory-stat strong { font-size: 18px; color: var(--text); }
.controller-directory-orgs {
  padding: 10px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); line-height: 1.6; overflow-wrap: anywhere;
}
.controller-directory-blockers {
  margin: 0; padding: 10px 12px 10px 30px; color: var(--danger);
  border: 1px solid var(--danger); border-radius: var(--radius-sm); background: var(--danger-weak);
}
.controller-directory-sync {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft, #f7f8fb);
}
.controller-directory-sync > .small:first-child { font-weight: 650; }
.controller-directory-sync > .small.muted { flex: 1 1 320px; }
.controller-directory-sync.exact { display: block; }
.controller-directory-table-wrap {
  max-height: 430px; overflow: auto; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--card);
}
.controller-directory-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.controller-directory-table th, .controller-directory-table td {
  padding: 9px 11px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle;
}
.controller-directory-table th {
  position: sticky; top: 0; z-index: 1; background: var(--bg-elev);
  color: var(--text-dim); font-size: 13px; font-weight: 600; font-family: var(--font-sans);
  line-height: 1.5; text-transform: none; letter-spacing: 0;
}
.controller-directory-table tbody tr:nth-child(even) { background: var(--zebra); }
.controller-directory-table tbody tr:last-child td { border-bottom: none; }
.controller-directory-table .directory-row.changed { background: var(--danger-weak); }
.modem-config-comparison.ethernet-io-device-fields,
.modem-config-comparison.ethernet-fields,
.modem-config-comparison.ethernet-lm-fields,
.modem-config-comparison.veeder-root-fields,
.modem-config-comparison.ethernet-io-count-fields,
.modem-config-comparison.hardware-capability-fields {
  border: none; border-radius: 0; box-shadow: none;
}
.modem-config-comparison {
  flex: 0 0 auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--card);
}
.modem-config-head, .modem-config-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.05fr) minmax(160px, 1fr) minmax(160px, 1fr) minmax(105px, .55fr);
  align-items: center;
}
.modem-config-head {
  color: var(--text-dim); background: var(--bg-elev);
  font-size: 13px; font-weight: 600; font-family: var(--font-sans); line-height: 1.5;
  text-transform: none; letter-spacing: 0;
  border-bottom: 1px solid var(--border);
}
.modem-config-head > div, .modem-config-row > div { min-width: 0; padding: 10px 12px; }
.modem-config-head > div + div, .modem-config-row > div + div { border-left: 1px solid var(--border); }
.modem-config-row { min-height: 44px; border-bottom: 1px solid var(--border); }
.modem-config-row:last-child { border-bottom: none; }
.modem-config-row:nth-child(odd) { background: var(--zebra); }
.modem-config-label { color: var(--text-dim); font-size: 12.5px; font-weight: 600; }
.modem-config-value { color: var(--text); overflow-wrap: anywhere; font-size: 12px; }
.modem-config-status { text-align: center; }
.modem-config-row.loading .modem-config-value { color: var(--text-mut); }
.other-live-config {
  flex: 0 0 auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); overflow: hidden;
}
.other-live-config > summary {
  padding: 11px 13px; cursor: pointer; color: var(--text-dim);
  font-size: 12.5px; font-weight: 700; user-select: none;
}
.other-live-config > summary:hover { color: var(--text); background: var(--hover); }
.other-live-config[open] > summary { border-bottom: 1px solid var(--border); }
.other-live-note { padding: 10px 13px 0; }
.other-live-config .live-config-grid { padding: 12px; }

/* ===================================================================
   Toasts
   =================================================================== */
.toasts {
  position: fixed; bottom: calc(max(12px, env(safe-area-inset-bottom)) + var(--read-dock-space, 0px));
  right: 12px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px;
  width: min(360px, calc(100vw - 24px)); max-height: min(220px, 30vh);
  overflow-y: auto; overscroll-behavior: contain; pointer-events: none;
}
.toast {
  display: grid; grid-template-columns: minmax(0, 1fr) 32px; align-items: start; gap: 8px;
  flex: 0 0 auto; min-width: 0; pointer-events: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 9px 8px 9px 12px; box-shadow: var(--shadow-sm);
}
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.err { border-left-color: var(--danger); }
.toast-copy { min-width: 0; }
.toast .t-title { font-size: 13px; line-height: 1.4; font-weight: 700; overflow-wrap: anywhere; }
.toast .t-body { font-size: 12px; line-height: 1.4; color: var(--text-dim); overflow-wrap: anywhere; }
.toast-close {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--text-dim);
  font: inherit; font-size: 24px; line-height: 1; cursor: pointer;
}
.toast-close:hover { color: var(--text); background: var(--hover); }
.toast-close:active { transform: scale(.97); }
.toast-details > summary {
  width: fit-content; min-height: 24px; margin-top: 2px; padding: 2px 0;
  font-size: 12px; color: var(--text-dim); cursor: pointer;
}
.toast-full-message { max-height: 96px; overflow-y: auto; white-space: pre-wrap; padding: 4px 0; }
@media (pointer: coarse) {
  .toast { grid-template-columns: minmax(0, 1fr) 44px; }
  .toast-close { width: 44px; height: 44px; }
  .toast-details > summary { min-height: 44px; display: flex; align-items: center; }
}

/* ===================================================================
   Legacy helpers (kept for forward-compat: fuel bars / tanks / filters)
   =================================================================== */
.fuelbars { display: flex; flex-direction: column; gap: 10px; }
.fuelbar-row { display: grid; grid-template-columns: 130px 1fr 120px; align-items: center; gap: 12px; }
.fuelbar-name { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.fuelbar-track { background: var(--bg-elev); border-radius: 6px; height: 20px; overflow: hidden; }
.fuelbar-fill { height: 100%; border-radius: 6px; min-width: 2px; transition: width .3s; }
.fuelbar-val { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-dim); }

.report-picker {
  position: relative; z-index: 20;
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  margin: -6px 0 14px; padding: 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
  box-shadow: var(--shadow-sm);
}
.report-picker-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.report-picker-heading { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.report-picker-current-title {
  overflow: hidden; color: var(--text); font-size: 16px; font-weight: 750;
  text-overflow: ellipsis; white-space: nowrap;
}
.report-catalog { position: relative; flex: 0 0 auto; }
.report-catalog > summary,
.report-controller-picker > summary { list-style: none; }
.report-catalog > summary::-webkit-details-marker,
.report-controller-picker > summary::-webkit-details-marker { display: none; }
.report-catalog-trigger {
  display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 11px;
  border: 1px solid var(--accent); border-radius: var(--radius-sm);
  background: var(--accent-weak); color: var(--accent-ink); cursor: pointer;
  font-size: 13px; font-weight: 750; user-select: none;
}
.report-catalog-trigger:hover { filter: brightness(1.06); }
.report-catalog-trigger-icon { font-size: 15px; line-height: 1; }
.report-catalog-chevron,
.report-controller-summary-hint { margin-left: 2px; transition: transform var(--motion-fast) var(--ease-out); }
.report-catalog[open] .report-catalog-chevron,
.report-controller-picker[open] .report-controller-summary-hint { transform: rotate(180deg); }
.report-catalog-panel {
  position: absolute; top: calc(100% + 9px); right: 0; left: auto; z-index: 80;
  width: min(1080px, calc(100vw - 48px)); max-height: min(72vh, 720px); overflow: auto;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--card);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .36); padding: 15px;
}
.report-catalog-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 2px 12px; border-bottom: 1px solid var(--border);
}
.report-catalog-head-copy { display: flex; flex-direction: column; gap: 2px; }
.report-catalog-search {
  width: min(280px, 36vw); min-width: 180px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); color: var(--text); font: inherit;
}
.report-catalog-search:focus { border-color: var(--accent); outline: none; }
.report-catalog-groups {
  display: grid; grid-template-columns: 1.15fr .9fr 1fr 1fr; gap: 14px; padding-top: 14px;
}
.report-catalog-group { min-width: 0; }
.report-catalog-item[hidden], .report-catalog-group[hidden] { display: none; }
.report-catalog-group-graphs { border-left: 1px solid var(--border); padding-left: 12px; }
.report-catalog-group-graphs .report-catalog-group-title { color: var(--accent-ink); font-weight: 750; }
.report-catalog-group-title {
  margin: 0 4px 7px; color: var(--text-mut); font-size: 13px; font-weight: 600;
  letter-spacing: 0; text-transform: none; line-height: 1.5;
}
.report-catalog-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 8px 9px;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent;
  color: var(--text); text-align: left; cursor: pointer;
}
.report-catalog-item:hover { border-color: var(--border); background: var(--hover); }
.report-catalog-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.report-catalog-item.is-active {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-weak);
}
.report-catalog-item-title { font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.report-catalog-item.is-active .report-catalog-item-title { color: var(--accent-ink); }
.report-catalog-item-description {
  color: var(--text-mut); font-size: 10.5px; line-height: 1.3;
}
.report-catalog-empty {
  padding: 28px 12px; color: var(--text-mut); text-align: center; font-size: 12.5px;
}
@media (max-width: 1000px) {
  .report-catalog-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-catalog-group-graphs { border-left: 0; padding-left: 0; }
}
.report-picker-current {
  display: flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden;
  white-space: nowrap;
}
.report-picker-category { color: var(--text-dim); font-size: 12px; font-weight: 650; }
/* Five quick reports fit in one desktop row; narrower screens wrap automatically. */
.report-quick-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px;
}
@media (max-width: 1100px) {
  .report-quick-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.report-quick-button {
  min-height: 42px; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-elev); color: var(--text);
  font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: border-color var(--motion-fast) var(--ease-out),
    background-color var(--motion-fast) var(--ease-out);
}
.report-quick-button:hover { border-color: var(--border-strong); background: var(--hover); }
.report-quick-button.is-active {
  border-color: var(--accent); background: var(--accent-weak); color: var(--accent-ink);
}
.report-picker-kicker {
  color: var(--accent-ink); font-size: 13px; font-weight: 600; letter-spacing: 0;
  text-transform: none; line-height: 1.5;
}
.report-picker-separator { color: var(--text-mut); }
.report-picker-description {
  min-width: 0; overflow: hidden; color: var(--text-dim); font-size: 12px;
  text-overflow: ellipsis;
}
.report-controller-native {
  position: absolute !important; width: 1px !important; height: 1px !important;
  min-height: 0 !important; padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important; border: 0 !important;
}
.report-controller-picker { position: relative; width: 100%; z-index: 12; }
.report-controller-picker.disabled { opacity: .55; pointer-events: none; }
.report-controller-picker[open] { z-index: 70; }
.report-controller-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 48px; width: 100%; padding: 11px 13px;
  border: 1px solid var(--control-border); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text); cursor: pointer; user-select: none;
  font-size: 13px;
}
.report-controller-summary:hover,
.report-controller-picker[open] .report-controller-summary { border-color: var(--text-dim); }
.report-controller-summary-value {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.report-controller-summary-hint { flex: 0 0 auto; color: var(--text-mut); }
.report-controller-panel {
  position: absolute; top: calc(100% + 7px); right: 0; z-index: 80;
  width: min(430px, calc(100vw - 72px)); padding: 13px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--card);
  box-shadow: var(--shadow);
}
.report-controller-panel-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px;
}
.report-controller-search {
  width: 100%; min-width: 0; padding: 11px 13px; border: 1px solid var(--control-border);
  border-radius: var(--radius-sm); background: var(--card); color: var(--text); font: inherit;
}
.report-controller-quick {
  display: flex; align-items: center; gap: 14px; min-height: 34px; padding: 6px 1px;
  border-bottom: 1px solid var(--border);
}
.report-controller-link {
  padding: 3px 0; border: 0; background: transparent; color: var(--accent-ink);
  cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 700;
}
.report-controller-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.report-controller-options {
  display: flex; flex-direction: column; max-height: min(220px, 20vh); overflow: auto; padding: 6px 0;
}
.report-controller-option {
  display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 6px 7px;
  border-radius: 6px; color: var(--text); cursor: pointer; font-size: 12.5px;
}
.report-controller-option[hidden] { display: none; }
.report-controller-option:hover { background: var(--hover); }
.report-controller-option input {
  flex: 0 0 auto; width: 16px !important; height: 16px; margin: 0; accent-color: var(--accent);
}
.report-controller-panel-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.auto-report-config-body .report-controller-picker[open] { z-index: auto; }
.auto-report-config-body .report-controller-panel {
  position: static; width: 100%; margin-top: 7px;
  box-shadow: none;
}
.report-note {
  margin: 0 0 14px; padding: 9px 12px;
  border-left: 3px solid var(--border-strong); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: color-mix(in srgb, var(--card) 72%, transparent); line-height: 1.45;
}
.report-tabs {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: -4px 0 16px; padding: 4px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-sunken); width: fit-content; max-width: 100%;
}
.report-tab {
  appearance: none; display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 8px 13px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-dim); font: inherit; font-size: 13px;
  font-weight: 600; line-height: 1.25; cursor: pointer;
  transition: background-color var(--motion-ui) var(--ease-out), border-color var(--motion-ui) var(--ease-out),
    color var(--motion-ui) var(--ease-out), transform var(--motion-fast) var(--ease-out);
}
.report-tab:hover { background: var(--bg-elev); color: var(--text); }
.report-tab.active { background: var(--card); border-color: var(--border-strong); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.report-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.report-tab:active { transform: scale(.97); }
.report-filter-card { position: relative; overflow: visible; margin-bottom: 14px; }
.report-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 12px 14px;
}
.report-filter-grid .f-field { min-width: 0; }
.report-filter-grid .f-label {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-height: 36px; text-transform: none; letter-spacing: 0;
}
.report-label-title {
  color: var(--text-dim); font-size: 13px; font-weight: 600; line-height: 1.5;
}
.report-label-hint {
  max-width: 100%; overflow: hidden; color: var(--text-mut); font-size: 10.5px;
  font-weight: 450; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap;
}
.report-filter-grid select,
.report-filter-grid input { width: 100%; min-width: 0; max-width: none; }
.report-datetime-split {
  display: grid; grid-template-columns: minmax(132px, 1.1fr) minmax(132px, 1fr);
  align-items: center; gap: 7px; width: 100%; min-width: 0;
}
.report-datetime-split > input {
  min-width: 0; font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}
.report-filter-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.report-direction-control {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px;
  color: var(--text-mut); font-size: 11px; font-weight: 700; white-space: nowrap;
}
.report-sort-direction {
  min-width: 152px; max-width: none; min-height: 38px; padding-block: 7px;
  color: var(--text); font-size: 12px; font-weight: 600;
}
.report-filter-actions .report-page-size { margin-left: auto; min-width: 120px; }
/* Export actions of a built report: one bar directly above the result, hidden until it is built. */
.report-export-bar {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  margin: 0 0 10px;
}
.report-export-bar > .btn { white-space: nowrap; }
.report-options { position: relative; }
.report-options > summary { list-style: none; }
.report-options > summary::-webkit-details-marker { display: none; }
.report-options-summary {
  display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev);
  color: var(--text-dim); cursor: pointer; font-size: 12px; font-weight: 700; user-select: none;
}
.report-options-summary:hover,
.report-options[open] .report-options-summary { border-color: var(--border-strong); color: var(--text); }
.report-options-badge {
  padding: 2px 6px; border-radius: 999px; background: var(--accent-weak);
  color: var(--accent-ink); font-size: 10px; font-weight: 800;
}
.report-options-chevron { color: var(--text-mut); transition: transform var(--motion-fast) var(--ease-out); }
.report-options[open] .report-options-chevron { transform: rotate(180deg); }
.report-options-panel {
  position: absolute; bottom: calc(100% + 7px); left: 0; z-index: 80;
  display: flex; flex-direction: column; gap: 4px; width: max-content; min-width: 290px;
  max-width: min(420px, calc(100vw - 72px)); padding: 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--card);
  box-shadow: var(--shadow);
}
.report-options-panel .report-check {
  min-height: 34px; padding: 7px 8px; border-radius: 6px; color: var(--text);
}
.report-options-panel .report-check:hover { background: var(--hover); }
.report-user-selection-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px;
}
.report-users-sum-select { min-height: 150px !important; }
.report-check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); }
.report-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.report-kpis { margin-bottom: 14px; }
.report-totals-box { margin-bottom: 14px; }
.report-totals-box .table-wrap { box-shadow: none; }
.report-table-box { min-height: 150px; transition: opacity var(--motion-fast) var(--ease-out); }
.report-table-box.is-loading { opacity: .55; pointer-events: none; }
.report-notes .badge + .badge { margin-left: 5px; }
.report-table-box .table-wrap table { min-width: 1040px; }
.fillings-no-group-report-table .table-wrap table { min-width: 1080px; }
.fillings-no-group-report-table.with-rfid .table-wrap table { min-width: 1320px; }
.fillings-mass-report-table .table-wrap table { min-width: 1540px; }
.fillings-mass-report-table.with-rfid .table-wrap table { min-width: 1800px; }
.level-fillings-report-table .table-wrap table { min-width: 1420px; }
.fillings-users-report-table .table-wrap table { min-width: 720px; }
.fillings-users-report-table.with-rfid .table-wrap table { min-width: 880px; }
.fillings-users-report-table.with-prices .table-wrap table { min-width: 1040px; }
.fillings-users-sum-report-table .table-wrap table { min-width: 680px; }
.fillings-users-sum-report-table.with-rfid .table-wrap table { min-width: 860px; }
.fillings-cars-report-table .table-wrap table { min-width: 900px; }
.fillings-cars-report-table.with-density .table-wrap table { min-width: 1040px; }
.fillings-cars-report-table.with-fuel-type .table-wrap table { min-width: 1040px; }
.fillings-cars-report-table.with-density.with-fuel-type .table-wrap table { min-width: 1180px; }
.fillings-cars-report-table.with-rfid .table-wrap table { min-width: 1180px; }
.fillings-cars-report-table.with-rfid.with-density .table-wrap table,
.fillings-cars-report-table.with-rfid.with-fuel-type .table-wrap table { min-width: 1320px; }
.fillings-cars-report-table.with-rfid.with-density.with-fuel-type .table-wrap table {
  min-width: 1460px;
}
.fillings-cars-sum-report-table .table-wrap table { min-width: 900px; }
.fillings-cars-sum-report-table.with-rfid .table-wrap table { min-width: 1180px; }
.level-meter-report-table .table-wrap table { min-width: 1500px; }
.fillings-sum-report-table .table-wrap table { min-width: 680px; }
.fillings-orgs-sum-report-table .table-wrap table { min-width: 920px; }
.report-range { margin: -4px 0 10px; }
.report-sum-warnings {
  margin-bottom: 14px; border: 1px solid var(--warn); border-radius: var(--radius);
  background: var(--warn-weak); overflow: hidden;
}
.report-sum-warnings .table-wrap { border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.report-sum-warning-title { padding: 12px 14px; color: var(--warn); font-weight: 750; }
.report-diagnostic-list {
  margin: 0; padding: 0 18px 13px 34px; color: var(--text); font-size: 12.5px;
}
.report-diagnostic-list li + li { margin-top: 5px; }
.report-sum-subtotals { margin-bottom: 14px; }
.report-sum-subtotals .table-wrap { box-shadow: none; }
.report-sum-section-title { margin-top: 0; }
.report-sum-group :is(td, th) {
  background: var(--accent-weak); color: var(--accent-ink); font-weight: 800;
  border-top: 2px solid var(--accent);
}
.report-organization-group :is(td, th) {
  background: var(--accent-weak); color: var(--text); border-top: 2px solid var(--accent);
}
.report-organization-name { font-weight: 800; }
.report-organization-meta {
  margin-left: 12px; color: var(--text-dim); font-size: 12px; font-weight: 600;
}
.report-organization-total :is(td, th) {
  background: var(--bg-elev); color: var(--text); font-weight: 800;
  border-top: 1px solid var(--border-strong); border-bottom: 2px solid var(--border-strong);
}
.report-controller-group :is(td, th) {
  background: var(--bg-elev); color: var(--text); font-weight: 750;
  border-top: 2px solid var(--border-strong);
}
.report-sum-fuel-group :is(td, th) { background: var(--card); color: var(--text); font-weight: 700; }
.report-sleeve-group td {
  background: var(--bg); color: var(--text-dim); font-size: 12px; font-weight: 700;
}
.report-car-group :is(td, th) {
  background: var(--bg); color: var(--text-dim); font-size: 12px; font-weight: 700;
  border-top: 1px solid var(--border);
}
.report-car-total :is(td, th) {
  background: var(--bg-elev); color: var(--text); font-weight: 800;
  border-top: 1px solid var(--border-strong);
}
.report-user-group :is(td, th) {
  background: var(--bg-elev); color: var(--text); font-weight: 750; text-align: left;
  border-top: 2px solid var(--border-strong);
}
.report-user-total :is(td, th) {
  background: var(--bg-elev); color: var(--text); font-weight: 800;
  border-top: 1px solid var(--border-strong);
}
.report-sum-address { font-weight: 500; }
.report-sum-inline-total { float: right; font-size: 12px; font-weight: 500; }
.report-no-valid-data td:not(:first-child) { background: var(--warn-weak); }
.report-filling-device-error td { background: var(--warn-weak); cursor: help; }
.report-filling-device-error td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.report-invalid-value {
  color: var(--warn); cursor: help; text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.report-pager {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 12px 2px 0;
}
.report-page-info { min-width: 150px; text-align: center; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .report-picker { align-items: stretch; flex-direction: column; }
  .report-picker-top { align-items: stretch; flex-direction: column; }
  .report-picker-heading { padding-inline: 2px; }
  .report-quick-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-picker-current { padding: 0 2px 2px; }
  .report-catalog { width: 100%; }
  .report-catalog-trigger { justify-content: center; width: 100%; }
  .report-catalog-panel { position: fixed; top: 74px; right: auto; left: 12px; width: calc(100vw - 24px); }
  .report-catalog-head { align-items: stretch; flex-direction: column; }
  .report-catalog-search { width: 100%; min-width: 0; }
  .report-catalog-groups { grid-template-columns: 1fr; }
  .report-controller-panel { position: fixed; top: 74px; left: 12px; right: auto; width: calc(100vw - 24px); }
  .report-options-panel { position: fixed; top: 90px; bottom: auto; left: 12px; width: calc(100vw - 24px); max-width: none; }
  .report-label-hint { overflow: visible; text-overflow: clip; white-space: normal; }
  .report-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .report-tab { width: 100%; min-height: 48px; padding-inline: 8px; white-space: normal; }
  .report-filter-actions > .btn { flex: 1 1 140px; }
  .report-filter-actions > .btn-primary { flex-basis: 100%; }
  .report-export-bar > .btn { flex: 1 1 140px; justify-content: center; }
  .report-organization-meta { display: block; margin: 3px 0 0; }
  .report-pager { flex-wrap: wrap; }
  .report-pager .btn { flex: 1 1 100px; }
  .report-page-info { order: -1; flex: 1 1 100%; }
}

.controller-reservoir-group td {
  padding: 10px 12px !important; border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
}
.controller-reservoir-name { font-size: 12px; font-weight: 800; }
.controller-reservoir-count {
  margin-left: 9px; color: var(--text-mut); font-size: 11px; font-variant-numeric: tabular-nums;
}

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters .f-field { display: flex; flex-direction: column; gap: 4px; }
.filters label { font-size: 13px; font-weight: 600; line-height: 1.5; color: var(--text-dim); text-transform: none; letter-spacing: 0; }
.filters select, .filters input { min-width: 150px; }

.tank-card .tank-head { padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; background: var(--bg-elev); }
.tank-sections { display: flex; flex-direction: column; }
.tank-sec { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.tank-sec:last-child { border-bottom: none; }
.tank-sec .sec-num { font-family: var(--font-sans); font-variant-numeric: tabular-nums; color: var(--text-mut); font-size: 12px; }
.tank-gauge { margin-top: 5px; height: 8px; background: var(--bg-elev); border-radius: 4px; overflow: hidden; }
.tank-gauge > div { height: 100%; border-radius: 4px; }
.sec-vals { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--text-dim); white-space: nowrap; }
.sec-vals b { color: var(--text); }

/* ===================================================================
   Utilities
   =================================================================== */
.muted { color: var(--text-mut); }
.small { font-size: 12px; }
[hidden], .hidden { display: none !important; }
.stack { display: flex; flex-direction: column; gap: 2px; }
.ctr, th.ctr { text-align: center; }

/* ===================================================================
   Пользователи (fuel users editor)
   =================================================================== */
.users-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.users-search-wrap {
  position: relative; display: flex; align-items: center;
  flex: 1 1 280px; min-width: 200px; max-width: 460px;
}
.users-search-wrap .search-ico {
  position: absolute; left: 11px; display: inline-flex; align-items: center;
  color: var(--text-mut); pointer-events: none;
}
.users-search {
  width: 100%; padding-left: 34px;
}
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.directory-batch-action {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 12px 0; margin-bottom: 12px;
}
.directory-batch-copy { flex: 1 1 360px; min-width: 0; display: grid; gap: 4px; }
.directory-batch-body { display: flex; flex-direction: column; gap: 14px; }
.directory-batch-selection { min-width: 0; border: 0; padding: 0; margin: 0; }
.directory-batch-selection legend { font-weight: 600; margin-bottom: 8px; }
.directory-batch-choices .ctl-check-name { white-space: normal; overflow-wrap: anywhere; }
.directory-batch-results { display: grid; gap: 8px; }
.directory-batch-result { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.directory-batch-result.blocked, .directory-batch-result.error, .directory-batch-result.unknown, .directory-batch-result.warning { border-color: var(--danger); }
.directory-save-notice { margin-top: 12px; }

.btn-danger {
  background: var(--danger-weak); border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  color: var(--danger);
}
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 22%, transparent); border-color: var(--danger); color: var(--danger); }

.users-table-box { position: relative; transition: opacity var(--motion-fast) var(--ease-out); }
.users-table-box.is-loading { opacity: .5; pointer-events: none; }
.directory-page-controls, .directory-page-navigation, .directory-page-size-label {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.directory-page-controls { justify-content: space-between; margin: 12px 0; }
.directory-page-range { font-size: 13px; font-variant-numeric: tabular-nums; }
.directory-page-size-label { font-size: 13px; color: var(--text-mut); }
.directory-list .directory-page-size { width: 84px; min-height: 36px; flex: 0 0 84px; }
.directory-list-feedback { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 36px; margin-bottom: 8px; }
.directory-list-status { color: var(--text-mut); overflow-wrap: anywhere; }
.directory-list-status.directory-list-error { color: var(--danger); }
.directory-list .users-table .u-name { overflow-wrap: anywhere; }
.users-table td { vertical-align: middle; }
.users-table .u-name { font-weight: 600; }
.count-pill {
  display: inline-block; min-width: 26px; padding: 1px 8px; border-radius: 999px;
  background: var(--accent-weak); color: var(--accent-ink);
  font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; text-align: center;
}
.ck { font-weight: 800; font-size: 14px; }
.ck-yes { color: var(--ok); }
.ck-no { color: var(--text-mut); font-weight: 400; }
.row-actions { display: inline-flex; gap: 6px; }

/* ===================================================================
   Modal (user create / edit form)
   =================================================================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 18px;
  background: rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity var(--motion-ui) var(--ease-out); overflow-y: auto;
}
.modal-overlay.open { opacity: 1; }
.modal-overlay.closing { opacity: 0; }
.modal-card {
  width: 100%; max-width: 680px;
  /* the CARD is the scroll boundary: cap its height and let .modal-body scroll inside, so the
     header/footer stay pinned to the card (not the screen) instead of riding over the content. */
  max-height: calc(100vh - 80px);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(-8px) scale(.99); transition: transform var(--motion-ui) var(--ease-out);
  margin: auto 0;
}
.modal-overlay.open .modal-card { transform: none; }
.modal-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  background: var(--card); border-radius: var(--radius) var(--radius) 0 0;
}
.modal-head h3 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
.modal-close {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--text-dim);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: var(--bg-elev); color: var(--accent-ink); border-color: var(--border); }
.modal-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 24px; display: flex; flex-direction: column; gap: 24px;
}
.modal-foot {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 16px 24px; border-top: 1px solid var(--border);
  background: var(--card); border-radius: 0 0 var(--radius) var(--radius);
}

.form-group { display: flex; flex-direction: column; gap: 10px; }
.form-group-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 13px; font-weight: 600; color: var(--text-mut); font-family: var(--font-sans);
  text-transform: none; letter-spacing: 0; line-height: 1.5;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.form-group-actions { text-transform: none; letter-spacing: 0; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
.f-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.f-label { font-size: 13px; font-weight: 600; color: var(--text-dim); line-height: 1.5; }
.f-hint { color: var(--text-mut); font-weight: 400; }
.f-input { width: 100%; }
select.f-input { min-width: 0; max-width: none; }
.f-input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-weak); }
.f-error { color: var(--danger); font-size: 11.5px; font-weight: 600; }

.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; }
.perm-row {
  display: flex; align-items: flex-start; gap: 9px; cursor: pointer;
  padding: 7px 9px; border-radius: var(--radius-sm); border: 1px solid transparent;
}
.perm-row:hover { background: var(--bg-elev); border-color: var(--border); }
.perm-label { display: flex; flex-direction: column; gap: 1px; font-size: 13px; line-height: 1.3; }
.perm-hint { font-size: 11px; color: var(--text-mut); }
.f-check { width: 17px; height: 17px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--accent); cursor: pointer; }

.ctl-filter { width: 100%; margin-bottom: 4px; }
.ctl-checklist {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 220px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-sunken); padding: 6px;
}
.ctl-check-row {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 6px 8px; border-radius: var(--radius-sm);
}
.ctl-check-row:hover { background: var(--hover); }
.ctl-check-name { flex: 1 1 auto; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctl-check-id { flex: 0 0 auto; font-size: 11px; }
.link-btn {
  background: none; border: none; color: var(--accent-ink); cursor: pointer;
  font: inherit; font-size: 12px; padding: 0; text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { color: var(--accent-hover); }
.link-btn:disabled { color: var(--text-mut); cursor: not-allowed; text-decoration: none; }

/* ===================================================================
   Config editors (managers + forms): controllers / reservoirs / create-db
   =================================================================== */
.modal-card.wide { max-width: 940px; }
.mgr-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 4px; flex-wrap: wrap;
}
.manager-note {
  padding: 10px 12px; color: var(--text-dim); background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--radius-sm); line-height: 1.45;
}
.controller-manager-name { font-weight: 700; }
.controller-manager-actions { flex-wrap: nowrap; justify-content: flex-end; }
.controller-settings-button { min-width: 96px; }
.btn-danger-soft { color: var(--danger); background: var(--danger-weak); border-color: transparent; }
.btn-danger-soft:hover { border-color: var(--danger); }
.controller-technical-details,
.tank-section-advanced {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev);
}
.controller-technical-details > summary,
.tank-section-advanced > summary {
  padding: 11px 13px; cursor: pointer; color: var(--text-dim); font-size: 13px; font-weight: 700;
}
.controller-technical-details > .form-grid { padding: 0 13px 13px; }
.controller-meter-summary-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.controller-meter-summary {
  display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-elev);
}
.office-groups-grid, .office-plans-grid { grid-template-columns: minmax(0, 1fr); }
.icon-btn {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text-dim);
  font-size: 14px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background-color var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out), transform var(--motion-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--hover); color: var(--accent-ink); border-color: var(--accent); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn:active { transform: scale(.96); }
.controller-manager-focus-row > * {
  background: var(--accent-weak);
  box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent);
}
.icon-btn.danger { color: var(--danger); background: var(--danger-weak); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.mt8 { margin-top: 8px; }

.sec-list { display: flex; flex-direction: column; gap: 10px; }
.sec-row {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev);
}
.tank-section-editor {
  display: grid; gap: 12px; padding: 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-elev);
}
.tank-section-editor.has-level-meter-conflict { border-color: var(--danger); }
.tank-section-editor-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.tank-section-editor-title { display: grid; gap: 2px; min-width: 0; }
.tank-section-main-grid { grid-template-columns: 84px minmax(160px, 1fr) minmax(150px, 1fr); }
.tank-section-advanced { background: var(--card); }
.tank-section-advanced > .form-grid { padding: 2px 13px 13px; }
.tank-extra-details { background: var(--card); }
.tank-sections-title { align-items: center; }
.tank-sections-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap;
}
.tank-sections-summary {
  color: var(--text-dim); font-size: 12px; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tank-sections-summary.has-conflict { color: var(--danger); font-weight: 700; }
.tank-sections-help { max-width: 780px; line-height: 1.5; }
.sec-cell { display: flex; flex-direction: column; gap: 4px; flex: 1 1 90px; min-width: 0; }
.sec-cell.narrow { flex: 0 0 64px; }
.sec-cell.grow { flex: 2 1 150px; }
.tank-level-meter-cell { flex-basis: 280px; }
.sec-row.has-level-meter-conflict { border-color: var(--danger); }
.tank-level-meter-conflict:empty { display: none; }
.sec-cap { font-size: 11px; color: var(--text-mut); font-weight: 600; }
.sec-row .icon-btn { margin-bottom: 1px; }
.f-input.tiny { text-align: center; }
.tank-communication-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.tank-communication-row {
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev);
}
.tank-communication-row.unavailable { border-color: var(--danger); background: var(--danger-weak); }
.tank-communication-controller { margin-bottom: 8px; }
.tank-communication-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
.tank-balance-panel { margin-top: 10px; min-height: 44px; }
.tank-balance-table { min-width: 620px; }
.tank-balance-table th,
.tank-balance-table td { vertical-align: middle; }
.tank-balance-table .tank-balance-total th { border-top: 2px solid var(--border); }
.tank-balance-table .tank-balance-archived { color: var(--text-mut); }
.danger-text { color: var(--danger); }

.phone-cell { display: flex; align-items: center; gap: 8px; }
.phone-val { display: inline-flex; align-items: center; gap: 6px; }
.phone-tag { text-transform: none; }
.phone-input { width: 160px; padding: 4px 8px; }
.phone-cell .icon-btn { width: 36px; height: 36px; font-size: 12px; }

th.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
th.th-sort:has(> .table-sort-button) { padding: 0; }
th.th-sort:hover, th.th-sort.active { color: var(--accent-ink); }
.table-sort-button {
  appearance: none; display: inline-flex; align-items: center; justify-content: inherit; gap: 6px;
  width: 100%; min-height: 40px; margin: 0; padding: 9px 13px; border: 0;
  background: transparent; color: inherit; font: inherit; font-weight: inherit;
  letter-spacing: inherit; text-align: inherit; text-transform: inherit; cursor: pointer;
  transition: color var(--motion-fast) var(--ease-out), background-color var(--motion-fast) var(--ease-out),
    transform var(--motion-fast) var(--ease-out);
}
th.num .table-sort-button { justify-content: flex-end; }
th.ctr .table-sort-button { justify-content: center; }
.table-sort-button:hover { background: var(--hover); color: var(--accent-ink); }
.table-sort-button:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--accent); outline-offset: -3px; }
.table-sort-button:active { transform: scale(.98); }
.sort-arrow { display: inline-block; min-width: 10px; font-size: 10px; opacity: .85; }
.resv-chip.stale { opacity: .5; }
.resv-chip .fuel-dot { margin-right: 5px; }

/* dashboard "Резервуар" cell: tank name + lazy remainders */
.resv-cell { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 130px; }
.resv-tank { font-weight: 600; font-size: 12.5px; }
.resv-cell-ico { font-size: 11px; }
.resv-level { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.resv-level.stale { opacity: .5; }
.resv-unconfigured { color: var(--warn); font-weight: 650; }
.resv-more { font-size: 11px; }
.resv-live {
  display: flex; flex-direction: column; gap: 4px;
  width: 100%; max-width: 100%; min-width: 0;
  padding: 6px; border: 1px solid color-mix(in srgb, var(--ok) 45%, var(--border));
  border-radius: var(--radius-sm); background: var(--ok-weak);
}
.live-level-office-modal { min-width: 0; }
.live-level-office-table { max-width: 100%; box-shadow: none; }
.live-level-office-table table { min-width: 720px; width: max-content; }
.live-level-office-table th, .live-level-office-table td { white-space: nowrap; }
.live-level-office-table .live-level-office-metric {
  min-width: 220px; font-weight: 650; white-space: normal;
}
.live-level-office-table .live-level-office-total {
  font-weight: 750; border-left: 2px solid var(--border-strong); background: var(--bg-elev);
}
.live-level-office-table .live-level-office-error {
  color: var(--danger); background: var(--danger-weak); font-weight: 700;
}
/* connection dot is painted from a separate live BenzaServer presence probe. */
.link-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; flex: 0 0 auto; }
.link-dot.on { background: var(--ok); }
/* offline is an explicit verdict; grey stays reserved for `stale` / `no data` (inline #8c96a3). */
.link-dot.off { background: var(--danger); }
.ctl-name { display: flex; align-items: center; }

/* reservoir tree (vendor model: tank -> its controllers) */
.resv-filter { margin-bottom: 4px; }
.resv-tree { display: flex; flex-direction: column; gap: 10px; }
.resv-node { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev); overflow: hidden; }
.resv-node-head { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; }
.resv-ico { flex: 0 0 auto; font-size: 15px; line-height: 1.3; }
.resv-node-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.resv-node-title { font-weight: 700; font-size: 13.5px; }
.resv-last-read { color: var(--text-dim); }
.resv-last-read.stale { color: var(--warn); font-weight: 650; }
.resv-ctrls { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 10px 34px; }
.resv-ctrl { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--border); }
.resv-ctrl-ico { flex: 0 0 auto; font-size: 13px; }
.resv-ctrl-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.resv-noctrl { padding: 6px 2px; }

/* Office-compatible level-meter graph with real timestamps and explicit validity evidence. */
.level-meter-chart-box { min-width: 0; overflow: hidden; }
.level-meter-chart-result { display: flex; flex-direction: column; gap: 14px; }
.level-meter-chart-scroll { width: 100%; overflow-x: auto; }
.level-meter-chart-svg {
  display: block; width: 100%; min-width: 760px; height: auto;
  background: var(--card); color: var(--text);
}
.level-meter-chart-grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.level-meter-chart-axis { stroke: var(--text); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.level-meter-chart-axis-label {
  fill: var(--text-dim); font: 11px var(--font-sans); font-variant-numeric: tabular-nums;
}
.level-meter-chart-line {
  fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.level-meter-chart-invalid {
  fill: var(--card); stroke-width: 2; vector-effect: non-scaling-stroke;
}
.level-meter-chart-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.level-meter-chart-legend-item {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); font-size: 12px;
}
.level-meter-chart-swatch { width: 18px; height: 4px; border-radius: 999px; flex: 0 0 auto; }
.level-meter-chart-sampling { line-height: 1.45; }
/* Fuel level (tank gauge) chart: interactive SVG, event lane, navigator and flow-meter comparison.
   Light tokens only; hand-rolled SVG, no chart libraries. */
.fuel-level-chart-box { min-width: 0; overflow: hidden; }
.fuel-level-result { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fuel-level-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.fuel-level-metric-switch {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev);
}
.fuel-level-metric-switch button {
  min-height: 36px; padding: 6px 12px; border: 0; border-radius: 9px; background: transparent;
  color: var(--text-dim); font: 500 12.5px var(--font-sans); cursor: pointer;
  transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .fuel-level-metric-switch button:hover:not(:disabled) { color: var(--text); background: var(--card); }
}
.fuel-level-metric-switch button[aria-checked="true"],
.fuel-level-metric-switch button[aria-checked="true"]:hover { background: var(--fg); color: var(--bg-card); }
.fuel-level-metric-switch button:disabled { opacity: .4; cursor: not-allowed; }
.fuel-level-metric-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fuel-level-zoom { display: inline-flex; gap: 6px; }
.fuel-level-zoom-btn { min-width: 40px; font-weight: 700; }
.fuel-level-sampling { font-variant-numeric: tabular-nums; }
.fuel-level-detail-status { margin-left: auto; min-height: 1em; font-variant-numeric: tabular-nums; }
.fuel-level-truncated { color: var(--warn); }
.fuel-level-legend { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.fuel-level-legend-item {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 11px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card);
  color: var(--text); font: 12px var(--font-sans); text-align: left; cursor: pointer;
  transition: opacity var(--motion-fast) var(--ease-out), border-color var(--motion-fast) var(--ease-out),
    transform var(--motion-press) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  button.fuel-level-legend-item:hover { border-color: var(--border-strong); }
}
button.fuel-level-legend-item:active { transform: scale(.97); }
.fuel-level-legend-item[aria-pressed="false"] { opacity: .45; }
.fuel-level-legend-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fuel-level-legend-item.is-unconfigured { cursor: default; color: var(--fg-muted); background: var(--bg-elev); }
.fuel-level-swatch { width: 18px; height: 4px; border-radius: 999px; flex: 0 0 auto; }
.fuel-level-swatch--aux { height: 0; border-top: 2px dashed var(--fg-muted); border-radius: 0; }
.fuel-level-fuel-stripe { width: 5px; height: 16px; border-radius: 2px; flex: 0 0 auto; }
.fuel-level-chart-frame {
  position: relative; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card);
}
.fuel-level-chart-frame:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Движение вида: transform на внутренних группах .fuel-level-motion. Без will-change: растеризация
   слоя в масштабе начала жеста размывала бы тонкие линии при зуме. */
.fuel-level-layer--lines .fuel-level-line { transition: opacity var(--motion-fade) var(--ease-out); }
.fuel-level-result.is-focusing .fuel-level-layer--lines .fuel-level-line:not(.is-focus) { opacity: .35; }
.fuel-level-layer--ghost { pointer-events: none; }
.fuel-level-chart-svg {
  display: block; width: 100%; height: auto; border-radius: var(--radius-sm);
  touch-action: none; user-select: none; -webkit-user-select: none; color: var(--text);
}
.fuel-level-grid { stroke: var(--brd); stroke-width: 1; stroke-opacity: .7; vector-effect: non-scaling-stroke; }
.fuel-level-grid--x { stroke-dasharray: 2 4; }
.fuel-level-zero { stroke: var(--fg-muted); stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.fuel-level-plot-border { fill: none; stroke: var(--brd-hover); stroke-width: 1; vector-effect: non-scaling-stroke; }
.fuel-level-lane-bg { fill: var(--bg-sunken); stroke: var(--brd); stroke-width: 1; vector-effect: non-scaling-stroke; }
.fuel-level-axis-label { fill: var(--fg-muted); font: 12px var(--font-sans); font-variant-numeric: tabular-nums; }
.fuel-level-axis-date { fill: var(--fg-muted); font: 12px var(--font-sans); font-variant-numeric: tabular-nums; }
.fuel-level-axis-unit { fill: var(--fg-muted); font: 600 11px var(--font-sans); }
.fuel-level-empty-note { fill: var(--fg-muted); font: 13px var(--font-sans); }
.fuel-level-line {
  fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.fuel-level-invalid { fill: none; stroke: var(--danger); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.fuel-level-src { fill: var(--card); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
/* Много точек источника: при зуме гаснут за 80 мс и возвращаются за 120 мс после покоя. */
.fuel-level-layer--src { transition: opacity var(--motion-fade) var(--ease-out); }
.fuel-level-layer--src.is-zooming { opacity: 0; transition-duration: 80ms; }
/* Кресты недостоверных точек сдвигаются только по X: на время вертикальной пружины гаснут. */
.fuel-level-layer--invalid { transition: opacity var(--motion-fade) var(--ease-out); }
.fuel-level-layer--invalid.is-zooming { opacity: 0; transition-duration: 80ms; }
.fuel-level-src--end { fill: var(--fg-muted); }
.fuel-level-gap { stroke: none; }
.fuel-level-gap--no_data { fill: rgba(96, 94, 89, .08); }
.fuel-level-gap--invalid { fill: rgba(201, 52, 44, .08); }
.fuel-level-hatch-bg { fill: rgba(201, 52, 44, .04); }
.fuel-level-hatch-line { stroke: rgba(201, 52, 44, .28); stroke-width: 2; }
.fuel-level-band { stroke: none; }
.fuel-level-band--intake { fill: rgba(36, 111, 76, .10); }
.fuel-level-band--drain { fill: rgba(201, 52, 44, .12); }
.fuel-level-band--undocumented { fill: rgba(135, 80, 14, .10); }
.fuel-level-band--sensor_error { fill: rgba(135, 80, 14, .08); }
.fuel-level-band--frozen {
  fill: rgba(96, 94, 89, .05); stroke: var(--fg-muted); stroke-width: 1; stroke-dasharray: 4 3;
  vector-effect: non-scaling-stroke;
}
.fuel-level-band.is-highlighted { stroke: var(--fg); stroke-width: 1.5; stroke-dasharray: none; vector-effect: non-scaling-stroke; }
.fuel-level-capacity { stroke: var(--fg-muted); stroke-width: 1; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.fuel-level-lane-span { stroke: none; }
.fuel-level-lane-span--intake { fill: var(--ok); }
.fuel-level-lane-span--drain { fill: var(--danger); }
.fuel-level-lane-span--undocumented { fill: var(--warn); }
.fuel-level-marker { cursor: pointer; outline: none; }
.fuel-level-marker-body {
  transform-box: fill-box; transform-origin: center;
  transition: transform var(--motion-press) var(--ease-out);
}
.fuel-level-marker:active .fuel-level-marker-body { transform: scale(.97); }
.fuel-level-marker-hit { fill: transparent; }
.fuel-level-marker-shape, .fuel-level-marker-disc { fill: var(--fg-muted); stroke: var(--card); stroke-width: 1; }
.fuel-level-marker-ring { fill: var(--card); stroke: var(--fg-muted); stroke-width: 1.5; }
.fuel-level-marker-glyph { fill: var(--fg-muted); font: 700 9px var(--font-sans); pointer-events: none; }
.fuel-level-marker-disc + .fuel-level-marker-glyph,
.fuel-level-marker-shape + .fuel-level-marker-glyph { fill: var(--bg-card); }
.fuel-level-marker-cross { fill: none; stroke: var(--danger); stroke-width: 1.8; }
.fuel-level-marker--intake .fuel-level-marker-shape { fill: var(--ok); }
.fuel-level-marker--dispense .fuel-level-marker-shape,
.fuel-level-marker--dispense_cluster .fuel-level-marker-shape,
.fuel-level-marker--dispense_group .fuel-level-marker-shape { fill: var(--v2); }
.fuel-level-marker--event_cluster .fuel-level-marker-shape { fill: var(--fg-muted); }
.fuel-level-marker--drain_suspect .fuel-level-marker-shape { fill: var(--danger); }
.fuel-level-marker--drain_suspect.is-undocumented .fuel-level-marker-shape { fill: var(--warn); }
.fuel-level-marker--hatch_open .fuel-level-marker-disc { fill: var(--warn); }
.fuel-level-marker--hatch_close .fuel-level-marker-ring,
.fuel-level-marker--battery_low .fuel-level-marker-ring { stroke: var(--warn); }
.fuel-level-marker--hatch_close .fuel-level-marker-glyph,
.fuel-level-marker--battery_low .fuel-level-marker-glyph { fill: var(--warn); }
.fuel-level-marker--sensor_error .fuel-level-marker-disc { fill: var(--danger); }
.fuel-level-marker--link_lost .fuel-level-marker-ring { stroke: var(--danger); }
@media (hover: hover) and (pointer: fine) {
  .fuel-level-marker:hover .fuel-level-marker-hit { fill: rgba(24, 24, 23, .07); }
  .fuel-level-nav-handle:hover { fill: var(--v2-weak); }
  .fuel-level-daily-svg:has(.fuel-level-daily-bar:hover) .fuel-level-daily-bar:not(:hover) { opacity: .55; }
  .fuel-level-residual-dot:hover { transform: scale(1.35); }
  .fuel-level-fillings-table tbody tr:hover { background: var(--bg-elev); }
}
.fuel-level-marker:focus-visible .fuel-level-marker-hit { fill: rgba(24, 24, 23, .07); stroke: var(--accent); stroke-width: 2; }
.fuel-level-marker.is-highlighted .fuel-level-marker-hit { fill: var(--signal-muted); stroke: var(--accent); stroke-width: 1.5; }
.fuel-level-overlay { fill: transparent; cursor: crosshair; }
.fuel-level-crosshair {
  stroke: rgb(24 24 23 / .28); stroke-width: 1; pointer-events: none;
  vector-effect: non-scaling-stroke;
}
.fuel-level-cross-dots, .fuel-level-cross-dot { pointer-events: none; }
.fuel-level-cross-dot { fill: var(--card); stroke-width: 2; vector-effect: non-scaling-stroke; }
.fuel-level-brush {
  fill: rgba(40, 108, 122, .10); stroke: var(--v2); stroke-width: 1; pointer-events: none;
  vector-effect: non-scaling-stroke;
}
.fuel-level-aux-bg { fill: var(--bg-sunken); stroke: var(--brd); stroke-width: 1; vector-effect: non-scaling-stroke; }
.fuel-level-aux-line { fill: none; stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.fuel-level-aux-line--rssi { stroke-dasharray: 4 3; stroke-opacity: .75; }
.fuel-level-aux-threshold { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; }
.fuel-level-aux-threshold-label { fill: var(--warn); }
.fuel-level-aux-hidden { font-size: 12px; }
.fuel-level-daily-empty { fill: var(--fg-muted); }
.fuel-level-navigator { fill: var(--bg-sunken); stroke: var(--brd); stroke-width: 1; cursor: pointer; vector-effect: non-scaling-stroke; }
.fuel-level-nav-line { fill: none; stroke-width: 1; stroke-opacity: .8; pointer-events: none; vector-effect: non-scaling-stroke; }
.fuel-level-nav-shade { fill: rgb(246 244 239 / .6); cursor: pointer; }
.fuel-level-nav-window {
  fill: rgba(40, 108, 122, .08); stroke: var(--v2); stroke-width: 1.5; cursor: grab;
  vector-effect: non-scaling-stroke;
}
.fuel-level-nav-window:active { cursor: grabbing; }
.fuel-level-nav-handle { fill: var(--card); stroke: var(--v2); stroke-width: 1.5; cursor: ew-resize; vector-effect: non-scaling-stroke; }
.fuel-level-tooltip {
  position: absolute; top: 0; left: 0; z-index: 3; min-width: 180px; max-width: 320px;
  padding: 9px 11px; border: 1px solid var(--brd); border-radius: 10px;
  background: var(--bg-card); box-shadow: var(--shadow-pop); color: var(--text);
  font-size: 12px; line-height: 1.4; font-variant-numeric: tabular-nums; pointer-events: none; will-change: transform;
}
.fuel-level-tooltip[hidden] { display: none; }
/* Появление подсказки — на внутреннем блоке: внешний двигается translate() за курсором. */
.fuel-level-tooltip-body { display: flex; flex-direction: column; }
.fuel-level-tooltip-time { margin-bottom: 4px; font: 600 12px var(--font-sans); font-variant-numeric: tabular-nums; }
.fuel-level-tooltip-row { display: flex; align-items: center; gap: 7px; }
.fuel-level-tooltip-row strong { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fuel-level-tooltip-name { color: var(--fg-muted); }
.fuel-level-tooltip-meta { margin: 0 0 3px 25px; color: var(--fg-muted); font-size: 11px; }
.fuel-level-tooltip-event { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--brd); color: var(--fg); }
.fuel-level-detail {
  padding: 14px 16px; border: 1px solid var(--brd); border-radius: 10px;
  background: var(--bg-card); box-shadow: var(--shadow-pop);
}
.fuel-level-detail[hidden] { display: none; }
.fuel-level-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fuel-level-detail-head h3 { margin: 0; font-size: 15px; }
.fuel-level-detail-list {
  display: grid; grid-template-columns: minmax(150px, max-content) 1fr; gap: 5px 16px;
  margin: 12px 0; font-size: 13px;
}
.fuel-level-detail-list dt { color: var(--fg-muted); }
.fuel-level-detail-list dd { margin: 0; font-variant-numeric: tabular-nums; }
.fuel-level-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fuel-level-compare { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; border-top: 1px solid var(--brd); }
.fuel-level-compare-title { margin: 8px 0 0; font-size: 18px; }
.fuel-level-subtitle { margin: 6px 0 0; font-size: 14px; }
.fuel-level-compare-top { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.fuel-level-compare-kpis { margin: 0; }
.fuel-level-gauge {
  display: flex; flex-direction: column; align-items: center; padding: 10px 8px 12px;
  border: 1px solid var(--brd); border-radius: var(--radius-sm); background: var(--card);
}
.fuel-level-gauge-svg { display: block; width: 220px; max-width: 100%; height: auto; }
.fuel-level-gauge-arc { fill: none; stroke-width: 14; }
.fuel-level-gauge-arc--ok { stroke: var(--ok); }
.fuel-level-gauge-arc--warn { stroke: var(--warn); }
.fuel-level-gauge-arc--bad { stroke: var(--danger); }
.fuel-level-gauge-arc--unknown { stroke: var(--brd-hover); }
.fuel-level-gauge-needle { stroke: var(--fg); stroke-width: 3; stroke-linecap: round; }
.fuel-level-gauge-needle-g { transform-box: view-box; }
.fuel-level-gauge-hub { fill: var(--fg); }
.fuel-level-gauge-value {
  margin-top: -6px; font: 700 28px var(--font-sans); font-variant-numeric: tabular-nums;
  letter-spacing: -.03em; line-height: 1;
}
.fuel-level-gauge-caption { color: var(--fg-muted); font-size: 12px; }
.fuel-level-gauge-label { margin-top: 4px; font-size: 12.5px; font-weight: 600; text-align: center; }
.fuel-level-grade--ok .fuel-level-gauge-label { color: var(--ok); }
.fuel-level-grade--warn .fuel-level-gauge-label { color: var(--warn); }
.fuel-level-grade--bad .fuel-level-gauge-label { color: var(--danger); }
.fuel-level-grade--unknown .fuel-level-gauge-label { color: var(--fg-muted); }
.fuel-level-daily-svg, .fuel-level-residual-svg {
  display: block; width: 100%; height: auto; border: 1px solid var(--brd);
  border-radius: var(--radius-sm); background: var(--card);
}
.fuel-level-daily-bar { stroke: none; }
.fuel-level-daily-bar.fuel-level-grade--ok { fill: var(--ok); }
.fuel-level-daily-bar.fuel-level-grade--warn { fill: var(--warn); }
.fuel-level-daily-bar.fuel-level-grade--bad { fill: var(--danger); }
.fuel-level-daily-bar.fuel-level-grade--unknown { fill: var(--fg-subtle); }
.fuel-level-daily-bar { transition: opacity var(--motion-fade) var(--ease-out); }
.fuel-level-residual-line { fill: none; stroke: var(--v2); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.fuel-level-residual-dot {
  fill: var(--card); stroke: var(--v2); stroke-width: 1.5; vector-effect: non-scaling-stroke;
  transform-box: fill-box; transform-origin: center; transition: transform var(--motion-press) var(--ease-out);
}
.fuel-level-fillings-table tbody tr { cursor: pointer; }
.fuel-level-fillings-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fuel-level-fillings-table tr.is-group { background: var(--v2-weak); font-weight: 600; }
.fuel-level-fillings-table td { white-space: nowrap; }
.fuel-level-show-all { align-self: flex-start; }
/* Загрузка: полоса прогресса детализации, скелет первого построения, перестроение по «Показать». */
.fuel-level-progress {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2; height: 2px; overflow: hidden;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0; pointer-events: none;
  opacity: 0; transition: opacity var(--motion-fast) var(--ease-out);
}
.fuel-level-progress.is-active { opacity: 1; transition-delay: var(--motion-progress-delay); }
.fuel-level-progress-bar {
  display: block; width: 30%; height: 100%; background: var(--v2);
  animation: fuel-level-progress 1.2s linear infinite;
}
/* Полоса доигрывает затухание в движении; анимация снимается только после ухода (is-idle). */
.fuel-level-progress.is-idle { visibility: hidden; }
.fuel-level-progress.is-idle .fuel-level-progress-bar { animation: none !important; }
@keyframes fuel-level-progress { from { transform: translateX(-100%); } to { transform: translateX(333%); } }
@keyframes fuel-level-pulse { from { opacity: .6; } to { opacity: 1; } }
@keyframes fuel-level-appear { from { opacity: 0; } to { opacity: 1; } }
.fuel-level-chart-box { position: relative; }
.fuel-level-reload { position: absolute; top: 0; left: 0; right: 0; z-index: 4; }
.fuel-level-reload .fuel-level-progress {
  position: relative; border-radius: 0; opacity: 1;
  animation: fuel-level-appear var(--motion-fast) var(--ease-out) var(--motion-progress-delay) both;
}
.fuel-level-chart-box.is-reloading .fuel-level-result {
  opacity: .55; pointer-events: none; transition: opacity var(--motion-fast) var(--ease-out);
  transition-delay: var(--motion-progress-delay);
}
.fuel-level-skeleton { display: flex; flex-direction: column; gap: 10px; }
.fuel-level-skeleton-bone {
  border-radius: var(--radius-sm); background: var(--bg-sunken);
  animation: fuel-level-pulse 1.4s var(--ease-in-out) infinite alternate;
}
.fuel-level-skeleton-toolbar { width: 62%; }
.fuel-level-skeleton-legend { width: 44%; border-radius: 999px; }
.fuel-level-loading-status {
  position: absolute; width: 1px; height: 1px; min-height: 0; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.fuel-level-error { min-height: 724px; }
.fuel-level-report-kpis .k-value { min-height: 1.2em; }
@media (max-width: 900px) {
  .fuel-level-toolbar { align-items: stretch; }
  .fuel-level-detail-status { margin-left: 0; flex-basis: 100%; }
  .fuel-level-legend { flex-direction: column; align-items: stretch; }
  .fuel-level-legend-item { border-radius: var(--radius-sm); }
  .fuel-level-compare-top { grid-template-columns: 1fr; }
  .fuel-level-gauge-svg { width: 200px; }
  .fuel-level-detail-list { grid-template-columns: 1fr; gap: 2px; }
  .fuel-level-detail-list dd { margin-bottom: 6px; }
}
/* Reduced motion — мягче, а не ноль: остаются смены прозрачности и цвета, без сдвигов и масштаба. */
@media (prefers-reduced-motion: reduce) {
  .fuel-level-result *, .fuel-level-chart-box * {
    transition-property: opacity, color, background-color, border-color !important;
    animation: none !important;
  }
  .fuel-level-marker:active .fuel-level-marker-body,
  button.fuel-level-legend-item:active,
  .fuel-level-residual-dot:hover { transform: none; }
  .fuel-level-progress-bar { width: 100%; animation: fuel-level-reduced-pulse 1.6s ease-in-out infinite alternate !important; }
  .fuel-level-reload .fuel-level-progress {
    animation: fuel-level-appear var(--motion-fast) linear var(--motion-progress-delay) both !important;
  }
  .fuel-level-skeleton-bone { opacity: .8; }
}
@keyframes fuel-level-reduced-pulse { from { opacity: .35; } to { opacity: .8; } }
.connection-chart-box { min-width: 0; overflow: hidden; }
.connection-chart-result { display: flex; flex-direction: column; gap: 10px; }
.connection-chart-scroll { width: 100%; overflow-x: auto; }
.connection-chart-svg {
  display: block; width: 100%; min-width: 780px; height: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.connection-chart-band { opacity: .48; }
.connection-chart-band-label,
.connection-chart-axis-label { fill: var(--text); font-size: 12px; }
.connection-chart-band-label { font-weight: 700; }
.connection-chart-axis-title { fill: var(--text); font-size: 13px; font-weight: 700; }
.connection-chart-grid {
  stroke: color-mix(in srgb, var(--text) 25%, transparent); stroke-width: 1;
  stroke-dasharray: 5 5; vector-effect: non-scaling-stroke;
}
.connection-chart-axis { stroke: var(--text); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.connection-chart-line {
  stroke: var(--accent); stroke-width: 3; fill: none; vector-effect: non-scaling-stroke;
}
.connection-chart-gap { stroke: var(--danger); stroke-dasharray: 9 7; }
.connection-chart-point { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }
.connection-chart-legend { display: flex; align-items: center; gap: 8px; }
.connection-chart-gap-swatch {
  width: 34px; height: 0; border-top: 3px dashed var(--danger); flex: 0 0 auto;
}
.connection-chart-quality-swatch {
  width: 34px; height: 0; border-top: 3px solid var(--accent); flex: 0 0 auto;
}
.connection-mode-switch { justify-content: flex-start; }
.intake-fuel-report-table table { min-width: 1050px; }
.intake-fuel-filter-grid { grid-template-columns: repeat(4, minmax(180px, 1fr)); }
.office-action-log-filter { align-items: end; justify-content: flex-start; margin: 12px 0; }
.office-action-log-filter .f-field { min-width: 180px; }
.office-action-log-status { margin: 8px 0; }
.office-action-log-table table { min-width: 980px; }
.office-action-log-table th:first-child { width: 76px; }
.office-action-log-table th:nth-child(2) { width: 178px; }
.office-action-log-table th:nth-child(3) { width: 210px; }
.office-action-log-table th:nth-child(4) { width: 150px; }
.office-software-monitor-status { margin: 10px 0; }
.office-software-monitor-table table { min-width: 900px; }
.office-monitor-sort { appearance: none; border: 0; background: transparent; color: inherit;
  font: inherit; font-weight: 700; padding: 6px 8px; width: 100%; text-align: left; cursor: pointer; }
.office-monitor-sort:hover { color: var(--accent); }
.office-monitor-sort.active { background: var(--accent-weak); color: var(--accent-ink); border-radius: 6px; }
.proxy-connections-filter { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin: 12px 0; }
.proxy-connections-filter .f-field { min-width: 170px; }
.proxy-connections-filter .f-field:nth-child(4) { min-width: 240px; }
.proxy-connections-filter-actions { display: flex; align-items: end; padding-bottom: 2px; }
.proxy-connections-status { display: grid; gap: 4px; margin: 8px 0 12px; }
.proxy-connections-lookup { margin: 8px 0 12px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); }
.proxy-connections-title { margin: 16px 0 6px; font-size: 14px; }
.proxy-connections-table table { min-width: 980px; }
.proxy-connections-table td { vertical-align: top; }
.office-action-description { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 320px; }
.journal-table { min-width: 1180px; }
.journal-table .row-warn td { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.journal-raw summary { cursor: pointer; font-weight: 600; }
.journal-raw[open] summary { margin-bottom: 6px; }
.journal-detail { max-width: 520px; white-space: pre-wrap; overflow-wrap: anywhere; }
.report-organization-header {
  display: grid; grid-template-columns: minmax(240px, 3fr) minmax(180px, 2fr);
  gap: 8px 20px; padding: 18px 20px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); white-space: pre-wrap;
}
.report-organization-logo { color: var(--text-mut); align-self: center; }
.report-organization-right { text-align: right; }
.report-organization-name { grid-column: 1 / -1; font-weight: 700; }
.report-organization-bottom { grid-column: 1 / -1; text-align: center; }

/* ===================================================================
   Responsive
   =================================================================== */
@media (max-width: 1180px) {
  .topbar .obj-label { display: none; }
}
@media (max-width: 900px) {
  select { min-width: 150px; max-width: 52vw; }
  .topbar { flex-wrap: wrap; padding: 14px 20px; }
  .topbar .brand { flex: 1 1 auto; }
  .topbar-spacer { display: none; }
  .topbar .obj-select { flex: 0 1 210px; }
  .topbar .obj-select select { width: 100%; max-width: none; }
  .segment-inner { padding: 8px 14px; }
}
@media (max-width: 560px) {
  .view { padding: 20px 14px 32px; }
  .topbar { padding: 14px; gap: 8px; }
  .segment { top: auto; }
  .topbar #logoutBtn { font-size: 12px; }
  .topline-logo { width: 200px; }
  .app-brand-footer { padding: 0 14px 16px; }
  .obj-label { display: none; }
  .obj-select { flex: 1 1 auto; }
  .obj-select select { width: 100%; min-width: 0; max-width: none; }
  .btn-txt { display: none; }
  .segment-inner {
    display: grid; grid-template-columns: repeat(5, minmax(100px, 1fr)); gap: 4px;
    padding: 6px 8px; overflow-x: auto; scroll-padding-inline: 8px;
  }
  .seg-btn {
    flex-direction: column; gap: 2px; width: 100%; min-width: 0; min-height: 56px;
    padding: 6px 4px; font-size: 11px; line-height: 1.2;
  }
  .seg-btn .seg-ico { width: 19px; height: 19px; }
  .seg-btn > span:last-child { max-width: 100%; }
  .settings-grid, .settings-grid.stubs { grid-template-columns: 1fr; }
  .controller-config-truth { align-items: flex-start; flex-direction: column; }
  .lic-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 24px; }
  select, input:not([type="checkbox"]):not([type="radio"]), textarea { font-size: 16px; }
  .btn-sm { min-height: 44px; }
  .form-grid { grid-template-columns: 1fr; }
  .report-filter-grid { grid-template-columns: 1fr; }
  .intake-fuel-filter-grid { grid-template-columns: 1fr; }
  .report-direction-control { flex: 1 1 100%; justify-content: space-between; }
  .report-sort-direction { flex: 1 1 auto; min-width: 0; }
  .report-filter-actions .report-page-size { margin-left: 0; }
  .report-pager { justify-content: center; }
  .live-config-grid { grid-template-columns: 1fr; }
  .perm-list { grid-template-columns: 1fr; }
  .users-toolbar { gap: 10px; }
  .users-search-wrap { flex: 1 1 100%; max-width: none; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .btn { flex: 1 1 auto; justify-content: center; }
  .setting-actions .btn { flex: 1 1 150px; white-space: normal; text-align: center; }
  .modal-body .mgr-toolbar > .f-input { flex: 1 1 100%; max-width: none; }
  .modal-body .mgr-toolbar > .btn { flex: 1 1 140px; justify-content: center; }
  .modal-foot > .btn { flex: 1 1 130px; justify-content: center; }
  .sec-row > .sec-cell.grow, .sec-row > .tank-level-meter-cell { flex: 1 1 100%; }
  .sec-row > .icon-btn { margin-left: auto; }
  .controller-read-job { padding: 13px; }
  .controller-read-job-head { gap: 8px; }
  .controller-read-job-title { font-size: 14px; }
  details > summary { min-height: 44px; }
  .autopoll-results > summary { display: flex; align-items: center; }
  .modal-overlay { padding: 0; }
  .modal-card, .modal-card.wide { max-width: none; min-height: 100%; max-height: 100%; border-radius: 0; border: none; }
  .tank-sections-title { align-items: flex-start; flex-direction: column; }
  .tank-sections-actions { align-items: flex-start; justify-content: flex-start; width: 100%; }
  .sec-row { flex-wrap: wrap; }
  .sec-cell, .sec-cell.narrow, .sec-cell.grow { flex: 1 1 45%; }
  .tank-communication-grid { grid-template-columns: 1fr; }
  .modal-head { border-radius: 0; }
}

@media (max-width: 360px) {
  .report-datetime-split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .modem-config-head { display: none; }
  .modem-config-row { display: block; padding: 8px 11px; }
  .modem-config-head > div, .modem-config-row > div { padding: 5px 0; }
  .modem-config-row > div + div { border-left: none; }
  .modem-config-label { color: var(--text); padding-bottom: 7px !important; }
  .modem-config-value, .modem-config-status {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    text-align: right;
  }
  .modem-config-value::before, .modem-config-status::before {
    content: attr(data-column); color: var(--text-mut); font-family: var(--font-sans);
    font-size: 13px; font-weight: 600; line-height: 1.5; text-align: left;
  }
  .trk-dispenser-card > summary {
    align-items: flex-start; flex-wrap: wrap;
  }
  .trk-dispenser-title { flex-basis: 100%; }
  .trk-dispenser-state { flex: 1 1 100%; }
  .trk-reserve-badge { max-width: 100%; }
  .ethernet-io-device > summary { align-items: flex-start; flex-wrap: wrap; }
  .ethernet-io-device-title, .ethernet-io-device-state { flex: 1 1 100%; }
  .ethernet-io-device > summary .badge {
    max-width: 100%; white-space: normal; line-height: 1.25;
  }
  .hardware-config-sources { flex-direction: column; }
  .hardware-config-sources > span { flex-basis: auto; width: 100%; }
  .controller-clock-grid { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .controller-clock-grid .mono, .controller-clock-grid .tabular { margin-bottom: 8px; }
  .grad-table-meta { grid-template-columns: minmax(0, 1fr); }
}
.journal-column-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px 18px;
  margin-top:14px;
}
.journal-column-choice{
  display:flex;
  align-items:center;
  gap:9px;
  min-width:0;
  font-family:var(--font-sans);
  font-size:13px;
}
.journal-column-choice input{margin:0;flex:0 0 auto}
/* Controller journal: near full-screen card, compact filter bars, the table takes the rest. */
.modal-card.wide.full { max-width: min(1680px, 100%); height: calc(100vh - 48px); max-height: calc(100vh - 48px); }
.modal-overlay:has(.modal-card.full) { padding: 24px 16px; }
.modal-card.full .modal-head { padding: 12px 20px; }
.modal-card.full .modal-foot { padding: 10px 20px; justify-content: space-between; }
.modal-body.controller-journal { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px 20px; overflow: hidden; }
.controller-journal-form { display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; }
.controller-journal-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; min-width: 0; }
.controller-journal-bar > .f-field, .controller-journal-bar .controller-journal-filters > .f-field { margin: 0; min-width: 0; gap: 4px; }
.controller-journal-bar .f-input { width: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.controller-journal-bar .controller-journal-filters { flex: 1 1 420px; flex-wrap: nowrap; }
.controller-journal-filters > .f-field:first-child { flex: 1 1 260px; }
.controller-journal-filters .controller-journal-search { width: 100%; }
.controller-journal-segment { display: inline-flex; flex-wrap: wrap; gap: 4px; align-self: flex-end; }
.controller-journal-period { display: flex; gap: 8px; align-items: flex-end; }
.controller-journal-period .f-field { margin: 0; gap: 4px; }
.controller-journal-period input { width: 200px; }
.controller-journal-note { display: block; margin: 0; }
.controller-journal .journal-table-wrap { flex: 1 1 auto; min-height: 180px; max-height: none; margin: 0; overflow: auto; }
.controller-journal .journal-table-wrap.is-loading table { opacity: .55; }
.controller-journal-table thead th { position: sticky; top: 0; z-index: 2; background: var(--card); box-shadow: inset 0 -1px 0 var(--border); }
.controller-journal .controller-journal-columns { position: relative; }
.controller-journal .controller-journal-columns > summary {
  list-style: none; padding: 7px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); font-weight: 600; white-space: nowrap;
}
.controller-journal .controller-journal-columns > summary::-webkit-details-marker { display: none; }
.controller-journal .controller-journal-columns[open] > .journal-column-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(820px, calc(100vw - 64px));
  max-height: 60vh; overflow: auto; padding: 12px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.controller-journal-export { align-self: flex-end; }
.controller-journal-pager { display: flex; align-items: center; gap: 12px; margin: 0; }
.controller-journal-status { min-width: 220px; text-align: center; }
.controller-journal-columns > summary, .journal-read-details > summary { cursor: pointer; padding: 10px 0; }
.controller-journal-columns .journal-column-grid { padding: 8px 0; }
.controller-journal .controller-journal-table { min-width: 680px; width: 100%; }
.controller-journal-table th:nth-child(n) { width: auto; }
.controller-journal-table td { vertical-align: top; }
.controller-journal-table .journal-detail { min-width: 240px; max-width: 400px; white-space: pre-wrap; overflow-wrap: anywhere; }
.controller-journal-sort { color: inherit; font: inherit; text-align: left; border: 0; background: none; cursor: pointer; padding: 8px 0; }
.controller-journal-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.journal-read-details { min-width: 200px; }
.journal-read-details dl { display: grid; grid-template-columns: minmax(110px,1fr) minmax(60px,1fr); gap: 6px 12px; margin: 0 0 8px; }
.journal-read-details dt { color: var(--text-mut); }
.journal-read-details dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width:720px) {
  .controller-journal-period { flex-wrap: wrap; }
  .controller-journal-period input { width: 100%; }
  .controller-journal-bar .controller-journal-filters { flex-wrap: wrap; }
  .modal-card.wide.full { height: auto; }
  .modal-body.controller-journal { overflow-y: auto; }
  .controller-journal-pager { flex-wrap: wrap; }
}
.controller-journal-report-table td:not(.journal-detail),
.controller-journal-report-table th{white-space:nowrap}
.controller-journal-report-table .journal-detail{min-width:240px;max-width:420px;white-space:pre-wrap;overflow-wrap:anywhere}
.controller-journal-report-table .journal-sort-active{
  color:var(--accent);
  background:color-mix(in srgb,var(--accent) 10%,transparent);
}
.controller-journal-columns > summary { font-weight: 600; }
.report-filter-card .controller-journal-columns { margin-top: 12px; }
.journal-column-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 10px; }
.journal-column-groups { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 12px; }
.journal-column-group { border: 1px solid var(--border); border-radius: 8px; margin: 0; padding: 6px 12px 10px; min-width: 0; }
.journal-column-group > legend { padding: 0 4px; font-size: 13px; font-weight: 600; }
.journal-column-group .journal-column-grid { grid-template-columns: minmax(0,1fr); gap: 6px; margin-top: 4px; padding: 0; }
.controller-journal-filters > .f-field:first-child { flex: 3 1 260px; }
@media (max-width:720px){.journal-column-grid{grid-template-columns:1fr}}

@media (max-width: 860px) {
  .controller-settings-toolbar { align-items: stretch; }
  .controller-settings-toolbar > .row-actions { flex: 1 1 100%; justify-content: flex-start; }
  .controller-settings-workspace { grid-template-columns: 1fr; gap: 12px; }
  .controller-settings-workspace > .controller-config-tabs {
    position: static; flex-direction: row;
  }
  .controller-settings-workspace > .controller-config-tabs .controller-config-tab {
    width: auto; flex: 0 0 auto; white-space: nowrap;
  }
  .controller-directory-settings-list { grid-template-columns: 1fr; }
  .tank-section-main-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .controller-settings-workspace > .controller-config-tabs { display: none; }
  .controller-settings-group-select { display: grid; gap: 6px; }
  .controller-settings-group-select > .f-input { min-height: 44px; font-size: 16px; }
}

@media (max-width: 560px) {
  .controller-meter-summary-list,
  .tank-section-main-grid,
  .tank-section-advanced-grid { grid-template-columns: 1fr; }
}

/* Connection profiles: bounded workspace, not the generic directory layout. */
.modal-card.wide.connection-profile-manager {
  max-width: min(1180px, calc(100vw - 48px));
  height: min(760px, calc(100dvh - 48px));
  min-height: 0;
  max-height: calc(100dvh - 48px);
}
.connection-profile-manager > .modal-head { padding: 12px 20px; }
.connection-profile-manager > .modal-foot { padding: 12px 20px; }
.modal-body.connection-profile-manager-body {
  padding: 16px 20px; gap: 12px; overflow: hidden; min-width: 0;
}
.connection-profile-manager-body > .manager-note { padding: 8px 10px; flex: 0 0 auto; }
.connection-profile-manager-body > .inline-warn:not(.hidden) {
  flex: 0 1 auto; max-height: 160px; overflow: auto; overscroll-behavior: contain;
}
.connection-profile-manager-body .connection-profile-toolbar {
  display: grid; grid-template-columns: auto minmax(160px, 1fr) auto auto;
  align-items: center; gap: 10px; margin: 0; flex: 0 0 auto;
}
.connection-profile-toolbar > .f-input { min-width: 0; max-width: none; width: 100%; }
.connection-profile-toolbar > .btn { white-space: nowrap; }
.connection-profile-list {
  flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain;
  box-shadow: none; scroll-padding-block: 12px;
}
.connection-profile-list table { width: 100%; min-width: 0; table-layout: fixed; }
.connection-profile-list th, .connection-profile-list td {
  padding: 10px 9px; white-space: normal; overflow-wrap: anywhere; line-height: 1.4;
}
.connection-profile-list th:first-child { width: 42px; }
.connection-profile-list th:nth-child(2) { width: 21%; }
.connection-profile-list th:nth-child(3) { width: 9%; }
.connection-profile-list th:nth-child(4) { width: 17%; }
.connection-profile-list th:nth-child(6) { width: 12%; }
.connection-profile-list th:last-child { width: 170px; }
.connection-profile-list td:nth-child(2) { font-weight: 600; }
.connection-profile-list td:nth-child(6) { font-size: 12px; color: var(--text-dim); }
.connection-profile-list .row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.connection-profile-list .row-actions > .btn { min-height: 32px; white-space: nowrap; }
@media (max-width: 900px) {
  .connection-profile-list th:nth-child(2) { width: 19%; }
  .connection-profile-list th:nth-child(4) { width: 16%; }
  .connection-profile-list th:last-child { width: 94px; }
  .connection-profile-list .row-actions { flex-direction: column; align-items: stretch; }
}
@media (max-width: 760px) {
  .modal-card.wide.connection-profile-manager {
    max-width: none; width: 100%; height: 100dvh; max-height: 100dvh;
  }
  .modal-body.connection-profile-manager-body { padding: 12px; gap: 10px; }
  .connection-profile-manager > .modal-head, .connection-profile-manager > .modal-foot { padding: 10px 12px; }
  .connection-profile-manager-body .connection-profile-toolbar { grid-template-columns: 1fr 1fr; gap: 8px; }
  .connection-profile-toolbar > .f-input { grid-column: 1 / -1; grid-row: 2; }
  .connection-profile-toolbar > .muted { grid-column: 1 / -1; }
  .connection-profile-list table, .connection-profile-list tbody, .connection-profile-list tr, .connection-profile-list td { display: block; }
  .connection-profile-list thead {
    position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
  .connection-profile-list tr { padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .connection-profile-list td { padding: 4px 0; border: 0; }
  .connection-profile-list td:first-child { font-size: 11px; color: var(--text-mut); }
  .connection-profile-list tr:not(.t-empty) td:first-child::before { content: 'ID '; }
  .connection-profile-list td:nth-child(2) { font-size: 14px; }
  .connection-profile-list td:nth-child(4)::before { content: 'Адрес / порт: '; font-family: var(--font-sans); }
  .connection-profile-list td:nth-child(5) { color: var(--text-dim); }
  .connection-profile-list .row-actions { flex-direction: row; justify-content: flex-start; padding-top: 6px; }
  .connection-profile-list .row-actions > .btn { min-height: 36px; }
}

/* One pagination surface for reports, journals and card directories. Repeated
   navigation deliberately has no motion; controls and focus stay in place. */
.table-pagination {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 20px; padding: 16px 0 4px; min-width: 0;
  font-family: var(--font-sans); font-size: 13px; font-variant-numeric: tabular-nums;
}
.table-pagination-info {
  flex: 1 1 150px; min-width: 0; text-align: left; color: var(--text-dim);
  line-height: 1.5; overflow-wrap: anywhere; order: 0;
}
.table-pagination-navigation, .table-pagination-numbers {
  display: flex; align-items: center; gap: 4px; flex: 0 0 auto;
}
.table-pagination .btn {
  min-height: 36px; height: 36px; margin: 0; padding: 0 10px;
  flex: 0 0 auto; border-radius: 8px; font-family: var(--font-sans);
  font-size: 13px; font-weight: 500; line-height: 1; white-space: nowrap;
  transition: none; transform: none; box-shadow: none;
}
.table-pagination .table-pagination-number, .table-pagination .table-pagination-arrow { min-width: 36px; }
.table-pagination .table-pagination-arrow { width: 36px; padding: 0; }
.table-pagination .btn[aria-current="page"] {
  background: var(--action-bg); border-color: var(--action-bg); color: var(--action-ink); font-weight: 600;
}
.table-pagination .btn:disabled { opacity: .45; cursor: not-allowed; }
.table-pagination .btn:focus-visible, .table-pagination-input:focus-visible {
  outline: 2px solid var(--accent-ink); outline-offset: 3px;
}
.table-pagination-icon { display: inline-flex; align-items: center; justify-content: center; }
.table-pagination-icon svg { display: block; width: 18px; height: 18px; }
.table-pagination-ellipsis { display: grid; place-items: center; width: 22px; color: var(--text-dim); }
.table-pagination-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.table-pagination-jump, .table-pagination-jump-label {
  display: flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap;
}
.table-pagination-jump { flex: 0 0 auto; }
.table-pagination-jump[hidden] { display: none; }
.table-pagination .table-pagination-jump input.table-pagination-input[type="text"] {
  width: 62px; min-width: 0; min-height: 36px; height: 36px; border: 1px solid var(--control-border);
  border-radius: 8px; padding: 0 6px; text-align: center;
  background: var(--card); color: var(--text); font-size: 14px;
  font-family: var(--font-sans); font-variant-numeric: tabular-nums; transition: none;
}
.table-pagination-input[aria-invalid="true"] { border-color: var(--danger); }
.table-pagination-count { color: var(--text-dim); }
.directory-page-controls { gap: 12px 20px; }
.directory-page-controls > .table-pagination { flex: 1 1 auto; padding: 0; }
.directory-page-size-label { flex: 0 0 auto; }
.controller-journal-pager.table-pagination { flex: 1 1 auto; padding: 0; margin: 0; }
@media (hover: hover) and (pointer: fine) {
  .table-pagination .btn:not(:disabled):not([aria-current="page"]):hover {
    background: var(--hover); border-color: var(--control-border); color: var(--text);
  }
}
@media (max-width: 760px) {
  .table-pagination { justify-content: center; gap: 12px; }
  .table-pagination-info { flex: 1 1 100%; text-align: center; order: 0; }
  .table-pagination-navigation { order: 1; }
  .table-pagination-jump { order: 2; }
  .directory-page-controls { justify-content: center; }
  .directory-page-controls > .table-pagination { flex-basis: 100%; }
}
@media (max-width: 600px) {
  .table-pagination [data-mobile-hidden="true"] { display: none; }
  .table-pagination .btn { min-height: 44px; height: 44px; }
  .table-pagination .table-pagination-number, .table-pagination .table-pagination-arrow { min-width: 44px; }
  .table-pagination .table-pagination-arrow { width: 44px; }
  .table-pagination .table-pagination-jump input.table-pagination-input[type="text"] { min-height: 44px; height: 44px; font-size: 16px; }
  .table-pagination-navigation { flex-basis: 100%; justify-content: center; }
}

/* Interactive history charts use the existing light design tokens. */
.calibration-workspace-host { min-width: 0; }
.calibration-workspace-host[hidden] { display: none; }
.calibration-workspace { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; min-width: 0; }
.calibration-workspace h4, .calibration-workspace h5 { margin: 0 0 10px; font: 600 15px/1.4 var(--font-sans); }
.calibration-workspace > [role="status"] { margin: 10px 0; overflow-wrap: anywhere; }
.calibration-tabs, .calibration-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.calibration-tabs .btn[aria-pressed="true"] { background: var(--text); color: var(--card); }
.calibration-workspace .btn { min-height: 40px; max-width: 100%; height: auto; white-space: normal; transition: none; transform: none; }
.calibration-workspace :is(button,input):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.calibration-table-scroll { max-width: 100%; max-height: 440px; overflow: auto; }
.calibration-workspace .calibration-point-input { min-width: 88px; width: 100%; min-height: 38px; padding: 6px 8px; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.calibration-workspace .level-meter-grad-table { width: 100%; min-width: 340px; }
.calibration-reason { display: grid; gap: 6px; margin: 16px 0 8px; font-size: 13px; }
.calibration-period { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; margin: 14px 0; }
.calibration-period label { display: grid; gap: 6px; min-width: 0; }
.calibration-period input { min-width: 0; width: 100%; }
.calibration-history-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.calibration-history-row > div { min-width: 0; }
.calibration-history-row > .btn { flex: 0 0 auto; }
.calibration-preview, .calibration-version-detail { padding: 14px; margin: 14px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev); min-width: 0; }
.calibration-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.calibration-summary div { min-width: 0; }
.calibration-summary dt { font-size: 12px; color: var(--text-dim); }
.calibration-summary dd { margin: 3px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .calibration-period { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .calibration-workspace .btn, .calibration-workspace input { min-height: 44px; }
  .calibration-workspace .f-input { font-size: 16px; }
  .calibration-history-row { align-items: flex-start; }
}
@media (max-width: 420px) {
  .calibration-period { grid-template-columns: minmax(0, 1fr); }
}
.report-history-chart { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.report-history-chart-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.report-history-chart-toolbar .btn { min-width: 36px; min-height: 36px; transition: none; }
.report-history-chart-toolbar .btn:active { transform: none; }
.report-history-chart-range { color: var(--text-dim); font-variant-numeric: tabular-nums; font-size: 13px; }
.report-history-chart-plot { min-width: 0; overflow: hidden; border-radius: var(--radius-sm); }
.report-history-chart-plot:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.report-history-chart :is(.level-meter-chart-svg, .connection-chart-svg) { min-width: 0; width: 100%; height: auto; display: block; }
.report-history-chart-inspection { min-height: 42px; padding: 10px 12px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.report-history-chart-table { min-width: 0; }
.report-history-chart-data > summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.report-history-chart-data > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.report-history-chart-table .table-wrap { max-height: 320px; }
.report-history-chart-selected line { stroke: var(--text-dim); stroke-width: 1; stroke-dasharray: 4 3; }
.report-history-chart-selected circle { stroke: var(--bg); stroke-width: 2; }
.report-history-chart .level-meter-chart-legend-item { cursor: pointer; text-align: left; font: inherit; color: var(--text); transition: none; }
.report-history-chart .level-meter-chart-legend-item:active { transform: none; }
.report-history-chart .level-meter-chart-legend-item[aria-pressed="false"] { opacity: .65; text-decoration: line-through; }
.report-history-chart :is(.btn, .level-meter-chart-legend-item):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 600px) {
  .report-history-chart-toolbar .btn { min-height: 44px; min-width: 44px; }
  .report-history-chart .level-meter-chart-legend { grid-template-columns: minmax(0, 1fr); }
  .report-catalog-item { min-height: 44px; }
}

/* Literal reference-search results: independent of native datalist filtering. */
.filling-reference-picker { position: relative; min-width: 0; }
.filling-reference-options { position: absolute; inset: 100% 0 auto; z-index: 100; max-height: 240px; overflow-y: auto; margin-top: 4px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); box-shadow: var(--shadow-pop); }
.filling-reference-options[hidden] { display: none; }
.filling-reference-option { display: block; width: 100%; min-height: 36px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.filling-reference-option:hover, .filling-reference-option[aria-selected="true"] { background: var(--bg-elev); }
.filling-reference-option:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 640px) { .filling-reference-option { min-height: 44px; } }

/* Read result warning preserves successful raw coverage. */
.progressbar .bar.warn { background: var(--warn); }

/* One visible read-status owner per controller at every viewport. */
.controller-workspace .controller-action .read-prog[hidden] { display: none; }
