/* Shared physical-control and native-slider language for the main instrument and Console. */
button,
a.mode-button,
summary,
input[type="button"],
input[type="submit"] {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
a.mode-button,
summary {
  transition: transform var(--mmf-motion-press) linear,
    box-shadow var(--mmf-motion-press) linear,
    background-color var(--mmf-motion-toggle) linear,
    color var(--mmf-motion-toggle) linear;
}

@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):hover,
  a.mode-button:hover,
  summary:hover {
    transform: translate(-1px, -1px);
  }
}

button:not(:disabled):active,
a.mode-button:active,
summary:active {
  transform: translate(2px, 2px);
  box-shadow: var(--mmf-shadow-pressed);
}

button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

button[aria-pressed="true"],
button.active,
a.mode-button[aria-current="page"] {
  transform: translate(2px, 2px);
  box-shadow: var(--mmf-shadow-pressed);
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: var(--mmf-focus-ring) solid var(--cyan);
  outline-offset: 3px;
}

input[type="range"] {
  min-height: var(--mmf-target-size);
  width: 100%;
  accent-color: var(--purple);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: var(--mmf-slider-track-size);
}

input[type="range"]::-webkit-slider-thumb {
  width: var(--mmf-slider-thumb-size);
  height: var(--mmf-slider-thumb-size);
  margin-top: calc((var(--mmf-slider-track-size) - var(--mmf-slider-thumb-size)) / 2);
}

input[type="range"]::-moz-range-track {
  height: var(--mmf-slider-track-size);
}

input[type="range"]::-moz-range-thumb {
  width: var(--mmf-slider-thumb-size);
  height: var(--mmf-slider-thumb-size);
}

body.mmf-main-page input[type="range"]::-webkit-slider-runnable-track {
  background: linear-gradient(90deg, var(--cyan) 0 var(--range-progress, 0%), var(--surface-3) var(--range-progress, 0%) 100%);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
}

body.mmf-main-page input[type="range"]::-moz-range-track {
  background: linear-gradient(90deg, var(--cyan) 0 var(--range-progress, 0%), var(--surface-3) var(--range-progress, 0%) 100%);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
}

.mmf-readonly-meter {
  cursor: default;
  opacity: .78;
  pointer-events: none;
}

.mmf-parameter {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mmf-parameter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
}

.mmf-parameter-head label,
.mmf-parameter-head .mmf-parameter-label {
  min-width: 0;
  color: inherit;
  font-weight: 800;
}

.mmf-parameter-head output,
.mmf-parameter-value {
  min-width: 4.5ch;
  color: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.mmf-parameter-control {
  min-height: var(--mmf-target-size);
  display: flex;
  align-items: center;
}

.mmf-parameter-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.mmf-range-value {
  min-width: 4.5ch;
  justify-self: end;
  color: inherit;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
