/*
  The console shell's stylesheet (monitor/console): the page, the sidebar, the status bar, the
  dialogs (wizard, one-step confirm, step-up), the pagers and filter chips. Loaded after the theme's
  custom properties (`/static/theme.<digest>.css`) and before the app's own stylesheets, which may
  build on it but never restate it. billing copies this file verbatim (console/manifest.py).
*/

* { box-sizing: border-box; }
/* The inlined icon sprite (_icons.html) is the first child of <body>. `hidden` is an HTML
       attribute and the browser does not apply it to an <svg>, so without this rule the sprite
       lays out as a 150px block above the header -- the "gap in the header". */
#icon-sprite { display: none; }
html { background: var(--bg); }
body {
      margin: 0;
      min-height: 100vh;
      color: var(--fg);
      font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
      background:
        radial-gradient(1200px 600px at 10% -10%, rgb(126 184 255 / 14%), transparent 55%),
        radial-gradient(900px 500px at 110% 0%, rgb(157 140 255 / 12%), transparent 50%),
        var(--bg);
    }
a { color: var(--accent); }
main {
      max-width: 52rem;
      margin: 0 auto;
      padding: 2rem 1.25rem 5rem;
    }
body.gui main {
      max-width: 92rem;
      padding-top: 3.25rem;
    }
.site-head {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 10000;
      display: grid;
      grid-template-columns: minmax(0, max-content) minmax(0, 1fr) minmax(0, max-content) minmax(0, max-content);
      align-items: center;
      gap: 0.35rem 0.65rem;
      padding: 0.4rem 1.25rem;
      border-bottom: 1px solid var(--line);
      background: color-mix(in oklab, var(--panel) 92%, var(--bg));
      color: var(--muted);
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      font-size: 0.78rem;
    }
.site-head h1 {
      justify-self: start;
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      gap: 0.35rem;
      font-family: inherit;
      font-size: inherit;
      font-weight: 500;
      letter-spacing: 0;
      margin: 0;
      min-width: 0;
      white-space: nowrap;
    }
.site-head-cluster {
      display: flex;
      flex-wrap: nowrap;
      min-width: 0;
      overflow: hidden;
      align-items: center;
      justify-content: center;
      gap: 0.35rem 0.65rem;
    }
.site-head-cluster > span:not(.status-sep) {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
    }
.site-head-end {
      justify-self: end;
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      justify-content: flex-end;
      gap: 0.35rem 0.65rem;
      font-family: inherit;
      font-size: inherit;
      font-weight: 500;
      color: inherit;
      min-width: 0;
      overflow: hidden;
    }
.site-head-end > span {
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }
/* The hostname is never clipped: the h1 column is max-content, and the middle cluster
       (rtt / uptime / load) is the one that gives way. On a phone it wraps instead. */
#status-host {
      overflow: visible;
      text-overflow: clip;
      max-width: none;
    }
@media (max-width: 52rem) {
  .site-head h1 { white-space: normal; flex-wrap: wrap; }
  #status-host { overflow-wrap: anywhere; }
}
.status-bar {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 10000;
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      gap: 0.35rem 0.65rem;
      padding: 0.4rem 1.25rem;
      border-top: 1px solid var(--line);
      background: color-mix(in oklab, var(--panel) 92%, var(--bg));
      color: var(--muted);
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      font-size: 0.78rem;
    }
/* Each span is pinned to its column, so docs / who stays at the right edge whatever else
       the bar is or is not rendering (guest view, no windows). */
.status-start {
      grid-column: 1;
      justify-self: start;
      display: inline-flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.45rem 0.55rem;
      min-width: 0;
    }
.status-start button, .status-end button {
      appearance: none;
      border: 0;
      background: transparent;
      color: var(--accent);
      cursor: pointer;
      font: inherit;
      padding: 0;
    }
.status-start button:hover, .status-end button:hover { color: var(--fg); }
.status-start button.is-down, .status-end button.is-down, .site-head-end span.is-down { color: var(--bad); }
.status-start button.is-warn, .status-end button.is-warn { color: var(--warn); }
.status-start [hidden], .status-end [hidden] { display: none !important; }
.status-end {
      grid-column: 3;
      position: relative;
      justify-self: end;
      display: inline-flex;
      align-items: center;
      gap: 0.75rem;
    }
#status-time {
      justify-self: end;
      white-space: nowrap;
      font-variant-numeric: tabular-nums;
    }

:root {
  --nav-w: 15.5rem;
  --nav-w-rail: 3.5rem;
  --z-nav: 9000;          /* under .site-head (10000), over --z-overlay (400) */
  --z-inspect: 200;
  --z-window-max: 399;
  --z-overlay: 400;
}
html {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklab, var(--muted) 55%, var(--line)) var(--panel);
}
body.gui main { max-width: none; }
.status-start a {
  color: var(--accent);
  text-decoration: none;
}
.status-start a:hover,
.status-start a.is-active { color: var(--fg); }
.status-start button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.status-start button:hover { color: var(--fg); }
.site-head .chip { font-size: 0.82rem; }
html { overflow-x: hidden; }
.table-pager {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}
.table-pager[hidden] {
  display: none !important;
}
.table-pager label,
.table-pager select,
.table-pager button {
  flex: 0 0 auto;
}
.table-pager label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.table-pager[hidden] {
  display: none !important;
}
.table-pager select {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  min-width: 5rem;
  padding: 0.22rem 1.55rem 0.22rem 0.5rem;
  margin-right: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--bg);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 0.85rem) 50%, calc(100% - 0.55rem) 50%;
  background-size: 0.3rem 0.3rem, 0.3rem 0.3rem;
  background-repeat: no-repeat;
  color: inherit;
  font: inherit;
}
.table-pager-bar {
  display: flex;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 0.55rem;
  margin: 0 0 0.45rem;
}
.table-pager-bar-bottom {
  margin: 0.45rem 0 0;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.22rem 0.4rem;
}
.pager-btn svg {
  display: block;
}
.who-menu {
  position: fixed;
  z-index: var(--z-overlay);
  min-width: 10rem;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 8px 24px color-mix(in oklab, #000 25%, transparent);
}
.who-menu button {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
}
.who-menu button:hover { color: var(--fg); background: color-mix(in oklab, var(--panel-2) 80%, transparent); }
.status-end #status-who {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.status-end #status-who:hover { color: var(--fg); }
.status-end #status-who::after {
  content: " ▾";
  font-size: 0.65em;
  opacity: 0.7;
}
.tab-badge {
  display: inline-block;
  min-width: 1.15em;
  margin-left: 0.35em;
  padding: 0 0.35em;
  border-radius: 999px;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1.35;
  background: var(--bad);
  color: var(--bg);
  vertical-align: middle;
}
.tab-badge[hidden] { display: none !important; }
.site-head-end span.is-down { color: var(--bad); }
.status-start button.is-down { color: var(--bad); }
.status-end button.is-down { color: var(--bad); }
.status-end button.is-warn { color: var(--warn); }
body.gui #console-pop-host {
  position: fixed;
  z-index: var(--z-overlay);
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: color-mix(in oklab, var(--bg) 55%, transparent);
}
body.gui #console-pop-host[hidden] {
  display: none !important;
}
body.gui #console-pop-host .pop-confirm,
body.gui #console-pop-host .stepup {
  pointer-events: auto;
  z-index: var(--z-overlay);
  min-width: min(28rem, calc(100vw - 2rem));
  max-width: 36rem;
  margin: 0;
  box-shadow: 0 8px 32px color-mix(in oklab, #000 45%, transparent);
}
body.gui #console-pop-host .stepup {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--panel) 92%, transparent);
}
/* The console's confirm: the same card as a wizard dialog (dialog.wz), sized like dialog.wz-sm. */
body.gui .pop-confirm {
  width: min(32rem, calc(100vw - 2rem));
  margin: 0.65rem 0 0.35rem;
  padding: 1rem 1.1rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
body.gui #console-pop-host .pop-confirm {
  box-shadow: 0 18px 60px color-mix(in oklab, #000 45%, transparent);
}
body.gui .pop-confirm-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 650;
}
body.gui .pop-confirm-copy {
  margin: 0 0 0.85rem;
  color: var(--fg);
}
body.gui .pop-confirm-type,
body.gui .pop-confirm-note,
body.gui .pop-confirm-prompt {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 0.65rem;
}
/* "Type delete to confirm" over a full-width box, the way Cloudflare and DigitalOcean ask. */
body.gui .pop-confirm-type,
.wz-confirm .wz-body label.wz-word {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
}
body.gui .pop-confirm-type strong,
.wz-word strong {
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
body.gui .pop-confirm-note {
  flex-direction: column;
  align-items: stretch;
}
body.gui .pop-confirm-note textarea {
  min-height: 4rem;
  resize: vertical;
}
body.gui .pop-confirm-actions {
  justify-content: flex-end;
}
/* The console's wizard (console/_wizard.html; console/js/wizard.js opens it as a modal). */
dialog.wz {
  width: min(56rem, 94vw);
  max-height: min(88vh, 60rem);
  padding: 0;
  display: flex;
  flex-direction: column;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 60px color-mix(in oklab, #000 45%, transparent);
  overflow: hidden;
}
dialog.wz:not([open]) { display: none; }
/* A one-step confirm (console/_modal.html): the same dialog, narrower. */
dialog.wz.wz-sm { width: min(32rem, 94vw); }
.wz-confirm { display: flex; flex-direction: column; min-height: 0; }
.wz-confirm .wz-body label { display: flex; flex-direction: column; gap: 0.3rem; margin: 0 0 0.75rem; }
.wz-confirm .wz-body textarea { min-height: 4.5rem; resize: vertical; }
.wz-confirm .wz-foot { justify-content: flex-end; }
/* Find strays: "Select all" and the count on one line, above the two sections. */
.wz-confirm .strays-bar { display: flex; align-items: center; gap: 1rem; margin: 0.75rem 0; }
.wz-confirm .wz-body label.strays-all { flex-direction: row; align-items: center; gap: 0.5rem; margin: 0; }
.wz-confirm .strays-result { margin: 0.5rem 0; color: var(--ok); }
dialog.wz::backdrop { background: color-mix(in oklab, var(--bg) 62%, transparent); }
/* Inside the open wizard the confirm host is a child of the dialog (see wizard.js), still fixed over
   the viewport. */
dialog.wz > #console-pop-host { position: fixed; }
.wz-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.1rem 0.6rem;
}
.wz-head h2 { margin: 0; font-size: 1.15rem; font-weight: 650; }
.wz-draft { margin: 0 1.1rem 0.35rem; display: flex; gap: 0.5rem; align-items: center; }
.wz-steps {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0.35rem 1.1rem 0.75rem;
  gap: 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.wz-step { flex: 1 1 0; min-width: 6.5rem; display: flex; align-items: center; }
.wz-step + .wz-step::before {
  content: "";
  flex: 1 1 auto;
  height: 2px;
  margin: 0 0.4rem;
  background: var(--line);
}
.wz-step.is-done + .wz-step::before,
.wz-step.is-current::before { background: var(--accent); }
.wz-step-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.3rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  white-space: nowrap;
}
.wz-num {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 2px solid var(--line);
  font-size: 0.85rem;
  font-weight: 650;
}
.wz-step.is-done .wz-num { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 22%, transparent); }
.wz-step.is-current .wz-num { border-color: var(--accent); background: var(--accent); color: var(--bg); }
.wz-step.is-current .wz-step-btn { color: var(--fg); font-weight: 650; }
.wz-note { margin: 0.6rem 1.1rem 0; }
.wz-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.wz-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0.9rem 1.1rem; }
.wz-foot {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.1rem;
  border-top: 1px solid var(--line);
}
.wz-count { margin-right: auto; order: -1; }
.wz-after { padding: 0 1.1rem 1rem; overflow-y: auto; max-height: 30vh; }
.wz-danger { margin-top: 1rem; }
@media (prefers-reduced-motion: no-preference) {
  dialog.wz[open] { animation: wz-in 140ms ease-out; }
}
@media (max-width: 40rem) {
  dialog.wz { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .wz-label { display: none; }
  .wz-step.is-current .wz-label { display: inline; }
}
.wz-step-body h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}
.wz-step-body .lede {
  margin: 0 0 1rem;
  max-width: 42rem;
  line-height: 1.45;
  color: var(--muted, inherit);
}
.filter-chip { display: inline-flex; align-items: center; cursor: pointer; color: var(--muted);
  padding: 0.28rem 0.6rem; border-radius: 10px; }
/* The same chip for a checkbox (several chosen at once, e.g. the Runs looking-glass picks). */
.filter-chip > input[type="radio"],
.filter-chip > input[type="checkbox"] {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.filter-chip:hover { color: var(--fg); }
.filter-chip:has(> input:checked) {
  color: var(--fg); font-weight: 650;
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  box-shadow: inset 2px 0 0 var(--accent);
}
.filter-chip:has(> input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* htmx's in-flight class. includeIndicatorCSS is false, so this is the only definition: one rule
   instead of the hx-pending / hx-browser-indicator extensions, and it cannot touch --z-*. */
.hx-busy { cursor: progress; }
.hx-busy button, .hx-busy input, .hx-busy select { cursor: progress; }
button.hx-busy, a.hx-busy { opacity: 0.6; }
@media (prefers-reduced-motion: no-preference) {
  button.hx-busy, a.hx-busy { transition: opacity 120ms ease; }
}
/* Left sidebar (console/_home_nav.html, items from the app's NavTree).
   Selection is [aria-current="page"] -- deliberately NOT .is-open, which is the in-pane tab
   vocabulary; keeping the two apart is what makes the JS selectors unambiguous. */
.home-nav {
  grid-column: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--panel) 88%, transparent);
  box-shadow: var(--shadow);
}
/* The head holds only the phone drawer's menu button; on desktop there is nothing to collapse. */
.home-nav-head { display: none; flex: 0 0 auto; padding: 0.3rem 0.35rem; border-bottom: 1px solid var(--line); }
.home-nav-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0.4rem 0.35rem; }
.home-nav-foot { flex: 0 0 auto; padding: 0.3rem 0.35rem; border-top: 1px solid var(--line); }
.home-nav-menu {
  appearance: none; width: 100%; display: flex; align-items: center; gap: 0.45rem;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  padding: 0.35rem 0.5rem; border-radius: 10px; font: inherit; font-size: 0.78rem;
}
.home-nav-menu:hover { color: var(--fg); background: color-mix(in oklab, var(--accent) 10%, transparent); }
/* Section titles you can find at a glance: larger, brighter, and set off by a hairline. */
.home-nav-group + .home-nav-group { margin-top: 0.9rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }
.home-nav-group-label {
  margin: 0 0 0.3rem; padding: 0 0.55rem;
  font: 700 0.72rem/1.4 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: color-mix(in oklab, var(--fg) 75%, var(--muted));
}
.home-nav-list { list-style: none; margin: 0; padding: 0; }
.home-nav-item[hidden] { display: none; }
.home-nav-row { display: flex; align-items: stretch; gap: 0.1rem; }
.home-nav-link {
  position: relative; flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.38rem 0.55rem; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 0.86rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Each section's icons carry its own colour, so the groups read apart at a glance; the label stays
   muted until hovered or current. */
.home-nav-group { --nav-tone: var(--accent); }
.home-nav-group[data-nav-group="platform"] { --nav-tone: var(--cyan); }
.home-nav-group[data-nav-group="admin"] { --nav-tone: var(--violet); }
.home-nav-link { transition: background-color 120ms ease, color 120ms ease; }
.home-nav-link .home-nav-icon {
  color: color-mix(in oklab, var(--nav-tone, var(--accent)) 80%, var(--muted));
  transition: color 120ms ease, transform 120ms ease;
}
.home-nav-link:hover {
  color: var(--fg);
  background: color-mix(in oklab, var(--nav-tone, var(--accent)) 14%, transparent);
}
.home-nav-link:hover .home-nav-icon,
.home-nav-link[aria-current="page"] .home-nav-icon { color: var(--nav-tone, var(--accent)); }
.home-nav-link:hover .home-nav-icon { transform: translateX(1px) scale(1.08); }
@media (prefers-reduced-motion: reduce) {
  .home-nav-link, .home-nav-link .home-nav-icon { transition: none; }
  .home-nav-link:hover .home-nav-icon { transform: none; }
}
.home-nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.home-nav-link[aria-current="page"] {
  color: var(--fg); font-weight: 650;
  background: color-mix(in oklab, var(--nav-tone, var(--accent)) 18%, transparent);
  box-shadow: inset 2px 0 0 var(--nav-tone, var(--accent));
}
/* The parent of the current child: the trail is visible, but only one link claims the page. */
.home-nav-link.is-branch { color: var(--fg); background: color-mix(in oklab, var(--accent) 7%, transparent); }
.home-nav-icon { flex: 0 0 auto; display: inline-flex; }
.home-nav-icon .i { display: block; }
.home-nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.home-nav-link .tab-badge { margin-left: auto; flex: 0 0 auto; }
.home-nav-link.is-alert { color: var(--bad); font-weight: 700; }
.home-nav-link.is-alert[aria-current="page"] {
  background: color-mix(in oklab, var(--bad) 20%, transparent);
  box-shadow: inset 2px 0 0 var(--bad);
}
.home-nav-twisty {
  flex: 0 0 auto; width: 1.5rem; display: inline-flex; align-items: center; justify-content: center;
  appearance: none; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; border-radius: 8px;
}
.home-nav-twisty:hover { color: var(--fg); }
.home-nav-twisty .i { transition: transform 120ms ease; }
.home-nav-twisty[aria-expanded="true"] .i { transform: rotate(90deg); }
.home-nav-sub {
  list-style: none; margin: 0.1rem 0 0.3rem 1.05rem; padding: 0 0 0 0.5rem;
  border-left: 1px solid var(--line);
}
.home-nav-sub[hidden] { display: none; }
.home-nav-link-sub { font-size: 0.82rem; padding-block: 0.3rem; gap: 0.4rem; }
/* Every level has its icon; below the top they are smaller and quieter so the tree still reads as
   a tree. A third level nests one step further in and a touch smaller. */
.home-nav-link-sub .home-nav-icon { opacity: 0.8; }
.home-nav-sub .home-nav-sub { margin-left: 0.55rem; }
.home-nav-link-l3 { font-size: 0.78rem; padding-block: 0.25rem; }
/* The drag handle of a top-level item: shown on hover or focus, the item itself is what drags. */
.home-nav-grip {
  flex: 0 0 auto; display: inline-flex; align-items: center; padding: 0 0.1rem;
  color: var(--muted); opacity: 0; cursor: grab;
}
.home-nav-item[data-nav-order]:hover > .home-nav-row > .home-nav-grip,
.home-nav-item[data-nav-order]:focus-within > .home-nav-row > .home-nav-grip { opacity: 0.7; }
.home-nav-item.is-dragging { opacity: 0.5; }
/* The filter box sits above the first group and stays put while the list scrolls under it. */
.home-nav-tools {
  position: sticky; top: -0.4rem; z-index: 1;
  display: flex; align-items: center; gap: 0.35rem;
  margin: -0.4rem -0.35rem 0.45rem; padding: 0.4rem 0.35rem 0.35rem;
  background: color-mix(in oklab, var(--panel) 96%, var(--bg));
  border-bottom: 1px solid var(--line);
}
/* The search box spans the sidebar, its magnifier inside on the left. */
.home-nav-search { position: relative; flex: 1 1 auto; min-width: 0; display: flex; }
.home-nav-search-icon {
  position: absolute; left: 0.5rem; top: 50%; transform: translateY(-50%);
  display: inline-flex; color: var(--muted); pointer-events: none;
}
.home-nav-search:focus-within .home-nav-search-icon { color: var(--accent); }
.home-nav-filter {
  flex: 1; min-width: 0; width: 100%;
  font: inherit; font-size: 0.82rem;
  padding: 0.3rem 0.5rem 0.3rem 1.7rem;
  color: var(--fg);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  border: 1px solid var(--line); border-radius: calc(var(--radius) - 2px);
}
.home-nav-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.home-nav-filter::placeholder { color: var(--muted); }
.home-nav-filter-count { flex: 0 0 auto; font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.home-nav-filter-count:empty { display: none; }
/* Filtered out: distinct from `hidden`, which a capability sets. */
.home-nav-item[data-nav-filtered] { display: none; }
.home-nav-group[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .home-nav-twisty .i { transition: none; }
}
@media (max-width: 52rem) {
  .home-nav-head { display: block; }
  .home-nav {
    position: fixed; z-index: var(--z-nav);
    top: 3.4rem; left: 0.6rem;
    width: min(17rem, calc(100vw - 1.2rem));
    max-height: calc(100dvh - 7.5rem);
  }
}
.wz-step-body:has(input[name="glass_scope"][value="all"]:checked) .pkg-glasses,
.wz-step-body:has(input[name="glass_scope"][value="package"]:checked) .pkg-glasses { display: none; }
.wz-confirm:has(input[name="type"][value="email_managed"]:checked) .alerts-fields[data-type="email_managed"],
.wz-confirm:has(input[name="type"][value="slack"]:checked) .alerts-fields[data-type="slack"],
.wz-confirm:has(input[name="type"][value="discord"]:checked) .alerts-fields[data-type="discord"],
.wz-confirm:has(input[name="type"][value="teams"]:checked) .alerts-fields[data-type="teams"],
.wz-confirm:has(input[name="type"][value="telegram"]:checked) .alerts-fields[data-type="telegram"],
.wz-confirm:has(input[name="type"][value="webhook"]:checked) .alerts-fields[data-type="webhook"],
.wz-confirm:has(input[name="type"][value="pagerduty"]:checked) .alerts-fields[data-type="pagerduty"] { display: grid; }

/* The apps switcher (console/base.html `apps`): a native <details> menu at the header's end. */
.apps-menu { position: relative; margin-left: 0.5rem; }
.apps-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; padding: 0.15rem 0.3rem; border-radius: 6px; color: var(--muted); }
.apps-menu > summary::-webkit-details-marker { display: none; }
.apps-menu > summary:hover, .apps-menu[open] > summary { color: var(--text); background: var(--panel-2); }
.apps-menu > ul { position: absolute; right: 0; top: calc(100% + 0.35rem); z-index: var(--z-overlay); min-width: 12rem; margin: 0; padding: 0.35rem; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.apps-menu > ul a { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.5rem; border-radius: 6px; color: var(--text); text-decoration: none; }
.apps-menu > ul a:hover, .apps-menu > ul a:focus-visible { background: var(--panel-2); }
