/* =========================================================
   Pane OS — styles
   ========================================================= */

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; overflow: hidden; }
body {
  font-family: "Tahoma","Segoe UI",Verdana,Geneva,sans-serif;
  font-size: 11px;
  user-select: none;
  color: #000;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='24' viewBox='0 0 20 24'%3E%3Cpolygon points='2,2 2,20 6,15 10,24 13,22 9,13 16,13' fill='white' stroke='black' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 2 2, default;
}
.hidden { display: none !important; }
.muted { color: #666; }

img.xp-icon {
  width: 16px; height: 16px;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  vertical-align: middle;
  pointer-events: none;
}

/* =========================================================
   Boot screen
   ========================================================= */
#boot {
  position: fixed; inset: 0;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.boot-logo { display: flex; align-items: center; gap: 20px; }
.boot-flag {
  width: 80px; height: 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  transform: perspective(200px) rotateY(-15deg) skewY(-7deg);
  filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
}
.boot-flag div { border-radius: 4px 12px 4px 4px; }
.bf-r { background: #e0383c; }
.bf-g { background: #6dc433; }
.bf-b { background: #2476c8; }
.bf-y { background: #f5cd1c; }

.boot-pane-logo { filter: drop-shadow(0 0 12px rgba(100,180,255,0.4)); }
.boot-text { font-family: "Trebuchet MS", sans-serif; }
.boot-windows { font-size: 28px; font-weight: bold; letter-spacing: 2px; color: #eee; }
.boot-xp { font-size: 48px; font-weight: bold; line-height: 1; }
.boot-xp .xp {
  background: linear-gradient(180deg,#7ee8ff 0%, #2e9fd4 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  font-style: italic;
}

.boot-bar {
  width: 240px; height: 16px;
  border: 1px solid #555;
  border-radius: 3px;
  margin-top: 50px;
  overflow: hidden;
  background: #111;
  position: relative;
}
.boot-bar-inner {
  display: flex; gap: 3px; padding: 2px;
  height: 100%;
  position: absolute;
  animation: bootSlide 1.5s linear infinite;
}
.boot-bar-inner span {
  width: 18px; height: 100%;
  background: linear-gradient(90deg,#1e90ff,#0050b5);
  border-radius: 2px;
}
@keyframes bootSlide {
  0% { transform: translateX(-70px); }
  100% { transform: translateX(240px); }
}
.boot-copy {
  position: absolute;
  bottom: 30px;
  color: #888;
  font-size: 11px;
}

/* =========================================================
   Desktop
   ========================================================= */
#desktop {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.5) 0%, transparent 40%),
    radial-gradient(ellipse at 70% 100%, #4a8f2e 0%, #6db93e 30%, transparent 60%),
    radial-gradient(ellipse at 50% 80%, #5fa838 0%, transparent 50%),
    linear-gradient(180deg, #4ea6e8 0%, #6dc1f5 40%, #b9e1f5 60%, #7dbd4e 65%, #5a9c33 100%);
  background-color: #5fa838;
  overflow: hidden;
}
#desktop::before {
  content:'';
  position: absolute; left: 0; right: 0; bottom: 0; height: 50%;
  background:
    radial-gradient(ellipse 90% 60% at 30% 100%, #5fa83c 0%, #4a8d2e 70%, transparent 75%),
    radial-gradient(ellipse 70% 50% at 80% 110%, #6cb944 0%, #57a032 70%, transparent 80%);
  pointer-events: none;
}
#desktop::after {
  content:'';
  position: absolute; left: 0; right: 0; top: 0; height: 60%;
  background:
    radial-gradient(ellipse 40% 25% at 20% 30%, rgba(255,255,255,0.7), transparent 70%),
    radial-gradient(ellipse 30% 18% at 70% 50%, rgba(255,255,255,0.5), transparent 70%),
    radial-gradient(ellipse 25% 15% at 85% 20%, rgba(255,255,255,0.6), transparent 70%);
  pointer-events: none;
}

/* =========================================================
   Desktop Icons
   ========================================================= */
.icons {
  position: absolute;
  top: 8px; left: 8px;
  display: grid;
  grid-template-columns: 80px;
  gap: 12px;
  z-index: 1;
}
.dicon {
  width: 80px;
  text-align: center;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
  cursor: default;
  padding: 4px;
  border-radius: 2px;
}
.dicon.selected { background: rgba(49,106,197,0.45); outline: 1px dotted #fff; }
.dicon .di-ico { line-height: 1; height: 40px; display: flex; align-items: center; justify-content: center; }
.dicon .di-ico img.xp-icon { width: 36px; height: 36px; }
.dicon .di-label { font-size: 11px; word-wrap: break-word; margin-top: 4px; }

/* Selection box */
#select-box {
  position: absolute;
  border: 1px dotted #fff;
  background: rgba(49,106,197,0.25);
  pointer-events: none;
  display: none;
  z-index: 10;
}

/* =========================================================
   Taskbar
   ========================================================= */
#taskbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 30px;
  display: flex;
  align-items: center;
  background:
    linear-gradient(180deg, #2b56b3 0%, #245edb 4%, #3b7ce8 10%, #245edb 50%, #1c4eb6 90%, #154092 100%);
  border-top: 1px solid #0b3da6;
  z-index: 9000;
}

#start-btn {
  height: 30px;
  padding: 0 28px 0 10px;
  border: none;
  cursor: pointer;
  color: #fff;
  font-family: "Trebuchet MS", sans-serif;
  font-style: italic;
  font-weight: bold;
  font-size: 16px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
  background:
    radial-gradient(ellipse at 80% 50%, #4ec23a 0%, transparent 40%),
    linear-gradient(180deg, #4ca935 0%, #3d8b27 50%, #2e711b 100%);
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
  box-shadow: inset 0 0 10px rgba(255,255,255,0.2);
  display: flex; align-items: center; gap: 6px;
}
#start-btn:hover { filter: brightness(1.1); }
#start-btn.active { filter: brightness(0.85); }

.start-flag {
  width: 18px; height: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  transform: skewY(-7deg) perspective(50px) rotateY(-12deg);
}
.start-flag span { border-radius: 1px 3px 1px 1px; }
.sf-r{background:#e0383c}.sf-g{background:#6dc433}.sf-b{background:#2476c8}.sf-y{background:#f5cd1c}

#quick-launch {
  display: flex; align-items: center; gap: 2px;
  padding: 0 6px;
  border-right: 1px solid rgba(0,0,0,0.4);
  box-shadow: 1px 0 0 rgba(255,255,255,0.25);
  height: 26px;
}
.ql-btn {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border-radius: 2px;
}
.ql-btn:hover { background: rgba(255,255,255,0.2); }
.ql-btn img.xp-icon { width: 16px; height: 16px; }

#tasks {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 6px;
  height: 26px;
  overflow: hidden;
}
.task {
  height: 22px;
  min-width: 140px;
  max-width: 200px;
  padding: 0 8px;
  display: flex; align-items: center; gap: 6px;
  color: #fff;
  background: linear-gradient(180deg, #3b7ce8 0%, #245edb 50%, #1c4eb6 100%);
  border: 1px solid #1444a6;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.task:hover { filter: brightness(1.1); }
.task.active { background: linear-gradient(180deg, #1c4eb6, #245edb 50%, #3b7ce8); box-shadow: inset 0 0 6px rgba(0,0,0,0.5); }
.task.minimized { opacity: 0.85; }
.task .t-ico { display: inline-flex; align-items: center; }
.task .t-label { overflow: hidden; text-overflow: ellipsis; }

#systray {
  display: flex; align-items: center; gap: 6px;
  height: 26px;
  padding: 0 10px;
  background: linear-gradient(180deg, #128ad6 0%, #109acc 50%, #0c75b8 100%);
  color: #fff;
  font-size: 11px;
  border-left: 1px solid rgba(255,255,255,0.4);
}
.tray-ico {
  display: inline-flex; align-items: center;
  cursor: pointer;
  padding: 2px;
}
.tray-ico img.xp-icon { width: 16px; height: 16px; }
.tray-ico:hover { filter: brightness(1.2); }
#clock { padding-left: 6px; }

/* =========================================================
   Start Menu
   ========================================================= */
#start-menu {
  position: fixed;
  left: 0; bottom: 30px;
  width: 380px;
  border: 1px solid #0b3da6;
  border-radius: 6px 6px 0 0;
  background: #fff;
  box-shadow: 4px -2px 10px rgba(0,0,0,0.4);
  z-index: 9500;
  overflow: hidden;
}
.sm-header {
  height: 56px;
  background: linear-gradient(180deg, #1c66e0 0%, #245edb 50%, #1c4eb6 100%);
  display: flex; align-items: center;
  padding: 6px 10px;
  gap: 10px;
  border-bottom: 2px solid #f5a623;
}
.sm-avatar {
  width: 44px; height: 44px;
  background: #cdd6e0;
  border: 2px solid #fff;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.sm-avatar img.xp-icon { width: 36px; height: 36px; }
.sm-username {
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.sm-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
}
.sm-col { padding: 6px 4px; }
.sm-left { border-right: 1px solid #aabae0; }
.sm-right {
  background: linear-gradient(180deg, #d9e4f5 0%, #c2d4ee 100%);
}

.sm-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 11px;
}
.sm-item:hover { background: linear-gradient(180deg, #316ac5, #245edb); color: #fff; }
.sm-ico { width: 24px; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.sm-ico img.xp-icon { width: 24px; height: 24px; }
.sm-text { flex: 1; }
.sm-title { font-size: 12px; font-weight: bold; }
.sm-sub { font-size: 10px; color: #555; }
.sm-item:hover .sm-sub { color: #ddd; }
.sm-sep { height: 1px; background: #c7c7c7; margin: 4px 8px; }
.sm-arrow { margin-left: auto; }

.sm-footer {
  background: linear-gradient(180deg, #245edb 0%, #1c4eb6 100%);
  display: flex; justify-content: flex-end; gap: 14px;
  padding: 6px 14px;
  border-top: 2px solid #f5a623;
}
.sm-foot-btn {
  color: #fff;
  display: flex; align-items: center; gap: 6px;
  cursor: pointer;
  font-size: 11px;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}
.sm-foot-btn:hover { text-decoration: underline; }
.sm-foot-btn img.xp-icon { width: 22px; height: 22px; }

/* =========================================================
   Windows
   ========================================================= */
.window {
  position: absolute;
  background: #ece9d8;
  border: 1px solid #0831d9;
  border-radius: 8px 8px 0 0;
  box-shadow: 4px 4px 10px rgba(0,0,0,0.4);
  display: flex; flex-direction: column;
  min-width: 220px;
  min-height: 160px;
}
.window.maximized {
  border-radius: 0;
  border: none;
}
.window .titlebar {
  height: 28px;
  background:
    linear-gradient(180deg, #0b58d6 0%, #1c66e0 4%, #3b7ce8 8%, #245edb 50%, #1c4eb6 90%, #154092 100%);
  border-radius: 7px 7px 0 0;
  display: flex; align-items: center;
  padding: 0 4px 0 6px;
  color: #fff;
  font-weight: bold;
  font-size: 12px;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.6);
  cursor: move;
  flex-shrink: 0;
}
.window.inactive .titlebar { background: linear-gradient(180deg, #7895d4 0%, #7e9fdf 50%, #5b7fc4 100%); }
.window .titlebar .t-ico { margin-right: 6px; display: inline-flex; }
.window .titlebar .t-ico img.xp-icon { width: 16px; height: 16px; }
.window .titlebar .t-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.window .titlebar .wb {
  width: 22px; height: 22px;
  margin-left: 2px;
  border: 1px solid rgba(0,0,0,0.4);
  border-radius: 3px;
  color: #fff;
  font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  background: linear-gradient(180deg, #5b8ee5, #2364d8);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.4);
  font-size: 13px;
  font-family: "Marlett", sans-serif;
}
.window .titlebar .wb:hover { filter: brightness(1.2); }
.window .titlebar .wb.close { background: linear-gradient(180deg, #ec6f6f, #c52727); }
.window .titlebar .wb.close:hover { background: linear-gradient(180deg, #ff8e8e, #e54040); }

.window .menubar {
  background: #ece9d8;
  border-bottom: 1px solid #aca99f;
  height: 22px;
  display: flex;
  align-items: center;
  padding: 0 4px;
  font-size: 11px;
  flex-shrink: 0;
}
.window .menubar .menu {
  padding: 2px 8px;
  cursor: default;
  border-radius: 2px;
}
.window .menubar .menu:hover { background: #316ac5; color: #fff; }

.window .body {
  flex: 1;
  overflow: auto;
  position: relative;
  background: #fff;
}
.window .statusbar {
  height: 20px;
  background: #ece9d8;
  border-top: 1px solid #aca99f;
  padding: 2px 8px;
  font-size: 11px;
  display: flex; align-items: center;
  flex-shrink: 0;
}

/* Menu dropdown */
.menu-dropdown {
  position: fixed;
  background: #fff;
  border: 1px solid #555;
  box-shadow: 3px 3px 6px rgba(0,0,0,0.3);
  font-size: 11px;
  min-width: 180px;
  z-index: 10000;
  padding: 2px;
}
.menu-dropdown .md-item {
  padding: 4px 18px 4px 22px;
  display: flex; justify-content: space-between; gap: 20px;
  cursor: default;
}
.menu-dropdown .md-item:hover:not(.disabled) { background: #316ac5; color: #fff; }
.menu-dropdown .md-item.disabled { color: #aaa; cursor: default; }
.menu-dropdown .md-sc { color: #888; }
.menu-dropdown .md-item:hover:not(.disabled) .md-sc { color: #ddd; }
.menu-dropdown .md-sep { height: 1px; background: #ccc; margin: 2px 4px; }

/* resize handle */
.resize-handle {
  position: absolute;
  width: 14px; height: 14px;
  right: 0; bottom: 0;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 50%, #888 50%, #888 60%, transparent 60%, transparent 70%, #888 70%, #888 80%, transparent 80%);
  z-index: 5;
}

/* =========================================================
   Generic UI bits
   ========================================================= */
button.xpbtn {
  background: linear-gradient(180deg, #f5f5f0 0%, #e1ddc7 100%);
  border: 1px solid #003c74;
  border-radius: 3px;
  padding: 4px 14px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  min-width: 75px;
  box-shadow: inset 0 0 0 1px #fff;
}
button.xpbtn:hover { background: linear-gradient(180deg, #fffacb 0%, #f5e8a4 100%); border-color: #e89a2e; }
button.xpbtn:active { background: linear-gradient(180deg, #d1cdb0 0%, #e1ddc7 100%); }
button.xpbtn:disabled { color: #888; background: linear-gradient(180deg, #ece9d8, #d8d4ba); cursor: default; border-color: #888; }
button.xpbtn:disabled:hover { background: linear-gradient(180deg, #ece9d8, #d8d4ba); border-color: #888; }

input.xpinput, textarea.xpinput {
  border: 1px solid #7f9db9;
  background: #fff;
  padding: 3px 4px;
  font-family: inherit;
  font-size: 11px;
}

.generic-app { padding: 18px; height: 100%; box-sizing: border-box; font-size: 12px; }
.generic-app h3 { margin: 0 0 8px; color: #003399; }
.generic-app p { margin: 6px 0; }
.generic-actions { margin-top: 18px; text-align: right; }

/* =========================================================
   Context menu
   ========================================================= */
#context-menu {
  position: fixed;
  background: #fff;
  border: 1px solid #aaa;
  box-shadow: 3px 3px 6px rgba(0,0,0,0.3);
  font-size: 11px;
  min-width: 160px;
  z-index: 9800;
  padding: 2px;
}
#context-menu .cm-item { padding: 4px 22px; cursor: default; }
#context-menu .cm-item:hover:not(.disabled) { background: #316ac5; color: #fff; }
#context-menu .cm-item.disabled { color: #aaa; }
#context-menu .cm-sep { height: 1px; background: #ccc; margin: 2px 4px; }

/* =========================================================
   Shutdown dialog
   ========================================================= */
#shutdown-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,30,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 9700;
  backdrop-filter: blur(2px);
}
.shutdown-dialog {
  width: 460px;
  background: linear-gradient(180deg, #245edb 0%, #1c4eb6 100%);
  border-radius: 8px;
  padding: 4px;
  color: #fff;
}
.sd-title {
  padding: 14px 14px 6px;
  font-size: 22px;
  font-family: "Trebuchet MS", sans-serif;
  font-style: italic;
  text-align: right;
}
.sd-body {
  background: #d9e6f8;
  color: #000;
  display: flex;
  justify-content: center;
  gap: 30px;
  padding: 26px;
  border-radius: 4px;
  margin: 4px;
}
.sd-body button {
  background: none;
  border: none;
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  cursor: pointer;
  font-size: 11px;
  color: #000;
}
.sd-ico {
  width: 50px; height: 50px;
  background: linear-gradient(180deg, #ffb22e, #d6791b);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3), inset 0 -4px 8px rgba(0,0,0,0.2);
}
.sd-ico img.xp-icon { width: 28px; height: 28px; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2)); }
.sd-footer {
  padding: 10px; text-align: right;
  background: #d9e6f8;
  border-radius: 4px;
  margin: 4px;
}
.sd-footer button {
  background: linear-gradient(180deg,#ffb22e,#d6791b);
  border: 1px solid #b25e0a;
  border-radius: 16px;
  padding: 4px 16px;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

/* Off screen */
#off-screen {
  position: fixed; inset: 0;
  background: #000;
  color: #ffa500;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999;
  font-size: 22px;
}
.off-text { margin-bottom: 30px; }
#off-restart {
  background: #222; color: #ffa500;
  border: 1px solid #ffa500;
  padding: 6px 20px;
  cursor: pointer;
}

/* =========================================================
   About Window
   ========================================================= */
.about-app {
  padding: 24px;
  background: #fff;
  text-align: center;
  height: 100%;
  box-sizing: border-box;
}
.about-logo { font-family: 'Trebuchet MS'; display: flex; align-items: center; gap: 14px; }
.ab-windows { font-size: 28px; font-weight: bold; color: #1a5fa8; }
.ab-xp { font-size: 48px; font-weight: bold; color: #1a5fa8; }
.ab-xp .xp {
  background: linear-gradient(180deg,#7ee8ff,#2e9fd4);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  font-style: italic;
}
.ab-edition { margin-top: 6px; font-size: 14px; }
.ab-version { font-size: 11px; color: #444; }
.about-app hr { margin: 16px 0; border: none; border-top: 1px solid #ccc; }
.ab-license { font-size: 11px; }
.ab-user { font-size: 12px; font-weight: bold; }
.about-actions { margin-top: 20px; }

/* =========================================================
   Minesweeper
   ========================================================= */
.ms-app { padding: 6px; background: #c0c0c0; height: 100%; display: flex; flex-direction: column; }
.ms-app .menubar { background: #c0c0c0; border-color: #888; }
.ms-header {
  background: #c0c0c0;
  border: 2px inset #fff;
  padding: 4px;
  display: flex; justify-content: space-between; align-items: center;
  margin: 6px 0;
}
.ms-counter {
  background: #000; color: #f00;
  font-family: "Courier New", monospace;
  font-weight: bold;
  font-size: 22px;
  padding: 1px 4px;
  min-width: 50px;
  text-align: center;
  border: 1px inset #888;
}
.ms-face {
  width: 32px; height: 32px;
  font-size: 20px;
  background: #c0c0c0;
  border: 2px outset #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ms-face:active { border-style: inset; }
.ms-board {
  display: grid;
  border: 3px inset #888;
  background: #c0c0c0;
  width: max-content;
}
.ms-cell {
  width: 22px; height: 22px;
  background: #c0c0c0;
  border: 2px outset #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold;
  font-size: 14px;
  cursor: default;
  font-family: "Arial",sans-serif;
}
.ms-cell.revealed {
  border: 1px solid #7b7b7b;
  background: #bdbdbd;
}
.ms-cell.mine { background: #e74c3c; }
.ms-cell.flag::before { content: "🚩"; font-size: 12px; }
.ms-cell[data-n="1"] { color: #1565c0; }
.ms-cell[data-n="2"] { color: #2e7d32; }
.ms-cell[data-n="3"] { color: #c62828; }
.ms-cell[data-n="4"] { color: #4527a0; }
.ms-cell[data-n="5"] { color: #6a1b1b; }
.ms-cell[data-n="6"] { color: #00838f; }
.ms-cell[data-n="7"] { color: #000; }
.ms-cell[data-n="8"] { color: #555; }

/* =========================================================
   Paint
   ========================================================= */
.paint-app { display: flex; flex-direction: column; height: 100%; background: #ece9d8; }
.paint-top { display: flex; gap: 4px; padding: 4px; flex: 1; min-height: 0; }
.paint-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: #ece9d8;
  border: 1px solid #888;
  padding: 2px;
  align-self: flex-start;
}
.paint-tool {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
}
.paint-tool:hover { background: #fff; }
.paint-tool.active { border: 1px inset #888; background: #fff; }
.paint-canvas-wrap {
  flex: 1;
  background: #808080;
  overflow: auto;
  padding: 6px;
}
.paint-canvas {
  background: #fff;
  cursor: crosshair;
  border: 1px solid #888;
  display: block;
}
.paint-colors {
  display: flex; flex-direction: column;
  background: #ece9d8;
  border-top: 1px solid #888;
  padding: 4px 6px;
  gap: 4px;
}
.paint-current { display: flex; gap: 8px; align-items: center; }
.pc-swatches { position: relative; width: 50px; height: 40px; }
.pc-swatch {
  width: 28px; height: 28px;
  border: 1px solid #555;
  position: absolute;
}
.pc-swatch.fg { left: 0; top: 0; z-index: 2; }
.pc-swatch.bg { left: 14px; top: 10px; }
.paint-palette {
  display: grid;
  grid-template-columns: repeat(10, 18px);
  gap: 2px;
}
.pp-color {
  width: 18px; height: 18px;
  border: 1px solid #555;
  cursor: pointer;
}
.paint-sizes { display: flex; gap: 4px; }
.ps-btn {
  width: 24px; height: 22px;
  background: #fff;
  border: 1px solid #555;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.ps-btn.active { background: #316ac5; }
.ps-btn .ps-dot { background: #000; border-radius: 50%; }
.ps-btn.active .ps-dot { background: #fff; }

/* =========================================================
   Notepad
   ========================================================= */
.notepad-app { display: flex; flex-direction: column; height: 100%; }
.notepad-app textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  padding: 4px;
  font-family: "Lucida Console","Courier New",monospace;
  font-size: 12px;
  background: #fff;
  width: 100%;
  height: 100%;
  white-space: pre;
}
.notepad-app textarea.wrap { white-space: pre-wrap; }

/* =========================================================
   Calculator
   ========================================================= */
.calc-app { padding: 6px; background: #ece9d8; height: 100%; display: flex; flex-direction: column; gap: 4px; }
.calc-display {
  background: #fff;
  border: 1px inset #888;
  text-align: right;
  padding: 4px 6px;
  font-family: "Lucida Console","Courier New",monospace;
  font-size: 16px;
  min-height: 24px;
  overflow: hidden;
}
.calc-keys {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  flex: 1;
}
.calc-keys button {
  font-family: inherit;
  font-size: 13px;
  background: linear-gradient(180deg, #f5f5f0, #d8d4ba);
  border: 1px outset #fff;
  cursor: pointer;
  min-height: 28px;
}
.calc-keys button:active { border-style: inset; }
.calc-keys .ck-op { color: #2854a2; font-weight: bold; }
.calc-keys .ck-eq { color: #b62525; font-weight: bold; }
.calc-keys .ck-mem { color: #1a7a1a; }

/* =========================================================
   Snake
   ========================================================= */
.snake-app {
  background: #000;
  display: flex; flex-direction: column;
  height: 100%; align-items: center;
  color: #0f0; font-family: "Courier New", monospace;
}
.snake-info {
  width: 100%; padding: 6px 12px;
  background: #111; color: #0f0;
  display: flex; justify-content: space-between;
  font-size: 13px;
}
.snake-canvas { background: #000; border: 1px solid #0f0; margin-top: 8px; }
.snake-actions { padding: 8px; }

/* =========================================================
   My Computer / Explorer
   ========================================================= */
.exp-app { display: flex; flex-direction: column; height: 100%; background: #fff; }
.exp-toolbar {
  background: #ece9d8;
  border-bottom: 1px solid #aca99f;
  display: flex; gap: 4px; padding: 4px;
  font-size: 11px;
  flex-shrink: 0;
}
.exp-toolbar button {
  background: none; border: 1px solid transparent;
  padding: 3px 8px;
  cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  font-size: 11px;
  font-family: inherit;
}
.exp-toolbar button:hover:not(:disabled) { border: 1px solid #ccd6e8; background: #e7eff8; }
.exp-toolbar button:disabled { color: #aaa; cursor: default; }
.exp-toolbar img.xp-icon { width: 16px; height: 16px; }
.exp-address {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 6px;
  background: #ece9d8;
  border-bottom: 1px solid #aca99f;
  font-size: 11px;
  flex-shrink: 0;
}
.exp-address input {
  flex: 1;
  border: 1px solid #7f9db9;
  padding: 2px 4px;
  font-family: inherit;
}
.exp-content {
  flex: 1;
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 0;
}
.exp-sidebar {
  background: linear-gradient(180deg, #7da2ce, #4e7ab4);
  padding: 10px;
  color: #fff;
  font-size: 11px;
  overflow: auto;
}
.exp-sidebar h4 {
  margin: 0 0 6px;
  font-size: 12px;
  padding: 4px;
  background: linear-gradient(90deg, #f5b440, transparent);
  border-radius: 2px;
}
.exp-sidebar ul { list-style: none; padding: 0; margin: 0 0 14px; }
.exp-sidebar li { padding: 3px 4px; cursor: pointer; }
.exp-sidebar li:hover { text-decoration: underline; }
.exp-details { padding: 2px 4px; }
.exp-main {
  background: #fff;
  padding: 10px;
  overflow: auto;
}
.exp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 96px);
  gap: 8px;
}
.exp-item {
  width: 96px;
  text-align: center;
  padding: 6px;
  cursor: default;
  border-radius: 2px;
}
.exp-item:hover { background: #e7eff8; }
.exp-item.selected { background: #316ac5; color: #fff; }
.exp-item .ei-ico { height: 40px; display: flex; align-items: center; justify-content: center; }
.exp-item .ei-ico img.xp-icon { width: 36px; height: 36px; }
.exp-item .ei-label { font-size: 11px; margin-top: 4px; word-wrap: break-word; }

/* =========================================================
   IE
   ========================================================= */
.ie-app { display: flex; flex-direction: column; height: 100%; background: #fff; }
.ie-toolbar {
  background: linear-gradient(180deg, #f4f4f4, #d3d3c4);
  border-bottom: 1px solid #888;
  display: flex; gap: 4px; align-items: center;
  padding: 4px;
  flex-shrink: 0;
}
.ie-toolbar.ie-addr-bar { gap: 8px; }
.ie-toolbar.ie-addr-bar > span { padding-left: 4px; color: #555; }
.ie-btn {
  padding: 4px 8px; border: 1px solid transparent;
  background: none; cursor: pointer;
  font-size: 11px;
  display: flex; align-items: center; gap: 4px;
  font-family: inherit;
}
.ie-btn:hover:not(:disabled) { border: 1px solid #ccd6e8; background: #e7eff8; }
.ie-btn:disabled { color: #aaa; cursor: default; }
.ie-address {
  flex: 1;
  border: 1px solid #7f9db9;
  background: #fff;
  padding: 3px 4px;
  font-family: inherit;
  font-size: 12px;
}
.ie-go {
  background: linear-gradient(180deg, #f0f0e0, #d8d4ba);
  border: 1px outset #fff;
  padding: 3px 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
}
.ie-frame-wrap {
  flex: 1;
  position: relative;
  background: #fff;
  min-height: 0;
}
.ie-frame {
  width: 100%; height: 100%;
  border: 0;
  background: #fff;
}
.ie-overlay {
  position: absolute;
  inset: 0;
  background: #fff;
  padding: 30px;
  font-family: "Times New Roman", serif;
  overflow: auto;
}
.ie-err-title {
  font-size: 22px;
  color: #003399;
  border-bottom: 2px solid #003399;
  padding-bottom: 6px;
  margin-bottom: 14px;
}
.ie-err-body p { line-height: 1.6; }
.ie-err-body button { margin: 8px 8px 0 0; }

/* =========================================================
   Clock
   ========================================================= */
.clock-app { background: #ece9d8; padding: 20px; text-align: center; height: 100%; box-sizing: border-box; }
.clock-digital {
  font-family: "Lucida Console", monospace;
  font-size: 32px;
  background: #000;
  color: #0f0;
  padding: 14px;
  border: 2px inset #888;
  margin-bottom: 14px;
}
.clock-date { font-size: 16px; }

/* =========================================================
   Help
   ========================================================= */
.help-app { padding: 14px; background: #fff; height: 100%; overflow: auto; font-size: 12px; line-height: 1.5; box-sizing: border-box; }
.help-app h3 { color: #003399; margin: 14px 0 6px; }
.help-banner {
  background: linear-gradient(180deg,#0a4ec0,#003399);
  color: #fff;
  padding: 10px 12px;
  font-size: 14px;
  margin: -14px -14px 14px;
  display: flex; align-items: center; gap: 8px;
}
.help-topics li { margin-bottom: 6px; }

/* =========================================================
   Run dialog
   ========================================================= */
.run-dialog { padding: 14px; box-sizing: border-box; background: #ece9d8; height: 100%; }
.run-dialog .row { display: flex; gap: 10px; align-items: center; }
.run-dialog .run-icon img.xp-icon { width: 36px; height: 36px; }
.run-input-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.run-input-row label { font-weight: bold; }
.run-input-row input { flex: 1; }
.run-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 14px; }

/* =========================================================
   Solitaire
   ========================================================= */
.sol-app {
  background: #3a8a3a;
  height: 100%;
  padding: 14px;
  color: #fff;
  font-family: 'Trebuchet MS', sans-serif;
  box-sizing: border-box;
  overflow: auto;
}
.sol-top { display: flex; gap: 14px; margin-bottom: 18px; align-items: center; }
.sol-stock, .sol-waste, .sol-foundation {
  width: 60px; height: 84px;
  border: 2px dashed #fff;
  border-radius: 6px;
  background: rgba(0,0,0,0.18);
  display: flex; align-items: center; justify-content: center;
}
.sol-foundation { font-size: 28px; color: rgba(255,255,255,0.55); }
.sol-stock { cursor: pointer; }
.sol-spacer { flex: 1; }
.sol-foundations { display: flex; gap: 6px; }
.sol-tabs { display: flex; gap: 8px; }
.sol-col { width: 64px; position: relative; min-height: 220px; }
.sol-card-wrap {
  position: absolute;
  left: 0;
  width: 60px;
  height: 84px;
}
.sol-card {
  width: 60px; height: 84px;
  border-radius: 6px;
  border: 1px solid #333;
  background: #fff;
  color: #000;
  display: flex; flex-direction: column;
  padding: 4px;
  font-weight: bold;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.sol-card.red { color: #d22; }
.sol-card.back {
  background: linear-gradient(135deg,#1c4eb6,#0b3da6);
  color: #fff;
  text-align: center;
  font-size: 28px;
  align-items: center; justify-content: center;
}
.sol-card .sc-r { font-size: 14px; }
.sol-card .sc-s { font-size: 20px; margin-top: -4px; }
.sol-help { margin-top: 18px; text-align: center; font-size: 12px; opacity: 0.9; }
.sol-help button { margin-left: 10px; }

/* =========================================================
   Email (Outlook Express)
   ========================================================= */
.email-app { display: flex; flex-direction: column; height: 100%; background: #ece9d8; }
.email-toolbar { padding: 4px; display: flex; gap: 4px; border-bottom: 1px solid #aca99f; }
.email-body { flex: 1; display: grid; grid-template-columns: 240px 1fr; min-height: 0; }
.email-list { background: #fff; border-right: 1px solid #aca99f; overflow: auto; }
.email-row { padding: 6px 10px; border-bottom: 1px solid #eee; cursor: default; font-size: 11px; }
.email-row:hover { background: #e7eff8; }
.email-row.selected { background: #316ac5; color: #fff; }
.email-row b { font-size: 12px; }
.email-content { padding: 14px; background: #fff; overflow: auto; }
.em-head { font-size: 12px; }
.em-body { line-height: 1.6; margin-top: 8px; }

/* =========================================================
   Windows Media Player
   ========================================================= */
.wmp-app {
  display: flex; flex-direction: column;
  height: 100%;
  background: linear-gradient(180deg, #1c5db5 0%, #062a72 100%);
  color: #fff;
  font-family: "Trebuchet MS", sans-serif;
}
.wmp-stage { flex: 1; display: grid; grid-template-columns: 1fr 200px; gap: 0; min-height: 0; }
.wmp-visualizer {
  background: #000;
  position: relative;
  display: flex; flex-direction: column;
  margin: 4px;
  border: 1px inset #000;
  overflow: hidden;
}
.wmp-canvas { width: 100%; height: 100%; display: block; flex: 1; }
.wmp-now {
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(28,93,181,0.9), rgba(6,42,114,0.95));
  color: #fff;
}
.wmp-title { font-size: 14px; font-weight: bold; }
.wmp-artist { font-size: 11px; opacity: 0.8; }
.wmp-playlist {
  background: #102b66;
  margin: 4px 4px 4px 0;
  border: 1px inset #000;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.wmp-pl-header {
  background: linear-gradient(180deg,#3a78d6,#1c4eb6);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: bold;
  border-bottom: 1px solid #0b3da6;
}
.wmp-pl-list { flex: 1; overflow: auto; }
.wmp-pl-row {
  padding: 5px 8px;
  display: flex; gap: 8px;
  cursor: pointer;
  font-size: 11px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.wmp-pl-row:hover { background: rgba(255,255,255,0.1); }
.wmp-pl-row.active { background: linear-gradient(180deg,#3a78d6,#1c4eb6); color: #fff; font-weight: bold; }
.wmp-pl-num { opacity: 0.6; min-width: 14px; }
.wmp-pl-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wmp-controls {
  background: linear-gradient(180deg, #5b8ee5, #2364d8);
  border-top: 1px solid #0b3da6;
  padding: 6px 10px;
  display: flex; align-items: center; gap: 6px;
}
.wmp-btn {
  width: 30px; height: 26px;
  background: linear-gradient(180deg, #f5f5f0, #d8d4ba);
  border: 1px outset #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #003;
  font-family: "Segoe UI Symbol", "Arial", sans-serif;
}
.wmp-btn:active { border-style: inset; }
.wmp-seek { flex: 1; cursor: pointer; }
.wmp-time { font-size: 11px; min-width: 80px; text-align: center; color: #fff; }
.wmp-vol-ico { color: #fff; }
.wmp-vol { width: 70px; cursor: pointer; }

/* =========================================================
   Control Panel
   ========================================================= */
.cp-app { display: flex; flex-direction: column; height: 100%; background: #fff; }
.cp-header {
  background: linear-gradient(180deg, #0a4ec0, #003399);
  color: #fff;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: bold;
}
.cp-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, 110px);
  gap: 10px;
  padding: 14px;
  align-content: start;
  overflow: auto;
}
.cp-item {
  width: 110px;
  text-align: center;
  padding: 6px;
  cursor: default;
  border-radius: 2px;
}
.cp-item:hover { background: #e7eff8; }
.cp-item.selected { background: #316ac5; color: #fff; }
.cp-ico img.xp-icon { width: 36px; height: 36px; }
.cp-label { font-size: 11px; margin-top: 4px; }

/* =========================================================
   Search
   ========================================================= */
.search-app { display: flex; flex-direction: column; height: 100%; background: #fff; }
.search-body { flex: 1; display: grid; grid-template-columns: 220px 1fr; min-height: 0; }
.search-sidebar {
  background: linear-gradient(180deg,#7da2ce,#4e7ab4);
  color: #fff;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  overflow: auto;
}
.search-sidebar h3 { margin: 0 0 6px; font-size: 12px; }
.search-results { padding: 14px; overflow: auto; }
.search-q { width: 60%; }
.search-output { margin-top: 14px; }
.search-row { padding: 4px; display: flex; gap: 6px; align-items: center; cursor: pointer; }
.search-row:hover { background: #e7eff8; }

/* =========================================================
   All Programs
   ========================================================= */
.allprog-app { padding: 8px; background: #fff; height: 100%; overflow: auto; box-sizing: border-box; }
.ap-group { margin-bottom: 10px; }
.ap-group-head {
  background: linear-gradient(180deg, #d9e4f5, #c2d4ee);
  padding: 4px 8px;
  font-weight: bold;
  border-bottom: 1px solid #aabae0;
  font-size: 11px;
}
.ap-item {
  padding: 5px 12px;
  display: flex; gap: 8px; align-items: center;
  cursor: pointer;
  font-size: 11px;
}
.ap-item:hover { background: linear-gradient(180deg, #316ac5, #245edb); color: #fff; }
.ap-ico img.xp-icon { width: 18px; height: 18px; }

/* =========================================================
   Volume
   ========================================================= */
.vol-app { padding: 14px; background: #ece9d8; height: 100%; box-sizing: border-box; }
.vol-app h3 { margin-top: 0; }
.vol-row { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.vol-row label { min-width: 70px; }
.vol-row input[type="range"] { flex: 1; }

/* =========================================================
   Picture viewer
   ========================================================= */
.picture-viewer {
  background: #000;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.picture-viewer img { max-width: 100%; max-height: 100%; image-rendering: auto; }
.picture-error { color: #f88; padding: 30px; font-family: monospace; }
