/* SquishSwitch style adapted to the existing native checkbox in the dictionary. */
.dictionary-search-options.squish-switch-root {
  --ss-w: 62px;
  --ss-h: 32px;
  --ss-inset: 4px;
  --ss-thumb: 24px;
  --ss-travel: 30px;
  --ss-track: #18323c;
  --ss-track-on: #63d5e4;
  --ss-thumb-color: #9fc5cd;
  --ss-thumb-on: #12323b;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 2px 6px;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.dictionary-search-options .squish-switch__input {
  position: absolute;
  top: 50%;
  left: 6px;
  z-index: 1;
  width: var(--ss-w);
  height: var(--ss-h);
  margin: 0;
  transform: translateY(-50%);
  opacity: 0;
  cursor: pointer;
  touch-action: pan-y;
}
.dictionary-search-options .squish-switch__track {
  position: relative;
  display: block;
  flex: none;
  width: var(--ss-w);
  height: var(--ss-h);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: calc(var(--ss-h) / 2);
  background: var(--ss-track);
  box-sizing: border-box;
  transition: background-color 320ms ease, border-color 320ms ease;
}
.dictionary-search-options .squish-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: var(--ss-thumb);
  height: var(--ss-thumb);
  border-radius: 50%;
  background: var(--ss-thumb-color);
  box-shadow: 0 1px 4px #0004;
  transform: translateX(0);
  transition: background-color 320ms ease, transform 300ms cubic-bezier(.23, 1, .32, 1);
}
.dictionary-search-options .squish-switch__input:checked + .squish-switch__track { background: var(--ss-track-on); border-color: var(--ss-track-on); }
.dictionary-search-options .squish-switch__input:checked + .squish-switch__track .squish-switch__thumb { background: var(--ss-thumb-on); transform: translateX(var(--ss-travel)); }
.dictionary-search-options.is-squishing-on .squish-switch__thumb { animation: dictionary-squish-on 390ms cubic-bezier(.23, 1, .32, 1) both; }
.dictionary-search-options.is-squishing-off .squish-switch__thumb { animation: dictionary-squish-off 390ms cubic-bezier(.23, 1, .32, 1) both; }
.dictionary-search-options .squish-switch__copy { display: grid; gap: 1px; line-height: 1.35; }
.dictionary-search-options .squish-switch__copy strong { color: var(--ink); font-size: 13px; font-weight: 650; }
.dictionary-search-options .squish-switch__copy small { color: var(--muted); font-size: 11px; }
.dictionary-search-options .squish-switch__input:focus-visible + .squish-switch__track { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .dictionary-search-options:hover .squish-switch__thumb { scale: 1.035; }
}
html[data-theme="day"] .dictionary-search-options.squish-switch-root {
  --ss-track: #dceaf0;
  --ss-track-on: #2786a2;
  --ss-thumb-color: #f8fcfd;
  --ss-thumb-on: #fff;
}
@keyframes dictionary-squish-on {
  0% { transform: translateX(0) scale(1, 1); }
  42% { transform: translateX(calc(var(--ss-travel) * .62)) scale(1.33, .76); }
  72% { transform: translateX(calc(var(--ss-travel) * 1.035)) scale(.94, 1.07); }
  100% { transform: translateX(var(--ss-travel)) scale(1, 1); }
}
@keyframes dictionary-squish-off {
  0% { transform: translateX(var(--ss-travel)) scale(1, 1); }
  42% { transform: translateX(calc(var(--ss-travel) * .38)) scale(1.33, .76); }
  72% { transform: translateX(calc(var(--ss-travel) * -.035)) scale(.94, 1.07); }
  100% { transform: translateX(0) scale(1, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .dictionary-search-options .squish-switch__track,
  .dictionary-search-options .squish-switch__thumb { transition: none; }
  .dictionary-search-options.is-squishing-on .squish-switch__thumb,
  .dictionary-search-options.is-squishing-off .squish-switch__thumb { animation: none; }
}
