/* Fake XP right-click menu (js/eggs/meta.js). */

/* ---------- context menu (Luna) ---------- */
.xpm {
  position: fixed; z-index: 9500; min-width: 190px; max-width: calc(100vw - 8px); padding: 2px;
  background: #fff; color: #000; font: 11px/1 Tahoma, Verdana, 'Segoe UI', sans-serif;
  border: 1px solid #aca899; box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.45);
  outline: none; user-select: none; -webkit-user-select: none;
  animation: xpmIn 0.12s ease-out;
}
@keyframes xpmIn { from { opacity: 0; } }
.xpm-item {
  display: flex; align-items: center; width: 100%; height: 22px; padding: 0 6px 0 0; margin: 0;
  background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: default; outline: none;
}
.xpm-item.on, .xpm-item[aria-expanded="true"] { background: #316ac5; color: #fff; }
.xpm-item[aria-disabled] { color: #aca899; }
.xpm-item[aria-disabled].on { background: #316ac5; color: #aca899; }
.xpm-bold { font-weight: 700; }
.xpm-ico { flex: none; display: grid; place-items: center; width: 24px; height: 22px; }
.xpm-ico svg { width: 16px; height: 16px; }
.xpm-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.xpm-label { flex: 1; padding-right: 18px; white-space: nowrap; }
.xpm-key { padding: 0 6px 0 12px; white-space: nowrap; }
.xpm-arrow { width: 0; height: 0; margin: 0 2px 0 8px; border: 4px solid transparent; border-left: 4px solid currentColor; border-right: 0; }
.xpm-sep { height: 1px; margin: 3px 1px; background: #aca899; }

/* "Actualizar": the desktop blinks and the cursor spins */
.xpm-busy, .xpm-busy * { cursor: progress !important; }
.xpm-refresh { visibility: hidden; }

/* "Nuevo ▸": an icon lands where you clicked */
.xpm-desk {
  position: fixed; z-index: 9400; width: 86px; display: grid; justify-items: center; gap: 3px;
  pointer-events: none; font: 11px/1.25 Tahoma, Verdana, sans-serif; text-align: center;
  animation: xpmIn 0.15s ease-out; transition: opacity 0.4s;
}
.xpm-desk.out { opacity: 0; }
.xpm-desk-ico { width: 32px; height: 32px; filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, 0.5)); }
.xpm-desk-ico svg { width: 100%; height: 100%; }
.xpm-desk-name { padding: 1px 3px; background: #316ac5; color: #fff; outline: 1px dotted #fff; outline-offset: -1px; word-break: break-word; }

/* ---------- XP dialogs: Properties, error ---------- */
.xpm-win {
  position: fixed; inset: auto; z-index: 9400; margin: 0; padding: 0 3px 3px;
  width: min(370px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow: auto;
  background: var(--xp-face, #ece9d8); color: #000; font: 11px/1.35 Tahoma, Verdana, 'Segoe UI', sans-serif;
  border: 3px solid #0831d9; border-top: 0; border-radius: 8px 8px 0 0;
  box-shadow: inset 0 0 0 1px #166aee, 4px 6px 18px rgba(0, 0, 0, 0.55);
  animation: xpmWin 0.18s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes xpmWin { from { transform: scale(0.85); opacity: 0; } }
.xpm-alert { width: min(330px, calc(100vw - 16px)); }
.xpm-bar {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; gap: 2px; height: 30px; margin: 0 -6px 0; padding: 0 5px 0 9px; border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #0997ff 0%, #0053ee 8%, #0050ee 40%, #0066ff 88%, #0066ff 93%, #005bff 95%, #003dd7 96%, #003dd7 100%);
  border: 1px solid #0831d9; border-bottom: 0;
  color: #fff; font: 700 13px var(--trebuchet, 'Trebuchet MS', Tahoma, sans-serif); text-shadow: 1px 1px 0 #0f1089;
  cursor: default; touch-action: none; user-select: none; -webkit-user-select: none;
}
.xpm-bar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xpm-help, .xpm-x {
  position: relative; flex: none; width: 21px; height: 21px; padding: 0; cursor: pointer;
  border: 1px solid #fff; border-radius: 3px; color: #fff;
}
.xpm-help {
  font: 700 13px/1 Tahoma, sans-serif; text-shadow: none;
  background: radial-gradient(circle at 90% 90%, #0043cf 0%, #0d5cf3 55%, #3a83ff 75%, #c6dcff 100%);
  box-shadow: inset 0 -1px 2px 1px #0039b8;
}
/* reuse the orange close button from chaos.css, but stand alone on the 404 page too */
.xpm-x {
  background: radial-gradient(circle at 90% 90%, #cc4600 0%, #dc6527 55%, #cd7546 70%, #ffccb2 90%, #fff 100%);
  box-shadow: inset 0 -1px 2px 1px #da4600;
}
.xpm-x::before, .xpm-x::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 2.5px; background: #fff; border-radius: 1px;
  transform: translate(-50%, -50%) rotate(45deg);
}
.xpm-x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.xpm-x:hover, .xpm-help:hover { filter: brightness(1.15); }
.xpm-body { padding: 8px 6px 8px; }
.xpm-btns { display: flex; justify-content: flex-end; gap: 6px; padding-top: 8px; }
.xpm-btns .xp-btn { min-width: 75px; padding: 4px 10px; font-size: 11px; }
.xpm-alert .xpm-btns { justify-content: center; }

/* error box */
.xpm-msg { display: flex; gap: 12px; align-items: flex-start; padding: 8px 6px 4px; font-size: 12px; }
.xpm-msg p { margin: 0 0 6px; }
.xpm-msg-ico { flex: none; width: 32px; height: 32px; }
.xpm-msg-ico svg { width: 100%; height: 100%; }

/* tabs */
.xpm-tabs { display: flex; gap: 1px; padding-left: 2px; position: relative; z-index: 1; }
.xpm-tab {
  margin-top: 2px; padding: 3px 8px 2px; font: 11px Tahoma, Verdana, sans-serif; color: #000; cursor: pointer;
  background: linear-gradient(180deg, #fff 0%, #fafaf9 50%, #e8e7e1 100%);
  border: 1px solid #919b9c; border-bottom: 0; border-radius: 3px 3px 0 0;
}
.xpm-tab:hover { box-shadow: inset 0 2px 0 #ffc83c; }
.xpm-tab[aria-selected="true"] {
  margin-top: 0; margin-bottom: -1px; padding: 4px 9px 4px; background: #fcfcfe;
  border-top: 2px solid #ffc83c; box-shadow: inset 0 1px 0 #e68b2c;
}
.xpm-tab:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
.xpm-panels { background: #fcfcfe; border: 1px solid #919b9c; box-shadow: 1px 1px 0 #d0ceca; }
.xpm-panel { padding: 10px 12px 12px; min-height: 300px; }
.xpm-panel p { margin: 0 0 8px; }
.xpm-panel hr { border: 0; border-top: 1px solid #d0d0bf; margin: 8px 0; }

.xpm-head { display: flex; align-items: center; gap: 16px; padding: 2px 0 2px 2px; }
.xpm-big-ico { width: 32px; height: 32px; flex: none; }
.xpm-big-ico svg { width: 100%; height: 100%; }
.xpm-field { flex: 1; padding: 3px 4px; background: #fff; border: 1px solid #7f9db9; }
.xpm-grid { display: grid; grid-template-columns: 104px 1fr; gap: 6px 4px; margin: 0; }
.xpm-grid dt { color: #000; }
.xpm-grid dd { margin: 0; overflow-wrap: anywhere; }
.xpm-attrs { display: grid; grid-template-columns: 104px 1fr; gap: 4px; align-items: start; }
.xpm-boxes { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.xpm-check { display: inline-flex; align-items: center; gap: 4px; cursor: default; }
.xpm-check input { margin: 0; width: 13px; height: 13px; accent-color: #21a121; }
.xpm-adv { margin-left: auto; min-width: 0; padding: 3px 8px; font-size: 11px; }

.xpm-group { margin: 0; padding: 6px 10px 10px; border: 1px solid #d0d0bf; border-radius: 3px; }
.xpm-group legend { padding: 0 3px; color: #0046d5; }
.xpm-list { margin: 0 0 10px; padding: 2px 0; list-style: none; background: #fff; border: 1px solid #7f9db9; }
.xpm-list li { padding: 2px 6px; }
.xpm-list li:last-child { background: #316ac5; color: #fff; }
.xpm-perms { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #7f9db9; }
.xpm-perms th { padding: 3px 6px; text-align: center; font-weight: 400; background: #ebeadb; border-bottom: 1px solid #d0d0bf; }
.xpm-perms th:first-child, .xpm-perms td:first-child { text-align: left; }
.xpm-perms td { padding: 2px 6px; text-align: center; }

@media (max-width: 420px) {
  .xpm-grid, .xpm-attrs { grid-template-columns: 92px 1fr; }
  .xpm-panel { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .xpm, .xpm-win, .xpm-desk { animation: none; }
}
