/* Persistent desktop console: only the glass display changes screens. */
html body.web-ui-active [data-web-ui] [data-monitor-page] [data-ui-nav] [data-ui-spacer] {
  display: none !important;
}
html[data-ui-platform='web']:not([data-ui-device='psg1']) .web-home-screen--page {
  display: block;
  position: relative;
  isolation: isolate;
}
.web-home-screen--page > :not([data-monitor-page]) { display: none !important; }
.web-home-screen--page::after { display: none !important; }
.web-monitor-page {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  container: monitor / size;
  background: var(--bc-bg);
}
html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) > main {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 12px;
  overflow: hidden;
  --psg-gap: 8px;
  --psg-control: clamp(40px, 7cqh, 56px);
  --ui-nav-height: var(--psg-control);
  --ui-nav-font: clamp(16px, 2.6cqw, 24px);
}
html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) [data-ui-nav] {
  width: 100%;
  min-width: 0;
  margin: 0;
  gap: 6px;
}
html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) [data-ui-nav] > * {
  min-width: 0;
  max-width: 100%;
}
html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) [data-ui-page] [data-ui-nav] :is([data-ui-tab], [data-ui-back]) {
  width: auto;
  min-width: 0;
  padding-inline: 8px;
  white-space: normal;
}
html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) :is(.psg1-console-frame, .settings-web__rows article, .shop-web__desktop-side, .shop-web__desktop-content)::before {
  /* The existing TV housing supplies the hardware; no extra corner knobs. */
  background: none;
}
html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .shop-web__desktop-owned {
  min-height: 0;
  grid-template-rows: repeat(4, minmax(60px, 1fr));
}
html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) :is(.shop-web__desktop-side, .shop-web__desktop-content) {
  min-width: 0;
  padding: 10px;
}
html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) :is(.operations-web__grid, .hq-page-web__content, .ranking-web__rows, .shop-web__desktop-side) {
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .operations-web__grid--hq {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(210px, 1fr);
}
html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .ranking-web__shell {
  grid-template-columns: minmax(0, 2fr) minmax(170px, 1fr);
}
html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .ranking-web__row > * {
  font-size: clamp(18px, 2.6cqw, 30px);
}
html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .ranking-web__perks {
  font-size: clamp(18px, 2.6cqw, 30px) !important;
}
html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) :is(button, a, input, select):focus-visible {
  outline: 2px solid var(--bc-command);
  outline-offset: -3px;
}
html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) [data-ui-back]:focus-visible {
  outline-color: var(--bc-danger);
}
@container monitor (max-width: 700px) {
  html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .shop-web__desktop-shell {
    grid-template-columns: minmax(140px, 26%) minmax(0, 1fr);
  }
  html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .operations-web__grid--hq {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .shop-web__desktop-side {
  overflow-y: auto;
}
/* Short monitors still expose a complete purchase card, not just its artwork. */
@container monitor (max-height: 450px) {
  html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .shop-web__desktop-content .shop-web__card {
    min-height: 160px;
    height: 160px;
    grid-template-rows: auto minmax(30px, 1fr) auto 36px;
    gap: 4px;
    padding: 6px;
  }
  html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .shop-web__desktop-content .shop-web__card-icon {
    min-height: 30px;
  }
  html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .shop-web__desktop-content .shop-web__card-icon img {
    max-height: 42px;
  }
  html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .shop-web__desktop-content .shop-web__card h2 {
    font-size: 20px;
  }
  html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .shop-web__desktop-side {
    display: block;
  }
  html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .shop-web__wallet-panel {
    margin-bottom: 8px;
  }
  html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .shop-web__desktop-side .shop-web__resource {
    height: 32px;
  }
  html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .hq-page-web__heading {
    min-height: 56px;
    padding: 8px 12px;
  }
  html body.web-ui-active [data-web-ui] [data-monitor-page].web-monitor-page:not([hidden]) .hq-page-web__manual-card {
    min-height: 220px;
    grid-template-rows: auto 64px minmax(0, 1fr) auto;
    padding: 10px;
    gap: 6px;
  }
}
