/*
 * Artificial Idiot: shared chrome (header, footer, ticks, buttons, skip, lock panel,
 * toast, celebration canvas, share box, .ai-sr-only).
 * Styled only through the shared variables in docs/CONTRACT.md section 11, so each stage
 * keeps its own look. Pages set the variables (light on :root, dark in a media query).
 * Optional: --ai-wrap sets the header's inner max width (default 1080px).
 */

/* ---------- Screen-reader only ---------- */
.ai-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- Icons ---------- */
.ai-ico { width: 20px; height: 20px; flex: none; display: block; overflow: visible; }
.ai-ico__line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ai-ico__fill { fill: currentColor; }
.ai-ico__hot { fill: var(--ai-accent, #2457D6); }
.ai-ico__hotfill { fill: var(--ai-accent, #2457D6); stroke: currentColor; stroke-width: 1.6; }
.ai-ico__star { fill: var(--ai-accent-ink, #FFFFFF); }
.ai-ico__snow { fill: var(--ai-surface, #FFFFFF); }

/* ---------- Header (rendered by game.js into [data-game-header]) ---------- */
.ai-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ai-bg, #FFFFFF);
  background: color-mix(in srgb, var(--ai-bg, #FFFFFF) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(10px);
  backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--ai-line, #D0D0D0);
  color: var(--ai-ink, #111111);
  padding-top: env(safe-area-inset-top, 0px);
}
.ai-header__in {
  box-sizing: border-box;
  max-width: var(--ai-wrap, 1080px);
  margin: 0 auto;
  height: 56px;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
.ai-brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-right: 4px;
  border-radius: 12px;
  color: var(--ai-ink, #111111);
  text-decoration: none;
  font-family: var(--ai-font-display, system-ui, sans-serif);
}
.ai-brand__bot { width: 34px; height: 34px; flex: none; display: grid; place-items: center; }
.ai-brand__bot svg { width: 34px; height: 34px; display: block; }
.ai-brand__name { display: grid; font-size: 15px; line-height: .95; letter-spacing: .01em; white-space: nowrap; }
@media (min-width: 640px) {
  .ai-brand__name { display: block; font-size: 19px; line-height: 1; }
}
.ai-stats { margin-left: auto; flex: none; display: flex; align-items: center; gap: 4px; }
.ai-stat {
  box-sizing: border-box;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 11px 0 9px;
  border: 1.5px solid var(--ai-line, #D0D0D0);
  border-radius: 999px;
  background: var(--ai-surface, #FFFFFF);
  color: var(--ai-ink, #111111);
  font: 700 15px/1 var(--ai-font-body, system-ui, sans-serif);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ai-stat b { font-weight: 800; }
.ai-stat__part { display: inline-flex; align-items: center; gap: 5px; }
.ai-stat--pair { gap: 10px; }
.ai-stat--pair .ai-stat__part + .ai-stat__part { padding-left: 10px; border-left: 1.5px solid var(--ai-line, #D0D0D0); height: 22px; }
.ai-stat--btn {
  position: relative;
  min-width: 44px;
  justify-content: center;
  padding: 0 7px;
  gap: 4px;
  border-color: transparent;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ai-stat--btn::after { content: ""; position: absolute; inset: -3px 0; } /* 44px+ hit area */
.ai-stat--btn:hover { background: var(--ai-surface, #FFFFFF); border-color: var(--ai-line, #D0D0D0); }
.ai-stat--btn .ai-ico { color: var(--ai-muted, #666666); }
/* Off state: the flame keeps the muted ink colour so it still reads as a streak (3:1 or more). */
.ai-stat--btn .ai-ico__hot { fill: var(--ai-muted, #666666); }
.ai-stat--btn .ai-ico__hotfill { fill: var(--ai-line, #D0D0D0); }
.ai-stat--btn.is-on .ai-ico { color: var(--ai-ink, #111111); }
.ai-stat--btn.is-on .ai-ico__hot { fill: var(--ai-bad, #E0562E); }
.ai-stat--btn.is-on .ai-ico__hotfill { fill: var(--ai-accent, #2457D6); }

/* ---------- 3-stage progress strip (in the header): 1 · 2 · 3 ----------
   Each step links to its stage page and carries data-status="passed|skipped|open|locked".
   passed = filled with a tick, skipped = dashed ring, open = solid ring, locked = padlock.
   The current page (aria-current) gets an accent bar underneath. */
.ai-strip { flex: none; display: flex; align-items: center; margin-left: 6px; }
.ai-strip__step {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 40px;
  border-radius: 10px;
  color: var(--ai-ink, #111111);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.ai-strip__step::after { content: ""; position: absolute; inset: -2px 0; } /* 44px tall hit area */
.ai-strip__pip {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--ai-ink, #111111);
  border-radius: 50%;
  background: var(--ai-surface, #FFFFFF);
  color: var(--ai-ink, #111111);
  font: 800 12px/1 var(--ai-font-body, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
  transition: box-shadow .15s ease;
}
.ai-strip__pip > * { grid-area: 1 / 1; }
.ai-strip__pip .ai-ico { display: none; width: 14px; height: 14px; }
.ai-ico__bold { stroke-width: 3.2; }
.ai-strip__step:hover .ai-strip__pip { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ai-accent, #2457D6) 28%, transparent); }
.ai-strip__step[data-status="passed"] .ai-strip__pip { background: var(--ai-good, #1F8A4C); border-color: var(--ai-good, #1F8A4C); color: var(--ai-surface, #FFFFFF); }
.ai-strip__step[data-status="passed"] .ai-strip__num,
.ai-strip__step[data-status="locked"] .ai-strip__num { display: none; }
.ai-strip__step[data-status="passed"] .ai-strip__check,
.ai-strip__step[data-status="locked"] .ai-strip__lock { display: block; }
.ai-strip__step[data-status="skipped"] .ai-strip__pip { border-style: dashed; border-color: var(--ai-muted, #666666); background: transparent; color: var(--ai-muted, #666666); }
.ai-strip__step[data-status="locked"] .ai-strip__pip { border-color: var(--ai-line, #D0D0D0); background: transparent; color: var(--ai-muted, #666666); }
.ai-strip__step[data-status="locked"] .ai-strip__lock { width: 13px; height: 13px; }
.ai-strip__step[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 16px;
  height: 3px;
  margin-left: -8px;
  border-radius: 2px;
  background: var(--ai-accent, #2457D6);
}
.ai-strip__bar { flex: none; width: 8px; height: 2px; margin: 0 -3px; border-radius: 1px; background: var(--ai-line, #D0D0D0); }
.ai-strip__step[data-status="passed"] + .ai-strip__bar { background: var(--ai-good, #1F8A4C); }
.ai-strip__step[data-status="skipped"] + .ai-strip__bar { background: var(--ai-muted, #666666); }
@media (max-width: 420px) {
  .ai-strip { margin-left: 2px; }
  .ai-strip__step { width: 25px; }
  .ai-strip__pip { width: 21px; height: 21px; font-size: 11.5px; }
  .ai-strip__bar { width: 6px; margin: 0 -2px; }
}
.ai-stat__stack { display: grid; gap: 2px; min-width: 0; text-align: left; }
.ai-stat__main { font-size: 14px; line-height: 1.05; }
.ai-stat__sub { font-size: 11.5px; line-height: 1.1; font-weight: 600; color: var(--ai-muted, #666666); overflow: hidden; text-overflow: ellipsis; }
.ai-stat--counter { padding-right: 12px; }
.ai-stat .ai-opt { font-weight: 600; }
.ai-stat > .ai-opt:not(:first-child) { margin-left: -2px; }
.ai-stat--btn > .ai-opt { font-size: 14px; color: var(--ai-muted, #666666); }

/* Phones. This block comes after the base .ai-stat rules on purpose, so it wins. */
@media (max-width: 420px) {
  .ai-header__in { gap: 4px; }
  .ai-brand { gap: 5px; padding-right: 0; }
  .ai-brand__bot, .ai-brand__bot svg { width: 30px; height: 30px; }
  .ai-brand__name { font-size: 13px; }
  .ai-stats { gap: 0; }
  .ai-stat { gap: 4px; padding: 0 8px 0 7px; font-size: 14.5px; }
  .ai-stat--btn { padding: 0 4px; min-width: 40px; }
  .ai-stat--counter { padding-right: 9px; }
  .ai-stat--pair { gap: 6px; }
  .ai-stat--pair .ai-stat__part + .ai-stat__part { padding-left: 6px; }
  .ai-stat .ai-ico { width: 17px; height: 17px; }
}

/* Fit levels, set by game.js when the row is too wide: 1 drops optional words,
   2 also drops the brand words (the robot stays), 3 tightens the progress strip and the
   buttons and lets the counter truncate, 4 (very narrow screens only) drops the brand robot
   too, since stage 1 in the strip also links home. The progress strip itself is never hidden. */
.ai-header:not([data-fit="0"]) .ai-opt { display: none; }
.ai-header[data-fit="2"] .ai-brand__name,
.ai-header[data-fit="3"] .ai-brand__name,
.ai-header[data-fit="4"] .ai-brand__name { display: none; }
.ai-header[data-fit="4"] .ai-brand { display: none; }
.ai-header:is([data-fit="3"], [data-fit="4"]) .ai-strip { margin-left: 0; }
.ai-header:is([data-fit="3"], [data-fit="4"]) .ai-strip__step { width: 24px; }
.ai-header:is([data-fit="3"], [data-fit="4"]) .ai-strip__bar { width: 4px; margin: 0 -1px; }
.ai-header:is([data-fit="3"], [data-fit="4"]) .ai-stat--btn { min-width: 36px; padding: 0 2px; }
.ai-header:is([data-fit="3"], [data-fit="4"]) .ai-stats { flex: 0 1 auto; min-width: 0; }
.ai-header:is([data-fit="3"], [data-fit="4"]) .ai-stat--shrink { flex: 0 1 auto; min-width: 0; }
.ai-header:is([data-fit="3"], [data-fit="4"]) .ai-stat--shrink .ai-stat__main,
.ai-header:is([data-fit="3"], [data-fit="4"]) .ai-stat--shrink .ai-stat__sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Focus (all chrome) ---------- */
.ai-brand:focus-visible,
.ai-strip__step:focus-visible,
.ai-stat--btn:focus-visible,
.ai-btn:focus-visible,
.ai-skip:focus-visible,
.ai-footer a:focus-visible,
[data-reset]:focus-visible,
[data-skip]:focus-visible,
[data-share]:focus-visible,
.ai-sharebox textarea:focus-visible {
  outline: 3px solid var(--ai-ink, #111111);
  outline-offset: 3px;
}
.ai-strip__step:focus-visible { outline-offset: 0; }

/* ---------- Tick boxes: <label class="ai-tick"><input type="checkbox" data-task="..."> Text</label> ---------- */
.ai-tick {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 18px 8px 10px;
  border: 2px solid var(--ai-line, #D0D0D0);
  border-radius: 14px;
  background: var(--ai-surface, #FFFFFF);
  color: var(--ai-ink, #111111);
  font: 700 1rem/1.25 var(--ai-font-body, system-ui, sans-serif);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  max-width: 100%;
  transition: background-color .2s ease, border-color .2s ease;
}
.ai-tick:hover { border-color: var(--ai-ink, #111111); }
.ai-tick input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  flex: none;
  margin: 0;
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--ai-ink, #111111);
  border-radius: 10px;
  background: var(--ai-surface, #FFFFFF);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.ai-tick input[type="checkbox"]::before {
  content: "";
  box-sizing: border-box;
  width: 10px;
  height: 17px;
  margin-top: -4px;
  border: solid var(--ai-surface, #FFFFFF);
  border-width: 0 4px 4px 0;
  transform: rotate(45deg) scale(0);
  transition: transform .2s cubic-bezier(.2, 1.6, .4, 1);
}
.ai-tick input[type="checkbox"]:checked { background: var(--ai-good, #1F8A4C); border-color: var(--ai-good, #1F8A4C); }
.ai-tick input[type="checkbox"]:checked::before { transform: rotate(45deg) scale(1); }
.ai-tick input[type="checkbox"]:focus-visible { outline: 3px solid var(--ai-ink, #111111); outline-offset: 3px; }
.ai-tick:has(input:focus-visible) { border-color: var(--ai-ink, #111111); }
.ai-tick.is-done,
.ai-tick:has(input:checked) {
  border-color: var(--ai-good, #1F8A4C);
  background: color-mix(in srgb, var(--ai-good, #1F8A4C) 13%, var(--ai-surface, #FFFFFF));
}
.ai-tick.is-popping input[type="checkbox"] { animation: ai-pop .32s ease-out; }
.ai-tick input[type="checkbox"]:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Buttons ---------- */
.ai-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--ai-accent, #2457D6);
  color: var(--ai-accent-ink, #FFFFFF);
  font: 400 1.15rem/1.1 var(--ai-font-display, system-ui, sans-serif);
  letter-spacing: .02em;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--ai-accent, #2457D6) 55%, #000000);
  transition: transform .08s ease, box-shadow .08s ease;
  -webkit-tap-highlight-color: transparent;
}
.ai-btn:hover { filter: brightness(1.05); }
.ai-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--ai-accent, #2457D6) 55%, #000000); }
.ai-btn:disabled, .ai-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.ai-btn .ai-ico { width: 20px; height: 20px; }
.ai-btn--ghost {
  background: var(--ai-surface, #FFFFFF);
  color: var(--ai-ink, #111111);
  border-color: var(--ai-ink, #111111);
  box-shadow: 0 4px 0 var(--ai-line, #D0D0D0);
}
.ai-btn--ghost:active { box-shadow: 0 1px 0 var(--ai-line, #D0D0D0); }

/* Skip button: <button class="ai-skip" data-skip="1">Skip to the next level</button>
   (plain [data-skip] elements with no class get the same look). */
.ai-skip,
[data-skip]:not([class]) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border: 2px dashed var(--ai-muted, #666666);
  border-radius: 14px;
  background: transparent;
  color: var(--ai-ink, #111111);
  font: 700 1rem/1.2 var(--ai-font-body, system-ui, sans-serif);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ai-skip:hover,
[data-skip]:not([class]):hover { border-style: solid; border-color: var(--ai-ink, #111111); }

/* ---------- Footer (static HTML on every page) ---------- */
.ai-footer {
  box-sizing: border-box;
  margin-top: 48px;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--ai-line, #D0D0D0);
  color: var(--ai-muted, #666666);
  font: 400 .92rem/1.8 var(--ai-font-body, system-ui, sans-serif);
  text-align: center;
  text-wrap: balance;
}
.ai-footer a { color: var(--ai-ink, #111111); font-weight: 700; text-underline-offset: 3px; }
/* 44px tall tap target without changing the line height: padding out, the same margin back in. */
.ai-footer a { display: inline-block; padding: 9px 4px; margin: -9px 0; }
[data-reset] {
  min-height: 44px;
  padding: 8px 6px;
  border: 0;
  background: none;
  color: var(--ai-ink, #111111);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
[data-reset][data-armed="true"] { color: var(--ai-bad, #C0362C); text-decoration-style: wavy; }

/* ---------- Lock panel: shown by game.js only when the page's stage is locked ----------
   Default: a fixed overlay with a blurred page behind it. data-lock-panel="inline" keeps it in the flow.
   Put the panel's content in .ai-lock-card (game.js writes a default card if the panel is empty). */
[data-lock-panel][hidden] { display: none !important; }
[data-lock-panel] {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: calc(72px + env(safe-area-inset-top, 0px)) 16px 24px;
  overflow-y: auto;
  background: color-mix(in srgb, var(--ai-bg, #FFFFFF) 55%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
/* Keep the footer (and its Reset button) usable above the overlay on a locked page. */
body[data-locked="true"] .ai-footer { position: relative; z-index: 41; background: var(--ai-bg, #FFFFFF); }
[data-lock-panel="inline"] {
  position: relative;
  inset: auto;
  z-index: auto;
  display: block;
  padding: 0;
  overflow: visible;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.ai-lock-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 26px 22px 24px;
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
  background: var(--ai-surface, #FFFFFF);
  color: var(--ai-ink, #111111);
  border: 3px solid var(--ai-ink, #111111);
  border-radius: 22px;
  box-shadow: 0 10px 0 -2px color-mix(in srgb, var(--ai-ink, #111111) 22%, transparent);
  font: 400 1rem/1.5 var(--ai-font-body, system-ui, sans-serif);
}
.ai-lock-card p { margin: 0; }
.ai-lock-card__icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ai-bg, #F2F2F2);
  border: 2px solid var(--ai-line, #D0D0D0);
}
.ai-lock-card__icon .ai-ico { width: 28px; height: 28px; }
.ai-lock-card__title { margin: 0; font: 400 1.7rem/1.1 var(--ai-font-display, system-ui, sans-serif); }
.ai-lock-card__muted { color: var(--ai-muted, #666666); font-size: .95rem; }
.ai-lock-card__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 6px; }

/* ---------- Toasts (role="status" region made by game.js) ---------- */
.ai-toasts {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 1002;
  width: min(440px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}
.ai-toast {
  box-sizing: border-box;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--ai-ink, #111111);
  color: var(--ai-bg, #FFFFFF);
  font: 600 .98rem/1.4 var(--ai-font-body, system-ui, sans-serif);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
  animation: ai-toast-in .22s ease-out;
}
.ai-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .24s ease, transform .24s ease; }

/* ---------- Celebration: confetti canvas and the floating "+1 year" chip ---------- */
.ai-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1001; }
.ai-chip {
  position: fixed;
  z-index: 1003;
  transform: translate(-50%, -50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ai-accent, #2457D6);
  color: var(--ai-accent-ink, #FFFFFF);
  font: 400 1.1rem/1.1 var(--ai-font-display, system-ui, sans-serif);
  letter-spacing: .02em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
  animation: ai-chip-rise 1.35s cubic-bezier(.2, .8, .3, 1) forwards;
}

/* ---------- Share fallback box ---------- */
.ai-sharebox {
  box-sizing: border-box;
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 1004;
  width: min(460px, calc(100vw - 32px));
  padding: 18px;
  display: grid;
  gap: 10px;
  background: var(--ai-surface, #FFFFFF);
  color: var(--ai-ink, #111111);
  border: 3px solid var(--ai-ink, #111111);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .3);
  font: 400 1rem/1.4 var(--ai-font-body, system-ui, sans-serif);
}
.ai-sharebox__title { margin: 0; font-weight: 700; }
.ai-sharebox__text {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--ai-line, #D0D0D0);
  border-radius: 12px;
  background: var(--ai-bg, #F6F6F6);
  color: var(--ai-ink, #111111);
  font: 400 1rem/1.4 var(--ai-font-body, system-ui, sans-serif);
  resize: none;
}
.ai-sharebox .ai-btn { justify-self: end; }

/* ---------- Mascot ----------
   In dark mode the robot's dark outline would vanish into a dark page, so mascot.js draws a light
   rim (--ai-mascot-halo) round its silhouette. :where() keeps this easy for a page to override,
   e.g. a page with dark sections in light mode can set --ai-mascot-halo itself. */
@media (prefers-color-scheme: dark) {
  :where(:root) { --ai-mascot-halo: color-mix(in srgb, var(--ai-ink, #EAF2E4) 38%, var(--ai-bg, #121A14)); }
}
[data-mascot] { display: inline-block; line-height: 0; }
[data-mascot] svg { max-width: 100%; height: auto; }
.ai-hop { animation: ai-hop .6s cubic-bezier(.3, 1.5, .5, 1); transform-origin: 50% 100%; }

/* ---------- Motion ---------- */
.ai-booting .ai-tick,
.ai-booting .ai-tick input[type="checkbox"],
.ai-booting .ai-tick input[type="checkbox"]::before { transition: none !important; animation: none !important; }
@keyframes ai-pop { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes ai-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ai-chip-rise {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); }
  18% { opacity: 1; transform: translate(-50%, -80%) scale(1.06); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -260%) scale(1); }
}
@keyframes ai-hop {
  0% { transform: translateY(0) scale(1, 1); }
  25% { transform: translateY(0) scale(1.06, .92); }
  55% { transform: translateY(-12%) scale(.96, 1.05); }
  100% { transform: translateY(0) scale(1, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .ai-tick, .ai-tick input[type="checkbox"], .ai-tick input[type="checkbox"]::before,
  .ai-btn, .ai-toast, .ai-chip, .ai-hop, .ai-strip__pip, .ai-tick.is-popping input[type="checkbox"] {
    animation: none !important;
    transition: none !important;
  }
  .ai-btn:active { transform: none; }
}
