/* css/kit.css
   Owns: the component kit's classes (the UI plan §3.2): the buttons (.pill, .tbtn), badges and chips, the warning box,
   the legacy dialog (core/dialog.js modal(): .modal, .modal-card, .log) and the toasts (core/toast.js), the dialog
   (js/core/dialog.js: .dlg-layer › .dlg-scrim + section.dlg.dlg-s/m/l/xl › head, body (scrolls), error line, foot),
   pages, tables, the event kinds' colours (.k-<kind>, .kdot), the segmented switch (.seg, scoped), a button's menu and
   popover (kit/menu.js: .kit-menu, .kit-pop), a picture's zoom bar (js/stage/zoom.js: .zoombar). setup.php loads this
   sheet (with tokens, base and pages/system), so what it uses lives here or in base.css, never in a later sheet. */

/* ---------- buttons, badges, chips, the warning box (from style.css, step 21: first in this sheet, where style.css sat
   in the cascade, so every rule below still overrides them as before) ---------- */

/* A warning box: the Export dialog's lines. A page's warn status (.page-status.warn) draws on it too; .page-status,
   later, sets that one's margin and size. */
.warn {
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-fg);
  padding: 8px 10px; border-radius: var(--radius); margin: 8px 0; font-size: 13px;
}

.badge {
  font-size: 11px; padding: 2px 7px; border-radius: 20px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  white-space: nowrap;
}
.badge.sim  { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber-fg); }   /* the driver, a pane's SIM */
.badge.bwb  { background: var(--bw-bg); border-color: var(--bw-line); color: var(--text-2); }            /* DELAYED */

.pill, .tbtn {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius); padding: 6px 11px; cursor: pointer;
}
.pill:hover, .tbtn:hover { background: var(--panel-3); }
.pill.on, .tbtn.on { background: var(--on-bg); border-color: var(--on-line); color: var(--on-fg); }

select.pill { padding: 5px 8px; }

.tbtn.small { padding: 4px 9px; font-size: 12px; }
.tbtn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 600; }
.tbtn.danger { color: var(--err-fg); border-color: var(--danger-line); }
.tbtn[disabled] { opacity: .45; cursor: not-allowed; }
a.tbtn { text-decoration: none; display: inline-block; }   /* a link that looks like a button */

/* the till's amount in a waiting item, a pane's MANUAL: amber words, not the kit's t-warn */
.badge.warnb { background: var(--warnb-bg); border-color: var(--warnb-line); color: var(--amber-fg); }
.chip {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  border-radius: 20px; padding: 2px 9px; font-size: 11.5px; cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.on { color: var(--on-accent); background: var(--c, var(--accent)); border-color: transparent; font-weight: 600; }

/* ---------- the legacy dialog (core/dialog.js modal(): Help and the Export dialog still use it) ---------- */

.modal-card input, .modal-card select, .modal-card textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 6px 8px; font-size: 12px;
}
.modal-card textarea { color: var(--text); font: 13px/1.4 system-ui, sans-serif; resize: vertical; min-height: 54px; }
.modal-card label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: grid; place-items: center; z-index: var(--z-dialog); padding: 20px;
}
.modal-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px 22px; width: min(560px, 96vw); max-height: 86vh; overflow: auto;
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
/* Nothing in a dialog squeezes to fit (a clipped image box would): a tall one scrolls. */
.modal-card > * { flex-shrink: 0; }
.modal-card h2 { margin: 0; font-size: 16px; }
.modal-card h2 ~ h2 { margin-top: 8px; }
.modal-card p { margin: 0; font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
/* A dialog's own buttons sit under a rule, pinned to the foot of the card: they read as belonging to the whole dialog,
   not to its last section, and stay in reach when the dialog is taller than the screen. (:has() is Chromium 105: the
   TV never opens this dialog.) */
.modal-card:has(> .modal-actions:last-child) { padding-bottom: 0; }
.modal-card > .modal-actions:last-child {
  position: sticky; bottom: 0; z-index: 2;
  margin: 4px -22px 0; padding: 12px 22px 16px;
  background: var(--panel); border-top: 1px solid var(--line);
}

/* Help's tables */
.log { width: 100%; border-collapse: collapse; font-size: 12px; }
.log th, .log td { text-align: left; padding: 4px 8px 4px 0; border-bottom: 1px solid var(--log-line); vertical-align: top; }
.log th { color: var(--muted); font-weight: 500; }

/* ---------- toasts (core/toast.js, on any page: setup.php too): up to three at once, newest on top ---------- */
.toasts {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: var(--z-toast);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 16px; font-size: 13px; max-width: 80vw;
  box-shadow: 0 8px 30px rgba(0,0,0,.55); pointer-events: auto;
}
.toast.ok  { border-color: var(--ok-line); background: var(--ok-bg); }
.toast.err { border-color: var(--err-line); background: var(--err-bg); }
.toast.info { border-color: var(--info-line); background: var(--info-bg); }
.toast .tbtn { margin-left: 10px; }   /* a toast's own action (Open) */

/* ---------- the dialog (js/core/dialog.js) ---------- */


/* The margin gives way below 1200 px wide so a 96vw dialog always fits it (24 px each side ran a phone's off the right). */
.dlg-layer { position: fixed; inset: 0; display: grid; place-items: center; padding: min(var(--s5), 2vw); }
.dlg-scrim { position: absolute; inset: 0; background: var(--scrim); }
.dlg-layer.stacked .dlg-scrim { background: var(--scrim-soft); }   /* a dialog over a dialog: the one under stays readable */
.dlg {
  position: relative; display: flex; flex-direction: column; max-height: 86vh; width: min(560px, 96vw);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px var(--scrim-strong); outline: none;
}
.dlg-s { width: min(420px, 96vw); }
.dlg-l { width: min(820px, 96vw); }
.dlg-xl { width: min(1280px, 96vw); }
.dlg-head { padding: var(--s4) 22px 0; }
.dlg-head h2 { margin: 0; font-size: var(--fs-lg); }
.dlg-body { padding: var(--s3) 22px var(--s4); overflow: auto; display: grid; gap: var(--s3); line-height: var(--lh); }
.dlg-body > div { display: grid; gap: var(--s3); }
.dlg-body p { margin: 0; }
.dlg-body ul { margin: 0; padding-left: 20px; }
.dlg-error { margin: 0 22px var(--s3); padding: var(--s2) var(--s3); border: 1px solid var(--err-line); border-radius: var(--radius);
  background: var(--err-bg); color: var(--err-fg); }
.dlg-foot { display: flex; justify-content: flex-end; gap: var(--s2); padding: var(--s3) 22px var(--s4); border-top: 1px solid var(--line); }
.dlg.busy { cursor: progress; }
.tbtn.danger.primary { background: var(--danger); color: var(--on-err); border-color: transparent; }

.dlg-form { display: grid; gap: var(--s3); }
.dlg-field, .dlg-typed { display: grid; gap: var(--s1); color: var(--muted); font-size: var(--fs-sm); }
.dlg-input { display: flex; align-items: center; gap: var(--s2); }
.dlg-input input { flex: 1; min-width: 0; }
.dlg-form input, .dlg-form select, .dlg-form textarea, .dlg-typed input {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
  padding: 7px 9px; font: inherit; font-size: var(--fs-base);
}
.dlg-form textarea { resize: vertical; min-height: 54px; }
.dlg-presets { display: flex; flex-wrap: wrap; gap: var(--s2); }
.dlg-kv { display: grid; grid-template-columns: auto 1fr; gap: var(--s1) var(--s3); margin: 0; }
.dlg-kv dt { color: var(--muted); }
.dlg-kv dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ---------- pages on the kit (js/kit/page.js; the shell's section.page.kit-page) ---------- */

.kit-page { overflow: hidden; }
.kit-split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.kit-split.with-pane { grid-template-columns: minmax(0, 1fr) var(--pane-w); }
.kit-main { min-width: 0; overflow-y: auto; padding: var(--s3) var(--s5) var(--s6); }
.page-status { margin: 0 0 var(--s2); font-size: var(--fs-md); color: var(--text-2); }
.page-status.warn { color: var(--warn-fg); }
.page-status.err { color: var(--err-fg); }
.about { margin: 0 0 var(--s3); color: var(--muted); font-size: var(--fs-sm); }
.about > summary { cursor: pointer; width: max-content; }
.about-body { max-width: 72ch; padding: var(--s1) 0 0; }
.about-body p { margin: var(--s1) 0; }
.kit-sec { padding: var(--s3) 0; }
.kit-sec + .kit-sec { border-top: 1px solid var(--line); }
.kit-sec-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.kit-sec-head h3, .kit-sub { margin: 0; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); }
.kit-sub { margin: var(--s3) 0 var(--s2); }
.spacer { flex: 1; }
p.empty { margin: var(--s2) 0; color: var(--muted); }
.error-block { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); border: 1px solid var(--err-line);
  border-radius: var(--radius); background: var(--err-bg); color: var(--err-fg); }
.error-block p { margin: 0; }
.pagebar-actions { flex: none; margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.pagebar-actions .tbtn { white-space: nowrap; }

/* tiles: only as children of .tiles (the Watch contact sheet has its own .tile) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile-min), 1fr)); gap: var(--s2); }
.tiles > .tile { display: flex; flex-direction: column; gap: var(--s1); min-width: 0; padding: var(--s2) var(--s3); text-align: left;
  background: var(--panel); border: 1px solid var(--line-2); border-left-width: 4px; border-radius: var(--radius);
  color: inherit; font: inherit; cursor: pointer; }
.tiles > .tile:hover { background: var(--panel-2); }
.tiles > .tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.tile-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-sub { font-size: var(--fs-xs); color: var(--muted); min-height: 1.2em; }
.tiles > .tile.t-ok { border-left-color: var(--lvl-good); }
.tiles > .tile.t-neutral { border-left-color: var(--lvl-mid); }
.tiles > .tile.t-warn { border-left-color: var(--warn); }
.tiles > .tile.t-err { border-left-color: var(--lvl-bad); box-shadow: inset 0 0 0 1px var(--lvl-bad); }

/* badges (kit/badge.js) */
.badge.t-ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-fg); }
.badge.t-warn { background: var(--warnb-bg); border-color: var(--warnb-line); color: var(--warn-fg); }
.badge.t-err { background: var(--err-bg); border-color: var(--err-line); color: var(--err-fg); }
.badge.t-neutral { background: var(--panel-2); border-color: var(--line); color: var(--muted); }

/* event kinds (UI plan §3.1; core/tokens.js kindClass): a kind's element carries .k-<kind>, which sets --k, and paints
   var(--k, var(--kind-other)), so a kind without a line here is --kind-other. Never on a container: --k inherits.
   .kdot is the small square a list row or a picker shows. */
.k-motion { --k: var(--kind-motion); }          .k-vehicle { --k: var(--kind-vehicle); }
.k-person { --k: var(--kind-person); }          .k-tamper { --k: var(--kind-tamper); }
.k-video_loss { --k: var(--kind-video_loss); }  .k-manual { --k: var(--kind-manual); }
.k-dwell { --k: var(--kind-dwell); }            .k-unpaid { --k: var(--kind-unpaid); }
.k-door_open { --k: var(--kind-door_open); }    .k-short_visit { --k: var(--kind-short_visit); }
.k-animal { --k: var(--kind-animal); }          .k-overstay { --k: var(--kind-overstay); }
.k-acw_attend { --k: var(--kind-acw_attend); }  .k-paid { --k: var(--kind-paid); }
.k-dial { --k: var(--kind-dial); }              .k-wash { --k: var(--kind-wash); }
.k-aborted { --k: var(--kind-aborted); }        .k-no_sale { --k: var(--kind-no_sale); }
              .k-other { --k: var(--kind-other); }
.kdot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--k, var(--kind-other)); vertical-align: middle; }

/* data table (kit/table.js) */
.dt { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.dt th { position: sticky; top: 0; z-index: 1; background: var(--panel); text-align: left; font-weight: 600; font-size: var(--fs-xs);
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: var(--s2); border-bottom: 1px solid var(--line); }
.dt td { padding: 7px var(--s2); border-bottom: 1px solid var(--row-line); vertical-align: middle; }
.dt .num { text-align: right; font-variant-numeric: tabular-nums; }
.dt tr.clickable { cursor: pointer; }
.dt tbody tr.clickable:hover { background: var(--panel-2); }
.dt tr.inactive td { color: var(--muted); }
.dt.dense td { padding: 4px var(--s2); font-size: var(--fs-sm); }
.dt input { width: 7em; }
.dt input[type=text] { width: 100%; min-width: 10em; }

/* side pane (kit/sidepane.js) */
.side-pane { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--panel); }
.side-pane-head { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.side-pane-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-pane-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s3) var(--s4) var(--s5); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--s1) var(--s3); margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; }
.pane-form { display: grid; gap: var(--s2); }
.pane-actions { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s3); }

/* form fields (kit/form.js) */
.field { display: grid; gap: var(--s1); font-size: var(--fs-sm); color: var(--muted); }
.field input, .field select, .field textarea { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); padding: 6px 8px; font: inherit; font-size: var(--fs-base); min-width: 0; }
.field.check { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); color: var(--text); }
.field.check .hint { flex-basis: 100%; margin-left: 26px; }   /* a long hint on its own line, under the label */
.field.check input { width: 18px; height: 18px; flex: none; }
.field-label .hint, .field .hint { color: var(--faint); font-weight: 400; margin-left: var(--s1); }
.field-row { display: grid; grid-template-columns: 1fr 8em; gap: var(--s2); }
.check-list { display: grid; gap: var(--s2); }

/* the sticky bar under a table being typed into (count mode) */
.count-bar { position: sticky; bottom: 0; display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2);
  padding: var(--s2) var(--s3); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); }
.count-bar label { display: flex; align-items: center; gap: var(--s2); }

/* toolbar above a table (kit/toolbar.js): a switch, a search box, the count. The switch is scoped to kit pages and the
   Watch bars that use it (the Events tab's Follow, the contact sheet's tile size). */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: var(--s2) 0 var(--s3); }
.kit-page .seg, .ev-tools .seg, .sheet-bar .seg { display: inline-flex; max-width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius); overflow-x: auto; }
.kit-page .seg button, .ev-tools .seg button, .sheet-bar .seg button { flex: none; height: var(--ctl-h-sm); padding: 0 var(--s3); border: 0;
  border-right: 1px solid var(--line-2); background: var(--panel); color: var(--muted); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.kit-page .seg button:last-child, .ev-tools .seg button:last-child, .sheet-bar .seg button:last-child { border-right: 0; }
.kit-page .seg button:hover, .ev-tools .seg button:hover, .sheet-bar .seg button:hover { color: var(--text); }
.kit-page .seg button[aria-pressed="true"], .ev-tools .seg button[aria-pressed="true"], .sheet-bar .seg button[aria-pressed="true"] {
  background: var(--panel-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.toolbar-search { height: var(--ctl-h-sm); min-width: 15em; padding: 0 var(--s2); background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius); font: inherit; font-size: var(--fs-sm); }
.toolbar-count { color: var(--muted); font-size: var(--fs-sm); }
/* "2 more clips since this list was drawn [Show]": in the toolbar's own row, so it never pushes the table down */
.new-note { display: inline-flex; align-items: center; gap: var(--s2); color: var(--text-2); font-size: var(--fs-sm); }

/* tables: the row the side pane shows (the columns marked hide: 'm' give way at ≤ 1440: css/mobile.css) */
.dt tr[aria-selected="true"] td { background: var(--panel-2); }
.dt tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* records in the side pane */
.pane-actions.wrap { flex-wrap: wrap; }
.hash-full { font-family: var(--font-mono); font-size: var(--fs-xs); word-break: break-all; -webkit-user-select: all; user-select: all; }
.url-row { display: flex; gap: var(--s2); margin-bottom: var(--s3); }
.url-row input { flex: 1; min-width: 0; height: var(--ctl-h-sm); padding: 0 var(--s2); background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--font-mono); font-size: var(--fs-xs); }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.err-text { color: var(--err-fg); }

/* a clip played in the app (kit/media.js) */
.clip-player video { display: block; width: 100%; max-height: 72vh; background: var(--black); border-radius: var(--radius); }
.clip-player-foot { margin: var(--s2) 0 0; }

/* cards: a bordered block of one subject (Pricing, the Front desk, Sales, a camera's page) */
.kit-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4); }
.kit-card + .kit-card { margin-top: var(--s4); }
.kit-card-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.kit-card-head h3 { margin: 0; font-size: var(--fs-md); }
.kit-card .dt { margin-top: var(--s2); }

/* a one-line notice under a page's status (a BOGO running); t-* tones as the badges */
.notice { margin: 0 0 var(--s3); padding: var(--s2) var(--s3); border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius);
  background: var(--panel-2); color: var(--text-2); }
.notice.t-info { border-left-color: var(--accent); }
.notice.t-warn { border-left-color: var(--warn); }
.notice.t-err { border-left-color: var(--lvl-bad); }
.warn-text { color: var(--warn-fg); }
/* scoped to kit pages: legacy markup uses its own .mono */
.kit-page .fine { font-size: var(--fs-sm); }
.kit-page .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.more-row { margin: var(--s3) 0 0; }
.field-row.two { grid-template-columns: 1fr 1fr; }
.code-big { margin: var(--s2) 0; font-family: var(--font-mono); font-size: 2rem; letter-spacing: .08em; -webkit-user-select: all; user-select: all; }

/* a button's small menu (kit/menu.js); the shell's user menu is its own .menu */
.kit-menu { position: fixed; z-index: var(--z-menu); min-width: 12em; padding: 4px; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--radius); box-shadow: 0 8px 24px var(--scrim); }
.kit-menu-item { display: block; width: 100%; padding: 7px 12px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text);
  font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; white-space: nowrap; }
.kit-menu-item:hover, .kit-menu-item:focus-visible { background: var(--panel-2); outline: none; }
.kit-menu-item.danger { color: var(--err-fg); }

/* a button's popover (kit/menu.js popover()): a small panel of controls under its button, its body scrolling in the room
   there is; below 1000 px a bottom sheet with Done (.kit-pop-layer › .kit-pop-scrim + .kit-pop). Under the scroll-focus
   ring (--z-popover), so its list gets the ring. The closing sheet keeps its pointer events: the tap that closed it must
   not land on a pane underneath during the fall. (Reduced motion: the tokens set the durations to 0.) */
.kit-pop { position: fixed; z-index: var(--z-popover); display: flex; flex-direction: column; min-width: 15em;
  max-width: min(24em, calc(100vw - 16px)); background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--radius); box-shadow: 0 8px 24px var(--scrim); outline: none; }
.kit-pop-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--s2); }
.kit-pop-layer { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: var(--z-popover); display: flex; align-items: flex-end;
  justify-content: center; }
.kit-pop-scrim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: var(--scrim); animation: kit-pop-fade var(--dur) ease both; }
.kit-pop-layer .kit-pop { position: relative; width: 100%; max-width: 560px; max-height: 80vh; max-height: 80dvh;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: 0 -8px 24px var(--scrim); animation: kit-sheet-rise var(--dur) var(--ease) both; }
.kit-pop-layer .kit-pop-body { padding: 0 var(--s4) calc(env(safe-area-inset-bottom) + var(--s4)); }
.kit-pop-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--s4);
  border-bottom: 1px solid var(--line); }
.kit-pop-layer.closing .kit-pop-scrim { animation: kit-pop-fadeout var(--dur-fast) ease forwards; }
.kit-pop-layer.closing .kit-pop { animation: kit-sheet-fall var(--dur-fast) cubic-bezier(.4, 0, 1, 1) forwards; }
@keyframes kit-sheet-rise { from { transform: translateY(100%); } to { transform: none; } }
@keyframes kit-sheet-fall { from { transform: none; } to { transform: translateY(100%); } }
@keyframes kit-pop-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes kit-pop-fadeout { from { opacity: 1; } to { opacity: 0; } }

/* ---------- picture zoom controls (js/stage/zoom.js zoomControls): −, the scale (= fit), + ---------- */
.zoombar { position: absolute; right: var(--s2); bottom: var(--s2); z-index: var(--z-pane-ui); display: flex; overflow: hidden;
  background: var(--scrim); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.zoombar button { min-width: 34px; height: 30px; padding: 0 var(--s2); border: 0; background: none; color: var(--text);
  font: inherit; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; cursor: pointer; }
.zoombar button + button { border-left: 1px solid var(--line); }
.zoombar [data-z="fit"] { min-width: 48px; }
.zoombar button:hover:not(:disabled) { background: var(--panel-3); }
.zoombar button:disabled { color: var(--faint); cursor: default; }
.zoombar button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (hover: none) and (pointer: coarse) { .zoombar button { min-width: 44px; height: 40px; } }   /* finger-sized */

/* the account picker (actions/accounts.js) and a few words of colour */
.picker-list { display: grid; gap: 2px; max-height: 14em; overflow-y: auto; }
.picker-list button { text-align: left; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2);
  color: var(--text); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.picker-list button:hover, .picker-list button:focus-visible { border-color: var(--accent); outline: none; }
.picker-chosen { margin: 2px 0 0; color: var(--ok-fg); font-size: var(--fs-sm); }
.ok-text { color: var(--ok-fg); }
fieldset.checks { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); border: 1px solid var(--line); border-radius: var(--radius); }

/* charts (kit/chart.js): at most 1200 px wide; the marks' colours by class (s-*), the key's swatches likewise */
.chart-box { max-width: 1200px; margin-top: var(--s2); }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .ax { fill: var(--chart-text); font-size: 10px; }
.chart .hit { fill: transparent; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: var(--s1); font-size: var(--fs-xs); color: var(--muted); }
.chart-legend i, i.sw { display: inline-block; width: 10px; height: 10px; margin-right: 4px; border-radius: 2px; vertical-align: -1px; }
.chart .s-avg { fill: var(--line-2); }
.chart-legend .s-avg { background: var(--line-2); }
.chart .s-act { fill: var(--accent); }
.chart-legend .s-act { background: var(--accent); }
.chart .s-typ { fill: none; stroke: var(--text); stroke-width: 1.4; stroke-dasharray: 4 3; opacity: .75; }
.chart-legend .s-typ { height: 0; border-top: 2px dashed var(--text); border-radius: 0; vertical-align: 3px; }
.chart .s-now { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 2 2; }
.chart .s-mark { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }

/* a form's fields side by side, as many as fit (one column on a narrow screen) */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s2) var(--s4); align-items: start; }
.page-back { margin: 0 0 var(--s2); font-size: var(--fs-sm); }
.page-back a { color: var(--muted); text-decoration: none; }
.page-back a:hover { color: var(--text); }
.probe-uri { font-size: var(--fs-sm); overflow-wrap: anywhere; }

.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }   /* a description keeps its own lines */
.row-acts { white-space: nowrap; text-align: right; }          /* a row's own buttons (Delete…) */

/* The "?" beside a setting (core/html.js helpTip): its explanation is a hover or a tap away, not words on the screen. */
.help-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
  margin-left: 4px; padding: 0; border: 1px solid var(--line-2); border-radius: 50%; background: none; color: var(--muted);
  font: 600 10px/1 var(--font-ui); vertical-align: 1px; cursor: help; }
.help-tip::before { content: ""; position: absolute; inset: -8px; }   /* a finger-sized target around a small mark */
.help-tip:hover, .help-tip:focus-visible { color: var(--text); border-color: var(--accent); outline: none; }
