/* One question at a time: store setup and settings share these styles. */
.flow-page { width: min(100%, 640px); margin-inline: auto; }
.flow { display: grid; grid-template-rows: auto 1fr; min-height: calc(100svh - 150px); padding-block: clamp(18px, 4vw, 36px) 28px; }
.flow-top { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; }
.flow-back { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--sheet); color: var(--ink); cursor: pointer; }
.flow-back[hidden] { display: grid !important; visibility: hidden; }
.flow-back:hover { border-color: var(--rule-strong); }
.flow-back-arrow { width: 9px; height: 9px; margin-inline-start: 3px; border-block-end: 2px solid; border-inline-start: 2px solid; rotate: 45deg; }
.flow-progress { height: 4px; overflow: hidden; border-radius: 999px; background: var(--line); }
.flow-progress span { display: block; height: 100%; background: var(--ink); transform: scaleX(var(--progress, 0)); transform-origin: left; }
.flow-count { color: var(--muted); font-size: .8125rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.flow-stage { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; padding-top: clamp(28px, 7vh, 64px); }
.flow-step { grid-area: 1 / 1; display: grid; align-content: start; gap: 14px; min-width: 0; }
.flow-step[data-leaving] { position: absolute; inset: clamp(28px, 7vh, 64px) 0 auto; pointer-events: none; }
.flow-title { max-width: 15ch; font: 780 clamp(2.1rem, 7vw, 3.3rem)/.98 var(--display-font); letter-spacing: -.055em; outline: none; }
.flow-hint { max-width: 42ch; color: var(--muted); font-size: 1.05rem; }
.flow-step > :is(.flow-field, .flow-fields, .flow-choices, .flow-hours, .flow-pace, .flow-look, .flow-review, .flow-done-body) { margin-top: 14px; }
.flow-error { min-height: 1.4em; color: var(--danger); font-weight: 650; }
.flow-error:empty { visibility: hidden; }

.flow-fields { display: grid; gap: 18px; }
.flow-field { display: grid; gap: 4px; }
.flow-field-label { color: var(--muted); font-size: .8125rem; font-weight: 700; }
.flow-text {
  box-sizing: border-box;
  width: 100%;
  padding: 6px 0 10px;
  border: 0;
  border-bottom: 2px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: 650 clamp(1.25rem, 4.6vw, 1.6rem)/1.25 var(--body-font);
  outline: none;
  resize: none;
}
.flow-text::placeholder { color: color-mix(in srgb, var(--muted) 60%, transparent); }
.flow-text:focus { border-bottom-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }

.flow-choices { display: grid; gap: 10px; }
.flow-choices--tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.flow-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 44px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--sheet);
  color: var(--ink);
  text-align: start;
  cursor: pointer;
}
.flow-choice::after { content: ""; position: absolute; inset-inline-end: 14px; width: 18px; height: 18px; border: 1.5px solid var(--rule); border-radius: 50%; }
.flow-choice[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #fff; }
.flow-choice[aria-checked="true"]::after { border: 5px solid var(--ink); }
.flow-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.flow-choice-text { display: grid; gap: 2px; }
.flow-choice strong { font: 720 1.05rem/1.2 var(--display-font); letter-spacing: -.015em; }
.flow-choice small { color: var(--muted); font-size: .8125rem; line-height: 1.35; }
.flow-icon { display: grid; flex: none; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--tint); color: var(--accent-dark); }
.flow-icon .icon { width: 22px; height: 22px; }
.flow-choices--chips { display: flex; flex-wrap: wrap; }
.flow-choices--chips .flow-choice { min-height: 48px; padding: 0 20px; border-radius: 999px; }
.flow-choices--chips .flow-choice::after { display: none; }
.flow-choices--chips .flow-choice[aria-checked="true"] { background: var(--ink); color: var(--sheet); }
.flow-pace { display: grid; gap: 22px; }
.flow-pace .flow-field { max-width: 200px; }

.flow-days { display: grid; gap: 2px; min-width: 0; margin-top: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--sheet); }
.flow-days[hidden] { display: none; }
.flow-day { display: grid; grid-template-columns: 4.6em minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; min-height: 52px; }
.flow-day + .flow-day { border-top: 1px dashed var(--line); }
.flow-day-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; cursor: pointer; }
.flow-day-name input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.flow-day-to { color: var(--muted); }
.flow-day[data-closed="true"] .flow-time { opacity: .35; }
.flow-time { box-sizing: border-box; width: 100%; min-width: 0; min-height: 40px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; }
.flow-time:disabled { color: var(--muted); }
/* On phones the whole field opens the time picker, so the clock glyph only costs room. */
@media (max-width: 480px) {
  .flow-days { padding-inline: 10px; }
  .flow-day { grid-template-columns: 3.9em minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; }
  .flow-time { padding-inline: 6px; text-align: center; }
  .flow-time::-webkit-calendar-picker-indicator { display: none; }
}

.flow-look { display: grid; gap: 18px; }
.flow-preview { overflow: hidden; border-radius: 16px; pointer-events: none; }
.flow-preview .store-profile { border: 0; }
.flow-preview .store-name :is(h1, h2) { font-size: clamp(1.6rem, 6vw, 2.2rem); }
.flow-choices--swatches { display: flex; flex-wrap: wrap; }
.flow-choices--swatches .flow-choice { min-height: 48px; padding: 0 16px 0 10px; border-radius: 999px; }
.flow-choices--swatches .flow-choice::after { display: none; }
.flow-swatch { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-dark); box-shadow: inset 0 0 0 2px #ffffff40; }
.flow-swatch[data-cover="clay"] { background: #654338; }
.flow-swatch[data-cover="blue"] { background: #334951; }

.flow-receipt { margin: 0; padding: 6px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--sheet); }
.flow-receipt-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 10px; padding-block: 12px; }
.flow-receipt-row + .flow-receipt-row { border-top: 1px dashed var(--rule); }
.flow-receipt dt { color: var(--muted); font-size: .875rem; font-weight: 650; }
.flow-receipt dd { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.flow-edit { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; margin: -6px -8px -6px 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--accent-dark); cursor: pointer; }
.flow-edit .icon { width: 18px; height: 18px; }
.flow-edit:hover { background: var(--tint); }
.flow-edit:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.flow-fee { margin-top: 12px; color: var(--muted); font-size: .875rem; }

/* Continue: the same tear-off ticket as Join queue. */
.flow-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-top: 32px; }
.flow-actions[hidden] { display: none; }
.flow-next {
  display: inline-grid;
  grid-template-columns: auto 3.6rem;
  min-height: 58px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sheet);
  text-decoration: none;
  cursor: pointer;
  filter: drop-shadow(0 12px 18px #1b242033);
}
.flow-next-label { display: grid; align-content: center; padding: 0 24px; border-radius: 14px 0 0 14px; background: var(--ink); font: 760 1.1rem/1 var(--display-font); letter-spacing: -.015em;
  mask: radial-gradient(circle 6px at right top, transparent 95%, #000), radial-gradient(circle 6px at right bottom, transparent 95%, #000); mask-composite: intersect; }
.flow-next-stub { position: relative; display: grid; place-items: center; border-radius: 0 14px 14px 0; background: var(--lime); color: var(--ink);
  mask: radial-gradient(circle 6px at left top, transparent 95%, #000), radial-gradient(circle 6px at left bottom, transparent 95%, #000); mask-composite: intersect; }
.flow-next-stub::before { content: ""; position: absolute; inset-block: 10px; inset-inline-start: 0; border-inline-start: 2px dotted var(--perforation-ink); }
.flow-next-arrow { width: 10px; height: 10px; margin-inline-end: 4px; border-block-start: 2.5px solid; border-inline-end: 2.5px solid; rotate: 45deg; }
.flow-next--compact { grid-template-columns: auto; }
.flow-next--compact .flow-next-label { border-radius: 14px; mask: none; }
.flow-next:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 14px; }
.flow-enter-hint { color: var(--muted); font-size: .8125rem; }
@media (hover: none) { .flow-enter-hint { display: none; } }

.flow-done .flow-title { color: var(--accent); }
.flow-done-body { display: grid; gap: 22px; justify-items: start; }
.flow-preview--done { width: 100%; box-shadow: 0 24px 40px -28px #1b242080; }

@keyframes flow-in-next { from { opacity: 0; transform: translateX(40px); } }
@keyframes flow-in-back { from { opacity: 0; transform: translateX(-40px); } }
@keyframes flow-out-next { to { opacity: 0; transform: translateX(-40px); } }
@keyframes flow-out-back { to { opacity: 0; transform: translateX(40px); } }
@keyframes flow-rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes flow-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes flow-drop { from { opacity: 0; transform: translateY(-28px) rotate(-2.5deg) scale(.96); } 70% { transform: translateY(3px) rotate(.6deg); } }
@media (prefers-reduced-motion: no-preference) {
  .flow-progress span { transition: transform 560ms cubic-bezier(.2, .8, .2, 1); }
  .flow-step[data-enter="next"] { animation: flow-in-next 520ms cubic-bezier(.2, .8, .2, 1) both; }
  .flow-step[data-enter="back"] { animation: flow-in-back 520ms cubic-bezier(.2, .8, .2, 1) both; }
  .flow-step[data-enter="next"] > *, .flow-step[data-enter="back"] > * { animation: flow-rise 560ms cubic-bezier(.2, .8, .2, 1) both; }
  .flow-step[data-enter] > :nth-child(2) { animation-delay: 60ms; }
  .flow-step[data-enter] > :nth-child(3) { animation-delay: 120ms; }
  .flow-step[data-enter] > :nth-child(n + 4) { animation-delay: 170ms; }
  .flow-step[data-leaving="next"] { animation: flow-out-next 300ms cubic-bezier(.4, 0, 1, 1) both; }
  .flow-step[data-leaving="back"] { animation: flow-out-back 300ms cubic-bezier(.4, 0, 1, 1) both; }
  .flow-step.is-shaking { animation: flow-shake 360ms ease both; }
  .flow-choice { transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 120ms ease; }
  .flow-choice:active { transform: scale(.985); }
  .flow-choice::after { transition: border-width 200ms cubic-bezier(.3, 1.4, .5, 1); }
  .flow-text { transition: border-color 200ms ease; }
  .flow-preview .store-cover { transition: background-color 420ms ease; }
  .flow-done .flow-preview--done { animation: flow-drop 760ms cubic-bezier(.2, .8, .2, 1) 120ms both; }
  .flow-next { transition: transform 140ms ease; }
  .flow-next:active { transform: translateY(1px) scale(.99); }
}
@media (max-width: 520px) {
  .flow-receipt-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* Settings: a list of answers, each opening its own question. */
.settings-list { margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--sheet); list-style: none; }
.settings-list li + li { border-top: 1px dashed var(--rule); }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 64px; padding: 10px 16px; border: 0; background: none; color: var(--ink); text-align: start; cursor: pointer; }
.settings-row:hover { background: color-mix(in srgb, var(--tint) 60%, transparent); }
.settings-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.settings-row-text { display: grid; gap: 2px; min-width: 0; }
.settings-row-text small { color: var(--muted); font-size: .8125rem; font-weight: 650; }
.settings-row-text strong { font-size: 1rem; overflow-wrap: anywhere; }
.settings-chevron { flex: none; width: 8px; height: 8px; margin-inline-end: 4px; border-block-start: 2px solid var(--muted); border-inline-end: 2px solid var(--muted); rotate: 45deg; }
.settings-back { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; margin-bottom: 6px; padding: 0; border: 0; background: none; color: var(--accent-dark); font: 700 .9375rem/1 var(--body-font); cursor: pointer; }
.settings-back .flow-back-arrow { width: 8px; height: 8px; }
.flow-sheet { display: grid; gap: 20px; }
.flow-sheet .flow-title { font-size: clamp(1.6rem, 5.4vw, 2.2rem); }
.flow-sheet .flow-step { gap: 10px; }

@media (prefers-reduced-motion: no-preference) {
  .settings-panel[data-enter="next"] { animation: flow-in-next 440ms cubic-bezier(.2, .8, .2, 1) both; }
  .settings-panel[data-enter="back"] { animation: flow-in-back 440ms cubic-bezier(.2, .8, .2, 1) both; }
  .flow-step[data-enter="up"] > * { animation: flow-rise 480ms cubic-bezier(.2, .8, .2, 1) both; }
  .settings-row { transition: background-color 160ms ease; }
}
