/* Shared interaction feedback. Scale is independent of existing layout transforms. */
:where(button, input[type="button"], input[type="submit"], input[type="reset"], [role="button"], a.button, summary)[data-ui-pressed="true"] {
  scale: 0.94;
  box-shadow: none !important;
}

/* Replace older active translate/scale rules so the requested scale stays exactly .94. */
:is(button, input[type="button"], input[type="submit"], input[type="reset"], [role="button"], a.button, summary):active:not(:disabled) {
  transform: none !important;
}

.schedule-editor-grid .field-switch input[type="checkbox"] {
  position: relative;
  background-image: none;
  transition: background-color 280ms ease, border-color 280ms ease;
}
.schedule-editor-grid .field-switch input[type="checkbox"]:checked {
  background-image: none;
  background-color: var(--blue);
}
.schedule-editor-grid .field-switch input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(23 56 80 / 20%);
  transform: translateX(0);
  transition: transform 280ms ease;
}
.schedule-editor-grid .field-switch input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}

.reassign-send-notice-switch,
.create-switch input + span {
  transition: background-color 280ms ease, border-color 280ms ease;
}
.reassign-send-notice-toggle input:checked + .reassign-send-notice-switch {
  background-color: var(--blue);
}
.reassign-send-notice-switch::after,
.create-switch input + span::after {
  transition: transform 280ms ease;
}
.create-switch:has(input:disabled) {
  opacity: .56;
  cursor: not-allowed;
}

/* Stretch is enabled by change events; initial render has no animation.
   Travel lasts 280ms. The thumb stretches to 1.35 during travel, then returns
   with unit mass, stiffness 200 and damping 14. Samples every 1/30 second
   use 1 + .35*exp(-7t)*(cos(sqrt(151)t)+7/sqrt(151)*sin(sqrt(151)t)).
   Separate names restart feedback when a switch reverses quickly. */
.schedule-editor-grid .field-switch input[data-ui-switch-motion="on"]:checked::before,
.reassign-send-notice-toggle input[data-ui-switch-motion="on"]:checked + .reassign-send-notice-switch::after,
.create-switch input[data-ui-switch-motion="on"]:checked + span::after {
  animation: ui-switch-on 1480ms linear;
}
.schedule-editor-grid .field-switch input[data-ui-switch-motion="off"]:not(:checked)::before,
.reassign-send-notice-toggle input[data-ui-switch-motion="off"]:not(:checked) + .reassign-send-notice-switch::after,
.create-switch input[data-ui-switch-motion="off"]:not(:checked) + span::after {
  animation: ui-switch-off 1480ms linear;
}

@keyframes ui-switch-on {
  0% { scale: 1 1; }
  4.0541% { scale: 1.35 1; }
  18.9189% { scale: 1.350000 1; }
  21.1712% { scale: 1.317112 1; }
  23.4234% { scale: 1.241207 1; }
  25.6757% { scale: 1.151560 1; }
  27.9279% { scale: 1.068923 1; }
  30.1802% { scale: 1.005087 1; }
  32.4324% { scale: 0.964170 1; }
  34.6847% { scale: 0.944757 1; }
  36.9369% { scale: 0.942213 1; }
  39.1892% { scale: 0.950692 1; }
  41.4414% { scale: 0.964605 1; }
  43.6937% { scale: 0.979499 1; }
  45.9459% { scale: 0.992413 1; }
  48.1982% { scale: 1.001834 1; }
  50.4505% { scale: 1.007422 1; }
  52.7027% { scale: 1.009632 1; }
  54.9550% { scale: 1.009339 1; }
  57.2072% { scale: 1.007527 1; }
  59.4595% { scale: 1.005079 1; }
  61.7117% { scale: 1.002658 1; }
  63.9640% { scale: 1.000677 1; }
  66.2162% { scale: 0.999316 1; }
  68.4685% { scale: 0.998582 1; }
  70.7207% { scale: 0.998369 1; }
  72.9730% { scale: 0.998520 1; }
  75.2252% { scale: 0.998872 1; }
  77.4775% { scale: 0.999290 1; }
  79.7297% { scale: 0.999676 1; }
  81.9820% { scale: 0.999974 1; }
  84.2342% { scale: 1.000166 1; }
  86.4865% { scale: 1.000257 1; }
  88.7387% { scale: 1.000269 1; }
  90.9910% { scale: 1.000230 1; }
  93.2432% { scale: 1.000166 1; }
  95.4955% { scale: 1.000096 1; }
  97.7477% { scale: 1.000036 1; }
  100.0000% { scale: 1.000000 1; }
}

@keyframes ui-switch-off {
  0% { scale: 1 1; }
  4.0541% { scale: 1.35 1; }
  18.9189% { scale: 1.350000 1; }
  21.1712% { scale: 1.317112 1; }
  23.4234% { scale: 1.241207 1; }
  25.6757% { scale: 1.151560 1; }
  27.9279% { scale: 1.068923 1; }
  30.1802% { scale: 1.005087 1; }
  32.4324% { scale: 0.964170 1; }
  34.6847% { scale: 0.944757 1; }
  36.9369% { scale: 0.942213 1; }
  39.1892% { scale: 0.950692 1; }
  41.4414% { scale: 0.964605 1; }
  43.6937% { scale: 0.979499 1; }
  45.9459% { scale: 0.992413 1; }
  48.1982% { scale: 1.001834 1; }
  50.4505% { scale: 1.007422 1; }
  52.7027% { scale: 1.009632 1; }
  54.9550% { scale: 1.009339 1; }
  57.2072% { scale: 1.007527 1; }
  59.4595% { scale: 1.005079 1; }
  61.7117% { scale: 1.002658 1; }
  63.9640% { scale: 1.000677 1; }
  66.2162% { scale: 0.999316 1; }
  68.4685% { scale: 0.998582 1; }
  70.7207% { scale: 0.998369 1; }
  72.9730% { scale: 0.998520 1; }
  75.2252% { scale: 0.998872 1; }
  77.4775% { scale: 0.999290 1; }
  79.7297% { scale: 0.999676 1; }
  81.9820% { scale: 0.999974 1; }
  84.2342% { scale: 1.000166 1; }
  86.4865% { scale: 1.000257 1; }
  88.7387% { scale: 1.000269 1; }
  90.9910% { scale: 1.000230 1; }
  93.2432% { scale: 1.000166 1; }
  95.4955% { scale: 1.000096 1; }
  97.7477% { scale: 1.000036 1; }
  100.0000% { scale: 1.000000 1; }
}

/* These control effects are intentionally always enabled. Override the page-wide
   reduced-motion duration rules only for the switch track and thumb. */
.schedule-editor-grid .field-switch input[type="checkbox"],
.reassign-send-notice-switch,
.create-switch input + span,
.schedule-editor-grid .field-switch input[type="checkbox"]::before,
.reassign-send-notice-switch::after,
.create-switch input + span::after {
  transition-duration: 280ms !important;
}
.schedule-editor-grid .field-switch input[type="checkbox"]::before,
.reassign-send-notice-switch::after,
.create-switch input + span::after {
  animation-duration: 1480ms !important;
}

/* Confirmation stays beside its originating control, without an overlay. */
[data-confirmation-pending="true"] {
  color: #8d2d20 !important;
  background: #fff1df !important;
  border-color: #c77a3c !important;
}
.button-confirmation-hint {
  display: flex;
  flex: 1 1 100%;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  max-width: 620px;
  padding: 9px 11px;
  border: 1px solid #e5c9a5;
  border-radius: 7px;
  color: #754b26;
  background: #fff8ed;
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}
.button-confirmation-hint > span { min-width: 0; }
.button-confirmation-hint > button { flex: 0 0 auto; }
