/* Wizard component (Task 7c). DS-49 (Shane, 2 November 2026, replacing the fixed-height scroller of 31 October): a
   step is as tall as its content, never shorter than its art square plus padding, and nothing inside the card has its
   own scroll, so the page is the one scroll container and the wheel works anywhere. The footer stays sticky at the
   bottom of the viewport, so Next is always in reach. */
.ds-wizard { --ds-wiz-min: calc(144px + 48px); }
.ds-wizard-head { position: sticky; top: var(--ds-topbar-h); z-index: 5; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 24px -48px 0; padding: 14px 48px 10px; background: var(--ds-surface-raised); border-bottom: 1px solid var(--ds-border-divider); }
.ds-wizard-count { margin: 0; color: var(--ds-text-tertiary); font-size: 13px; font-weight: 600; }
.ds-wizard-title { margin: 0; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* one line, so the head never changes height */
.ds-progress { display: flex; gap: 4px; margin: 10px 0 0; padding: 0; list-style: none; }
.ds-progress li { flex: 1; min-width: 0; }
/* a 4px segment per step, with a 12px hit area; the numbers live in the header, never on the rail */
.ds-progress button { display: block; width: 100%; height: 12px; padding: 4px 0; border: 0; background: none; font-size: 0; cursor: pointer; }
.ds-progress button::before { content: ""; display: block; height: 4px; border-radius: 2px; background: var(--ds-border-divider); transition: background-color 0.15s cubic-bezier(0, 0, 0.2, 1), box-shadow 0.15s cubic-bezier(0, 0, 0.2, 1); }
.ds-progress button > * { display: none; }
/* 1 Nov 2026 (Shane): current solid brand, done a lighter brand tint over the surface, upcoming grey; no glow */
.ds-progress { --ds-step-done: color-mix(in srgb, var(--ds-brand) 38%, var(--ds-surface-raised)); }
.ds-progress button.is-done::before { background: var(--ds-step-done); }
.ds-progress button[aria-current="step"]::before { background: var(--ds-brand); box-shadow: none; }
.ds-progress button:hover::before { background: var(--ds-brand-border); }
.ds-steps { min-height: var(--ds-wiz-min); margin: 0 -48px; padding: 24px 48px; }
.ds-steps:focus { outline: none; box-shadow: none !important; }
.ds-step[hidden], .ds-wizard-done[hidden] { display: none; }
.ds-step-art { float: right; width: 144px; height: 144px; margin: 0 0 16px 24px; overflow: hidden; border: 1px solid var(--ds-border-subtle); border-radius: var(--ds-r-card); }
.ds-step::after { content: ""; display: block; clear: both; }
.ds-wizard-done h2 { margin-top: 0; }
.ds-wizard-nav { position: sticky; bottom: var(--ds-dock-h, 0px); z-index: 4; display: flex; justify-content: space-between; align-items: center; height: 56px; margin: 0 -48px -40px; padding: 0 48px; background: var(--ds-surface-raised); border-top: 1px solid var(--ds-border-divider); border-radius: 0 0 var(--ds-r-card) var(--ds-r-card); }
.ds-wizard-nav .ds-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: 96px; height: 36px; padding: 0 12px; font-size: 14px; }
.ds-wizard-nav [data-step-prev] { justify-content: flex-start; border-color: transparent; background: none; color: var(--ds-text-secondary); }
.ds-wizard-nav [data-step-prev]:hover:not(:disabled) { color: var(--ds-text-primary); }
.ds-wizard-go { display: flex; align-items: center; gap: 16px; }
.ds-step-done { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--ds-text-secondary); font: 500 13px var(--ds-font); cursor: pointer; }
.ds-step-done:hover { color: var(--ds-text-primary); text-decoration: underline; }
.ds-step-done .ds-tick { color: var(--ds-text-tertiary); }
.ds-step-done[aria-pressed="true"] { color: var(--ds-brand-fg); }
.ds-step-done[aria-pressed="true"] .ds-tick { color: var(--ds-brand-fg); }
.ds-wizard-nav .ds-btn:hover { transform: none; }   /* Next must not move, not even by a hover scale */
@media (max-width: 859.98px) {
  .ds-wizard { --ds-wiz-min: calc(120px + 40px); }
  .ds-wizard-head { margin: 16px -16px 0; padding: 12px 16px; }
  .ds-steps { margin: 0 -16px; padding: 20px 16px; }
  .ds-wizard-nav { margin: 0 -16px -20px; padding: 0 16px; bottom: var(--ds-bar-h, 0px); }
  .ds-wizard-nav .ds-btn { width: 88px; }
  .ds-step-done span { display: none; }   /* the tick alone on a phone; its label is the aria-pressed state */
  .ds-step-art { float: none; width: 120px; height: 120px; margin: 0 0 16px; }
}
.ds-wizard-demo { margin: 12px 0 32px; box-shadow: none; }
.ds-wizard-demo .ds-wizard-head { position: static; margin-top: -40px; border-radius: var(--ds-r-card) var(--ds-r-card) 0 0; }
@media (max-width: 859.98px) { .ds-wizard-demo .ds-wizard-head { margin-top: -20px; } }
.ds-wizard-demo .ds-wizard-nav { position: static; }
.ds-wizard-nav [data-step-prev]:disabled { visibility: hidden; }   /* nothing to go back to: no stray chevron */

/* Step controls and the rail: no ring, clean and simple (Shane, 1 November 2026); keyboard focus shows as the hover colour. */
.ds-wizard :is(.ds-progress button, .ds-step-done, [data-step-prev], [data-step-next]):focus-visible { box-shadow: none !important; }
.ds-progress button:focus-visible::before { background: var(--ds-brand-border); }
.ds-wizard :is(.ds-step-done, [data-step-prev]):focus-visible { color: var(--ds-text-primary); }
/* DS-65 step transition (round 7): the outgoing step fades and slides 8px up while the new one rises in, and each
   rail segment fills left to right. Off under reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .ds-step-ghost { pointer-events: none; animation: ds-step-out var(--ds-dur-base) var(--ds-ease) both; }
  @keyframes ds-step-out { to { opacity: 0; transform: translateY(-8px); } }
  .ds-step-in { animation: ds-step-rise var(--ds-dur-base) var(--ds-ease) both; }
  @keyframes ds-step-rise { from { opacity: 0; transform: translateY(8px); } }
  .ds-progress button::before { background-image: linear-gradient(var(--ds-brand), var(--ds-brand)); background-repeat: no-repeat; background-size: 0 100%; transition: background-size var(--ds-dur-slow) var(--ds-ease), background-color 0.15s cubic-bezier(0, 0, 0.2, 1); }
  .ds-progress button[aria-current="step"]::before { background-color: var(--ds-border-divider); background-image: linear-gradient(var(--ds-brand), var(--ds-brand)); background-repeat: no-repeat; background-size: 100% 100%; }
}
