/* Medieval cursor set. Page styles use these variables with native fallbacks,
   so the teacher workspace keeps normal cursors when this sheet is omitted. */
@media (any-pointer: fine) {
    :root {
        --koe-cursor-default: url('/images/cursors/knight-sword-bright-48.png?v=3') 6 6, auto;
        --koe-cursor-pointer: url('/images/cursors/knight-pointer-48.png?v=1') 13 5, pointer;
        --koe-cursor-text: url('/images/cursors/raven-quill-48.png?v=1') 6 7, text;
        --koe-cursor-not-allowed: url('/images/cursors/locked-shield-48.png?v=1') 24 24, not-allowed;
        --koe-cursor-wait: url('/images/cursors/hourglass-48.png?v=1') 24 24, wait;
        --koe-cursor-progress: url('/images/cursors/hourglass-48.png?v=1') 24 24, progress;
        --koe-cursor-grab: url('/images/cursors/gauntlet-open-48.png?v=1') 24 24, grab;
        --koe-cursor-grabbing: url('/images/cursors/gauntlet-closed-48.png?v=1') 24 24, grabbing;
        --koe-cursor-help: url('/images/cursors/help-scroll-48.png?v=1') 24 24, help;
        --koe-cursor-crosshair: url('/images/cursors/archery-reticle-48.png?v=1') 24 24, crosshair;
        --koe-cursor-zoom-in: url('/images/cursors/brass-lens-48.png?v=1') 19 19, zoom-in;
    }

    :where(html, body) {
        cursor: var(--koe-cursor-default, auto);
    }

    /* Plain labels otherwise use the browser's arrow, even inside unselectable text. */
    :where(label) {
        cursor: inherit;
    }

    :where(
        a[href], area[href], button, select, summary, label[for],
        input[type='button'], input[type='submit'], input[type='reset'],
        input[type='checkbox'], input[type='radio'], input[type='range'],
        input[type='color'], input[type='file'], [role='button'], [onclick]
    ) {
        cursor: var(--koe-cursor-pointer, pointer) !important;
    }

    :where(
        input:not([type]), input[type='text'], input[type='search'], input[type='email'],
        input[type='password'], input[type='url'], input[type='tel'], input[type='number'],
        textarea, [contenteditable=''], [contenteditable='true'], [contenteditable='plaintext-only']
    ),
    :where([contenteditable=''], [contenteditable='true'], [contenteditable='plaintext-only']) * {
        cursor: var(--koe-cursor-text, text) !important;
    }

    :where([draggable='true'], [draggable='true'] *) {
        cursor: var(--koe-cursor-grab, grab) !important;
    }

    :where([aria-busy='true'], [aria-busy='true'] *) {
        cursor: var(--koe-cursor-progress, progress) !important;
    }

    :disabled, [aria-disabled='true'] {
        cursor: var(--koe-cursor-not-allowed, not-allowed) !important;
    }

    :is(:disabled, [aria-disabled='true']) * {
        cursor: inherit !important;
    }

    /* JavaScript tools still set native keywords; map those inline states too. */
    [style*='cursor: default'], [style*='cursor:default'],
    [style*='cursor: auto'], [style*='cursor:auto'] { cursor: var(--koe-cursor-default, auto) !important; }
    [style*='cursor: pointer'], [style*='cursor:pointer'] { cursor: var(--koe-cursor-pointer, pointer) !important; }
    [style*='cursor: text'], [style*='cursor:text'] { cursor: var(--koe-cursor-text, text) !important; }
    [style*='cursor: not-allowed'], [style*='cursor:not-allowed'] { cursor: var(--koe-cursor-not-allowed, not-allowed) !important; }
    [style*='cursor: grab'], [style*='cursor:grab'] { cursor: var(--koe-cursor-grab, grab) !important; }
    [style*='cursor: grabbing'], [style*='cursor:grabbing'] { cursor: var(--koe-cursor-grabbing, grabbing) !important; }
    [style*='cursor: help'], [style*='cursor:help'] { cursor: var(--koe-cursor-help, help) !important; }
    [style*='cursor: zoom-in'], [style*='cursor:zoom-in'] { cursor: var(--koe-cursor-zoom-in, zoom-in) !important; }
    [style*='cursor: crosshair'], [style*='cursor:crosshair'] { cursor: var(--koe-cursor-crosshair, crosshair) !important; }
    [style*='cursor: wait'], [style*='cursor:wait'] { cursor: var(--koe-cursor-wait, wait) !important; }
    [style*='cursor: progress'], [style*='cursor:progress'] { cursor: var(--koe-cursor-progress, progress) !important; }
    [style*='cursor: zoom-out'], [style*='cursor:zoom-out'] { cursor: zoom-out !important; }
    [style*='cursor: move'], [style*='cursor:move'] { cursor: move !important; }
    [style*='cursor: none'], [style*='cursor:none'] { cursor: none !important; }
}
