/* The standard object side panel (web/templates/_panel.html, web/static/js/panel.js). Built on the app's tokens, so it
   follows the light and dark themes. A host carries data-sp-host; the panel itself is .sp. */

/* hosts: the stage column (topology views) and the list-page drawer; width is --sp-w, set and remembered by panel.js */
.phys-stage { grid-template-columns: 1fr var(--sp-w, 340px); }
.phys-stage.sp-collapsed { grid-template-columns: 1fr 56px; }
.drawer[data-sp-host] { width: var(--sp-w, min(620px, 46vw)); }
@media (max-width: 1000px) { .drawer[data-sp-host]:not(.sp-collapsed) { width: 100%; } }   /* a narrow window: the drawer covers the page, the remembered width waits */
.drawer.sp-collapsed { width: 56px; }
.ws.drawer-open.sp-collapsed .ws-main { margin-right: 56px; }
.phys-side[data-sp-host] { position: relative; }          /* the drawer is fixed already */
/* the pane is the container its tables answer to (container queries below), not the window (Jon, 2026-11-23) */
[data-sp-host] { container: sp-pane / inline-size; }
.sp-resizer { position: absolute; left: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 2; touch-action: none; }
.sp-resizer::after { content: ""; position: absolute; left: 2px; top: 50%; width: 3px; height: 32px; margin-top: -16px; border-radius: 2px; background: var(--border-strong); opacity: 0; transition: opacity .12s; }
.sp-resizer:hover::after, .sp-resizer:focus-visible::after, .sp-resizing .sp-resizer::after { opacity: 1; }
.sp-resizer:hover, .sp-resizing .sp-resizer { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.sp-resizer:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; background: color-mix(in srgb, var(--accent) 20%, transparent); }
.sp-resizing { user-select: none; }
.sp-collapsed .sp-resizer { display: none; }

.sp { display: flex; flex-direction: column; min-height: 100%; font-size: 13px; color: var(--text); }
.phys-side .sp { margin: -14px -16px -18px; }           /* the stage column's own padding: the panel brings its own */

/* 1. header */
.sp-head { padding: 16px 18px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.sp-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 8px; }
.sp-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
/* a narrow panel cannot hold the eyebrow beside the button group: the buttons keep the top right, the eyebrow takes
   its own line under them, above the title, and wraps rather than being cut */
@container sp (max-width: 560px) {
  .sp-bar { grid-template-columns: minmax(0, 1fr); }
  .sp-bar .sp-actions { order: -1; justify-self: end; }
}
.sp-actions { --grp-h: 32px; --grp-line: var(--border); flex: none; }
.sp-actions a.nb-btn { border: 0; border-radius: 0; background: var(--surface-2); height: auto; }                /* a member of the joined group: the group draws the line */
.sp-actions a.nb-btn:hover { background: var(--accent-soft); }
.sp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; min-height: 32px; box-sizing: border-box; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface-2); color: var(--title); font-size: 12.5px; font-weight: 500; line-height: 1; cursor: pointer; }
.sp-btn.sp-ico { width: 32px; min-width: 32px; padding: 0; color: var(--muted); }
.sp-btn i { font-size: 12px; }
/* a solid hover, not an outline: neutral buttons fill one step darker, the primary (NetBox) button fills with the accent */
.sp-btn { transition: background-color .14s ease, border-color .14s ease, color .14s ease; cursor: pointer; }
.sp-btn:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--title); text-decoration: none; }
/* the NetBox button in the action group is the shared hairline nb-btn (cinqstack.css), no longer a solid primary */
.sp-btn:active { background: var(--border-strong); }
.sp-btn:not(.sp-ico):active { background: var(--accent-hover, var(--accent)); border-color: var(--accent-hover, var(--accent)); }
.sp-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sp-btn.done { border-color: var(--success); color: var(--success-text); }
.sp-ident { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.sp-icon { width: 40px; height: 40px; flex: none; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: var(--neutral-soft); color: var(--neutral-text); }
.sp-icon.ok { background: var(--success-soft); color: var(--success-text); }
.sp-icon.warn { background: var(--warn-soft); color: var(--warn-text); }
.sp-icon.bad { background: var(--danger-soft); color: var(--danger-text); }
.sp-icon.info { background: var(--info-soft); color: var(--info-text); }
.sp-names { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
/* the name never breaks mid-word: it wraps at hyphens and spaces, and past two lines it is cut with an ellipsis (the
   title attribute carries the whole name) */
.sp-name { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.25; color: var(--title); overflow-wrap: normal; word-break: keep-all; hyphens: manual;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
/* as a page (a finding, a device) the name is the page's title: shown whole, wrapping anywhere a long host name needs (ee-19) */
.device-page .sp-name { display: block; -webkit-line-clamp: none; overflow: visible; overflow-wrap: anywhere; word-break: normal; }
.sp-kind { font-size: 13px; color: var(--muted); }
.sp-chips { display: flex; gap: 6px; flex-wrap: wrap; }
/* one pill size in a panel header (Jon via c7, 2026-11-11): a small pill passed in is drawn at the standard size */
.sp-chips .pill.sm { height: 22px; padding: 0 8px 0 6px; font-size: 12px; gap: 6px; }

/* the collapsed rail: 56px with the name and the count of things to look at */
.sp-rail { display: none; }
.sp-collapsed .sp-rail { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0; height: 100%; }
.sp-collapsed .sp-rail-name { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 13px; font-weight: 600; color: var(--title); max-height: 60%; overflow: hidden; text-overflow: ellipsis; }
.sp-collapsed .sp-rail-count { margin-top: auto; width: 24px; height: 24px; border-radius: var(--pill); background: var(--danger-soft); color: var(--danger-text); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.sp-collapsed .sp-head, .sp-collapsed .sp-body, .sp-collapsed .sp-foot { display: none; }
/* the cue (panel.js cue()): a different object came into the collapsed panel by the user's click. One pulse of the
   accent on the Expand button and the name, the chevron nudged towards the page; no fill mode, so nothing is held
   once it has played (no stacking context left behind) and the layout never moves. Reduced motion: the colour only. */
.sp-collapsed .sp-rail.sp-cue [data-sp-collapse] { animation: sp-cue-btn .9s ease-out var(--sp-cue-delay, 0s); }
.sp-collapsed .sp-rail.sp-cue [data-sp-collapse] i { animation: sp-cue-nudge .9s ease-in-out var(--sp-cue-delay, 0s); }
.sp-collapsed .sp-rail.sp-cue .sp-rail-name { animation: sp-cue-name .9s ease-out var(--sp-cue-delay, 0s); }
@keyframes sp-cue-btn {
  0%, 100% { background-color: var(--surface-2); border-color: var(--border); color: var(--muted); }
  25%, 55% { background-color: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
}
@keyframes sp-cue-nudge { 0%, 100% { transform: none; } 20% { transform: translateX(-4px); } 40% { transform: none; } 60% { transform: translateX(-2px); } 80% { transform: none; } }
@keyframes sp-cue-name { 0%, 100% { color: var(--title); } 25%, 55% { color: var(--accent); } }
@media (prefers-reduced-motion: reduce) { .sp-collapsed .sp-rail.sp-cue [data-sp-collapse] i { animation: none; } }

/* 2. key facts */
.sp-body { flex: 1; min-height: 0; }
/* the fact strip: icon + value chips in one row (about 32 px), wrapping when it must; values never truncated */
.sp-facts { display: flex; flex-wrap: wrap; gap: 0; padding: 0; border-bottom: 1px solid var(--border); }
.sp-fact { display: inline-flex; flex: 1 1 auto; align-items: center; gap: 7px; min-height: 34px; padding: 6px 14px; border: 0; border-right: 1px solid var(--border); border-radius: 0;
  background: none; color: var(--title); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; min-width: 0; }
.sp-fact:last-child { border-right: 0; }
.sp-fact > i:first-child { color: var(--muted); font-size: 12px; width: 13px; text-align: center; flex: none; }
.sp-fact > .cs-i:first-child { color: var(--muted); width: 13px; height: 13px; }
.sp-icon .cs-i { width: 18px; height: 18px; }
/* the device's front picture in place of the icon (Jon, 2026-11-20): letterboxed on the surface, never stretched; a 1U
   front gets up to 112 px of width, a PLC or HMI stays narrow; the icon underneath shows only if the picture fails */
.sp-icon.sp-pic { width: auto; min-width: 40px; max-width: 120px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); }
.sp-icon.sp-pic img { display: block; height: 100%; width: auto; max-width: 112px; object-fit: contain; }
.sp-icon.sp-pic .sp-pic-ico { display: none; }
.sp-fact > span { overflow-wrap: anywhere; white-space: normal; }
.sp-fact.off { color: var(--muted); } .sp-fact.off > i:first-child { color: var(--faint); }
.sp-fact.warn { color: var(--warn-text); } .sp-fact.warn > i:first-child { color: var(--warn-text); }
.sp-fact.bad { color: var(--danger-text); } .sp-fact.bad > i:first-child { color: var(--danger-text); }
.sp-fact-ok { color: var(--success); font-size: 11px; }

/* 3. sections: all collapsible, one heading style */
.sp-section { border-bottom: 1px solid var(--border); }
.sp-section-head { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 18px; background: var(--band); cursor: pointer; }
.sp-section[open] > .sp-section-head { border-bottom: 1px solid var(--border); }
.sp-section-head::-webkit-details-marker { display: none; }
.sp-section-head::before { content: none; }              /* the app's own summary chevron: the panel has its own on the right */
.sp-section-head h3 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sp-section-head .sp-count { font-weight: 500; letter-spacing: 0; text-transform: none; }
.sp-section-head i { color: var(--muted); font-size: 12px; transition: transform .15s; }
.sp-section:not([open]) .sp-section-head i { transform: rotate(-90deg); }
.sp-section-head:hover h3 { color: var(--title); }
.sp-section-body { padding: 0 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.sp-kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 12px; margin: 0; }
.sp-kv dt { color: var(--muted); } .sp-kv dd { margin: 0; color: var(--title); min-width: 0; overflow-wrap: anywhere; }
.sp-kv dd.mono { font-family: var(--font-mono); font-size: 12.5px; white-space: normal; overflow-wrap: anywhere; }   /* addresses and identifiers never get an ellipsis */
.sp-kv dt .cs-fi { margin-right: 5px; }
.sp .mono { overflow-wrap: break-word; }      /* a name, a port, a NIC breaks only when it cannot fit, never to squeeze a column */
/* a "to look at" item: a soft tinted block, state in the content, never an edge stripe */
.sp-issue { border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--border)); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.sp-issue.warn { border-color: color-mix(in srgb, var(--warn) 28%, var(--border)); background: color-mix(in srgb, var(--warn) 6%, var(--surface)); }
.sp-issue strong { color: var(--title); font-weight: 600; }
.sp-issue .mono { color: var(--muted); }

/* 4. actions last */
.sp-foot { margin-top: auto; padding: 14px 18px 18px; background: var(--surface-2); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.sp-foot strong { color: var(--title); }
.sp-foot .row { display: flex; gap: 8px; }
.sp-foot form.cg-ack { display: flex; flex-direction: column; gap: 12px; }
.sp-foot form.cg-ack button.primary { align-self: flex-start; margin-top: 2px; }
/* list rows in a panel: the area fills on hover, the text stays as it is */
.sp-body .dp-links > li { border-radius: var(--radius); transition: background-color .15s ease; }
.sp-body .dp-links > li:hover { background: var(--surface-2); }
.sp-body .timeline .tl-top a:hover { text-decoration: none; }
/* the small icon before a field label (web/field_icons.py), shared with the device panel tabs */
.cs-fi { display: inline-block; width: 14px; margin-right: 6px; color: var(--muted); font-size: 12px; text-align: center; }
.sp-foot .row > label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); flex: 1; }
.sp-foot .row > label.wide { flex: 2; }
.sp-foot input { width: 100%; box-sizing: border-box; }

/* on a phone the panel is a bottom sheet */
@media (max-width: 900px) {
  .phys-stage, .phys-stage.sp-collapsed { grid-template-columns: 1fr; }   /* collapsed too: no 56 px column beside the drawing */
  [data-sp-host] { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto !important; max-height: 72vh; margin: 0; z-index: 40;
    border: 1px solid var(--border); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow-lg); overflow: auto; background: var(--surface); }
  .sp-resizer { display: none; }
  .sp-collapsed[data-sp-host] { max-height: 56px; }
  .sp-collapsed .sp-rail { flex-direction: row; padding: 10px 14px; height: 56px; }
  .sp-collapsed .sp-rail-name { writing-mode: horizontal-tb; transform: none; }
  .sp-collapsed .sp-rail-count { margin-top: 0; margin-left: auto; }
}

/* -- the trail: "← <object> · <tab>" above the action bar, crumbs before it past one step ------------------------------ */
.sp .sp-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; padding: 8px 14px 0; }
.sp .sp-back { display: inline-flex; align-items: center; gap: 6px; min-height: 0; padding: 3px 8px 3px 6px; border: 1px solid transparent; border-radius: var(--radius);
  background: none; color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; max-width: 100%; }
.sp .sp-back > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp .sp-back:hover { background: var(--accent-soft); color: var(--accent); }
.sp .sp-back i { font-size: 11px; }
.sp .sp-back-tab { color: var(--muted); font-weight: 400; }
.sp .sp-trail { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.sp .sp-trail i { font-size: 8px; color: var(--faint); }
.sp .sp-crumb { min-height: 0; padding: 2px 5px; border: 0; border-radius: var(--radius); background: none; color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer; }
.sp .sp-crumb:hover { color: var(--accent); background: var(--accent-soft); }

/* -- tabs, for a panel whose parts are each a fetch (the inventory device): quiet text tabs on one rule ---------------- */
/* Jon's lab verdict (2026-11-12) on the boxed, segmented version: restyled as quiet tabs. Plain text, no boxes and no borders
   between them; one 1px rule under the whole row in the panel's rule colour; the active tab in ink at 600 with a 2px accent
   underline sitting on that rule; inactive muted, hover ink; the count before the word in the same font with tabular figures,
   slightly muted; an empty tab muted further, without a count. The row scrolls sideways on a phone and never wraps. */
.sp-tabs { display: flex; align-items: stretch; flex-wrap: nowrap; gap: 0; overflow-x: auto; scrollbar-width: none; padding: 0 18px; background: var(--surface); border-bottom: 1px solid var(--border); }
.sp-tabs::-webkit-scrollbar { display: none; }
.sp-tabs a.sp-tab { display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 1px; margin-right: 18px; font-size: 13px; font-weight: 500; color: var(--muted);
  white-space: nowrap; text-decoration: none; background: none; border: 0; border-radius: 0; box-shadow: inset 0 -2px 0 transparent; transition: color .14s ease, box-shadow .14s ease; }
.sp-tabs a.sp-tab:last-child { margin-right: 0; }
.sp-tabs a.sp-tab b { font-family: inherit; font-size: inherit; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sp-tabs a.sp-tab.is-empty { color: color-mix(in srgb, var(--muted) 72%, transparent); }
.sp-tabs a.sp-tab:hover { color: var(--title); background: none; text-decoration: none; }
.sp-tabs a.sp-tab:hover b { color: var(--title); }
.sp-tabs a.sp-tab.is-on { color: var(--title); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.sp-tabs a.sp-tab.is-on b { color: var(--title); font-weight: 600; }
.sp-tabs a.sp-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sp-tab-body { padding: 12px 18px 16px; }
.sp-tab-body > .dp-filter { margin-bottom: 8px; }
.sp-tab-body .dp-jump { margin-top: 12px; }
.sp-tab-body .dp-card { margin: 0 0 12px; }
.sp-tab-body .dp-image { margin: 0 0 12px; }
/* a view's own sections in the device panel (Physical's cable paths, Logical's connections, Virtual's VMs): full width,
   as the panel's own sections are, not boxes inset in the tab (3c's fresh-eyes pass) */
.sp-tab-body > .sp-dev-extra { margin: 0 -18px 12px; border-top: 1px solid var(--border); }
.sp-tab-body > .sp-dev-extra:first-child { margin-top: -12px; border-top: 0; }

/* -- "Open in": the views of this object, one joined group under the fact strip --------------------------------------- */
.sp-open { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.sp-open-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sp-open .btn-group { flex-wrap: nowrap; max-width: 100%; }   /* one row: the group's outline is never clipped (icons only when narrow) */
.sp-open .button.small { min-height: 0; height: auto; padding: 4px 10px; font-size: 12.5px; }   /* fills the 30 px group's content box, whatever the display scale makes of its 1 px outline */
.sp-open .button.is-disabled { pointer-events: auto; }
.sp-tab-body .dp-image { padding: 8px 10px; margin: 0 0 12px; }
.sp-tab-body .dp-image img { max-height: 120px; }

/* -- the panel is a size container: when narrow, tabs show icon + count and "Open in" shows icons (labels in tooltips) -- */
.sp { container: sp / inline-size; }
.sp-open .button > span { white-space: nowrap; }
@container sp (max-width: 560px) {
  .sp-tabs { padding: 0 14px; flex-wrap: wrap; overflow: visible; }
  .sp-tabs a.sp-tab { margin-right: 14px; height: 34px; }      /* a narrow panel: the tabs wrap onto a second row, every tab in view
                                                                   (ee's visitor walk, 2026-11-12: a sideways row read "rview" and "Chang") */
}
/* "Open in" keeps its labels whenever they fit the panel's width (the "Open in" word then takes a line of its own) and
   shows icons only, labels in the tooltips, when they truly do not: panel.js measures the group and sets .is-tight
   (3c's note via c7, 2026-11-14: a fixed 520 px container query hid them in every 340 px stage panel) */
.sp-open.is-snug .button.small { padding: 4px 7px; font-size: 11.5px; letter-spacing: -.005em; }   /* first a tighter group, labels kept */
.sp-open.is-tight .button > span { display: none; }
.sp-open.is-tight .button.small { padding: 4px 9px; font-size: 12.5px; }
.sp-head, .sp-facts, .sp-open, .sp-tabs { max-width: 100%; min-width: 0; }

/* -- "ultra" Details: compact blocks with mono eyebrows (WHERE · WHAT · NETWORK · RECORD); a NetBox mark after a name shows always -- */
.sp-dl { padding: 2px 0 8px; }
.sp-dl + .sp-dl { border-top: 1px solid var(--border); padding-top: 10px; }
.sp-dl-eyebrow { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.sp-dl-row { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 4px 12px; padding: 3px 0; align-items: baseline; }
.sp-dl-row dt { color: var(--muted); font-size: 12.5px; margin: 0; } .sp-dl-row dt .cs-fi { margin-right: 5px; width: 12px; text-align: center; }
.sp-dl-row dd { margin: 0; color: var(--title); min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sp-dl-row dd.muted { color: var(--muted); }
.sp-copy { opacity: 0; transition: opacity .12s ease; }
.sp-copyable:hover .sp-copy, .sp-copy:focus-visible { opacity: 1; }
.sp-copyable { display: inline-flex; align-items: center; gap: 4px; }
.sp-copy { min-height: 0; width: 20px; height: 20px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 11px; display: inline-grid; place-items: center; border-radius: var(--radius); cursor: pointer; }
.sp-copy:hover { color: var(--accent); background: var(--accent-soft); box-shadow: none; } .sp-copy.done { color: var(--success); }
.sp-check { display: inline-flex; align-items: center; } .sp-check .cs-sign { cursor: help; }
.sp-path { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; font-size: 13px; }
.sp-path-seg { display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.sp-path-seg > a:not(.nb-mark), .sp-path-seg > span { display: inline-flex; align-items: center; gap: 5px; color: var(--title); text-decoration: none; }
.sp-path-seg > a:not(.nb-mark):hover { color: var(--accent); } .sp-path-seg > a > i, .sp-path-seg > span > i { color: var(--muted); font-size: 11px; }
.sp-path-sep { font-size: 8px; color: var(--faint); margin: 0 2px; }
.sp-path a.nb-mark[href] { margin-left: 5px; }
.sp-role-sq { display: inline-block; width: 8px; height: 8px; background: var(--c, var(--border-strong)); flex: none; }
.sp-vendor { display: inline-grid; place-items: center; width: 20px; height: 20px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 10px; flex: none; }
.sp-ladder { display: inline-flex; flex-direction: column; gap: 1.5px; width: 14px; flex: none; vertical-align: middle; }
.sp-ladder i { display: block; height: 2px; background: color-mix(in srgb, var(--c) 22%, var(--border)); }
.sp-ladder i.on { background: var(--c); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent); }
.sp-ladder-text { margin-left: 2px; }

/* touch screens (3c's 390 sweep, 2026-11-14): the panel's own buttons (NetBox, copy, expand, close) and the "Open in"
   icons were 31-32 px; a finger needs 40 */
@media (pointer: coarse) {
  .sp-actions.sp-actions, .sp-open .btn-group.btn-group { --grp-h: 40px; }   /* doubled: over the group's own height */
  .sp-actions > :is(a, button, .sp-btn), .sp-open .btn-group > :is(a, button, span) { min-width: 40px; }
}

/* Nothing cut off at any pane width (Jon, 2026-11-23: in a 500 px pane the Interfaces table lost "Speed" and "Connected
   to", the switch tables broke "Gig-E 1" into three lines and ran past their cards). Below 540 px of pane the panel's
   tables take a compact form, by the pane's width and not the window's: an interface on one line with its mode and
   VLANs, its speed and far end on the next; an uplink as one block ("Gig-E 1 vmnic0 · 10 Gb/s", the far end, its
   VLANs); a port group with its VLAN and VM count on a line and its VMs under it. The other tables scroll inside their
   own box. The tab bar wraps. The pane itself never scrolls sideways. */
/* a name never breaks inside itself, not even at its hyphens ("cm-ein-fsw-" / "01"): the table goes compact first */
.sp .dp-table :is(a[data-device-link], .nb-name), .sp .dp-vsw-groups .nb-name { white-space: nowrap; }
@container sp-pane (max-width: 540px) {
  .sp-tabs { flex-wrap: wrap; overflow: visible; row-gap: 0; }
  .dp-table:has(td[data-label]) { display: block; }
  .dp-table:has(td[data-label]) thead { display: none; }
  .dp-table:has(td[data-label]) tbody { display: block; }
  .dp-table:has(td[data-label]) tbody > tr { display: flex; flex-wrap: wrap; column-gap: 14px; row-gap: 3px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
  .dp-table:has(td[data-label]) tbody > tr > td { display: block; flex: 1 1 40%; border: 0; padding: 0; min-width: 0; text-align: left; white-space: normal; overflow-wrap: break-word; }
  .dp-table:has(td[data-label]) td[data-label="Speed"] { flex: 0 0 auto; }
  .dp-table:has(td[data-label]) td[data-label="Connected to"] { flex: 1 1 55%; }
  .dp-table:has(td[data-label]) td[data-label="Speed"]::before, .dp-table:has(td[data-label]) td[data-label="Connected to"]::before { content: attr(data-label) " "; color: var(--muted); }
  .dp-table:has(td[data-label]) tbody > tr.dp-under { display: block; padding-top: 0; }
  .dp-table:has(td[data-label]) tbody > tr:has(+ tr.dp-under) { border-bottom: 0; padding-bottom: 2px; }
  .dp-table:has(td[data-label]) tr.dp-under > td { padding-left: 0; }
  .dp-table:has(td[data-label]).is-capped:not(.is-all):not(.is-filtering) tr.dp-more { display: none; }
  .dp-table:not(:has(td[data-label])) { display: block; max-width: 100%; overflow-x: auto; }
  .dp-vsw-groups { display: block; border: 0; }
  .dp-vsw-groups thead { display: none; }
  .dp-vsw-groups tbody { display: block; }
  .dp-vsw-groups tbody > tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 10px; padding: 7px 10px; border: 1px solid var(--border); border-top: 0; }
  .dp-vsw-groups tbody > tr:first-child { border-top: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
  .dp-vsw-groups tbody > tr:last-child { border-radius: 0 0 var(--radius) var(--radius); }
  .dp-vsw-groups tbody > tr > td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: break-word; }
  .dp-vsw-groups.is-uplinks tbody > tr { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
  .dp-vsw-groups.is-uplinks td:first-child > div { display: inline; }
  .dp-vsw-groups.is-uplinks td:first-child > div:not(:empty)::before { content: " · "; }
}

/* A device panel while the inventory panel loads (panel.js waiting(); point 17, 2026-11-24): the panel's own frame, the
   head as it will be, the kind line, chips, Open in bar and tabs holding their places in a quiet tone, the body a few
   still bars that breathe slowly; nothing above the tab bar moves when the panel comes */
.sp.is-waiting .sp-wait { color: transparent; background: var(--neutral-soft); border-color: transparent; border-radius: 2px; box-shadow: none; }
.sp.is-waiting .sp-icon.sp-wait-ico i { visibility: hidden; }
.sp.is-waiting .sp-wait::before, .sp.is-waiting .sp-wait::after, .sp.is-waiting .sp-wait > * { visibility: hidden; }
.sp.is-waiting .sp-wait-bar { opacity: .45; pointer-events: none; }
.sp-loading { display: grid; gap: 10px; padding: 16px 18px; }
.sp-loading i { display: block; width: var(--w, 100%); height: var(--h, 10px); border-radius: 2px; background: var(--neutral-soft); animation: sp-wait 1.4s ease-in-out infinite alternate; }
@keyframes sp-wait { from { opacity: .5; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sp-loading i { animation: none; } }
