/*
 * Large-screen accessibility tier.
 * 1920x1080 at 100% browser zoom is the 1x visual baseline.
 * Above 2200 CSS pixels, shell components grow with the viewport.
 */
@media (min-width: 2200px) and (min-height: 1200px) {
  :root {
    --xp-taskbar-height: clamp(42px, 1.56vw, 60px);
    --xp-start-menu-width: clamp(430px, 13.54vw, 520px);
  }

  .desktop-shortcut {
    width: clamp(90px, 3.13vw, 120px);
    min-height: clamp(82px, 2.86vw, 110px);
    padding: clamp(6px, .26vw, 10px) clamp(5px, .21vw, 8px);
    font-size: clamp(13px, .417vw, 16px);
  }
  .desktop-shortcut img {
    width: clamp(58px, 1.67vw, 64px);
    height: clamp(58px, 1.67vw, 64px);
  }
  .documents-desktop-shortcut { top: clamp(18px, .63vw, 24px); }
  .my-computer-desktop-shortcut { top: clamp(124px, 3.75vw, 144px); }
  .recycle-bin-shortcut { top: clamp(230px, 6.95vw, 267px); }
  .ie-desktop-shortcut { top: clamp(336px, 10.16vw, 390px); }
  .folder-desktop-shortcut { top: clamp(442px, 13.39vw, 514px); }
  .wow-desktop-shortcut {
    right: clamp(28px, 1.25vw, 48px);
    bottom: calc(var(--xp-taskbar-height) + clamp(18px, .83vw, 32px));
  }

  .xp-documents-window,
  .xp-ebooks-window {
    width: min(64vw, 1840px);
    height: min(64vh, calc(100vh - var(--xp-taskbar-height) - 7vh));
  }
  .xp-folder-window,
  .my-computer-window {
    width: min(62vw, 1680px);
    height: min(64vh, calc(100vh - var(--xp-taskbar-height) - 7vh));
  }
  .xp-app-window:not(.is-maximized) {
    min-width: 900px;
    min-height: 620px;
  }
  .xp-app-window {
    font-size: clamp(12px, .47vw, 18px);
  }

  .folder-toolbar { min-height: clamp(56px, 2.5vw, 96px); padding: clamp(4px,.2vw,8px) clamp(7px,.3vw,12px); }
  .folder-tool { height: clamp(46px, 2.08vw, 80px); gap: clamp(5px,.22vw,9px); padding: 3px clamp(6px,.26vw,10px); font-size: clamp(12px,.573vw,22px); }
  .folder-tool img { width: clamp(29px,1.15vw,44px); height: clamp(29px,1.15vw,44px); }
  .folder-address-row, .folder-go { font-size: clamp(12px,.573vw,22px); }
  .folder-address-row { min-height: clamp(29px,1.15vw,44px); }
  .folder-address-box { height: clamp(27px,1.2vw,46px); }
  .folder-address-box img, .folder-go img { width: clamp(20px,1vw,38px); height: clamp(20px,1vw,38px); }
  .folder-task-pane { width: clamp(240px,11.2vw,430px); flex-basis: clamp(240px,11.2vw,430px); padding: clamp(14px,.63vw,24px) clamp(12px,.52vw,20px); }
  .folder-task-group h2 { font-size: clamp(12px,.573vw,22px); }
  .folder-task-group a, .folder-task-group strong, .folder-task-group span { font-size: clamp(11px,.52vw,20px); }
  .folder-status-bar { height: clamp(27px,1.2vw,46px); flex-basis: clamp(27px,1.2vw,46px); font-size: clamp(11px,.52vw,20px); }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(clamp(160px, 6.88vw, 264px), 1fr));
    gap: clamp(28px,1.25vw,48px) clamp(24px,1.04vw,40px);
    padding: clamp(26px,1.15vw,44px);
  }
  #ebooks-grid {
    grid-template-columns: repeat(auto-fit, minmax(clamp(142px,6.15vw,236px), clamp(170px,6.88vw,264px)));
    column-gap: clamp(18px,.73vw,28px);
  }
  .book-shortcut,
  .ebook-shortcut {
    height: clamp(208px,9.06vw,348px);
    gap: clamp(8px,.36vw,14px);
    padding: clamp(4px,.16vw,6px);
    font-size: clamp(12px,.573vw,22px);
  }
  .book-shortcut img,
  .ebook-shortcut img {
    width: clamp(110px,4.79vw,184px);
    height: clamp(158px,6.88vw,264px);
  }
  .book-shortcut span,
  .ebook-shortcut span { max-width: clamp(150px,6.56vw,252px); }

  .restart-confirm-dialog {
    width: clamp(480px,17.71vw,680px);
    height: clamp(180px,6.51vw,250px);
  }
  .restart-confirm-titlebar {
    height: clamp(34px,1.46vw,56px);
    flex-basis: clamp(34px,1.46vw,56px);
    padding: clamp(5px,.21vw,8px);
  }
  .restart-confirm-titlebar strong { font-size: clamp(14px,.52vw,20px); }
  .book-link-dialog-close,
  .book-link-dialog-close img,
  .restart-confirm-titlebar::after {
    width: clamp(24px,1.04vw,40px);
    height: clamp(24px,1.04vw,40px);
    flex-basis: clamp(24px,1.04vw,40px);
  }
  .restart-confirm-body { padding: clamp(10px,.42vw,16px); }
  .restart-confirm-message { gap: clamp(18px,.83vw,32px); padding: clamp(10px,.42vw,16px); }
  .restart-confirm-message img {
    width: clamp(40px,1.67vw,64px);
    height: clamp(40px,1.67vw,64px);
    flex-basis: clamp(40px,1.67vw,64px);
  }
  .restart-confirm-message p { font-size: clamp(13px,.47vw,18px); line-height: 1.4; }
  .repo-xp-button {
    min-width: clamp(92px,3.91vw,150px);
    min-height: clamp(28px,1.2vw,46px);
    margin-inline: clamp(8px,.36vw,14px);
    padding: 3px clamp(11px,.47vw,18px);
    font-size: clamp(13px,.47vw,18px);
  }

  .xp-start-button {
    flex-basis: clamp(162px,5.29vw,203px);
    width: clamp(162px,5.29vw,203px);
    height: var(--xp-taskbar-height);
    background-size: clamp(162px,5.29vw,203px) calc(var(--xp-taskbar-height) * 3);
    background-position: 0 calc(var(--xp-taskbar-height) * -2);
  }
  .xp-start-button:hover,
  .xp-start-button:focus-visible { background-position: 0 calc(var(--xp-taskbar-height) * -1); }
  .xp-start-button:active,
  .xp-start-button.is-selected { background-position: 0 0; }
  .xp-taskbar-clock { font-size: clamp(14px,.52vw,20px); }
  .xp-tray-icon { width: clamp(23px,.91vw,35px); height: clamp(29px,1.15vw,44px); }
  .xp-tray-icon img { width: clamp(18px,.73vw,28px); height: clamp(18px,.73vw,28px); }
  .xp-system-tray { min-width: clamp(172px,6.77vw,260px); gap: clamp(6px,.26vw,10px); padding-inline: clamp(14px,.57vw,22px); }
  .xp-taskbar-clock { min-width: clamp(68px,2.6vw,100px); flex-basis: clamp(68px,2.6vw,100px); }

  .xp-start-menu {
    height: min(72vh, calc(100dvh - var(--xp-taskbar-height) - 10px));
    grid-template-rows: clamp(78px,3.33vw,128px) minmax(0,1fr) clamp(72px,3.02vw,116px);
  }
  .xp-user-badge { width: clamp(58px,2.5vw,96px); height: clamp(58px,2.5vw,96px); flex-basis: clamp(58px,2.5vw,96px); }
  .xp-start-menu-header strong { font-size: clamp(18px,.73vw,28px); }
  .xp-menu-item, .xp-all-programs, .xp-footer-action { font-size: clamp(14px,.52vw,20px); }
  .xp-menu-item small { font-size: clamp(12px,.52vw,20px); }
  .xp-system-item { min-height: clamp(48px,2.03vw,78px); grid-template-columns: clamp(34px,1.46vw,56px) minmax(0,1fr); }
  .xp-system-item img { width: clamp(32px,1.35vw,52px); height: clamp(32px,1.35vw,52px); }
  .xp-footer-action img { width: clamp(32px,1.35vw,52px); height: clamp(32px,1.35vw,52px); }

  .xp-context-menu { font-size: clamp(13px,.47vw,18px); }
  .xp-tray-balloon { width: clamp(300px,13vw,500px); font-size: clamp(13px,.47vw,18px); bottom: calc(var(--xp-taskbar-height) - 6px); }
}

/* Maximized windows always occupy the usable desktop, independent of scaling tier. */
.xp-app-window.is-maximized {
  inset: 0 0 var(--xp-taskbar-height) 0 !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
}



/* Keep the Luna taskbar and Start menu at the authentic desktop baseline. */
@media (min-width: 1600px) and (min-height: 800px) {
  :root { --xp-taskbar-height: 40px; --xp-start-menu-width: 390px; }
  .xp-start-button { width:135px; height:40px; flex-basis:135px; background-size:135px 120px; background-position:0 -80px; }
  .xp-start-button:hover,.xp-start-button:focus-visible { background-position:0 -40px; }
  .xp-start-button:active,.xp-start-button.is-selected { background-position:0 0; }
  .xp-task-area { padding:3px 8px 3px 13px; }
  .xp-system-tray { min-width:124px; gap:5px; padding:0 14px 0 12px; }
  .xp-tray-icon { width:20px; height:24px; }
  .xp-tray-icon img { width:16px; height:16px; }
  .xp-taskbar-clock { min-width:58px; flex-basis:58px; font-size:13px; }
  .xp-start-menu { width:min(390px,calc(100vw - 10px)); height:min(556px,calc(100dvh - 46px)); grid-template-rows:64px minmax(0,1fr) 58px; border-width:2px; }
  .xp-start-menu-header { gap:10px; padding:6px 8px; }
  .xp-user-badge { width:44px; height:44px; flex-basis:44px; }
  .xp-start-menu-header strong { font-size:18px; }
  .xp-start-column { gap:0; padding:10px 8px 8px; }
  .xp-menu-item,.xp-all-programs,.xp-footer-action { font-size:14px; }
  .xp-menu-item { min-height:47px; padding:8px 10px; }
  .xp-menu-item small { margin-top:3px; font-size:11px; }
  .xp-system-item { min-height:42px; grid-template-columns:30px minmax(0,1fr); gap:8px; padding:5px 7px; }
  .xp-system-item img { width:28px; height:28px; }
  .xp-all-programs { min-height:48px; margin:auto -8px -8px; padding:10px 29px 9px 10px; }
  .xp-all-programs-arrow { font-size:25px; }
  .xp-start-menu-footer { gap:8px; padding:7px 9px; }
  .xp-footer-action { padding:4px 3px; }
  .xp-footer-action img { width:27px; height:27px; }
}


/* Final compact shell calibration: unconditional so display scaling cannot bypass it. */
:root { --xp-taskbar-height: 32px; --xp-start-menu-width: 340px; }
.xp-taskbar { height:32px !important; }
.xp-start-button {
  width:108px !important;
  height:32px !important;
  flex-basis:108px !important;
  background-size:108px 96px !important;
  background-position:0 -64px !important;
}
.xp-start-button:hover,.xp-start-button:focus-visible { background-position:0 -32px !important; }
.xp-start-button:active,.xp-start-button.is-selected { background-position:0 0 !important; }
.xp-task-area { padding:2px 7px 2px 11px !important; }
.xp-system-tray { min-width:112px !important; gap:3px !important; padding:0 8px 0 7px !important; }
.xp-tray-icon { width:18px !important; height:22px !important; }
.xp-tray-icon img { width:14px !important; height:14px !important; }
.xp-taskbar-clock { min-width:52px !important; flex-basis:52px !important; font-size:11px !important; }

.xp-start-menu {
  bottom:32px !important;
  width:min(340px,calc(100vw - 10px)) !important;
  height:min(480px,calc(100dvh - 38px)) !important;
  grid-template-rows:54px minmax(0,1fr) 48px !important;
}
.xp-start-menu-header { gap:8px !important; padding:5px 7px !important; }
.xp-user-badge { width:38px !important; height:38px !important; flex-basis:38px !important; }
.xp-start-menu-header strong { font-size:16px !important; }
.xp-start-column { padding:8px 7px 7px !important; }
.xp-menu-item,.xp-all-programs,.xp-footer-action { font-size:12px !important; }
.xp-menu-item { min-height:39px !important; padding:6px 8px !important; }
.xp-menu-item small { margin-top:2px !important; font-size:10px !important; }
.xp-system-item {
  min-height:35px !important;
  grid-template-columns:25px minmax(0,1fr) !important;
  gap:6px !important;
  padding:4px 6px !important;
}
.xp-system-item img { width:24px !important; height:24px !important; }
.xp-all-programs {
  min-height:40px !important;
  margin:auto -7px -7px !important;
  padding:8px 25px 7px 8px !important;
}
.xp-all-programs-arrow { width:19px !important; height:19px !important; font-size:21px !important; }
.xp-start-menu-footer { gap:6px !important; padding:5px 7px !important; }
.xp-footer-action { padding:3px 2px !important; }
.xp-footer-action img { width:23px !important; height:23px !important; }


/* Bounded proportional shell: compact at 1920-class viewports, readable on 4K. */
:root {
  --xp-taskbar-height: clamp(32px, 1.667vw, 48px);
  --xp-start-menu-width: clamp(340px, 17.71vw, 510px);
  --xp-desktop-icon-size: clamp(48px, 2.5vw, 72px);
  --xp-desktop-icon-step: clamp(102px, 5.31vw, 153px);
  --xp-desktop-icon-top: clamp(16px, .83vw, 24px);
}
.xp-taskbar { height:var(--xp-taskbar-height) !important; }
.xp-start-button {
  width:calc(var(--xp-taskbar-height) * 3.375) !important;
  height:var(--xp-taskbar-height) !important;
  flex-basis:calc(var(--xp-taskbar-height) * 3.375) !important;
  background-size:calc(var(--xp-taskbar-height) * 3.375) calc(var(--xp-taskbar-height) * 3) !important;
  background-position:0 calc(var(--xp-taskbar-height) * -2) !important;
}
.xp-start-button:hover,.xp-start-button:focus-visible { background-position:0 calc(var(--xp-taskbar-height) * -1) !important; }
.xp-start-button:active,.xp-start-button.is-selected { background-position:0 0 !important; }

.xp-start-menu {
  bottom:var(--xp-taskbar-height) !important;
  width:min(var(--xp-start-menu-width),calc(100vw - 10px)) !important;
  height:min(clamp(480px,25vw,720px),calc(100dvh - var(--xp-taskbar-height) - 6px)) !important;
  grid-template-rows:clamp(54px,2.81vw,81px) minmax(0,1fr) clamp(48px,2.5vw,72px) !important;
}
.xp-start-menu-header strong { font-size:clamp(16px,.833vw,24px) !important; }
.xp-user-badge { width:clamp(38px,1.98vw,57px) !important; height:clamp(38px,1.98vw,57px) !important; flex-basis:clamp(38px,1.98vw,57px) !important; }
.xp-menu-item,.xp-all-programs,.xp-footer-action { font-size:clamp(12px,.625vw,18px) !important; }
.xp-menu-item small { font-size:clamp(10px,.52vw,15px) !important; }
.xp-system-item img { width:clamp(24px,1.25vw,36px) !important; height:clamp(24px,1.25vw,36px) !important; }
.xp-footer-action img { width:clamp(23px,1.2vw,35px) !important; height:clamp(23px,1.2vw,35px) !important; }

.desktop-shortcut {
  width:clamp(84px,4.375vw,126px) !important;
  min-height:clamp(76px,3.96vw,114px) !important;
  padding:clamp(4px,.21vw,6px) !important;
  font-size:clamp(11px,.573vw,16px) !important;
}
.desktop-shortcut img {
  width:var(--xp-desktop-icon-size) !important;
  height:var(--xp-desktop-icon-size) !important;
}
.documents-desktop-shortcut { top:var(--xp-desktop-icon-top) !important; }
.my-computer-desktop-shortcut { top:calc(var(--xp-desktop-icon-top) + var(--xp-desktop-icon-step)) !important; }
.recycle-bin-shortcut { top:calc(var(--xp-desktop-icon-top) + var(--xp-desktop-icon-step) + var(--xp-desktop-icon-step)) !important; }
.ie-desktop-shortcut { top:calc(var(--xp-desktop-icon-top) + var(--xp-desktop-icon-step) + var(--xp-desktop-icon-step) + var(--xp-desktop-icon-step)) !important; }
.folder-desktop-shortcut { top:calc(var(--xp-desktop-icon-top) + var(--xp-desktop-icon-step) + var(--xp-desktop-icon-step) + var(--xp-desktop-icon-step) + var(--xp-desktop-icon-step)) !important; }
.portfolio-desktop-shortcut { top:calc(var(--xp-desktop-icon-top) + var(--xp-desktop-icon-step) + var(--xp-desktop-icon-step) + var(--xp-desktop-icon-step) + var(--xp-desktop-icon-step) + var(--xp-desktop-icon-step)) !important; }
.wow-desktop-shortcut {
  right:clamp(18px,.94vw,27px) !important;
  bottom:calc(var(--xp-taskbar-height) + clamp(12px,.625vw,18px)) !important;
}


/* RebornXP start_menu.svelte footer: 40px row, 24px icons, 11px Tahoma. */
.xp-start-menu-footer {
  box-sizing:border-box !important;
  min-width:0 !important;
  height:40px !important;
  min-height:40px !important;
  gap:8px !important;
  flex-wrap:nowrap !important;
  overflow:hidden !important;
  padding:4px 8px !important;
}
.xp-footer-action {
  box-sizing:border-box !important;
  min-width:0 !important;
  max-width:100% !important;
  flex:0 1 auto !important;
  gap:4px !important;
  border:0 !important;
  padding:4px !important;
  overflow:hidden !important;
  color:#fff !important;
  background:transparent !important;
  box-shadow:none !important;
  font:11px/1 Tahoma,MSSS,Arial,sans-serif !important;
  text-overflow:ellipsis !important;
  text-shadow:1px 1px 0 #174c9a !important;
  white-space:nowrap !important;
}
.xp-footer-action img {
  width:24px !important;
  height:24px !important;
  flex:0 0 24px !important;
  object-fit:contain !important;
}
.xp-footer-action:hover,.xp-footer-action:focus-visible {
  border:0 !important;
  background:rgba(255,255,255,.16) !important;
  box-shadow:none !important;
  outline:1px solid rgba(255,255,255,.8) !important;
  outline-offset:-1px !important;
}
#xp-log-off { margin-left:auto !important; }
#xp-shut-down { margin-left:0 !important; }

/* Keep every running-app button inside the responsive XP taskbar. */
.xp-task-area {
  box-sizing:border-box !important;
  height:100% !important;
  min-height:0 !important;
  align-items:center !important;
  overflow:hidden !important;
}
.xp-task-button {
  box-sizing:border-box !important;
  height:calc(var(--xp-taskbar-height) - 4px) !important;
  max-height:calc(var(--xp-taskbar-height) - 4px) !important;
  min-height:0 !important;
  margin:0 !important;
  padding-block:1px !important;
  font-size:clamp(11px,.625vw,15px) !important;
}
.xp-task-button img {
  width:calc(var(--xp-taskbar-height) - 12px) !important;
  height:calc(var(--xp-taskbar-height) - 12px) !important;
  max-width:24px !important;
  max-height:24px !important;
  flex:0 0 auto !important;
}

/* Phone notification area: content-sized, with no reserved clock gutter. */
@media (max-width:700px) {
  .xp-system-tray {
    min-width:0 !important;
    width:max-content !important;
    flex:0 0 auto !important;
    padding:0 6px 0 4px !important;
    gap:0 !important;
  }
  .xp-taskbar-clock {
    min-width:0 !important;
    flex:0 0 auto !important;
    margin-left:2px !important;
    text-align:left !important;
  }
}
