/* Native roles override cursor assets without changing the saved preset.
   Descendants matter: Profile and Customisations define their own variables. */
html[data-custom-cursors="off"],
html[data-custom-cursors="off"] *,
html[data-custom-cursors="off"] *::before,
html[data-custom-cursors="off"] *::after {
  --cursor-default: default !important;
  --cursor-pointer: pointer !important;
  --cursor-grab: grab !important;
  --cursor-grabbing: grabbing !important;
  --cursor-not-allowed: not-allowed !important;
  --cursor-wait-progress: progress !important;
  --cursor-magnify: zoom-in !important;
  --cursor-text: text !important;
}

/* Outrank the live-page blanket default cursor while retaining specialised
   zoom, drag and disabled states supplied by the existing selectors. */
html[data-custom-cursors="off"] :is(a, button, summary, select):where(:not(:disabled)) {
  cursor: pointer !important;
}
html[data-custom-cursors="off"] :is(a, button, summary, select) * {
  cursor: inherit !important;
}
html[data-custom-cursors="off"] :is(button, input, select, textarea):disabled {
  cursor: not-allowed !important;
}
html[data-custom-cursors="off"] :is(textarea, [contenteditable="true"], input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], input[type="tel"], input[type="number"]):not(:disabled) {
  cursor: text !important;
}

.cursorHeadingRow { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.cursorHeadingRow .sectionTitle { margin: 0; }
.cursorPreferenceStatus { color: #d2c6ad; font-size: 12px; line-height: 1.4; }
.cursorPreferenceStatus:empty { display: none; }
.cursorPreferenceStatus.isError { color: #ffbdb3; }

/* Rocker motion inspired by Jon Kantner's Neumorphic Rocker Switch:
   https://codepen.io/jkantner/pen/RwmoqNP. Local, independently styled control. */
.customisationsShell #cursorToggle {
  flex: 0 0 auto;
  width: 88px;
  height: 44px;
  padding: 4px;
  border: 0;
  border-radius: 22px;
  background: transparent;
  box-shadow: none;
  transform: none;
  font: 600 13px/1 "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.customisationsShell #cursorToggle:focus-visible {
  outline: 2px solid #f0d78f;
  outline-offset: 2px;
  box-shadow: none;
}
.customisationsShell #cursorToggle:disabled { opacity: .55; }
.cursorToggleWell {
  display: block;
  position: relative;
  height: 36px;
  padding: 4px;
  box-sizing: border-box;
  border-radius: 20px;
  background: #211a11;
  box-shadow: inset 0 2px 4px #080603, 0 1px 0 #8c7547;
  perspective: 240px;
}
.cursorToggleFace {
  display: flex;
  align-items: center;
  justify-content: space-around;
  position: relative;
  height: 100%;
  border-radius: 15px;
  background: linear-gradient(#625139, #392e20);
  box-shadow: inset 0 1px 1px #a48a56, inset 0 -2px 3px #21180d, 3px 2px 4px #080603;
  transform: translateX(-2px) rotateY(-16deg);
  transition: transform .25s cubic-bezier(.65, 0, .35, 1), box-shadow .25s;
}
.cursorToggleFace::before, .cursorToggleFace::after {
  content: "";
  position: absolute;
  inset: 0 50% 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #0007, transparent);
  pointer-events: none;
  transition: opacity .25s;
}
.cursorToggleFace::after {
  inset: 0 0 0 50%;
  background: linear-gradient(-90deg, #0007, transparent);
  opacity: 0;
}
.cursorToggleOn, .cursorToggleOff { position: relative; z-index: 1; flex: 1; text-align: center; color: #c2b18c; text-shadow: 0 1px 1px #140f08; transition: color .25s, text-shadow .25s; }
.cursorToggleOn { color: #ffe4a0; text-shadow: 0 0 7px #e7b83988, 0 1px 1px #140f08; }
.cursorToggleSeam { width: 1px; height: 13px; background: #20180f; box-shadow: 1px 0 0 #b09a6344; }
#cursorToggle[aria-checked="false"] .cursorToggleFace {
  transform: translateX(2px) rotateY(16deg);
  box-shadow: inset 0 1px 1px #a48a56, inset 0 -2px 3px #21180d, -3px 2px 4px #080603;
}
#cursorToggle[aria-checked="false"] .cursorToggleFace::before { opacity: 0; }
#cursorToggle[aria-checked="false"] .cursorToggleFace::after { opacity: 1; }
#cursorToggle[aria-checked="false"] .cursorToggleOn { color: #c2b18c; text-shadow: 0 1px 1px #140f08; }
#cursorToggle[aria-checked="false"] .cursorToggleOff { color: #ffe4a0; text-shadow: 0 0 7px #e7b83988, 0 1px 1px #140f08; }
#cursorToggle[aria-busy="true"] .cursorToggleWell { opacity: .7; }
@media (prefers-reduced-motion: reduce) {
  #cursorToggle span { transition: none; }
}
