/*! setup.css 1.1.1 | DJ2000-UK/app-workbench */
/* Finish setting up and the tutorial (setup.js, docs/SETUP.md). The rows use
   navigation.css's grouped list; this adds the step rows' Skip, the progress
   meter and the tutorial's cards. Every colour comes from the app's tokens, with
   Kaizen's names as fallbacks (--cyan for --accent, --health for --danger).
   Unlayered, like feedback.css, and scoped to its own classes: it wins over an
   app's own element rules (h2, p, button) inside the tutorial, and over
   navigation.css's layer for the step rows, and touches nothing else. */

/* More: Finish setting up at the top, with no heading, as FitBee and iOS Settings
   lead, while steps remain; Setup and View tutorial again at the foot (setup.js). */

.setup-count { color: var(--muted); font-variant-numeric: tabular-nums; }

/* The page: a summary, then the steps. */
.setup-page { display: grid; min-width: 0; gap: 24px; }
.setup-summary {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 26px;
  background: var(--grouped-fill, color-mix(in srgb, var(--ink) 9.5%, var(--void)));
  font-family: var(--grouped-font, var(--font-sans, system-ui));
}
.setup-summary p { margin: 0; }
.setup-summary__count strong { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.setup-summary__lead { color: var(--muted-bright, var(--muted)); font-size: 15px; line-height: 1.4; }
.setup-meter { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 4px; }
.setup-meter > span { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 14%, transparent); }
.setup-meter > [data-state="done"] { background: var(--positive); }
.setup-meter > [data-state="skipped"] { background: color-mix(in srgb, var(--muted) 55%, transparent); }

/* A step: the row that opens where it's done, and Skip or Add back beside it. */
.setup-step { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.setup-step > .nav-row { min-width: 0; padding-right: 4px; }
.setup-step__act {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  margin: 0 10px 0 0;
  padding: 0;
  place-items: center;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.setup-step__act > span:first-child {
  padding: 7px 13px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  font-family: var(--grouped-font, var(--font-sans, system-ui));
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.1;
  white-space: nowrap;
}
.setup-step__act:active > span:first-child { background: color-mix(in srgb, var(--ink) 22%, transparent); }
.setup-step__act:focus-visible { outline: 2px solid var(--accent, var(--cyan)); outline-offset: -4px; border-radius: 999px; }
.setup-step__done { margin-right: 16px; color: var(--positive); font-family: var(--grouped-font, var(--font-sans, system-ui)); font-size: 15px; font-weight: 600; }
.setup-step[data-state="skipped"] .nav-row__text strong,
.setup-step[data-state="done"] .nav-row__text strong { color: var(--muted-bright, var(--muted)); }

/* The tutorial: a glass card of cards, full height on a phone, centred on a wide screen. */
.tutorial {
  box-sizing: border-box;
  width: min(440px, calc(100vw - 16px));
  max-width: none;
  height: min(640px, calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 28px;
  background: color-mix(in srgb, var(--panel) 92%, var(--void));
  box-shadow: 0 24px 80px color-mix(in srgb, var(--void) 70%, transparent);
  color: var(--ink);
  font-family: var(--grouped-font, var(--font-sans, system-ui));
  -webkit-user-select: none;
  user-select: none;
}
.tutorial *, .tutorial *::before, .tutorial *::after { box-sizing: border-box; }
.tutorial[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.tutorial--help { height: auto; max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
.tutorial--help[open] { grid-template-rows: minmax(0, 1fr) auto; }
.tutorial::backdrop { background: color-mix(in srgb, var(--void) 58%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
html:has(.tutorial[open]) { overflow: hidden; }
.tutorial [hidden] { display: none !important; }

.tutorial__top { display: flex; min-height: 52px; padding: 6px 8px 0 22px; align-items: center; justify-content: space-between; }
.tutorial__count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.tutorial__skip {
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted-bright, var(--muted));
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.tutorial__skip:focus-visible,
.tutorial__btn:focus-visible,
.tutorial__setup:focus-visible { outline: 2px solid var(--accent, var(--cyan)); outline-offset: 2px; }

/* The cards: side by side, one screen each; the swipe is the browser's own scroll. */
.tutorial__track {
  display: flex;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x;
}
.tutorial__track::-webkit-scrollbar { display: none; }
.tutorial__track:focus-visible { outline: 2px solid var(--accent, var(--cyan)); outline-offset: -2px; border-radius: 20px; }
.tutorial__slide {
  display: grid;
  flex: 0 0 100%;
  min-width: 0;
  padding: 4px 30px 12px;
  align-content: center;
  justify-items: center;
  gap: 14px;
  overflow-y: auto;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  text-align: center;
}
.tutorial__slide--help { padding-top: 28px; overflow-y: auto; }
.tutorial__tile {
  --tile-tint: var(--accent, var(--cyan));
  display: grid;
  width: 92px;
  height: 92px;
  margin-bottom: 8px;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--tile-tint), var(--white, var(--ink)) 14%), var(--tile-tint) 52%, color-mix(in oklab, var(--tile-tint), var(--void) 10%));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--white, var(--ink)) 30%, transparent), 0 14px 36px color-mix(in srgb, var(--tile-tint) 28%, transparent);
  color: var(--white, var(--ink));
}
.tutorial__tile svg { width: 52px; height: 52px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tutorial__tile[data-tint="mint"] { --tile-tint: var(--data-1); }
.tutorial__tile[data-tint="blue"] { --tile-tint: var(--data-2); }
.tutorial__tile[data-tint="amber"] { --tile-tint: var(--data-3); }
.tutorial__tile[data-tint="pink"] { --tile-tint: var(--data-4); }
.tutorial__tile[data-tint="sky"] { --tile-tint: var(--data-5); }
.tutorial__tile[data-tint="green"] { --tile-tint: var(--positive); }
.tutorial__tile[data-tint="red"] { --tile-tint: var(--danger, var(--health)); }
.tutorial__tile[data-tint="purple"] { --tile-tint: var(--purple); }
.tutorial__tile[data-tint="grey"] { --tile-tint: color-mix(in srgb, var(--muted) 82%, var(--void)); }
.tutorial__slide h2 { margin: 0; color: var(--ink); font-family: inherit; font-size: 26px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; text-transform: none; text-wrap: balance; }
.tutorial__slide p { max-width: 32ch; margin: 0; color: var(--muted-bright, var(--muted)); font-size: 17px; letter-spacing: -.01em; line-height: 1.42; text-wrap: pretty; }
.tutorial__steps { display: grid; max-width: 34ch; margin: 0; padding: 0 0 0 1.3em; gap: 8px; color: var(--ink); font-size: 16px; line-height: 1.4; text-align: left; }

.tutorial__foot { display: grid; padding: 8px 18px max(18px, env(safe-area-inset-bottom, 0px)); gap: 12px; }
.tutorial__dots { display: flex; justify-content: center; gap: 7px; }
.tutorial__dots > span { width: 7px; height: 7px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 24%, transparent); transition: width 200ms ease, background-color 200ms ease; }
.tutorial__dots > .is-on { width: 20px; background: var(--accent, var(--cyan)); }
.tutorial__buttons { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 10px; }
.tutorial__buttons:has(> [hidden]) { grid-auto-flow: row; }
/* Tall, rounded, bold capitals: the buttons of More's pages (DJ, 2026-11-30). */
.tutorial__btn {
  min-height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 18px;
  background: var(--accent, var(--cyan));
  color: var(--accent-ink, var(--void));
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tutorial__btn--quiet { background: color-mix(in srgb, var(--ink) 11%, transparent); color: var(--ink); }
.tutorial__btn:active { filter: brightness(.92); }
/* A finger's height, as every tap target: 44 px (35 px before 1.1.1). */
.tutorial__setup { display: flex; min-height: 44px; align-items: center; justify-content: center; padding: 0; color: var(--accent, var(--cyan)); font-size: 16px; font-weight: 600; text-align: center; text-decoration: none; }

/* A step's control, pointed out on its page (setup.js spotlight; DJ, 2026-11-30):
   a rounded ring in the accent that pulses three times, then stays until the
   control is used. No overlay and no words. A control with square corners is
   rounded while it is marked; a row of a grouped list, which clips its rows, gets
   the ring inside, rounded like the list. The ring is !important, since an app's
   own field rules often say outline: 0 (Kaizen's do); the pulse moves through two
   registered properties, which an animation can change under !important. */
@property --setup-spot-ring { syntax: "<color>"; inherits: false; initial-value: transparent; }
@property --setup-spot-grow { syntax: "<length>"; inherits: false; initial-value: 0px; }
.setup-spot {
  --setup-spot-ring: var(--accent, var(--cyan));
  --setup-spot-gap: 4px;
  outline: 2px solid var(--setup-spot-ring) !important;
  outline-offset: calc(var(--setup-spot-gap) + var(--setup-spot-grow)) !important;
  animation: setup-spot 1.1s ease-in-out 3;
}
.setup-spot--round { border-radius: 14px; }
.nav-row.setup-spot { --setup-spot-gap: -3px; border-radius: 23px; animation-name: setup-spot-inside; }
@keyframes setup-spot {
  50% { --setup-spot-ring: color-mix(in srgb, var(--accent, var(--cyan)) 30%, transparent); --setup-spot-grow: 3px; }
}
@keyframes setup-spot-inside {
  50% { --setup-spot-ring: color-mix(in srgb, var(--accent, var(--cyan)) 30%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  .setup-spot { animation: none; }
  .tutorial__dots > span { transition: none; }
  .tutorial__track { scroll-behavior: auto; }
}
