/* Cleaver Chores: tokens, page shell, buttons, focus ring, reduced motion.
   Plain CSS. Later tasks append component rules below the marked sections. */

/* ---------- Tokens ---------- */
:root {
  /* Color */
  --color-primary: #F1BF68;
  --color-on-primary: #422C00;
  --color-primary-container: #B58938;
  --color-on-primary-container: #271900;
  --color-secondary: #D2C4B2;
  --color-on-secondary: #251913;
  --color-surface: #1C110B;
  --color-on-surface: #F5DED4;
  --color-surface-container-low: #251913;
  --color-surface-container: #291D17;
  --color-surface-container-high: #342721;
  --color-surface-container-highest: #3F322B;
  --color-on-surface-variant: #D2C4B2;
  --color-outline: #9B8F7E;
  --color-outline-variant: #4F4538;
  --color-paper: #F6F0E2;
  --color-on-paper: #1D1C13;
  --color-paper-dim: #E8E2D4;
  --color-on-paper-dim: #49473D;
  --color-paper-outline: #CBC6B9;
  --color-brass: #D3A450;
  --color-on-brass: #271900;
  --color-brass-subtle: #5F4100;
  --color-on-brass-subtle: #FFDEAA;
  --color-error: #BA1A1A;
  /* Error text on the dark walnut surface (the paper-tone error fails 4.5:1 there) */
  --color-error-on-surface: #FFB4AB;
  --color-on-error: #FFFFFF;

  /* Walnut grain: glows and grain lines as channels so rules stay token based */
  --color-glow-purple: rgba(132, 74, 178, 0.38);
  --color-glow-purple-mid: rgba(92, 52, 132, 0.18);
  --color-glow-teal: rgba(42, 136, 116, 0.32);
  --color-glow-teal-mid: rgba(32, 96, 84, 0.14);
  --color-glow-violet: rgba(122, 68, 164, 0.34);
  --color-glow-violet-mid: rgba(82, 46, 114, 0.14);
  --color-grain-light: rgba(255, 222, 170, 0.015);
  --color-grain-dark: rgba(10, 5, 2, 0.16);
  --color-shadow: rgba(8, 4, 1, 0.5);
  --color-shadow-strong: rgba(8, 4, 1, 0.65);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-section: 48px;
  --space-page-margin: 32px;

  /* Size */
  --size-touch: 44px;
  --size-bubble-tail: 14px;
  --size-cut-row: 64px;
  --size-drop-area: 120px;
  --size-mascot-dock: 120px;
  --size-content-max: 1152px;
  --size-focus-ring: 3px;
  --size-focus-gap: 2px;
  --size-border: 1px;
  --size-border-strong: 2px;

  /* Radius */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Type families, with system fallbacks */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-headline: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Type scale: size / line height / letter spacing / weight */
  --font-size-display-lg: 44px;
  --line-height-display-lg: 52px;
  --letter-spacing-display-lg: -0.5px;
  --font-size-display-lg-mobile: 32px;
  --line-height-display-lg-mobile: 38px;
  --letter-spacing-display-lg-mobile: -0.25px;
  --font-size-headline-lg: 32px;
  --line-height-headline-lg: 40px;
  --font-size-headline-xl: 28px;
  --line-height-headline-xl: 36px;
  --font-size-title-lg: 18px;
  --line-height-title-lg: 26px;
  --font-size-headline-md: 24px;
  --line-height-headline-md: 30px;
  --letter-spacing-headline-md: -0.15px;
  --font-size-headline-sm: 20px;
  --line-height-headline-sm: 26px;
  --font-size-title-md: 16px;
  --line-height-title-md: 24px;
  --font-size-body-lg: 16px;
  --line-height-body-lg: 24px;
  --font-size-body-md: 14px;
  --line-height-body-md: 22px;
  --font-size-label-lg: 14px;
  --line-height-label-lg: 20px;
  --letter-spacing-label-lg: 0.25px;
  --font-size-label-md: 12px;
  --line-height-label-md: 16px;
  --letter-spacing-label-md: 0.4px;
  --font-size-label-sm: 11px;
  --line-height-label-sm: 14px;
  --letter-spacing-label-sm: 0.5px;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;

  /* Motion */
  --duration-fast: 150ms;
  --duration-base: 240ms;
  --duration-slow: 400ms;
  --duration-glow: 600ms;
  --duration-react: 500ms;
  --duration-wave: 900ms;
  --hop-height: 12px;
  --hop-tilt: 10deg;
  --wave-bob: 8px;
  --wave-up: -35deg;
  --wave-down: 15deg;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);

  /* Elevation */
  --shadow-button: 0 4px 8px -2px var(--color-shadow);
  --shadow-ticket: 0 8px 18px -6px var(--color-shadow), 0 2px 4px var(--color-shadow);
  --shadow-lift: 0 18px 32px -8px var(--color-shadow-strong), 0 6px 12px var(--color-shadow);
  --shadow-plate: inset 0 2px 12px var(--color-grain-dark), 0 18px 36px -12px var(--color-shadow-strong);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--color-surface);
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--color-surface);
  color: var(--color-on-surface);
  font-family: var(--font-body);
  font-size: var(--font-size-body-lg);
  line-height: var(--line-height-body-lg);
  font-weight: var(--font-weight-regular);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

h1 {
  font-family: var(--font-display);
  font-size: var(--font-size-display-lg-mobile);
  line-height: var(--line-height-display-lg-mobile);
  letter-spacing: var(--letter-spacing-display-lg-mobile);
  font-weight: var(--font-weight-semibold);
}

h2 {
  font-family: var(--font-headline);
  font-size: var(--font-size-headline-md);
  line-height: var(--line-height-headline-md);
  letter-spacing: var(--letter-spacing-headline-md);
  font-weight: var(--font-weight-semibold);
}

h3 {
  font-family: var(--font-headline);
  font-size: var(--font-size-headline-sm);
  line-height: var(--line-height-headline-sm);
  font-weight: var(--font-weight-semibold);
}

/* The step heading receives programmatic focus on step change (R1.8). */
h1:focus {
  outline: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Page shell and walnut background ---------- */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-surface);
  background-image:
    radial-gradient(ellipse 70% 60% at 85% 15%, var(--color-glow-purple) 0%, var(--color-glow-purple-mid) 45%, transparent 75%),
    radial-gradient(ellipse 65% 55% at 90% 52%, var(--color-glow-teal) 0%, var(--color-glow-teal-mid) 48%, transparent 78%),
    radial-gradient(ellipse 60% 50% at 80% 88%, var(--color-glow-violet) 0%, var(--color-glow-violet-mid) 45%, transparent 75%),
    repeating-linear-gradient(92deg, var(--color-grain-light) 0, var(--color-grain-light) 2px, transparent 2px, transparent 14px),
    repeating-linear-gradient(89deg, var(--color-grain-dark) 0, var(--color-grain-dark) 3px, transparent 3px, transparent 22px);
}

.shell {
  width: 100%;
  max-width: var(--size-content-max);
  margin-inline: auto;
  padding: var(--space-xl) var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-section);
}

.shell-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.shell-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-size: var(--font-size-headline-md);
  line-height: var(--line-height-headline-md);
  letter-spacing: var(--letter-spacing-headline-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-on-surface);
}

.brand-tagline {
  font-size: var(--font-size-body-md);
  line-height: var(--line-height-body-md);
  color: var(--color-on-surface-variant);
}

.step-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: var(--size-border) solid var(--color-outline-variant);
  border-radius: var(--radius-full);
  background-color: var(--color-surface-container);
  color: var(--color-primary);
  font-size: var(--font-size-label-md);
  line-height: var(--line-height-label-md);
  letter-spacing: var(--letter-spacing-label-md);
  font-weight: var(--font-weight-medium);
}

.step-pill::before {
  content: "";
  width: var(--space-sm);
  height: var(--space-sm);
  border-radius: var(--radius-full);
  background-color: var(--color-primary);
}

.shell-intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 65ch;
}

.shell-intro p {
  color: var(--color-on-surface-variant);
}

.shell-main {
  flex: 1;
}

/* ---------- Buttons (min 44px by 44px, including touch target) ---------- */
button {
  font: inherit;
  color: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-width: var(--size-touch);
  min-height: var(--size-touch);
  padding: var(--space-sm) var(--space-lg);
  border: var(--size-border-strong) solid transparent;
  border-radius: var(--radius-lg);
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  font-family: var(--font-body);
  font-size: var(--font-size-label-lg);
  line-height: var(--line-height-label-lg);
  letter-spacing: var(--letter-spacing-label-lg);
  font-weight: var(--font-weight-semibold);
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-button);
  touch-action: manipulation;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.btn:hover {
  background-color: var(--color-brass);
}

.btn:active {
  transform: scale(0.96);
}

/* Disabled: dashed outline, no shadow and a not-allowed cursor, so the state
   does not depend on color alone (R11.3). */
.btn:disabled,
.btn[aria-disabled="true"] {
  background-color: var(--color-surface-container-high);
  color: var(--color-on-surface-variant);
  border-style: dashed;
  border-color: var(--color-outline);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: none;
}

.btn-secondary:hover {
  background-color: var(--color-brass-subtle);
  color: var(--color-on-brass-subtle);
}

/* ---------- Focus ring: brass, visible on dark and on paper ---------- */
:focus-visible {
  outline: var(--size-focus-ring) solid var(--color-brass);
  outline-offset: var(--size-focus-gap);
  box-shadow: 0 0 0 var(--size-focus-gap) var(--color-surface);
}

/* ---------- Responsive ---------- */
@media (min-width: 768px) {
  .shell {
    padding: var(--space-section);
  }

  h1 {
    font-size: var(--font-size-display-lg);
    line-height: var(--line-height-display-lg);
    letter-spacing: var(--letter-spacing-display-lg);
  }
}

/* ---------- The CUT moment ---------- */
.mascot {
  transform-origin: 51% 86%;
  /* handle base of the cleaver */
}

.mascot.mascot--raise {
  transform: translateY(calc(var(--space-sm) * -2)) rotate(-16deg);
  transition: transform var(--duration-base) var(--ease-out);
}

.mascot.mascot--chop {
  transform: translateY(var(--space-md)) rotate(8deg);
  transition: transform var(--duration-fast) var(--ease-out);
}

.plates--apart>.plate-wrap {
  transition: transform 300ms var(--ease-out);
}

.plates--apart>.plate-wrap:first-child {
  transform: translateX(calc(var(--space-lg) * -1));
}

.plates--apart>.plate-wrap:last-child {
  transform: translateX(var(--space-lg));
}

.page--shake {
  animation: shake var(--duration-base) var(--ease-out);
}

@keyframes shake {

  0%,
  100% {
    transform: translate(0, 0);
  }

  20% {
    transform: translate(-6px, 2px);
  }

  40% {
    transform: translate(5px, -2px);
  }

  60% {
    transform: translate(-3px, 1px);
  }

  80% {
    transform: translate(2px, 0);
  }
}

.plates-caption {
  transition: opacity var(--duration-fast) var(--ease-out);
}

.plates-caption.is-hidden {
  opacity: 0;
}

.step-cut.is-locked {
  pointer-events: none;
}

.step.is-entering {
  opacity: 0;
}

.step {
  transition: opacity var(--duration-base) var(--ease-out);
}

/* ---------- Error step ---------- */
.step-error {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.step[hidden] {
  display: none;
}

.plate-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.check {
  display: inline-flex;
  color: var(--color-primary);
}

.check[hidden] {
  display: none;
}

.check path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw var(--duration-slow) var(--ease-out) var(--duration-base) forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.result-actions {
  display: flex;
  justify-content: center;
}

.envy-ghost {
  display: block;
  margin-inline: auto;
}

.envy-ghost--peek {
  position: absolute;
  bottom: 0;
  left: 4px;
  transform: translateY(8px);
  animation: ghost-peek var(--duration-slow) var(--ease-out) var(--duration-slow) backwards;
}

@keyframes ghost-peek {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(8px);
  }
}

/* ---------- Mascot slots ---------- */
.mascot-slot--logo .mascot {
  height: calc(var(--space-xl) + var(--space-sm));
  width: auto;
}

.mascot-slot--large .mascot {
  height: 220px;
  width: auto;
  margin-inline: auto;
}

/* Coach strip layout (crossfade comes with the coach task) */
.coach {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border: var(--size-border) solid var(--color-outline-variant);
  border-radius: var(--radius-xl);
  background-color: var(--color-surface-container);
}

.coach-icon {
  flex: none;
  color: var(--color-primary);
}

.coach-body {
  flex: 1;
  min-width: 220px;
}

.coach-label {
  font-size: var(--font-size-label-md);
  line-height: var(--line-height-label-md);
  letter-spacing: var(--letter-spacing-label-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
}

/* Two stacked layers: the new text goes into the hidden one, then opacity swaps. */
.coach-text {
  display: grid;
}

.coach-layer {
  grid-area: 1 / 1;
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out);
}

.coach-layer.is-live {
  opacity: 1;
}

.coach-figure {
  font-size: var(--font-size-label-lg);
  line-height: var(--line-height-label-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-on-surface-variant);
}

@media (min-width: 768px) {
  .plates {
    grid-template-columns: 1fr auto 1fr;
  }

  .plates-center {
    align-self: center;
    min-width: 200px;
  }
}

/* ---------- Who's home ---------- */
.home-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  max-width: 560px;
}

.home-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  min-height: var(--size-touch);
  padding: var(--space-md);
  border: var(--size-border-strong) solid var(--color-paper-outline);
  border-radius: var(--radius-lg);
  background-color: var(--color-paper);
  color: var(--color-on-paper);
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.home-choice:hover {
  border-color: var(--color-brass);
}

.home-choice:active {
  transform: scale(0.97);
}

.home-choice-num {
  font-family: var(--font-display);
  font-size: var(--font-size-display-lg);
  line-height: 1;
  font-weight: var(--font-weight-semibold);
}

.home-choice-label {
  font-size: var(--font-size-body-md);
  color: var(--color-on-paper-dim);
}

.home-choice-state {
  min-height: var(--line-height-label-lg);
  font-size: var(--font-size-label-lg);
  font-weight: var(--font-weight-semibold);
}

.home-choice[aria-pressed="true"] {
  border-color: var(--color-on-brass);
  background-color: var(--color-brass);
  color: var(--color-on-brass);
}

.home-choice[aria-pressed="true"] .home-choice-label {
  color: var(--color-on-brass);
}

.home-roster {
  margin: var(--space-md) 0;
  color: var(--color-on-surface-variant);
}

@media (prefers-reduced-motion: reduce) {
  .home-choice {
    transition: none;
  }

  .home-choice:active {
    transform: none;
  }
}

/* ====================================================================
   Redesign: stage banner, top tray Cut, Pick queue, Own settle.
   Motion rules: transform and opacity only, 150 to 400ms, ease-out.
   ==================================================================== */
:root {
  --z-lifted: 20;
  --z-drag: 50;
  --z-fly: 60;
  --color-hint-ring: rgba(241, 191, 104, 0.55);
}

/* ---------- One-screen shell at 1280px ---------- */
.shell {
  max-width: 1216px;
  padding: var(--space-md) var(--space-xl);
  gap: var(--space-md);
}

.shell-header {
  gap: 0;
}

.brand-tagline {
  display: none;
}

.mascot-slot--logo {
  min-width: var(--space-xl);
}

.step {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.step-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.rate-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border: var(--size-border) solid var(--color-outline-variant);
  border-radius: var(--radius-xl);
  background-color: var(--color-surface-container);
}

/* ---------- Stage banner ---------- */
.stage-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  border: var(--size-border) solid var(--color-outline-variant);
  border-radius: var(--radius-xl);
  background-color: var(--color-surface-container);
}

.stage-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stage-step {
  font-size: var(--font-size-label-lg);
  line-height: var(--line-height-label-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
}

.stage-banner h1 {
  font-size: var(--font-size-headline-xl);
  line-height: var(--line-height-headline-xl);
  letter-spacing: var(--letter-spacing-headline-md);
}

.stage-progress {
  flex: none;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  background-color: var(--color-brass-subtle);
  color: var(--color-on-brass-subtle);
  font-size: var(--font-size-label-lg);
  line-height: var(--line-height-label-lg);
  font-weight: var(--font-weight-semibold);
  font-variant-numeric: tabular-nums;
}

.is-swap {
  animation: swap var(--duration-fast) var(--ease-out);
}

/* ---------- Dock: mascot, coach line, Cut button ---------- */
.dock {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  /* Sticky to the viewport bottom on every step so the coach is always in view. */
  position: sticky;
  bottom: 0;
  z-index: 10;
  max-height: 30vh;
  overflow-y: auto;
  padding: var(--space-sm) var(--space-md);
  padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom, 0px));
  background-color: var(--color-surface);
  border-top: var(--size-border) solid var(--color-outline-variant);
}

.mascot-slot--dock {
  flex: none;
  min-width: 80px;
}

.mascot-slot--dock .mascot {
  height: var(--size-mascot-dock);
  width: auto;
}

.dock .coach {
  flex: 1;
  padding: var(--space-sm) var(--space-lg);
}

.dock .coach-body {
  min-width: 0;
}

.coach-layer {
  font-size: var(--font-size-body-lg);
  line-height: var(--line-height-body-lg);
}

.cut-action {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  width: 220px;
}

.btn-cut {
  width: 100%;
  min-height: 52px;
  font-size: var(--font-size-title-md);
}

.btn-cut.is-ready:not(:disabled) {
  box-shadow: 0 0 0 3px var(--color-hint-ring), var(--shadow-button);
}

.plates-caption {
  font-family: var(--font-body);
  font-size: var(--font-size-label-lg);
  line-height: var(--line-height-label-lg);
  color: var(--color-on-surface-variant);
  text-align: center;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.plates-caption.is-hidden {
  opacity: 0;
}

/* Auto-fill plates: secondary action under CUT. Stays focusable when unavailable (aria-disabled). */
.btn-autofill {
  width: 100%;
  min-height: var(--size-touch);
}

.btn-autofill[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-autofill[aria-disabled="true"]:hover {
  background-color: transparent;
  color: var(--color-primary);
}

@media (max-width: 767.98px) {
  .btn-autofill {
    width: 100%;
  }
}

/* ---------- Cut: the top tray ---------- */
.tray {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md) var(--space-md);
  border: var(--size-border-strong) dashed var(--color-outline);
  border-radius: var(--radius-xl);
  background-color: var(--color-surface-container-low);
}

.tray-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-xs) var(--space-md);
}

.tray-title {
  font-size: var(--font-size-headline-sm);
  line-height: var(--line-height-headline-sm);
}

.tray-note {
  font-size: var(--font-size-label-lg);
  line-height: var(--line-height-label-lg);
  color: var(--color-on-surface-variant);
}

.skull-legend {
  font-size: var(--font-size-label-lg);
  line-height: var(--line-height-label-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
}
.cut-list {
  list-style: none;
  margin: 0;
  padding: 3px;
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 4), auto);
  gap: var(--space-sm) var(--space-md);
}

.cut-row {
  /* Name block keeps at least 10rem. When the tools (skulls, buttons, x) do not fit beside it,
     they wrap to a second line and the name takes the full first line. */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  min-height: var(--size-cut-row);
  padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-sm);
  border: var(--size-border-strong) solid var(--color-paper-outline);
  border-radius: var(--radius-lg);
  background-color: var(--color-paper);
  color: var(--color-on-paper);
  box-shadow: var(--shadow-button);
  transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.cut-row.is-placed {
  background-color: var(--color-paper-dim);
}

/* Unrated rows are highlighted in order; the first one is the one to rate now. */
.cut-row.is-todo {
  border-style: dashed;
  border-color: var(--color-primary-container);
}

.cut-row.is-next {
  border-style: solid;
  border-color: var(--color-primary-container);
  box-shadow: 0 0 0 3px var(--color-hint-ring), var(--shadow-button);
}

.cut-row.is-selected {
  border-color: var(--color-on-paper);
  box-shadow: 0 0 0 3px var(--color-brass), var(--shadow-button);
}

.row-main {
  display: flex;
  flex: 1 1 10rem;
  align-items: center;
  gap: var(--space-sm);
  min-width: min(10rem, 100%);
  min-height: var(--size-touch);
  padding: 0 var(--space-xs);
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: grab;
  touch-action: manipulation;
}

.row-main[aria-disabled="true"] {
  cursor: default;
}

.row-main:not([aria-disabled="true"]):hover {
  background-color: rgba(29, 28, 19, 0.08);
}

.row-num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  background-color: var(--color-on-paper);
  color: var(--color-paper);
  font-size: var(--font-size-label-md);
  font-weight: var(--font-weight-semibold);
}

.is-todo .row-num {
  background-color: var(--color-primary-container);
  color: var(--color-on-primary-container);
}

.row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.row-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-title-lg);
  line-height: var(--line-height-title-lg);
  /* Never truncate the label: wrap at word boundaries and let the row grow.
     A single word longer than the column may still break, but never letter by letter. */
  overflow-wrap: break-word;
}

/* Parent chore above a chopped bite's label, so the two bites read as a pair. */
.row-chore {
  font-size: var(--font-size-label-md);
  line-height: var(--line-height-label-md);
  letter-spacing: var(--letter-spacing-label-md);
  font-weight: var(--font-weight-medium);
  color: var(--color-on-paper-dim);
  overflow-wrap: break-word;
}

.row-tools {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-xs);
  margin-inline-start: auto;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-xs);
}

.row-main.is-renaming {
  cursor: default;
}

.rename-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-width: 0;
}

.rename-error {
  color: var(--color-error);
  font-size: var(--font-size-label-lg);
  line-height: var(--line-height-label-lg);
  font-weight: var(--font-weight-semibold);
}

.rename-error:empty {
  display: none;
}

.row-where {
  font-size: var(--font-size-label-md);
  line-height: 14px;
  color: var(--color-on-paper-dim);
}

.skull-group {
  display: flex;
  gap: var(--space-sm);
  border-radius: var(--radius-lg);
}

.skull-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--size-touch);
  min-height: var(--size-touch);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--color-on-paper-dim);
  cursor: pointer;
  touch-action: manipulation;
}

.skull-btn svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
  transform-origin: 50% 60%;
}

.skull-btn:hover {
  background-color: rgba(29, 28, 19, 0.08);
}

.skull-btn.is-filled {
  color: var(--color-on-paper);
}

.skull-btn.is-filled svg {
  fill: currentColor;
}

.is-popping .skull-btn.is-filled svg {
  animation: skull-pop var(--duration-base) var(--ease-out) calc(var(--i) * 40ms) both;
}

.cut-row .btn-secondary {
  min-height: var(--size-touch);
  padding: 0 var(--space-md);
  border-color: var(--color-on-paper-dim);
  color: var(--color-on-paper);
}

.chop-btn,
.undo-btn,
.rename-btn {
  min-height: var(--size-touch);
  font-size: var(--font-size-body-lg);
}

.cut-row .btn-secondary:hover {
  background-color: var(--color-paper-outline);
  color: var(--color-on-paper);
}

.x-btn {
  min-width: var(--size-touch);
  min-height: var(--size-touch);
  border: var(--size-border) solid var(--color-paper-outline);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-on-paper);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.x-btn:hover {
  background-color: var(--color-paper-outline);
}

.x-btn:disabled {
  visibility: hidden;
}

/* ---------- Plates (Cut) ---------- */
.plates {
  display: grid;
  grid-template-columns: repeat(var(--plate-count, 2), minmax(0, 1fr));
  gap: var(--space-md);
  align-items: stretch;
}

.plate-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.plate {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md) var(--space-md);
  border: var(--size-border-strong) solid var(--color-outline-variant);
  border-radius: var(--radius-xl);
  background-color: var(--color-surface-container-high);
  box-shadow: var(--shadow-plate);
  transition: border-color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}

.plate-head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: var(--size-touch);
}

.plate-head h2 {
  font-size: var(--font-size-headline-sm);
  line-height: var(--line-height-headline-sm);
  flex: 1;
  min-width: 0;
}

.plate-count {
  font-size: var(--font-size-label-lg);
  line-height: var(--line-height-label-lg);
  color: var(--color-on-surface-variant);
}

.plate-total {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: var(--font-size-headline-xl);
  line-height: var(--line-height-headline-xl);
  font-variant-numeric: tabular-nums;
}

.plate-total strong {
  font-weight: var(--font-weight-semibold);
}

.total-skull {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.plate-total.is-bump {
  animation: bump var(--duration-base) var(--ease-out);
}

.place-btn {
  min-height: var(--size-touch);
  padding: 0 var(--space-md);
}

.place-btn:disabled {
  visibility: hidden;
}

.plate-chips {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: var(--space-sm);
  flex: 1;
  min-height: var(--size-drop-area);
  padding: var(--space-sm);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface-container-low);
  box-shadow: inset 0 2px 10px var(--color-grain-dark);
}

.plate-chips:empty::before {
  content: "Drop chores here";
  align-self: center;
  padding-inline: var(--space-sm);
  font-size: var(--font-size-label-lg);
  color: var(--color-on-surface-variant);
}

.plate-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: var(--size-touch);
  padding: 0 var(--space-md);
  border: var(--size-border) solid var(--color-paper-outline);
  border-radius: var(--radius-md);
  background-color: var(--color-paper);
  color: var(--color-on-paper);
  font-size: var(--font-size-body-lg);
  font-weight: var(--font-weight-semibold);
  box-shadow: var(--shadow-button);
  cursor: grab;
  touch-action: manipulation;
}

.plate-chip.is-selected {
  outline: 3px solid var(--color-brass);
  outline-offset: 2px;
}

.chip-score {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--color-on-paper-dim);
}

.chip-skull {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.plate.is-target {
  border-color: var(--color-primary);
  cursor: pointer;
}

.plates--await .plate.is-target {
  animation: plate-pulse 1.2s ease-in-out infinite;
}

.plate.is-empty:not(.is-target) .plate-chips {
  outline: 2px dashed var(--color-outline);
  outline-offset: -2px;
}

.is-over {
  outline: var(--size-border-strong) dashed var(--color-brass);
  outline-offset: var(--space-xs);
  background-color: var(--color-brass-subtle);
}

.plate.is-over,
.tray.is-over {
  background-color: var(--color-brass-subtle);
}

.is-drag-origin {
  opacity: 0.4;
}

.drag-ghost {
  position: fixed;
  z-index: var(--z-drag);
  margin: 0;
  background-color: var(--color-paper);
  color: var(--color-on-paper);
  border-radius: var(--radius-lg);
  pointer-events: none;
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}

.drag-ghost.is-lifted {
  transform: scale(1.04);
  box-shadow: var(--shadow-lift);
}

.is-flying {
  position: relative;
  z-index: var(--z-lifted);
}

/* ---------- Pick ---------- */
.queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.queue-chip {
  display: inline-flex;
  align-items: center;
  min-height: var(--size-touch);
  padding: 0 var(--space-lg);
  border: var(--size-border-strong) solid var(--color-outline-variant);
  border-radius: var(--radius-full);
  background-color: var(--color-surface-container);
  color: var(--color-on-surface);
  font-size: var(--font-size-body-md);
  font-weight: var(--font-weight-semibold);
}

.queue-chip.is-last {
  border-style: dashed;
  border-color: var(--color-outline);
}

.queue-chip.is-done {
  border-color: var(--color-brass-subtle);
  background-color: var(--color-brass-subtle);
  color: var(--color-on-brass-subtle);
}

.queue-chip.is-now {
  border-color: var(--color-primary);
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  animation: chip-now var(--duration-base) var(--ease-out) both;
}

.queue-chip.is-tick {
  animation: tick var(--duration-base) var(--ease-out) var(--duration-base) both;
}

.plates--pick .plate {
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out), opacity var(--duration-base) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.plates--pick .plate:not(.is-taken):hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
}

.plates--pick .plate.is-taken {
  cursor: default;
  opacity: 0.55;
}

.plates--pick .plate.is-landing {
  animation: settle var(--duration-slow) var(--ease-out) both;
}

.plate-list.pick-bites,
.plate-list.own-bites {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  align-content: flex-start;
}

.plate-list li {
  padding: var(--space-xs) var(--space-md);
  border: var(--size-border) solid var(--color-paper-outline);
  border-radius: var(--radius-md);
  background-color: var(--color-paper);
  color: var(--color-on-paper);
  font-size: var(--font-size-body-md);
  font-weight: var(--font-weight-semibold);
}

.plate-foot {
  display: flex;
}

.plate-foot .btn {
  flex: 1;
}

.take-btn {
  min-height: var(--size-touch);
}

.pick-taken {
  min-height: var(--size-touch);
  display: flex;
  align-items: center;
  font-weight: var(--font-weight-semibold);
  color: var(--color-on-surface-variant);
}

/* ---------- Own ---------- */
.own-card {
  position: relative;
  padding: var(--space-sm) var(--space-md) var(--space-md);
  border: var(--size-border-strong) solid var(--color-outline-variant);
  border-radius: var(--radius-xl);
  background-color: var(--color-surface-container-high);
  box-shadow: var(--shadow-plate);
}

.own-card .plate-head h2 {
  font-size: var(--font-size-title-md);
  line-height: var(--line-height-title-md);
}

.own-picked {
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
}

.own-totals {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--font-size-label-lg);
  color: var(--color-on-surface-variant);
}

.envy-ghost-slot--own {
  position: relative;
  height: 56px;
  width: 64px;
  overflow: hidden;
  pointer-events: none;
}

.agree-btn {
  align-self: flex-start;
}

.agree-btn .check svg {
  width: 20px;
  height: 20px;
}

.agree-btn.is-pressed {
  animation: press var(--duration-fast) var(--ease-out);
}

.own-actions {
  margin-top: var(--space-xs);
}

.own-actions .btn {
  min-width: 200px;
}

/* ---------- Idle hint: a gentle pulse on the next thing to act on ---------- */
.is-hint {
  animation: hint-pulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 3px var(--color-hint-ring);
}

/* ---------- Mascot reactions ---------- */
.mascot--swing {
  animation: swing 400ms var(--ease-out);
}

.mascot--proud {
  animation: proud 400ms var(--ease-out);
}

/* ---------- Step change: banner, body and dock slide in ---------- */
.step.is-in .stage-banner {
  animation: rise var(--duration-base) var(--ease-out) both;
}

.step.is-in .step-body {
  animation: from-right var(--duration-slow) var(--ease-out) 60ms both;
}

.step.is-in .dock {
  animation: rise var(--duration-base) var(--ease-out) 140ms both;
}

.step.is-in .own-card {
  animation: settle var(--duration-slow) var(--ease-out) calc(160ms + var(--i, 0) * 70ms) both;
}

/* ---------- Keyframes (rise, from-right, press and hop come from the earlier design) ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(var(--space-md));
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes from-right {
  from {
    opacity: 0;
    transform: translateX(var(--space-xl));
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes press {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.96);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes hop {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(calc(var(--space-md) * -1));
  }
}

@keyframes swap {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes skull-pop {
  0% {
    opacity: 0.2;
    transform: scale(0.5);
  }

  60% {
    opacity: 1;
    transform: scale(1.18);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bump {

  0%,
  100% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.18);
  }
}

@keyframes plate-pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.015);
  }
}

@keyframes hint-pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes chip-now {
  from {
    opacity: 0.6;
    transform: scale(0.94);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes tick {
  from {
    opacity: 0.6;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes swing {
  0% {
    transform: none;
  }

  35% {
    transform: translateY(-8px) rotate(-22deg);
  }

  60% {
    transform: translateY(6px) rotate(14deg);
  }

  100% {
    transform: none;
  }
}

@keyframes proud {

  0%,
  100% {
    transform: none;
  }

  40% {
    transform: translateY(-14px) scale(1.06);
  }
}

/* ---------- Coach: speech bubble and attention ---------- */
.dock .coach {
  position: relative;
}

/* Tail pointing left at the mascot. It inherits the bubble's border colour, so it glows with it. */
.dock .coach::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(var(--size-bubble-tail) / -2 - var(--size-border));
  width: var(--size-bubble-tail);
  height: var(--size-bubble-tail);
  box-sizing: border-box;
  border-style: solid;
  border-width: 0 0 var(--size-border) var(--size-border);
  border-color: inherit;
  background-color: var(--color-surface-container);
  transform: translateY(-50%) rotate(45deg);
}

/* New text slides up and fades in. */
.dock .coach-layer.is-live {
  animation: rise var(--duration-base) var(--ease-out) both;
}

.coach--glow {
  animation: coach-glow var(--duration-glow) var(--ease-out);
}

.mascot--hop {
  animation: hop-tilt var(--duration-react) var(--ease-out);
}

.mascot--wave {
  animation: bob var(--duration-wave) var(--ease-out);
}

/* Pivot on the shoulder: the arm's own box, at its left edge near the bottom */
.mascot--wave [data-part="arm-right"] {
  transform-box: fill-box;
  transform-origin: 0% 85%;
  animation: wave-arm var(--duration-wave) ease-in-out;
}

@keyframes coach-glow {

  0%,
  100% {
    border-color: var(--color-outline-variant);
  }

  40% {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 var(--size-border-strong) var(--color-hint-ring);
  }
}

/* hop, plus a tilt toward the bubble (the bubble sits to the right of the mascot) */
@keyframes hop-tilt {

  0%,
  100% {
    transform: none;
  }

  50% {
    transform: translateY(calc(var(--hop-height) * -1)) rotate(var(--hop-tilt));
  }
}

@keyframes bob {

  0%,
  100% {
    transform: none;
  }

  30% {
    transform: translateY(calc(var(--wave-bob) * -1));
  }
}

/* Three waves, each from raised to lowered */
@keyframes wave-arm {

  0%,
  100% {
    transform: none;
  }

  10%,
  40%,
  70% {
    transform: rotate(var(--wave-up));
  }

  25%,
  55%,
  85% {
    transform: rotate(var(--wave-down));
  }
}

/* ---------- Who's home: chore list editor ---------- */
.chore-editor {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 0;
}

.chore-editor h2 {
  font-size: var(--font-size-headline-sm);
  line-height: var(--line-height-headline-sm);
}

.chore-editor-hint {
  color: var(--color-on-surface-variant);
  font-size: var(--font-size-body-md);
  line-height: var(--line-height-body-md);
}

.chore-add {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.chore-add-label {
  font-size: var(--font-size-label-lg);
  line-height: var(--line-height-label-lg);
  font-weight: var(--font-weight-semibold);
}

.chore-add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}

.chore-input {
  flex: 1;
  min-width: 0;
  min-height: var(--size-touch);
  padding: 0 var(--space-md);
  border: var(--size-border-strong) solid var(--color-paper-outline);
  border-radius: var(--radius-lg);
  background-color: var(--color-paper);
  color: var(--color-on-paper);
  font-family: var(--font-body);
  font-size: var(--font-size-body-lg);
  line-height: var(--line-height-body-lg);
}

.chore-input:hover {
  border-color: var(--color-brass);
}

.chore-input[aria-invalid="true"] {
  border-color: var(--color-error);
  border-style: dashed;
}

/* Chores as chips that wrap across the full width. */
.chore-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* About 36px tall: a 20px line plus 8px above and below. */
.chore-row {
  display: inline-flex;
  align-items: center;
  border: var(--size-border) solid var(--color-paper-outline);
  border-radius: var(--radius-full);
  background-color: var(--color-paper);
  color: var(--color-on-paper);
}

.chore-chip-name {
  padding: var(--space-sm) 0 var(--space-sm) var(--space-md);
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: inherit;
  font-family: var(--font-body);
  font-size: var(--font-size-label-lg);
  line-height: var(--line-height-label-lg);
  font-weight: var(--font-weight-semibold);
  cursor: text;
  touch-action: manipulation;
}

.chore-chip-name:hover {
  text-decoration: underline;
  text-underline-offset: var(--space-xs);
}

/* The x keeps a 44px hit area; the negative block margin keeps the chip at about 36px,
   and the padded content box draws a 28px circle. */
.chore-remove {
  flex: none;
  width: var(--size-touch);
  height: var(--size-touch);
  margin-block: calc(var(--space-xs) * -1);
  padding: var(--space-sm);
  border: 0;
  border-radius: var(--radius-full);
  background-color: var(--color-paper-dim);
  background-clip: content-box;
  color: var(--color-on-paper);
  font-family: var(--font-body);
  font-size: var(--font-size-title-md);
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.chore-remove:hover {
  background-color: var(--color-paper-outline);
}

.chore-remove[aria-disabled="true"] {
  background-color: transparent;
  color: var(--color-on-paper-dim);
  cursor: not-allowed;
}

/* While renaming, the chip becomes a full-width field with its reason below. */
.chore-row.is-editing {
  flex-basis: 100%;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-sm);
  padding: var(--space-xs);
  border-radius: var(--radius-lg);
}

.chore-row.is-editing .chore-input {
  min-height: var(--space-xl);
}

.chore-row .chore-error {
  flex-basis: 100%;
  padding-inline: var(--space-sm);
  color: var(--color-error);
}

.chore-note {
  font-size: var(--font-size-label-lg);
  line-height: var(--line-height-label-lg);
  color: var(--color-on-surface-variant);
}

.chore-note:empty {
  display: none;
}

#chore-add-error {
  color: var(--color-error-on-surface);
  font-weight: var(--font-weight-semibold);
}

.chore-row .chore-error {
  font-weight: var(--font-weight-semibold);
}

/* Home: two equal-height cards side by side from 1024px; stacked below. */
.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-lg);
  align-items: stretch;
}

.home-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
  border: var(--size-border-strong) solid var(--color-outline-variant);
  border-radius: var(--radius-xl);
  background-color: var(--color-surface-container-high);
  box-shadow: var(--shadow-plate);
}

.home-card .home-roster {
  margin: 0;
}

@media (min-width: 1024px) {
  .home-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-xl);
  }

  .home-card {
    padding: var(--space-xl);
  }

  .home-layout .home-choices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.home-actions {
  display: flex;
  justify-content: flex-end;
  margin-block: var(--space-md);
}

/* Home only: centre the content in the viewport, drop the empty logo slot. */
.page:has(#step-home:not([hidden])) .shell-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.page:has(#step-home:not([hidden])) .mascot-slot--logo {
  display: none;
}

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
  .shell {
    padding: var(--space-md);
  }

  .cut-list {
    grid-auto-flow: row;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    max-height: none;
  }

  .plates {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .stage-banner,
  .dock {
    flex-wrap: wrap;
  }

  .cut-action {
    width: 100%;
  }

  .dock .coach::before {
    display: none;
  }
}

/* ---------- Reduced motion: final state, instantly ---------- */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .check path {
    stroke-dashoffset: 0;
  }

  .drag-ghost.is-lifted {
    transform: none;
  }

  .envy-ghost--peek {
    animation: none !important;
    transform: translateY(8px);
  }

  /* Coach: no hop, wave, slide or glow. Only an instant border colour change. */
  .dock .coach-layer.is-live,
  .coach--glow,
  .mascot--hop,
  .mascot--wave,
  .mascot--wave [data-part="arm-right"] {
    animation: none !important;
  }

  .coach--flash {
    border-color: var(--color-primary);
    transition: none;
  }
}

/* The step heading takes programmatic focus; it needs no ring or halo. */
h1:focus,
h1:focus-visible {
  outline: none;
  box-shadow: none;
}

/* ---------- Narrow dock: mascot centred above a full-width bubble (R13.4, R13.5) ---------- */
@media (max-width: 479.98px) {
  .dock {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    padding-bottom: calc(var(--space-xs) + env(safe-area-inset-bottom, 0px));
  }
  .mascot-slot--dock .mascot {
    height: 48px;
  }
  .dock .coach-body {
    min-width: 0;
  }
  .dock .coach-layer {
    font-size: var(--font-size-body-md);
    line-height: var(--line-height-body-md);
  }

  .mascot-slot--dock {
    align-self: center;
    min-width: 0;
  }

  .dock .coach {
    width: 100%;
    padding: var(--space-xs) var(--space-md);
    gap: var(--space-sm);
    flex: none;
  }
}