/* morisoba // vintage pointer set. All visible cursor roles use local 32x32 sprites.
   Cursor_4.cur was entirely transparent; crosshair is a drawn replacement.
   Arrow is shared by default/hover. No native fallback cursors.
   Change a variable here to remap a role site-wide. */
@media (any-pointer: fine) {
  :root {
    --cur-arrow: url("/shared/cursors/arrow.png") 0 0, url("/shared/cursors/alternate-arrow.png") 10 10, none;
    --cur-pointer: var(--cur-arrow);
    --cur-text: url("/shared/cursors/text.png") 16 15, url("/shared/cursors/arrow.png") 0 0, none;
    --cur-vertical-text: url("/shared/cursors/vertical-text.png") 15 15, url("/shared/cursors/text.png") 16 15, none;
    --cur-move: url("/shared/cursors/move.png") 10 10, url("/shared/cursors/arrow.png") 0 0, none;
    --cur-grab: var(--cur-move);
    --cur-grabbing: url("/shared/cursors/grabbing.png") 15 17, url("/shared/cursors/move.png") 10 10, none;
    --cur-ns: url("/shared/cursors/vertical.png") 10 10, url("/shared/cursors/arrow.png") 0 0, none;
    --cur-ew: url("/shared/cursors/horizontal.png") 15 15, url("/shared/cursors/arrow.png") 0 0, none;
    --cur-nwse: url("/shared/cursors/diagonal-nwse.png") 10 10, url("/shared/cursors/arrow.png") 0 0, none;
    --cur-nesw: url("/shared/cursors/diagonal-nesw.png") 15 15, url("/shared/cursors/arrow.png") 0 0, none;
    --cur-crosshair: url("/shared/cursors/crosshair.png") 15 15, url("/shared/cursors/arrow.png") 0 0, none;
    --cur-wait: url("/shared/cursors/busy.png") 10 10, url("/shared/cursors/arrow.png") 0 0, none;
    --cur-progress: url("/shared/cursors/progress.png") 10 10, url("/shared/cursors/arrow.png") 0 0, none;
    --cur-disabled: url("/shared/cursors/forbidden.png") 10 10, url("/shared/cursors/arrow.png") 0 0, none;
    --cur-zoom-in: url("/shared/cursors/zoom-in.png") 12 11, url("/shared/cursors/crosshair.png") 15 15, none;
    --cur-zoom-out: url("/shared/cursors/zoom-out.png") 12 11, url("/shared/cursors/crosshair.png") 15 15, none;
  }

  /* Force the custom arrow even over old cursor:auto/default/none declarations
     and third-party widgets; explicit role rules below restore their semantics. */
  html, html body, html body *, html body *::before, html body *::after {
    cursor: var(--cur-arrow) !important;
  }

  /* Selectable reading text, including nested inline markup. Controls below
     deliberately override this so their labels keep the arrow. */
  html body :is(p, h1, h2, h3, h4, h5, h6, li, dt, dd, blockquote, pre, code,
    span, b, strong, em, i, small, td, th, label, .post-body, .cursor-text),
  html body :is(p, blockquote, pre, .post-body, .cursor-text) * {
    cursor: var(--cur-text) !important;
  }

  html body :is(a[href], button:not(:disabled), summary, select:not(:disabled),
    input[type="button"], input[type="submit"], input[type="reset"],
    input[type="checkbox"], input[type="radio"], input[type="range"],
    label[for], [role="button"], [role="link"], [role="menuitem"],
    [role="tab"], [role="option"], [onclick], [data-ui-sound],
    [style*="cursor: pointer"], [style*="cursor:pointer"],
    .row, .tag-pill, .ui-sound-nav, .ui-sound-select, .imported-review summary),
  html body :is(a[href], button, summary, [role="button"], [role="tab"], [onclick],
    .row, .tag-pill) *, html body input::file-selector-button {
    cursor: var(--cur-pointer) !important;
  }

  html body :is(textarea, [contenteditable="true"], [contenteditable=""],
    input:not([type]), input[type="text"], input[type="search"], input[type="email"],
    input[type="password"], input[type="number"], input[type="url"], input[type="tel"],
    input[type="date"], input[type="datetime-local"], input[type="time"],
    input[type="month"], input[type="week"], input[type="datetime"]) {
    cursor: var(--cur-text) !important;
  }
  html body :is([style*="vertical-text"], .cursor-vertical-text) { cursor: var(--cur-vertical-text) !important; }

  html body :is(.panel .titlebar, .panel .titlebar .tl, [draggable="true"], [style*="cursor: move"],
    [style*="cursor:move"], .cursor-move) {
    cursor: var(--cur-move) !important;
  }
  html body :is([style*="cursor: grab"], [style*="cursor:grab"], .cursor-grab,
    .maplibregl-canvas-container.maplibregl-interactive, .maplibregl-canvas-container.maplibregl-interactive canvas,
    #volume, #volume canvas, .directory > .titlebar, .dossier > .titlebar,
    #stage.grid .panel .titlebar) {
    cursor: var(--cur-grab) !important;
  }
  html body :is(.dragging, .dragging .titlebar, .dragging .tl, .cursor-grabbing,
    [style*="cursor: grabbing"], [style*="cursor:grabbing"],
    .maplibregl-canvas-container.maplibregl-interactive:active,
    .maplibregl-canvas-container.maplibregl-interactive:active canvas,
    #volume.dragging, #volume.dragging canvas, #stage.grid .panel.dragging .titlebar) {
    cursor: var(--cur-grabbing) !important;
  }

  html body :is(.cursor-ns-resize, .cursor-n-resize, .cursor-s-resize,
    [style*="cursor: ns-resize"], [style*="cursor: row-resize"]) { cursor: var(--cur-ns) !important; }
  html body :is(.cursor-ew-resize, .cursor-e-resize, .cursor-w-resize,
    [style*="cursor: ew-resize"], [style*="cursor: col-resize"]) { cursor: var(--cur-ew) !important; }
  html body :is(.cursor-nwse-resize, .cursor-nw-resize, .cursor-se-resize,
    [style*="cursor: nwse-resize"]) { cursor: var(--cur-nwse) !important; }
  html body :is(.cursor-nesw-resize, .cursor-ne-resize, .cursor-sw-resize,
    [style*="cursor: nesw-resize"]) { cursor: var(--cur-nesw) !important; }
  html body :is(.cursor-crosshair, [style*="cursor: crosshair"]) { cursor: var(--cur-crosshair) !important; }
  html body :is(.cursor-wait, [aria-busy="true"], [style*="cursor: wait"]) { cursor: var(--cur-wait) !important; }
  html body :is(.cursor-progress, [style*="cursor: progress"]) { cursor: var(--cur-progress) !important; }
  html body :is(:disabled, [aria-disabled="true"], [inert], [inert] *, .cursor-disabled,
    [style*="cursor: not-allowed"], [style*="cursor: no-drop"]) { cursor: var(--cur-disabled) !important; }

  html body :is(.cursor-help, [style*="cursor: help"], .cursor-context-menu,
    .cursor-alias, .cursor-copy) { cursor: var(--cur-pointer) !important; }
  html body :is(.cursor-cell, [style*="cursor: cell"]) { cursor: var(--cur-crosshair) !important; }
  html body :is(.cursor-all-scroll, [style*="cursor: all-scroll"]) { cursor: var(--cur-move) !important; }
  html body :is(.cursor-zoom-in, [style*="cursor: zoom-in"]) { cursor: var(--cur-zoom-in) !important; }
  html body :is(.cursor-zoom-out, [style*="cursor: zoom-out"]) { cursor: var(--cur-zoom-out) !important; }

  /* Explicit utilities take precedence over broad component defaults. */
  html body .cursor-arrow { cursor: var(--cur-arrow) !important; }
  html body .cursor-pointer { cursor: var(--cur-pointer) !important; }
  html body .cursor-text { cursor: var(--cur-text) !important; }
}
