/* BioStudio AI — shared chrome for the layout-first styles
   (Folio, Ink, Block, Orbit, Bench — see js/platform/novel-styles.js).

   Each style's own sheet (css/shell-<id>.css) sets:
     • its --ct-* palette for White and Black, so the shell's legacy tokens
       and the app content of White windows (which read --mono-*) follow it;
     • the --nv-* tokens below (type, radii, borders, shadows, controls);
     • its bar / hub / status line and launcher layout.
   This file turns the tokens into windows, menus, flyouts, dialogs,
   notifications, desktop icons and scrollbars. Scoped to `.novel-shell`,
   which the shell adds to #os and <body> only while one of them is active. */

/* Parts of the bar only these styles show. */
.task-btn-label,
.task-btn-close,
.tb-start-label,
.bench-map {
  display: none;
}

html:not(.shell-mobile) #os.novel-shell,
html:not(.shell-mobile) body.novel-shell {
  --font: var(--nv-font);
  --radius: var(--nv-radius);
  --window-titlebar-h: var(--nv-titlebar-h);
  font-family: var(--nv-font);
}

/* ---------------------------------------------------------------------------
   Windows
   --------------------------------------------------------------------------- */

/* A window whose palette disagrees with the style's appearance (a Black app on
   a White desktop, or any coloured palette) keeps its own title-bar colours. */
html:not(.shell-mobile) #os.novel-shell .window {
  --nv-win-titlebar: var(--nv-titlebar);
  --nv-win-ink: var(--nv-ink);
  --nv-win-ink-idle: var(--nv-ink-3);
}

html:not(.shell-mobile) #os.novel-shell[data-color-theme="white"] .window[data-app-color-tone="dark"],
html:not(.shell-mobile) #os.novel-shell:not([data-color-theme="white"]) .window[data-app-color-tone="light"],
html:not(.shell-mobile) #os.novel-shell .window[data-app-color-theme]:not([data-app-color-theme="white"]):not([data-app-color-theme="black"]) {
  --nv-win-titlebar: var(--titlebar-bg);
  --nv-win-ink: var(--ink);
  --nv-win-ink-idle: var(--ink-soft);
}

html:not(.shell-mobile) #os.novel-shell .window,
html:not(.shell-mobile) #os.novel-shell .window[data-app-color-theme] {
  border-radius: var(--nv-radius) !important;
  border: var(--nv-win-border) !important;
  box-shadow: var(--nv-shadow-idle) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  font-family: var(--nv-font);
}

html:not(.shell-mobile) #os.novel-shell .window.focused,
html:not(.shell-mobile) #os.novel-shell .window[data-app-color-theme].focused {
  border: var(--nv-win-border-focus, var(--nv-win-border)) !important;
  box-shadow: var(--nv-shadow) !important;
}

html:not(.shell-mobile) #os.novel-shell .window.maximized,
html:not(.shell-mobile) #os.novel-shell .window[data-app-color-theme].maximized {
  border-radius: 0 !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

html:not(.shell-mobile) #os.novel-shell:not(.shell-mobile) .window:not(.maximized):not(.dragging),
html.fx-glass:not(.shell-mobile) #os.novel-shell:not(.shell-mobile) .window:not(.maximized):not(.dragging) {
  background: var(--win-bg) !important;
}

html:not(.shell-mobile) #os.novel-shell .window .window-titlebar,
html:not(.shell-mobile) #os.novel-shell .window[data-app-color-theme] .window-titlebar,
html.fx-glass:not(.shell-mobile) #os.novel-shell:not(.shell-mobile) .window:not(.maximized):not(.dragging) .window-titlebar {
  height: var(--nv-titlebar-h);
  background: var(--nv-win-titlebar) !important;
  border-bottom: var(--nv-titlebar-rule) !important;
  color: var(--nv-win-ink) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1 !important;
}

html:not(.shell-mobile) #os.novel-shell .window .window-title-text,
html:not(.shell-mobile) #os.novel-shell .window[data-app-color-theme] .window-title-text {
  font-family: var(--nv-font-title);
  font-size: var(--nv-title-size);
  font-weight: var(--nv-title-weight);
  letter-spacing: var(--nv-title-tracking, 0);
  color: var(--nv-win-ink) !important;
}

html:not(.shell-mobile) #os.novel-shell .window:not(.focused) .window-title-text,
html:not(.shell-mobile) #os.novel-shell .window[data-app-color-theme]:not(.focused) .window-title-text {
  color: var(--nv-win-ink-idle) !important;
}

html:not(.shell-mobile) #os.novel-shell .window .window-controls {
  height: 100%;
  align-items: center;
  gap: var(--nv-ctl-gap, 0px);
  padding-right: var(--nv-ctl-pad, 0px);
}

html:not(.shell-mobile) #os.novel-shell .window .win-btn,
html:not(.shell-mobile) #os.novel-shell .window[data-app-color-theme] .win-btn {
  width: var(--nv-ctl-w);
  min-width: var(--nv-ctl-w);
  height: var(--nv-ctl-h);
  border-radius: var(--nv-ctl-radius);
  color: var(--nv-win-ink) !important;
  transition: background-color 0.1s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

html:not(.shell-mobile) #os.novel-shell .window .win-btn svg {
  width: var(--nv-ctl-glyph, 14px);
  height: var(--nv-ctl-glyph, 14px);
}

html:not(.shell-mobile) #os.novel-shell .window .win-btn:hover:not(.close),
html:not(.shell-mobile) #os.novel-shell .window[data-app-color-theme] .win-btn:hover:not(.close) {
  background: var(--nv-hover) !important;
}

html:not(.shell-mobile) #os.novel-shell .window .win-btn.close:hover,
html:not(.shell-mobile) #os.novel-shell .window[data-app-color-theme] .win-btn.close:hover {
  background: var(--nv-close-hover) !important;
  color: var(--nv-close-ink, #ffffff) !important;
}

html:not(.shell-mobile) #os.novel-shell:not(.shell-mobile) .window:not(.focused) :is(.window-title-text, .window-controls),
html.fx-glass:not(.shell-mobile) #os.novel-shell:not(.shell-mobile) .window:not(.focused) :is(.window-title-text, .window-controls) {
  opacity: 1;
}

html.fx-glow:not(.shell-mobile) #os.novel-shell:not(.shell-mobile) .window::before {
  display: none;
}

/* ---------------------------------------------------------------------------
   Menus
   --------------------------------------------------------------------------- */

html:not(.shell-mobile) body.novel-shell .ctx-menu,
html:not(.shell-mobile) body.novel-shell .ctx-menu[role="menu"][data-app-color-theme] {
  min-width: 200px;
  padding: var(--nv-menu-pad, 6px);
  border-radius: var(--nv-radius-menu);
  border: var(--nv-menu-border) !important;
  background: var(--nv-menu) !important;
  background-image: none !important;
  box-shadow: var(--nv-menu-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--nv-ink) !important;
  font-family: var(--nv-font);
}

html:not(.shell-mobile) body.novel-shell .ctx-menu .ctx-item,
html:not(.shell-mobile) body.novel-shell .ctx-menu[role="menu"][data-app-color-theme] .ctx-item {
  height: var(--nv-item-h);
  padding: 0 10px;
  border-radius: var(--nv-radius-item);
  font-family: var(--nv-font);
  font-size: var(--nv-item-size, 13px);
  font-weight: var(--nv-item-weight, 400);
  color: var(--nv-ink) !important;
}

html:not(.shell-mobile) body.novel-shell .ctx-menu .ctx-item:hover:not([disabled]),
html:not(.shell-mobile) body.novel-shell .ctx-menu[role="menu"][data-app-color-theme] .ctx-item:hover:not([disabled]) {
  background: var(--nv-menu-hover) !important;
  color: var(--nv-menu-hover-ink) !important;
}

html:not(.shell-mobile) body.novel-shell .ctx-menu .ctx-item:hover:not([disabled]) :is(.ctx-icon, .ctx-shortcut, .ctx-arrow) {
  color: var(--nv-menu-hover-ink);
}

html:not(.shell-mobile) body.novel-shell .ctx-menu :is(.ctx-icon, .ctx-shortcut, .ctx-arrow) {
  color: var(--nv-ink-2);
}

html:not(.shell-mobile) body.novel-shell .ctx-menu .ctx-sep {
  margin: 4px 6px;
  background: var(--nv-line);
}

html:not(.shell-mobile) body.novel-shell .ctx-menu .ctx-header {
  color: var(--nv-ink-2);
  font-family: var(--nv-font-mono, var(--nv-font));
  letter-spacing: 0.06em;
}

html:not(.shell-mobile) body.novel-shell .ctx-menu .ctx-item.danger:hover:not([disabled]) {
  background: var(--nv-close-hover) !important;
  color: #ffffff !important;
}

/* ---------------------------------------------------------------------------
   Flyouts (Quick settings, notifications), dialogs, notifications
   --------------------------------------------------------------------------- */

html:not(.shell-mobile) #os.novel-shell .flyout {
  border-radius: var(--nv-radius-menu);
  border: var(--nv-menu-border);
  background: var(--nv-menu);
  box-shadow: var(--nv-menu-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--nv-ink);
  font-family: var(--nv-font);
}

html:not(.shell-mobile) #os.novel-shell .qs-tile {
  border-radius: var(--nv-radius-item);
  background: var(--nv-surface-3);
  color: var(--nv-ink);
}

html:not(.shell-mobile) #os.novel-shell .qs-tile:hover {
  background: var(--nv-hover);
}

html:not(.shell-mobile) #os.novel-shell .qs-tile.on {
  background: var(--nv-accent);
  color: var(--nv-on-accent);
}

html:not(.shell-mobile) #os.novel-shell .qs-tile.on .icon {
  color: var(--nv-on-accent);
}

html:not(.shell-mobile) #os.novel-shell .qs-accents {
  display: none;
}

html:not(.shell-mobile) #os.novel-shell .nc-item {
  border-radius: var(--nv-radius-item);
  background: var(--nv-surface-3);
}

html:not(.shell-mobile) #os.novel-shell :is(.nc-clear, .nc-unread-dot, .nc-item-category) {
  color: var(--nv-accent);
}

html:not(.shell-mobile) #os.novel-shell .cal-cell.today {
  background: var(--nv-accent);
  color: var(--nv-on-accent);
}

html:not(.shell-mobile) body.novel-shell .platform-dialog-overlay {
  background: var(--nv-scrim);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html:not(.shell-mobile) body.novel-shell .platform-dialog {
  border-radius: var(--nv-radius-menu);
  border: var(--nv-menu-border);
  background: var(--nv-surface) !important;
  box-shadow: var(--nv-menu-shadow);
  color: var(--nv-ink);
  font-family: var(--nv-font);
}

html:not(.shell-mobile) body.novel-shell .platform-dialog-title {
  font-family: var(--nv-font-title);
  font-weight: var(--nv-title-weight);
}

html:not(.shell-mobile) body.novel-shell .platform-dialog :is(.platform-dialog-foot button, .platform-dialog-foot .btn) {
  border-radius: var(--nv-radius-item);
  font-family: var(--nv-font);
}

html:not(.shell-mobile) body.novel-shell .platform-dialog-foot > :last-child {
  background: var(--nv-accent);
  color: var(--nv-on-accent);
  border-color: transparent;
}

html:not(.shell-mobile) #os.novel-shell .toast {
  border-radius: var(--nv-radius-menu);
  border: var(--nv-menu-border);
  background: var(--nv-menu);
  box-shadow: var(--nv-menu-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--nv-ink);
  font-family: var(--nv-font);
}

html:not(.shell-mobile) #os.novel-shell .toast-icon {
  color: var(--nv-accent);
}

/* ---------------------------------------------------------------------------
   Desktop icons
   --------------------------------------------------------------------------- */

html:not(.shell-mobile) #os.novel-shell .desktop-icon {
  border-radius: var(--nv-radius-item);
  color: var(--nv-desk-ink);
  text-shadow: var(--nv-desk-shadow);
  transform: none !important;
}

html:not(.shell-mobile) #os.novel-shell .desktop-icon:hover {
  background: var(--nv-desk-hover);
  border-color: transparent;
  box-shadow: none;
}

html:not(.shell-mobile) #os.novel-shell .desktop-icon.selected {
  background: var(--nv-desk-selected);
  border-color: var(--nv-desk-selected-line, transparent);
  box-shadow: none;
}

html:not(.shell-mobile) #os.novel-shell .desktop-icon-label {
  font-family: var(--nv-font);
  font-weight: var(--nv-desk-weight, 500);
}

html:not(.shell-mobile) #os.novel-shell .desktop-icon:hover .desktop-icon-glyph {
  transform: none;
}

html:not(.shell-mobile) #os.novel-shell .marquee {
  border: 1px solid var(--nv-accent);
  background: color-mix(in srgb, var(--nv-accent) 18%, transparent);
  border-radius: 0;
}

/* The per-style home dashboards never appear under these styles. */
html:not(.shell-mobile) #os.novel-shell :is(.bs1-home, .bs2-home, .bsx-home) {
  display: none !important;
}

/* ---------------------------------------------------------------------------
   Scrollbars and focus
   --------------------------------------------------------------------------- */

#os.novel-shell ::-webkit-scrollbar,
body.novel-shell ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

#os.novel-shell ::-webkit-scrollbar-track,
body.novel-shell ::-webkit-scrollbar-track {
  background: transparent;
}

#os.novel-shell ::-webkit-scrollbar-thumb,
body.novel-shell ::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: var(--nv-scroll-radius, 6px);
  background: var(--nv-scroll) padding-box;
}

#os.novel-shell :focus-visible,
body.novel-shell :focus-visible {
  outline: 2px solid var(--nv-accent);
  outline-offset: 1px;
}

#os.novel-shell [tabindex="-1"]:focus-visible {
  outline: none;
}

/* The drifting colour blobs belong to the branded wallpapers only. */
html:not(.shell-mobile) #os.novel-shell > .fx-aurora {
  display: none !important;
}
