/* Phit stylesheet, part 7 of 8. The onboarding wizard, the welcome page, the pages beside the panel, the import progress bar, next steps and the first-comparison tools.
   The parts are one stylesheet cut into files: they must load in this order (index.html and the plain pages list them), because a later rule can override an earlier one. */

/* ----- onboarding wizard (one question at a time) ----- */
.wizard { max-width: 560px; }
.wizard-card { display: flex; flex-direction: column; gap: 0.9rem; padding: 1rem 1.25rem 1.1rem; }
.wizard-top { display: flex; align-items: center; gap: 0.75rem; }
.wizard-progress { flex: 1; height: 6px; border-radius: var(--r-pill); background: rgb(var(--ink-rgb) / 0.1); overflow: hidden; }
.wizard-progress > span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.25s ease; }
.wizard-body { display: flex; flex-direction: column; gap: 0.7rem; min-height: 340px; }
.wizard h1 { margin: 0; font-size: 1.4rem; }
.wizard svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wizard .wz-dot { fill: var(--good); stroke: none; }
.wz-hero, .wz-ico { display: grid; place-items: center; flex: none; background: rgb(var(--accent-rgb) / 0.14); color: var(--accent); }
.wz-hero { width: 60px; height: 60px; border-radius: 18px; }
.wz-hero svg { width: 32px; height: 32px; }
.wz-ico { width: 40px; height: 40px; border-radius: 11px; }
.wz-ico svg { width: 22px; height: 22px; }
.wz-lead { margin: 0; color: var(--muted); font-size: var(--fs-lg); line-height: 1.45; }
.wz-choices { display: grid; gap: 0.6rem; margin-top: 0.3rem; }
.wz-choice {
  display: flex; align-items: center; gap: 0.85rem; width: 100%; min-height: 64px; padding: 0.75rem 0.9rem; text-align: left;
  border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--panel); color: var(--text); font-size: 1rem; font-weight: 600;
}
.wz-choice small { display: block; margin-top: 0.1rem; color: var(--muted); font-weight: 400; font-size: var(--fs-sm); }
.wz-choice:hover { border-color: var(--accent); background: rgb(var(--accent-rgb) / 0.07); }
.wz-choice[aria-pressed="true"] { border-color: var(--accent); background: rgb(var(--accent-rgb) / 0.14); }
.wz-choice:focus-visible, .wz-drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wz-steps { list-style: none; margin: 0.2rem 0; padding: 0; display: grid; gap: 0.7rem; counter-reset: wz; }
.wz-steps li { counter-increment: wz; display: grid; grid-template-columns: 1.9rem minmax(0, 1fr); gap: 0.7rem; align-items: start; line-height: 1.45; }
.wz-steps li::before { content: counter(wz); display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: rgb(var(--accent-rgb) / 0.14); color: var(--accent); font-weight: 700; font-size: var(--fs-md); }
.wz-drop { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 1.5rem 1rem; text-align: center; border: 2px dashed var(--border); border-radius: var(--r-2xl); color: var(--muted); cursor: pointer; }
.wz-drop b { color: var(--text); }
.wz-drop.over { border-color: var(--accent); background: rgb(var(--accent-rgb) / 0.08); }
.wz-drop.busy { opacity: 0.7; cursor: progress; }
.wz-ok { margin: 0; color: var(--good); font-weight: 600; }
.wz-ok.none { color: var(--muted); }                       /* nothing was added: not a success, so not green */
.wz-notes { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: var(--fs-sm); }
.wz-runs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; max-height: min(30rem, 56vh); overflow-y: auto; }
.wz-runrow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; align-items: center; padding: 0.4rem 0.7rem; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--panel); }
.wz-namebox { position: relative; display: block; }
.wz-runrow .wz-name { width: 100%; min-width: 0; min-height: 38px; font-weight: 600; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); padding: 0 2rem 0 0.55rem; color: var(--text); }
.wz-runrow .wz-name:hover { border-color: var(--muted); }
.wz-pen { position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: var(--fs-base); pointer-events: none; }
.wz-namebox:focus-within .wz-pen, .wz-namebox:hover .wz-pen { color: var(--accent); }
.wz-runrow .wz-name:focus { border-color: var(--accent); outline: none; background: var(--bg); }
.wz-runrow small { grid-column: 1 / -1; color: var(--muted); }
.wz-saved { color: var(--good); }
.wz-more { margin: 0.5rem 0 0; color: var(--muted); font-size: var(--fs-md); }
.run-menu .menu-name { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: stretch; gap: 0.4rem; padding: 0 0.3rem 0.4rem; }
.run-menu .menu-name input { flex: 1 1 0; width: auto; min-width: 0; min-height: 34px; }
.run-menu .menu-name button { flex: none; min-height: 34px; padding: 0 0.8rem; font-size: var(--fs-md); }
.wizard-foot { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.wizard-foot-gap { flex: 1; }
.wizard-foot [hidden] { display: none; }
@media (max-width: 520px) { .wizard-body { min-height: 0; } .wizard-card { padding: 0.9rem 1rem; } }

/* ----- dropping runs on a block that has weeks: the question ----- */
.weekfit-list { margin: 0.2rem 0 0.4rem; padding-left: 1.2rem; display: grid; gap: 0.2rem; }
#weekfit-dialog .dialog-actions { flex-wrap: wrap; }

/* ----- welcome page of an empty account: no run list yet, a picture of what Phit shows ----- */
.layout.is-empty { grid-template-columns: minmax(0, 1fr); max-width: 1360px; }          /* the page grows with the window up to a wide screen; only the sentences keep a readable length */
.layout.is-empty .sidebar { display: none; }
.guide-hero { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; padding: 0.6rem 0 0.2rem; text-align: center; }
.guide-hero { position: relative; padding-top: 1.6rem; }
.guide-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 14rem; z-index: -1; background: radial-gradient(60% 100% at 50% 0%, rgb(var(--accent-rgb) / 0.10), transparent 70%); pointer-events: none; }
.guide-hero h1 { margin: 0.1rem 0 0; font-size: 2.3rem; font-weight: 750; letter-spacing: -0.02em; }
.guide-hero .lead { max-width: 46rem; margin: 0; color: var(--muted); font-size: 1.1rem; line-height: 1.5; text-wrap: balance; }
.guide-hero .guide-foot button { border-radius: var(--r-pill); padding-left: 1.4rem; padding-right: 1.4rem; }
.guide-hero .guide-foot { justify-content: center; margin-top: 0.4rem; }
.guide-hero .hint { margin: 0.2rem 0 0; }
.guide-figure { width: 100%; max-width: 1200px; margin: 1.3rem 0 0; }
.pv { display: block; width: 100%; height: auto; filter: drop-shadow(0 12px 28px rgb(0 0 0 / 0.22)); }
.pv text { font-family: inherit; font-size: 12px; fill: var(--text); }
.pv .pv-h { font-size: 15px; }
.pv .pv-s { font-size: 11.5px; } .pv .pv-t { fill: var(--text); font-weight: 700; } .pv .pv-m { fill: var(--muted); } .pv .pv-r { font-weight: 600; }
.pv-frame { fill: var(--bg); stroke: var(--border); } .pv-card { fill: var(--panel); stroke: var(--border); }
.pv-sep { stroke: var(--border); stroke-width: 1; } .pv-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; opacity: 0.8; }
.pv-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pv-navbg { fill: none; } .pv-navbg.on { fill: rgb(var(--accent-rgb) / 0.16); }
.pv-ico { fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; } .pv-ico.on { stroke: var(--accent); }
.pv-dot { fill: var(--good); stroke: none; }
.pv-pill { fill: none; stroke: var(--border); } .pv-pill.on { fill: rgb(var(--accent-rgb) / 0.16); stroke: var(--accent); }
.pv text.pv-on { fill: var(--accent); font-weight: 600; }
.pv-z1 { fill: var(--z1); } .pv-z2 { fill: var(--z2); } .pv-z3 { fill: var(--z3); } .pv-z4 { fill: var(--z4); } .pv-z5 { fill: var(--z5); }
.pv-prtag { fill: none; stroke: var(--good); } .pv text.pv-prtext { fill: var(--good); font-size: 10.5px; font-weight: 700; }
.pv-chip { fill: none; stroke: var(--border); } .pv text.pv-chiptext { fill: var(--muted); }
@media (max-width: 560px) { .guide-hero h1 { font-size: 1.6rem; } }

/* ----- Settings as a page beside the left panel ----- */
.settings-page { max-width: 780px; margin: 1rem auto; padding: 0 0.75rem; }
.settings-page[hidden] { display: none; }
.settings-page .settings-form { margin: 0; padding: 1.1rem 1.25rem; }
.settings-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.settings-head h1 { margin: 0 0 0.4rem; }
.settings-page .dialog-tabs { margin: 0.5rem 0 1rem; padding: 0; }
.settings-actions { display: flex; align-items: center; gap: 0.8rem; margin-top: 1rem; }
.settings-page .tabs { background: transparent; padding-left: 0; }

/* ----- the wizard as a page beside the left panel ----- */
.wizard-page { max-width: 680px; margin: 1.2rem auto; padding: 0 0.75rem; }
.wizard-page[hidden] { display: none; }
.wizard-page .wizard-card { margin: 0; padding: 1.2rem 1.4rem; }

/* file and folder names (.fit, GARMIN, Activity) are bold in the text's own font, not the browser's small monospace: in every dialog and page */
code { font-family: inherit; font-size: inherit; font-weight: 700; }
.wz-steps a, .wz-lead a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* the picture compares three runs, in the colours of the real compare view (earlier run blue, later orange, run 3 green) */
.pv-line.pv-r1 { stroke: var(--series-1); } .pv-line.pv-r2 { stroke: var(--series-2); } .pv-line.pv-r3 { stroke: var(--series-3); }
.pv-sd1 { fill: var(--series-1); } .pv-sd2 { fill: var(--series-2); } .pv-sd3 { fill: var(--series-3); }
.pv-pill.pv-on-r1 { stroke: var(--series-1); } .pv-pill.pv-on-r2 { stroke: var(--series-2); } .pv-pill.pv-on-r3 { stroke: var(--series-3); }
.pv text.pv-b { font-weight: 600; } .pv .pv-n { font-weight: 400; }
.pv text.pv-good { fill: var(--good); font-weight: 600; } .pv text.pv-d { font-size: 10.5px; font-weight: 600; } .pv text.pv-m.pv-d { font-weight: 400; }
.pv text.pv-big { font-size: 28px; font-weight: 700; }
.pv text.pv-big2 { font-size: 22px; font-weight: 700; } .pv text.pv-tick { font-size: 10px; fill: var(--muted); } .pv-gridx { stroke: var(--border); stroke-width: 1; }
/* the interval picture: a dot on each rep's peak heart rate and a dashed trend line through them, one pair per run */
.pv-trend { fill: none; stroke-width: 1.7; stroke-dasharray: 5 4; stroke-linecap: round; }
.pv-trend.pv-r1 { stroke: var(--series-1); } .pv-trend.pv-r2 { stroke: var(--series-2); } .pv-trend.pv-r3 { stroke: var(--series-3); }
.pv-pk1, .pv-pk2, .pv-pk3 { stroke: var(--panel); stroke-width: 1.6; } .pv-pk1 { fill: var(--series-1); } .pv-pk2 { fill: var(--series-2); } .pv-pk3 { fill: var(--series-3); }
.guide-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; width: 100%; max-width: 1200px; margin: 1.1rem 0 0; padding: 0; list-style: none; text-align: left; }
.guide-points li { padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--r-2xl); background: var(--panel); box-shadow: 0 1px 2px rgb(var(--ink-rgb) / 0.04); }
.guide-points b { display: block; margin-bottom: 0.2rem; }
.guide-points span { color: var(--muted); font-size: var(--fs-base); line-height: 1.45; }
@media (max-width: 720px) { .guide-points { grid-template-columns: minmax(0, 1fr); } }

/* the import progress bar: a thin bar in the guide's drop zone, and a small card at the bottom of the page everywhere else */
.progress { height: 6px; border-radius: var(--r-pill); background: var(--border); overflow: hidden; width: 100%; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: var(--r-pill); transition: width 0.2s ease; }
.import-progress { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 60; width: min(22rem, calc(100vw - 2rem)); display: flex; flex-direction: column; gap: 0.5rem;
  padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--panel); box-shadow: 0 8px 28px rgb(0 0 0 / 0.35); font-size: var(--fs-md); }
.import-progress[hidden] { display: none; }
.wz-drop .progress { max-width: 18rem; margin-top: 0.35rem; }
@media (prefers-reduced-motion: reduce) { .progress > i { transition: none; } }
.import-left, .wz-left { color: var(--muted); font-size: var(--fs-md); margin: 0.25rem 0 0; }
.wz-none { margin-top: 0.4rem; padding: 0.7rem 0.85rem; border: 1px solid var(--border); border-left: 3px solid var(--warn); border-radius: var(--r-lg); background: var(--bg); }
.wz-none b { display: block; }
.wz-none p { margin: 0.3rem 0 0.55rem; color: var(--muted); font-size: var(--fs-md); line-height: 1.45; }
.wz-left { margin: 0.4rem 0 0; }

/* "Add a group": a dashed button above the list that opens a one-line form */
.add-group { margin: 0 0 0.5rem; }
.add-group[hidden], .add-group-form[hidden] { display: none; }
.add-group > .ghost { width: 100%; border-style: dashed; color: var(--muted); }
.add-group > .ghost:hover { color: var(--text); }
.add-group-form { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.65rem; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--panel); }
.add-group-form input[type=text] { width: 100%; min-height: 40px; }
.add-group-ticked { display: flex; align-items: center; gap: 0.45rem; font-size: var(--fs-md); color: var(--muted); }
.add-group-ticked[hidden] { display: none; }
.add-group-buttons { display: flex; gap: 0.5rem; }
.delete-group-btn:hover { color: var(--bad); border-color: var(--bad); }

/* next-step helpers: the checklist that replaces the welcome page once runs are in, the tip above the results, and the pulse that points at something */
.next-steps { list-style: none; margin: 0.8rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.next-step { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--bg); }
.next-step.done { opacity: 0.75; }
.next-mark { display: inline-flex; align-items: center; justify-content: center; width: 1.8rem; height: 1.8rem; border-radius: var(--r-pill); background: rgb(var(--accent-rgb) / 0.16); color: var(--accent); font-weight: 700; font-size: var(--fs-md); }
.next-step.done .next-mark { background: rgb(var(--good-rgb, 61 191 129) / 0.18); color: var(--good); }
.next-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.next-text small { color: var(--muted); font-size: var(--fs-sm); line-height: 1.4; }
.pulse { animation: phit-pulse 2.4s ease-out 1; outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xl); }
@keyframes phit-pulse { 0% { outline-color: var(--accent); outline-offset: 2px; } 70% { outline-color: var(--accent); outline-offset: 6px; } 100% { outline-color: transparent; outline-offset: 10px; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
@media (max-width: 560px) { .next-step { grid-template-columns: auto minmax(0, 1fr); } .next-step button { grid-column: 1 / -1; } }

/* the brand grid on the "What do you record your runs with?" step, and the line under a how-to */
.wz-brands { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.wz-brand { display: flex; align-items: center; gap: 0.7rem; text-align: left; padding: 0.65rem 0.8rem; min-height: 56px; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--panel); color: var(--text); cursor: pointer; }
.wz-brand:hover { border-color: var(--accent); }
.wz-brand .wz-ico { flex: none; }
.wz-brand b { display: block; font-weight: 600; }
.wz-brand small { display: block; color: var(--muted); font-size: var(--fs-sm); }
.wz-source { margin: 0.6rem 0 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.45; }
@media (max-width: 420px) { .wz-brands { grid-template-columns: minmax(0, 1fr); } }


/* Documentation: a page like Settings, for now one card that says it is coming */
.docs-page { max-width: 560px; margin: 2rem auto; padding: 0 0.75rem; }
.docs-page[hidden] { display: none; }
.docs-card { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; padding: 2rem 1.5rem; text-align: center; }
.docs-card h1 { margin: 0; }
.docs-card .hint { max-width: 26rem; margin: 0; line-height: 1.5; }
.docs-ico { width: 46px; height: 46px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.docs-soon { margin: 0; font-size: 1.05rem; font-weight: 600; color: var(--accent); }
/* Contact: the feedback form, in the same frame */
.contact-page { max-width: 640px; }
.contact-card { padding: 1.5rem; font-size: var(--fs-base); } .contact-card h1 { margin: 0 0 0.6rem; } .contact-card h2 { margin: 1.4rem 0 0.4rem; font-size: 1.05rem; }
.contact-card .fb-thanks .ghost { margin-left: 0.4rem; }

/* the guide's import step after runs are in: a small drop target and a closed list of names */
.wz-drop.compact { padding: 0.55rem 0.8rem; flex-direction: row; gap: 0.6rem; min-height: 0; margin-top: 0.7rem; }
.wz-drop.compact .wz-ico { transform: scale(0.8); }
.wz-rename { margin: 0.7rem 0 0; }
.wz-rename > summary { cursor: pointer; color: var(--accent); font-size: var(--fs-base); font-weight: 600; padding: 0.2rem 0; }
.wz-rename .wz-runs { max-height: 18rem; overflow-y: auto; margin-top: 0.4rem; }

/* the two quick settings beside the first comparison */
.setup-card { margin: 0 0 0.8rem; padding: 0.7rem 0.9rem; border: 1px solid var(--accent); border-radius: var(--r-xl); background: rgb(var(--accent-rgb) / 0.06); }
.setup-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.setup-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.35rem 0; font-size: var(--fs-base); }
.setup-hr { display: inline-flex; align-items: center; gap: 0.4rem; }
.setup-hr input { width: 7.5rem; min-height: 36px; padding: 0.2rem 0.6rem; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.setup-card .hint { margin: 0.2rem 0 0; }

/* the one-line verdict at the top of a comparison, and the closed explanation under it */
.verdict { margin: 0.3rem 0 0.4rem; padding: 0.5rem 0.75rem; border-left: 3px solid var(--border); border-radius: var(--r-sm); background: rgb(var(--ink-rgb) / 0.04); font-size: 1rem; line-height: 1.45; font-weight: 600; }
.verdict.good { border-left-color: var(--good); } .verdict.warn { border-left-color: var(--warn); } .verdict.neutral { border-left-color: var(--accent); }
.plain-help { margin: 0.2rem 0 0.6rem; font-size: var(--fs-base); }
.plain-help > summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 0.15rem 0; }
.plain-help ul { margin: 0.3rem 0 0; padding-left: 1.1rem; color: var(--muted); line-height: 1.5; }
.setup-hr input { width: 8.5rem; }

