/* Finder UI. A demo can override the --f-* tokens in its own small stylesheet. */
:root {
  --f-accent: var(--accent);
  --f-accent-ink: var(--accent-ink);
  --f-surface: var(--surface);
  --f-line: var(--line);
}

/* Keeps the step label and heading clear of the sticky site header (4rem) when the engine scrolls the finder into view. */
[data-finder] { scroll-margin-top: 5rem; }

.finder-shell { max-width: 46rem; margin: 0 auto; padding: 1.25rem 1.25rem 3rem; }
@media (min-width: 48rem) { .finder-shell { padding: 2rem 2rem 4.5rem; } }
.finder-intro h1 { font-size: clamp(2rem, 6vw, 2.8rem); margin-bottom: .45rem; }
.finder-intro p { color: var(--muted); font-size: 1.1rem; max-width: 34rem; }

#finder {
  background: var(--f-surface); border: 1px solid var(--f-line); border-radius: 16px;
  padding: 1.25rem; margin-top: 1.5rem; min-height: 24rem;
  box-shadow: 0 1px 0 var(--f-line), 0 24px 48px -32px rgba(0, 0, 0, .35);
}
@media (min-width: 48rem) { #finder { padding: 2.25rem; } }

/* progress */
.msp-progress { margin-bottom: 1.5rem; }
.msp-step { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem; }
.msp-bar { height: 6px; background: var(--f-line); border-radius: 999px; overflow: hidden; }
.msp-bar-fill { height: 100%; background: var(--f-accent); border-radius: 999px; transition: width .3s ease; }

/* questions */
.msp-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.msp-helper { font-size: .9rem; color: var(--muted); margin: -.5rem 0 1rem; }
.msp-q { font-family: var(--serif); font-size: clamp(1.5rem, 4.8vw, 1.95rem); font-weight: 700; line-height: 1.2; margin: 0 0 1.1rem; padding: 0; outline: none; }
.msp-options { display: grid; gap: .6rem; }
.msp-option {
  display: grid; grid-template-columns: 1.25rem 1fr auto; align-items: center; gap: .85rem;
  font: inherit; text-align: left; width: 100%; min-height: 3.5rem; padding: .85rem 1rem;
  background: var(--bg); color: var(--ink); border: 1.5px solid var(--f-line); border-radius: 10px; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.msp-option-mark { width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 2px solid var(--muted); transition: border-color .15s ease, box-shadow .15s ease; }
.msp-option-go { color: var(--muted); opacity: 0; transform: translateX(-4px); transition: opacity .15s ease, transform .15s ease; }
.msp-option:hover, .msp-option:focus-visible { border-color: var(--f-accent); background: var(--f-surface); }
.msp-option:hover .msp-option-go, .msp-option:focus-visible .msp-option-go { opacity: 1; transform: none; color: var(--f-accent); }
.msp-option:hover .msp-option-mark { border-color: var(--f-accent); }
.msp-option:active { transform: scale(.99); }
.msp-option.is-selected { border-color: var(--f-accent); background: var(--accent-soft); }
.msp-option.is-selected .msp-option-mark { border-color: var(--f-accent); box-shadow: inset 0 0 0 4px var(--f-surface), inset 0 0 0 10px var(--f-accent); }

.msp-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; }
.msp-link {
  font: inherit; font-weight: 700; color: var(--f-accent); background: none; border: 0;
  padding: .6rem 0; min-height: 2.75rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.msp-restart { text-decoration: none; border: 1.5px solid var(--f-line); border-radius: 8px; padding: .55rem 1rem; color: var(--ink); }
.msp-restart:hover { border-color: var(--f-accent); color: var(--f-accent); }

/* result */
.msp-note { background: var(--accent-soft); border-left: 4px solid var(--f-accent); border-radius: 4px 8px 8px 4px; padding: .75rem 1rem; font-size: .95rem; margin: 0 0 .9rem; }
.msp-tip { color: var(--muted); font-size: .95rem; margin: .25rem 0 0; padding-left: 1rem; border-left: 2px solid var(--f-line); }
.msp-sub { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 2rem 0 .75rem; }
.msp-alts { display: grid; gap: .75rem; }
@media (min-width: 40rem) { .msp-alts { grid-template-columns: 1fr 1fr; } .msp-alts .msp-card { height: 100%; } }

.msp-card {
  display: flex; flex-direction: column; gap: .85rem;
  border: 1px solid var(--f-line); border-radius: 12px; padding: 1rem; background: var(--bg); margin-bottom: .75rem;
}
.msp-alts .msp-card { margin-bottom: 0; }
.msp-card-best { border: 2px solid var(--f-accent); background: var(--f-surface); padding: 1.15rem; box-shadow: 0 12px 32px -24px rgba(0, 0, 0, .45); }
@media (min-width: 40rem) { .msp-card-best { padding: 1.5rem; } }

.msp-card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.msp-label { font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0; }
.msp-card-best .msp-label { color: var(--f-accent-ink); background: var(--f-accent); padding: .25rem .6rem; border-radius: 4px; }

.msp-fit { display: flex; align-items: center; gap: .55rem; }
.msp-fit-num { font-size: .82rem; font-weight: 700; white-space: nowrap; }
.msp-meter { width: 4.5rem; height: 6px; border-radius: 999px; background: var(--f-line); overflow: hidden; }
.msp-meter-fill { display: block; height: 100%; background: var(--f-accent); border-radius: 999px; }

.msp-card-main { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem; align-items: start; }
.msp-card-best .msp-card-main { grid-template-columns: 5.5rem 1fr; }
@media (min-width: 40rem) { .msp-card-best .msp-card-main { grid-template-columns: 7.5rem 1fr; gap: 1.25rem; } }
@media (max-width: 39.99rem) {
  /* phones: image beside name and price, reason lines full width underneath */
  .msp-card-main, .msp-card-best .msp-card-main { grid-template-columns: 4rem 1fr; column-gap: .9rem; row-gap: 0; }
  .msp-card-body { display: contents; }
  .msp-card-img { grid-row: span 2; align-self: start; }
  .msp-why, .msp-blurb, .msp-reasoning, .msp-compare, .msp-visuals, .msp-signals { grid-column: 1 / -1; margin-top: .6rem; }
  .msp-signals { margin-bottom: 0; }
  .msp-reasoning .msp-why { margin-top: 0; }
  .msp-why + .msp-blurb { margin-top: .3rem; }
}
.msp-card-img { background: var(--bg); border: 1px solid var(--f-line); border-radius: 10px; aspect-ratio: 1; display: grid; place-items: center; }
.msp-card-best .msp-card-img { background: var(--accent-soft); border-color: transparent; }
.msp-img { width: 72%; height: auto; }
/* real photos fill the square; outlines (svg) stay inset */
.msp-img[src$=".jpg"], .msp-img[src$=".jpeg"], .msp-img[src$=".webp"] { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.msp-photo-note { font-size: .78rem; color: var(--muted); margin: 0; }
.msp-name { margin: 0 0 .2rem; font-size: 1.08rem; line-height: 1.25; }
.msp-card-best .msp-name { font-family: var(--serif); font-size: clamp(1.35rem, 4vw, 1.65rem); }
.msp-meta { color: var(--muted); font-size: .88rem; margin: 0 0 .55rem; }
.msp-why { font-weight: 600; margin: 0 0 .4rem; }
.msp-blurb { color: var(--muted); font-size: .95rem; margin: 0; }
.msp-reasoning { margin: 0 0 .6rem; }
.msp-why-head { font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 .25rem; }
.msp-reasons { list-style: none; margin: .45rem 0 0; padding: 0; display: grid; gap: .25rem; font-size: .92rem; }
.msp-reasons li { position: relative; padding-left: 1.4rem; }
.msp-reasons li::before { content: "✓"; position: absolute; left: 0; font-weight: 800; color: var(--f-accent); }
.msp-compare { font-size: .9rem; font-weight: 600; margin: 0 0 .4rem; }

.msp-details { margin: 0; display: grid; gap: .5rem; padding-top: .85rem; border-top: 1px solid var(--f-line); font-size: .9rem; }
.msp-details:empty { display: none; }
.msp-details div { display: grid; gap: .1rem; }
@media (min-width: 40rem) { .msp-card-best .msp-details div { grid-template-columns: 7.5rem 1fr; gap: 1.25rem; } }
.msp-details dt { font-weight: 700; }
.msp-details dd { margin: 0; color: var(--muted); }

.msp-card-foot { margin-top: auto; }
.msp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.75rem; padding: .55rem 1.1rem; border-radius: 8px;
  font-weight: 700; text-decoration: none; border: 1.5px solid var(--f-line); color: var(--ink); transition: border-color .15s ease, filter .15s ease;
}
.msp-btn::after { content: "↗"; font-size: .9em; }
.msp-btn:hover { border-color: var(--f-accent); color: var(--f-accent); }
.msp-btn-primary { background: var(--f-accent); border-color: var(--f-accent); color: var(--f-accent-ink); min-height: 3rem; padding: .65rem 1.4rem; }
.msp-btn-primary:hover { color: var(--f-accent-ink); filter: brightness(1.1); }
@media (max-width: 39.99rem) { .msp-card-best .msp-btn { width: 100%; } }

/* demo chrome */
.demo-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.lang-switch { display: flex; gap: .25rem; margin-bottom: .6rem; }
.lang-switch a { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-decoration: none; padding: .1rem .55rem; border: 1px solid var(--f-line); border-radius: 4px; color: var(--muted); min-width: 2.75rem; min-height: 2rem; display: inline-flex; align-items: center; justify-content: center; }
.lang-switch a:hover, .lang-switch a:focus-visible { border-color: var(--f-accent); color: var(--ink); }
.lang-switch a[aria-current] { background: var(--f-accent); border-color: var(--f-accent); color: var(--f-accent-ink); }
.demo-banner {
  display: block; width: 100%; height: auto; aspect-ratio: 5 / 2; object-fit: cover;
  border-radius: 16px; margin: .75rem 0 1.5rem; background: var(--f-line);
}
@media (max-width: 30rem) { .demo-banner { aspect-ratio: 3 / 1; } }
@media (min-width: 48rem) { .demo-banner { aspect-ratio: 4 / 1; } }

.cta-block {
  margin-top: 2.5rem; padding: 2rem 1.5rem; border-radius: 16px; background: var(--ink); color: var(--bg);
  display: grid; gap: .5rem;
}
@media (min-width: 48rem) { .cta-block { padding: 2.5rem; grid-template-columns: 1fr auto; align-items: end; column-gap: 2rem; } }
.cta-block h2 { font-size: clamp(1.6rem, 4.5vw, 2rem); margin: 0; }
.cta-block p { opacity: .85; max-width: 32rem; margin: 0; }
.cta-block .btn-wa { background: #25a35a; color: #04210f; margin-top: .75rem; }
@media (min-width: 48rem) { .cta-block .btn-wa { grid-column: 2; grid-row: 1 / span 2; margin: 0; } }
.cta-block .cta-by { font-size: .9rem; opacity: .65; margin-top: .5rem; }
.demo-foot-note { font-size: .9rem; }

/* mobile: keep the call to action in reach once a result is showing */
.sticky-cta { display: none; }
@media (max-width: 47.99rem) {
  .sticky-cta:not([hidden]) {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
    padding: .65rem 1.25rem calc(.65rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
  }
  .sticky-cta .btn { width: 100%; }
  body.has-sticky .site-foot { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .msp-option, .msp-option-go, .msp-bar-fill { transition: none; }
}

/* answer chips, work line, visuals, compare table, share */
.msp-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .9rem; }
.msp-chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0; min-height: 2.75rem; padding: .3rem .75rem; text-align: left;
  border: 1.5px solid var(--f-line); border-radius: 999px; background: var(--bg); color: var(--ink); font: inherit; cursor: pointer;
  transition: border-color .15s ease;
}
.msp-chip:hover, .msp-chip:focus-visible { border-color: var(--f-accent); }
.msp-chip-q { font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.msp-chip-a { font-size: .9rem; font-weight: 600; }
.msp-work { color: var(--muted); font-size: .92rem; margin: 0 0 .9rem; }

.msp-visuals { display: grid; gap: .45rem; margin: .6rem 0 .5rem; }
.msp-viz { display: grid; grid-template-columns: 3rem 1fr; align-items: center; gap: .6rem; font-size: .8rem; }
.msp-viz-label { font-weight: 700; color: var(--muted); }
.msp-scale { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem; }
.msp-scale-end { color: var(--muted); font-size: .72rem; }
.msp-scale-track { position: relative; height: 6px; border-radius: 999px; background: var(--f-line); }
.msp-scale-dot, .msp-scale-you { position: absolute; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; }
.msp-scale-dot { width: 14px; height: 14px; background: var(--f-accent); border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--f-accent); }
.msp-scale-you { width: 10px; height: 10px; border: 2px solid var(--ink); background: transparent; }
.msp-dots { display: inline-flex; gap: .3rem; }
.msp-pip { width: .7rem; height: .7rem; border-radius: 50%; border: 1.5px solid var(--muted); }
.msp-pip.is-on { background: var(--f-accent); border-color: var(--f-accent); }

.msp-table-scroll { overflow-x: auto; border: 1px solid var(--f-line); border-radius: 10px; }
.msp-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 34rem; }
.msp-table th, .msp-table td { padding: .55rem .7rem; text-align: left; border-bottom: 1px solid var(--f-line); white-space: nowrap; }
.msp-table thead th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.msp-table tbody tr:last-child > * { border-bottom: 0; }
.msp-table tr.is-best > * { background: var(--f-surface); font-weight: 700; }

.msp-share { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.msp-share-status { font-size: .88rem; color: var(--muted); }

/* confidence and risk badges */
.msp-signals { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .6rem; }
.msp-signal { font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 4px; border: 1px solid var(--f-line); color: var(--muted); background: var(--bg); }
.msp-conf-high, .msp-risk-low { color: var(--f-accent); border-color: var(--f-accent); background: var(--accent-soft); }
.msp-conf-lower, .msp-risk-high { color: var(--ink); border-color: var(--ink); }
.msp-risk-medium, .msp-conf-medium { color: var(--ink); }
.msp-watch dt { color: var(--ink); }
.msp-watch dd { color: var(--ink); }
