#windows-container {
  position: fixed;
  inset: 0;
  bottom: var(--taskbar-h);
  pointer-events: none;
  z-index: var(--z-windows);
}

.app-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 300px;
  min-height: 200px;
  pointer-events: auto;
  filter: drop-shadow(2px 3px 6px rgba(0,0,0,.5));
}

.app-window > .window {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  box-shadow: none !important; 
  border-radius: 8px 8px 0 0 !important;
}

.app-window:not(.active) > .window > .title-bar {
  background: var(--xp-inactive-title) !important;
}

.app-window.active > .window > .title-bar {
  background: var(--xp-active-title) !important;
}

.title-bar-icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  vertical-align: middle;
  margin-right: 5px;
  position: relative;
  top: -1px;
}

.title-bar {
  font-size: 15px !important;
  padding: 5px 4px 5px 6px !important;
}
.title-bar-controls button {
  width: 24px !important;
  height: 24px !important;
  min-height: 24px !important;
  margin-left: 2px;
}

.app-window .window-body {
  flex: 1;
  overflow: auto;
  background: var(--xp-bg);
  margin: 0 !important;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative; 
}

.win-body-shield {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none; 
}
.app-window:not(.active) .win-body-shield {
  pointer-events: auto; 
}
.window-content {
  flex: 1;
  overflow: auto;
  position: relative;
}

.win-menubar {
  height: 30px;
  min-height: 30px;
  background: #e9e9e9;
  border-bottom: 2px solid #e0e0e0;
  display: flex;
  align-items: center;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}
.win-menubar-item {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 16px;
  cursor: pointer;
}
.win-menubar-item:hover { background: #0a6fc2; color: #fff; }

.win-toolbar {
  height: 48px;
  min-height: 48px;
  background: #e9e9e9;
  border-bottom: 2px solid #e0e0e0;
  display: flex;
  align-items: center;
  padding: 0 8px 0 4px;
  flex-shrink: 0;
  gap: 2px;
}
.win-toolbar-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: Tahoma, Arial, sans-serif;
  border: 1.5px solid transparent;
  border-radius: 5px;
  background: none;
  color: #222;
}
.win-toolbar-btn:hover  { background: #e7e7e7; border-color: #b0b0b0; }
.win-toolbar-btn:active { background: #dadada; border-color: #7a7a7a; box-shadow: inset 1px 1px 2px rgba(0,0,0,.3); }
.win-toolbar-sep { width: 0; height: 26px; border-left: 1px solid #d7d4ca; margin: 0 2px; }

.win-addrbar {
  height: 34px;
  min-height: 34px;
  background: #e9e9e9;
  border-bottom: 2px solid #e0e0e0;
  display: flex;
  align-items: center;
  padding: 0 4px;
  flex-shrink: 0;
}
.win-addrbar-label {
  font-size: 11px;
  color: #7f7c73;
  padding: 0 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.win-addrbar-input {
  flex: 1;
  height: 22px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  padding: 0 3px;
  font-size: 11px;
  font-family: Tahoma, Arial, sans-serif;
  overflow: hidden;
}

.app-window.maximized {
  left: 0 !important;
  top: 0 !important;
  width: 100vw !important;
  height: calc(100vh - var(--taskbar-h)) !important;
  filter: none !important;
}
.app-window.maximized > .window {
  border-radius: 0 !important;
}
.app-window.maximized .resizer { display: none; }

.app-window.minimized { display: none !important; }

@keyframes winOpen {
  from { opacity: 0; transform: translate(-16px, -16px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes winClose {
  from { opacity: 1; }
  to   { opacity: 0; transform: scale(.95); }
}
@keyframes winMinimize {
  from { opacity: 1; transform: none; }
  to   { opacity: .4; transform: scale(.5); }
}
@keyframes winRestore {
  from { opacity: .4; transform: scale(.5); }
  to   { opacity: 1; transform: none; }
}

.win-opening   { animation: winOpen .18s ease-out; }
.win-closing   { animation: winClose .15s ease-in forwards; }
.win-minimizing { animation: winMinimize .15s ease-in forwards; transform-origin: bottom center; }
.win-restoring  { animation: winRestore .15s ease-out; transform-origin: bottom center; }


[data-xp-scroll]::-webkit-scrollbar { display: none !important; width: 0 !important; }
[data-xp-scroll] { scrollbar-width: none !important; }

.xpsb-outer {
  display: flex;
  flex-direction: row;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}

.xpsb-rail {
  width: 18px;
  min-width: 18px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-left: 1px solid #9eb0d0;
  user-select: none;
  -webkit-user-select: none;
}

.xpsb-btn {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  background-color: transparent;
  background: linear-gradient(180deg, #ddeeff 0%, #b8d4f8 40%, #a0c4f4 100%);
  border: 1px solid #5070c0;
  border-radius: 2px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 7px;
  box-sizing: border-box;
}
.xpsb-btn:hover {
  background: linear-gradient(180deg, #eef6ff 0%, #cce4ff 40%, #b4d8ff 100%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 7px;
  border-color: #3858a8;
}
.xpsb-btn:active {
  background: linear-gradient(180deg, #a0c4f4 0%, #b8d4f8 100%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 7px;
  border-color: #2848a0;
}

.xpsb-track {
  flex: 1;
  background: #ffffff;
  border-left: 1px solid #9eb0d0;
  border-right: 1px solid #9eb0d0;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.xpsb-thumb {
  position: absolute;
  left: 0;
  right: 0;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0)    0px,
      rgba(255,255,255,0)    2px,
      rgba(255,255,255,0.30) 2px,
      rgba(255,255,255,0.30) 3px
    ),
    linear-gradient(90deg,
      #c8dcff 0%,
      #92b4f0 25%,
      #7aa0ea 50%,
      #92b4f0 75%,
      #c8dcff 100%
    );
  border: 1px solid #5070c0;
  border-radius: 3px;
  min-height: 24px;
  cursor: ns-resize;
  box-sizing: border-box;
}
.xpsb-thumb:hover {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0)    0px,
      rgba(255,255,255,0)    2px,
      rgba(255,255,255,0.38) 2px,
      rgba(255,255,255,0.38) 3px
    ),
    linear-gradient(90deg,
      #ddeeff 0%,
      #a8c8ff 25%,
      #8cb4f8 50%,
      #a8c8ff 75%,
      #ddeeff 100%
    );
}
.xpsb-thumb:active {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(0,0,0,0)    0px,
      rgba(0,0,0,0)    2px,
      rgba(0,0,0,0.10) 2px,
      rgba(0,0,0,0.10) 3px
    ),
    linear-gradient(90deg,
      #8cb0e8 0%,
      #6890d8 40%,
      #5880d0 60%,
      #6890d8 80%,
      #8cb0e8 100%
    );
  cursor: ns-resize;
}

.app-window ::-webkit-scrollbar {
  width: 18px;
  height: 18px;
}

.app-window ::-webkit-scrollbar-track {
  background: #ffffff;
  border: 1px solid #9eb0d0;
}

.app-window ::-webkit-scrollbar-thumb {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0)    0px,
      rgba(255,255,255,0)    2px,
      rgba(255,255,255,0.30) 2px,
      rgba(255,255,255,0.30) 3px
    ),
    linear-gradient(90deg,
      #c8dcff 0%,
      #92b4f0 25%,
      #7aa0ea 50%,
      #92b4f0 75%,
      #c8dcff 100%
    );
  border: 1px solid #5070c0;
  border-radius: 3px;
  min-height: 20px;
  min-width: 20px;
}
.app-window ::-webkit-scrollbar-thumb:hover {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0)    0px,
      rgba(255,255,255,0)    2px,
      rgba(255,255,255,0.38) 2px,
      rgba(255,255,255,0.38) 3px
    ),
    linear-gradient(90deg,
      #ddeeff 0%,
      #a8c8ff 25%,
      #8cb4f8 50%,
      #a8c8ff 75%,
      #ddeeff 100%
    );
}
.app-window ::-webkit-scrollbar-thumb:active {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(0,0,0,0)    0px,
      rgba(0,0,0,0)    2px,
      rgba(0,0,0,0.10) 2px,
      rgba(0,0,0,0.10) 3px
    ),
    linear-gradient(90deg,
      #8cb0e8 0%,
      #6890d8 40%,
      #5880d0 60%,
      #6890d8 80%,
      #8cb0e8 100%
    );
}

.app-window ::-webkit-scrollbar-button {
  display: block;
  width: 18px;
  height: 18px;
  background: linear-gradient(180deg,
    #ddeeff 0%,
    #b8d4f8 40%,
    #a0c4f4 100%
  );
  border: 1px solid #5070c0;
  border-radius: 2px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 8px;
  flex-shrink: 0;
}
.app-window ::-webkit-scrollbar-button:hover {
  background: linear-gradient(180deg,
    #eef6ff 0%,
    #cce4ff 40%,
    #b4d8ff 100%
  );
  border-color: #3858a8;
}
.app-window ::-webkit-scrollbar-button:active {
  background: linear-gradient(180deg,
    #a0c4f4 0%,
    #b8d4f8 100%
  );
  border-color: #2848a0;
}
.app-window ::-webkit-scrollbar-button:double-button  { display: none; }
.app-window ::-webkit-scrollbar-button:single-button  { display: block; }

.app-window ::-webkit-scrollbar-button:single-button:vertical:decrement {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 7'%3E%3Cpolyline points='1,6 5,2 9,6' fill='none' stroke='%232244aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 10px 7px;
}
.app-window ::-webkit-scrollbar-button:single-button:vertical:increment {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 7'%3E%3Cpolyline points='1,1 5,5 9,1' fill='none' stroke='%232244aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 10px 7px;
}
.app-window ::-webkit-scrollbar-button:single-button:horizontal:decrement {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 10'%3E%3Cpolyline points='6,1 2,5 6,9' fill='none' stroke='%232244aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 7px 10px;
}
.app-window ::-webkit-scrollbar-button:single-button:horizontal:increment {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 10'%3E%3Cpolyline points='1,1 5,5 1,9' fill='none' stroke='%232244aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 7px 10px;
}
.app-window ::-webkit-scrollbar-corner { background: #e8f0fc; }

.app-window { scrollbar-color: #7aa0ea #ffffff; scrollbar-width: auto; }

.resizer { position: absolute; background: transparent; z-index: 20; }
.resizer-n  { top: -5px;    left: 10px;  right: 10px; height: 10px; cursor: ns-resize; }
.resizer-s  { bottom: -5px; left: 10px;  right: 10px; height: 10px; cursor: ns-resize; }
.resizer-e  { right: -5px;  top: 10px; bottom: 10px; width: 10px;  cursor: ew-resize; }
.resizer-w  { left: -5px;   top: 10px; bottom: 10px; width: 10px;  cursor: ew-resize; }
.resizer-ne { top: -5px;    right: -5px;  width: 10px; height: 10px; cursor: nesw-resize; }
.resizer-nw { top: -5px;    left: -5px;   width: 10px; height: 10px; cursor: nwse-resize; }
.resizer-se { bottom: -5px; right: -5px;  width: 10px; height: 10px; cursor: nwse-resize; }
.resizer-sw { bottom: -5px; left: -5px;   width: 10px; height: 10px; cursor: nesw-resize; }
