.tool { padding: clamp(32px, 5vw, 64px) 0 clamp(56px, 8vw, 96px); }
.tool-head h1 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); max-width: 18em; }
.tool-head .lede { margin: 16px 0 8px; }
.saved { font-size: .92rem; color: var(--muted); margin-bottom: 28px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration-color: var(--contour); text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }

.tool-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.tool-side { position: sticky; top: 88px; display: grid; gap: 16px; }
@media (max-width: 980px) { .tool-grid { grid-template-columns: 1fr; } .tool-side { position: static; } }

/* Section legs: a route of six stops */
.legs { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.legs button { width: 100%; font: inherit; font-size: .88rem; text-align: left; background: none; border: 0; border-top: 4px solid var(--contour-soft); padding: 8px 2px 0; color: var(--muted); cursor: pointer; }
.legs button[aria-current="step"] { border-top-color: var(--pin); color: var(--ink); font-weight: 700; }
.legs button.done { border-top-color: var(--contour); color: var(--ink); }
.legs button:hover { color: var(--ink); }
@media (max-width: 600px) { .legs button span { display: none; } .legs button::after { content: attr(data-n); font-weight: 700; } }

fieldset.step { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.step legend { padding: 0; margin-bottom: 20px; }
fieldset.step legend h2 { font-size: 1.7rem; }
.nav-row { display: flex; gap: 12px; justify-content: space-between; margin-top: 8px; flex-wrap: wrap; }
.nav-row #back[hidden] + #next { margin-left: auto; }
#formErr { margin-top: 12px; }

/* Share sliders */
.shares { display: grid; gap: 10px; margin-top: 12px; }
.shares:empty { display: none; }
.share { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 1.2fr) 52px; gap: 12px; align-items: center; font-size: .95rem; }
.share input[type="range"] { width: 100%; accent-color: var(--survey); }
.share output { text-align: right; font-weight: 700; }
@media (max-width: 520px) { .share { grid-template-columns: 1fr 52px; } .share input { grid-column: 1 / -1; grid-row: 2; } }

/* Readout */
.readout h3 { font-size: 1rem; margin: 20px 0 8px; }
.ro-label { margin: 0; color: var(--muted); font-size: .92rem; }
.ro-range { font-stretch: 125%; font-weight: 800; font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 2px 0 4px; line-height: 1.15; }
.factors, .raise { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.factors li { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: baseline; font-size: .95rem; }
.factors .d { font-weight: 800; font-stretch: 125%; text-align: center; border-radius: 999px; padding: 1px 0; }
.factors .plus { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.factors .minus { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.factors .why { display: block; color: var(--muted); font-size: .88rem; }
.raise li { font-size: .95rem; padding-left: 18px; position: relative; }
.raise li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--pin); border: 1.5px solid var(--pin-ink); }
.none { color: var(--muted); }
.factors li.none { display: block; }
.ro-range.is-empty { font-size: 1.15rem; font-stretch: 100%; font-weight: 600; color: var(--muted); }
.raise li.none::before { display: none; }
.disclaimer { margin: 20px 0 0; }

/* Result */
.result h2 { font-size: 1.8rem; }
.res-range { font-stretch: 125%; font-weight: 800; font-size: clamp(2rem, 4.4vw, 3rem); margin: 10px 0 6px; line-height: 1.1; }
.summary { width: 100%; border-collapse: collapse; margin-top: 28px; font-size: .93rem; display: none; }
.summary th, .summary td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.summary th { width: 38%; color: var(--muted); font-weight: 600; }

/* Mobile range bar */
.minibar { display: none; }
@media (max-width: 980px) {
  .minibar { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 15; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow-up); font-size: .95rem; }
  .minibar strong { font-stretch: 125%; font-size: 1.05rem; }
  .minibar.off { display: none; }
  .tool { padding-bottom: 96px; }
}

@media print {
  .tool-grid { display: block; }
  .tool-side .mapcard { display: none; }
  .summary { display: table; }
  .panel { box-shadow: none; border: 0; padding: 0; }
  #vform { display: none !important; }
}
