/* ============================================================
   Windows XP Luna Theme — Meridian Care Group EMR
   ============================================================ */

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Tahoma, 'MS Sans Serif', Arial, sans-serif;
  font-size: 11px;
  background: #3A6EA5;
  color: #000;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- XP Desktop ---- */
.xp-desktop {
  min-height: calc(100vh - 30px);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

/* Desktop (icon grid shown when window is closed) */
.xp-desktop-bg {
  display: none;
  position: fixed;
  inset: 0 0 30px 0;
  background: #3A6EA5;
  padding: 12px;
  align-content: start;
  flex-wrap: wrap;
  gap: 8px;
  flex-direction: column;
  z-index: 1;
  overflow: hidden;
}
.xp-desktop-bg.visible { display: flex; }

.xp-icon {
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
  user-select: none;
}
.xp-icon:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.4); }
.xp-icon.selected { background: rgba(49,106,197,0.6); border-color: rgba(49,106,197,0.9); }
.xp-icon-img { font-size: 32px; line-height: 1; }
.xp-icon-label { font-size: 11px; line-height: 1.3; word-break: break-word; }

/* Original paperclip helper inspired by classic desktop assistants. */
.xp-paperclip-assistant {
  position: fixed;
  right: 18px;
  bottom: 40px;
  z-index: 140;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  max-width: 330px;
  animation: xp-paperclip-arrive .35s ease-out;
}
.xp-paperclip-assistant[hidden] { display: none; }
.xp-paperclip-bubble {
  position: relative;
  min-width: 205px;
  padding: 10px 25px 10px 11px;
  background: #fffbd6;
  border: 1px solid #6f6b43;
  border-radius: 9px;
  box-shadow: 2px 3px 7px rgba(0, 0, 0, .35);
  line-height: 1.35;
}
.xp-paperclip-bubble::after {
  content: "";
  position: absolute;
  right: -9px;
  bottom: 26px;
  width: 15px;
  height: 15px;
  background: #fffbd6;
  border-right: 1px solid #6f6b43;
  border-bottom: 1px solid #6f6b43;
  transform: rotate(-45deg);
}
.xp-paperclip-bubble strong,
.xp-paperclip-bubble span { display: block; }
.xp-paperclip-bubble strong { margin-bottom: 3px; color: #173f82; }
.xp-paperclip-close {
  position: absolute;
  top: 4px;
  right: 5px;
  border: 0;
  background: transparent;
  color: #555;
  cursor: pointer;
  font: bold 11px Tahoma, sans-serif;
}
.xp-paperclip-character {
  width: 100px;
  height: 158px;
  flex: none;
  filter: drop-shadow(2px 3px 2px rgba(0, 0, 0, .35));
  animation: xp-paperclip-bob 2.8s ease-in-out infinite;
}
.xp-paperclip-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.xp-clip-brow { transform-origin: 66px 48px; animation: xp-paperclip-brow 6s ease-in-out infinite; }
.xp-clip-pupils { animation: xp-paperclip-look 5s ease-in-out infinite; }
.xp-clip-eyes { transform-origin: 66px 72px; animation: xp-paperclip-blink 4.5s infinite; }
@keyframes xp-paperclip-arrive {
  from { opacity: 0; transform: translateY(18px) scale(.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes xp-paperclip-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}
@keyframes xp-paperclip-blink {
  0%, 94%, 100% { transform: scaleY(1); }
  97% { transform: scaleY(.1); }
}
@keyframes xp-paperclip-look {
  0%, 40%, 100% { transform: translateX(0); }
  55%, 75% { transform: translateX(-6px); }
}
/* the "I'm up to something" eyebrow raise */
@keyframes xp-paperclip-brow {
  0%, 60%, 100% { transform: translateY(0); }
  66%, 76% { transform: translateY(-5px); }
}
@media (prefers-reduced-motion: reduce) {
  .xp-paperclip-assistant, .xp-paperclip-character,
  .xp-clip-pupils, .xp-clip-eyes, .xp-clip-brow { animation: none; }
}
@media (max-width: 640px) {
  .xp-paperclip-assistant { right: 8px; left: 8px; max-width: none; }
  .xp-paperclip-bubble { flex: 1; min-width: 0; }
}

/* Window states */
.xp-window.minimized { display: none !important; }
.xp-window.maximized {
  position: fixed !important;
  inset: 0 0 30px 0 !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  border-radius: 0 !important;
  z-index: 100;
}

/* Draggable windows */
.xp-window.draggable { position: fixed; z-index: 50; cursor: default; }
.xp-window.draggable .xp-titlebar { cursor: move; }

/* ---- Window chrome ---- */
.xp-window {
  background: #ECE9D8;
  border: 2px solid #0054E3;
  border-radius: 6px 6px 4px 4px;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.5), inset 1px 1px 0 #fff;
  min-width: 340px;
}

.xp-window.full {
  position: relative;  /* so WM.focus can raise it above floating windows (IE) */
  isolation: isolate;  /* its menu bar's z-index stays inside it, under floating windows (IE) */
  width: calc(100vw - 16px);
  height: calc(100vh - 46px);
  display: flex;
  flex-direction: column;
}

/* Title bar */
.xp-titlebar {
  background: linear-gradient(180deg, #0078d4 0%, #1553a8 50%, #0058cf 51%, #2b8acf 100%);
  padding: 3px 4px;
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.xp-titlebar-icon {
  font-size: 14px;
  line-height: 1;
}

.xp-titlebar-title {
  flex: 1;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xp-titlebar-btns {
  display: flex;
  gap: 2px;
}

.xp-titlebar-btn {
  width: 21px;
  height: 21px;
  border: 1px solid #003da0;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.xp-titlebar-btn.min { background: linear-gradient(180deg, #e9d5aa, #c8a86b); color: #000; }
.xp-titlebar-btn.max { background: linear-gradient(180deg, #e9d5aa, #c8a86b); color: #000; }
.xp-titlebar-btn.close { background: linear-gradient(180deg, #e87b7b, #c03030); color: #fff; }
.xp-titlebar-btn:hover { filter: brightness(1.1); }
.xp-titlebar-btn:active { filter: brightness(0.9); border-style: inset; }

/* Menu bar */
.xp-menubar {
  background: #ECE9D8;
  border-bottom: 1px solid #aca899;
  padding: 1px 4px;
  display: flex;
  gap: 0;
}

.xp-menu-item {
  padding: 2px 6px;
  cursor: default;
  border-radius: 2px;
  font-size: 11px;
}
.xp-menu-item:hover { background: #316AC5; color: #fff; }

/* Toolbar */
.xp-toolbar {
  background: #ECE9D8;
  border-bottom: 1px solid #aca899;
  padding: 3px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Window body */
.xp-window-body {
  padding: 8px;
  flex: 1;
  overflow: auto;
}

/* Status bar */
.xp-statusbar {
  background: #ECE9D8;
  border-top: 1px solid #aca899;
  padding: 2px 8px;
  font-size: 11px;
  color: #444;
  display: flex;
  gap: 12px;
}

.xp-statusbar-panel {
  border-right: 1px solid #aca899;
  padding-right: 12px;
}

/* ---- Taskbar ---- */
.xp-taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(180deg, #245EDC 0%, #1A45B0 3%, #2060CE 6%, #1B4BC2 100%);
  border-top: 1px solid #0f3a9e;
  display: flex;
  align-items: center;
  padding: 0 4px;
  gap: 4px;
  z-index: 9999;
}

.xp-start-btn {
  background: linear-gradient(180deg, #57c43c, #2a9e0f);
  border: 1px solid #1a6b08;
  border-radius: 0 10px 10px 0;
  padding: 2px 14px 2px 7px;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}
.xp-start-flag {
  width: 20px;
  height: 18px;
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, .45));
}

.xp-taskbar-apps {
  flex: 1;
  display: flex;
  gap: 3px;
  overflow: hidden;
}

.xp-taskbar-app {
  background: linear-gradient(180deg, #1f5bce, #2a6bd8);
  border: 1px solid #0f3a9e;
  border-radius: 2px;
  padding: 2px 8px;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}
.xp-taskbar-app:hover { background: linear-gradient(180deg, #2a6bd8, #3a7be8); }
.xp-taskbar-app.active { background: linear-gradient(180deg, #1044a8, #1a54b8); border-color: #0a2a6e; }

.xp-taskbar-tray {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #1044a8, #0a3090);
  border: 1px solid #0a2a6e;
  border-radius: 2px;
  padding: 2px 8px;
  color: #fff;
  font-size: 11px;
}

/* ---- XP Buttons ---- */
.xp-btn {
  background: linear-gradient(180deg, #fff 0%, #ECE9D8 50%, #d4d0c8 100%);
  border: 2px outset #d4d0c8;
  border-color: #fff #808080 #808080 #fff;
  padding: 3px 10px;
  font-family: Tahoma, sans-serif;
  font-size: 11px;
  cursor: pointer;
  min-width: 75px;
  white-space: nowrap;
}
.xp-btn:hover { background: linear-gradient(180deg, #fff, #dde8ff 50%, #b8c8f8 100%); border-color: #316AC5; }
.xp-btn:active { border-style: inset; border-color: #808080 #fff #fff #808080; }
.xp-btn.primary {
  background: linear-gradient(180deg, #6db3f7, #3570c8 50%, #2458a8 100%);
  color: #fff;
  border-color: #1a4080 #5090d8 #5090d8 #1a4080;
  font-weight: bold;
}
.xp-btn.primary:hover { background: linear-gradient(180deg, #7ec3ff, #4580d8 50%, #3468b8 100%); }
.xp-btn.primary:active { filter: brightness(0.9); }

/* ---- XP Input ---- */
.xp-input {
  border: 2px inset #d4d0c8;
  border-color: #808080 #fff #fff #808080;
  padding: 2px 4px;
  font-family: Tahoma, sans-serif;
  font-size: 11px;
  background: #fff;
  outline: none;
}
.xp-input:focus { border-color: #316AC5 #c0c0c0 #c0c0c0 #316AC5; }

textarea.xp-input {
  resize: vertical;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

/* ---- XP Panel / GroupBox ---- */
.xp-groupbox {
  border: 1px solid #aca899;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  padding: 8px;
  margin: 4px 0;
  position: relative;
}
.xp-groupbox legend {
  font-weight: bold;
  padding: 0 4px;
  background: #ECE9D8;
  position: absolute;
  top: -8px;
  left: 8px;
  font-size: 11px;
}

/* ---- XP Table / ListView ---- */
.xp-listview {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.xp-listview th {
  background: linear-gradient(180deg, #ECE9D8, #d4d0c8);
  border: 1px solid #aca899;
  border-bottom: 2px solid #888;
  padding: 2px 6px;
  text-align: left;
  font-weight: bold;
  white-space: nowrap;
}
.xp-listview td {
  border: 1px solid #e0ddd4;
  padding: 2px 6px;
  white-space: nowrap;
  overflow: hidden;
  max-width: 300px;
  text-overflow: ellipsis;
}
.xp-listview tr:nth-child(even) td { background: #f0efe8; }
.xp-listview tr:hover td { background: #316AC5; color: #fff; }

/* ---- Split layout ---- */
.xp-split {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow: hidden;
}
.xp-sidebar {
  width: 220px;
  min-width: 180px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.xp-content {
  flex: 1;
  overflow-y: auto;
}

/* ---- Tree / File list ---- */
.xp-tree { list-style: none; font-size: 11px; }
.xp-tree li { padding: 2px 0; }
.xp-tree-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 2px;
  border: 1px solid transparent;
  word-break: break-word;
  white-space: normal;
}
.xp-tree-item:hover { background: #cce4ff; border-color: #99c4ff; }
.xp-tree-item.active { background: #316AC5; color: #fff; border-color: #1a4aaa; }
.xp-tree-item.solved { color: #006400; }  /* was #008000 — bumped for WCAG AA contrast */
.xp-tree-item.solved .xp-badge { background: #006400; }
.xp-badge {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 2px;
  background: #888;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- Scoreboard ---- */
.xp-scoreboard th:first-child { width: 40px; text-align: center; }
.score-rank { font-weight: bold; text-align: center; }
.score-team { font-weight: bold; }
.score-solved { text-align: center; }
.score-gold td { background: #fff8d0 !important; }
.score-silver td { background: #f4f4f4 !important; }
.score-bronze td { background: #fdf0e0 !important; }
.score-you td { outline: 2px solid #316AC5; font-weight: bold; }

/* ---- Alert / message dialogs ---- */
.xp-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.xp-dialog {
  background: #ECE9D8;
  border: 2px solid #0054E3;
  border-radius: 6px 6px 4px 4px;
  min-width: 300px;
  max-width: 420px;
  box-shadow: 4px 4px 12px rgba(0,0,0,0.6);
}
.xp-dialog-body {
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.5;
}
.xp-dialog-icon { font-size: 32px; flex-shrink: 0; }
.xp-dialog-footer {
  padding: 8px;
  border-top: 1px solid #aca899;
  display: flex;
  justify-content: center;
  gap: 8px;
}

/* ---- Splash / boot screen ---- */
.xp-boot {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 20000;
}
.xp-boot-logo {
  text-align: center;
  color: #fff;
}
.xp-boot-logo h1 { font-size: 28px; font-weight: bold; color: #4da6ff; letter-spacing: 2px; }
.xp-boot-logo p  { font-size: 13px; color: #aac8e8; margin-top: 4px; }
.xp-boot-bar-outer {
  width: 260px;
  height: 12px;
  border: 1px solid #555;
  background: #111;
  border-radius: 2px;
  overflow: hidden;
}
.xp-boot-bar-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(180deg, #4da6ff, #1a6bd8);
  animation: xp-boot-fill 2.4s steps(20, end) forwards;
}
@keyframes xp-boot-fill {
  from { width: 0%; }
  to   { width: 100%; }
}
.xp-boot-text {
  font-size: 11px;
  color: #666;
  animation: xp-boot-blink 0.8s infinite;
}
@keyframes xp-boot-blink { 50% { opacity: 0; } }

/* ---- Login dialog ---- */
.xp-login-wrap {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 30px);
}
.xp-login-wrap.visible { display: flex; }

.xp-login-window { width: 360px; }

.xp-login-user-area {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #1a5bce, #0f3a9e);
  border-radius: 0 0 0 0;
}
.xp-login-avatar {
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border: 2px solid #6aabff;
}
.xp-login-user-info h3 { color: #fff; font-size: 13px; }
.xp-login-user-info p  { color: #aac8e8; font-size: 11px; }

.xp-login-form { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.xp-login-field { display: flex; flex-direction: column; gap: 2px; }
.xp-login-field label { font-size: 11px; font-weight: bold; }
.xp-login-field .xp-input { width: 100%; }

.xp-login-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 0 12px 12px; }

.xp-login-footer {
  background: linear-gradient(180deg, #0f3a9e, #08276e);
  padding: 6px 12px;
  color: #8aabdc;
  font-size: 10px;
  text-align: center;
  border-radius: 0 0 4px 4px;
}

.xp-error-msg {
  background: #fce8e8;
  border: 1px solid #cc0000;
  color: #cc0000;
  padding: 4px 8px;
  font-size: 11px;
  margin: 4px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---- KQL terminal area ---- */
.kql-terminal {
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  padding: 6px;
  border: 2px inset #808080;
  width: 100%;
  min-height: 120px;
  resize: vertical;
  tab-size: 4;
}
.kql-terminal:focus { outline: 1px solid #569cd6; }

.kql-toolbar {
  background: #ECE9D8;
  border-bottom: 1px solid #aca899;
  padding: 4px 6px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.kql-results-area {
  overflow: auto;
  max-height: 300px;
  border: 1px solid #aca899;
  background: #fff;
}

/* ---- Challenge card ---- */
.challenge-card {
  padding: 12px;
  background: #f8f7f2;
  border: 1px solid #aca899;
  margin-bottom: 8px;
}
.challenge-card h3 {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.challenge-card p { font-size: 11px; color: #555; margin-bottom: 8px; }
.challenge-submit {
  display: flex;
  gap: 6px;
  align-items: center;
}
.challenge-submit .xp-input { flex: 1; }

.resolved-stamp {
  display: inline-block;
  border: 3px solid #008000;
  color: #008000;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: bold;
  transform: rotate(-5deg);
  letter-spacing: 2px;
  margin-top: 4px;
}

/* ---- Progress bar (flag progress) ---- */
.xp-progress-outer {
  height: 14px;
  border: 2px inset #aca899;
  background: #fff;
  overflow: hidden;
  flex: 1;
}
.xp-progress-inner {
  height: 100%;
  background: linear-gradient(180deg, #5bb8f8, #1a6bd8);
  transition: width 0.4s ease;
}

/* ---- Misc utility ---- */
.text-center { text-align: center; }
.text-bold   { font-weight: bold; }
.text-small  { font-size: 10px; color: #666; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.align-center { align-items: center; }
.hidden { display: none !important; }

/* Visually hidden — accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---- Dark mode ---- */
html.dark-mode body { background: #1a1a2e; color: #e0e0e0; }
html.dark-mode .xp-window { background: #2a2a3e; border-color: #4a7fd4; }
html.dark-mode .xp-menubar,
html.dark-mode .xp-toolbar,
html.dark-mode .xp-window-body,
html.dark-mode .xp-statusbar { background: #2a2a3e; color: #e0e0e0; border-color: #444; }
html.dark-mode .xp-groupbox { border-color: #555; }
html.dark-mode .xp-groupbox legend { background: #2a2a3e; color: #e0e0e0; }
html.dark-mode .xp-listview td { border-color: #444; }
html.dark-mode .xp-listview tr:nth-child(even) td { background: #323248; }
html.dark-mode .xp-input { background: #1e1e2e; color: #e0e0e0; border-color: #555 #1a1a2e #1a1a2e #555; }
html.dark-mode .xp-btn { background: linear-gradient(180deg, #3a3a5a, #2a2a4a); color: #e0e0e0; border-color: #555 #1a1a2e #1a1a2e #555; }
html.dark-mode .xp-dialog { background: #2a2a3e; }
html.dark-mode .xp-dialog-body { color: #e0e0e0; }
html.dark-mode .xp-tree-item:hover { background: #3a5a8a; }
html.dark-mode .xp-desktop-bg { background: #1a1a2e; }

/* Dark mode toggle button in taskbar tray */
#dark-mode-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 2px;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  padding: 1px 5px;
  line-height: 1.4;
}
#dark-mode-toggle:hover { background: rgba(255,255,255,0.15); }

/* ---- Dropdown menus ---- */
.xp-menubar { position: relative; z-index: 500; }

.xp-menu-item {
  position: relative;
}
.xp-menu-item.open { background: #316AC5; color: #fff; }

.xp-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: #ECE9D8;
  border: 1px solid #888;
  border-top: none;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  z-index: 600;
  padding: 2px 0;
}
.xp-menu-item.open .xp-dropdown { display: block; }

.xp-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 20px 3px 24px;
  font-size: 11px;
  cursor: default;
  white-space: nowrap;
}
.xp-dropdown-item:hover { background: #316AC5; color: #fff; }
.xp-dropdown-item.disabled { color: #aaa; pointer-events: none; }
.xp-dropdown-item .shortcut { margin-left: auto; color: #666; font-size: 10px; }
.xp-dropdown-item:hover .shortcut { color: #cce; }
.xp-dropdown-separator {
  height: 1px;
  background: #aca899;
  margin: 3px 4px;
}
.xp-dropdown-item-icon { font-size: 13px; width: 16px; text-align: center; flex-shrink: 0; }

/* Context menu (right-click desktop) */
.xp-context-menu {
  position: fixed;
  background: #ECE9D8;
  border: 1px solid #888;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.4);
  padding: 2px 0;
  z-index: 8000;
  min-width: 160px;
}
.xp-context-item {
  padding: 3px 20px;
  font-size: 11px;
  cursor: default;
  white-space: nowrap;
}
.xp-context-item:hover { background: #316AC5; color: #fff; }
.xp-context-separator { height: 1px; background: #aca899; margin: 3px 4px; }

/* ---- Start menu ---- */
.xp-start-menu {
  display: none;
  position: fixed;
  bottom: 30px;
  left: 0;
  width: 300px;
  background: #ECE9D8;
  border: 2px solid #0054E3;
  border-radius: 6px 6px 0 0;
  box-shadow: 4px -2px 12px rgba(0,0,0,0.5);
  z-index: 9000;
  overflow: hidden;
}
.xp-start-menu.open { display: block; }
.xp-start-menu-header {
  background: linear-gradient(90deg, #1a5bce, #2060ce);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.xp-start-menu-header .avatar { font-size: 28px; }
.xp-start-menu-header .name { font-size: 13px; font-weight: bold; }
.xp-start-menu-body { display: flex; }
.xp-start-menu-left {
  flex: 1;
  padding: 4px 0;
  border-right: 1px solid #aca899;
}
.xp-start-menu-right {
  width: 120px;
  background: #d8d4c4;
  padding: 4px 0;
}
.xp-start-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  cursor: default;
  font-size: 11px;
}
.xp-start-item:hover { background: #316AC5; color: #fff; }
.xp-start-item .icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.xp-start-item-sep { height: 1px; background: #aca899; margin: 4px 8px; }
.xp-start-item.danger:hover { background: #c03030; color: #fff; }

/* ---- Command Prompt (cmd.exe, Luna theme) ----
   Placed last so it wins over the generic and dark-mode .xp-window rules. */
html .xp-window.xp-cmd-window {
  top: 64px;
  left: 80px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0 3px 3px;
  background: #0b4fe3;
  border: 1px solid #0831a8;
  border-top: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 2px 3px 12px rgba(0,0,0,0.45);
}
html .xp-window.xp-cmd-window:has(.xp-titlebar.inactive) { background: #7a96df; border-color: #6a82c4; }

.xp-cmd-window .xp-titlebar {
  height: 29px;
  box-sizing: border-box;
  margin: 0 -3px;
  padding: 0 5px 0 6px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, #3d95ff 0%, #0a5fe8 9%, #0052e6 45%, #0a62f5 85%, #0b5ce6 94%, #0040c8 100%);
  gap: 5px;
}
.xp-cmd-window .xp-titlebar.inactive {
  background: linear-gradient(180deg, #a8bdf5 0%, #7d99e2 10%, #7a96df 88%, #6f8bd8 100%);
}
.xp-cmd-window .xp-titlebar-title {
  font: bold 13px "Trebuchet MS", Tahoma, sans-serif;
  text-shadow: 1px 1px #0f1089;
}
.xp-cmd-window .xp-titlebar.inactive .xp-titlebar-title { color: #d8e4f8; text-shadow: none; }

.xp-cmd-icon {
  flex: none;
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border: 1px solid #a0a0a0;
  border-top-width: 3px;
  background: #000;
  color: #fff;
  font: bold 7px/10px "Lucida Console", monospace;
  letter-spacing: -0.5px;
  text-align: center;
  overflow: hidden;
}

.xp-cmd-btn {
  position: relative;
  width: 21px;
  height: 21px;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 3px;
  cursor: default;
  background: radial-gradient(circle at 85% 85%, #0045d6 0%, #2a68e0 50%, #4a82ea 70%, #b6cdf6 92%, #fff 100%);
}
.xp-cmd-btn:hover  { filter: brightness(1.12); }
.xp-cmd-btn:active { filter: brightness(0.85); }
.xp-cmd-btn.close {
  background: radial-gradient(circle at 85% 85%, #c13b0c 0%, #d9572a 50%, #e07a4e 70%, #f7c7b0 92%, #fff 100%);
}
.xp-cmd-btn::before, .xp-cmd-btn::after { content: ""; position: absolute; box-sizing: border-box; }
.xp-cmd-btn.min::before { left: 5px; bottom: 4px; width: 7px; height: 3px; background: #fff; }
.xp-cmd-btn.max::before { left: 4px; top: 4px; width: 11px; height: 11px; border: 1px solid #fff; border-top-width: 3px; }
.xp-cmd-window.maximized .xp-cmd-btn.max::before { left: 3px; top: 7px; width: 8px; height: 8px; }
.xp-cmd-window.maximized .xp-cmd-btn.max::after  { left: 7px; top: 3px; width: 8px; height: 8px; border: 1px solid #fff; border-top-width: 2px; border-left: 0; border-bottom: 0; }
.xp-cmd-btn.close::before, .xp-cmd-btn.close::after {
  left: 50%; top: 50%; width: 13px; height: 2px; background: #fff;
  transform: translate(-50%, -50%) rotate(45deg);
}
.xp-cmd-btn.close::after { transform: translate(-50%, -50%) rotate(-45deg); }

.xp-cmd-body {
  flex: 1;
  min-height: 0;
  display: flex;
  background: #000;
}
.xp-cmd-screen {
  flex: 1;
  width: 80ch;
  height: 432px; /* 36 rows x 12px */
  margin: 0;
  padding: 1px 2px;
  background: #000;
  color: #c0c0c0;
  font: 12px/12px "Lucida Console", Consolas, Monaco, "DejaVu Sans Mono", monospace;
  white-space: pre;
  overflow: hidden;
}
.xp-cmd-window.maximized .xp-cmd-screen { width: auto; height: auto; }

/* Decorative Luna vertical scrollbar */
.xp-cmd-scroll {
  flex: none;
  width: 17px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(90deg, #eeede5 0%, #fcfcfa 50%, #f3f1ec 100%);
}
.xp-cmd-scroll-btn, .xp-cmd-scroll-thumb {
  box-sizing: border-box;
  border: 1px solid #fff;
  border-radius: 3px;
  background: linear-gradient(90deg, #c5d5fc 0%, #bcd0fc 45%, #a9c1f7 100%);
  box-shadow: inset 0 0 0 1px #b4c9f7;
}
.xp-cmd-scroll-btn { position: relative; flex: none; height: 17px; }
.xp-cmd-scroll-btn::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  border: 4px solid transparent;
}
.xp-cmd-scroll-btn.up::before   { border-bottom-color: #4d6185; border-top-width: 0; }
.xp-cmd-scroll-btn.down::before { border-top-color: #4d6185; border-bottom-width: 0; }
.xp-cmd-scroll-track { position: relative; flex: 1; }
.xp-cmd-scroll-thumb { position: absolute; left: 0; right: 0; top: 0; height: 22%; min-height: 20px; }
.xp-cmd-scroll-thumb::before {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 7px; height: 8px;
  transform: translate(-50%, -50%);
  background: repeating-linear-gradient(180deg, #eef4fe 0 1px, #8cb0f8 1px 2px);
}

/* ---- Internet Explorer (templates/_ie_window.html) ---- */
.xp-window.draggable.xp-ie {
  left: 3vw;
  top: 2vh;
  width: 94vw;
  height: calc(100vh - 30px - 4vh);
  display: flex;
  flex-direction: column;
}
.xp-ie-logo { width: 16px; height: 16px; vertical-align: -3px; flex: none; }
.xp-ie-logo-icon { width: 32px; height: 32px; }
.xp-ie-toolbar, .xp-ie-address, .xp-ie-links { font-size: 11px; }
.xp-ie-btn, .xp-ie-link {
  font: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 2px 6px;
  cursor: pointer;
}
.xp-ie-btn:hover, .xp-ie-link:hover { border-color: #aca899; background: #f5f4ea; }
.xp-ie-btn:active, .xp-ie-link:active { background: #dcd9c8; }
.xp-ie-label { color: #555; }
.xp-ie-url {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid #7f9db9;
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xp-ie-link::before { content: "\1F4C4"; margin-right: 3px; }
.xp-ie-frame { flex: 1; width: 100%; border: 0; border-top: 1px solid #aca899; background: #fff; }
.xp-taskbar-app[hidden] { display: none; }
/* The IE taskbar entry is a <button>, the others are links: same look. */
button.xp-taskbar-app { font: inherit; font-size: 11px; text-align: left; }
.xp-ie-btn:disabled { color: #a0a0a0; cursor: default; background: transparent; border-color: transparent; }
.xp-ie-url { font: inherit; color: inherit; }
#ie-user { color: #555; }
.xp-start-pinned { font-weight: bold; }
html.dark-mode .xp-ie-url { background: #1f1f30; border-color: #4a7fd4; color: #e0e0e0; }
html.dark-mode .xp-ie-btn:hover, html.dark-mode .xp-ie-link:hover { background: #3a3a50; }
/* The window that is not in front: a paler title bar, as in XP */
.xp-window:not(.xp-cmd-window) > .xp-titlebar.inactive { filter: saturate(0.35) brightness(1.15); }
