/* ---------- Tokens (tema oscuro por defecto; JS pone data-theme y data-wallpaper en <html>) ---------- */
:root {
  color-scheme: dark;
  --text: #f2f2f2;
  --text-muted: #a8a8a8;
  --accent: #e95420;
  --accent-soft: rgba(233, 84, 32, 0.18);
  --win-bg: #2a2a2a;
  --win-bar: #353535;
  --win-bar-inactive: #2d2d2d;
  --border: #444444;
  --control-bg: rgba(255, 255, 255, 0.08);
  --control-hover: rgba(255, 255, 255, 0.18);
  --chrome-bg: rgba(30, 30, 30, 0.72);
  --chrome-hover: rgba(50, 50, 50, 0.85);
  --chrome-border: rgba(255, 255, 255, 0.09);
  --tile-bg: rgba(255, 255, 255, 0.06);
  --tile-hover: rgba(255, 255, 255, 0.12);
  --overlay-bg: rgba(12, 12, 12, 0.55);
  --input-bg: rgba(255, 255, 255, 0.08);
  --shadow-win: 0 18px 50px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  --radius: 12px;

  --wp-ubuntu:
    radial-gradient(1100px 600px at 75% 12%, rgba(233, 84, 32, 0.18), transparent 55%),
    radial-gradient(900px 700px at 15% 90%, rgba(83, 32, 105, 0.55), transparent 62%),
    linear-gradient(160deg, #34103a 0%, #5e2750 50%, #7a3255 100%);
  --wp-noche:
    radial-gradient(900px 600px at 80% 10%, rgba(80, 140, 255, 0.22), transparent 60%),
    radial-gradient(800px 700px at 10% 95%, rgba(20, 60, 120, 0.6), transparent 65%),
    linear-gradient(165deg, #0b1026 0%, #142046 55%, #1d2f5e 100%);
  --wp-atardecer:
    radial-gradient(1000px 600px at 70% 20%, rgba(255, 200, 120, 0.35), transparent 60%),
    radial-gradient(900px 700px at 15% 90%, rgba(190, 40, 90, 0.5), transparent 65%),
    linear-gradient(160deg, #e95420 0%, #c13b5a 55%, #5e2750 100%);
  --wp-grafito:
    radial-gradient(900px 600px at 70% 15%, rgba(255, 255, 255, 0.08), transparent 60%),
    linear-gradient(160deg, #1c1c1c 0%, #2b2b2b 55%, #3a3a3a 100%);
  --wallpaper: var(--wp-ubuntu);
}

:root[data-theme="light"] {
  color-scheme: light;
  --text: #1d1d1d;
  --text-muted: #5f5f5f;
  --win-bg: #fafafa;
  --win-bar: #ebebeb;
  --win-bar-inactive: #f3f3f3;
  --border: #d4d4d4;
  --control-bg: rgba(0, 0, 0, 0.06);
  --control-hover: rgba(0, 0, 0, 0.13);
  --chrome-bg: rgba(246, 246, 246, 0.8);
  --chrome-hover: rgba(255, 255, 255, 0.95);
  --chrome-border: rgba(0, 0, 0, 0.08);
  --tile-bg: rgba(0, 0, 0, 0.05);
  --tile-hover: rgba(0, 0, 0, 0.1);
  --overlay-bg: rgba(245, 245, 245, 0.55);
  --input-bg: rgba(255, 255, 255, 0.9);
  --shadow-win: 0 18px 50px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.12);
}

:root[data-wallpaper="noche"] { --wallpaper: var(--wp-noche); }
:root[data-wallpaper="atardecer"] { --wallpaper: var(--wp-atardecer); }
:root[data-wallpaper="grafito"] { --wallpaper: var(--wp-grafito); }

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--wallpaper);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* ---------- Desktop clock (lockscreen style) ---------- */
.desktop-clock {
  position: fixed;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.clock-time {
  font-size: clamp(56px, 13vw, 140px);
  font-weight: 200;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: #f5f5f5;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.35);
}
.clock-date {
  font-size: clamp(16px, 2.6vw, 24px);
  font-weight: 300;
  color: rgba(245, 245, 245, 0.85);
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.3);
}

/* ---------- Ventanas ---------- */
.windows {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}
.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 300px;
  min-height: 200px;
  background: var(--win-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-win);
  overflow: hidden;
  pointer-events: auto;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.window.opening,
.window.closing { opacity: 0; transform: scale(0.96); }
.window.minimized {
  opacity: 0;
  transform: translateY(60px) scale(0.85);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}
.window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: 0;
  border-radius: 0;
}

.window-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 8px;
  background: var(--win-bar);
  border-bottom: 1px solid var(--border);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: default;
}
/* espacio a la izquierda del mismo ancho que los botones, para centrar el título */
.window-bar::before { content: ""; flex: none; width: 88px; }
.window:not(.focused) .window-bar { background: var(--win-bar-inactive); }
.window:not(.focused) .window-title { opacity: 0.6; }
.window-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.window-controls { flex: none; display: flex; gap: 8px; width: 88px; justify-content: flex-end; }
.window-controls button,
.window-controls a {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--control-bg);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.window-controls button:hover,
.window-controls a:hover { background: var(--control-hover); }
.window-controls .close:hover { background: var(--accent); color: #fff; }

.window-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.window-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
/* mientras se arrastra o redimensiona, los iframes no deben robar el puntero */
.wm-busy .window-body iframe { pointer-events: none; }
.wm-busy { cursor: grabbing; }

.window-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  touch-action: none;
}
.window.maximized .window-resize { display: none; }

/* contenido de ventanas nativas (Proyectos, Contacto, Ajustes) */
.window-body.pad { padding: 20px 24px; }
.window-body h2 { margin: 0 0 12px; font-size: 20px; letter-spacing: -0.01em; }
.window-body h3 { margin: 22px 0 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.window-body h3:first-child { margin-top: 0; }
.window-body p { color: var(--text-muted); margin: 0 0 10px; }
.window-body a { color: var(--accent); }

.project-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.project {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--tile-bg);
}
.project-icon { font-size: 28px; line-height: 1; }
.project-info { flex: 1; min-width: 0; }
.project-info strong { display: block; }
.project-info span { display: block; color: var(--text-muted); font-size: 13.5px; line-height: 1.45; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--control-bg);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--control-hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }

.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.contact-list li:last-child { border-bottom: 0; }
.contact-list .label { width: 80px; flex: none; color: var(--text-muted); }
.contact-list .pending { color: var(--text-muted); font-style: italic; }

.segmented { display: inline-flex; padding: 3px; gap: 3px; border-radius: 10px; background: var(--control-bg); }
.segmented button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--win-bg); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.swatch {
  display: flex;
  align-items: flex-end;
  height: 64px;
  padding: 6px 8px;
  border: 2px solid transparent;
  border-radius: 10px;
  color: #fff;
  font: inherit;
  font-size: 12px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
.swatch[aria-pressed="true"] { border-color: var(--accent); }

.shortcuts { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.shortcuts td { padding: 6px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.shortcuts td:first-child { width: 45%; padding-right: 12px; }
.shortcuts tr:last-child td { border-bottom: 0; }
kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--control-bg);
  font-family: inherit;
  font-size: 12px;
  text-align: center;
}
.note { font-size: 12.5px; }

/* ---------- Terminal ---------- */
.term {
  padding: 10px 12px;
  background: #300a24;
  color: #eeeeec;
  font-family: "Ubuntu Mono", "Cascadia Mono", Consolas, "DejaVu Sans Mono", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.45;
  cursor: text;
}
.term-line { min-height: 1.45em; white-space: pre-wrap; word-break: break-word; }
.term-row { display: flex; }
.term-prompt { flex: none; white-space: pre; }
.term-user { color: #8ae234; font-weight: 700; }
.term-path { color: #729fcf; font-weight: 700; }
.term-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  caret-color: #eeeeec;
}
.term-muted { color: #a9a9a9; }
.term-err { color: #ef2929; }
.term-ok { color: #8ae234; }
.term-accent { color: #e95420; }
.term a { color: #729fcf; }

/* ---------- Ubuntu Dock ---------- */
.ubuntu-dock {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  max-width: calc(100vw - 16px);
  padding: 8px 10px;
  background: var(--chrome-bg);
  border: 1px solid var(--chrome-border);
  border-radius: 18px;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.dock-closed .ubuntu-dock { transform: translate(-50%, 170%); }

.dock-close {
  position: absolute;
  left: 50%;
  top: -24px;
  transform: translateX(-50%);
  width: 44px;
  height: 26px;
  border: 1px solid var(--chrome-border);
  border-radius: 10px;
  background: var(--chrome-bg);
  color: var(--text);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: background 0.2s ease;
}
.dock-close:hover { background: var(--chrome-hover); }
.dock-closed .dock-close { display: none; }

.dock-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 110;
  width: 44px;
  height: 30px;
  border: 1px solid var(--chrome-border);
  border-radius: 10px;
  background: var(--chrome-bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: background 0.2s ease, transform 0.2s ease;
}
.dock-handle:hover { background: var(--chrome-hover); }
.dock-handle:active { transform: translateX(-50%) scale(0.92); }
body:not(.dock-closed) .dock-handle { display: none; }

.dock-item {
  position: relative;
  flex: none;
  width: 70px;
  height: 56px;
  border: none;
  padding: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--tile-bg);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease, opacity 0.2s ease;
}
.dock-item:hover { transform: scale(1.22); background: var(--tile-hover); opacity: 1; }
.dock-item:active { transform: scale(1.08); }
.ubuntu-dock:hover .dock-item:not(:hover) { opacity: 0.7; }
.dock-icon { font-size: 24px; line-height: 1; pointer-events: none; }
.dock-icon svg { display: block; width: 22px; height: 22px; fill: currentColor; }
.dock-dot {
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 3px;
  background: var(--text);
  opacity: 0;
  transition: opacity 0.2s ease, width 0.2s ease;
}
.dock-item.running .dock-dot { opacity: 0.85; }
.dock-item.focused .dock-dot { width: 14px; opacity: 1; background: var(--accent); }
.dock-separator {
  flex: none;
  align-self: center;
  width: 1px;
  height: 36px;
  margin: 0 3px;
  background: var(--chrome-border);
}

/* ---------- Menú de aplicaciones ---------- */
.app-menu {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9vh 16px 120px;
  overflow-y: auto;
  background: var(--overlay-bg);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  animation: fade-in 0.18s ease;
}
.app-menu[hidden] { display: none; }
.app-search {
  width: min(420px, 100%);
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--chrome-border);
  border-radius: 21px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
}
.app-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 116px);
  justify-content: center;
  gap: 16px;
  width: min(760px, 100%);
  margin-top: 40px;
}
.app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 6px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.app-tile:hover,
.app-tile:focus-visible,
.app-tile.selected { background: var(--tile-hover); outline: none; }
.tile-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--tile-bg);
  font-size: 34px;
  line-height: 1;
}
.app-empty { margin-top: 40px; color: var(--text-muted); }

/* ---------- Arranque ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--wallpaper);
  color: #fff;
  text-align: center;
  cursor: pointer;
  /* se va solo aunque falle el JS */
  animation: boot-out 0.45s ease 2.3s forwards;
}
.boot.done { animation: boot-out 0.3s ease forwards; }
.boot-avatar {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e95420, #77216f);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  font-size: 38px;
  font-weight: 300;
  letter-spacing: 0.04em;
}
.boot-name { font-size: 22px; font-weight: 300; }
.boot-dots { display: flex; gap: 8px; }
.boot-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.3;
  animation: boot-dot 1s ease-in-out infinite;
}
.boot-dots span:nth-child(2) { animation-delay: 0.15s; }
.boot-dots span:nth-child(3) { animation-delay: 0.3s; }
.boot-hint { position: absolute; bottom: 40px; font-size: 13px; opacity: 0.6; }

@keyframes boot-out { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@keyframes boot-dot { 50% { opacity: 1; transform: translateY(-4px); } }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(6px);
  z-index: 300;
  padding: 9px 16px;
  border-radius: 9px;
  background: var(--win-bar);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Página 404 ---------- */
.page-404 {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 16px;
}
.page-404 .window {
  position: relative;
  width: min(640px, 100%);
  min-height: 0;
}
.page-404 .term { padding: 14px 16px 18px; }
.page-404 .term .btn { margin-top: 14px; }

/* elementos que solo existen en el tema XP */
.desktop-icons,
.app-menu-head,
.start-label,
.dock-tray { display: none; }

/* ---------- Tema secreto: Windows XP (`theme xp` en la terminal) ---------- */
:root[data-theme="xp"] {
  color-scheme: light;
  --text: #000000;
  --text-muted: #4a4a4a;
  --accent: #316ac5;
  --accent-soft: rgba(49, 106, 197, 0.25);
  --win-bg: #ece9d8;
  --border: #aca899;
  --control-bg: #ffffff;
  --control-hover: #ffffff;
  --tile-bg: #ffffff;
  --tile-hover: #316ac5;
  --input-bg: #ffffff;
  --shadow-win: 2px 3px 10px rgba(0, 0, 0, 0.45);
  --radius: 8px;
  --xp-blue: #0831d9;
  --xp-title: linear-gradient(180deg, #0997ff 0%, #0053ee 8%, #0050ee 40%, #0066ff 88%, #0066ff 93%, #005bff 95%, #003dd7 96%, #003dd7 100%);
  --xp-title-inactive: linear-gradient(180deg, #7697e7 0%, #7e9ee3 3%, #94afe8 6%, #97b4e9 8%, #82a5e4 14%, #7c9fe2 17%, #7996de 25%, #7b99e1 56%, #82a9e9 81%, #80a5e7 89%, #7b96e1 94%, #7a93df 97%, #abbae3 100%);
  --xp-taskbar: linear-gradient(180deg, #1f2f86 0%, #3165c4 3%, #3682e5 6%, #4490e6 10%, #3883e5 12%, #2b71e0 15%, #2663da 18%, #235bd6 20%, #2258d5 23%, #2157d6 38%, #245ddb 54%, #2562df 86%, #245fdc 89%, #2158d4 92%, #1d4ec0 95%, #1941a5 98%);
  /* colinas verdes bajo un cielo azul con nubes */
  --wallpaper:
    radial-gradient(140% 75% at 30% 118%, #8fd05b 0%, #5fae35 35%, #3f8f22 47%, #3a8a1f 49.6%, transparent 50%),
    radial-gradient(110% 60% at 92% 120%, #6dbb40 0%, #4a9a28 45%, transparent 50%),
    radial-gradient(320px 90px at 72% 22%, rgba(255, 255, 255, 0.85), transparent 70%),
    radial-gradient(260px 70px at 22% 16%, rgba(255, 255, 255, 0.75), transparent 70%),
    radial-gradient(200px 50px at 48% 34%, rgba(255, 255, 255, 0.55), transparent 70%),
    linear-gradient(180deg, #2b6fd6 0%, #5c9ce9 40%, #a9d3f6 68%, #cfe7fb 100%);
}

[data-theme="xp"] body { font-family: Tahoma, Verdana, "Segoe UI", sans-serif; }
[data-theme="xp"] .desktop-clock { display: none; }

/* ventanas Luna */
[data-theme="xp"] .window {
  border: 3px solid var(--xp-blue);
  border-top: 0;
  border-radius: 8px 8px 0 0;
  background: var(--win-bg);
}
[data-theme="xp"] .window:not(.focused) { border-color: #7a93df; }
[data-theme="xp"] .window.maximized { height: calc(100% - 30px) !important; border-width: 0; border-radius: 0; }
[data-theme="xp"] .window-bar {
  height: 30px;
  padding: 0 5px 0 7px;
  border: 0;
  border-radius: 7px 7px 0 0;
  background: var(--xp-title);
}
[data-theme="xp"] .window:not(.focused) .window-bar { background: var(--xp-title-inactive); }
[data-theme="xp"] .window-bar::before { display: none; }
[data-theme="xp"] .window-title {
  text-align: left;
  color: #ffffff;
  font-family: "Trebuchet MS", Tahoma, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-shadow: 1px 1px #0f1089;
}
[data-theme="xp"] .window:not(.focused) .window-title { opacity: 1; color: #d8e4f8; text-shadow: none; }
[data-theme="xp"] .window-controls { width: auto; gap: 2px; }
[data-theme="xp"] .window-controls button,
[data-theme="xp"] .window-controls a {
  width: 21px;
  height: 21px;
  border: 1px solid #ffffff;
  border-radius: 3px;
  background: radial-gradient(circle at 90% 90%, #0054e9 0%, #2263d5 55%, #4479e4 70%, #a3bbec 90%, #ffffff 100%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}
[data-theme="xp"] .window-controls .close,
[data-theme="xp"] .window-controls .close:hover {
  background: radial-gradient(circle at 90% 90%, #cc4600 0%, #dc6527 55%, #cd7546 70%, #ffccb2 90%, #ffffff 100%);
  color: #ffffff;
}
[data-theme="xp"] .window-controls button:hover,
[data-theme="xp"] .window-controls a:hover { filter: brightness(1.15); }
[data-theme="xp"] .window:not(.focused) .window-controls button { opacity: 0.7; }

/* contenido de ventanas */
[data-theme="xp"] .window-body { font-size: 12px; }
[data-theme="xp"] .window-body h3 { color: #0046d5; font-size: 12px; letter-spacing: 0; text-transform: none; }
[data-theme="xp"] .window-body p { color: #000000; }
[data-theme="xp"] .window-body a { color: #0000ee; }
[data-theme="xp"] .project { border-color: #7f9db9; border-radius: 0; background: #ffffff; }
[data-theme="xp"] .project-info span { color: #4a4a4a; font-size: 12px; }
[data-theme="xp"] .btn,
[data-theme="xp"] .segmented button {
  height: 23px;
  padding: 0 12px;
  border: 1px solid #003c74;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffffff 0%, #ecebe6 86%, #d6d0c5 100%);
  color: #000000;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  box-shadow: none;
}
[data-theme="xp"] .btn:hover,
[data-theme="xp"] .segmented button:hover { box-shadow: inset 0 0 0 2px #f8b636; filter: none; }
[data-theme="xp"] .segmented { padding: 0; gap: 4px; background: none; }
[data-theme="xp"] .wp-setting { display: none; } /* XP tiene su propio fondo */

/* terminal = símbolo del sistema */
[data-theme="xp"] .term {
  background: #000000;
  color: #c0c0c0;
  font-family: "Lucida Console", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.35;
}
[data-theme="xp"] .term-user,
[data-theme="xp"] .term-path { color: inherit; font-weight: 400; }
[data-theme="xp"] .term-ok,
[data-theme="xp"] .term-accent { color: #ffffff; }
[data-theme="xp"] .term-muted { color: #808080; }
[data-theme="xp"] .term-err { color: #ff5555; }
[data-theme="xp"] .term-input { caret-color: #c0c0c0; }
[data-theme="xp"] .term a { color: #c0c0c0; }

/* barra de tareas */
[data-theme="xp"] .ubuntu-dock {
  left: 0;
  bottom: 0;
  width: 100%;
  max-width: none;
  height: 30px;
  padding: 0;
  gap: 2px;
  align-items: center;
  border: 0;
  border-radius: 0;
  background: var(--xp-taskbar);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transform: none !important;
}
[data-theme="xp"] .dock-close,
[data-theme="xp"] .dock-handle,
[data-theme="xp"] .dock-sep-end,
[data-theme="xp"] .dock-dot { display: none !important; }
[data-theme="xp"] .dock-item {
  width: 28px;
  height: 26px;
  border-radius: 3px;
  background: transparent;
}
[data-theme="xp"] .dock-item:hover { transform: none; background: rgba(255, 255, 255, 0.2); }
[data-theme="xp"] .ubuntu-dock:hover .dock-item:not(:hover) { opacity: 1; }
[data-theme="xp"] .dock-icon { font-size: 17px; }
[data-theme="xp"] .dock-item.running { background: rgba(255, 255, 255, 0.14); }
[data-theme="xp"] .dock-item.focused { background: rgba(0, 0, 0, 0.28); box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.45); }
[data-theme="xp"] .dock-separator {
  height: 22px;
  margin: 0 4px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 1px 0 rgba(255, 255, 255, 0.2);
}
[data-theme="xp"] .dock-apps {
  order: -1;
  width: auto;
  height: 30px;
  margin-right: 8px;
  padding: 0 22px 0 14px;
  border-radius: 0 12px 12px 0;
  background: linear-gradient(180deg, #3c8f3c 0%, #5fbf5f 12%, #43a343 45%, #2e8b2e 85%, #1f6f1f 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.4), 2px 0 5px rgba(0, 0, 0, 0.35);
}
[data-theme="xp"] .dock-apps:hover { background: linear-gradient(180deg, #4aa04a 0%, #6fcf6f 12%, #52b352 45%, #3a9b3a 85%, #277f27 100%); }
[data-theme="xp"] .dock-apps .dock-icon { display: none; }
[data-theme="xp"] .start-label {
  display: inline;
  color: #ffffff;
  font-family: "Trebuchet MS", Tahoma, sans-serif;
  font-size: 18px;
  font-style: italic;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}
[data-theme="xp"] .dock-tray {
  display: flex;
  align-items: center;
  height: 30px;
  margin-left: auto;
  padding: 0 14px;
  border-left: 1px solid #1042af;
  background: linear-gradient(180deg, #0c59b9 1%, #139ee9 6%, #18b5f2 10%, #139beb 14%, #1290e8 19%, #0d8dea 63%, #0d9ff1 81%, #0f9eed 88%, #119be9 91%, #1392e2 94%, #137ed7 97%, #095bc9 100%);
  box-shadow: inset 1px 0 1px #18bbff;
  color: #ffffff;
  font-size: 12px;
}

/* menú Inicio */
[data-theme="xp"] .app-menu {
  inset: auto auto 30px 0;
  width: min(360px, 100vw);
  max-height: calc(100% - 40px);
  padding: 0;
  align-items: stretch;
  overflow: hidden;
  border: 2px solid #1854c1;
  border-radius: 8px 8px 0 0;
  background: #ffffff;
  box-shadow: 2px -2px 10px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  animation: none;
}
[data-theme="xp"] .app-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #1868ce 0%, #0e60cb 20%, #1b6cd3 47%, #297ae0 65%, #428ee9 90%, #4791eb 100%);
  color: #ffffff;
  font-family: "Trebuchet MS", Tahoma, sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}
[data-theme="xp"] .app-menu-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid #ffffff;
  border-radius: 4px;
  background: linear-gradient(135deg, #e95420, #77216f);
  font-weight: 400;
}
[data-theme="xp"] .app-search {
  width: auto;
  height: 26px;
  margin: 8px;
  padding: 0 8px;
  border: 1px solid #7f9db9;
  border-radius: 0;
  color: #000000;
  font-size: 12px;
}
[data-theme="xp"] .app-search:focus { box-shadow: none; }
[data-theme="xp"] .app-grid {
  grid-template-columns: 1fr;
  gap: 0;
  width: auto;
  margin: 0;
  padding: 0 4px 8px;
  overflow-y: auto;
}
[data-theme="xp"] .app-tile {
  flex-direction: row;
  justify-content: flex-start;
  gap: 10px;
  padding: 4px 8px;
  border-radius: 0;
  color: #000000;
  font-size: 12px;
  text-align: left;
}
[data-theme="xp"] .app-tile:hover,
[data-theme="xp"] .app-tile:focus-visible,
[data-theme="xp"] .app-tile.selected { background: #316ac5; color: #ffffff; }
[data-theme="xp"] .tile-icon { width: 32px; height: 32px; border-radius: 0; background: none; font-size: 24px; }
[data-theme="xp"] .app-empty { margin: 4px 12px 12px; font-size: 12px; }

/* íconos del escritorio */
[data-theme="xp"] .desktop-icons {
  position: fixed;
  top: 10px;
  left: 6px;
  bottom: 40px;
  z-index: 10;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(auto-fill, 84px);
  gap: 8px;
  align-content: start;
}
.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 78px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: #ffffff;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  text-shadow: 1px 1px 1px #000000;
  cursor: default;
}
.di-icon { font-size: 34px; line-height: 1; text-shadow: none; }
.di-label { padding: 0 2px; }
.desktop-icon.selected .di-label { background: #316ac5; }
.desktop-icon.selected .di-icon { filter: brightness(0.75) sepia(1) hue-rotate(180deg) saturate(3); }
.desktop-icon:focus-visible { outline: none; }
.desktop-icon:focus-visible .di-label { outline: 1px dotted #ffffff; }

/* globo de notificación */
[data-theme="xp"] .toast {
  left: auto;
  right: 10px;
  bottom: 40px;
  transform: translateY(6px);
  border: 1px solid #000000;
  border-radius: 8px;
  background: #ffffe1;
  color: #000000;
  font-family: Tahoma, sans-serif;
  font-size: 12px;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
[data-theme="xp"] .toast.show { transform: translateY(0); }

/* arranque */
[data-theme="xp"] .boot { background: #000000; }
[data-theme="xp"] .boot-avatar { display: none; }
[data-theme="xp"] .boot-name {
  font-family: "Trebuchet MS", Tahoma, sans-serif;
  font-size: 34px;
  font-style: italic;
  font-weight: 700;
}
[data-theme="xp"] .boot-name::after {
  content: "xp";
  margin-left: 4px;
  color: #ff6a00;
  font-size: 20px;
  vertical-align: super;
}
[data-theme="xp"] .boot-dots {
  gap: 2px;
  width: 150px;
  height: 18px;
  padding: 2px;
  overflow: hidden;
  border: 2px solid #b2b2b2;
  border-radius: 4px;
}
[data-theme="xp"] .boot-dots span {
  flex: none;
  width: 9px;
  height: 10px;
  border-radius: 1px;
  background: linear-gradient(180deg, #2838c7, #5979ef 45%, #2838c7);
  opacity: 1;
  animation: xp-slide 1.6s linear infinite;
}
@keyframes xp-slide { from { transform: translateX(-40px); } to { transform: translateX(150px); } }

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  .dock-item { width: 36px; height: 42px; border-radius: 10px; }
  .dock-icon { font-size: 19px; }
  .dock-icon svg { width: 18px; height: 18px; }
  .ubuntu-dock { gap: 3px; padding: 6px; }
  .dock-separator { margin: 0 1px; height: 28px; }
  .window-bar::before { display: none; }
  .window-title { text-align: left; padding-left: 6px; }
  .window-controls [data-act="max"] { display: none; }
  [data-theme="xp"] .dock-tray { display: none; }
  [data-theme="xp"] .dock-item { width: 26px; }
  [data-theme="xp"] .dock-apps { padding: 0 14px 0 10px; margin-right: 4px; }
  [data-theme="xp"] .start-label { font-size: 15px; }
}
@media (hover: none) {
  .dock-item:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .boot { display: none; }
  .window, .ubuntu-dock, .toast { transition: none; }
  .app-menu { animation: none; }
}
