body[data-scene="fingers"] {
  background: linear-gradient(145deg, #fff0c9, #ffdfeb 45%, #c6f3ec);
}
#world {
  overflow: hidden;
}
.finger-garden {
  position: absolute;
  inset: 0;
}
.finger-garden i {
  position: absolute;
  font-size: 4vw;
  color: #ffbd4c55;
  left: 3%;
  top: 10%;
  font-style: normal;
}
.finger-garden i:nth-child(2) {
  left: 75%;
  top: 8%;
  color: #ff5fa255;
}
.finger-garden i:nth-child(3) {
  left: 64%;
  top: 91%;
  color: #2ed9a355;
}
.finger-garden i:nth-child(4) {
  left: 5%;
  top: 90%;
  color: #2f8cff44;
}
.finger-tracks {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 34%;
  height: 48%;
  --card-h: clamp(150px, 21vh, 250px);
  --card-w: calc(var(--card-h) * 0.85);
}
.finger-lane {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--card-h);
  border-radius: 100px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, #2f8cff22, #ffffff99);
  border: 2px dashed #2f8cff66;
  top: 25%;
}
.finger-lane.right {
  top: 75%;
  background: linear-gradient(90deg, #ff4d5e22, #ffffff99);
  border-color: #ff4d5e66;
}
.finger-lane > span {
  position: absolute;
  left: 8px;
  top: 50%;
  font-weight: 800;
  color: #1765c5;
  writing-mode: vertical-lr;
  transform: translateY(-50%);
}
.finger-lane.right > span {
  color: #c72840;
}
.gesture-card,
.gesture-frame {
  position: absolute;
  box-sizing: border-box;
  width: var(--card-w);
  height: var(--card-h);
  transform: translate(-50%, -50%);
  border-radius: 24px;
}
.gesture-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fffffff5;
  border: 3px solid #2f8cff;
  box-shadow: 0 8px 18px #415b7130;
  z-index: 3;
}
.gesture-card[data-hand="R"] {
  border-color: #ff4d5e;
}
.gesture-card[data-hand="B"] {
  border-color: #e7ab00;
  width: calc(var(--card-w) * 1.55);
}
.gesture-card svg {
  height: 70%;
  flex-shrink: 0;
  max-width: 95%;
}
.gesture-card strong {
  font-size: clamp(22px, 2.8vh, 34px);
  line-height: 1.2;
}
.gesture-card small {
  font-size: clamp(13px, 1.5vh, 19px);
  color: #535d72;
}
.gesture-frame {
  left: 22%;
  top: 25%;
  outline: 5px solid #2f8cff;
  outline-offset: 4px;
  background: #ffffff77;
}
.gesture-frame.right {
  top: 75%;
  outline-color: #ff4d5e;
}
.gesture-frame.both {
  top: 50%;
  width: calc(var(--card-w) * 1.55);
  outline-color: #d8a000;
}
body[data-state="position"] .finger-tracks,
body[data-state="loading"] .finger-tracks {
  opacity: 0.1;
}
[data-scene="fingers"] .command-box {
  top: 17%;
}
[data-scene="fingers"] .feedback {
  top: 82%;
  font-size: 7vh;
}
[data-scene="fingers"] .loading-cover {
  display: flex;
  align-items: center;
  justify-content: space-around;
}
[data-scene="fingers"] .loading-cover svg {
  width: 38%;
}
.finger-mode-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.finger-mode-links a {
  color: #245995;
  font-size: 14px;
  text-decoration: none;
  background: #edf6ff;
  border-radius: 10px;
  padding: 7px;
}
[data-finger-mode="elder"] .command {
  font-size: clamp(40px, 8vh, 96px);
}
[data-finger-mode="elder"] .gesture-card strong {
  font-size: clamp(25px, 3.2vh, 40px);
}
#world[data-fx="perfect"] .gesture-frame {
  box-shadow:
    0 0 0 18px #ffc92944,
    0 0 0 40px #ff5fa222;
}
#world[data-fx="great"] .gesture-frame {
  box-shadow: 0 0 0 14px #2ed9a355;
}
#world[data-fx="good"] .gesture-frame {
  box-shadow: 0 0 0 9px #fff9;
}
body[data-impact="off"] .gesture-frame {
  box-shadow: none !important;
}
#mode-notice {
  color: #176b68;
  font-weight: bold;
}
@media (min-height: 1000px) {
  .finger-tracks {
    --card-h: 230px;
  }
}
@media (orientation: portrait) {
  .finger-tracks {
    left: 5%;
    right: 5%;
    top: 34%;
    height: 46%;
    --card-h: 126px;
    --card-w: 112px;
  }
  .finger-lane {
    left: 25%;
    right: auto;
    top: 0;
    width: var(--card-w);
    height: 100%;
    transform: translateX(-50%);
    border-radius: 50px;
  }
  .finger-lane.right {
    left: 75%;
    top: 0;
  }
  .finger-lane > span {
    writing-mode: horizontal-tb;
    left: 12px;
    top: 5px;
    transform: none;
    font-size: 14px;
  }
  .gesture-frame {
    left: 25%;
    top: 72%;
    outline-width: 4px;
    outline-offset: 2px;
  }
  .gesture-frame.right {
    left: 75%;
    top: 72%;
  }
  .gesture-frame.both {
    left: 50%;
    top: 72%;
  }
  .gesture-card {
    border-radius: 18px;
  }
  .gesture-card strong {
    font-size: 22px;
  }
  .gesture-card small {
    font-size: 12px;
  }
  [data-scene="fingers"] .command-box {
    top: 18%;
  }
  [data-scene="fingers"] .command {
    font-size: clamp(34px, 5vh, 48px);
  }
  [data-scene="fingers"] .feedback {
    top: 78%;
    font-size: 6vh;
  }
  [data-scene="fingers"] .footer-note {
    font-size: 11px;
  }
  [data-scene="fingers"] .result-counts {
    font-size: 12px;
    gap: 3px 8px;
  }
}
@media (max-height: 450px) and (orientation: landscape) {
  .finger-tracks {
    --card-h: 95px;
    --card-w: 95px;
    top: 30%;
    height: 55%;
  }
  .gesture-card strong {
    font-size: 16px;
  }
  .gesture-card small {
    font-size: 10px;
  }
}
.finger-confetti {
  position: fixed;
  left: 27%;
  top: 56%;
  z-index: 4;
  pointer-events: none;
}
.finger-confetti i {
  position: absolute;
  width: 10px;
  height: 18px;
  border-radius: 3px;
  opacity: 0;
}
.finger-confetti.active[data-tier="perfect"] i,
.finger-confetti.active[data-tier="great"] i {
  animation: finger-burst 0.75s ease-out;
}
.finger-confetti[data-tier="great"] i:nth-child(n + 9) {
  display: none;
}
@keyframes finger-burst {
  0% {
    opacity: 1;
    transform: rotate(var(--angle)) translateX(0);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--angle)) translateX(var(--distance)) rotate(180deg);
  }
}
body.reduced .finger-confetti,
body[data-impact="off"] .finger-confetti {
  display: none;
}
body[data-impact="weak"] .finger-confetti i:nth-child(n + 7) {
  display: none;
}
@media (orientation: portrait) {
  .finger-confetti {
    left: 50%;
    top: 67%;
  }
}

@media (orientation: portrait) {
  /* Upcoming cards enter inside their tracks, below the spoken command. */
  .finger-tracks {
    clip-path: inset(0 -20px -40px -20px);
  }
}
.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.preset-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding: 18px;
  min-height: 125px;
}
.preset-card strong {
  font-size: 26px;
}
.preset-card span {
  font-size: 16px;
}
.preset-card small {
  font-size: 14px;
}
.preset-card[aria-pressed="true"] {
  outline: 3px solid #2f8cff;
  background: #e4f4ff;
}
#position .sheet {
  max-height: 94vh;
  overflow: auto;
  width: min(1000px, 94vw);
}
.preset-picker h2 {
  font-size: 28px;
  margin: 8px 0 16px;
}
.course-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
}
.course-controls select,
.course-editor select,
.course-editor input {
  font-size: 18px;
  max-width: 100%;
}
.course-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.course-editor h2,
.gesture-options {
  width: 100%;
}
.course-editor > label {
  display: flex;
  flex-direction: column;
  width: 44%;
}
.gesture-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.gesture-options label {
  background: #edf6ff;
  border-radius: 12px;
  padding: 8px;
  display: flex;
  align-items: center;
  flex-direction: column;
}
.gesture-options svg {
  height: 65px;
  max-width: 90px;
}
#hand-quality {
  position: fixed;
  right: 12px;
  bottom: 55px;
  z-index: 30;
  background: #fffffff0;
  border-radius: 12px;
  padding: 10px;
  font-size: 14px;
  max-width: 270px;
  box-shadow: 0 3px 16px #26385822;
}
#hand-quality summary {
  cursor: pointer;
}
.finger-tracks[data-single="L"] .finger-lane.right,
.finger-tracks[data-single="R"] .finger-lane.left {
  display: none;
}
.finger-tracks[data-single="L"],
.finger-tracks[data-single="R"] {
  --card-h: clamp(180px, 30vh, 340px);
}
.finger-tracks[data-single="L"] .finger-lane.left,
.finger-tracks[data-single="R"] .finger-lane.right,
.finger-tracks[data-single="L"] .gesture-frame.left,
.finger-tracks[data-single="R"] .gesture-frame.right {
  top: 50%;
}
[data-finger-mode="elder"] .finger-tracks {
  --card-h: 30vh;
  --card-w: calc(var(--card-h) * 0.85);
  height: 60%;
  top: 30%;
}
[data-finger-mode="kids"] {
  background: linear-gradient(135deg, #fff2a0, #ffc5ec, #94f3e4);
}
.silent-course .command {
  font-size: clamp(40px, 7vh, 90px);
}
.rehab-results {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 16px;
}
@media (orientation: portrait) {
  .preset-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .preset-card {
    min-height: 108px;
    padding: 12px;
    gap: 6px;
  }
  .preset-card strong {
    font-size: 22px;
  }
  .preset-card span,
  .preset-card small {
    font-size: 12px;
  }
  .gesture-options {
    grid-template-columns: repeat(3, 1fr);
  }
  .finger-tracks[data-single="L"],
  .finger-tracks[data-single="R"] {
    --card-h: 180px;
    --card-w: 155px;
  }
  .finger-tracks[data-single="L"] .finger-lane.left,
  .finger-tracks[data-single="R"] .finger-lane.right {
    left: 50%;
    top: 0;
  }
  .finger-tracks[data-single="L"] .gesture-frame.left,
  .finger-tracks[data-single="R"] .gesture-frame.right {
    left: 50%;
    top: 72%;
  }
  #hand-quality {
    bottom: 45px;
    font-size: 11px;
    max-width: 200px;
    padding: 7px;
  }
}
/* The preset picker uses document flow; the old full-body calibration overlay does not apply here. */
[data-scene="fingers"] #position .sheet {
  height: auto;
  padding: 24px;
  padding-bottom: 28px;
}
[data-scene="fingers"] #position-title {
  font-size: 26px;
  margin: 18px 0 8px;
}
[data-scene="fingers"] #position-note {
  margin: 8px 0;
}
[data-scene="fingers"] #position #range-list,
[data-scene="fingers"] #position #start-button,
[data-scene="fingers"] #position #skip-range,
[data-scene="fingers"] #position #position-layout,
[data-scene="fingers"] #position .sim-label {
  position: static;
  width: auto;
  margin: 8px 8px 8px 0;
}
[data-scene="fingers"] #position #start-button {
  display: none;
}
[data-scene="fingers"] #position #range-list {
  font-size: 13px;
}
[data-scene="fingers"][data-state="position"] #camera,
[data-scene="fingers"][data-state="position"] #skeleton-window {
  visibility: hidden;
}
[data-scene="fingers"][data-state="position"] #hand-quality {
  bottom: 8px;
  right: 8px;
}
.finger-tracks.vertical .finger-lane {
  left: 25%;
  right: auto;
  top: 0;
  width: var(--card-w);
  height: 100%;
  transform: translateX(-50%);
}
.finger-tracks.vertical .finger-lane.right {
  left: 75%;
}
.finger-tracks.vertical .gesture-frame {
  left: 25%;
  top: 72%;
}
.finger-tracks.vertical .gesture-frame.right {
  left: 75%;
}
.finger-tracks.vertical .gesture-frame.both {
  left: 50%;
}
.finger-tracks.vertical[data-single="L"] .finger-lane.left,
.finger-tracks.vertical[data-single="R"] .finger-lane.right {
  left: 50%;
  top: 0;
}
.finger-tracks.vertical[data-single="L"] .gesture-frame.left,
.finger-tracks.vertical[data-single="R"] .gesture-frame.right {
  left: 50%;
  top: 72%;
}
@media (max-width: 600px) {
  [data-scene="fingers"] #position .sheet {
    padding: 16px;
    padding-bottom: 45px;
  }
  [data-scene="fingers"] #position-title {
    font-size: 22px;
  }
  .course-controls {
    gap: 10px;
    font-size: 14px;
  }
  .preset-picker h2 {
    font-size: 24px;
  }
}
[data-scene="fingers"][data-state="position"].layout-editing #camera,
[data-scene="fingers"][data-state="position"].layout-editing #skeleton-window {
  visibility: visible;
}
#position .sheet:has(.course-editor) > :not(.course-editor) {
  display: none !important;
}
.course-editor {
  padding-bottom: 40px;
}
.course-editor h2 {
  margin: 0 0 10px;
  font-size: 28px;
}
body:has(.course-editor) #hand-quality {
  display: none;
}
body:has(#result:not([hidden])) #hand-quality {
  display: none;
}
#rehab-actions {
  border: 1px solid #bdd9ed;
  border-radius: 12px;
  margin-top: 12px;
}
#rehab-actions label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 8px;
}
[data-finger-mode="kids"] .finger-garden {
  background: linear-gradient(145deg, #ffe7a3, #ffd3ed 50%, #a8f2e4);
}
[data-finger-mode="kids"] .finger-garden i {
  color: #ff73a8;
  font-size: 5vw;
}
@media (orientation: portrait) {
  [data-finger-mode="elder"] .finger-tracks {
    --card-h: 30vh;
    --card-w: calc(var(--card-h) * 0.85);
  }
}
@media (orientation: portrait) {
  [data-scene="fingers"][data-state="playing"] #hand-quality {
    left: 8px;
    right: auto;
    bottom: 150px;
    max-width: 180px;
  }
}
@media (orientation: landscape) and (min-height: 600px) {
  [data-finger-mode="elder"] .finger-tracks {
    top: 38%;
    height: 54%;
  }
}
@media (orientation: portrait) {
  [data-finger-mode="elder"] .finger-tracks {
    --card-w: 40vw;
  }
}
/* R2: bounded start workspace, live preview and large gesture controls. */
[data-scene="fingers"] #position {
  padding: 24px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: center;
}
[data-scene="fingers"] #position[hidden] {
  display: none;
}
[data-scene="fingers"] #position .sheet {
  width: 100%;
  max-height: calc(100dvh - 48px);
  padding: 20px;
  overflow: visible;
}
#position .eyebrow,
#position #position-title,
#position #position-note,
#position #range-list,
#position .sim-label {
  display: none;
}
.preset-grid {
  gap: 8px;
}
.preset-card {
  min-height: 100px;
  padding: 12px;
  gap: 4px;
}
.preset-card strong {
  font-size: 23px;
}
.preset-card span {
  font-size: 14px;
}
#custom-course {
  margin-top: 12px;
}
.course-controls {
  gap: 12px;
  margin-top: 10px;
  align-items: center;
}
.course-controls > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
button,
[role="button"] {
  touch-action: manipulation;
}
#position button,
#position [role="button"] {
  min-height: 48px;
  min-width: 48px;
}
.segments-control {
  display: flex;
  gap: 3px;
}
.segments-control button {
  padding: 6px 10px;
  font-size: 16px;
  border: 2px solid transparent;
}
.segments-control button[aria-pressed="true"] {
  border-color: #2f8cff;
  background: #def0ff;
  color: #174e90;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stepper button {
  min-width: 48px;
  padding: 6px;
  font-size: 24px;
}
.stepper output {
  min-width: 40px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
}
.switch-control button {
  border-radius: 32px;
  padding: 6px 18px;
  font-size: 16px;
}
.switch-control [aria-checked="true"] {
  background: #d0f5e9;
  color: #096d58;
}
#start-preview {
  align-self: center;
  min-width: 0;
}
.preview-image {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: #172c43;
  aspect-ratio: 16/9;
}
#start-camera {
  width: 100%;
  height: 100%;
  display: block;
}
#start-progress {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 132px;
  height: 132px;
  border-radius: 50%;
  padding: 9px;
  background: conic-gradient(#2ed9a3 var(--progress, 0deg), #ffffff55 0);
}
#start-progress strong {
  display: grid;
  place-content: center;
  height: 100%;
  border-radius: 50%;
  background: #172c43d9;
  color: white;
  text-align: center;
  font-size: 22px;
}
#detected-hands {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 12px;
}
#detected-hands span {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 800;
  color: white;
}
.hand-L {
  background: #1765c5;
}
.hand-R {
  background: #b92940;
}
#start-preview #hand-quality {
  position: static;
  display: block;
  max-width: none;
  margin-top: 10px;
  font-size: 16px;
}
#hand-quality summary {
  min-height: 28px;
}
[data-scene="fingers"] #range-risk {
  font-size: 16px;
  padding: 8px 14px;
  border-radius: 24px;
  bottom: 8px;
}
[data-scene="fingers"][data-state="playing"] #hand-quality {
  left: 20px;
  right: auto;
  bottom: 180px;
  max-width: 280px;
}
.course-editor {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0;
}
.course-editor h2,
.course-editor .gesture-options,
.course-editor [role="status"] {
  grid-column: 1/-1;
  width: auto;
  margin: 0;
}
.course-editor > label {
  width: auto;
  gap: 4px;
  font-size: 16px;
}
.course-editor > label:has([name="name"]),
.course-editor > label:has([name="hands"]) {
  grid-column: span 2;
}
.course-editor input[name="name"] {
  min-height: 48px;
  width: 100%;
  border: 2px solid #bdd9ed;
  border-radius: 12px;
  padding: 6px;
}
#position:has(.course-editor) {
  grid-template-columns: 1fr;
}
#position:has(.course-editor) .sheet {
  width: min(1100px, 100%);
  justify-self: center;
}
#position:has(.course-editor) #start-preview {
  display: none;
}
.gesture-options {
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.gesture-options label,
#rehab-actions label {
  position: relative;
  border: 2px solid transparent;
  cursor: pointer;
}
.gesture-options label:has(:checked),
#rehab-actions label:has(:checked) {
  border-color: #2f8cff;
  background: #deefff;
}
.gesture-options label:has(:checked)::after,
#rehab-actions label:has(:checked)::after {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 4px;
}
.gesture-options input,
#rehab-actions input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.gesture-options label:has(:disabled) {
  opacity: 0.4;
}
.gesture-options svg {
  height: 48px;
}
.gesture-options span {
  font-size: 14px;
}
#rehab-actions {
  margin: 8px 0 0;
  padding: 4px;
}
#rehab-actions label {
  min-height: 48px;
  margin: 2px;
  padding: 6px;
  font-size: 14px;
  border-radius: 10px;
}
.counting .finger-lane {
  display: none !important;
}
.finger-tracks.counting .gesture-frame {
  left: 50%;
  top: 50%;
  width: var(--card-w);
}
.finger-tracks.counting {
  --card-h: clamp(280px, 43vh, 440px);
  --card-w: calc(var(--card-h) * 0.85);
}
.count-current svg {
  height: 40%;
}
.count-current .rep-ring {
  display: grid;
  place-content: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, white 83%, transparent 85%),
    conic-gradient(#2ed9a3 var(--progress, 0deg), #dce9ee 0);
  font-size: 28px;
  font-weight: 900;
  margin-top: 8px;
}
.count-next {
  scale: 0.5;
  transform-origin: 0 0;
}
@media (orientation: portrait) {
  [data-scene="fingers"] #position {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px;
    gap: 10px;
  }
  #start-preview {
    order: -1;
    width: 100%;
  }
  .preview-image {
    aspect-ratio: auto;
    height: 190px;
  }
  #start-progress {
    width: 100px;
    height: 100px;
    padding: 6px;
  }
  #start-progress strong {
    font-size: 17px;
  }
  #detected-hands span {
    font-size: 15px;
    padding: 4px 8px;
  }
  #start-preview #hand-quality {
    font-size: 14px;
    padding: 6px 10px;
    margin-top: 4px;
  }
  #start-preview #hand-quality summary {
    min-height: 20px;
  }
  [data-scene="fingers"] #position .sheet {
    padding: 12px;
    max-height: none;
  }
  .preset-picker h2 {
    font-size: 22px;
    margin: 0 0 8px;
  }
  .preset-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .preset-card {
    min-height: 72px;
    padding: 8px;
    gap: 2px;
  }
  .preset-card strong {
    font-size: 19px;
  }
  .preset-card small {
    font-size: 12px;
  }
  #custom-course {
    margin-top: 6px;
  }
  .course-controls {
    gap: 6px;
    margin-top: 4px;
    font-size: 14px;
  }
  .course-controls > label {
    gap: 2px;
  }
  .segments-control button {
    padding: 4px 8px;
    font-size: 15px;
  }
  #position #skip-range,
  #position #position-layout {
    margin: 4px 4px 0 0;
    padding: 6px 10px;
    font-size: 16px;
  }
  .course-editor {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .course-editor > label:has([name="name"]),
  .course-editor > label:has([name="hands"]) {
    grid-column: span 2;
  }
  .course-editor > label:has([name="windowScale"]) {
    grid-column: span 2;
  }
  .course-editor h2 {
    font-size: 23px;
  }
  .gesture-options {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }
  .gesture-options label {
    padding: 3px;
  }
  .gesture-options svg {
    height: 32px;
  }
  .gesture-options span {
    font-size: 12px;
  }
  .course-editor [role="status"]:empty {
    display: none;
  }
  .course-editor > label:has([name="muted"]) {
    flex-direction: row;
    align-items: center;
    grid-column: span 2;
  }
  [data-scene="fingers"][data-state="playing"] #camera,
  [data-scene="fingers"][data-state="playing"] #skeleton-window {
    display: none;
  }
  [data-scene="fingers"][data-state="playing"] #toolbar {
    left: auto;
    right: 8px;
    bottom: 40px;
    top: auto;
    gap: 4px;
  }
  [data-scene="fingers"][data-state="playing"] #toolbar button {
    min-width: 48px;
    height: 48px;
    padding: 4px;
    font-size: 14px;
  }
  [data-scene="fingers"] #combo {
    left: 8px;
    bottom: 40px;
    height: 48px;
    display: flex;
    align-items: center;
    font-size: 18px;
  }
  [data-scene="fingers"] #meter {
    left: 86px;
    bottom: 40px;
    height: 48px;
    padding: 4px;
    display: flex;
    align-items: center;
    font-size: 14px;
  }
  [data-scene="fingers"][data-state="playing"] #hand-quality {
    left: 8px;
    bottom: 100px;
    font-size: 14px;
    max-width: 260px;
  }
  [data-scene="fingers"] .footer-note {
    left: 8px;
    bottom: 10px;
    font-size: 12px;
  }
  .finger-tracks.counting {
    --card-h: 280px;
    --card-w: 210px;
    top: 34%;
    height: 46%;
    clip-path: none;
  }
  .counting .count-next {
    left: 84% !important;
    top: 2% !important;
    scale: 0.3;
  }
  [data-scene="fingers"] #range-risk {
    bottom: 145px;
    max-width: 94vw;
  }
}
.editor-tabs {
  display: none;
}
@media (orientation: portrait) {
  .course-editor .editor-tabs {
    display: flex;
    gap: 8px;
    grid-column: 1/-1;
  }
  .editor-tabs [aria-pressed="true"] {
    background: #deefff;
    outline: 2px solid #2f8cff;
  }
  .course-editor[data-page="settings"] .gesture-options,
  .course-editor[data-page="gestures"] > label {
    display: none;
  }
  .course-editor[data-page="gestures"] .gesture-options {
    grid-template-columns: repeat(3, 1fr);
  }
  .course-editor[data-page="gestures"] .gesture-options svg {
    height: 46px;
  }
  .course-editor[data-page="gestures"] .gesture-options label {
    min-height: 70px;
  }
}
@media (orientation: portrait) {
  [data-scene="fingers"] #combo {
    right: auto;
    width: 72px;
    padding: 0;
  }
  [data-scene="fingers"] #meter {
    right: auto;
    width: auto;
  }
}
@media (orientation: portrait) and (max-height: 800px) {
  .preview-image {
    height: 145px;
  }
  .course-editor {
    gap: 5px;
  }
}
#rehab-actions:not([hidden]) {
  position: fixed;
  z-index: 60;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, 94vw);
  margin: 0;
  padding: 20px;
  background: white;
  border: 3px solid #2f8cff;
  box-shadow: 0 0 0 100vmax #172c4366;
}
#rehab-actions legend {
  background: white;
  border-radius: 12px;
  padding: 8px;
  font-size: 20px;
}
#rehab-actions #rehab-reps {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}
.preset-card[hidden] {
  display: none;
}
@media (orientation: portrait) {
  .course-controls .segments-control button {
    min-width: 48px;
    padding: 4px 5px;
  }
  .course-controls .switch-control button {
    padding: 4px 8px;
    font-size: 14px;
  }
  .course-controls > label:has(#silent-course) {
    font-size: 12px;
  }
}
@media (orientation: landscape) {
  [data-scene="fingers"][data-state="playing"] #hand-quality {
    width: calc(10vw - 16px);
    max-width: 160px;
    font-size: 14px;
  }
}
.preset-card {
  min-width: 0;
}
.preset-card strong {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.count-current .rep-ring {
  width: 128px;
  height: 128px;
  font-size: 40px;
}
@media (orientation: portrait) {
  .count-current .rep-ring {
    width: 96px;
    height: 96px;
    font-size: 32px;
  }
}
@media (orientation: portrait) {
  .preset-picker > button {
    font-size: 14px;
    padding: 8px 12px;
  }
}
#start-preview #range-risk {
  position: static;
  margin-top: 8px;
  background: #fff0cf;
  color: #6b3618;
  border: 1px solid #e0bf85;
}
@media (orientation: portrait) {
  #start-preview:has(#range-risk:not(:empty)) .preview-image {
    height: 150px;
  }
}
@media (orientation: portrait) and (max-height: 800px) {
  #start-preview:has(#range-risk:not(:empty)) .preview-image {
    height: 105px;
  }
}
.finger-tracks.counting .gesture-frame.both {
  width: calc(var(--card-w) * 1.55);
}
@media (orientation: landscape) {
  .finger-tracks.counting {
    --card-h: clamp(280px, 40vh, 440px);
    top: 37%;
    height: 44%;
  }
}
body[data-rhythm="count"] .finger-confetti {
  display: none;
}
body[data-rhythm="count"] #world .gesture-frame {
  box-shadow: 0 0 0 8px #2ed9a322;
}
body[data-rhythm="count"] .feedback {
  font-size: 28px;
  top: 84%;
}
.preview-camera-toggle {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 10px;
  background: #fff8ee;
  color: #243550;
  font-size: 13px;
}
