* { box-sizing: border-box; }

html, body { height: 100%; }

body.xp-desktop {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  color: #111;
  background: #3a7d2c;
  user-select: none;
}

.xp-wallpaper {
  position: fixed;
  inset: 0;
  background-image: url("/static/bliss.jpg"), url("/static/wallpaper.svg");
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.xp-desktop-icons {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 8px 14px;
  height: calc(100vh - 70px);
  align-content: flex-start;
}

.xp-icon {
  width: 84px;
  min-height: 74px;
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #fff;
  text-shadow: 1px 1px 2px #000, 0 0 3px #000;
  background: transparent;
  border: 1px dotted transparent;
  font: inherit;
  cursor: default;
  overflow-wrap: anywhere;
}
.xp-icon:focus { outline: none; border-color: rgba(255,255,255,.8); background: rgba(49,106,197,.28); }
.xp-icon.selected { background: rgba(49,106,197,.45); border-color: rgba(255,255,255,.65); }

.xp-icon-img {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  font: 700 24px Tahoma, Arial, sans-serif;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,.35);
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #f6d36b, #c47a16);
  border: 1px solid rgba(0,0,0,.25);
  box-shadow: inset 0 1px rgba(255,255,255,.65), 0 2px 4px rgba(0,0,0,.35);
}
.xp-icon-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; }
.xp-icon-img .sym { position: relative; z-index: 0; }
.xp-icon-img.small { width: 38px; height: 38px; font-size: 19px; }
.xp-icon-img.icon-mail { background: linear-gradient(145deg, #f6e08b, #c28a16); }
.xp-icon-img.icon-vpn { background: linear-gradient(145deg, #86d98a, #2c7d36); }
.xp-icon-img.icon-pay { background: linear-gradient(145deg, #efa184, #a83c24); }
.xp-icon-img.icon-user { background: linear-gradient(145deg, #78b7ef, #14549c); }
.xp-icon-img.icon-paint { background: linear-gradient(145deg, #d9a0e8, #7a2d99); }
.xp-icon-img.icon-notepad { background: linear-gradient(145deg, #f3f0c4, #8f8a3d); color: #222; text-shadow: none; }
.xp-icon-img.icon-bin { background: linear-gradient(145deg, #d6d6d6, #6b6b6b); }
.xp-icon-img.icon-login { background: linear-gradient(145deg, #f2c14e, #a4680c); }

.xp-taskbar {
  position: fixed;
  z-index: 1000;
  left: 0; right: 0; bottom: 0;
  height: 34px;
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 2px 4px 0;
  color: #fff;
  background: linear-gradient(#3f8fe0 0%, #1d6dc4 10%, #0a4fa8 48%, #0b5fc1 92%, #3f8fe0 100%);
  border-top: 1px solid #0831d9;
  box-shadow: 0 -2px 5px rgba(0,0,0,.3);
}

.xp-start-button {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 96px;
  padding: 0 14px 0 8px;
  color: #fff;
  font: italic 700 16px "Trebuchet MS", Tahoma, sans-serif;
  text-shadow: 1px 1px 1px #1e5410;
  background: linear-gradient(#7bd06f 0%, #4cae3d 12%, #2f8f24 55%, #3fa531 90%, #7bd06f 100%);
  border: 1px solid #1f6b16;
  border-radius: 0 9px 9px 0;
  box-shadow: inset 0 1px rgba(255,255,255,.55);
  cursor: pointer;
}
.xp-start-button:active, .xp-start-button.open { filter: brightness(.92); }
.xp-flag {
  width: 18px; height: 18px;
  background:
    linear-gradient(135deg, #ff6b5c 0 48%, transparent 48%) 0 0 / 9px 9px no-repeat,
    linear-gradient(135deg, #6cc24a 0 48%, transparent 48%) 9px 0 / 9px 9px no-repeat,
    linear-gradient(135deg, #4aa3e8 0 48%, transparent 48%) 0 9px / 9px 9px no-repeat,
    linear-gradient(135deg, #f3c94e 0 48%, transparent 48%) 9px 9px / 9px 9px no-repeat;
  transform: skewY(-6deg);
  border-radius: 2px;
}

.xp-quicklaunch { display: flex; align-items: center; gap: 2px; padding: 0 4px; border-left: 1px solid rgba(255,255,255,.28); border-right: 1px solid rgba(0,0,0,.25); }
.xp-quicklaunch button { width: 24px; height: 24px; color: #fff; background: transparent; border: 1px solid transparent; border-radius: 3px; cursor: pointer; }
.xp-quicklaunch button:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.35); }

.xp-tasks { flex: 1; display: flex; gap: 3px; overflow: hidden; }
.xp-task {
  max-width: 180px;
  min-width: 80px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font: inherit;
  text-align: left;
  background: linear-gradient(#5a9de0, #2b6dbb);
  border: 1px solid #0b3d91;
  border-radius: 3px;
  box-shadow: inset 0 1px rgba(255,255,255,.4);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
}
.xp-task.active { background: linear-gradient(#1c5eae, #0a3f88); box-shadow: inset 1px 1px 3px rgba(0,0,0,.45); }
.xp-task span:last-child { overflow: hidden; text-overflow: ellipsis; }

.xp-tray {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  background: linear-gradient(#19a3e8, #0b6fbd);
  border-left: 1px solid #0a4fa8;
  box-shadow: inset 1px 0 rgba(255,255,255,.35);
}
.xp-tray-icons { letter-spacing: 3px; font-size: 11px; opacity: .9; }
#clock { min-width: 44px; text-align: center; }

.xp-start-menu {
  position: fixed;
  z-index: 1100;
  left: 0;
  bottom: 34px;
  width: 420px;
  max-width: 92vw;
  background: #fff;
  border: 1px solid #0831d9;
  border-radius: 8px 8px 0 0;
  box-shadow: 4px -4px 18px rgba(0,0,0,.4);
  overflow: hidden;
}
.xp-start-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  color: #fff;
  background: linear-gradient(#3f8fe0, #0a4fa8 60%, #3f8fe0);
  border-bottom: 1px solid #0831d9;
}
.xp-start-user small { display: block; opacity: .85; }
.xp-start-columns { display: grid; grid-template-columns: 1.45fr 1fr; }
.xp-start-left { padding: 6px; background: #fff; }
.xp-start-right { padding: 6px; background: #d3e5fa; border-left: 1px solid #9db9d8; }
.xp-start-heading { padding: 3px 8px; font-weight: 700; color: #0a3b78; }
.xp-start-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  font: inherit;
  text-align: left;
  color: #111;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
}
.xp-start-menu button:hover { background: #2f71c8; color: #fff; border-color: #1a4f95; }
.xp-start-menu form { margin: 0; }
.xp-start-menu hr { border: 0; border-top: 1px solid #c9c5b6; margin: 5px 6px; }
.xp-start-menu .mini { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; color: #fff; font-size: 12px; background: #3a6ea5; }
.xp-start-menu .mini.mail { background: #c28a16; }
.xp-start-menu .mini.vpn { background: #2c7d36; }
.xp-start-menu .mini.pay { background: #a83c24; }
.xp-start-menu .mini.paint { background: #7a2d99; }
.xp-start-menu .mini.notepad { background: #8f8a3d; }

.xp-windows { position: absolute; inset: 0 0 34px 0; z-index: 10; pointer-events: none; }
.xp-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 260px;
  min-height: 140px;
  background: #ece9d8;
  border: 1px solid #0831d9;
  border-radius: 7px 7px 3px 3px;
  box-shadow: 2px 3px 12px rgba(0,0,0,.45);
  pointer-events: auto;
  overflow: hidden;
}
.xp-window.maximized { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; }
.xp-window.minimized { display: none; }
.xp-window-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 3px 4px 3px 8px;
  color: #fff;
  font-weight: 700;
  text-shadow: 1px 1px 1px rgba(0,0,0,.45);
  background: linear-gradient(#3f8fe0, #0a4fa8 55%, #3f8fe0);
  cursor: move;
}
.xp-window-title .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xp-window-buttons { display: flex; gap: 3px; }
.xp-window-buttons button {
  display: grid; place-items: center;
  width: 21px; height: 19px;
  color: #fff;
  font: 700 11px Tahoma, sans-serif;
  background: linear-gradient(#6ba8e6, #2d6fbf);
  border: 1px solid #0b3d91;
  border-radius: 3px;
  box-shadow: inset 0 1px rgba(255,255,255,.55);
  cursor: pointer;
}
.xp-window-buttons button.close { background: linear-gradient(#e88a7d, #c73a2b); }
.xp-window-body { flex: 1; display: flex; flex-direction: column; min-height: 0; background: #ece9d8; }
.xp-window-status { padding: 3px 8px; font-size: 11px; color: #333; border-top: 1px solid #b6b2a4; background: #ece9d8; }

.app-menubar {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  padding: 5px 6px;
  background: #ece9d8;
  border-bottom: 1px solid #b6b2a4;
}
.app-menubar button, .paint-toolbar button {
  min-height: 24px;
  padding: 2px 8px;
  font: inherit;
  background: linear-gradient(#fff, #ece9d8);
  border: 1px solid #7b7b7b;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px #fff;
  cursor: pointer;
}
.app-menubar button:hover, .paint-toolbar button:hover { border-color: #3a6ea5; }
.app-name-label { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.app-name-label input { width: 170px; padding: 2px 5px; font: inherit; border: 1px solid #7f9db9; background: #fff; }
.app-status { padding: 3px 8px; font-size: 11px; color: #333; background: #ece9d8; border-top: 1px solid #c9c5b6; }

.app-notepad { display: flex; flex-direction: column; height: 100%; }
.app-notepad textarea {
  flex: 1;
  resize: none;
  width: 100%;
  padding: 8px;
  font: 13px/1.45 "Lucida Console", Consolas, monospace;
  color: #111;
  background: #fff;
  border: 1px solid #7f9db9;
  border-radius: 0;
  outline: none;
  user-select: text;
}

.app-paint { display: flex; flex-direction: column; height: 100%; }
.paint-toolbar { display: flex; align-items: center; gap: 4px; padding: 5px 6px; background: #d6d2c2; border-bottom: 1px solid #b6b2a4; flex-wrap: wrap; }
.paint-toolbar button { min-width: 30px; }
.paint-toolbar button.active { background: linear-gradient(#cfe0f5, #8fb6e2); border-color: #3a6ea5; }
.paint-toolbar input[type=color] { width: 30px; height: 24px; padding: 0; border: 1px solid #7b7b7b; background: #fff; }
.paint-toolbar input[type=range] { width: 100px; }
.paint-canvas-wrap { flex: 1; overflow: auto; padding: 8px; background: #8a8a8a; border-top: 1px solid #fff; }
.paint-canvas-wrap canvas { display: block; background: #fff; box-shadow: 2px 2px 5px rgba(0,0,0,.4); cursor: crosshair; touch-action: none; }

.app-trash { display: flex; flex-direction: column; height: 100%; }
.trash-list { flex: 1; overflow: auto; padding: 6px; background: #fff; border: 1px solid #7f9db9; }
.trash-row { display: flex; align-items: center; gap: 8px; padding: 5px; border-bottom: 1px solid #eee; }
.trash-row .name { flex: 1; }
.trash-row button { padding: 2px 8px; font: inherit; background: linear-gradient(#fff,#ece9d8); border: 1px solid #7b7b7b; border-radius: 3px; cursor: pointer; }
.trash-row button.danger { color: #8c1d14; }
.app-about { padding: 14px; line-height: 1.6; background: #fff; height: 100%; user-select: text; }
.app-about .muted { color: #666; }

.xp-context-menu {
  position: fixed;
  z-index: 2000;
  min-width: 170px;
  padding: 3px;
  background: #ece9d8;
  border: 1px solid #7b7b7b;
  box-shadow: 2px 2px 8px rgba(0,0,0,.4);
}
.xp-context-menu button { display: block; width: 100%; padding: 4px 10px; font: inherit; text-align: left; background: transparent; border: 0; cursor: pointer; }
.xp-context-menu button:hover { background: #2f71c8; color: #fff; }
.xp-context-menu .danger { color: #8c1d14; }

.xp-bubble {
  position: fixed;
  right: 14px;
  bottom: 46px;
  z-index: 1200;
  max-width: 320px;
  padding: 10px 12px;
  background: #fffde7;
  border: 1px solid #c9b458;
  border-radius: 4px;
  box-shadow: 2px 3px 9px rgba(0,0,0,.35);
  color: #333;
  line-height: 1.45;
}
.xp-bubble a { color: #0a4fa8; }

@media (max-width: 760px) {
  .xp-desktop-icons { flex-direction: row; flex-wrap: wrap; height: auto; max-width: calc(100vw - 20px); }
  .xp-icon { width: 70px; min-height: 64px; }
  .xp-icon-img { width: 40px; height: 40px; font-size: 20px; }
  .xp-window { left: 4px !important; top: 4px !important; width: calc(100vw - 8px) !important; height: calc(100vh - 42px) !important; }
  .xp-quicklaunch, .xp-tray-icons { display: none; }
  .xp-start-menu { width: 96vw; }
  .xp-start-columns { grid-template-columns: 1fr; }
  .xp-start-right { border-left: 0; border-top: 1px solid #9db9d8; }
  .app-name-label { width: 100%; margin-left: 0; }
  .app-name-label input { flex: 1; }
}
