/* Z_ONE_LAYER_LEDGER_2026-08-31 - every layer in this project is written in ONE
   ledger, in shared/z-shell/tokens.css. Never type a raw z-index. If a part has
   no rung yet, add it to that ledger first, then use the token. */
/* ===========================================================================
   SETTINGS — STATIC STYLESHEET.  Assistant B, 2026-08-31.
   Marker: Z_SETTINGS_ONTOP_OF_DOCK_2026-08-31

   FOUNDER, 2026-08-28, verbatim:
     "when settings is open, its ONTOP of the dock."

   WHY THE OBVIOUS FIX DOES NOT WORK, MEASURED LIVE 2026-08-31 18:40 EST.
   My first attempt raised the settings panel's own z-index. It changed nothing,
   and the measurement said exactly why:
       settings panel   z-index 2147482600   and the DOCK was still in front
       dock             z-index 72
   A bigger number lost to a smaller one, so this was never about the number.
   Reading the ancestors of both settled it:
       settings  aside.settings-panel -> div.app-shell -> div#app      z-index 1
       dock      div.z-dockwrap       -> div#z-shell             z-index 2147481500
   Both #app and #z-shell are children of <body> and both start their own
   stacking world. Everything inside #app is trapped below everything inside
   #z-shell, no matter what number the panel itself carries.

   THE FIX, AND WHY IT IS SHAPED THIS WAY.
   While settings is open, #app is lifted one step above #z-shell. The step is
   DERIVED FROM HIS OWN NUMBER (#z-shell's 2147481500), not a number I chose.
   It is scoped to a state HIS OWN CODE already sets - the runtime writes
   data-z-shell-overlay-layer-owner="chat-ui-entry" onto .app-shell whenever the
   settings panel or the mobile drawer is covering the screen. No new state was
   invented and no marker was added to any file.

   THE MOMENT SETTINGS CLOSES, that attribute clears and #app drops back to its
   own layer, so the dock is in front again everywhere else. The dock is never
   hidden, never removed, and never touched - it is a permanent fixture and it
   stays one. The only window where it sits behind is while settings is open,
   which is precisely what he asked for.

   NOTHING IS MADE TO APPEAR HERE. A real stylesheet, linked in the head, parsed
   with the document. It changes only which of two things already on screen is
   drawn in front.

   UNDO: delete this file and the one line in app.js that links it.
   =========================================================================== */

body:has(> #app .app-shell[data-z-shell-overlay-layer-owner="chat-ui-entry"]) > #app {
  /* one step above #z-shell's own 2147481500 */
  /* Z_ONE_LAYER_LEDGER_2026-08-31 - no raw numbers any more. Founder, same day:
     "make sure the z-index of the settings is above the dock and the
     keyboard/gaming/etc tabs." That rung is --z-shell-settings: above the dock,
     the keyboard and its tray, below the sheets and item menus. The one ledger
     lives in shared/z-shell/tokens.css. */
  z-index: var(--z-shell-settings, 2147482900);
}


/* Z_SETTINGS_IS_A_FULL_WIDTH_APP_2026-08-31 -------------------------------
   Founder: "For the settings app, you just take the settings slideout pane and
   turn it into a full-width app that can be opened."
   So on this one route the slideout stops being a slideout: the same pane fills
   the work surface. Everything here is scoped to that route and cannot reach
   any other page. The frame and heading ship in the served HTML, so the page is
   real the moment it loads. */
[data-z-settings-page="true"] .zs-page {
  position: fixed;
  inset: 48px 64px 0 0;
  overflow: auto;
  background-color: rgb(13, 6, 23);
  z-index: 20;
  padding: 22px 26px 40px;
  box-sizing: border-box;
}
[data-z-settings-page="true"] .zs-page-head { margin: 0 0 14px; }
[data-z-settings-page="true"] .zs-page-title {
  margin: 0; font-size: 26px; font-weight: 700; letter-spacing: .2px;
  color: var(--text, #e8e8ea);
}
[data-z-settings-page="true"] .zs-page-sub {
  margin: 6px 0 0; font-size: 13px; color: var(--muted, #a8a8ad);
}
[data-z-settings-page="true"] .zs-page-host { min-height: 40px; }

/* the same pane, full width, on this route only */
[data-z-settings-page="true"] .settings-panel {
  position: fixed !important;
  inset: 48px 64px 0 0 !important;
  width: auto !important;
  max-width: none !important;
  border-radius: 0 !important;
  z-index: 21 !important;
}
