/* SHOW DESKTOP (components/show-desktop.js): the menu bar toggle, the hidden window, the paused animations and the
   floating "Show browser" pill. Semantic tokens only. */

/* The toggle: like the other tray toggles; the label box is as wide as "show browser" so the tray never changes
   width. Checkbox + 16px desktop glyph + words; under ~1100px checkbox + glyph only. Phones (under 700px): not rendered (no wallpaper there). */
.os-tray__desk-label { display: inline-grid; }
.os-tray__desk-label > span,
.os-tray__desk-label::after { grid-area: 1 / 1; }
.os-tray__desk-label::after { content: "show browser"; visibility: hidden; }
.os-tray__btn--desk { padding-right: 6px; }
@media (max-width: 1099.98px) {
  .os-tray__btn--desk { padding-right: 3px; }
  .os-tray__btn--desk .os-tray__desk-label { display: none; }
}
@media (max-width: 43.75rem) {
  .os-tray__btn--desk { display: none; }
}
html:not(.js) .os-tray__btn--desk { display: none; } /* without JavaScript the button couldn't do anything */

/* The hidden window: still laid out (scroll position and state stay), not visible, not clickable; inert +
   aria-hidden are set by the script. Everything inside it is paused. */
html[data-desktop="on"] [data-browser] {
  visibility: hidden;
  pointer-events: none;
}
html[data-desktop="on"] [data-browser] *,
html[data-desktop="on"] [data-browser] *::before,
html[data-desktop="on"] [data-browser] *::after {
  animation-play-state: paused !important;
}

/* The dock stays visible on every page while the desktop is shown (dock-float.js cancels its hide timer) */
html[data-desktop="on"] .dock-handle { display: none !important; }
html[data-desktop="on"].dock-away .os-dock { transform: translateX(-50%) !important; pointer-events: auto !important; }

/* The "Show browser" pill: centered, 12px above the dock's top edge (the dock is 72px tall + its float gap on
   autohide pages), only while the desktop is shown */
.desk-pill {
  position: fixed;
  left: 50%;
  bottom: calc(var(--desk-pill-bottom, 96px));
  z-index: calc(var(--z-os-menubar) + 1);
  min-height: 24px;
  padding: 3px 14px;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0s linear 0.15s;
}
.desk-pill.is-shown {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.15s ease, visibility 0s;
}
.desk-pill:focus-visible { outline: 2px solid var(--os-focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .desk-pill, .desk-pill.is-shown { transition: none; }
}
@media (max-width: 43.75rem) {
  .desk-pill { display: none; }
}
