:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #f1eee6;
  --ink: #1e2320;
  --muted: #6c7269;
  --accent: #c0521e;
  --accent-ink: #ffffff;
  --line: #e3ddd1;
  --good: #3e7a4e;
  --danger: #a33526;
  --warn-bg: #fbeee0;
  --warn-line: #e6b980;
  --warn-ink: #7a4b12;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181a;
    --surface: #1d2123;
    --surface-2: #232829;
    --ink: #ece7dc;
    --muted: #97a096;
    --accent: #e0692f;
    --line: #313739;
    --good: #6fb07f;
    --danger: #d9705f;
    --warn-bg: #33240f;
    --warn-line: #7a5a2a;
    --warn-ink: #e7c084;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 18px calc(40px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -18px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 12px -8px rgba(0, 0, 0, 0.25);
}
.wordmark {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.wordmark:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
.wordmark:active { transform: translateY(1px); }
.wordmark .mark {
  width: 22px;
  height: 22px;
  flex: none;
  fill: var(--accent);
  transform: translateY(-3px) rotate(-18deg);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18));
}
.wordmark-text { line-height: 1; padding-bottom: 5px; }
.wm-ask { color: var(--muted); font-weight: 600; }
.wordmark::after {
  content: "";
  position: absolute;
  left: 0;
  right: 2px;
  bottom: 0;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent) 78%, transparent);
}
.tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px;
}

.screen { padding: 8px 0 24px; }
.screen.center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 60vh; color: var(--muted); }

h1 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 6px 0 8px;
  text-wrap: balance;
}
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); margin: 24px 0 8px; }
.sub { color: var(--muted); margin: 0 0 18px; }
.prose { margin: 0 0 16px; }
em { color: var(--muted); font-style: normal; }

/* capture */
.photo-drop {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 190px; padding: 20px;
  border: 2px dashed var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--muted); cursor: pointer;
  overflow: hidden;
}
.photo-drop img { width: 100%; max-height: 320px; object-fit: contain; border-radius: 8px; }
.field { display: block; margin: 16px 0; }
.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; resize: vertical;
}
textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fineprint { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

/* history */
.history { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.history > summary { margin-bottom: 12px; }
.history-list { list-style: none; padding: 0; margin: 0 0 10px; }
.history-list li { margin: 0; }
.history-list button {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  width: 100%; text-align: left; padding: 12px 2px;
  background: transparent; border: none; border-bottom: 1px solid var(--line);
  color: var(--ink); font: inherit;
}
.history-list li:last-child button { border-bottom: none; }
.history-list .h-item { font-weight: 600; }
.history-list .h-meta { font-size: 13px; color: var(--muted); }
.history-list .h-status {
  margin-left: auto; white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
}
.history-list .h-status-done { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); text-transform: none; letter-spacing: 0; }
.history-list .h-status-in_progress { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.history-list .h-status-pro { color: var(--warn-ink); background: var(--warn-bg); }
.history-list .h-status-planned { color: var(--muted); background: var(--surface-2); }
.linkbtn {
  background: transparent; border: none; color: var(--muted);
  font: inherit; font-size: 13px; padding: 4px 2px; text-decoration: underline;
}

/* buttons */
button { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid transparent; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary {
  display: block; width: 100%; margin-top: 18px; padding: 14px 16px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 17px; border: none;
}
.primary:disabled { opacity: 0.45; cursor: not-allowed; }

/* main "AskFelix" button — mirrors the header wordmark */
#go {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.035em;
}
#go .go-ask { font-weight: 600; opacity: 0.6; }
.secondary {
  display: inline-block; padding: 10px 14px; background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); font-weight: 600;
}
.ghost {
  display: block; width: 100%; margin-top: 10px; padding: 12px;
  background: transparent; color: var(--muted); border: 1px solid var(--line);
}

/* analyzing — "Felix is on it": wrench in a progress ring */
.think {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 26px;
}
.think-ring {
  position: relative;
  width: 108px;
  height: 108px;
}
.think-ring::before {
  content: "";
  position: absolute; inset: -16px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent), transparent 68%);
  animation: think-glow 2.6s ease-in-out infinite;
}
.think-ring-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.think-track {
  fill: none; stroke: var(--surface-2); stroke-width: 5;
}
.think-prog {
  fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 276.46;
  stroke-dashoffset: calc(276.46px * (1 - var(--p, 0)));
  transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.think-wrench {
  position: absolute; top: 50%; left: 50%;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  fill: var(--accent);
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.16));
  animation: think-torque 1.9s ease-in-out infinite;
}
@keyframes think-torque {
  0%, 100% { transform: rotate(-15deg); }
  50% { transform: rotate(24deg); }
}
@keyframes think-glow {
  0%, 100% { opacity: 0.5; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1.03); }
}

.think-label {
  margin: 0;
  font-size: 16px; font-weight: 500; line-height: 1.4;
  color: var(--ink);
  min-height: 1.4em;
}
.think-slow { margin: 0; font-size: 13px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .think-wrench,
  .think-ring::before { animation: none; }
}

/* stop */
.stop-mark { font-size: 40px; }

/* plan */
.badge {
  display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; padding: 3px 8px; border-radius: 999px; margin-bottom: 4px;
  cursor: help;
}
.badge.high { background: var(--good); color: #fff; }
.badge.medium { background: var(--warn-line); color: var(--warn-ink); }
.badge.low { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.conf-explain {
  margin: 0; max-height: 0; opacity: 0; overflow: hidden;
  font-size: 12.5px; line-height: 1.45; color: var(--muted);
  transition: opacity 0.15s ease, max-height 0.22s ease, margin-top 0.22s ease;
}
.conf-explain.show {
  opacity: 1; max-height: 8em; margin-top: 7px;
}
@media (hover: hover) {
  .badge:hover + .conf-explain,
  .conf-explain:hover {
    opacity: 1; max-height: 8em; margin-top: 7px;
  }
}
@media (prefers-reduced-motion: reduce) { .conf-explain { transition: none; } }

.banner {
  border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; font-size: 15px;
}
.banner.caution { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); }
.banner.banner-strong {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  color: var(--danger);
  font-weight: 500;
}
.stop-hard { margin-top: 14px; font-weight: 600; color: var(--danger); }

.meta-row { display: flex; gap: 10px; margin: 0; }
.meta-row > div {
  flex: 1; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
}
.meta-row .k {
  display: block; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.meta-row .v {
  display: block; margin-top: 4px;
  font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums;
}

ul.check { list-style: none; padding: 0; margin: 0; }
ul.check li {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 11px 2px 11px 30px; border-bottom: 1px solid var(--line); position: relative;
  cursor: pointer; user-select: none;
  transition: color 0.12s ease;
}
ul.check li:last-child { border-bottom: none; }
ul.check li::before {
  content: ""; position: absolute; left: 2px; top: 13px;
  width: 16px; height: 16px; box-sizing: border-box;
  border: 1.5px solid var(--muted); border-radius: 4px;
  transition: border-color 0.12s ease, background 0.12s ease;
}
ul.check li:active { transform: translateY(0.5px); }
ul.check li.checked .label,
ul.check li.checked .cost { color: var(--muted); text-decoration: line-through; }
ul.check li.checked::before {
  border-color: var(--good);
  background: var(--good)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    center / 11px no-repeat;
}
ul.check li .label { flex: 1; min-width: 0; }
ul.check li .cost { color: var(--muted); font-size: 14px; white-space: nowrap; }
ul.check li .shop {
  margin-left: auto;
  font-size: 13px; font-weight: 600; color: var(--accent);
  text-decoration: none; white-space: nowrap;
}
ul.check li .shop:active { opacity: 0.55; }
ul.check li.checked .shop { color: var(--muted); }

.plan-details { margin-top: 24px; }
.plan-details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.plan-details > summary::-webkit-details-marker { display: none; }
.plan-details > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.plan-details[open] > summary::after { transform: rotate(-135deg); }
.plan-details > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.plan-steps { margin: 0; padding-left: 1.5em; }
.plan-steps li { margin-bottom: 9px; padding-left: 4px; }
.plan-steps li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.plan-steps .warn {
  display: inline-block; margin-left: 8px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--warn-ink); background: var(--warn-bg);
  border: 1px solid var(--warn-line); border-radius: 999px; padding: 1px 7px;
  vertical-align: 1px;
}

/* steps */
.screen.steps-screen {
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - 118px);
  padding-block: 4px 20px;
}
.progress {
  position: relative;
  display: flex; align-items: center;
  margin: 2px 0 0; min-height: 30px;
  padding-left: 0;
  transition: padding-left 0.26s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.progress.has-back { padding-left: 42px; } /* 30px button + 12px gap */
.step-back {
  position: absolute; left: 0; top: 50%;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  font-size: 18px; line-height: 1; padding-bottom: 2px;
  opacity: 0; pointer-events: none;
  transform: translateY(-50%) scale(0.6);
  transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.2, 0.85, 0.3, 1.2);
}
.progress.has-back .step-back {
  opacity: 1; pointer-events: auto;
  transform: translateY(-50%) scale(1);
}
.progress.has-back .step-back:active { transform: translateY(-50%) scale(0.92); }
@media (prefers-reduced-motion: reduce) {
  .progress, .step-back { transition: opacity 0.15s ease; }
  .step-back { transform: translateY(-50%); }
  .progress.has-back .step-back { transform: translateY(-50%); }
}
.bar { flex: 1; height: 5px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.35s ease; }

.step-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  padding: 26px 0;
  overflow-y: auto;
}
.step-crumb {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 16px;
}
.step-crumb-link {
  flex: none; padding: 0;
  background: transparent; border: 0;
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
.step-crumb-link:active { color: var(--ink); }
.step-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent);
}
.steps-screen #stepTitle { font-size: 27px; line-height: 1.22; margin: 0 0 14px; }
.steps-screen #stepDetail { font-size: 16.5px; line-height: 1.62; margin: 0; }
.steps-screen #stepCaution { margin: 18px 0 0; }

.step-foot { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; }
.step-foot .primary { margin-top: 0; }
.step-foot-row { display: flex; gap: 10px; }
.step-foot-row > .ghost,
.step-foot-row > .checkbtn {
  flex: 1;
  margin: 0;
  padding: 12px 10px;
  text-align: center;
  white-space: nowrap;
}

.stuck {
  margin: 0; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.help { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* per-step photo check */
.checkbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  font-weight: 600; font-size: 15px; cursor: pointer;
}
.checkbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.checkbtn .btn-ic {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.step-foot > #checkResult { margin: 0; }
#checkResult { border-top: none; padding-top: 0; }
#checkResult.verdict-ok { border-left: 3px solid var(--good); padding-left: 12px; }
#checkResult.verdict-warn { border-left: 3px solid var(--warn-line); padding-left: 12px; }
#checkResult.verdict-stop { border-left: 3px solid var(--danger); padding-left: 12px; }
#checkResult strong { display: block; margin-bottom: 4px; }
#checkResult.verdict-ok strong { color: var(--good); }
#checkResult.verdict-stop strong { color: var(--danger); }
#checkResult button { margin-top: 10px; }
.escalate {
  margin-top: 12px; padding: 12px; border-radius: 10px;
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink);
}
.escalate p { margin: 6px 0 10px; }

/* done */
.victory {
  position: relative;
  background: #2f4b5c; color: #f4f1ea; border-radius: var(--radius);
  padding: 24px 18px; text-align: center; margin: 8px 0 4px;
}
.vk {
  font-size: 12px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase;
  opacity: 0.78; margin: 0;
}
.vtask {
  font-size: 23px; font-weight: 700; letter-spacing: -0.02em;
  margin: 8px 0 16px; text-wrap: balance;
}
.vgrid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 24px; }
.vgrid > div { display: flex; flex-direction: column; }
.vgrid span:first-child { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.65; }
.vgrid span:last-child { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vgrid .save span:last-child { color: #9bd6a9; }

.done-recap { margin-top: 22px; }

/* confetti */
.confetti-bit {
  position: absolute; top: 6px; width: 7px; height: 11px; border-radius: 1px;
  opacity: 0; pointer-events: none; will-change: transform, opacity;
  animation: confetti-fall 1.3s ease-in forwards;
}
@keyframes confetti-fall {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--x, 0), 260px) rotate(var(--r, 400deg)); }
}

/* screen + step transitions */
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }

/* step-to-step: outgoing content leaves quickly, incoming settles on a decel curve */
@keyframes step-out      { to { opacity: 0; transform: translateX(-18px); } }
@keyframes step-out-back { to { opacity: 0; transform: translateX(18px); } }
@keyframes step-in       { from { opacity: 0; transform: translateX(24px); }  to { opacity: 1; transform: none; } }
@keyframes step-in-back  { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  .screen-in { animation: screen-in 0.22s ease both; }
  .step-out      { animation: step-out 0.15s cubic-bezier(0.4, 0, 1, 1) both; }
  .step-out-back { animation: step-out-back 0.15s cubic-bezier(0.4, 0, 1, 1) both; }
  .step-in       { animation: step-in 0.32s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .step-in-back  { animation: step-in-back 0.32s cubic-bezier(0.16, 1, 0.3, 1) both; }
  #done .victory { animation: pop-in 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
}

.survey { margin: 22px 0 4px; }
.survey .q { padding: 12px 0; border-top: 1px solid var(--line); }
.survey .q > span { display: block; font-size: 15px; margin-bottom: 8px; }
.survey .opts { display: flex; gap: 8px; }
.survey .opts button {
  flex: 1; padding: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-weight: 600;
}
.survey .opts button.chosen { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: 90%; background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 20;
}

/* splash / launch */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--bg);
}
.splash.done {
  animation: splash-out 0.45s ease forwards;
  pointer-events: none;
}
@keyframes splash-out {
  to { opacity: 0; transform: scale(1.04); }
}
.splash-mark {
  position: relative;
  display: grid;
  place-items: center;
}
.splash-mark svg {
  width: 62px;
  height: 62px;
  fill: var(--accent);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18));
  animation: wrench-cinch 1.1s cubic-bezier(0.5, 0, 0.2, 1) both;
}
.splash-mark::after {
  content: "";
  position: absolute;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: splash-ring 0.95s ease-out 0.15s;
}
.splash-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.03em;
  color: var(--ink);
  opacity: 0;
  animation: splash-fade-up 0.5s ease 0.48s both;
}
@keyframes wrench-cinch {
  0% { transform: rotate(-34deg) scale(0.8); opacity: 0; }
  55% { transform: rotate(7deg) scale(1); opacity: 1; }
  72% { transform: rotate(-4deg); }
  87% { transform: rotate(2deg); }
  100% { transform: rotate(0) scale(1); opacity: 1; }
}
@keyframes splash-ring {
  0% { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(2.5); opacity: 0; }
}
@keyframes splash-fade-up {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .splash-mark svg,
  .splash-word { animation: none; opacity: 1; }
  .splash-mark::after { animation: none; }
  .splash.done { animation: none; opacity: 0; }
}

/* diy skill quiz */
.diy-chip {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 16px; padding: 6px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
.diy-chip:active { transform: translateY(1px); }

.onboard-screen { padding-block: 6px 24px; }

.quiz-top {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0 26px;
}
.quiz-back {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  font-size: 19px; line-height: 1; padding-bottom: 2px;
}
.quiz-back:active { transform: translateY(1px); }
.quiz-track {
  flex: 1; height: 5px; border-radius: 999px;
  background: var(--surface-2); overflow: hidden;
}
.quiz-track i {
  display: block; height: 100%; border-radius: 999px;
  background: var(--accent); width: 0;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.quiz-count {
  flex: none; font-size: 12px; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}

.quiz-eyebrow {
  margin: 0 0 12px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}

.quiz-stage { min-height: 360px; }
.quiz-question {
  margin: 0 0 6px;
  font-size: 22px; font-weight: 600; line-height: 1.28; letter-spacing: -0.01em;
  text-wrap: balance;
}
.quiz-hint { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); }
.quiz-question + .quiz-options { margin-top: 20px; }

.quiz-options { display: flex; flex-direction: column; gap: 9px; }
.quiz-opt {
  display: flex; align-items: center; gap: 13px;
  width: 100%; text-align: left; padding: 15px 16px;
  font-size: 15.5px; line-height: 1.3;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.08s ease;
}
.quiz-opt:active { transform: scale(0.99); }
@media (hover: hover) {
  .quiz-opt:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
}
.quiz-dot {
  flex: none; width: 20px; height: 20px; box-sizing: border-box;
  border: 2px solid var(--line); border-radius: 50%;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quiz-options.multi .quiz-dot { border-radius: 6px; }
.quiz-opt.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  font-weight: 600;
}
.quiz-opt.on .quiz-dot {
  border-color: var(--accent);
  background: var(--accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    center / 12px no-repeat;
}
.quiz-next { margin-top: 20px; }
.quiz-skip {
  display: block; width: 100%; text-align: center;
  margin-top: 22px; color: var(--muted);
}

/* result */
.quiz-result { text-align: center; padding-top: 8px; }
.result-score {
  display: flex; align-items: baseline; justify-content: center; gap: 6px;
  margin: 14px 0 6px;
}
.result-num {
  font-size: 58px; font-weight: 800; line-height: 1;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.result-max { font-size: 16px; font-weight: 600; color: var(--muted); }
.result-tier {
  display: inline-block; margin: 4px 0 14px; padding: 5px 14px;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 999px; font-size: 13px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.quiz-result .sub { margin: 0 auto 22px; max-width: 34ch; }

.tier-scale {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  margin: 0 0 26px;
}
.tier-seg { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.tier-seg i {
  width: 100%; height: 5px; border-radius: 999px;
  background: var(--surface-2);
}
.tier-seg.on i { background: var(--accent); }
.tier-seg b {
  font-size: 10px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--muted); text-align: center; line-height: 1.2;
}
.tier-seg.on b { color: var(--ink); font-weight: 700; }

#onboard .linkbtn { display: block; width: 100%; text-align: center; margin-top: 14px; }

/* hamburger menu */
.menu-btn {
  margin-left: auto; flex: none;
  width: 34px; height: 34px; padding: 0;
  display: grid; align-content: center; justify-items: center; gap: 5px;
  background: transparent; border: 0; cursor: pointer;
}
.menu-btn span {
  display: block; width: 20px; height: 2px; border-radius: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.menu-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10, 10, 12, 0.44);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0; transition: opacity 0.24s ease;
}
.menu-overlay.open { opacity: 1; }

.menu {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(86vw, 324px);
  display: flex; flex-direction: column;
  background: var(--bg);
  border-left: 1px solid var(--line);
  box-shadow: -22px 0 54px -22px rgba(0, 0, 0, 0.4);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
.menu.open { transform: none; }

.menu-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) 18px 14px 22px;
  border-bottom: 1px solid var(--line);
}
.menu-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted);
}
.menu-close {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center; padding: 0;
  background: transparent; border: 0; color: var(--muted);
}
.menu-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu-close:active { color: var(--ink); }

.menu-list { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.menu-item {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left; padding: 14px 12px;
  background: transparent; border: 0; border-radius: 12px;
  color: var(--ink); font-size: 15.5px; font-weight: 500;
  transition: background 0.12s ease;
}
@media (hover: hover) { .menu-item:hover { background: var(--surface-2); } }
.menu-item:active { background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); }
.menu-ic {
  flex: none; width: 20px; height: 20px;
  fill: none; stroke: var(--accent); stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.menu-label { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.menu-label small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.menu-chev {
  flex: none; width: 15px; height: 15px;
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.menu-foot {
  padding: 14px 22px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 12px; letter-spacing: 0.04em; color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .menu, .menu-overlay, .menu-btn span { transition: none; }
}

/* about */
.about-steps { margin: 0 0 8px; padding-left: 1.4em; }
.about-steps li { margin-bottom: 8px; }
.about-steps li::marker { color: var(--accent); }
#about .primary { margin-top: 24px; }

/* tell felix more */
.tell-more { display: flex; flex-direction: column; gap: 10px; }
.tell-more textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; resize: vertical;
}
.tell-more textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tell-more-preview {
  width: 100%; max-height: 220px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line);
}
.tell-more-actions { display: flex; gap: 8px; }
.tell-more-actions > .checkbtn,
.tell-more-actions > .secondary {
  flex: 1; margin: 0; padding: 11px 12px;
  text-align: center; white-space: nowrap;
}

/* "for a pro" — budget + chat */
.stop-total { margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.stop-total strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.stop-ask { margin: 24px 0 4px; padding-top: 20px; border-top: 1px solid var(--line); }
.ask-eyebrow {
  margin: 0 0 12px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}
.ask-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ask-thread:empty { display: none; }
.ask-bubble {
  max-width: 88%; padding: 11px 14px; border-radius: 14px;
  font-size: 15px; line-height: 1.5; white-space: pre-wrap;
}
.ask-me {
  align-self: flex-end;
  background: var(--accent); color: var(--accent-ink);
  border-bottom-right-radius: 5px;
}
.ask-felix {
  align-self: flex-start;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.ask-felix.ask-error { color: var(--danger); }

.ask-row { display: flex; gap: 8px; align-items: flex-end; }
.ask-row textarea {
  flex: 1; font: inherit; line-height: 1.35; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: 10px 16px; resize: none;
  height: 44px; max-height: 140px; overflow-y: hidden;
}
.ask-row textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ask-send {
  flex: none; width: 44px; height: 44px; border-radius: 50%; padding: 0;
  display: grid; place-items: center;
  background: var(--accent); border: 0;
  transition: transform 0.08s ease, opacity 0.12s ease;
}
.ask-send svg {
  width: 18px; height: 18px;
  fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.ask-send:disabled { opacity: 0.4; }
.ask-send:active { transform: scale(0.93); }

/* --- plan screen --- */
.plan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 0;
  margin-bottom: 22px;
  overflow: hidden;
}
.plan-card #itemName { margin: 8px 0 6px; font-size: 21px; }
.plan-note { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.plan-tier {
  display: inline-flex; align-items: center;
  margin: 12px 0 0; padding: 5px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.plan-tier:active { transform: translateY(1px); }

.plan-est {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  margin: 18px -18px 0;
  background: var(--line);
  border-top: 1px solid var(--line);
}
.plan-est > div { background: var(--surface); padding: 13px 18px; }
.est-k {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted);
}
.est-v {
  display: block; margin-top: 3px;
  font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.plan-est .est-save .est-v { color: var(--good); }

.plan-summary {
  font-size: 15.5px; line-height: 1.62; color: var(--ink);
  margin: 0 0 24px;
}

#plan .banner { margin: 0 0 20px; }
#plan .plan-details { margin-top: 26px; }
#plan .plan-details > summary { margin-bottom: 12px; }

.plan-actions { margin-top: 30px; }
.plan-actions .primary { margin-top: 0; }

/* "Did it — next" reward */
@keyframes did-it {
  0% { transform: scale(0.96); }
  45% { transform: scale(1.035); }
  100% { transform: scale(1); }
}
#nextBtn.did-it { animation: did-it 0.42s cubic-bezier(0.2, 0.8, 0.3, 1.5); }

@keyframes bar-pop { 0%, 100% { transform: scaleY(1); } 40% { transform: scaleY(2); } }
.bar.pop { animation: bar-pop 0.36s ease; transform-origin: center; }

.pop-bit {
  position: fixed; z-index: 50;
  width: 7px; height: 9px; border-radius: 1px;
  pointer-events: none; opacity: 0; will-change: transform, opacity;
  animation: pop-bit 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes pop-bit {
  0% { opacity: 1; transform: translate(-50%, 0) rotate(0deg); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x, 0px)), var(--y, -60px)) rotate(var(--r, 180deg)); }
}
@media (prefers-reduced-motion: reduce) {
  #nextBtn.did-it, .bar.pop { animation: none; }
}

/* report a problem with a step */
.step-report {
  display: block; width: 100%; margin-top: 14px;
  background: transparent; border: 0; color: var(--muted);
  font-size: 13px; text-decoration: underline; text-underline-offset: 2px;
}
.step-report:active { color: var(--ink); }
.report-panel {
  margin: 0; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 12px;
}
.report-q { margin: 0; font-size: 14px; font-weight: 600; }
.report-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.report-chips button {
  padding: 7px 12px; font-size: 13px; font-weight: 500;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
}
.report-chips button.on {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-color: var(--accent); color: var(--ink); font-weight: 600;
}
.report-panel textarea {
  width: 100%; font: inherit; color: var(--ink); line-height: 1.4;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; resize: vertical;
}
.report-panel textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.report-panel .secondary { align-self: flex-start; }

.report-warn { margin: 0; font-size: 13px; line-height: 1.5; color: var(--danger); }
