/* Option C — touch-accessible window resizing. Preview only.
   Keep the desktop/chrome/menu/dock unchanged; desktop mouse resizing
   continues to use the existing eight-direction pointer logic. */

/* The original CSS hides the handles on all coarse-pointer devices.
   Override that for tablets (including iPad Safari) and wide phones. */
@media (pointer:coarse) {
  .xp-window:not(.maximized) .window-resize-handle { display:block; }
  .xp-window:not(.maximized) .window-resize-handle[data-resize="e"],
  .xp-window:not(.maximized) .window-resize-handle[data-resize="w"] {width:20px;}
  .xp-window:not(.maximized) .window-resize-handle[data-resize="s"],
  .xp-window:not(.maximized) .window-resize-handle[data-resize="n"] {height:20px;}
  .xp-window:not(.maximized) .window-resize-handle[data-resize="se"],
  .xp-window:not(.maximized) .window-resize-handle[data-resize="sw"] {width:30px;height:30px;}
  /* Keep the upper corners small so the Close/Maximize controls stay tappable. */
  .xp-window:not(.maximized) .window-resize-handle[data-resize="nw"],
  .xp-window:not(.maximized) .window-resize-handle[data-resize="ne"] {width:10px;height:10px;}
}
.window-resize-handle[data-resize="se"]::after {
  background:repeating-linear-gradient(135deg,transparent 0 3px,#603B67 3px 4px,transparent 4px 6px);
}
@media (max-width:740px) {
  /* Narrow phones use full-width windows initially. Once the user resizes,
     give their explicit width/height priority over the original !important
     viewport defaults (including compact project windows). */
  .xp-window:not(.maximized) .window-resize-handle {display:block;}
  .xp-window:not(.maximized) .window-resize-handle:not([data-resize="e"]):not([data-resize="s"]):not([data-resize="se"]) {display:none;}
  .xp-window:not(.maximized) .window-resize-handle[data-resize="e"] {width:20px;}
  .xp-window:not(.maximized) .window-resize-handle[data-resize="s"] {height:22px;}
  .xp-window:not(.maximized) .window-resize-handle[data-resize="se"] {width:32px;height:32px;}
  .xp-window.is-user-resized:not(.maximized) {
    width:var(--user-resize-width,calc(100% - 12px)) !important;
    height:var(--user-resize-height,min(560px,calc(100% - 12px))) !important;
  }
  /* Existing project-specific compact heights must not override Maximize. */
  .xp-window.maximized {
    width:calc(100% - 12px) !important;
    height:calc(100% - 12px) !important;
  }
}
