/* THE CONSOLE'S SEAT — velora-dashboard's own stylesheet on the vendored design system (public/ds/, PIN.json).
 * Loaded after the bundle, the nebula, the vs- kit and every screen's placement CSS; before place/<key>.css.
 *
 * It holds only what a running console needs that a static screen does not: seating the two canvases in a real window
 * (the desk centred when the window is wider than 1,248; the pocket filling the device, its safe areas the real ones;
 * installed, the pocket's overlays staged on the in-flow body),
 * and the loading silhouettes of velora-design-system › Patterns › 12 (docs/patterns.html's .pt-skel, the raised
 * fill, still). The design system's law holds here as in a screen's CSS: roles only (no hex, no shadow, no font, no
 * border, no type size, no breakpoint @media — the pocket's one display-mode test below is not a breakpoint); no new
 * colour, type size or component.
 */

/* ---- the desk: the 1,248 canvas, centred on the page fill when the window is wider ---- */
.vs-dash.vs-shell { margin-inline: auto; }

/* ---- the pocket: the .nz-phone IS the device. Fixed to the viewport in a tab, in the page flow when installed (below;
   its own scroller either way, as the screens draw it), no
   radius; the drawn status bar and home indicator are not rendered (the real ones are there), so the mast runs up under
   the real status bar: the top inset is the device's, never less than the drawn 54; the tab bar clears the home
   indicator. ---- */
.nz-phone.vl-app-pocket {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  --nz-layout-mobile-safe-top: max(54px, env(safe-area-inset-top, 0px));
  --nz-layout-mobile-tab-bar-bottom: max(30px, env(safe-area-inset-bottom, 0px));
}
/* Installed on the home screen (standalone, black-translucent status bar), iOS 26 lays the viewport out one status-bar
   inset short of the screen and clips every fixed box to it, so a fixed phone stopped that far above the bottom edge
   however tall it was. There the phone leaves the fixed layer: it sits in the page flow at 100vh (the whole screen in
   standalone), still its own scroller, and the document itself never scrolls. A display-mode test, not a breakpoint;
   in a Safari tab the fixed inset-0 seat above stands. */
@media (display-mode: standalone) {
  html, body { height: 100vh; overflow: hidden; }
  .nz-phone.vl-app-pocket { position: relative; inset: auto; height: 100vh; }
  /* The overlays (the scrim, the sheets, the reader, the toast) are fixed and portaled to <body>, so the same clip
     stopped them on that line too. Under the pocket, body is their stage: the kit's .vs-overlay-stage mechanism
     (velora-screens.css › THE WINDOW: contain: layout paint, so fixed means the containing box; --vs-view-h its
     height), here the in-flow 100vh body, so they reach the bottom edge. The desk is never a stage. */
  body:has(> .nz-phone.vl-app-pocket) { contain: layout paint; --vs-view-h: 100vh; }
}
/* The overlays sit outside the phone, so the device's top inset reaches them from body (the full reader starts at the
   status bar's foot); in a tab the inset is 0 and this reads the drawn 54, as before. */
body:has(> .nz-phone.vl-app-pocket) { --nz-layout-mobile-safe-top: max(54px, env(safe-area-inset-top, 0px)); }
/* The toast is one of them. On a running pocket it is centred on the mast's first row (the logo and search), not 8 under
   the status bar as the kit seats it, where it rode high against that row: the row opens 5 below the status bar
   (.nz-mobile-header--large's 4 + 1) and is --nz-layout-mobile-header-row tall; the badge is 24. */
body:has(> .nz-phone.vl-app-pocket) > .vs-toast {
  --vs-toast-top: calc(var(--nz-layout-mobile-safe-top) + var(--nz-space-4) + var(--nz-space-px)
    + (var(--nz-layout-mobile-header-row) - var(--nz-size-control-xs)) / 2);
}
/* On the desk it sits 8 below the band's nav row, not 16 from the top as the kit seats it, where it rode the row's top
   edge (and centring it on the row would cover the Today pill, which sits under the window's centre): the band's top pad
   24 (.vs-dash --vs-pad-top, out of reach on body) + row 1's 48, whose 40 controls end 4 above its foot, + 4 = 8 below
   them. It also clears the scrolled strip (8 + 56). */
body:has(> .vs-dash) > .vs-toast { --vs-toast-top: calc(24px + 48px + var(--nz-space-4)); }
/* The toast hugs its word up to the window less the 16 gutters (the dialog's bound); a longer word ellipsizes, never
   leaves the screen. */
.vs-toast { inline-size: max-content; max-inline-size: calc(100% - 32px); }
.vs-toast > .nz-badge { flex: 0 1 auto; min-inline-size: 0; }
.vs-toast .nz-badge__label { overflow: hidden; text-overflow: ellipsis; }
/* Its motion, on the kit's tokens, eased in and out on the standard ease (a soft start, a long settle). It arrives from
   8 above at 96 % and settles (slow 280; the fade on the fade step, 200), and leaves lifting 4 at 98 % as it fades
   (base 200). Position and scale are the badge's own translate and scale, apart from the toast's centring translate.
   Under reduced motion the tokens stop the travel and keep a 120 fade. */
.vs-toast > .nz-badge {
  transition:
    opacity var(--nz-duration-fade) var(--nz-ease-standard),
    translate var(--nz-duration-slow) var(--nz-ease-standard),
    scale var(--nz-duration-slow) var(--nz-ease-standard);
}
@starting-style { .vs-toast > .nz-badge { opacity: 0; translate: 0 -8px; scale: .96; } }
.vs-toast > .nz-badge[data-leaving] {
  opacity: 0;
  translate: 0 -4px;
  scale: .98;
  transition-duration: var(--nz-duration-fade), var(--nz-duration-base), var(--nz-duration-base);
}

/* ---- loading: the silhouette of the real rows it will hold, in the raised fill, still (Patterns › 12) ---- */
.vl-app-skel-body { display: grid; gap: var(--nz-space-16); padding-block-start: var(--nz-space-8); }
.vl-app-skelrow { display: grid; grid-template-columns: 32px minmax(0, 1fr) 64px; align-items: center; gap: var(--nz-space-12); }
.vl-app-skelcol { display: grid; gap: var(--nz-space-8); }
.vl-app-skel { display: block; height: 10px; border-radius: var(--nz-radius-full); background-color: var(--nz-surface-inset); }
.vl-app-skel--disc { width: 32px; height: 32px; }
.vl-app-skel--fig { width: 120px; height: 32px; border-radius: var(--nz-radius-8, 8px); }
.vl-app-skel--w60 { width: 60%; }
.vl-app-skel--w40 { width: 40%; }
.vl-app-skel--w20 { width: 20%; }
.vl-app-skel--full { width: 100%; }

/* ---- a route's loading.tsx renders BOTH canvases' silhouettes (a Suspense fallback cannot read the device); the shell
   the layout chose shows its own and hides the other ---- */
.vs-dash .vl-app-only-pocket, .nz-phone .vl-app-only-desk { display: none; }
.nz-phone .vl-app-only-pocket { display: contents; }

/* ==== OVERLAYS — the kit draws them since 2.9 (velora-screens.css › THE OVERLAYS: .vs-scrim, .vs-dialog (--wide, --bare,
   --full), .vs-sheet (--full), .vs-records, .vs-search, .vs-reader). The seat keeps only what a running console needs
   beyond the kit: the basis tap's button reset and the focus rings (the kit draws none). Their seat in the installed
   pocket is above, with the pocket's. ==== */
/* the basis tap: a 44 hit area around a figure, without moving it (the pocket twin of a desk title); a bare button */
.vl-app-basis {
  display: inline-flex; flex-direction: column; justify-content: center; align-items: flex-start;
  min-height: 44px; margin: 0; padding: 0;
  border: 0; background: none; color: inherit; font: inherit; text-align: start;   /* a reset: the button draws nothing */
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.vl-app-basis:focus-visible { outline: none; box-shadow: var(--nz-focus-ring); border-radius: var(--nz-radius-8, 8px); }

.vs-records .nz-person:focus-visible { outline: none; box-shadow: var(--nz-focus-ring); border-radius: var(--nz-radius-full); }
.vs-search__item { -webkit-tap-highlight-color: transparent; }
.vs-shelf__tile:focus-visible,
.vs-toc__item:focus-visible,
.vs-toc__subitem:focus-visible { outline: none; box-shadow: var(--nz-focus-ring); border-radius: var(--nz-radius-8, 8px); }

/* ==== THE WORKLIST (2.24) — the kit draws every part (velora-screens.css WORKLIST part 12); the filter sheet is the kit's
   Radix-portaled .vs-sheet, so it needs no .vs-sheet-host. The running pocket only drops the tap flash on the line and the
   lens items (a static screen has no tap). ==== */
.vs-pline__sentence, .vs-pbar .nz-segmented__item { -webkit-tap-highlight-color: transparent; }
