/*
 * den-ui shell: the global shell's look (shell-html.js draws it): the
 * 48px top bar, the 216px rail (56px collapsed, a ☰ drawer below 720px),
 * its groups, entries, pins and badges, the Report button, the version
 * chip, and where the update pill sits on the bar. Tokens only (tokens.css).
 * A product's own top-bar parts (its slots) bring their own CSS.
 *
 * Load it in the page's <head>, after tokens.css and the theme:
 *   <link rel="stylesheet" href="/kit/shell.css">
 * and add class den-has-shell to <body>.
 */
body.den-has-shell {
  --den-top-h: 48px;
  --den-rail-cw: 216px;
  --den-rail-w: calc(var(--den-rail-cw) + 17px);
  padding-left: var(--den-rail-w);
}
body.den-has-shell.den-rail-collapsed {
  --den-rail-cw: 56px;
}
body.den-has-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--den-top-h);
  box-sizing: border-box;
}
/* The page's one main (#den-content, the skip link's target) takes what
   is left under the top bar, so a short page's last row can reach the
   window's bottom. */
body.den-has-shell > #den-content {
  flex: 1 1 auto;
  min-width: 0;
}
.den-shell {
  display: contents;
}
.den-top,
.den-rail {
  font: 14px/1.45 var(--sans);
}
.den-top :focus-visible,
.den-rail :focus-visible {
  outline: 2px solid var(--focus-ring, var(--accent));
  outline-offset: var(--focus-offset, 2px);
}
.den-skip {
  position: fixed;
  left: 8px;
  top: -40px;
  z-index: 100;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: var(--radius-button);
  font: 600 12px var(--sans);
  text-decoration: none;
}
.den-skip:focus {
  top: 8px;
}
.den-top {
  /* Issue 303: three parts. The left part (☰, the brand, the crumbs) and
     the search have set widths, so the search sits at the same x and
     width in every product whatever the host's words; the chips take the
     rest, pinned to the right edge. The chips' column is never narrower
     than the kit's own buttons (the host's chips count for nothing
     there): when the bar is too narrow for all three, the left part gives
     way. Settings: --den-top-left (444px), --den-top-search (304px). */
  display: grid;
  /* The search never moves (issue 303): its x is a function of the
     viewport only, the same in any host. The left part is
     --den-top-left (444px), less what the search and the kit's right
     group need (--den-top-right, 380px); the right group gives way
     inside its column (the host's chips, then the version's text),
     never Report, the bell or ◐. searchSlot() in the inventory is the
     same sum. */
  /* Issue 981: on a short bar the search gives way before the left part:
     the left part keeps --den-top-left-min (220px, the project picker in
     it) while the search narrows, down to its icon (--den-top-search-min,
     56px). At 944px and wider nothing changes. */
  --den-top-search-w: clamp(
    var(--den-top-search-min, 56px),
    calc(
      100% - var(--den-top-left-min, 220px) - var(--den-top-right, 380px) - 16px
    ),
    var(--den-top-search, 304px)
  );
  grid-template-columns:
    minmax(
      0,
      min(
        var(--den-top-left, 444px),
        calc(
          100% - var(--den-top-search-w) - var(--den-top-right, 380px) - 16px
        )
      )
    )
    var(--den-top-search-w)
    minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  height: var(--den-top-h);
  box-sizing: border-box;
  padding: 0 12px;
  flex-shrink: 0;
  /* Pinned, as the rail under it is: fixed, whatever the host does with
     html and body (sticky is held by the body's box, and a body of
     height 100% lets the bar scroll away). The body's padding-top keeps
     the page out from under it. */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  /* Its own layer from the start (0.6.4). The update pill's glass
     (blur and saturate) makes Chromium draw the page's text grayscale
     while it shows; drawn on its own layer, the bar is the same with the
     pill shown or hidden. A fixed element inside the bar would be placed
     against the bar, so the kit and products put none there (pop-ups go
     on <body>); the bar never clips (no overflow), so a slot's absolute
     menu still drops below it. */
  will-change: transform;
  background: var(--surface);
  border-bottom: 1px var(--edge-style, solid) var(--border);
  min-width: 0;
  color: var(--text);
}
.den-top::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--bar, none);
  pointer-events: none;
}
.den-left {
  grid-column: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
/* The crumbs give way first: they shrink before the brand does. */
.den-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  flex: 0 0.001 auto;
  min-width: 0;
  white-space: nowrap;
}
.den-title {
  font: 600 15px var(--display);
  margin: 0;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The mark's layout (0.7.0, from Den's own sheet): a centred box its
   image fills, whatever the host's mark is. */
.den-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  overflow: hidden;
}
.den-mark img {
  display: block;
  width: 18px;
  height: 18px;
}
/* Scaled, never cropped: non-square art keeps its edges. */
.den-mark-raster img {
  object-fit: contain;
}
.den-mark-text {
  font: 700 11px/1 var(--display);
  letter-spacing: -0.02em;
  background: var(--accent-fill);
  color: var(--on-accent);
}
.den-mark-text[data-len="2"] {
  font-size: 9px;
}
.den-mark-text[data-len="3"] {
  font-size: 7px;
}
.den-mark-square {
  border-radius: 2px;
}
.den-mark-rounded {
  border-radius: 5px;
}
.den-mark-circle {
  border-radius: 50%;
}
#den-shell .den-mark {
  width: 22px;
  height: 22px;
}
#den-shell .den-mark img {
  width: 22px;
  height: 22px;
}
#den-shell .den-mark-text {
  font: 700 12px/1 var(--mono);
}
#den-shell .den-mark-rounded {
  border-radius: 6px;
}
/* Issue 644: dark mode only, a faint cream edge so the mark's dark tile
   keeps its outline on a dark bar. One mark file for both modes. The svg
   mark's corners follow the tile's (14 of 64). An empty slot draws none. */
:root[data-mode="dark"] .den-mark:not(:empty) {
  box-shadow: 0 0 0 1px var(--den-mark-edge);
}
:root[data-mode="dark"] .den-mark-svg {
  border-radius: 22%;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-mode]) .den-mark:not(:empty) {
    box-shadow: 0 0 0 1px var(--den-mark-edge);
  }
  :root:not([data-mode]) .den-mark-svg {
    border-radius: 22%;
  }
}
.den-ib {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  padding: 4px 8px;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font: inherit;
}
.den-ib:hover {
  background: var(--sunken);
  color: var(--text);
}
.den-menu-btn {
  display: none;
}
.den-chips {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
  /* A clear gap after the search's ⌕. */
  padding-left: 8px;
}
/* The kit's own buttons keep their size; the host's chips give way. */
.den-chips > * {
  flex: none;
}
/* The version sits in a fixed slot (96px; 64px up to 1100px): its text
   ends in "…" inside it (the whole version in the text's title), so
   Report, the bell and ◐ sit at the same x in any host, anchored from
   the right edge. */
.den-chips > .v-pill,
#den-shell .den-chips > .v-pill {
  flex: none;
  width: var(--den-top-version, 96px);
  min-width: 0;
  justify-content: center;
  box-sizing: border-box;
}
@media (max-width: 1100px) {
  .den-chips > .v-pill,
  #den-shell .den-chips > .v-pill {
    width: var(--den-top-version-md, 64px);
  }
}
.den-chips > .v-pill .v-txt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Report, the bell and ◐ are the kit's: their font and box are set here,
   so a host's own rules (letter-spacing, box-sizing) can't size them. */
.den-chips > .den-rb-top,
.den-chips > #den-bell,
.den-chips > .appearance-btn {
  font-family: var(--sans);
  letter-spacing: normal;
  word-spacing: normal;
  text-transform: none;
  box-sizing: border-box;
}
/* The host's chips (issue 303): the first to give way when the bar is
   short. Their group takes the room left of the kit's buttons, right
   aligned, clipped on the x axis only (a touch tap area still reaches
   above and below); under 40px its chips hide, so none ever sits under
   the search. */
.den-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
  overflow-x: clip;
  /* Its chips never widen the bar: the group's own width is the room. */
  contain: inline-size;
}
/* A host chip gives way: its last part (its words, in a span) ends in
   "…". */
/* Width 0, growing to its own width: a host chip takes only the room
   there is, and counts for nothing in the chips' least width. */
.den-top .den-end > * {
  width: auto;
  flex: 0 1 auto;
  max-width: max-content;
  /* A shrunk chip keeps its dot and "…" (its words in its title and
     name, set by the kit's hydration). */
  min-width: 2.6em;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.den-top .den-end > * > :last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media not (pointer: coarse) {
  .den-top .den-end > * {
    overflow: hidden;
  }
}
/* On a touch screen nothing is clipped, so a chip's 44px tap reaches
   past its group. */
@media (pointer: coarse) {
  .den-end {
    overflow-x: visible;
  }
}
/* A phone: nothing is clipped (touch or not, the bar looks the same);
   the chips shrink to the room there is. */
@media (max-width: 720px) {
  .den-end {
    overflow-x: visible;
  }
  .den-top .den-end > * {
    min-width: 0;
  }
}
.den-user {
  display: contents;
}
.den-rb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px var(--edge-style, solid) var(--border-strong, var(--border));
  border-radius: var(--radius-button, 4px);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.den-rb svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.den-rb kbd {
  font: 11px var(--mono);
  color: var(--muted);
}
@media (max-width: 600px) {
  .den-rb kbd {
    display: none;
  }
}
.den-rb-foot {
  display: flex;
  justify-content: flex-start;
  margin-top: auto;
  padding: 8px 12px;
  border-top: 1px var(--edge-style, solid) var(--border);
}
.den-report-off [data-den-report] {
  display: none !important;
}
.den-scrim {
  position: fixed;
  inset: 0;
  background: var(--kit-scrim);
  z-index: 40;
}
#den-shell .v-pill {
  font: inherit;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  color: var(--muted);
  flex-shrink: 0;
}
#den-shell .v-pill:hover {
  background: var(--sunken);
  color: var(--text);
  border-color: transparent;
}
#den-shell .v-pip {
  position: static;
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
}
.den-top .den-ib[aria-expanded="true"] {
  background: var(--sunken);
  color: var(--text);
}
.den-rail-box {
  display: contents;
}
.den-rail {
  position: fixed;
  left: 0;
  top: var(--den-top-h);
  bottom: 0;
  width: var(--den-rail-cw);
  box-sizing: content-box;
  display: flex;
  flex-direction: column;
  padding: 10px 8px;
  background: var(--surface);
  border-right: 1px var(--edge-style, solid) var(--border);
  overflow-y: auto;
  /* Issue 1341: an entry scrolled into view (keyboard focus) stops above
     the sticky foot, never under it (WCAG 2.4.11). shell-client sets the
     foot's height. */
  scroll-padding-bottom: var(--den-rail-foot-h, 0px);
  z-index: 15;
  color: var(--text);
}
.den-rail-group {
  display: contents;
}
.den-gh {
  font: 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
  padding: 12px 10px 4px;
  display: flex;
  justify-content: space-between;
}
.den-rail > .den-rail-group:first-child > .den-gh {
  padding-top: 2px;
}
/* Issue 1444: a section's entries; its heading folds them. The heading is
   the toggle only once the kit's script made it one (a button), so with
   no script every entry shows. */
.den-gb {
  display: contents;
}
button.den-gh {
  appearance: none;
  background: none;
  border: 0;
  margin: 0;
  width: 100%;
  text-align: start;
  align-items: center;
  cursor: pointer;
}
/* Margins, not gap, and corners only while focused: the heading at rest
   keeps the signed-off nav's styles (nav-inventory). */
button.den-gh > span:first-child {
  margin-inline-end: auto;
}
button.den-gh > .den-bdg,
button.den-gh > .den-gh-chev {
  margin-inline-start: 6px;
}
button.den-gh:hover {
  color: var(--muted);
}
button.den-gh:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--focus-ring, var(--accent));
  outline-offset: var(--focus-offset, 2px);
}
button.den-gh > .den-bdg {
  text-transform: none;
  letter-spacing: 0;
}
.den-gh-chev {
  width: 12px;
  height: 12px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--dur-fast) var(--ease);
}
.den-rail-group[data-folded] .den-gh-chev {
  transform: rotate(-90deg);
}
@media (prefers-reduced-motion: reduce) {
  .den-gh-chev {
    transition: none;
  }
}
/* Hidden only once hydrateRailFolds marked the rail (data-folds): a
   script that failed to load or threw leaves every entry showing. */
[data-folds] .den-rail-group[data-folded] > :not(.den-gh) {
  display: none;
}
/* The heading is a tap's height from the first paint (it becomes the
   toggle when the script runs), so hydrating moves nothing. */
@media (scripting: enabled) and (max-width: 720px),
  (scripting: enabled) and (pointer: coarse) {
  .den-rail-group > .den-gh {
    min-height: var(--tap);
    align-items: center;
  }
}
/* A group's "from" tag never makes its heading taller, on any font: its
   box (a 12px line and its border, 14px) is centred on the heading's line
   and its vertical margins cancel that box, so its row is the heading's
   own words' line, with or without the tag. */
.den-tagx {
  font: 10px/12px var(--mono);
  color: var(--faint);
  border: 1px dashed var(--border-strong);
  border-radius: 4px;
  padding: 0 4px;
  text-transform: none;
  letter-spacing: 0;
  align-self: center;
  margin-block: -7px;
}
.den-ni {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  background: none;
  border: 0;
  padding: 6px 10px;
  border-radius: var(--radius-button);
  cursor: pointer;
  color: var(--muted);
  text-decoration: none;
  position: relative;
  font: inherit;
}
.den-ni:hover {
  background: var(--sunken);
  color: var(--text);
}
.den-ni .den-ext {
  color: var(--faint);
  font-size: 12px;
}
.den-ni.den-off {
  opacity: 0.55;
}
.den-ni[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--text);
  font-weight: 500;
}
.den-ni[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.den-ni svg {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.den-lbl {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.den-mono {
  font-family: var(--mono);
  font-size: 12.5px;
}
.den-bdg {
  font: 11px var(--mono);
  padding: 0 6px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.den-bdg.bad {
  background: color-mix(in srgb, var(--bad) 16%, transparent);
  color: var(--bad);
}
/* Issue 773: something needs the person (the rail's Agents count): the
   amber pill. */
.den-bdg.warn {
  background: var(--warn);
  color: var(--bg);
  font-weight: 600;
}
.den-bdg.warn.soft {
  background: var(
    --warn-tint,
    color-mix(in srgb, var(--warn) 14%, var(--surface))
  );
  color: var(--warn);
}
.den-ni .den-bdg.warn.soft {
  font-weight: 400;
}
.den-bdg.count {
  display: inline-block;
  box-sizing: border-box;
  min-width: var(--den-bdg-min, 1.6em);
  margin-inline-start: var(--space-half, 2px);
  padding: var(--den-bdg-pad, 0 var(--space-half, 2px));
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font: 600 var(--den-bdg-fs, var(--fs-2xs, 11px)) / var(--den-bdg-lh, 18px)
    var(--sans);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.den-bdg.count.bad {
  background: var(--bad);
  color: var(--on-accent);
}
.den-bdg.count.corner {
  position: absolute;
  inset-block-start: var(--space-half, 2px);
  inset-inline-end: calc(-1 * var(--space-1));
  min-width: 16px;
  margin: 0;
  padding: 0 var(--space-half, 2px);
  line-height: 16px;
  pointer-events: none;
}
/* Issue 307: a pin's or a cross-app link's kind (PROJECT, DEN, SERVICE,
   HUB, an artifact's word), at the row's end. Its look is the scope
   labels' (.den-k); this only places it. */
.den-ni-kind {
  flex: none;
  white-space: nowrap;
}
/* A project pin's initial, in a disc the icon's size, in place of it. */
.den-ini {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--sunken);
  color: var(--text);
  font: 500 11px/1 var(--sans);
}
.den-rail-grow {
  flex: 1;
}
/* Issue 1341: the foot stays in view when the groups are taller than the
   rail. The rail scrolls; the foot is sticky at its bottom, over the
   groups that scroll under it. The foot's background reaches over the
   rail's 10 px bottom padding (a negative margin), so nothing shows
   below it, and its entries sit where they did when the groups fit.
   bottom is -10px because a sticky box's inset is measured from inside
   its scroller's padding: 0 would lift the foot 10 px. The rail keeps
   its padding, so its height is unchanged. */
.den-rail-foot {
  position: sticky;
  bottom: -10px;
  z-index: 1;
  flex: none;
  display: flex;
  flex-direction: column;
  margin-bottom: -10px;
  padding-bottom: 10px;
  background: var(--surface);
}
.den-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.den-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
  display: inline-block;
  margin: 0 5px;
}
.den-dot.bad {
  background: var(--bad);
}
.den-dot.warn {
  background: var(--warn);
}
.den-dot.off {
  background: var(--faint);
}
.den-pin-row {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.den-pin-row .den-ni {
  flex: 1;
  min-width: 0;
}
.den-pin-row .den-ni[aria-expanded="true"] {
  background: var(--sunken);
  color: var(--text);
}
.den-pvisit {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  color: var(--muted);
  cursor: pointer;
  font: 13px/1 var(--sans);
}
.den-pvisit:hover {
  background: var(--sunken);
  color: var(--accent-text);
  border-color: var(--border);
}
.den-pvisit[aria-disabled="true"],
.den-svp .den-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
.den-pvisit[aria-disabled="true"]:hover {
  background: none;
  color: var(--muted);
  border-color: transparent;
}
body.den-rail-collapsed .den-rail .den-pvisit,
body.den-rail-collapsed .den-rail .den-ni-kind {
  display: none;
}
@media (max-width: 720px) {
  .den-pvisit {
    width: 32px;
    height: 32px;
  }
  body.den-rail-collapsed .den-rail .den-pvisit {
    display: grid;
  }
  body.den-rail-collapsed .den-rail .den-ni-kind {
    display: inline;
  }
}
/* Issue 1444: the rail as icons has no headings to open, so a folded
   section's entries show there (the drawer below 720px folds them). */
@media (min-width: 721px) {
  body.den-rail-collapsed [data-folds] .den-rail-group[data-folded] > .den-gb {
    display: contents;
  }
}
body.den-rail-collapsed .den-rail .den-lbl,
body.den-rail-collapsed .den-rail .den-gh,
body.den-rail-collapsed .den-rail .den-bdg {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
body.den-has-shell .den-upd {
  --upd-top: calc(
    env(safe-area-inset-top, 0px) +
      var(
        --den-overlay-top,
        max((var(--den-top-h) - 50px) / 2, -1px, 8px - var(--den-top-h))
      )
  );
  font-family: var(--sans);
}
@media (max-width: 720px) {
  body.den-has-shell,
  body.den-has-shell.den-rail-collapsed {
    --den-rail-w: 0px;
    --den-rail-cw: 244px;
  }
  .den-menu-btn {
    display: inline-flex;
  }
  .den-rail {
    transform: translateX(-105%);
    box-shadow: var(--shadow);
    z-index: 42;
  }
  /* The drawer slides only once the person has opened or closed it
     (shell-client adds den-rail-moved then). Before that, a load or a
     window narrowing past 720 puts the rail straight where it belongs;
     a transition here slid it across the page (issue 311). */
  body.den-rail-moved .den-rail {
    transition: transform 0.18s;
  }
  body.den-rail-open .den-rail {
    transform: none;
  }
  .den-scrim {
    position: fixed;
    inset: 0;
    z-index: 41;
    background: color-mix(in srgb, var(--bg) 60%, transparent);
  }
  body.den-rail-collapsed .den-rail .den-lbl,
  body.den-rail-collapsed .den-rail .den-gh,
  body.den-rail-collapsed .den-rail .den-bdg {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
    overflow: hidden;
  }
  .den-collapse-btn {
    display: none;
  }
  .den-top .v-pill {
    display: none;
  }
  .den-brand {
    min-width: 0;
    flex: 0 1 auto;
  }
  .den-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .den-chips {
    flex-shrink: 0;
  }
}
@media (max-width: 479.98px) {
  .den-title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  /* The brand is its mark alone here (the title is hidden): it never
     shrinks below it; the host's chips give way instead. */
  .den-brand {
    flex-shrink: 0;
    min-width: max-content;
  }
}
@media (prefers-reduced-motion: reduce) {
  .den-rail,
  body.den-rail-moved .den-rail {
    transition: none;
  }
}
/* The version chip's own look (it was What's new's: the shell's rules above win). */
.v-pill {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px var(--edge-style, solid) var(--border);
  color: var(--muted);
  background: none;
  cursor: pointer;
  user-select: none;
  transition:
    color 0.1s,
    border-color 0.1s;
  position: relative;
  flex-shrink: 0;
}
.v-pill:hover {
  color: var(--accent-text);
  border-color: var(--accent);
}
.v-pip {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--bg);
  display: none;
  pointer-events: none;
}

/* ── 0.7.0: the scope crumbs, the search, the bell, the account ───────── */

/* The scope crumbs: / KEY value ▾ / … The search gives way first: the
   crumbs keep their parts whole (each value is capped), so they never run
   into one another. */
/* The crumbs (issue 303): each crumb a column of minmax(auto, max-content)
   whose least width is 0 (min-width: 0), so the room there is goes to
   every crumb alike until each is whole: a short crumb keeps its words, a
   long one ends in an ellipsis, and the last crumb is kept whole. They
   give way before the brand. */
.den-scope {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(auto, max-content);
  align-items: center;
  column-gap: 2px;
  /* Never narrower than what its crumbs can give: past that, the brand
     gives way. */
  min-width: min-content;
  flex: 0 999 auto;
  position: relative;
}
.den-sep {
  color: var(--faint);
}
.den-scope [hidden] {
  display: none;
}
.den-scope .den-ib {
  color: var(--text);
  font-size: 13px;
  min-width: 0;
}
/* The last crumb's least width is its whole self: it never gives way. */
.den-scope .den-ib.den-last {
  min-width: auto;
}
.den-scope .den-ib > * {
  flex: none;
}
/* The label gives way first (down to nothing), then the value ends in
   "…": a crumb's value outlasts its label. Before the last crumb, a
   value keeps about 4ch and its ▾. */
.den-scope .den-ib > .den-k {
  flex: 0 1000 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.den-scope .den-ib:not(.den-last) > .den-v {
  min-width: calc(5ch + 0.28em);
}
.den-scope .den-ib:not(.den-last) > :last-child:not(.den-v):not(.den-k) {
  min-width: 4ch;
}
/* The value gives way (its ▾ stays): a static crumb's value, or a menu
   crumb's value box and the name in it. */
.den-scope .den-ib > :last-child {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.den-scope .den-v {
  display: inline-flex;
  align-items: baseline;
  /* The space between the value and its ▾. */
  column-gap: 0.28em;
}
.den-scope .den-v > .den-vn {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.den-scope .den-v > :not(.den-vn) {
  flex: none;
}
.den-k {
  font: 11px var(--mono);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.den-scope .den-ib[aria-expanded="true"] {
  background: var(--sunken);
}
/* A long value ends in an ellipsis; the whole value is in the menu. An
   env's name is short: never capped. */
.den-scope-btn:not([data-scope="env"]) .den-vn,
.den-scope .den-opt .den-vn {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}
/* The search field, ⌘K inside it. Its sizes are content-box (a page may
   reset everything to border-box). */
.den-search {
  grid-column: 2;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--sunken);
  border: 1px var(--edge-style, solid) var(--border);
  border-radius: var(--radius-button);
  padding: 5px 10px;
  color: var(--faint);
  cursor: text;
  min-width: 0;
  font: inherit;
  box-sizing: content-box;
}
.den-search-ph {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.den-search-ic {
  flex: none;
}
/* A narrowed search (issue 981): its words and ⌘K give way, its ⌕ stays. */
.den-search > kbd {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
}
/* A key cap: the search's ⌘K, the top bar's Report ⌘⇧F, and any .den-kbd
   a host draws. One rule, so they never drift apart. */
.den-kbd,
.den-search kbd,
.den-top .den-rb kbd {
  font: 11px var(--mono);
  border: 1px var(--edge-style, solid) var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 5px;
  color: var(--muted);
  background: var(--surface);
}

/* The bell, its count, and its panel (on <body>, outside the bar). */
.den-bell {
  position: relative;
}
.den-bell-n {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--warn);
  color: var(--bg);
  font: 600 10px/16px var(--mono);
  text-align: center;
}
.den-bell-n[hidden] {
  display: none;
}
.den-bell-pop {
  position: fixed;
  top: 52px;
  right: 12px;
  width: min(420px, calc(100vw - 32px));
  max-height: min(70vh, 640px);
  overflow: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px var(--edge-style, solid) var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--text) 25%, transparent);
  /* On <body>: its own font, not a page's default (a serif). */
  z-index: 60;
  padding: 8px 0;
  font: 13px/1.45 var(--sans);
}
.den-bell-pop[hidden] {
  display: none;
}
.den-bell-pop:focus {
  outline: none;
}
.den-bell-hd {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 12px 8px;
  border-bottom: 1px var(--edge-style, solid) var(--border);
}
.den-bell-hd h2 {
  font-size: 13px;
  margin: 0;
  flex: 1;
}
.den-bell-hd button {
  font: inherit;
  font-size: 12px;
  background: none;
  border: 0;
  color: var(--accent-text);
  cursor: pointer;
  padding: 2px 4px;
}
.den-bell-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 12px;
}
.den-bell-row:has(a[href]),
.den-bell-row:has(a[href]) a[href] {
  /* Issue 420: a row that opens on a click looks it, its link too (WebKit
     gives a link cursor: auto of its own, so it doesn't inherit this). */
  cursor: pointer;
}
.den-bell-row:hover {
  background: color-mix(in srgb, var(--text) 5%, transparent);
}
.den-bell-row a {
  flex: 1;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.den-bell-row.read a {
  color: var(--muted);
}
.den-bell-row time {
  color: var(--faint);
  font-size: 11px;
  white-space: nowrap;
}
/* Issue 101: Needs you, then Earlier, each under a quiet heading. */
.den-bell-sec + .den-bell-sec {
  border-top: 1px solid var(--border); /* issue 1137: a row divider stays solid */
}
.den-bell-sech {
  margin: 0;
  padding: 10px 12px 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.den-bell-none {
  margin: 0;
  padding: 6px 12px 10px;
  color: var(--muted);
}
.den-bell-empty {
  padding: 16px 12px;
  color: var(--muted);
}
.den-bell-empty p {
  margin: 0 0 6px;
}
.den-bell-empty a {
  color: var(--accent-text);
}

/* A phone: the panel the window's width, its rows tall enough to touch. */
@media (max-width: 480px) {
  .den-bell-pop {
    left: 0;
    right: 0;
    width: auto;
    top: 48px;
    border-radius: 0 0 10px 10px;
  }
  .den-bell-row {
    min-height: 44px;
    align-items: center;
  }
}

/* The account entry: its detail after the label, quieter. */
.den-acct-d {
  color: var(--faint);
}
/* Who is signed in (0.7.1): the name, then @login under it, quieter;
   the same in the rail's entry and the account menu's header. */
.den-acct {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.den-acct-n,
.den-acct-l,
.den-acct-r {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.den-acct-l,
.den-acct-r {
  font-size: 11px;
  color: var(--faint);
}

/* Narrow: the crumbs' keys and the optional crumb give way, then the
   crumbs hide and the search is its icon. */
@media (max-width: 860px) {
  .den-scope .den-k,
  .den-scope .den-sep,
  .den-scope .den-opt {
    display: none;
  }
}
@media (max-width: 720px) {
  /* The search is its icon, in a slot after the brand: the same x in
     every product (--den-top-left-md, 200px; on a phone
     --den-top-left-sm, 62px: ☰ and the mark). */
  .den-top {
    grid-template-columns: minmax(0, var(--den-top-left-md, 200px)) auto minmax(
        min-content,
        1fr
      );
  }
  .den-chips {
    padding-left: 0;
  }
  .den-scope {
    display: none;
  }
  .den-search {
    margin: 0;
  }
  .den-search-ph,
  .den-search kbd {
    display: none;
  }
}

/* A phone's tap targets: every top-bar button 32px or more each way. */
@media (max-width: 479.98px) {
  .den-top {
    grid-template-columns: var(--den-top-left-sm, 62px) auto minmax(
        min-content,
        1fr
      );
  }
  .den-top button {
    min-height: 32px;
    min-width: 32px;
  }
}

/* 0.7.0: the kit's menus (◐ ▾, a crumb's own menu): a host's menu look,
   value for value. */
.den-pop {
  position: fixed;
  z-index: 45;
  background: var(--raised);
  border: 1px var(--edge-style, solid) var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  min-width: 220px;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  box-sizing: border-box;
  font: 14px/1.45 var(--sans);
  color: var(--text);
}
.den-pop:focus {
  outline: none;
}
.den-pop :focus-visible {
  outline: 2px solid var(--focus-ring, var(--accent));
  outline-offset: var(--focus-offset, 2px);
}
.den-pop .den-ml {
  font: 11px var(--mono);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 6px 8px 2px;
}
.den-pop .den-mi {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  text-decoration: none;
  box-sizing: border-box;
}
.den-pop .den-mi:hover,
.den-pop .den-mi:focus {
  background: var(--sunken);
}
/* The ✓ is drawn, not read (aria-checked or aria-current says it). */
.den-pop .den-mi[aria-checked="true"]::after,
.den-pop .den-mi[aria-current="true"]::after {
  content: "✓" / "";
  margin-left: auto;
  color: var(--accent-text);
}
.den-pop .den-mi-l {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.den-pop .den-mtag {
  font: 11px var(--mono);
  color: var(--muted);
}
.den-pop .den-hr {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.den-pop .den-mnote {
  color: var(--muted);
  font-size: 12.5px;
  margin: 0;
  padding: 4px 8px;
  max-width: 260px;
}
/* A long menu's type-to-filter field, a host's menu field look; an entry
   it filters out is hidden. */
.den-pop input.den-mfilter {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 4px;
  -webkit-appearance: none;
  appearance: none;
  border: 1px var(--edge-style, solid) var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius-button);
  padding: 6px 8px;
  font: inherit;
  font-size: 13.3333px;
  line-height: normal;
}
.den-pop .den-mi[hidden],
.den-pop .den-mnote[hidden] {
  display: none;
}
/* A form in a menu (the account menu's Sign out) is just its row. */
.den-pop form.den-mform {
  display: block;
  width: auto;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
/* The page action menu (issue 555). A disabled item is faint and
   doesn't light up; its note sits right under it, wraps, and is a row to
   follow when it links to where to turn it on. */
.den-pop .den-mi[aria-disabled="true"] {
  color: var(--faint);
  cursor: not-allowed;
}
.den-pop .den-mi[aria-disabled="true"]:hover {
  background: none;
}
.den-pop .den-mwhy {
  display: block;
  max-width: 260px;
  padding: 0 8px 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
.den-pop .den-mwhy .den-mi-l {
  white-space: normal;
}
.den-pop a.den-mwhy .den-mi-l {
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* A phone: More and every row a 44px target. */
@media (max-width: 720px), (pointer: coarse) {
  .den-pmenu-btn,
  .den-pmenu .den-mi {
    min-height: var(--tap);
  }
  .den-pmenu .den-mwhy {
    display: flex;
    padding: 4px 8px 8px;
    font-size: 13px;
  }
}
/* ◐ ▾'s menu, on <body> above everything, placed under the button. */
.den-um {
  margin: 0;
  right: auto;
  bottom: auto;
  z-index: 1000;
}
/* A crumb's own menu drops below its ▾, inside the bar. */
.den-scope-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: var(--den-menu-x, 0px);
}

/* 0.7.0: the update-waiting pill beside the version chip. */
.stale-pill {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  border: 1px solid var(--warn);
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  animation: stale-pulse 2s ease-in-out infinite;
}
.stale-pill:hover {
  color: var(--bg);
  background: var(--warn);
}
.stale-pill b {
  font-weight: 700;
}
@keyframes stale-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
@media (max-width: 720px) {
  .den-top .stale-lbl {
    display: none;
  }
}

/* Touch (issue 303): .den-hit is the kit's 44×44px tap, for any control
   (the kit's top bar uses it, and a host may put it on its own buttons
   and tabs): a hit area centred on the control, transparent, with no
   change to its look or layout, on a touch screen only. Key hints
   (.den-kbd, and the bar's kbd) hide on a touch screen, wherever they
   are. A menu row (.den-mi) is left out: its ::after is its ✓, and a
   row is already a full-width target (issue 898). */
@media (pointer: coarse) {
  .den-hit,
  .den-top button,
  .den-top a[href] {
    position: relative;
  }
  .den-hit::after,
  .den-top button:not(.den-mi)::after,
  .den-top a[href]:not(.den-mi)::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    min-width: 44px;
    min-height: 44px;
    transform: translate(-50%, -50%);
    background: transparent;
  }
  .den-kbd,
  .den-top kbd {
    display: none;
  }
}
