/* Components read tokens from app/ui/tokens.css only. No raw colors below this line. */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-stretch: 75%;
  font-display: swap;
  src: url("./assets/fonts/roboto-latin-variable.woff2") format("woff2");
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: var(--stage-size);
  height: var(--stage-size);
  overflow: hidden;
  background: var(--color-stage);
  color: var(--color-text);
  font-family: var(--font-family);
  font-weight: 700;
  font-stretch: 75%;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button, input { font: inherit; color: inherit; }

/* ---------- Stage: fixed 600×600, nothing scrolls ---------- */
#stage {
  position: relative;
  isolation: isolate;
  width: var(--stage-size);
  height: var(--stage-size);
  overflow: hidden;
  background: var(--color-stage);
}

/* Ambient background: two soft glows, slow drift. steps() caps the animation at 30 FPS
   (22s × 30 = 660 steps) so the compositor does not repaint at 60/120 Hz for no gain. */
#bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
#bg::before, #bg::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(18px);
}
#bg::before { left: -110px; top: 330px; background: radial-gradient(closest-side, var(--color-glow-a), transparent); animation: bg-drift-a 22s steps(660, end) infinite; }
#bg::after { right: -120px; top: -90px; background: radial-gradient(closest-side, var(--color-glow-b), transparent); animation: bg-drift-b 26s steps(780, end) infinite; }
@keyframes bg-drift-a { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(14px, -10px, 0) scale(1.05); } }
@keyframes bg-drift-b { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-12px, 12px, 0) scale(1.04); } }
body[data-app-visibility="hidden"] #bg::before, body[data-app-visibility="hidden"] #bg::after { animation-play-state: paused; }

/* ---------- App root and screen transitions ---------- */
#app {
  position: absolute;
  inset: 0 0 calc(var(--stage-size) - var(--safe-bottom)) 0; /* ends at y=576 */
  z-index: 1;
  display: flex;
  outline: none;
  transition: opacity var(--motion-fast) ease;
}
#app.is-leaving { opacity: 0; }

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--safe-inset);
  text-align: center;
  animation: screen-settle var(--motion-slow) var(--motion-ease-out);
}
@keyframes screen-settle { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* ---------- Type ---------- */
.ui-title { font-size: var(--font-size-display); line-height: var(--line-height-tight); letter-spacing: 0; }
h2.ui-title { font-size: var(--font-size-title); }
.eyebrow { font-size: var(--font-size-body); color: var(--color-text-quiet); text-transform: uppercase; letter-spacing: 0.08em; }
.lede { max-width: 440px; font-size: 20px; line-height: var(--line-height-body); color: var(--color-text-muted); }
.footnote { font-size: var(--font-size-caption); color: var(--color-text-quiet); }
.hint { font-size: var(--font-size-body); color: var(--color-text-quiet); }

/* ---------- Buttons ---------- */
.ui-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 64px;
  min-width: 160px;
  padding: var(--space-3) var(--space-5);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface-control-top), var(--surface-control-bottom));
  box-shadow: var(--shadow-raised);
  font-size: var(--font-size-control);
  line-height: var(--line-height-tight);
  cursor: pointer;
  outline: none;
  transition: transform var(--motion-fast) var(--motion-ease-spring), background var(--motion-fast) ease, border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}
.ui-button-detail { font-size: var(--font-size-body); color: var(--color-text-quiet); }
.ui-button--primary { background: linear-gradient(180deg, var(--surface-action-top), var(--surface-action-bottom)); }
.ui-button--danger { background: linear-gradient(180deg, var(--surface-danger-top), var(--surface-danger-bottom)); }
.ui-button[aria-disabled="true"] { opacity: 0.55; }

/* Focus: border + ring + scale, so selection never depends on color alone. */
.focusable.nav-on {
  border-color: var(--focus-border);
  background: linear-gradient(180deg, var(--focus-top), var(--focus-bottom));
  box-shadow: 0 0 0 4px var(--focus-ring), var(--shadow-raised);
  transform: scale(var(--focus-scale));
}
.ui-button--primary.nav-on { background: linear-gradient(180deg, var(--surface-action-top), var(--surface-action-bottom)); }
.ui-button--danger.nav-on { background: linear-gradient(180deg, var(--surface-danger-top), var(--surface-danger-bottom)); }
.ui-button .ui-button-detail { pointer-events: none; }

/* ---------- Menus ---------- */
.ui-menu { display: flex; flex-direction: column; gap: var(--space-3); width: 400px; }
.ui-menu .ui-button { width: 100%; min-height: 72px; }
.ui-menu--settings .ui-button { flex-direction: row; justify-content: space-between; min-height: 64px; }
.ui-button--setting .ui-button-detail { font-size: 20px; color: var(--color-text-muted); }
.ui-button--setting.nav-on .ui-button-detail::before { content: "‹  "; }
.ui-button--setting.nav-on .ui-button-detail::after { content: "  ›"; }

.screen-actions { display: flex; flex-direction: column; gap: var(--space-3); }
.screen-actions--row { flex-direction: row; }

/* ---------- Carousel: one card at a time inside a clipped viewport ----------
   Nothing crosses the display edge: the track slides inside .carousel-viewport,
   which sits within the safe inset. Chevrons say more content exists. */
.carousel-frame { display: flex; align-items: center; gap: var(--space-3); }
.carousel-chevron { width: 32px; font-size: var(--font-size-title); color: var(--color-text-quiet); text-align: center; }
.carousel-chevron[data-active="false"] { opacity: 0.2; }
.carousel-viewport { width: 380px; padding: var(--space-3) 0; overflow: hidden; }
.carousel {
  --card-width: 340px;
  --card-gap: 40px;
  --carousel-index: 0;
  display: flex;
  gap: var(--card-gap);
  padding-left: 20px;
  transform: translateX(calc(var(--carousel-index) * -1 * (var(--card-width) + var(--card-gap))));
  transition: transform var(--motion-base) var(--motion-ease-spring);
}
.ui-button--card {
  flex: 0 0 var(--card-width);
  min-height: 220px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-panel-top), var(--surface-panel-bottom));
  font-size: 28px;
}
.ui-button--card .ui-button-detail { max-width: 280px; font-size: 18px; line-height: var(--line-height-body); }
.carousel-counter { font-size: var(--font-size-body); color: var(--color-text-quiet); }

/* ---------- Detail ---------- */
.detail-image { width: 96px; height: 96px; border-radius: var(--radius-md); }
.detail-image-fallback { font-size: var(--font-size-caption); color: var(--color-text-quiet); }

/* ---------- Composer field ---------- */
.composer-field {
  width: 440px;
  min-height: 72px;
  padding: 0 var(--space-5);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface-field-top), var(--surface-field-bottom));
  font-size: 24px;
  text-align: center;
  outline: none;
}
.composer-field::placeholder { color: var(--color-text-quiet); }
.composer-result { min-height: 28px; font-size: 20px; color: var(--color-text-muted); }

/* ---------- Animation host (Rive or static fallback) ----------
   The fallback mirrors the standard Rive contract: data-rive-state (idle | attention |
   thinking | success | fail | celebrate), data-rive-pulse (react | nudge-<dir>). */
.animation-host { position: relative; width: 200px; height: 200px; display: grid; place-items: center; }
.animation-state { font-size: 20px; color: var(--color-text-muted); }
.rive-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.rive-host[data-rive="available"] .fallback-glyph { display: none; }
.fallback-glyph { width: 160px; height: 160px; transition: transform var(--motion-base) var(--motion-ease-spring); }
.fallback-glyph-body { fill: var(--surface-panel-bottom); stroke: var(--color-accent); stroke-width: 6; transition: stroke var(--motion-base) ease; }
.fallback-glyph-core { fill: var(--color-accent-soft); transform-origin: 50px 50px; transition: transform var(--motion-base) var(--motion-ease-spring), fill var(--motion-base) ease; }
.rive-host:not([data-rive-state]) .fallback-glyph,
.rive-host[data-rive-state="idle"] .fallback-glyph { animation: glyph-breathe 3.2s steps(96, end) infinite; }
.rive-host[data-rive-state="attention"] .fallback-glyph-core { transform: scale(1.25); }
.rive-host[data-rive-state="attention"] .fallback-glyph { animation: glyph-breathe 1.6s steps(48, end) infinite; }
.rive-host[data-rive-state="thinking"] .fallback-glyph-body { stroke-dasharray: 24 12; }
.rive-host[data-rive-state="thinking"] .fallback-glyph { animation: glyph-spin 2.4s steps(72, end) infinite; }
.rive-host[data-rive-state="success"] .fallback-glyph-body { stroke: var(--color-good); }
.rive-host[data-rive-state="success"] .fallback-glyph-core { fill: var(--color-good); transform: scale(1.15); }
.rive-host[data-rive-state="fail"] .fallback-glyph-body { stroke: var(--color-warn); }
.rive-host[data-rive-state="fail"] .fallback-glyph-core { fill: var(--color-warn); transform: scale(0.8); }
.rive-host[data-rive-state="celebrate"] .fallback-glyph-body { stroke: var(--color-accent-soft); }
.rive-host[data-rive-state="celebrate"] .fallback-glyph { animation: glyph-pulse var(--motion-slow) var(--motion-ease-spring) 2; }
.rive-host[data-rive-visible="false"] .fallback-glyph { transform: scale(0.6); opacity: 0; }
.rive-host[data-rive-pulse="react"] .fallback-glyph-core { animation: glyph-pulse var(--motion-slow) var(--motion-ease-spring); }
.rive-host[data-rive-pulse="nudge-up"] .fallback-glyph { animation: nudge-up 320ms ease-out; }
.rive-host[data-rive-pulse="nudge-down"] .fallback-glyph { animation: nudge-down 320ms ease-out; }
.rive-host[data-rive-pulse="nudge-left"] .fallback-glyph { animation: nudge-left 320ms ease-out; }
.rive-host[data-rive-pulse="nudge-right"] .fallback-glyph { animation: nudge-right 320ms ease-out; }
@keyframes glyph-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes glyph-spin { to { transform: rotate(360deg); } }
@keyframes glyph-pulse { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ---------- Crop art (app/ui/crop-art.js): shapes filled by kind from tokens ---------- */
.crop-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.crop { display: block; overflow: visible; }
.crop-body { fill: var(--crop-main); }
.crop-dark { fill: var(--crop-dark); }
.crop-light { fill: var(--crop-light, var(--crop-main)); }
.crop-leaf { fill: var(--crop-leaf); }
.crop-shine { fill: var(--crop-shine); }
.crop[data-kind="tomato"] { --crop-main: var(--crop-tomato); --crop-dark: var(--crop-tomato-dark); }
.crop[data-kind="carrot"] { --crop-main: var(--crop-carrot); --crop-dark: var(--crop-carrot-dark); }
.crop[data-kind="corn"] { --crop-main: var(--crop-corn); --crop-dark: var(--crop-corn-dark); }
.crop[data-kind="lettuce"] { --crop-main: var(--crop-lettuce); --crop-light: var(--crop-lettuce-light); --crop-dark: var(--crop-lettuce-dark); }
.crop[data-kind="eggplant"] { --crop-main: var(--crop-eggplant); --crop-dark: var(--crop-eggplant-dark); }
.crop[data-kind="berry"] { --crop-main: var(--crop-berry); --crop-dark: var(--crop-berry-dark); }
/* Specials: gold and ivory with a thick ink outline (crops have none), so they read as tools. */
.special-gold, .special-gold-dark, .special-seed, .special-petal { stroke: var(--special-ink); stroke-width: 5; stroke-linejoin: round; }
.special-gold { fill: var(--special-gold); }
.special-gold-dark { fill: var(--special-gold-dark); }
.special-shine { fill: var(--special-ivory); }
.special-ink { fill: var(--special-ink); }
.special-spark { fill: var(--special-spark); stroke: var(--special-ink); stroke-width: 3; stroke-linejoin: round; }
.special-seed { fill: var(--special-seed); }
.special-petal { stroke-width: 3; }
.special-petal--tomato { fill: var(--crop-tomato); }
.special-petal--carrot { fill: var(--crop-carrot); }
.special-petal--corn { fill: var(--crop-corn); }
.special-petal--lettuce { fill: var(--crop-lettuce); }
.special-petal--eggplant { fill: var(--crop-eggplant); }
.special-petal--berry { fill: var(--crop-berry); }

/* ---------- Coin ---------- */
.m3-coin {
  display: inline-block;
  flex: none;
  width: 22px;
  height: 22px;
  border: 3px solid var(--coin-rim);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--coin-top), var(--coin-bottom));
}
.m3-coin--large { width: 40px; height: 40px; border-width: 5px; }

/* ---------- Game screen: HUD over the board ----------
   Layout (600×576 safe area): HUD 52px, board frame up to 456px, all above y≈524 so the
   bottom toast never covers a row. Nothing on the board animates in a loop. */
.screen--game { justify-content: flex-start; gap: var(--space-2); padding: var(--space-1) 0 0; }
.m3-hud { display: flex; align-items: center; gap: var(--space-2); width: 456px; height: 52px; }
.m3-goals { display: flex; flex: 1; gap: var(--space-2); }
.m3-goal {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  height: 52px;
  padding: 0 var(--space-3) 0 var(--space-1);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--surface-panel-top), var(--surface-panel-bottom));
}
.m3-goal-crop { width: 40px; height: 40px; }
.m3-goal-count { min-width: 28px; font-size: 24px; text-align: left; }
.m3-goal-check { display: none; width: 12px; height: 22px; margin: 0 var(--space-2) 6px; border: solid var(--color-good); border-width: 0 5px 5px 0; rotate: 45deg; }
.m3-goal.is-done { border-color: var(--color-good); }
.m3-goal.is-done .m3-goal-count { display: none; }
.m3-goal.is-done .m3-goal-check { display: block; }
.m3-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 52px;
  min-width: 72px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface-panel-top), var(--surface-panel-bottom));
}
.m3-stat--coins { flex-direction: row; gap: var(--space-2); }
.m3-stat-caption { font-size: var(--font-size-caption); line-height: 1; color: var(--color-text-quiet); }
.m3-stat-value { display: inline-block; font-size: 26px; line-height: 1.1; }
.m3-stat--coins .m3-stat-value { font-size: 22px; }
.m3-stat--moves.is-low .m3-stat-value { color: var(--color-warn); }

/* ---------- Board ---------- */
.m3-frame {
  position: relative;
  padding: 6px;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--board-frame-top), var(--board-frame-bottom));
}
/* Checkered soil: one static gradient, painted once. The grid clips its tiles, so a crop
   falling in from above never crosses the board edge. */
.m3-grid {
  position: relative;
  overflow: hidden;
  contain: strict;
  border-radius: 16px;
  outline: none;
  background-color: var(--board-cell-a);
  background-image: conic-gradient(var(--board-cell-b) 25%, transparent 0 50%, var(--board-cell-b) 0 75%, transparent 0);
  background-size: calc(var(--cell) * 2) calc(var(--cell) * 2);
}
.m3-tile { position: absolute; left: 0; top: 0; width: var(--cell); height: var(--cell); padding: calc(var(--cell) * 0.09); }
.m3-crop { width: 100%; height: 100%; transition: scale var(--motion-fast) var(--motion-ease-spring); }
.m3-tile.is-selected { z-index: 2; }
/* A special sits on a round violet badge with a gold ring (static, painted once): no crop
   has one, so a special reads as a tool at a glance on the soil checker. */
.m3-tile[data-special]::before {
  content: "";
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, var(--special-badge-top), var(--special-badge-bottom));
  box-shadow: 0 0 0 3px var(--special-ring), 0 0 14px var(--special-glow);
}
.m3-tile[data-special] .m3-crop { position: relative; }

/* Special effects: pooled nodes, placed and sized from JS, animated once with the Web
   Animations API (transform/opacity only). */
.m3-beam, .m3-blast, .m3-flyer { position: absolute; z-index: 4; left: 0; top: 0; opacity: 0; pointer-events: none; }
.m3-beam { border-radius: var(--radius-pill); background: linear-gradient(180deg, var(--beam-edge), var(--beam-glow) 30%, var(--beam-core) 50%, var(--beam-glow) 70%, var(--beam-edge)); }
.m3-beam--col { background: linear-gradient(90deg, var(--beam-edge), var(--beam-glow) 30%, var(--beam-core) 50%, var(--beam-glow) 70%, var(--beam-edge)); }
.m3-blast { border-radius: 50%; background: radial-gradient(closest-side, var(--blast-core), var(--blast-mid) 55%, var(--blast-edge)); }
.m3-flyer { z-index: 5; width: var(--cell); height: var(--cell); padding: calc(var(--cell) * 0.06); }
.m3-flyer .crop { width: 100%; height: 100%; }
.m3-tile.is-selected .m3-crop { scale: 1.16; }

/* Cursor: a thick ring that slides between cells. Picked: gold, thicker, with arrows on
   the sides a swap can go (shape + color, never color alone). */
.m3-cursor {
  position: absolute;
  z-index: 3;
  left: 0;
  top: 0;
  width: var(--cell);
  height: var(--cell);
  border: 4px solid var(--focus-border);
  border-radius: 14px;
  box-shadow: 0 0 0 3px var(--focus-ring), inset 0 0 0 3px var(--focus-ring);
  pointer-events: none;
  transition: transform 120ms var(--motion-ease-spring), opacity var(--motion-fast) ease;
}
.m3-cursor.is-selected { border-width: 5px; border-color: var(--select-border); box-shadow: 0 0 0 4px var(--select-ring), inset 0 0 0 3px var(--select-ring); }
.m3-cursor.is-hidden { opacity: 0; }
.m3-arrow { position: absolute; display: none; width: 0; height: 0; border: 9px solid transparent; }
.m3-cursor.is-selected[data-up="true"] .m3-arrow--up { display: block; left: calc(50% - 9px); top: -22px; border-bottom-color: var(--select-border); }
.m3-cursor.is-selected[data-down="true"] .m3-arrow--down { display: block; left: calc(50% - 9px); bottom: -22px; border-top-color: var(--select-border); }
.m3-cursor.is-selected[data-left="true"] .m3-arrow--left { display: block; top: calc(50% - 9px); left: -22px; border-right-color: var(--select-border); }
.m3-cursor.is-selected[data-right="true"] .m3-arrow--right { display: block; top: calc(50% - 9px); right: -22px; border-left-color: var(--select-border); }

/* Transient feedback (animated from JS with the Web Animations API, skipped in reduced motion). */
.m3-pop {
  position: absolute;
  z-index: 4;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: var(--cell);
  height: var(--cell);
  font-size: 24px;
  color: var(--coin-top);
  opacity: 0;
  pointer-events: none;
}
.m3-combo {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  top: calc(50% - 30px);
  width: fit-content;
  margin: 0 auto;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--surface-action-top), var(--surface-action-bottom));
  font-size: 30px;
  opacity: 0;
  pointer-events: none;
}
.m3-banner {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  width: max-content;
  max-width: 400px;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-panel-top), var(--surface-panel-bottom));
  box-shadow: var(--shadow-raised);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.94);
  transition: opacity var(--motion-base) ease, transform var(--motion-base) var(--motion-ease-spring);
  pointer-events: none;
}
.m3-banner.is-visible { opacity: 1; transform: translate(-50%, -50%); }
.m3-banner-title { font-size: var(--font-size-title); line-height: var(--line-height-tight); }
.m3-banner-line { margin-top: var(--space-2); font-size: 18px; line-height: var(--line-height-body); color: var(--color-text-muted); }
.m3-prompt {
  position: absolute;
  z-index: 6;
  inset: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-panel-top), var(--surface-panel-bottom));
  box-shadow: var(--shadow-raised);
}
.m3-prompt[hidden] { display: none; }
.m3-prompt .ui-button { width: 260px; }

/* ---------- Result ---------- */
.result-coins { display: flex; align-items: center; gap: var(--space-3); font-size: 56px; line-height: 1; }

/* ---------- Feedback: nudge + toast ---------- */
[data-nudge="left"] { animation: nudge-left 320ms ease-out; }
[data-nudge="right"] { animation: nudge-right 320ms ease-out; }
[data-nudge="up"] { animation: nudge-up 320ms ease-out; }
[data-nudge="down"] { animation: nudge-down 320ms ease-out; }
@keyframes nudge-left { 0%, 100% { translate: 0 0; } 24% { translate: calc(var(--motion-nudge-distance) * -1) 0; } 43% { translate: 4px 0; } 62% { translate: -3px 0; } 80% { translate: 1px 0; } }
@keyframes nudge-right { 0%, 100% { translate: 0 0; } 24% { translate: var(--motion-nudge-distance) 0; } 43% { translate: -4px 0; } 62% { translate: 3px 0; } 80% { translate: -1px 0; } }
@keyframes nudge-up { 0%, 100% { translate: 0 0; } 24% { translate: 0 calc(var(--motion-nudge-distance) * -1); } 43% { translate: 0 4px; } 62% { translate: 0 -3px; } 80% { translate: 0 1px; } }
@keyframes nudge-down { 0%, 100% { translate: 0 0; } 24% { translate: 0 var(--motion-nudge-distance); } 43% { translate: 0 -4px; } 62% { translate: 0 3px; } 80% { translate: 0 -1px; } }

.toast {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(var(--stage-size) - var(--safe-bottom) + var(--space-4)); /* stays above y=576 */
  width: max-content; /* left: 50% alone would cap the shrink-to-fit width at 300px */
  max-width: 480px;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--surface-panel-top), var(--surface-panel-bottom));
  font-size: 18px;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity var(--motion-base) ease, transform var(--motion-base) var(--motion-ease-out);
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast[data-tone="good"] { color: var(--color-good); }
.toast[data-tone="warn"] { color: var(--color-warn); }

/* ---------- Production FPS meter (passive) ---------- */
.performance-overlay {
  position: absolute; z-index: 9; top: var(--space-3); left: 50%; transform: translateX(-50%);
  display: flex; gap: var(--space-2); padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill); background: var(--surface-panel-bottom);
  font-size: var(--font-size-caption); pointer-events: none;
}

/* ---------- Reduced motion ---------- */
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after {
  animation-duration: 1ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 1ms !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
