/* ════════════════════════════════
   DESKTOP
   ════════════════════════════════ */
/* Everything above the taskbar, inside the notch / home-indicator insets.
   Windows are absolutely positioned inside this box. */
#desktop {
  position: relative;
  top: var(--safe-top);
  left: var(--safe-left);
  width: calc(100% - var(--safe-left) - var(--safe-right));
  height: calc(100vh - var(--taskbar-total) - var(--safe-top));
  height: calc(var(--app-height, 100vh) - var(--taskbar-total) - var(--safe-top));
  height: calc(100dvh - var(--taskbar-total) - var(--safe-top));
  background-color: var(--c-teal);
  overflow: hidden;
}

/* ── Desktop Icons wrapper ──
   One column with a 94px step from (14px, 16px), like the original absolute
   layout; on short screens the icons flow into more columns instead of
   being cut off. The wrapper ignores clicks so empty space is the desktop. */
#desktop-icons {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(auto-fill, 94px);
  grid-auto-columns: 76px;
  column-gap: 14px;
  padding: 16px 0 0 14px;
  align-items: start;
  pointer-events: none;
}

/* ── Desktop Icons ── */
.desktop-icon {
  position: relative;
  width: 76px;
  text-align: center;
  cursor: url('../img/cursor-default.png') 0 0, default;
  padding: 4px;
  pointer-events: auto;
  outline: none;
  -webkit-touch-callout: none;
}
.desktop-icon.recycled {
  visibility: hidden;
  pointer-events: none;
}
.desktop-icon.selected .icon-label {
  background-color: #000080;
  color: #fff;
  outline: 1px dotted #fff;
}
.desktop-icon:focus-visible .icon-label {
  outline: 1px dotted #fff;
}
#icon-recycle.selected .icon-label {
  background-color: #000080;
  color: #fff;
  outline: 1px dotted #fff;
}
.desktop-icon img {
  width: 32px;
  height: 32px;
  display: block;
  margin: 0 auto 3px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.icon-label {
  color: #fff;
  font-size: 13px;
  font-family: "w95fa", 'MS Sans Serif', Tahoma, sans-serif;
  text-shadow: 1px 0 #000, -1px 0 #000, 0 1px #000, 0 -1px #000;
  display: inline-block;
  padding: 1px 2px;
  line-height: 1.3;
  word-break: break-word;
}
/* Phone icon grid: see css/mobile.css */

/* ════════════════════════════════
   CONTEXT MENU
   ════════════════════════════════ */
#context-menu {
  position: fixed;
  background-color: var(--c-gray-200);
  box-shadow: var(--shadow-raised);
  display: none;
  z-index: 50000;
  min-width: 160px;
  padding: 2px 0;
}
#context-menu.visible { display: block; }
.context-item {
  padding: 4px 20px 4px 24px;
  cursor: pointer;
  font-size: 11px;
  font-family: "w95fa", 'MS Sans Serif', Tahoma, sans-serif;
}
.context-item:hover { background-color: #000080; color: #fff; }
.context-item.grayed { color: var(--c-gray-300); cursor: url('../img/cursor-default.png') 0 0, default; }
.context-item.grayed:hover { background: none; color: var(--c-gray-300); }
.context-sep {
  height: 1px;
  background: var(--c-gray-300);
  margin: 3px 4px;
  border-bottom: 1px solid var(--c-white);
}
