:root {
  --xp-taskbar-height: 40px;
  --xp-start-menu-width: 390px;
}

.xp-taskbar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: flex;
  height: var(--xp-taskbar-height);
  align-items: stretch;
  overflow: hidden;
  border-top: 1px solid #63a8ff;
  border-bottom: 1px solid #063aa8;
  background: linear-gradient(to bottom, #2f83f3 0, #176bdc 14%, #1f6cdf 56%, #1659ce 88%, #0d48bc 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
  user-select: none;
}

.xp-start-button {
  flex: 0 0 135px;
  width: 135px;
  height: 40px;
  border: 0;
  padding: 0;
  background-color: transparent;
  background-image: url("./Assets/taskbar-start-sprite.png");
  background-position: 0 -80px;
  background-repeat: no-repeat;
  background-size: 135px 120px;
  cursor: default;
}

.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-start-button:focus-visible {
  outline: 1px dotted rgba(255, 255, 255, 0.95);
  outline-offset: -5px;
}

.xp-task-area {
  position: relative;
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  padding: 3px 8px 3px 13px;
}

.xp-task-area::before {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 4px;
  width: 2px;
  border-right: 1px solid rgba(255, 255, 255, 0.32);
  border-left: 1px solid rgba(6, 55, 155, 0.72);
  content: "";
}

.xp-system-tray {
  display: flex;
  min-width: 124px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  border-left: 1px solid #0d4db7;
  padding: 0 14px 0 12px;
  background: linear-gradient(to bottom, #20a9ee 0, #118fe2 18%, #1598e7 68%, #0c7ed3 100%);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.xp-taskbar-clock {
  color: #fff;
  font: 13px/1 Tahoma, "MS Sans Serif", sans-serif;
  text-shadow: 1px 1px 0 rgba(0, 52, 131, 0.65);
  white-space: nowrap;
}

.xp-start-menu {
  position: absolute;
  bottom: var(--xp-taskbar-height);
  left: 0;
  z-index: 6;
  display: grid;
  width: min(var(--xp-start-menu-width), calc(100vw - 10px));
  height: min(520px, calc(100dvh - var(--xp-taskbar-height) - 8px));
  grid-template-rows: 58px minmax(0, 1fr) 54px;
  overflow: hidden;
  border: 2px solid #0b57c7;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: #fff;
  box-shadow: 3px -3px 8px rgba(0, 24, 84, 0.42);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  visibility: hidden;
  transition: opacity 100ms ease, transform 100ms ease, visibility 100ms ease;
}

.xp-start-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.xp-start-menu-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid #f28a2b;
  padding: 6px 9px;
  background: linear-gradient(to bottom, #258bf1 0, #0873df 48%, #0b61c5 100%);
}

.xp-user-badge {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 5px;
  color: #144b9b;
  background: #d9eafb;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 32, 98, 0.5);
}

.xp-user-badge img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  object-fit: cover;
  object-position: center;
}
.xp-start-menu-header strong {
  color: #fff;
  font-size: 18px;
  text-shadow: 1px 1px 1px #17488f;
}

.xp-start-menu-body {
  display: grid;
  min-height: 0;
  grid-template-columns: 1fr 1fr;
}

.xp-start-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  padding: 9px 7px;
}

.xp-start-column-primary {
  background: #fff;
}

.xp-start-column-secondary {
  border-left: 1px solid #a8c7eb;
  background: #dceafb;
}

.xp-menu-item,
.xp-all-programs,
.xp-footer-action {
  border: 0;
  color: #1a1a1a;
  background: transparent;
  font: 14px/1.15 Tahoma, "MS Sans Serif", sans-serif;
  text-align: left;
  cursor: default;
}

.xp-menu-item {
  min-height: 39px;
  padding: 8px 10px;
}

.xp-menu-item strong {
  display: block;
  font-weight: 700;
}

.xp-menu-item small {
  display: block;
  margin-top: 3px;
  color: #747474;
  font-size: 11px;
}

.xp-menu-item:hover,
.xp-menu-item:focus-visible,
.xp-all-programs:hover,
.xp-all-programs:focus-visible {
  color: #fff;
  background: #316ac5;
  outline: none;
}

.xp-menu-item:hover small,
.xp-menu-item:focus-visible small {
  color: #e7f1ff;
}

.xp-all-programs {
  margin-top: auto;
  border-top: 1px solid #d5d5d5;
  padding: 11px 10px 8px;
  font-weight: 700;
  text-align: center;
}

.xp-start-menu-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #5aa2ee;
  padding: 7px 10px;
  background: linear-gradient(to bottom, #1686ed 0, #0d70d8 50%, #0758b8 100%);
}

.xp-footer-action {
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 3px;
  padding: 7px 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-shadow: 1px 1px 0 #174c9a;
}

.xp-footer-action:hover,
.xp-footer-action:focus-visible {
  background: rgba(255, 255, 255, 0.2);
  outline: 1px solid #fff;
}

@media (max-width: 700px) {
  .xp-system-tray {
    min-width: 94px;
    padding-right: 9px;
  }

  .xp-taskbar-clock {
    font-size: 12px;
  }

  .xp-start-menu {
    height: min(470px, calc(100dvh - var(--xp-taskbar-height) - 8px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .xp-start-menu {
    transition: none;
  }
}

.xp-system-tray { position: relative; display: flex; align-items: center; gap: 5px; }
.xp-tray-icons { display: flex; align-items: center; gap: 2px; }
.xp-tray-icon { display: grid; width: 20px; height: 24px; place-items: center; border: 0; padding: 0; background: transparent; cursor: default; }
.xp-tray-icon:hover { background: rgba(255,255,255,.16); }
.xp-tray-icon img { width: 16px; height: 16px; object-fit: contain; }
.xp-tray-balloon { position: absolute; right: 4px; bottom: 34px; width: 250px; border: 1px solid #111; border-radius: 8px; padding: 8px 10px 7px; color: #111; background: #ffffe1; box-shadow: 2px 3px 5px rgba(0,0,0,.28); font: 11px/1.35 Tahoma,sans-serif; }
.xp-tray-balloon::after { content: ''; position: absolute; right: 25px; bottom: -9px; width: 15px; height: 15px; border-right: 1px solid #111; border-bottom: 1px solid #111; background: #ffffe1; transform: rotate(45deg); }
.xp-tray-balloon header { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.xp-tray-balloon p { margin: 4px 0; }
.xp-balloon-info { display: block; width: 16px; height: 16px; object-fit: contain; }
.xp-balloon-close { position: absolute; top: 5px; right: 6px; width: 17px; height: 17px; border: 0; padding: 0; background: transparent; } .xp-balloon-close img { display: block; width: 17px; height: 17px; }
.xp-volume-popup { position: absolute; right: 35px; bottom: 34px; width: 92px; border: 1px solid #003c74; padding: 7px; color: #111; background: #ece9d8; box-shadow: 2px 2px 4px rgba(0,0,0,.35); font: 11px Tahoma,sans-serif; text-align: center; }
.xp-volume-popup strong { display: block; margin-bottom: 5px; }
.xp-volume-popup input[type=range] { width: 70px; margin: 4px auto 8px; accent-color: #316ac5; }
.xp-volume-popup label { display: block; border-top: 1px solid #aca899; padding-top: 5px; }
.xp-recycle-balloon { right: 110px; width: 190px; }


/* Keep notification popups contained and completely remove them when closed. */
.xp-taskbar { overflow: visible; }
.xp-tray-balloon[hidden],
.xp-volume-popup[hidden] { display: none !important; }
.xp-volume-popup {
  right: 28px;
  bottom: 32px;
  width: 86px;
  box-sizing: border-box;
  overflow: hidden;
}
.xp-volume-popup input[type="range"] {
  display: block;
  width: 18px;
  height: 92px;
  margin: 4px auto 8px;
  writing-mode: vertical-lr;
  direction: rtl;
}

/* Large desktop tier: preserve XP proportions while improving readability. */
@media (min-width: 1600px) and (min-height: 800px) {
  :root {
    --xp-taskbar-height: 48px;
    --xp-start-menu-width: 468px;
  }

  .xp-start-button {
    flex-basis: 162px;
    width: 162px;
    height: 48px;
    background-position: 0 -96px;
    background-size: 162px 144px;
  }

  .xp-start-button:hover,
  .xp-start-button:focus-visible {
    background-position: 0 -48px;
  }

  .xp-start-button:active,
  .xp-start-button.is-selected {
    background-position: 0 0;
  }

  .xp-task-area {
    padding: 4px 10px 4px 15px;
  }

  .xp-system-tray {
    min-width: 154px;
    gap: 7px;
    padding-right: 17px;
    padding-left: 14px;
  }

  .xp-taskbar-clock {
    font-size: 15px;
  }

  .xp-tray-icon {
    width: 24px;
    height: 30px;
  }

  .xp-tray-icon img {
    width: 19px;
    height: 19px;
  }

  .xp-start-menu {
    height: min(624px, calc(100dvh - var(--xp-taskbar-height) - 10px));
    grid-template-rows: 70px minmax(0, 1fr) 65px;
    border-width: 3px;
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
  }

  .xp-start-menu-header {
    gap: 12px;
    padding: 8px 11px;
  }

  .xp-user-badge {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
  }

  .xp-start-menu-header strong {
    font-size: 21px;
  }

  .xp-start-column {
    gap: 3px;
    padding: 12px 9px;
  }

  .xp-menu-item,
  .xp-all-programs,
  .xp-footer-action {
    font-size: 16px;
  }

  .xp-menu-item {
    min-height: 48px;
    padding: 10px 12px;
  }

  .xp-menu-item small {
    margin-top: 4px;
    font-size: 13px;
  }

  .xp-all-programs {
    padding: 14px 12px 11px;
  }

  .xp-start-menu-footer {
    gap: 10px;
    padding: 9px 12px;
  }

  .xp-footer-action {
    padding: 8px 12px;
  }

  .xp-tray-balloon {
    bottom: 42px;
    width: 290px;
    padding: 10px 12px 9px;
    font-size: 13px;
  }

  .xp-volume-popup {
    right: 34px;
    bottom: 40px;
    width: 100px;
    font-size: 13px;
  }
}

/* XP Luna Start menu, matched to the supplied classic two-column reference. */
.xp-start-menu { height:min(556px,calc(100dvh - var(--xp-taskbar-height) - 6px)); grid-template-rows:64px minmax(0,1fr) 58px; border-color:#0a58c7; border-radius:9px 9px 0 0; box-shadow:3px -3px 9px rgba(0,22,76,.45),inset 0 1px 0 #4aa3ff; }
.xp-start-menu-header { gap:10px; border-bottom:2px solid #f49a34; padding:6px 8px; background:linear-gradient(to bottom,#1689ed 0%,#0872d9 58%,#0664c8 100%); }
.xp-start-menu-body { grid-template-columns:1fr 1fr; }
.xp-start-column { gap:0; padding:10px 8px 8px; }
.xp-start-column-secondary { border-left:1px solid #90b8e6; background:#d3e5f8; }
.xp-menu-item { min-height:47px; padding:8px 10px; }
.xp-system-item { display:grid; min-height:42px; grid-template-columns:30px minmax(0,1fr); align-items:center; gap:8px; padding:5px 7px; color:#123b71; }
.xp-system-item img { display:block; width:28px; height:28px; object-fit:contain; }
.xp-system-divider { display:block; height:1px; margin:4px 7px; background:#a8c7e8; box-shadow:0 1px 0 rgba(255,255,255,.75); }
.xp-all-programs { display:flex; min-height:48px; align-items:center; justify-content:flex-end; gap:10px; margin:auto -8px -8px; border-top:1px solid #d6d6d6; padding:10px 29px 9px 10px; }
.xp-all-programs-arrow { color:#12a736; font-size:25px; line-height:1; text-shadow:1px 1px 0 #075e18; }
.xp-start-menu-footer { gap:8px; border-top:1px solid #5fb0f4; padding:7px 9px; background:linear-gradient(to bottom,#1690ee 0%,#0875da 58%,#0562c5 100%); }
.xp-footer-action { display:flex; align-items:center; gap:5px; border:0; padding:4px 3px; background:transparent; }
.xp-footer-action img { width:27px; height:27px; object-fit:contain; }
.xp-footer-action:hover,.xp-footer-action:focus-visible { background:rgba(255,255,255,.16); outline:1px solid rgba(255,255,255,.8); }
@media (min-width:1600px) and (min-height:800px) {
  .xp-start-menu { height:min(667px,calc(100dvh - var(--xp-taskbar-height) - 8px)); grid-template-rows:77px minmax(0,1fr) 70px; }
  .xp-start-column { padding:12px 10px 10px; }
  .xp-menu-item { min-height:56px; }
  .xp-system-item { min-height:50px; grid-template-columns:36px minmax(0,1fr); gap:10px; }
  .xp-system-item img { width:34px; height:34px; }
  .xp-all-programs { min-height:58px; margin:auto -10px -10px; padding-right:35px; }
  .xp-all-programs-arrow { font-size:30px; }
  .xp-footer-action img { width:33px; height:33px; }
}

/* Start-menu footer now uses explicit image assets; suppress the legacy sprite pseudo-icons. */
#xp-log-off::before,
#xp-shut-down::before {
  display: none !important;
  content: none !important;
  background-image: none !important;
}

/* RebornXP shell fidelity layer (GPL-3.0 source credited in Assets/rebornxp-ui). */
.xp-taskbar {
  background: linear-gradient(to bottom,#245edb 0%,#3f8cf3 8%,#245edb 16%,#1f66d7 70%,#1941a5 100%);
}
.xp-system-tray {
  border-left-color: rgb(16,66,175);
  background: linear-gradient(to bottom,rgb(12,89,185) 1%,rgb(19,158,233) 6%,rgb(24,181,242) 10%,rgb(19,155,235) 14%,rgb(18,144,232) 19%,rgb(13,141,234) 63%,rgb(13,159,241) 81%,rgb(15,158,237) 88%,rgb(17,155,233) 91%,rgb(19,146,226) 94%,rgb(19,126,215) 97%,rgb(9,91,201) 100%);
  box-shadow:rgb(24,187,255) 1px 0 1px inset;
}
.xp-start-menu { background-color:rgb(66,130,214); }
.xp-start-menu-header {
  background:linear-gradient(to bottom,rgb(66,130,214) 0%,rgb(59,133,224) 3%,rgb(65,138,227) 5%,rgb(60,135,226) 35%,rgb(46,126,225) 55%,rgb(25,110,219) 78%,rgb(15,97,203) 100%);
}
.xp-start-menu-footer {
  background:linear-gradient(to bottom,rgb(66,130,214) 0%,rgb(59,133,224) 3%,rgb(52,130,227) 29%,rgb(32,114,219) 57%,rgb(20,104,213) 75%,rgb(15,97,203) 100%);
}
.xp-all-programs-arrow { display:block; width:22px; height:22px; object-fit:contain; filter:none; }
.ie-window-control img { width:100%; height:100%; object-fit:contain; }
@media (min-width:1600px) and (min-height:800px){ .xp-all-programs-arrow{width:27px;height:27px;} }

/* Keep the clock visible when larger authentic tray icons are used. */
.xp-system-tray { min-width:170px; }
.xp-taskbar-clock { display:block; min-width:62px; flex:0 0 62px; text-align:right; overflow:visible; }
@media (min-width:1600px) and (min-height:800px){ .xp-system-tray{min-width:205px;} .xp-taskbar-clock{min-width:72px;flex-basis:72px;} }
@media (max-width:700px){ .xp-system-tray{min-width:150px;} .xp-taskbar-clock{min-width:55px;flex-basis:55px;} }


/* External XP-era app entry. */
.xp-featured-app { display:grid; grid-template-columns:34px minmax(0,1fr); align-items:center; gap:8px; }
.xp-featured-app > img { display:block; width:30px; height:30px; object-fit:contain; }
.xp-featured-app > span { min-width:0; }
@media (min-width:1600px) and (min-height:800px) {
  .xp-featured-app { grid-template-columns:40px minmax(0,1fr); gap:10px; }
  .xp-featured-app > img { width:36px; height:36px; }
}

/* World of Warcraft opens as a native-looking XP desktop application. */
.wow-app-window { top:4%; left:3%; width:94vw; height:calc(92vh - var(--xp-taskbar-height)); min-width:620px; min-height:440px; background:#000; }
.wow-app-content { min-height:0; flex:1 1 auto; overflow:hidden; background:#000; }
.wow-app-content iframe { display:block; width:100%; height:100%; border:0; background:#000; }
@media (max-width:760px) { .wow-app-window { left:1.5%; width:97vw; min-width:0; } }
/* Keep the notification pointer anchored to the network tray icon. */
#xp-network-balloon::after { left: var(--network-pointer-left, auto); right: auto; }

/* Reserved topmost shell layer: application windows must never cover the XP taskbar or Start menu. */
.xp-taskbar { z-index: 2147483000 !important; }
.xp-start-menu { z-index: 2147483001 !important; }
.xp-taskbar .xp-tray-balloon,
.xp-taskbar .xp-volume-popup { z-index: 2147483002; }
/* RebornXP notification-area development balloon. */
#xp-development-balloon::after { left:var(--development-pointer-left,auto); right:auto; }
.xp-development-balloon { width:210px; }
.xp-development-balloon header strong { padding-right:18px; }
/* Compact notification area: fit three tray icons and clock without dead space. */
.xp-system-tray { min-width:144px; padding-left:7px; padding-right:8px; gap:4px; }
.xp-tray-icons { gap:1px; }
.xp-taskbar-clock { min-width:58px; flex:0 0 58px; text-align:right; }
@media (min-width:1600px) and (min-height:800px) {
  .xp-system-tray { min-width:168px; padding-left:8px; padding-right:10px; gap:5px; }
  .xp-taskbar-clock { min-width:64px; flex-basis:64px; }
}
@media (max-width:700px) {
  /* Let the compact notification area hug its icons and clock on phones. */
  .xp-system-tray { min-width:0; width:auto; padding-left:4px; padding-right:6px; gap:0; }
  .xp-taskbar-clock { min-width:0; flex:0 0 auto; margin-left:2px; text-align:left; }
}
/* Exact RebornXP volume_adjust.svelte geometry and slider treatment. */
.xp-volume-popup { box-sizing:border-box; right:31px; bottom:var(--xp-taskbar-height); width:80px; height:180px; display:flex; flex-direction:column; align-items:center; border:0; padding:0; color:#0f172a; background:#ece9d8; box-shadow:2px 2px 5px rgba(0,0,0,.35); font-family:MSSS,Tahoma,Arial,sans-serif; }
.xp-volume-popup strong { flex:0 0 auto; padding:16px 0; font-size:12px; font-weight:400; line-height:1; }
.xp-volume-slider-area { display:flex; min-height:0; flex:1 1 auto; align-items:center; justify-content:center; }
.xp-volume-popup-spacer { width:100%; height:24px; flex:0 0 24px; }
#xp-volume-slider { width:20px; height:86px; margin:0; border-radius:0; background:transparent; appearance:none; -webkit-appearance:none; writing-mode:vertical-lr; direction:rtl; }
#xp-volume-slider::-webkit-slider-runnable-track { width:4px; border:1px solid #7f9db9; background:#fff; box-shadow:inset 1px 1px #d4d0c8; }
#xp-volume-slider::-webkit-slider-thumb { width:20px; height:10px; margin-left:-9px; border:0; border-radius:3px; background:#16a34a; appearance:none; -webkit-appearance:none; }
#xp-volume-slider::-moz-range-track { width:4px; border:1px solid #7f9db9; background:#fff; box-shadow:inset 1px 1px #d4d0c8; }
#xp-volume-slider::-moz-range-thumb { width:20px; height:10px; border:0; border-radius:3px; background:#16a34a; }
