/* GOAT dashboard — built on cairn-ui tokens (vendor/cairn-ui/tokens.css) with Keshi's sage as the one brand
   accent and a blue→violet→pink data arc that never reads as status (status = up / warn / down only). */
@layer tokens, base, components, page;

@layer page {
  :root, [data-theme="light"] {
    --accent: #5F6E64;          /* keshi sage-ink: text-safe on light */
    --accent-fill: #87998E;     /* keshi sage: fills only */
    --accent-tint: rgba(95, 110, 100, 0.12);
    --s1: #3A6CCE;              /* oklch(0.55 0.16 262) */
    --s2: #8156C0;              /* oklch(0.55 0.16 300) */
    --s3: #AF4387;              /* oklch(0.55 0.16 345) */
    --s4: #B4683A;              /* peach end of the arc, darker for contrast */
    --glass: rgba(244, 244, 241, 0.78);
    --aura-a: rgba(58, 108, 206, 0.10);
    --aura-b: rgba(129, 86, 192, 0.08);
    --aura-c: rgba(135, 153, 142, 0.12);
    --switch-on: #1A8750;       /* "on" green from the --ui-up family: 4.4:1 against the knob, 4.5:1 on white */
    /* motion: UI feedback uses --ui-dur-1 (120 ms) / --ui-dur-2 (200 ms) with --ui-ease (ease-out);
       --dur-data is for values that tween on refresh (meter arcs) */
    --dur-data: 320ms;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --accent: #ADB4AA; --accent-fill: #87998E; --accent-tint: rgba(173, 180, 170, 0.12);
      --s1: #7DAAFD; --s2: #B897F0; --s3: #E488BE; --s4: #F2A97E;
      --glass: rgba(11, 11, 10, 0.72);
      --aura-a: rgba(125, 170, 253, 0.09); --aura-b: rgba(184, 151, 240, 0.07); --aura-c: rgba(135, 153, 142, 0.10);
      --switch-on: #2B9C61;     /* 3.4:1 against the knob, 5.2:1 on the dark surface, 3.3:1 against the off track */
    }
  }
  [data-theme="dark"] {
    --accent: #ADB4AA; --accent-fill: #87998E; --accent-tint: rgba(173, 180, 170, 0.12);
    --s1: #7DAAFD; --s2: #B897F0; --s3: #E488BE; --s4: #F2A97E;
    --glass: rgba(11, 11, 10, 0.72);
    --aura-a: rgba(125, 170, 253, 0.09); --aura-b: rgba(184, 151, 240, 0.07); --aura-c: rgba(135, 153, 142, 0.10);
    --switch-on: #2B9C61;
  }
}

@layer base {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
  body {
    margin: 0; min-height: 100vh; background: var(--ui-bg); color: var(--ui-ink);
    font: 400 var(--ui-text-sm) / var(--ui-leading-body) var(--ui-font-sans);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    font-feature-settings: "ss01", "cv11";
  }
  a { color: inherit; text-decoration: none; }
  button, input { font: inherit; color: inherit; }
  h1, h2, h3 { margin: 0; font-weight: 500; line-height: var(--ui-leading-tight); letter-spacing: var(--ui-track-heading); text-wrap: balance; }
  ::selection { background: var(--ui-ink); color: var(--ui-bg); }
  :focus-visible { outline: 2px solid var(--ui-ink); outline-offset: 2px; border-radius: var(--ui-radius-sm); }
  .mono { font-family: var(--ui-font-mono); font-variant-numeric: tabular-nums; }
  .num { font-variant-numeric: tabular-nums; }
  .muted { color: var(--ui-muted); }
  .label { font: 500 var(--ui-text-2xs) / var(--ui-leading-body) var(--ui-font-mono); letter-spacing: var(--ui-track-label); text-transform: uppercase; color: var(--ui-muted); }
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  [hidden] { display: none !important; }
}

@layer components {
  /* ---------------------------------------------------------------- layout */
  :root { --page-max: 1360px; --pad: clamp(16px, 4vw, 32px); }
  .wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--pad); }

  /* ---------------------------------------------------------------- header */
  .top {
    position: sticky; top: 0; z-index: var(--ui-z-sticky);
    background: var(--glass); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid var(--ui-line);
  }
  .top .wrap { display: flex; align-items: center; gap: var(--ui-space-5); height: 60px; }
  .brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; letter-spacing: 0.01em; }
  .brand .mark { width: 28px; height: 28px; flex: none; color: var(--ui-ink); overflow: visible; }
  .mark .horn { stroke: var(--accent-fill); transform-origin: 16px 11px; transition: transform var(--ui-dur-2) var(--ui-ease); }
  .mark .face { fill: currentColor; }
  .mark .ears { stroke: currentColor; }
  .brand:hover .mark .horn { transform: translateY(-1.5px); }
  .brand .word { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
  .nav { display: flex; gap: 2px; }
  .nav a {
    position: relative; display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px; border-radius: var(--ui-radius-pill); color: var(--ui-ink-2); font-weight: 500;
    transition: color var(--ui-dur-1) var(--ui-ease), background-color var(--ui-dur-2) var(--ui-ease);
  }
  .nav a:hover { color: var(--ui-ink); }
  .nav a[aria-current="page"] { background: var(--ui-sunken); color: var(--ui-ink); }
  .nav a[aria-current="page"]::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: -11px; height: 2px; border-radius: 2px; background: var(--accent-fill);
  }
  .nav .count {
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center;
    font: 600 10.5px/1 var(--ui-font-mono); background: var(--ui-down-tint); color: var(--ui-down);
  }
  .nav .count.warn { background: var(--ui-warn-tint); color: var(--ui-warn); }
  .top .spacer { flex: 1; }
  .pill {
    display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
    border: 1px solid var(--ui-line); border-radius: var(--ui-radius-pill); background: var(--ui-surface);
    color: var(--ui-ink-2); font: 500 var(--ui-text-caption) / normal var(--ui-font-mono); font-variant-numeric: tabular-nums; white-space: nowrap;
  }
  .icon-btn {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid var(--ui-line); background: var(--ui-surface); color: var(--ui-ink-2); cursor: pointer;
    transition: border-color var(--ui-dur-1) var(--ui-ease), color var(--ui-dur-1) var(--ui-ease), background-color var(--ui-dur-1) var(--ui-ease), transform var(--ui-dur-1) var(--ui-ease);
  }
  .icon-btn:hover:not(:disabled) { border-color: var(--ui-line-strong); color: var(--ui-ink); }
  .icon-btn:active:not(:disabled) { transform: scale(0.94); }
  .icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }
  .icon-btn svg { width: 17px; height: 17px; }

  /* user menu (2.4): name + role, Account, Sign out */
  .user-menu { position: relative; flex: none; }
  .um-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; max-width: 220px; padding: 0 9px 0 8px;
    border: 1px solid var(--ui-line); border-radius: var(--ui-radius-pill); background: var(--ui-surface); color: var(--ui-ink-2);
    font: inherit; font-weight: 500; cursor: pointer;
    transition: border-color var(--ui-dur-1) var(--ui-ease), color var(--ui-dur-1) var(--ui-ease);
  }
  .um-btn:hover, .um-btn[aria-expanded="true"] { border-color: var(--ui-line-strong); color: var(--ui-ink); }
  .um-btn .ic { width: 16px; height: 16px; flex: none; }
  .um-btn .ic.um-chev { width: 12px; height: 12px; color: var(--ui-muted); }
  .um-btn[aria-expanded="true"] .um-chev { transform: rotate(180deg); }
  .um-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .um-list {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: var(--ui-z-dropdown); min-width: 210px; max-width: calc(100vw - 2 * var(--pad));
    padding: 6px; border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius-md); background: var(--ui-surface); box-shadow: var(--ui-shadow-2);
  }
  .um-who { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--ui-line); }
  .um-who-name { font-weight: 600; color: var(--ui-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .um-item {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px;
    border: 0; border-radius: var(--ui-radius-sm); background: none; color: var(--ui-ink-2); font: inherit; text-align: left; cursor: pointer;
  }
  .um-item .ic { width: 16px; height: 16px; flex: none; }
  .um-item:hover, .um-item:focus-visible { background: var(--ui-sunken); color: var(--ui-ink); }
  .um-item:focus-visible { outline: 2px solid var(--ui-ink); outline-offset: -2px; }
  @media (max-width: 760px) {
    .um-name { display: none; }
  }
  @media (max-width: 430px) {
    .um-btn { height: 32px; }
  }
  @media (pointer: coarse) {
    .um-btn { min-height: 40px; min-width: 40px; }
  }
  @media (forced-colors: active) {
    .um-btn, .um-list { border: 1px solid CanvasText; }
    .um-item:hover, .um-item:focus-visible { outline: 2px solid Highlight; outline-offset: -2px; }
  }

  /* ---------------------------------------------------------------- dots, badges, buttons */
  .dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: currentColor; }
  .dot.live { animation: live 2.3s var(--ui-ease) infinite; }
  @keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, currentColor 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
  .t-up { color: var(--ui-up); } .t-warn { color: var(--ui-warn); } .t-down { color: var(--ui-down); } .t-mute { color: var(--ui-muted); }

  .badge {
    display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 9px;
    border: 1px solid var(--ui-line); border-radius: var(--ui-radius-pill); background: var(--ui-surface); color: var(--ui-ink-2);
    font-size: 11.5px; font-weight: 500; line-height: 1; letter-spacing: 0.01em; white-space: nowrap;
  }
  .badge.ok { border-color: color-mix(in oklab, var(--ui-up) 35%, var(--ui-line)); background: var(--ui-up-tint); color: var(--ui-up); }
  .badge.warn { border-color: color-mix(in oklab, var(--ui-warn) 35%, var(--ui-line)); background: var(--ui-warn-tint); color: var(--ui-warn); }
  .badge.bad { border-color: color-mix(in oklab, var(--ui-down) 35%, var(--ui-line)); background: var(--ui-down-tint); color: var(--ui-down); }
  .badge.accent { border-color: color-mix(in oklab, var(--accent) 35%, var(--ui-line)); background: var(--accent-tint); color: var(--accent); }
  .badge.sm { min-height: 19px; padding: 0 7px; font-size: 11px; }

  .btn {
    position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 34px; padding: 0 15px; border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius-pill);
    background: transparent; color: var(--ui-ink); font-size: var(--ui-text-xs); font-weight: 500; white-space: nowrap; cursor: pointer;
    transition: transform var(--ui-dur-1) var(--ui-ease), border-color var(--ui-dur-1) var(--ui-ease), color var(--ui-dur-1) var(--ui-ease), background-color var(--ui-dur-1) var(--ui-ease), opacity var(--ui-dur-1) var(--ui-ease);
  }
  .btn:hover:not(:disabled) { border-color: var(--ui-ink); }
  .btn:active:not(:disabled) { transform: scale(0.97); }
  .btn:disabled { opacity: 0.45; cursor: not-allowed; }
  .btn.primary { background: var(--ui-ink); color: var(--ui-bg); border-color: var(--ui-ink); isolation: isolate; }
  .btn.primary::before {      /* keshi fill wipe */
    content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent-fill);
    transform: scaleX(0); transform-origin: right; transition: transform var(--ui-dur-2) var(--ui-ease);
  }
  .btn.primary:hover:not(:disabled)::before { transform: scaleX(1); transform-origin: left; }
  .btn.primary:hover:not(:disabled) { color: #0B0B0A; border-color: var(--accent-fill); }
  .btn.sm { min-height: 26px; padding: 0 10px; font-size: 12px; }

  .seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-pill); background: var(--ui-sunken); }
  .seg button {
    padding: 5px 12px; border: 0; border-radius: var(--ui-radius-pill); background: transparent; color: var(--ui-muted);
    font-size: var(--ui-text-xs); font-weight: 500; cursor: pointer;
    transition: color var(--ui-dur-1) var(--ui-ease), background-color var(--ui-dur-1) var(--ui-ease), box-shadow var(--ui-dur-1) var(--ui-ease), transform var(--ui-dur-1) var(--ui-ease);
  }
  .seg button:hover { color: var(--ui-ink); }
  .seg button:active { transform: scale(0.97); }
  .seg button[aria-pressed="true"] { background: var(--ui-surface); color: var(--ui-ink); box-shadow: var(--ui-shadow-1), 0 0 0 1px var(--ui-line); }

  /* ---------------------------------------------------------------- page head + aura */
  .head { position: relative; padding: 44px 0 28px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; }
  .head h1 { font-size: clamp(30px, 4.2vw, 46px); letter-spacing: var(--ui-track-display); margin-top: 10px; overflow-wrap: anywhere; }
  .head .lede { margin: 12px 0 0; color: var(--ui-ink-2); font-size: var(--ui-text-subhead); max-width: 62ch; }
  .card .spark:empty { height: 0; margin: 0; }
  .head .lede .live-dot.t-down { color: var(--ui-down); }
  .card-id .name.is-label { font-family: var(--ui-font-sans); font-size: 15.5px; letter-spacing: -0.015em; }
  .head .lede .live-dot { color: var(--ui-up); vertical-align: 1px; margin-right: 7px; display: inline-block; }
  .crumb { display: inline-flex; gap: 8px; align-items: center; max-width: 100%; color: var(--ui-muted); font-size: var(--ui-text-xs); }
  .crumb-id { min-width: 0; font-size: 12px; color: var(--ui-ink-2); overflow-wrap: anywhere; }
  .crumb-id:not(:empty)::before { content: "·"; margin-right: 8px; color: var(--ui-faint); }
  .crumb a:hover { color: var(--ui-ink); }
  .head-side { display: flex; align-items: center; gap: 12px; }

  /* fleet ring */
  .fleet-ring { width: 148px; height: 148px; position: relative; }
  .fleet-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
  .fleet-ring .track { fill: none; stroke: var(--ui-line); stroke-width: 9; }
  .fleet-ring .seg-arc { fill: none; stroke-width: 9; stroke-linecap: round; transition: stroke var(--ui-dur-2) var(--ui-ease); }
  .fleet-ring .seg-arc.in { animation: fadein var(--ui-dur-2) var(--ui-ease) both; }
  .fleet-ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
  .fleet-ring .big { font-size: 34px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
  .fleet-ring .small { margin-top: 4px; }

  /* ---------------------------------------------------------------- stat strip */
  .stats { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); border-top: 1px solid var(--ui-line); border-bottom: 1px solid var(--ui-line); }
  .stat { padding: 16px 18px 16px 0; min-width: 0; }
  .stat + .stat { padding-left: 18px; border-left: 1px solid var(--ui-line); }
  .stat .v { margin-top: 6px; font-size: var(--ui-text-stat); font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .stat .v small { font-size: 13px; color: var(--ui-muted); font-weight: 400; margin-left: 3px; letter-spacing: 0; }
  .stat .sub { margin-top: 2px; color: var(--ui-muted); font-size: var(--ui-text-caption); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stat .spark { margin-top: 8px; height: 28px; }

  /* ---------------------------------------------------------------- sections / panels */
  .section { margin-top: 44px; }
  .section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--ui-line); margin-bottom: 16px; }
  .section-head h2 { font-size: 17px; letter-spacing: var(--ui-track-snug); }
  .section-head .aside { color: var(--ui-muted); font-size: var(--ui-text-caption); }
  .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
  .panel { min-width: 0; }
  .panel-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
  .panel-title h3 { font-size: 14px; letter-spacing: var(--ui-track-snug); }
  .panel-title .legend { display: flex; gap: 12px; flex-wrap: wrap; }
  .legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ui-muted); }
  .legend i { width: 10px; height: 2px; border-radius: 2px; background: currentColor; display: inline-block; }
  .legend i.dash { background: repeating-linear-gradient(90deg, currentColor 0 3px, transparent 3px 5px); }

  /* ---------------------------------------------------------------- host cards */
  .hosts { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
  .card {
    position: relative; display: block; padding: 18px 18px 16px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg);
    background: var(--ui-surface); box-shadow: var(--ui-shadow-1); cursor: pointer; overflow: hidden;
    transition: border-color var(--ui-dur-2) var(--ui-ease), box-shadow var(--ui-dur-2) var(--ui-ease), transform var(--ui-dur-2) var(--ui-ease);
  }
  .card::before {        /* keshi top-rule draw on hover */
    content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 100%; background: var(--card-accent, var(--accent-fill));
    transform: scaleX(0); transform-origin: left; transition: transform var(--ui-dur-2) var(--ui-ease);
  }
  @media (hover: hover) {
    .card:hover { border-color: var(--ui-line-2); box-shadow: var(--ui-shadow-2); transform: translateY(-2px); }
    .card:hover::before { transform: scaleX(1); }
  }
  .card:active { transform: scale(0.995); }
  .card[data-status="crit"], .card[data-status="offline"] { --card-accent: var(--ui-down); border-color: color-mix(in oklab, var(--ui-down) 40%, var(--ui-line)); }
  .card[data-status="warn"] { --card-accent: var(--ui-warn); }
  .card-top { display: flex; align-items: center; gap: 12px; }
  .avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ui-ink) 12%, transparent); }
  .card-id { min-width: 0; flex: 1; }
  .card-id .name { font: 500 15px/1.2 var(--ui-font-mono); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card-id .meta { margin-top: 3px; font-size: 12px; color: var(--ui-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 12px; }
  .meter { display: flex; align-items: center; gap: 10px; }
  .meter svg { width: 44px; height: 44px; flex: none; transform: rotate(-90deg); }
  .meter .trk { fill: none; stroke: var(--ui-line); stroke-width: 4; }
  .meter .arc { fill: none; stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset var(--dur-data) var(--ui-ease), stroke var(--ui-dur-2) var(--ui-ease); }
  .meter .mv { font-size: 16px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
  .meter .mv .na + small { visibility: hidden; }
  .meter .mv small { font-size: 11px; color: var(--ui-muted); margin-left: 1px; }
  .meter .ml { font: 500 10px/1.3 var(--ui-font-mono); letter-spacing: 0.08em; color: var(--ui-muted); text-transform: uppercase; }
  .card .spark { height: 42px; margin: 4px -2px 12px; }
  .chips { display: flex; flex-wrap: wrap; gap: 6px; }

  /* ---------------------------------------------------------------- charts */
  .chart { position: relative; height: 210px; }
  .chart.short { height: 160px; }
  .chart svg, .spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
  .chart .grid line { stroke: var(--ui-line); stroke-width: 1; shape-rendering: crispEdges; }
  .chart .axis text { fill: var(--ui-muted); font: 10.5px var(--ui-font-mono); font-variant-numeric: tabular-nums; }
  .chart .thr { stroke-width: 1; stroke-dasharray: 4 4; }
  .line { fill: none; stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
  .line.dash { stroke-dasharray: 5 4; }
  .area { stroke: none; }
  /* first paint of a chart: one short opacity fade, the data is readable at once (no stroke-draw, no stagger) */
  .line.draw, .area.draw { animation: fadein var(--ui-dur-2) var(--ui-ease) both; }
  @keyframes fadein { from { opacity: 0; } }
  .cross { stroke: var(--ui-line-strong); stroke-dasharray: 2 3; stroke-width: 1; }
  .tip {
    position: absolute; z-index: 5; pointer-events: none; padding: 8px 10px; min-width: 130px;
    background: var(--ui-surface); border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius-md); box-shadow: var(--ui-shadow-2);
    font-size: 12px; opacity: 0; transform: translateY(4px); transition: opacity var(--ui-dur-1) var(--ui-ease), transform var(--ui-dur-2) var(--ui-ease);
  }
  .tip.on { opacity: 1; transform: none; }
  .tip .tt { color: var(--ui-muted); font: 11px var(--ui-font-mono); margin-bottom: 4px; }
  .tip .tr { display: flex; align-items: center; gap: 8px; justify-content: space-between; white-space: nowrap; }
  .tip .tr b { font-weight: 500; font-variant-numeric: tabular-nums; }
  .tip .sw { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }
  .chart .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ui-muted); font-size: 12px; }
  /* 2.4 (package D): a chart with legend and table view (lineChart opts.legend / opts.table), keyboard cursor */
  .lc-plot:focus-visible { outline: 2px solid var(--ui-ink); outline-offset: 4px; border-radius: var(--ui-radius-sm); }
  .lc-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
  .lc-key {
    display: inline-flex; align-items: center; gap: 7px; min-height: 28px; max-width: 100%; padding: 0 10px; border: 1px solid var(--ui-line);
    border-radius: var(--ui-radius-pill); background: var(--ui-surface); color: var(--ui-ink-2); font: inherit; font-size: 12px; cursor: pointer;
  }
  .lc-key:hover { border-color: var(--ui-line-strong); color: var(--ui-ink); }
  .lc-key:focus-visible { outline: 2px solid var(--ui-ink); outline-offset: 2px; }
  .lc-key[aria-pressed="false"] { color: var(--ui-muted); background: transparent; border-style: dashed; }
  .lc-key[aria-pressed="false"] .lc-sw, .lc-key[aria-pressed="false"] .lc-val { opacity: 0.4; }
  .lc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .lc-val { font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ui-ink); white-space: nowrap; }
  .lc-sw, .chart svg.lc-sw { display: inline-block; width: 18px; height: 8px; flex: none; overflow: visible; } /* not the plot's 100 % */
  .lc-sw line { stroke-width: 2.25; stroke-linecap: round; }
  .tip .lc-sw { margin-right: 4px; vertical-align: 0; }
  .tip .tip-max { color: var(--ui-muted); font-weight: 400; margin-left: 6px; }
  .lc-foot { display: flex; justify-content: flex-end; margin-top: 4px; }
  .lc-table { margin-top: 8px; max-height: 320px; overflow: auto; }
  .lc-tbl th .lc-sw { vertical-align: 0; }
  @media (pointer: coarse) { .lc-key, .lc-table-btn { min-height: 40px; } }
  @media (forced-colors: active) {
    /* colours collapse to one: the dash pattern per series still tells them apart */
    .lc .line, .lc-sw line { stroke: CanvasText !important; }
    .lc-key { border: 1px solid CanvasText; }
    .lc-key[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -3px; }
    .lc-plot:focus-visible { outline-color: Highlight; }
  }

  /* ---------------------------------------------------------------- tables */
  .tbl-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
  table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: normal; }
  .tbl th { padding: 10px 12px 9px; border-bottom: 1px solid var(--ui-line); color: var(--ui-muted); font: 500 10.5px/1.2 var(--ui-font-mono); letter-spacing: var(--ui-track-label); text-align: left; text-transform: uppercase; white-space: nowrap; }
  .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--ui-line); vertical-align: middle; white-space: nowrap; }
  .tbl tr:last-child td { border-bottom: 0; }
  .tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
  .tbl td.m { font-family: var(--ui-font-mono); font-size: 12.5px; }
  .tbl td.wrap-cell { white-space: normal; overflow-wrap: anywhere; min-width: 200px; }
  .tbl tr { transition: background-color var(--ui-dur-1) var(--ui-ease); }
  .tbl tbody tr:hover { background: var(--ui-sunken); }
  .tbl tr.go { cursor: pointer; }          /* whole row opens the host; the id cell holds the real link for keyboards */
  .tbl tr.go td a:hover { text-decoration: underline; text-underline-offset: 3px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 0; }
  .tbl th:last-child, .tbl td:last-child { padding-right: 0; }
  .bar { position: relative; height: 4px; border-radius: 4px; background: var(--ui-sunken); overflow: hidden; min-width: 80px; }
  .bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--bar, var(--ui-ink)); }

  /* ---------------------------------------------------------------- rows / kv */
  .kv { display: grid; grid-template-columns: auto 1fr; gap: 0; }
  .kv > div { padding: 9px 0; border-bottom: 1px solid var(--ui-line); }
  .kv > div:nth-last-child(-n+2) { border-bottom: 0; }
  .kv .k { color: var(--ui-muted); padding-right: 24px; font-size: 13px; }
  .kv .v { text-align: right; font-variant-numeric: tabular-nums; }

  /* ---------------------------------------------------------------- alerts */
  .alerts { display: flex; flex-direction: column; gap: 10px; }
  .callout {
    display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px;
    border-radius: var(--ui-radius-md); background: var(--ui-sunken); border: 1px solid transparent;
  }
  .callout.crit { background: var(--ui-down-tint); border-color: color-mix(in oklab, var(--ui-down) 25%, transparent); }
  .callout.warn { background: var(--ui-warn-tint); border-color: color-mix(in oklab, var(--ui-warn) 25%, transparent); }
  .ic { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; }
  .ic svg { width: 100%; height: 100%; }
  .callout.crit > .ic { color: var(--ui-down); } .callout.warn > .ic { color: var(--ui-warn); }
  main:focus { outline: none; }
  .callout .ttl { font-weight: 500; }
  .callout .ttl a:hover { text-decoration: underline; text-underline-offset: 3px; }
  .callout .meta { font-size: 12px; color: var(--ui-muted); margin-top: 2px; }
  .callout .acts { display: flex; gap: 8px; align-items: center; }
  .all-good { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--ui-radius-md); background: var(--ui-up-tint); color: var(--ui-up); }
  .all-good .halo { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in oklab, var(--ui-up) 18%, transparent); }
  .all-good p { margin: 0; color: var(--ui-ink-2); }

  .note { padding: 10px 12px; border-radius: var(--ui-radius-md); background: var(--ui-sunken); color: var(--ui-ink-2); font-size: 12.5px; }

  /* ---------------------------------------------------------------- skeleton + motion */
  .skel { border-radius: var(--ui-radius-sm); background: linear-gradient(90deg, var(--ui-sunken), color-mix(in oklab, var(--ui-sunken) 60%, var(--ui-line)), var(--ui-sunken)); background-size: 200% 100%; animation: skel 1.4s linear infinite; }
  @keyframes skel { to { background-position: -200% 0; } }
  .skel-line { width: 160px; height: 12px; }
  /* entrances are transform/opacity only, ≤ 200 ms, and the stagger is capped (6 × 20 ms) so nothing waits to be read */
  .rise { animation: rise var(--ui-dur-2) var(--ui-ease) both; animation-delay: calc(min(var(--i, 0), 6) * 20ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
  /* 2.5: a page plays its entrance once; after its first render app.js marks main settled, and what a data refresh
     re-creates appears in place (a new alert's row-in still marks something that is new) */
  main.settled .rise { animation: none; }
  .no-anim { animation: none !important; }   /* a panel a redraw re-opened (settings.js) */
  main > * { animation: fadein var(--ui-dur-2) var(--ui-ease); }   /* page / tab switch */
  .flash { animation: flash 600ms var(--ui-ease); }
  @keyframes flash { 0% { color: var(--accent); } 100% { } }
  .row-in { animation: rowin var(--ui-dur-2) var(--ui-ease) both; }
  @keyframes rowin { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
  .stale { opacity: 0.55; transition: opacity var(--ui-dur-2) var(--ui-ease); }

  .foot { margin: 72px 0 32px; padding-top: 18px; border-top: 1px solid var(--ui-line); display: flex; justify-content: space-between; gap: 16px; color: var(--ui-muted); font-size: 12px; }

  /* ---------------------------------------------------------------- toast */
  .toast { padding: 10px 14px; border-radius: var(--ui-radius-md); background: var(--ui-ink); color: var(--ui-bg); font-size: 13px; box-shadow: var(--ui-shadow-2); animation: rise var(--ui-dur-2) var(--ui-ease); }

  /* ---------------------------------------------------------------- login */
  .login { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
  .login::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: radial-gradient(40% 40% at 30% 30%, var(--aura-a), transparent 70%), radial-gradient(35% 35% at 70% 65%, var(--aura-c), transparent 70%), radial-gradient(30% 30% at 60% 20%, var(--aura-b), transparent 70%);
  }
  .login-card { width: min(380px, 100%); padding: 32px 28px 26px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-xl); background: var(--ui-surface); box-shadow: var(--ui-shadow-2); }
  .login-card .brand { margin-bottom: 26px; }
  .login-card h1 { font-size: 26px; letter-spacing: var(--ui-track-display); }
  .login-card p { margin: 8px 0 22px; color: var(--ui-muted); font-size: 13px; }
  .field { display: block; margin-bottom: 14px; }
  .field span { display: block; margin-bottom: 6px; }
  .field input {
    width: 100%; height: 42px; padding: 0 14px; border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius-md); background: var(--ui-bg);
    outline: none; transition: border-color var(--ui-dur-2) var(--ui-ease), box-shadow var(--ui-dur-2) var(--ui-ease);
  }
  .field input:focus { border-color: var(--ui-ink); box-shadow: 0 0 0 3px var(--accent-tint); }
  .field input.code { font-family: var(--ui-font-mono); letter-spacing: 0.4em; font-size: 18px; text-align: center; }
  .login-card .btn { width: 100%; min-height: 42px; margin-top: 6px; font-size: 14px; }
  .login-err { min-height: 20px; margin-top: 12px; color: var(--ui-down); font-size: 13px; }
  .shake { animation: shake 360ms var(--ui-ease); }
  @keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

  /* ---------------------------------------------------------------- app shell aura
     One full-bleed layer behind the whole app (it used to hang off each page head inside .wrap, so its gradients were
     clipped by that box: a hard edge on the left at wide viewports). Gradients are placed in viewport terms and fade
     out at the bottom with a mask, so there is no box edge anywhere. */
  .aura {
    position: absolute; top: 0; left: 0; right: 0; height: 640px; z-index: -1; pointer-events: none; overflow: hidden;
    background:
      radial-gradient(48vw 300px at 18% 120px, var(--aura-a), transparent 70%),
      radial-gradient(40vw 260px at 46% 40px, var(--aura-b), transparent 70%),
      radial-gradient(42vw 320px at 84% 160px, var(--aura-c), transparent 70%);
    -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent);
    mask-image: linear-gradient(to bottom, #000 45%, transparent);
  }
  /* column shell: main takes the spare height, so the footer rests at the bottom instead of jumping down when a page's data arrives */
  body.app { position: relative; isolation: isolate; overflow-x: clip; display: flex; flex-direction: column; }
  body.app > main { flex: 1 0 auto; }
  body.app > .wrap { width: 100%; }

  /* ---------------------------------------------------------------- numbers + misc motion */
  .num-in { animation: numin var(--ui-dur-2) var(--ui-ease) both; }
  @keyframes numin { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
  .stat .v, .meter .mv > span, .fleet-ring .big { display: inline-block; }
  .ic.xs { width: 13px; height: 13px; }
  .ic.big { width: 30px; height: 30px; }
  .link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in oklab, var(--accent) 40%, transparent); }
  .link:hover { text-decoration-color: currentColor; }
  code { font-family: var(--ui-font-mono); font-size: 0.92em; }
  p code, .fineprint code { padding: 1px 5px; border-radius: 5px; background: var(--ui-sunken); }
  .fineprint { margin: 10px 0 0; color: var(--ui-muted); font-size: 12px; line-height: 1.5; }
  .spacer { flex: 1; }
  .aside-row { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
  .row-gap { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
  .btn.ghost { border-color: transparent; color: var(--ui-ink-2); }
  .btn.ghost:hover:not(:disabled) { border-color: var(--ui-line-2); color: var(--ui-ink); background: color-mix(in oklab, var(--ui-ink) 5%, transparent); }
  .btn.danger { color: var(--ui-down); }
  .btn.primary.danger { background: var(--ui-down); border-color: var(--ui-down); color: #fff; }
  .btn.primary.danger::before { background: color-mix(in oklab, var(--ui-down) 80%, #000); }
  .btn.primary.danger:hover:not(:disabled) { color: #fff; border-color: var(--ui-down); }
  .btn .ic { width: 15px; height: 15px; }
  .btn.sm .ic { width: 13px; height: 13px; }
  .icon-btn.sm { width: 28px; height: 28px; }
  .icon-btn.sm svg { width: 14px; height: 14px; }
  .icon-btn .ic { width: auto; height: auto; }
  .chip { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border-radius: 6px; background: var(--ui-sunken); color: var(--ui-ink-2); font-size: 11.5px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .chip.m { font-family: var(--ui-font-mono); font-size: 11px; }
  .count-pill { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--ui-sunken); color: var(--ui-muted); font: 600 10.5px/1 var(--ui-font-mono); }
  .stats .v.t-down { color: var(--ui-down); } .stats .v.t-warn { color: var(--ui-warn); } .stats .v.bad { color: var(--ui-down); } .stats .v.warn { color: var(--ui-warn); }

  /* ---------------------------------------------------------------- forms */
  .input {
    width: 100%; min-height: 38px; padding: 0 12px; border: 1px solid var(--ui-line-2); border-radius: var(--ui-radius-md);
    background: var(--ui-bg); color: var(--ui-ink); font: inherit; font-size: 13.5px; outline: none;
    transition: border-color var(--ui-dur-2) var(--ui-ease), box-shadow var(--ui-dur-2) var(--ui-ease);
  }
  textarea.input { padding: 9px 12px; resize: vertical; line-height: 1.45; min-height: 64px; }
  select.input { padding-right: 28px; appearance: none; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--ui-muted) 50%), linear-gradient(135deg, var(--ui-muted) 50%, transparent 50%);
    background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
  .input.sm { min-height: 30px; font-size: 12.5px; width: auto; }
  .input.m, .input[type="password"] { font-family: var(--ui-font-mono); font-size: 12.5px; }
  .input:hover { border-color: var(--ui-line-strong); }
  .input:focus { border-color: var(--ui-ink); box-shadow: 0 0 0 3px var(--accent-tint); }
  .input.invalid { border-color: var(--ui-down); box-shadow: 0 0 0 3px var(--ui-down-tint); }
  .input.code { font-family: var(--ui-font-mono); letter-spacing: 0.45em; font-size: 20px; text-align: center; min-height: 48px; }
  .input[type="time"] { font-variant-numeric: tabular-nums; }
  .with-unit { position: relative; display: flex; align-items: center; }
  .with-unit .input.num { padding-right: 44px; font-variant-numeric: tabular-nums; }
  .with-unit .unit { position: absolute; right: 12px; color: var(--ui-muted); font-size: 12px; pointer-events: none; }
  .fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  /* a field focused or scrolled to (an error, "fix the highlighted value") clears the sticky header and a save bar */
  .fld, .input { scroll-margin-top: 84px; scroll-margin-bottom: 88px; }
  @media (max-width: 760px) { .fld, .input { scroll-margin-top: 124px; } } /* the header has two rows here */
  .fld-l { font-size: 12.5px; font-weight: 500; color: var(--ui-ink-2); }
  .fld-h { font-size: 11.5px; color: var(--ui-muted); line-height: 1.4; }
  .fld-h.bad, .fld-warn { color: var(--ui-down); font-size: 12px; margin: 8px 0 0; }
  .form { display: flex; flex-direction: column; gap: 16px; }
  .inline { display: flex; align-items: center; gap: 10px; min-height: 38px; }
  .inline .input { flex: 1; }
  .seg[role="radiogroup"] { flex-wrap: wrap; }
  .seg button[aria-checked="true"] { background: var(--ui-surface); color: var(--ui-ink); box-shadow: var(--ui-shadow-1), 0 0 0 1px var(--ui-line); }
  .fld .seg { align-self: flex-start; }

  /* Switch: the one on/off control (lib.js toggle()). State is carried three ways so it never depends on colour
     alone: the track (neutral grey vs --switch-on green), the knob position, and a tick drawn in the knob when on. */
  .switch {
    position: relative; flex: none; width: 38px; height: 22px; padding: 0; border: 0; border-radius: var(--ui-radius-pill); cursor: pointer;
    background: var(--ui-line-2); box-shadow: inset 0 0 0 1px var(--ui-line-strong);   /* the ring keeps the off track ≥ 3:1 against the page in both themes */
    transition: background-color var(--ui-dur-2) var(--ui-ease), box-shadow var(--ui-dur-2) var(--ui-ease); -webkit-tap-highlight-color: transparent;
  }
  .switch::before { content: ""; position: absolute; inset: -9px -6px; }   /* comfortable hit area on touch screens */
  .switch .knob {
    position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #FBFBF8;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: transform var(--ui-dur-2) var(--ui-ease);
  }
  .switch .knob::after {
    content: ""; position: absolute; left: 6.5px; top: 3.5px; width: 5px; height: 9px; border: solid var(--switch-on); border-width: 0 2px 2px 0;
    opacity: 0; transform: rotate(45deg) scale(0.4); transition: opacity var(--ui-dur-1) var(--ui-ease), transform var(--ui-dur-2) var(--ui-ease);
  }
  .switch:hover { background: color-mix(in oklab, var(--ui-line-2) 70%, var(--ui-line-strong)); }
  .switch[aria-checked="true"] { background: var(--switch-on); box-shadow: inset 0 0 0 1px transparent; }
  .switch[aria-checked="true"]:hover { background: color-mix(in oklab, var(--switch-on) 88%, var(--ui-ink)); }
  .switch[aria-checked="true"] .knob { transform: translateX(16px); }
  .switch[aria-checked="true"] .knob::after { opacity: 1; transform: rotate(45deg); }
  .switch:active .knob { transform: scale(0.9); }
  .switch[aria-checked="true"]:active .knob { transform: translateX(16px) scale(0.9); }
  .switch:focus-visible { outline: 2px solid var(--ui-ink); outline-offset: 3px; }
  .switch:disabled { opacity: 0.5; cursor: not-allowed; }
  @media (forced-colors: active) {
    .switch { border: 1px solid ButtonText; background: Canvas; }
    .switch .knob { background: ButtonText; box-shadow: none; }
    .switch[aria-checked="true"] { background: Highlight; }
    .switch[aria-checked="true"] .knob { background: HighlightText; }
  }

  /* ---------------------------------------------------------------- toasts */
  .toasts { position: fixed; right: 20px; bottom: 20px; z-index: var(--ui-z-toast); display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
  .toasts .toast { display: inline-flex; align-items: center; gap: 8px; max-width: min(440px, calc(100vw - 40px)); }
  .toast .ic { width: 15px; height: 15px; }
  .toast.ok .ic { color: var(--ui-up); filter: brightness(1.3); }
  .toast.bad { background: var(--ui-down); color: #fff; }
  .toast.out { animation: toastout 160ms var(--ui-ease) forwards; }
  @keyframes toastout { to { opacity: 0; transform: translateY(6px) scale(0.98); } }

  /* ---------------------------------------------------------------- dialogs */
  .dlg {
    width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-xl);
    background: var(--ui-surface); color: var(--ui-ink); box-shadow: var(--ui-shadow-2); overflow: auto; overscroll-behavior: contain;
    animation: dlgin var(--ui-dur-2) var(--ui-ease);
  }
  .dlg.wide { width: min(680px, calc(100vw - 24px)); }
  .dlg.narrow { width: min(400px, calc(100vw - 24px)); }
  .dlg::backdrop { background: var(--ui-scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fadein var(--ui-dur-2) var(--ui-ease); }
  .dlg.out { animation: dlgout 140ms var(--ui-ease) forwards; }
  .dlg.out::backdrop { animation: fadeout 140ms var(--ui-ease) forwards; }
  @keyframes dlgin { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
  @keyframes dlgout { to { opacity: 0; transform: translateY(4px) scale(0.985); } }
  @keyframes fadeout { to { opacity: 0; } }
  .dlg form { padding: 22px 24px 20px; display: flex; flex-direction: column; gap: 16px; }
  .dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .dlg-head h2 { font-size: 19px; letter-spacing: var(--ui-track-heading); }
  .dlg-lede { margin: -8px 0 0; color: var(--ui-ink-2); font-size: 13px; overflow-wrap: anywhere; }
  .dlg-err { min-height: 0; color: var(--ui-down); font-size: 13px; }
  .dlg-err:empty { display: none; }
  .dlg-acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--ui-line); }
  .dlg.busy .dlg-acts .btn.primary { opacity: 0.7; }
  .stepup { display: flex; gap: 16px; align-items: center; }
  .stepup .fld { flex: 1; }
  .halo { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); }
  .halo .ic { width: 20px; height: 20px; }

  /* steps (telegram wizard, add host) */
  .steps { list-style: none; margin: 0; padding: 0; counter-reset: st; display: flex; flex-direction: column; gap: 18px; }
  .steps > li { position: relative; padding-left: 40px; counter-increment: st; display: flex; flex-direction: column; gap: 10px; }
  .steps > li::before {
    content: counter(st); position: absolute; left: 0; top: -2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    border: 1px solid var(--ui-line-2); background: var(--ui-surface); color: var(--ui-ink-2); font: 600 12px/1 var(--ui-font-mono);
  }
  .steps > li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 30px; bottom: -14px; width: 1px; background: var(--ui-line); }
  .steps h3 { font-size: 14.5px; letter-spacing: var(--ui-track-snug); }
  .steps p { margin: 0; color: var(--ui-ink-2); font-size: 13px; line-height: 1.55; }
  .steps.big > li { padding-left: 48px; gap: 10px; }
  .steps.big > li::before { content: attr(data-n); width: 30px; height: 30px; font-size: 13px; }
  .steps.big > li.alt { counter-increment: none; margin-top: -6px; }
  .steps.big > li.alt::before { content: "or"; font: 500 10.5px/1 var(--ui-font-mono); color: var(--ui-muted); border-style: dashed; }
  .steps.big > li:not(:last-child)::after { left: 15px; top: 34px; }
  .steps.big > li.on-server::before { background: var(--accent-tint); border-color: color-mix(in oklab, var(--accent) 45%, var(--ui-line)); color: var(--accent); }
  .step-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

  /* command blocks */
  .cmd { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 10px; padding: 10px 10px 10px 14px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); background: var(--ui-sunken); }
  .cmd pre, .snip pre { margin: 0; min-width: 0; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.6 var(--ui-font-mono); color: var(--ui-ink); padding-top: 3px; }
  .cmd-p { font: 12.5px/1.6 var(--ui-font-mono); color: var(--ui-faint); user-select: none; padding-top: 3px; }
  .btn.copy { min-height: 26px; padding: 0 9px; background: var(--ui-surface); border-color: var(--ui-line); }
  .btn.copy.done { color: var(--ui-up); border-color: color-mix(in oklab, var(--ui-up) 40%, var(--ui-line)); }
  .btn.copy .ic { width: 13px; height: 13px; }
  .snip { border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); background: var(--ui-sunken); overflow: hidden; }
  .snip-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--ui-line); }
  .snip pre { padding: 12px 14px; white-space: pre; overflow-wrap: normal; }
  .hint-box { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px dashed var(--ui-line-2); border-radius: var(--ui-radius-md); }
  .hint-box p { margin: 0; color: var(--ui-muted); font-size: 12.5px; }

  /* ---------------------------------------------------------------- states */
  .empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 0; color: var(--ui-muted); text-align: center; font-size: 13px; }
  .empty-state p { margin: 0; max-width: 52ch; }
  .error-state { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--ui-radius-md); background: var(--ui-down-tint); color: var(--ui-ink-2); font-size: 13px; }
  .error-state > .ic { color: var(--ui-down); }
  .error-state > div { flex: 1; overflow-wrap: anywhere; }
  .empty-hosts { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 44px 20px; border: 1px dashed var(--ui-line-2); border-radius: var(--ui-radius-lg); text-align: center; }
  .empty-hosts .ic.big { color: var(--accent-fill); }
  .empty-hosts h3 { font-size: 17px; }
  .empty-hosts p { margin: 0 0 6px; color: var(--ui-muted); max-width: 48ch; }
  .skel-rows { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
  .skel-row { height: 38px; animation-delay: calc(var(--i, 0) * 120ms); }
  .skel-rows.callouts .skel-row { height: 62px; border-radius: var(--ui-radius-md); }
  .skel-rows.cards .skel-row { height: 120px; border-radius: var(--ui-radius-lg); }
  .skel-rows.rules-skel .skel-row { height: 58px; border-radius: var(--ui-radius-md); }
  .skel-line.wide { width: min(420px, 80%); display: inline-block; }
  .skel-line.sm { width: 90px; height: 10px; display: inline-block; }
  .skel-title { display: inline-block; width: min(380px, 70vw); height: 0.9em; border-radius: 8px; }
  .skel-callout { height: 62px; border-radius: var(--ui-radius-md); }
  .skel-card { min-height: 214px; display: flex; flex-direction: column; gap: 14px; cursor: default; }
  .skel-card:hover, .skel-card:active { transform: none; box-shadow: var(--ui-shadow-1); border-color: var(--ui-line); }
  .skel-card::before { display: none; }
  .skel-av { width: 34px; height: 34px; border-radius: 50%; }
  .skel-block { flex: 1; border-radius: var(--ui-radius-md); }
  .chart-skel { position: absolute; inset: 8px 48px 22px 0; border-radius: var(--ui-radius-md); opacity: 0.6; }
  .banner { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; padding: 12px 16px; border-radius: var(--ui-radius-md); font-size: 13.5px; color: var(--ui-ink-2); animation: rise var(--ui-dur-2) var(--ui-ease) both; }
  .banner.bad { background: var(--ui-down-tint); border: 1px solid color-mix(in oklab, var(--ui-down) 25%, transparent); }
  .banner.bad > .ic { color: var(--ui-down); }
  .banner.info { background: var(--accent-tint); border: 1px solid color-mix(in oklab, var(--accent) 25%, transparent); }
  .banner.info > .ic { color: var(--accent); }
  .banner a { color: var(--ui-ink); text-decoration: underline; text-underline-offset: 3px; }
  body.offline-stream .head .live-dot { animation: none; color: var(--ui-muted); }

  /* ---------------------------------------------------------------- alerts (v2.1) */
  .callout { grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; transition: opacity var(--ui-dur-2) var(--ui-ease), background-color var(--ui-dur-2) var(--ui-ease); }
  .callout > .ic { margin-top: 1px; }
  .callout.info { background: var(--accent-tint); border-color: color-mix(in oklab, var(--accent) 22%, transparent); }
  .callout.info > .ic { color: var(--accent); }
  .callout.acked, .callout.is-muted { background: var(--ui-surface); border-color: var(--ui-line); }
  .callout.acked > .ic, .callout.is-muted > .ic { opacity: 0.75; }
  .callout .ttl { display: flex; flex-wrap: wrap; gap: 0 6px; overflow-wrap: anywhere; }
  .callout .ttl .sep { color: var(--ui-faint); }
  .callout .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; }
  .callout .meta .badge .ic { width: 11px; height: 11px; }
  .callout .acts { flex-wrap: wrap; justify-content: flex-end; }
  .callout .acts .btn.ghost .ic { width: 14px; height: 14px; }
  .ack { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 10px; padding: 8px 10px; border-radius: var(--ui-radius-sm); background: var(--ui-up-tint); color: var(--ui-ink-2); font-size: 12.5px; }
  .ack > .ic { color: var(--ui-up); }
  .ack b { font-weight: 600; }
  .ack q { flex-basis: 100%; padding-left: 21px; color: var(--ui-ink-2); font-style: italic; quotes: "“" "”"; overflow-wrap: anywhere; }
  .group-h { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; }
  .more-link { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; padding: 4px 2px; color: var(--ui-muted); font-size: 12.5px; }
  .more-link:hover { color: var(--ui-ink); }
  .callout.ext .ttl { align-items: center; }
  .src-badge { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 5px; background: var(--ui-ink); color: var(--ui-bg); font: 600 10px/1 var(--ui-font-mono); letter-spacing: 0.04em; text-transform: uppercase; }
  .ext-sum { margin-top: 3px; color: var(--ui-ink-2); font-size: 13px; overflow-wrap: anywhere; }
  .callout .chips { margin-top: 8px; }
  .ext-url { color: var(--ui-muted); font-size: 11.5px; overflow-wrap: anywhere; }
  a.ext-url { text-decoration: underline; text-underline-offset: 2px; }

  /* ---------------------------------------------------------------- alert delivery, server alerts, expiry (v2.3) */
  .srv-host { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-family: var(--ui-font-sans); }
  .srv-host .ic { color: var(--ui-muted); }
  .callout .deliv { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 7px; color: var(--ui-muted); font-size: 12px; }
  .deliv .dv, .deliv .dv-l { display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
  .deliv .dv > span:not(.ic):first-of-type { color: var(--ui-ink-2); font-weight: 500; }   /* the channel name */
  .deliv .dv.ok > .ic { color: var(--ui-up); }
  .deliv .dv.retry > .ic, .deliv .dv.retry > span:last-child { color: var(--ui-warn); }
  .deliv .dv.fail > .ic, .deliv .dv.fail > span:last-child { color: var(--ui-down); }
  .deliv time { font-variant-numeric: tabular-nums; }
  .deliv .badge .ic { width: 11px; height: 11px; }
  .callout.acked .deliv, .callout.is-muted .deliv { opacity: 0.85; }
  .tbl td.end-cell { white-space: nowrap; }
  .tbl td.end-cell .badge .ic, .end-inline .badge .ic { width: 11px; height: 11px; }
  .only-sm { display: none; }
  .end-inline { align-items: center; flex-wrap: wrap; gap: 3px 8px; margin-top: 5px; font-size: 11.5px; }
  .tbl td.end-cell .muted { display: block; margin-top: 2px; font-size: 11.5px; }

  /* ---------------------------------------------------------------- host cards (v2.1) */
  .meters.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .meters.four .meter { gap: 7px; }
  .meters.four .meter svg { width: 38px; height: 38px; }
  .card.is-pending .meters, .card.is-pending .spark { opacity: 0.4; }
  .card[data-status="offline"] .meters, .card[data-status="offline"] .spark { opacity: 0.42; filter: grayscale(1); }
  .card[data-status="offline"] .card-id .name, .card[data-status="offline"] .avatar { opacity: 0.7; }
  .last-known { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding: 5px 9px; border-radius: var(--ui-radius-sm); background: var(--ui-sunken); color: var(--ui-ink-2); font-size: 11.5px; }
  .card .chips .badge .ic { width: 11px; height: 11px; }

  /* ---------------------------------------------------------------- host page */
  .avatar.lg { width: 44px; height: 44px; }
  .head-side.wrap-side { flex-wrap: wrap; justify-content: flex-end; }
  .temp-pill { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 0 10px 0 7px; border-radius: var(--ui-radius-pill); border: 1px solid var(--ui-line); background: var(--ui-surface); font: 500 13px/1 var(--ui-font-sans); font-variant-numeric: tabular-nums; }
  .temp-pill .ic { width: 15px; height: 15px; color: var(--s4); }
  .temp-pill.warn { color: var(--ui-warn); background: var(--ui-warn-tint); border-color: color-mix(in oklab, var(--ui-warn) 35%, var(--ui-line)); }
  .temp-pill.bad { color: var(--ui-down); background: var(--ui-down-tint); border-color: color-mix(in oklab, var(--ui-down) 35%, var(--ui-line)); }
  .temp-pill.warn .ic, .temp-pill.bad .ic { color: currentColor; }
  .badge b { font-weight: 600; margin-left: 2px; }
  .host-page.is-offline .stats, .host-page.is-offline .grid2 .chart { opacity: 0.6; filter: grayscale(0.6); }
  .thermo-bar { overflow: visible; }
  .thermo-bar > b { position: absolute; top: -3px; width: 1px; height: 10px; background: var(--ui-warn); }
  .chart-now { margin-left: 8px; color: var(--ui-muted); font: 500 12px var(--ui-font-mono); font-variant-numeric: tabular-nums; }
  .wd-list, .msg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
  .wd { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ui-line); }
  .wd:last-child { border-bottom: 0; }
  .wd-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--ui-faint); }
  .wd.ok .wd-dot { background: var(--ui-up); }
  .wd.warn .wd-dot { background: var(--ui-warn); }
  .wd.bad .wd-dot { background: var(--ui-down); box-shadow: 0 0 0 4px var(--ui-down-tint); }
  .wd-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .wd-name { font-size: 13px; font-weight: 500; }
  .wd-msg { margin-top: 3px; color: var(--ui-ink-2); font-size: 13px; overflow-wrap: anywhere; }
  .wd-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; color: var(--ui-muted); font-size: 11.5px; }
  .msg { position: relative; padding: 11px 0 11px 14px; border-bottom: 1px solid var(--ui-line); }
  .msg:last-child { border-bottom: 0; }
  .msg::before { content: ""; position: absolute; left: 0; top: 13px; bottom: 13px; width: 2px; border-radius: 2px; background: var(--ui-line-2); }
  .msg.warn::before { background: var(--ui-warn); }
  .msg.bad::before { background: var(--ui-down); }
  .msg.p1, .msg.p2 { opacity: 0.75; }
  .msg-top { display: flex; align-items: center; gap: 8px; }
  .msg-topic { font-size: 11.5px; color: var(--ui-muted); }
  .msg-ts { margin-left: auto; color: var(--ui-muted); font-size: 11.5px; white-space: nowrap; }
  .msg-title { margin-top: 3px; font-weight: 500; overflow-wrap: anywhere; }
  .msg-body { margin-top: 2px; color: var(--ui-ink-2); font-size: 13px; overflow-wrap: anywhere; white-space: pre-line; }
  .msg .chips { margin-top: 6px; }
  .msg.sys::before { background: var(--ui-up); }
  .msg-topic.sys { display: inline-flex; align-items: center; gap: 5px; }
  .msg .badge .ic { width: 11px; height: 11px; }
  .sensors { display: flex; flex-direction: column; }
  .sensor { display: grid; grid-template-columns: 58px minmax(0, 1fr) minmax(70px, 1.2fr) 52px; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--ui-line); }
  .sensor:last-child { border-bottom: 0; }
  .sensor .badge { justify-content: center; }
  .s-name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .s-val { font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; }
  .sensor.warn .s-val { color: var(--ui-warn); } .sensor.bad .s-val { color: var(--ui-down); }
  .custom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
  .cm { display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 10px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); background: var(--ui-surface); min-width: 0; }
  .cm.warn { border-color: color-mix(in oklab, var(--ui-warn) 45%, var(--ui-line)); }
  .cm.bad { border-color: color-mix(in oklab, var(--ui-down) 45%, var(--ui-line)); }
  .cm-name { font-size: 12.5px; font-weight: 500; overflow-wrap: anywhere; }
  .cm-val { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .cm.warn .cm-val { color: var(--ui-warn); } .cm.bad .cm-val { color: var(--ui-down); }
  .cm-thr { color: var(--ui-muted); font-size: 11.5px; }
  .cm .spark { height: 32px; margin: 2px -2px 0; }
  .integ-list { display: flex; flex-direction: column; gap: 8px; }
  .integ { border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); background: var(--ui-surface); transition: border-color var(--ui-dur-2) var(--ui-ease); }
  .integ.ref { margin-top: 12px; background: transparent; border-style: dashed; }
  .integ[open] { border-color: var(--ui-line-2); }
  .integ summary { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
  .integ summary::-webkit-details-marker { display: none; }
  .integ summary:hover .integ-name { text-decoration: underline; text-underline-offset: 3px; }
  .integ-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ui-faint); }
  .integ.on .integ-dot { background: var(--ui-up); }
  .integ-name { font-weight: 500; }
  .integ-det { flex: 1; min-width: 0; color: var(--ui-muted); font: 11.5px var(--ui-font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .integ.ref summary .integ-name { flex: none; }
  .integ summary .chev { margin-left: auto; }
  .integ .chev { color: var(--ui-muted); transition: transform var(--ui-dur-2) var(--ui-ease); }
  .integ[open] .chev { transform: rotate(90deg); }
  .integ-body { display: flex; flex-direction: column; gap: 10px; padding: 0 14px 14px; animation: rise var(--ui-dur-2) var(--ui-ease); }
  .integ-body p { margin: 0; font-size: 13px; }

  /* ---------------------------------------------------------------- settings */
  .tabs { display: flex; gap: 4px; margin: 0 0 8px; padding-bottom: 0; border-bottom: 1px solid var(--ui-line); overflow-x: auto; scrollbar-width: none; }
  .tabs a { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px 12px; color: var(--ui-muted); font-weight: 500; white-space: nowrap; transition: color var(--ui-dur-1) var(--ui-ease); }
  .tabs a .ic { width: 15px; height: 15px; }
  .tabs a:hover { color: var(--ui-ink); }
  .tabs a[aria-current="page"] { color: var(--ui-ink); }
  .tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent-fill); animation: tabin var(--ui-dur-2) var(--ui-ease); }
  .tabs a[href="#/add-host"] { margin-left: auto; } /* 2.3: :last-child — the link is absent below admin (2.4) */
  @keyframes tabin { from { transform: scaleX(0.5); opacity: 0; } }
  .settings .section { margin-top: 32px; }
  .rules { display: flex; flex-direction: column; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); background: var(--ui-surface); overflow: hidden; }
  .rule { border-bottom: 1px solid var(--ui-line); transition: background-color var(--ui-dur-2) var(--ui-ease); }
  .rule:last-child { border-bottom: 0; }
  .rule.open { background: color-mix(in oklab, var(--ui-sunken) 45%, var(--ui-surface)); }
  .rule-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 12px 14px 12px 16px; }
  .rule-main { all: unset; display: block; min-width: 0; cursor: pointer; }
  .rule-main:focus-visible { outline: 2px solid var(--ui-ink); outline-offset: 4px; border-radius: 4px; }
  .rule-t { display: flex; align-items: center; gap: 8px; font-weight: 500; }
  .rule-id { color: var(--ui-faint); font-size: 11px; font-weight: 400; }
  .rule-sum { margin-top: 2px; color: var(--ui-muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rule.off .rule-main, .rule.off .badge { opacity: 0.5; }
  .mod-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-fill); opacity: 0; transform: scale(0.4); transition: opacity var(--ui-dur-2) var(--ui-ease), transform var(--ui-dur-2) var(--ui-ease); }
  .rule.modified .mod-dot { opacity: 1; transform: none; }
  .rule.changed { box-shadow: inset 3px 0 0 var(--accent-fill); }
  .notify-btn[aria-pressed="false"] { color: var(--ui-faint); border-style: dashed; }
  .chev-btn .ic, .chev-btn svg { transition: transform var(--ui-dur-2) var(--ui-ease); }
  .chev-btn[aria-expanded="true"] svg { transform: rotate(90deg); }
  .rule-detail { padding: 2px 16px 16px 66px; animation: rise var(--ui-dur-2) var(--ui-ease); }
  .rule-desc { margin: 0 0 14px; color: var(--ui-ink-2); font-size: 13px; }
  .rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px 20px; align-items: start; }
  .rule-grid.general { padding: 16px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); background: var(--ui-surface); }
  .sev-fixed { display: block; padding: 6px 0; color: var(--ui-muted); font-size: 12.5px; }
  .fineprint.srv-rule { display: flex; align-items: flex-start; gap: 6px; margin-top: 14px; }
  .fineprint.srv-rule .ic { margin-top: 2px; flex: none; }
  .overrides { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--ui-line-2); display: flex; flex-direction: column; gap: 10px; }
  .ov-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 12px; }
  .ov-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding: 10px 12px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); background: var(--ui-surface); }
  .ov-host { align-self: center; min-width: 90px; font-weight: 500; }
  .ov-f { display: flex; flex-direction: column; gap: 4px; width: 150px; }
  .ov-f .fld-l { font-size: 11.5px; color: var(--ui-muted); font-weight: 400; }
  .ov-row .icon-btn { margin-left: auto; align-self: center; }
  .overrides > select.input { align-self: flex-start; }
  .rule-acts { display: flex; justify-content: flex-end; margin-top: 14px; }
  .savebar { position: fixed; left: 50%; bottom: 18px; z-index: var(--ui-z-dropdown); width: min(640px, calc(100vw - 24px)); transform: translate(-50%, 16px); opacity: 0; visibility: hidden; pointer-events: none;
    transition: transform var(--ui-dur-2) var(--ui-ease), opacity var(--ui-dur-2) var(--ui-ease), visibility 0s linear var(--ui-dur-2); }
  .savebar.on { transform: translate(-50%, 0); opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
  .sb-in { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: var(--ui-radius-pill); background: var(--ui-ink); color: var(--ui-bg); box-shadow: var(--ui-shadow-2); font-size: 13px; }
  .sb-in .btn { border-color: color-mix(in oklab, var(--ui-bg) 30%, transparent); color: var(--ui-bg); }
  .sb-in .btn.primary { background: var(--ui-bg); color: var(--ui-ink); border-color: var(--ui-bg); }
  .sb-in .btn.primary:hover:not(:disabled) { color: #0B0B0A; }
  .savebar[data-state="saved"] .sb-in > .ic { color: var(--ui-up); }
  .savebar[data-state="error"] .sb-in { background: var(--ui-down); color: #fff; }
  .sb-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 16px; align-items: start; }
  .channel { position: relative; padding: 16px 18px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); background: var(--ui-surface); box-shadow: var(--ui-shadow-1); transition: border-color var(--ui-dur-2) var(--ui-ease), opacity var(--ui-dur-2) var(--ui-ease); }
  .channel.open { grid-column: 1 / -1; border-color: var(--ui-line-2); }
  .channel.off > :not(.ch-form):not(.ch-head) { opacity: 0.55; }
  .channel.off .ch-id { opacity: 0.6; }
  .channel.nudge { animation: nudge 1.6s var(--ui-ease) 2; }
  @keyframes nudge { 30% { box-shadow: 0 0 0 4px var(--accent-tint), var(--ui-shadow-2); border-color: var(--accent-fill); } }
  .ch-head { display: flex; align-items: center; gap: 12px; }
  .ch-ic { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--ui-sunken); color: var(--ui-ink-2); }
  .ch-ic .ic { width: 19px; height: 19px; }
  .ch-ic.kind-telegram { background: color-mix(in oklab, var(--s1) 14%, transparent); color: var(--s1); }
  .ch-ic.kind-ntfy { background: color-mix(in oklab, var(--s2) 14%, transparent); color: var(--s2); }
  .ch-id { flex: 1; min-width: 0; }
  .ch-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 500; font-size: 15px; }
  .ch-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 3px; color: var(--ui-muted); font-size: 12px; min-width: 0; }
  .ch-meta .m { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .secret-ok, .secret-missing, .secret-set { display: inline-flex; align-items: center; gap: 4px; }
  .secret-ok { color: var(--ui-up); }
  .secret-missing { color: var(--ui-warn); }
  .secret-set { min-height: 38px; color: var(--ui-ink-2); font-size: 13px; }
  .secret-set .ic { color: var(--ui-up); }
  .secret { display: flex; align-items: center; gap: 10px; }
  .secret .input { flex: 1; }
  .ch-sum { margin: 12px 0 0; color: var(--ui-ink-2); font-size: 12.5px; }
  .ch-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ui-line); flex-wrap: wrap; }
  .test-out { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ui-muted); animation: fadein var(--ui-dur-2) var(--ui-ease); overflow-wrap: anywhere; }
  .test-out:empty { display: none; }
  .test-out.ok { color: var(--ui-up); } .test-out.bad { color: var(--ui-down); }
  /* delivery health of a channel (v2.3) */
  .channel.failing { border-color: color-mix(in oklab, var(--ui-down) 45%, var(--ui-line)); }
  .ch-name .badge .ic { width: 11px; height: 11px; }
  .ch-status { margin-top: 10px; color: var(--ui-muted); font-size: 12.5px; }
  .ch-status .st-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
  .ch-status b { font-weight: 500; }
  .ch-status.ok .st-line > .ic { color: var(--ui-up); }
  .ch-status.warn, .ch-status.bad { padding: 9px 11px; border-radius: var(--ui-radius-sm); }
  .ch-status.warn { background: var(--ui-warn-tint); }
  .ch-status.bad { background: var(--ui-down-tint); }
  .ch-status.warn .st-line { color: var(--ui-warn); }
  .ch-status.bad .st-line { color: var(--ui-down); }
  .ch-status .st-more { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; padding-left: 19px; color: var(--ui-ink-2); font-size: 12px; }
  .ch-status .st-err { font-size: 11.5px; overflow-wrap: anywhere; }
  .ch-status .st-hint { margin: 6px 0 0; padding-left: 19px; color: var(--ui-muted); font-size: 12px; line-height: 1.45; }
  .ch-status .st-old { color: var(--ui-muted); }
  .test-out.busy::before { content: ""; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ui-line-2); border-top-color: var(--ui-ink); animation: spin 700ms linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .ch-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--ui-line); display: flex; flex-direction: column; gap: 18px; animation: rise var(--ui-dur-2) var(--ui-ease); }
  .routing { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 24px; }
  .pick { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px; }
  .chip-btn { min-height: 26px; padding: 0 10px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-pill); background: var(--ui-surface); color: var(--ui-ink-2); font-size: 12px; cursor: pointer; transition: background-color var(--ui-dur-1) var(--ui-ease), border-color var(--ui-dur-1) var(--ui-ease), color var(--ui-dur-1) var(--ui-ease), transform var(--ui-dur-1) var(--ui-ease); }
  .chip-btn:hover { border-color: var(--ui-line-strong); }
  .chip-btn:active { transform: scale(0.96); }
  .chip-btn[aria-pressed="true"] { background: var(--ui-ink); border-color: var(--ui-ink); color: var(--ui-bg); }
  .quiet-wrap { display: flex; flex-direction: column; gap: 12px; }
  .quiet { display: grid; grid-template-columns: 130px 130px 1fr; gap: 14px; padding-left: 46px; animation: rise var(--ui-dur-2) var(--ui-ease); }
  .ch-acts { display: flex; align-items: center; gap: 10px; }

  /* ---------------------------------------------------------------- add host */
  .addhost-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 8px 40px; align-items: start; }
  .addhost-grid > * { min-width: 0; }
  .addhost .side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
  .card-flat { padding: 16px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); background: var(--ui-surface); }
  .card-flat .section-head { margin-bottom: 10px; padding-bottom: 10px; }
  .card-flat .section-head h2 { font-size: 15px; }
  .card-flat .section-head .ic { color: var(--accent); }
  .card-flat > p { margin: 0 0 12px; font-size: 12.5px; line-height: 1.5; }
  .pins, .assets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
  .pins li { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; border-radius: var(--ui-radius-sm); background: var(--ui-sunken); }
  .pins code { flex: 1; min-width: 0; font-size: 11px; overflow-wrap: anywhere; line-height: 1.45; }
  .pins-all { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
  .assets li { padding: 8px 0; border-bottom: 1px solid var(--ui-line); display: flex; flex-direction: column; gap: 4px; }
  .assets li:last-child { border-bottom: 0; }
  .asset-n { font-size: 12px; overflow-wrap: anywhere; }
  .asset-sha { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .asset-sha code { font-size: 11px; color: var(--ui-muted); }
  .asset-u { font-size: 10.5px; overflow-wrap: anywhere; }
  .watch .badge .dot { width: 6px; height: 6px; }

  /* agents (2.2) */
  .agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
  .agent-group { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); background: var(--ui-surface); }
  .agent-group.old { border-color: color-mix(in oklab, var(--ui-warn) 40%, var(--ui-line)); }
  .agent-group.legend-tile { background: transparent; border-style: dashed; }
  .agent-group .fineprint { margin: 0; }
  .ag-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .ag-ver { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
  .ag-head .muted { margin-left: auto; font-size: 12px; }
  .legend-tile .ag-head .muted { margin-left: 0; }
  .ag-hosts { display: flex; flex-wrap: wrap; gap: 6px; }
  .agent-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 9px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-pill); font-size: 12px; transition: border-color var(--ui-dur-2) var(--ui-ease), transform var(--ui-dur-1) var(--ui-ease); }
  .agent-chip:hover { border-color: var(--ui-line-strong); }
  .agent-chip:active { transform: scale(0.97); }
  .agent-chip.bad { border-color: color-mix(in oklab, var(--ui-down) 45%, var(--ui-line)); color: var(--ui-down); }
  .ic.auto { color: var(--accent); }
  .agent-kv .v { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 8px; }
  .agent-kv .v > div { flex: 0 0 100%; justify-content: flex-end; }   /* results and notes go on their own line under the value */
  .agent-kv .v > .muted { font-size: 13px; }
  .upd-res { display: inline-flex; align-items: flex-start; gap: 5px; font-size: 12px; text-align: right; overflow-wrap: anywhere; }
  .upd-res.ok { color: var(--ui-up); } .upd-res.bad { color: var(--ui-down); }
  .upd-res .ic { margin-top: 2px; }
  /* collectors that failed in the last report (v2.3) */
  .coll-errs { margin-top: 14px; padding: 10px 12px; border: 1px solid color-mix(in oklab, var(--ui-warn) 25%, transparent); border-radius: var(--ui-radius-md); background: var(--ui-warn-tint); }
  .coll-errs .ce-head { display: flex; align-items: center; gap: 6px; color: var(--ui-warn); font-size: 12.5px; font-weight: 500; }
  .coll-errs ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
  .coll-errs li { display: grid; grid-template-columns: minmax(64px, max-content) minmax(0, 1fr); gap: 1px 12px; font-size: 12.5px; }
  .coll-errs .ce-name { font-size: 12px; font-weight: 500; }
  .coll-errs .ce-msg { color: var(--ui-ink-2); overflow-wrap: anywhere; }
  .coll-errs .ce-rules { grid-column: 2; color: var(--ui-muted); font-size: 11.5px; }
  .coll-errs .fineprint { margin-top: 8px; }
  .port-note { margin: 0 0 6px; }
  .tbl tr.new-port td { background: var(--ui-warn-tint); }
  .tbl tr.new-port td:first-child .badge { margin-left: 8px; }
  /* ports panel (2.5.1): state badges, an owner's UDP sockets folded under its header row, hint rows */
  .tbl td .port-badge { margin-left: 8px; }
  .badge.wait { border-style: dashed; color: var(--ui-muted); }
  .port-fold .chev { color: var(--ui-muted); transition: transform var(--ui-dur-2) var(--ui-ease); }
  .port-fold[aria-expanded="true"] .chev { transform: rotate(90deg); }
  .tbl tr.port-member td:first-child { padding-left: 22px; }
  .tbl tr.port-member td { background: color-mix(in oklab, var(--ui-sunken) 45%, transparent); }
  .tbl tr.port-hint td { background: var(--ui-warn-tint); }
  .tbl tr.port-hint td:first-child { padding-left: 10px; box-shadow: inset 3px 0 0 var(--ui-warn); }
  .tbl td.port-owner { min-width: 130px; }
  .tbl td.port-addrs { white-space: normal; }
  .port-hint-text { display: flex; align-items: flex-start; gap: 5px; margin-top: 3px; color: var(--ui-warn); font-size: 12px; }
  .port-hint-text .ic { flex: none; margin-top: 2px; }
  .port-owners { margin-top: 14px; }

  /* enrollment (2.2) */
  .enroll { display: flex; flex-direction: column; gap: 16px; animation: rise var(--ui-dur-2) var(--ui-ease); }
  .enroll-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .replace-row { padding: 8px 12px; border-radius: var(--ui-radius-md); font-size: 13px; transition: background-color var(--ui-dur-2) var(--ui-ease); }
  .replace-row.emph { background: var(--ui-warn-tint); }
  .enroll-acts { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
  .enroll-acts .fineprint { margin: 0; }
  .enroll-result { display: flex; flex-direction: column; gap: 20px; animation: rise var(--ui-dur-2) var(--ui-ease); }
  .invite-result-box { display: flex; flex-direction: column; gap: 20px; } /* inviteResult(): Add host and the assistant's invite card */
  .code-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid color-mix(in oklab, var(--accent) 35%, var(--ui-line)); border-radius: var(--ui-radius-lg); background: linear-gradient(180deg, var(--accent-tint), transparent 70%), var(--ui-surface); box-shadow: var(--ui-shadow-1); }
  .code-top { display: flex; align-items: center; gap: 12px; }
  .code-top h3 { font-size: 16px; letter-spacing: var(--ui-track-snug); }
  .code-top .small { font-size: 12.5px; margin-top: 2px; }
  .code-box { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border: 1px dashed var(--ui-line-strong); border-radius: var(--ui-radius-md); background: var(--ui-bg); }
  .enroll-code { flex: 1; min-width: 0; font: 500 clamp(13px, 1.6vw, 17px)/1.4 var(--ui-font-mono); letter-spacing: 0.02em; overflow-wrap: anywhere; user-select: all; }
  .once { display: flex; align-items: flex-start; gap: 8px; color: var(--ui-ink-2); font-size: 12.5px; }
  .once > .ic { color: var(--ui-warn); margin-top: 2px; }
  .progress-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--ui-line); }
  .progress { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; }
  .progress li { display: inline-flex; align-items: center; gap: 7px; color: var(--ui-muted); }
  .progress li b { font-weight: 500; }
  .pdot { width: 16px; height: 16px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--ui-line-2); }
  .pdot .ic { width: 10px; height: 10px; }
  .progress li.done { color: var(--ui-ink); }
  .progress li.done .pdot { background: var(--ui-up); border-color: var(--ui-up); color: #fff; }
  .progress li.now { color: var(--ui-ink); }
  .progress li.now .pdot { border-color: var(--accent-fill); border-top-color: transparent; animation: spin 900ms linear infinite; }
  .progress[data-stage="reporting"] li:last-child { color: var(--ui-up); }
  .how { display: flex; flex-direction: column; gap: 14px; }
  .how > .seg { align-self: flex-start; }
  .pane { display: flex; flex-direction: column; gap: 12px; animation: fadein var(--ui-dur-2) var(--ui-ease); }
  .pane > p { margin: 0; font-size: 13px; line-height: 1.55; }
  .prompt { border: 1px solid var(--ui-line); border-radius: var(--ui-radius-md); background: var(--ui-sunken); overflow: hidden; }
  .prompt pre { margin: 0; max-height: 420px; overflow: auto; padding: 14px 16px; white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.6 var(--ui-font-mono); color: var(--ui-ink); }
  .prompt .btn.copy { background: var(--ui-ink); color: var(--ui-bg); border-color: var(--ui-ink); }
  .prompt .btn.copy.done { background: var(--ui-up); border-color: var(--ui-up); color: #fff; }
  .tbl tr.hl td { background: var(--accent-tint); }
  .manual { border: 1px solid var(--ui-line); border-radius: var(--ui-radius-lg); background: var(--ui-surface); }
  .manual > summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; font-size: 13.5px; }
  .manual > summary::-webkit-details-marker { display: none; }
  .manual > summary .chev { color: var(--ui-muted); transition: transform var(--ui-dur-2) var(--ui-ease); }
  .manual[open] > summary .chev { transform: rotate(90deg); }
  .manual-body { display: flex; flex-direction: column; gap: 20px; padding: 4px 16px 18px; animation: rise var(--ui-dur-2) var(--ui-ease); }
  .how-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--ui-ink-2); font-size: 12.5px; line-height: 1.5; }

  /* ---------------------------------------------------------------- responsive */
  @media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stat:nth-child(3n+1) { padding-left: 0; border-left: 0; }
    .stat:nth-child(n+4) { border-top: 1px solid var(--ui-line); }
    .addhost-grid { grid-template-columns: minmax(0, 1fr); }
    .addhost .side { position: static; }
  }
  @media (max-width: 760px) {
    .top .wrap { gap: 10px; flex-wrap: wrap; height: auto; padding-top: 10px; }
    .top .nav { order: 10; width: calc(100% + 2 * var(--pad)); margin: 0 calc(-1 * var(--pad)); padding: 4px var(--pad) 0; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--ui-line); }
    .top .nav::-webkit-scrollbar { display: none; }
    .nav a { padding: 9px 10px 11px; border-radius: 0; background: none; flex: none; }
    .nav a[aria-current="page"] { background: none; }
    .nav a[aria-current="page"]::after { bottom: 0; left: 10px; right: 10px; }
    .nav a .lbl-long, .top .pill .lbl-long { display: none; }
    .head { grid-template-columns: minmax(0, 1fr); padding-top: 28px; gap: 20px; }
    .head-side, .head-side.wrap-side { justify-content: flex-start; }
    .host-page .head-side .avatar { order: -1; }
    .fleet-ring { width: 112px; height: 112px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat:nth-child(n) { padding-left: 0; border-left: 0; }
    .stat:nth-child(2n) { padding-left: 14px; border-left: 1px solid var(--ui-line); }
    .stat:nth-child(n+3) { border-top: 1px solid var(--ui-line); }
    .grid2 { grid-template-columns: 1fr; }
    .hosts { grid-template-columns: 1fr; }
    .callout { grid-template-columns: auto minmax(0, 1fr); }
    .callout .acts { grid-column: 2; justify-content: flex-start; }
    .section-head { flex-wrap: wrap; }
    .hide-sm { display: none; }
    .only-sm { display: flex; }
    .rule-head { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 12px; padding: 12px; }
    .rule-head .badge { display: none; }
    .rule-head .notify-btn { display: none; }
    .rule-detail { padding: 2px 12px 14px; }
    .quiet { grid-template-columns: 1fr 1fr; padding-left: 0; }
    .quiet > :last-child { grid-column: 1 / -1; }
    .sensor { grid-template-columns: 52px minmax(0, 1fr) 46px; }
    .sensor .bar { display: none; }
    .tabs a:last-child { margin-left: 0; }
    .toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
    .toasts .toast { max-width: none; }
    /* the ports panel (2.5.1) stacks each row: port, Accept and menu on top, owner and addresses below in full
       width, so neither the owner's unit name nor Accept owner… sits beyond a sideways scroll */
    .tbl.port-tbl, .tbl.port-tbl tbody { display: block; }
    .tbl.port-tbl thead { display: none; }
    .tbl.port-tbl tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: 8px; border-bottom: 1px solid var(--ui-line); }
    .tbl.port-tbl tr[hidden] { display: none; }
    .tbl.port-tbl tr > td { border-bottom: 0; padding: 6px 0; min-width: 0; background: none; box-shadow: none; }
    .tbl.port-tbl tr > td.port-owner, .tbl.port-tbl tr > td.port-addrs { grid-column: 1 / -1; padding-top: 0; overflow-wrap: break-word; }
    .tbl.port-tbl tr > td.port-owner { grid-row: 2; }
    .tbl.port-tbl tr > td.port-addrs { grid-row: 3; }
    .tbl.port-tbl tr > td:nth-child(4) { grid-row: 1; grid-column: 2; }
    .tbl.port-tbl tr > td:nth-child(5) { grid-row: 1; grid-column: 3; }
    .tbl.port-tbl tr > td.port-addrs:empty { display: none; }
    .tbl.port-tbl tr.new-port, .tbl.port-tbl tr.port-hint { background: var(--ui-warn-tint); }
    .tbl.port-tbl tr.port-hint { box-shadow: inset 3px 0 0 var(--ui-warn); }
    .tbl.port-tbl tr.port-member { background: color-mix(in oklab, var(--ui-sunken) 45%, transparent); }
    .tbl.port-tbl tr.port-member > td:first-child, .tbl.port-tbl tr.port-member > td.port-owner, .tbl.port-tbl tr.port-member > td.port-addrs { padding-left: 22px; }
    .tbl.port-tbl tr.port-hint > td:first-child, .tbl.port-tbl tr.port-hint > td.port-owner, .tbl.port-tbl tr.port-hint > td.port-addrs { padding-left: 10px; box-shadow: none; }
    .dlg form { padding: 18px 16px 16px; }
    .dlg-acts { flex-wrap: wrap; }
    .dlg-acts .btn { flex: 1; }
  }
  @media (max-width: 430px) {
    .top .pill { display: none; }
    .icon-btn { width: 32px; height: 32px; }
    .meters.four .meter svg { display: none; }
    .meters.four { gap: 4px; }
    .ch-head .switch { align-self: flex-start; margin-top: 8px; }
    .addhost .rule-grid, .enroll-grid { grid-template-columns: 1fr; }
    .code-box { flex-direction: column; align-items: stretch; }
  }
  /* 2.6: the header's first row also holds the Easy | Expert switch (app.js). Where that row is short — a window under
     about 1180 px, or the assistant's drawer open beside the page (it pads the body) — the fleet pill gives way and the
     nav scrolls sideways in its place, so the controls on the right never leave the window. A container query on the
     header's own width covers both; a phone keeps its two-row header (≤ 760 px, above). */
  header.top { container: goat-top / inline-size; }
  .top .ez-switch { flex: none; flex-wrap: nowrap; }
  @media (min-width: 761px) {
    @container goat-top (max-width: 1180px) {
      .top .pill { display: none; }
      .top .nav { min-width: 0; align-self: stretch; align-items: center; overflow-x: auto; scrollbar-width: none; }
      .top .nav::-webkit-scrollbar { display: none; }
      .nav a { flex: none; }
    }
  }
  /* U1: where the nav scrolls sideways, the cut edge fades (app.js sets cut-l, cut-r) */
  .top .nav.cut-l { --l: 28px; }
  .top .nav.cut-r { --r: 28px; }
  .top .nav:is(.cut-l, .cut-r) { mask-image: linear-gradient(90deg, transparent, #000 var(--l, 0px), #000 calc(100% - var(--r, 0px)), transparent); }
  /* U1: a strip's track shows in both themes, and the time before its first state is hatched "no data" */
  .st-strip { outline: 1px solid var(--ui-line-2); outline-offset: -1px; }
  .st-seg.st-none { background: repeating-linear-gradient(135deg, var(--ui-line-2) 0 1px, transparent 1px 5px); }
  /* on a phone the switch narrows, so that the first row still holds the brand, the assistant, the switch, the theme
     and the user menu */
  @media (max-width: 430px) {
    .top .wrap { gap: 6px; }
    .top .ez-switch { padding: 2px; }
    .top .ez-switch button { padding: 4px 7px; }
  }

  /* ---------------------------------------------------------------- 2.4: review of a dry run, guide links */
  .review { display: flex; flex-direction: column; gap: 12px; }
  .review-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 50dvh; overflow: auto; }
  .review-row { padding: 8px 10px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-sm); background: var(--ui-sunken); overflow-wrap: anywhere; }
  .review-l { font-weight: 600; color: var(--ui-ink); }
  .review-from { color: var(--ui-muted); font-family: var(--ui-font-mono); font-size: 12.5px; }
  .review-to { color: var(--ui-ink); font-family: var(--ui-font-mono); font-size: 12.5px; }
  .review-row.op-remove .review-from { text-decoration: line-through; }
  .review-arrow { color: var(--ui-muted); }
  .review-warn { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; color: var(--ui-warn); }
  .review-warn li { display: flex; align-items: flex-start; gap: 6px; }
  .review-warn .ic { margin-top: 2px; flex: none; }
  .help-link { font-weight: 600; font-size: 13px; line-height: 1; text-decoration: none; }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 1ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
      transition-duration: 1ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
    }
    .dot.live, .skel { animation: none; }
    .card:hover, .card:active, .btn:active:not(:disabled), .icon-btn:active:not(:disabled), .switch:active .knob { transform: none; }
    .switch[aria-checked="true"]:active .knob { transform: translateX(16px); }
  }
}
