/* The window's frame and sheet (D-376), loaded after every other sheet. The board "A nicer Worldrig" (2026-11-18),
   looks Calm and In the world. Every colour comes from the theme's roles, so each theme gets the same shape in its own
   colours, and nothing here needs the desktop window: it works the same in a browser tab and as an installed web app.
   1. One frame: the top bar, the rail and the side column sit on the window, with no strips or lines between them.
   2. The page is a sheet: one raised surface with round corners, its tabs on its top edge. Phones and pop-out
      windows show the sheet edge to edge.
   3. From the cover: the world's cover, washed out, shows in the frame (world-light.mjs makes a small blurred copy,
      so a browser draws no blur of its own). A chosen theme keeps its own colours and shows no picture.
   4. The Hub, which belongs to no world, glows in Midnight Prism's steel and ice (D-197).
   5. One family of buttons in the top bar, and lists as rows on the sheet. The fonts stay the brand's. */
body.wb-shell {
  --wl-frame-bg: color-mix(in srgb, var(--wl-bg) 62%, #000);
  --wl-sheet: color-mix(in srgb, var(--wl-bg) 45%, var(--wl-surface));
  --wl-sheet-line: color-mix(in srgb, var(--wl-text) 7%, transparent);
  --wl-sheet-tint: color-mix(in srgb, var(--wl-text) 4.5%, transparent);
  --wl-sheet-shadow: inset 0 1px 0 color-mix(in srgb, var(--wl-text) 3.5%, transparent), 0 24px 60px -28px rgb(0 0 0 / .7);
  --wl-sheet-radius: 14px;
  --wl-sheet-gap: 10px;
}
body.wb-shell:is([data-wl-theme="frost"], [data-wl-theme="vellum"]) {
  --wl-frame-bg: color-mix(in srgb, var(--wl-bg) 91%, var(--wl-text));
  --wl-sheet: var(--wl-surface);
  --wl-sheet-line: color-mix(in srgb, var(--wl-text) 9%, transparent);
  --wl-sheet-shadow: 0 0 0 1px color-mix(in srgb, var(--wl-text) 4%, transparent), 0 18px 44px -24px color-mix(in srgb, var(--wl-text) 30%, transparent);
}

/* 1. One frame, with whisper-thin hairline separators only between the rail and an open side column/panel (never against the rounded sheet corner). */
body.wb-shell.wl-own, body.wb-shell .wl-workspace { background: var(--wl-frame-bg) !important; }
body.wb-shell :is(.wb-project-bar, .wl-workspace-top, .wl-rail, .wl-page-column, .wl-sys-column) { background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
body.wb-shell .wl-rail:is(:has(+ .wl-side-panel.is-left:not(.is-folded)), :has(+ .wl-side-panel.is-left.is-folded + .wl-page-column:not(.is-folded))) { border-right: 1px solid var(--wl-sheet-line) !important; }
body.wb-shell .wl-page-column:not(.is-folded) { border-right: 1px solid var(--wl-sheet-line) !important; }
/* Sync is a solid full-page overlay in Play: keep the top bar solid so the scene backdrop never bleeds behind it. */
body.wb-shell.wb-game-open.wb-game-syncing .wb-project-bar { background: var(--wl-bg) !important; border-bottom-color: var(--wl-line) !important; }
/* The left side panel (Files' tree, Search, Bookmarks) is a column on the frame too, like System's. */
body.wb-shell .wl-side-panel.is-left, body.wb-shell .wl-side-panel.is-left :is(.wl-side-inner, .wl-tool-row, .wl-tab-page, .wl-tab-row) { background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
body.wb-shell .wl-side-panel.is-left:not(.is-folded) { border-right: 1px solid var(--wl-sheet-line) !important; }
body.wb-shell .wl-side-panel.is-left .wl-tool-row { border-bottom: 1px solid var(--wl-sheet-line) !important; }

/* 2. The sheet. */
body.wb-shell .wl-main { padding: 0 var(--wl-sheet-gap) var(--wl-sheet-gap) 0; }
body.wb-shell .wl-main-stage { background: var(--wl-sheet); border: 1px solid var(--wl-sheet-line); border-radius: var(--wl-sheet-radius); overflow: hidden; box-shadow: var(--wl-sheet-shadow); }
body.wb-shell .wl-tab-row { background: transparent !important; border-bottom: 1px solid var(--wl-sheet-line) !important; }
body.wb-shell .wl-tab:not(.is-shown) { background: transparent !important; }
body.wb-shell .wl-tab.is-shown { background: var(--wl-sheet-tint) !important; }
body.wb-shell .wl-tab-row .wl-tab::before, body.wb-shell .wl-tab.is-shown::after { opacity: 0; }
body.wb-shell :is(.wb-home, .wb-home-page) { background: transparent !important; }

/* 3. From the cover: the world's cover in the frame, veiled in the theme's background; the sheet stays nearly solid,
   so words never sit on the picture. */
body.wb-shell.has-world-cover:is(:not([data-wl-theme]), [data-wl-theme="cover"]) {
  --wl-sheet: color-mix(in srgb, color-mix(in srgb, var(--wl-bg) 45%, var(--wl-surface)) 92%, transparent);
  --wl-sheet-line: color-mix(in srgb, var(--wl-text) 9%, transparent);
  --wl-frame-bg: var(--wl-bg);
}
body.wb-shell.wl-own.has-world-cover:is(:not([data-wl-theme]), [data-wl-theme="cover"])::before,
body.wb-shell.wl-own.has-world-cover:is(:not([data-wl-theme]), [data-wl-theme="cover"])::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
}
body.wb-shell.wl-own.has-world-cover:is(:not([data-wl-theme]), [data-wl-theme="cover"])::before {
  background: var(--wl-world-cover) center 40% / cover no-repeat; filter: saturate(1.35) brightness(.62);
}
body.wb-shell.wl-own.has-world-cover:is(:not([data-wl-theme]), [data-wl-theme="cover"])::after {
  background: linear-gradient(180deg, color-mix(in srgb, var(--wl-bg) 25%, transparent), color-mix(in srgb, var(--wl-bg) 55%, transparent));
}
body.wb-shell.has-world-cover:is(:not([data-wl-theme]), [data-wl-theme="cover"]) .wl-workspace { background: transparent !important; }
body.wb-shell.has-world-cover:is(:not([data-wl-theme]), [data-wl-theme="cover"]) :is(.wb-project-bar, .wl-rail, .wl-sys-column, .wl-side-panel.is-left) { text-shadow: 0 1px 8px rgb(0 0 0 / .35); }
body.wb-shell.has-world-cover:is(:not([data-wl-theme]), [data-wl-theme="cover"]) .wl-rail-button:not(.is-active):not([aria-pressed="true"]) { color: color-mix(in srgb, var(--wl-text) 80%, transparent) !important; }
body.wb-shell.has-world-cover:is(:not([data-wl-theme]), [data-wl-theme="cover"]) .wl-sys-row.is-shown { background: color-mix(in srgb, var(--wl-text) 9%, transparent) !important; }

/* 4. The Hub: Midnight Prism's steel and ice behind the same frame and sheet. */
body.wb-shell .wb-projects-overview {
  background: radial-gradient(55% 60% at 8% 0%, color-mix(in srgb, var(--wl-accent) 30%, transparent), transparent 70%),
    radial-gradient(45% 55% at 100% 100%, color-mix(in srgb, var(--wl-selection) 22%, transparent), transparent 70%), var(--wl-frame-bg) !important;
}
body.wb-shell :is(.wp-frame, .wp-header, .wp-sidebar) { background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
/* On small screens (≤ 860px) the Hub sidebar becomes a slide-over drawer: keep it solid with Midnight Prism's glow. */
@media (max-width: 860px) {
  body.wb-shell .wp-sidebar {
    background: radial-gradient(85% 55% at 10% 0%, color-mix(in srgb, var(--wl-accent) 24%, transparent), transparent 72%),
      var(--wl-frame-bg, var(--wl-surface)) !important;
    border-right: 1px solid var(--wl-sheet-line, var(--wl-line)) !important;
    box-shadow: var(--wl-elev-pop) !important;
  }
}
/* Keep workspace drawers and floating panels tinted in the active workspace theme (including world-cover tint). */
@media (min-width: 769px) and (max-width: 1024px) {
  body.wb-shell .wl-side-panel.is-left:not(.is-folded),
  body.wb-shell .wl-page-column:not(.is-folded) {
    background: var(--wl-frame-bg, var(--wl-surface)) !important;
    box-shadow: var(--wl-elev-pop) !important;
  }
  body.wb-shell.has-world-cover:is(:not([data-wl-theme]), [data-wl-theme="cover"]) :is(.wl-side-panel.is-left:not(.is-folded), .wl-page-column:not(.is-folded)) {
    background: linear-gradient(180deg, color-mix(in srgb, var(--wl-bg) 78%, transparent), color-mix(in srgb, var(--wl-bg) 88%, transparent)),
      var(--wl-world-cover) center 40% / cover no-repeat, var(--wl-bg) !important;
  }
}
@media (max-width: 768px) {
  body.wb-shell .wl-ui.wl-workspace .wl-drawer-shell {
    background: var(--wl-frame-bg, var(--wl-surface)) !important;
    border-right: 1px solid var(--wl-sheet-line, var(--wl-line)) !important;
  }
  body.wb-shell.has-world-cover:is(:not([data-wl-theme]), [data-wl-theme="cover"]) .wl-ui.wl-workspace .wl-drawer-shell {
    background: linear-gradient(180deg, color-mix(in srgb, var(--wl-bg) 72%, transparent), color-mix(in srgb, var(--wl-bg) 86%, transparent)),
      var(--wl-world-cover) center 40% / cover no-repeat, var(--wl-bg) !important;
  }
  body.wb-shell .wl-ui.wl-workspace .wl-side-panel.is-right:not(.is-folded) {
    background: var(--wl-frame-bg, var(--wl-surface)) !important;
  }
}
body.wb-shell .wp-body {
  max-width: none !important; margin: 0 var(--wl-sheet-gap) var(--wl-sheet-gap) 0 !important;
  min-height: calc(100vh - var(--wb-bar-height) - var(--wl-sheet-gap)); min-height: calc(100dvh - var(--wb-bar-height) - var(--wl-sheet-gap));
  background: color-mix(in srgb, var(--wl-sheet) 92%, transparent); border: 1px solid var(--wl-sheet-line); border-radius: var(--wl-sheet-radius); box-shadow: var(--wl-sheet-shadow);
}
body.wb-shell .wp-card { border-color: transparent !important; background: color-mix(in srgb, var(--wl-text) 2.5%, transparent) !important; box-shadow: none !important; }
body.wb-shell .wp-new-card { background: transparent !important; }
body.wb-shell .wp-hero { border-color: transparent !important; }
body.wb-shell :is(.wp-search, .wp-toolbar input) { background: color-mix(in srgb, var(--wl-text) 3%, transparent) !important; }
body.wb-shell .wp-nav-link.is-active { background: var(--wl-sheet-tint) !important; }

/* 5. The top bar: three buttons of one family, one height and one corner. The music and the draft are quiet, a
   faint fill under a hairline; Create version and its menu are one button, outlined, with a line between the two. */
body.wb-shell .wb-project-bar {
  --wl-bar-quiet: color-mix(in srgb, var(--wl-text) 5%, transparent);
  --wl-bar-quiet-hover: color-mix(in srgb, var(--wl-text) 9%, transparent);
  --wl-bar-hairline: color-mix(in srgb, var(--wl-text) 8%, transparent);
  --wl-bar-main: color-mix(in srgb, var(--wl-text) 7%, transparent);
  --wl-bar-main-hover: color-mix(in srgb, var(--wl-text) 12%, transparent);
}
body.wb-shell .wb-project-bar .wb-project-actions { gap: 8px; }
/* Hub button on the left matches the quiet bar buttons on the right: same 32px height, corner and hairline. */
body.wb-shell .wb-project-bar .wb-projects-button {
  height: 32px; padding: 0 11px 0 9px; gap: 6px; border: 0 !important; border-radius: var(--r-md) !important;
  background: var(--wl-bar-quiet) !important; box-shadow: inset 0 0 0 1px var(--wl-bar-hairline) !important;
  color: var(--wl-text-2) !important; font-size: var(--t-ui); font-weight: 500;
  transition: background-color var(--wl-quick) var(--wl-ease), color var(--wl-quick) var(--wl-ease);
}
body.wb-shell .wb-project-bar .wb-projects-button .wb-icon { width: 15px; height: 15px; }
body.wb-shell .wb-project-bar .wb-projects-button:hover { background: var(--wl-bar-quiet-hover) !important; color: var(--wl-text) !important; }
body.wb-shell .wb-project-bar .wb-projects-button:focus-visible { outline: 2px solid var(--wl-selection); outline-offset: 2px; }
body.wb-shell .wb-project-bar :is(.wl-music-pair.is-bar, .wb-version-history, .wb-version-button, .wb-version-more) {
  height: 32px; border: 0 !important; transition: background-color var(--wl-quick) var(--wl-ease), color var(--wl-quick) var(--wl-ease);
}
/* Quiet: the music (with its pause while a song plays) and the draft. */
body.wb-shell .wb-project-bar :is(.wl-music-pair.is-bar, .wb-version-history) {
  display: inline-flex; align-items: center; margin: 0; overflow: hidden; border-radius: var(--r-md) !important;
  background: var(--wl-bar-quiet) !important; box-shadow: inset 0 0 0 1px var(--wl-bar-hairline) !important; color: var(--wl-text-2) !important;
}
body.wb-shell .wb-project-bar .wl-music-pair.is-bar > button { height: 32px; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; color: var(--wl-text-2) !important; }
body.wb-shell .wb-project-bar .wl-music-pair.is-bar > button.wl-music-hold:not([hidden]) { width: 32px; box-shadow: inset -1px 0 0 var(--wl-bar-hairline) !important; }
body.wb-shell .wb-project-bar :is(.wb-version-history, .wl-music-pair.is-bar > button):hover { background: var(--wl-bar-quiet-hover) !important; color: var(--wl-text) !important; }
/* Create version and its menu: one outlined button. */
body.wb-shell .wb-project-bar .wb-version-button {
  background: var(--wl-bar-main) !important; color: var(--wl-text) !important; box-shadow: inset 0 0 0 1px var(--wl-line-strong) !important;
}
body.wb-shell .wb-project-bar .wb-version-button:has(+ .wb-version-more) { border-radius: var(--r-md) 0 0 var(--r-md) !important; }
body.wb-shell .wb-project-bar .wb-version-more {
  margin-inline-start: -8px; border-radius: 0 var(--r-md) var(--r-md) 0 !important; background: var(--wl-bar-main) !important; color: var(--wl-text-2) !important;
  box-shadow: inset 0 1px 0 var(--wl-line-strong), inset -1px 0 0 var(--wl-line-strong), inset 0 -1px 0 var(--wl-line-strong) !important;
}
body.wb-shell .wb-project-bar :is(.wb-version-button, .wb-version-more):hover { background: var(--wl-bar-main-hover) !important; color: var(--wl-text) !important; }
body.wb-shell .wb-project-bar :is(.wl-music-pair.is-bar > button, .wb-version-history, .wb-version-button, .wb-version-more):focus-visible { outline: 2px solid var(--wl-selection); outline-offset: 2px; }

/* The fonts stay the brand's (DESIGN-SYSTEM.md section 4, look.css): this sheet changes no type. */

/* Lists are rows on the sheet, not a box of rows. */
body.wb-shell .wl-tl-list { border-color: transparent !important; background: transparent !important; box-shadow: none !important; overflow: visible !important; }
body.wb-shell .wl-tl-row { border-top-color: var(--wl-sheet-line) !important; border-radius: 10px; min-height: 56px; }
body.wb-shell .wl-tl-row:is(:hover, :focus-within) { border-top-color: transparent !important; }
body.wb-shell .wl-tl-tile { background: transparent !important; box-shadow: none !important; }

/* Phones and pop-out windows: the sheet fills the window, with no gap or corners. */
@media (max-width: 768px) {
  body.wb-shell { --wl-sheet-gap: 0px; --wl-sheet-radius: 0px; }
  body.wb-shell :is(.wl-main-stage, .wp-body) { border-width: 0; box-shadow: none; }
  body.wb-shell .wl-main { padding: 0; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  /* On tablets, floating panels keep a solid surface & elevation shadow over the sheet. */
  body.wb-shell .wl-page-column:not(.is-folded),
  body.wb-shell .wl-side-panel.is-left:not(.is-folded) { background: color-mix(in srgb, var(--wl-bg) 45%, var(--wl-surface)) !important; box-shadow: var(--wl-elev-pop) !important; text-shadow: none; }
}
body.wb-shell.is-popout-window { --wl-sheet-gap: 0px; --wl-sheet-radius: 0px; }
body.wb-shell.is-popout-window .wl-main-stage { border-width: 0; box-shadow: none; }

/* Less see-through when asked: no picture, a solid sheet. */
@media (prefers-reduced-transparency: reduce) {
  body.wb-shell.wl-own::before, body.wb-shell.wl-own::after { display: none !important; }
  body.wb-shell.has-world-cover { --wl-sheet: color-mix(in srgb, var(--wl-bg) 45%, var(--wl-surface)); --wl-frame-bg: color-mix(in srgb, var(--wl-bg) 62%, #000); }
}
