/* Tool lab: a pretend checkup bench. The oak counter and teal case come from the tray art; the
   practice teeth are drawn to sit on the same counter. Every rule is scoped to .tool-lab. */

.tool-lab {
  --tl-ink: #173c38;
  --tl-ink-soft: #3d5b53;
  --tl-paper: #fffcf1;
  --tl-line: #d4d9bf;
  --tl-oak: #cf8442;
  --tl-oak-deep: #a95f27;
  --tl-case: #1f9483;
  --tl-case-deep: #136a5e;
  --tl-sun: #ffd45c;
  --tl-sky: #5bb8e6;
  --tl-go: #185b50;
  --tl-focus: #194fac;
  container: toollab / inline-size;
  position: relative;
  width: 100%;
  color: var(--tl-ink);
  background: var(--tl-paper);
  border: 1px solid var(--tl-line);
  border-radius: 1.6rem;
  overflow: hidden;
  box-shadow: 0 0.5rem 1.7rem #283b2515;
  font-family: Nunito, ui-rounded, system-ui, sans-serif;
  line-height: 1.4;
}
.tool-lab *,
.tool-lab *::before,
.tool-lab *::after {
  box-sizing: border-box;
}
.tool-lab [hidden] {
  display: none !important;
}
.tool-lab button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tool-lab button:focus-visible {
  outline: 4px solid var(--tl-focus);
  outline-offset: 3px;
}
.tl-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  margin: 0;
}
.tl-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- top bar and instruction ---------- */
.tl-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.75rem 0;
}
.tl-ears {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.tool-lab .tl-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.4rem 0.85rem;
  border: 1.5px solid #c9d2bd;
  border-radius: 999px;
  background: #fff;
  color: var(--tl-ink);
  font-weight: 850;
  font-size: 0.95rem;
  line-height: 1;
}
.tl-chip svg {
  width: 1.3rem;
  height: 1.3rem;
  flex: none;
}
.tool-lab .tl-chip:hover {
  border-color: #9fb19a;
}
.tl-sound .tl-state {
  min-width: 1.9em;
  padding: 0.18rem 0.4rem;
  border-radius: 999px;
  background: #ecebe0;
  color: #5c665f;
  font-size: 0.78rem;
  text-align: center;
}
.tool-lab .tl-sound[aria-pressed="true"] {
  background: #e2f5ef;
  border-color: var(--tl-case);
  color: var(--tl-case-deep);
}
.tl-sound[aria-pressed="true"] .tl-state {
  background: var(--tl-case);
  color: #fff;
}
.tl-sound[aria-pressed="false"] .tl-waves,
.tl-sound[aria-pressed="true"] .tl-mute {
  display: none;
}
.tl-say {
  padding: 0.35rem 1rem 0.85rem;
  text-align: center;
}
.tool-lab .tl-title {
  margin: 0 auto 0.3rem;
  max-width: 20ch;
  font: 900 clamp(1.5rem, 5.4cqi, 2.5rem) / 1.05 Nunito, ui-rounded, system-ui, sans-serif;
  letter-spacing: -0.04em;
  color: #143e38;
  text-wrap: balance;
}
@container toollab (max-width: 520px) {
  .tool-lab .tl-title {
    min-height: 2.1em;
    display: grid;
    align-items: end;
  }
}
.tool-lab .tl-title:focus {
  outline: 0;
}
.tool-lab .tl-cue {
  margin: 0 auto;
  max-width: 44ch;
  min-height: 2.8em;
  font-size: clamp(0.98rem, 2.6cqi, 1.1rem);
  color: var(--tl-ink-soft);
  text-wrap: pretty;
}
/* The visual twin of "Hear it": the words being read light up. */
.tl-say.is-speaking .tl-title,
.tl-say.is-speaking .tl-cue {
  background: linear-gradient(transparent 62%, #ffe79a 62%) no-repeat;
  background-size: 100% 100%;
  animation: tl-read 1.4s ease-out;
}

/* ---------- the oak bench ---------- */
.tl-bench {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "model" "case" "goals";
  gap: 0.8rem;
  padding: clamp(0.7rem, 3cqi, 1.3rem);
  background:
    linear-gradient(112deg, #fff0 0 14%, #ffffff1c 14% 21%, #fff0 21% 30%, #ffffff14 30% 33%, #fff0 33%),
    repeating-linear-gradient(177deg, #0000 0 11px, #7a3f1212 11px 12px, #0000 12px 25px, #fff2 25px 26px),
    linear-gradient(180deg, #d99050, var(--tl-oak) 55%, #c0732f);
  box-shadow: inset 0 1px 0 #ffffff40, inset 0 -6px 14px #6b33100f;
  overflow: clip;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
@container toollab (min-width: 700px) {
  .tl-bench {
    grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
    grid-template-areas: "model case" "goals case";
    align-items: center;
    column-gap: clamp(1rem, 3cqi, 1.8rem);
  }
}

/* ---------- practice teeth ---------- */
.tl-model {
  grid-area: model;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  touch-action: pan-y;
}
.tl-holding .tl-model {
  touch-action: none;
  cursor: none;
}
.tl-gum,
.tl-lip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.tl-lip {
  z-index: 2;
  filter: drop-shadow(0 -1px 0 #ffffff55);
}
.tool-lab .tl-tooth {
  position: absolute;
  z-index: 1;
  width: 17.5%;
  height: 52%;
  padding: 0;
  border: 0;
  border-radius: 42% 42% 18% 18%;
  background: none;
  transform: rotate(var(--tilt, 0deg));
  transform-origin: 50% 100%;
  --shine: 0;
}
.tl-holding .tl-tooth {
  cursor: none;
}
.tool-lab .tl-tooth:focus-visible {
  outline-offset: 2px;
}
.tl-tooth-art {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 2px 0 #24524f22);
  transition: filter 0.3s;
}
.tl-dull {
  opacity: calc((1 - var(--shine)) * 0.95);
}
.tl-gloss {
  opacity: var(--shine);
}
.tl-tooth.is-shiny .tl-tooth-art {
  filter: drop-shadow(0 0 5px #fff) drop-shadow(0 0 10px #bfeeff);
}
.tl-badges {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.tl-num {
  position: absolute;
  display: none;
  place-items: center;
  width: clamp(1.45rem, 6cqi, 2.2rem);
  aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  background: var(--friend, var(--tl-case));
  box-shadow: 0 0 0 3px #fff, 0 3px 4px #24524f40;
  color: #fff;
  font-weight: 900;
  font-size: clamp(0.85rem, 3.4cqi, 1.3rem);
  line-height: 1;
}
.tl-num.is-on {
  display: grid;
}
.tl-num.is-new {
  animation: tl-count 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.tl-tooth.is-nudged {
  animation: tl-nudge 0.45s ease-in-out;
}

/* Foam bubbles sit on the teeth. White on white needs a cool rim to read. */
.tl-foam {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.tl-bubble {
  position: absolute;
  width: calc(var(--size) * 1%);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0 16%, #f6fcff 30%, #d9effa 68%, #a7d7ee 100%);
  box-shadow: inset 0 0 0 1.5px #7fbfdbb3, 0 1px 2px #1f4e6a33;
  will-change: transform, opacity;
}
.tl-bubble.is-new {
  animation: tl-grow 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.tl-bubble.is-shaky {
  animation: tl-shake 0.18s linear infinite;
}
.tl-bubble.is-fading {
  opacity: 0;
  transition: opacity 0.3s;
}

/* ---------- station goal ---------- */
.tool-lab .tl-goals {
  grid-area: goals;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tl-goal {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3.6rem;
  padding: 0.45rem 0.75rem 0.45rem 0.55rem;
  border-radius: 1rem;
  background: #fffcf1f0;
  box-shadow: 0 3px 0 #7d431a40;
  transition: background-color 0.3s;
}
.tl-goal-tool {
  flex: none;
  width: 1.3rem;
  height: 3rem;
  object-fit: contain;
  rotate: 14deg;
}
.tl-goal-text {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}
.tl-goal-text b {
  font-weight: 900;
  font-size: 0.98rem;
  line-height: 1.15;
}
.tl-pips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  min-height: 1.3rem;
}
.tl-pips:empty {
  display: none;
}
.tl-goal-status {
  margin-left: auto;
  font-weight: 850;
  font-size: 0.86rem;
  color: var(--tl-ink-soft);
  white-space: nowrap;
}
.tl-check {
  display: none;
  flex: none;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--tl-case);
  color: #fff;
}
.tl-check svg {
  width: 1rem;
  height: 1rem;
}
.tl-goal.is-met {
  background: #e6f6e4;
}
.tl-goal.is-met .tl-check {
  display: grid;
  animation: tl-count 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.tl-goal.is-waiting .tl-goal-status {
  color: #7a6a52;
  font-weight: 750;
}
.tl-pip {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border: 2px dashed #b5c0ae;
  border-radius: 50%;
  color: #8d9a88;
  font-style: normal;
  font-weight: 900;
  font-size: 0.72rem;
  line-height: 1;
}
.tl-pip.is-on {
  border: 0;
  background: var(--c, var(--tl-case));
  color: #fff;
  animation: tl-count 0.4s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.tl-pip-tooth {
  width: 1.05rem;
  height: 1.35rem;
  border: 2px solid #c6b48c;
  border-radius: 46% 46% 30% 30%;
  background: linear-gradient(to top, #8fd8f2 calc(var(--f, 0) * 100%), #efe2c2 0);
}
.tl-pip-tooth.is-on {
  border-color: #6cc7e9;
  background: #fff;
  box-shadow: 0 0 6px #9fe0ff;
  animation: none;
}
.tl-pip-bubble {
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0 20%, #d9effa 65%, #a7d7ee);
  box-shadow: inset 0 0 0 1px #7fbfdb;
}

/* ---------- the tool case ---------- */
.tl-case {
  grid-area: case;
  justify-self: center;
  width: min(100%, 27rem);
}
@container toollab (max-width: 520px) {
  .tl-case {
    width: 92%;
  }
}
@container toollab (min-width: 700px) {
  .tl-case {
    width: 100%;
  }
}
.tl-tray {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
}
.tl-tray-art {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 7% / 10%;
  -webkit-mask-image: linear-gradient(90deg, #0000, #000 3.5%, #000 96.5%, #0000), linear-gradient(#0000, #000 5%, #000 95%, #0000);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, #0000, #000 3.5%, #000 96.5%, #0000), linear-gradient(#0000, #000 5%, #000 95%, #0000);
  mask-composite: intersect;
  pointer-events: none;
}
.tool-lab .tl-slot {
  position: absolute;
  height: 68%;
  aspect-ratio: var(--a);
  padding: 0;
  border: 0;
  border-radius: 40% / 18%;
  background: none;
  translate: -50% -50%;
  touch-action: none;
  cursor: grab;
}
.tool-lab .tl-slot:active {
  cursor: grabbing;
}
.tl-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 3px #0b3d3655);
  transition: transform 0.2s ease-out, opacity 0.15s;
  pointer-events: none;
}
.tl-slot:hover img {
  transform: translateY(-3%) scale(1.02);
}
.tl-slot.is-next img {
  filter: drop-shadow(0 0 7px #fff7c7) drop-shadow(0 0 3px #fff) drop-shadow(0 4px 3px #0b3d3655);
  animation: tl-bob 1.8s ease-in-out infinite;
}
.tl-slot.is-calling img {
  animation: tl-call 0.6s ease-in-out 2;
}
.tl-slot.is-out img,
.tl-slot.is-landing img {
  opacity: 0;
  transition: none;
  animation: none;
}
.tool-lab .tl-slot.is-out {
  cursor: pointer;
}
/* An empty recess shows where the tool goes back. */
.tl-slot.is-out::after {
  content: "";
  position: absolute;
  inset: 12% 8%;
  border: 3px dashed #ffffffa8;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.2s;
}
.tl-slot.is-out:hover::after,
.tl-slot.is-out:focus-visible::after {
  opacity: 1;
}
.tl-slot.is-seated img {
  animation: tl-seat 0.32s ease-out;
}
.tl-names {
  position: relative;
  height: 2.1rem;
  margin-top: 0.15rem;
}
.tl-names span {
  position: absolute;
  top: 0.15rem;
  translate: -50% 0;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: #fffcf1eb;
  box-shadow: 0 2px 0 #7d431a3d;
  font-weight: 850;
  font-size: clamp(0.78rem, 2.4cqi, 0.9rem);
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}
.tl-names .is-next {
  background: var(--tl-sun);
}
.tl-names .is-out {
  background: var(--tl-case);
  color: #fff;
}

/* ---------- the tool in your hand ---------- */
.tl-hand {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.tl-held,
.tl-ghost {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}
.tl-held img,
.tl-ghost {
  filter: drop-shadow(9px 14px 7px #4a26094d);
}
.tl-held img {
  display: block;
  width: 100%;
  height: 100%;
}
.tl-held.tl-glide {
  transition: transform 0.22s ease-out;
}
.tl-held.is-working img {
  filter: drop-shadow(5px 8px 4px #4a260955);
}
.tl-lens,
.tl-spin {
  position: absolute;
  display: none;
  border-radius: 50%;
}
.tl-held[data-tool="mirror"] .tl-lens,
.tl-held[data-tool="polisher"] .tl-spin {
  display: block;
}
/* The mirror face: empty sky by default, the hidden friend behind a tooth when it looks. */
.tl-lens {
  left: calc(var(--ox) - var(--H) * 0.124);
  top: calc(var(--oy) - var(--H) * 0.124);
  width: calc(var(--H) * 0.248);
  aspect-ratio: 1;
  overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #ffffff60, #0000 55%);
  transition: background-color 0.15s;
}
.tl-lens::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0000 30%, #ffffff8c 38%, #0000 46%, #0000 58%, #ffffff4d 63%, #0000 68%);
  pointer-events: none;
}
.tl-lens svg {
  position: absolute;
  inset: 13%;
  width: 74%;
  height: 74%;
  opacity: 0;
  transform: rotate(var(--untilt, 0deg)) scaleX(-1) scale(0.4);
  transition: opacity 0.15s, transform 0.2s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.tl-lens.is-peeking {
  background: radial-gradient(circle at 50% 45%, #fff9ee, #f7dcc8 80%);
  box-shadow: inset 0 0 0 2px #ffffffaa;
}
.tl-lens.is-peeking svg {
  opacity: 1;
  transform: rotate(var(--untilt, 0deg)) scaleX(-1) scale(1);
}
/* The polisher cup spins while it is pressed. */
.tl-spin {
  left: calc(var(--ox) - var(--H) * 0.13);
  top: calc(var(--oy) - var(--H) * 0.13);
  width: calc(var(--H) * 0.26);
  aspect-ratio: 1;
  border: 3px dashed #ffffffe0;
  opacity: 0;
  transition: opacity 0.12s;
}
.tl-spin::before,
.tl-spin::after {
  content: "";
  position: absolute;
  top: 18%;
  width: 26%;
  height: 64%;
  border: 3px solid #2bb3a0;
  border-radius: 50%;
  opacity: 0;
}
.tl-spin::before {
  left: -34%;
  border-right-color: #0000;
  border-top-color: #0000;
  border-bottom-color: #0000;
}
.tl-spin::after {
  right: -34%;
  border-left-color: #0000;
  border-top-color: #0000;
  border-bottom-color: #0000;
}
.tl-held.is-spinning .tl-spin {
  opacity: 1;
  animation: tl-spin 0.32s linear infinite;
}
.tl-held.is-spinning .tl-spin::before,
.tl-held.is-spinning .tl-spin::after {
  opacity: 1;
}
.tl-held.is-spinning img {
  animation: tl-buzz 0.09s linear infinite;
}

/* ---------- picture words and effects ---------- */
.tl-fx {
  position: absolute;
  inset: 0;
}
.tl-fx > * {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}
.tl-word {
  translate: -50% -100%;
  padding: 0.28rem 0.6rem 0.32rem;
  border-radius: 1rem 1rem 1rem 0.3rem;
  background: #fff;
  box-shadow: 0 2px 0 #00000026;
  color: var(--tl-ink);
  font-weight: 900;
  font-size: clamp(0.88rem, 2.8cqi, 1.12rem);
  line-height: 1;
  white-space: nowrap;
  animation: tl-word 1.15s ease-out forwards;
}
.tl-word[data-kind="whoosh"] {
  background: #e4f4fd;
  color: #145c84;
  font-style: italic;
}
.tl-word[data-kind="bzz"] {
  background: #dcf6ef;
  color: #0f665a;
  letter-spacing: 0.06em;
}
.tl-word[data-kind^="ting"] {
  background: #fff4c4;
  color: #6d4f00;
}
.tl-word[data-kind="pop"] {
  background: #f1f8ff;
  color: #2a5d80;
}
.tl-word[data-kind="tada"] {
  background: var(--tl-go);
  color: #fff;
  font-size: clamp(1.05rem, 3.4cqi, 1.4rem);
  padding: 0.4rem 0.85rem;
  border-radius: 1.2rem;
}
.tl-gust {
  width: 4.2rem;
  height: 4.2rem;
  margin: -2.1rem 0 0 -2.1rem;
  border: 3px solid var(--tl-sky);
  border-left-color: #0000;
  border-bottom-color: #0000;
  border-radius: 50%;
  rotate: var(--r, 0deg);
  animation: tl-gust 0.6s ease-out forwards;
}
.tl-swirl {
  width: 1.7rem;
  height: 1.7rem;
  margin: -0.85rem 0 0 -0.85rem;
  border: 2.5px solid #2bb3a0;
  border-right-color: #0000;
  border-radius: 50%;
  rotate: var(--r, 0deg);
  animation: tl-swirl 0.55s ease-out forwards;
}
.tl-pop {
  width: 1.4rem;
  height: 1.4rem;
  margin: -0.7rem 0 0 -0.7rem;
  border: 2px solid #7fc3e3;
  border-radius: 50%;
  animation: tl-pop 0.4s ease-out forwards;
}
.tl-glint {
  width: 1.2rem;
  height: 1.2rem;
  margin: -0.6rem 0 0 -0.6rem;
  background: #fff;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: tl-pop 0.5s ease-out forwards;
}
.tl-spark i {
  position: absolute;
  left: -0.45rem;
  top: -0.45rem;
  width: 0.9rem;
  height: 0.9rem;
  background: var(--tl-sun);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0;
  animation: tl-ray 0.75s ease-out forwards;
  animation-delay: var(--d, 0ms);
}

/* ---------- footer actions ---------- */
.tl-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  min-height: calc(48px + 1.7rem);
  padding: 0.85rem 1rem;
}
.tool-lab .tl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.65rem 1.25rem;
  border: 0;
  border-radius: 1.1rem;
  font-weight: 900;
  font-size: 1rem;
  line-height: 1.15;
}
.tool-lab .tl-quiet {
  background: #fde2ab;
  color: #49331a;
}
.tool-lab .tl-go {
  background: var(--tl-go);
  color: #fff;
  box-shadow: 0 3px 0 #0f3b34;
}
.tl-done .tl-go {
  animation: tl-count 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.tool-lab .tl-btn:hover {
  filter: brightness(1.05);
}

/* ---------- motion ---------- */
@keyframes tl-word {
  0% { opacity: 0; transform: translateY(8px) scale(0.7); }
  14% { opacity: 1; transform: translateY(0) scale(1.06); }
  24% { transform: none; }
  72% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-16px); }
}
@keyframes tl-fade {
  0% { opacity: 0; }
  12%, 70% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes tl-gust {
  0% { opacity: 1; transform: scale(0.25); }
  100% { opacity: 0; transform: scale(1.5); }
}
@keyframes tl-swirl {
  0% { opacity: 1; transform: rotate(0) scale(0.6); }
  100% { opacity: 0; transform: rotate(260deg) scale(1.3); }
}
@keyframes tl-pop {
  0% { opacity: 1; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(1.7); }
}
@keyframes tl-ray {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(0.5); }
  60% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-2.6rem) scale(1); }
}
@keyframes tl-count {
  0% { scale: 0.3; }
  60% { scale: 1.18; }
  100% { scale: 1; }
}
@keyframes tl-grow {
  0% { scale: 0; }
  100% { scale: 1; }
}
@keyframes tl-shake {
  0%, 100% { scale: 1; }
  50% { scale: 1.08 0.93; }
}
@keyframes tl-nudge {
  0%, 100% { translate: 0 0; }
  25% { translate: -4% 0; }
  75% { translate: 4% 0; }
}
@keyframes tl-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4%); }
}
@keyframes tl-call {
  0%, 100% { transform: none; }
  30% { transform: translateY(-7%) rotate(-5deg); }
  65% { transform: translateY(-3%) rotate(4deg); }
}
@keyframes tl-seat {
  0% { transform: translateY(-5%) scale(1.04); }
  60% { transform: translateY(1%) scale(0.98, 1.01); }
  100% { transform: none; }
}
@keyframes tl-spin {
  to { rotate: 360deg; }
}
@keyframes tl-buzz {
  0%, 100% { translate: 0 0; }
  25% { translate: 0.6px -0.4px; }
  75% { translate: -0.6px 0.4px; }
}
@keyframes tl-read {
  from { background-size: 0 100%; }
  to { background-size: 100% 100%; }
}

/* Reduced motion keeps every picture but drops travel, spin and bounce. */
.tl-calm .tl-word,
.tl-calm .tl-gust,
.tl-calm .tl-swirl,
.tl-calm .tl-pop,
.tl-calm .tl-glint {
  animation-name: tl-fade;
}
.tl-calm .tl-spark i {
  animation-name: tl-fade;
  transform: rotate(var(--a)) translateY(-1.6rem);
}
.tl-calm .tl-slot.is-next img,
.tl-calm .tl-slot.is-calling img,
.tl-calm .tl-slot.is-seated img,
.tl-calm .tl-bubble,
.tl-calm .tl-tooth,
.tl-calm .tl-num,
.tl-calm .tl-pip,
.tl-calm .tl-check,
.tl-calm .tl-go,
.tl-calm .tl-held img,
.tl-calm .tl-spin {
  animation: none !important;
}
.tl-calm .tl-slot.is-calling img {
  outline: 3px solid var(--tl-sun);
  outline-offset: 2px;
  border-radius: 999px;
}
.tl-calm .tl-slot:hover img {
  transform: none;
}
.tl-calm .tl-lens svg,
.tl-calm .tl-held.tl-glide {
  transition: opacity 0.15s;
}
.tl-calm .tl-say.is-speaking .tl-title,
.tl-calm .tl-say.is-speaking .tl-cue {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .tool-lab .tl-slot.is-next img,
  .tool-lab .tl-held.is-spinning img,
  .tool-lab .tl-held.is-spinning .tl-spin {
    animation: none;
  }
}

@media (forced-colors: active) {
  .tl-num,
  .tl-pip.is-on,
  .tl-check {
    forced-color-adjust: none;
  }
  .tl-names span,
  .tool-lab .tl-chip,
  .tl-goal {
    border: 1px solid CanvasText;
  }
}
