/* ============================================================================
   css/groups.css — WELL Group Studio: /advisors/groups and its calculator
   ----------------------------------------------------------------------------
   Loaded by /advisors/groups and /advisors/groups/calculator (extraStyles),
   after site.css and practitioners.css, whose .pf-* form styles both reuse.

   EDITORIAL, NOT A DASHBOARD (Group Design brief §11). Hairlines, the site's
   three typefaces and its tokens; no new colours. Teal is "contribution",
   deep gold the investment line and the "typical" mark, and the form's own
   error red the only negative — all three already exist in css/tokens.css or
   css/practitioners.css. Warmth comes from imagery and space, not from
   decoration (26 Oct review: "make it more engaging and welcoming").
   ========================================================================== */

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: -1px;
}

/* ══ THE HEADLINE ═════════════════════════════════════════════════════════
   The brief's headline is 80 characters. At the shared 46rem measure it set
   as five lines at 2000px; a wider measure and a slightly lower cap set it in
   three. Phones keep the shared 9vw scaling. */
body[data-page="advisor-groups"] .page-header--long h1 {
  max-width: min(62rem, 100%);
  font-size: clamp(1.85rem, 9vw, 4.6rem);
}

/* ══ THE HERO IMAGES ══════════════════════════════════════════════════════
   The shared page-header veil is a uniform 60–88% midnight, made for images
   that sit wholly behind type. These two are golden-hour group scenes whose
   people are on the right and whose copy is on the left, so the veil here is
   directional: dark behind the words, opening toward the group. Deliberate,
   and flagged for Duncan's review (26 Oct). */
body[data-page="advisor-groups"] .page-header--media .page-header-media img,
body[data-page="advisor-group-calculator"] .page-header--media .page-header-media img {
  object-position: 70% 50%;
}
body[data-page="advisor-groups"] .page-header-veil,
body[data-page="advisor-group-calculator"] .page-header-veil {
  background:
    linear-gradient(90deg, rgba(10, 16, 26, 0.86) 0%, rgba(10, 16, 26, 0.74) 38%, rgba(10, 16, 26, 0.38) 66%, rgba(10, 16, 26, 0.12) 100%),
    linear-gradient(0deg, rgba(10, 16, 26, 0.5) 0%, rgba(10, 16, 26, 0) 40%);
}
@media (max-width: 760px) {
  /* On a phone the copy covers the whole width: keep the image, darken evenly. */
  body[data-page="advisor-groups"] .page-header-veil,
  body[data-page="advisor-group-calculator"] .page-header-veil {
    background: linear-gradient(rgba(10, 16, 26, 0.7) 0%, rgba(10, 16, 26, 0.82) 100%);
  }
}

/* ══ RHYTHM ═══════════════════════════════════════════════════════════════
   The shared --section-y caps at 11rem: 352px between sections at 2000px.
   Right for the sparse editorial pages; on a sales page whose sections each
   carry an image or a set of cards it read as the page drifting apart
   (Duncan, 26 Oct: "a lot of space around" the why section). Eclipse made the
   same call for the same reason (css/chrome.css). Headings get a wider
   measure so a short one sets on one line, and balanced wrapping when it
   cannot. */
body[data-page="advisor-groups"] { --section-y: clamp(4.5rem, 8vw, 7.5rem); }
body[data-page="advisor-groups"] .section-head { max-width: min(60rem, 100%); }
body[data-page="advisor-groups"] .section-head h2 { text-wrap: balance; }

/* ══ WHY, AND WHAT YOU BUILD ══════════════════════════════════════════════
   Portrait image beside the argument. The three outcomes are rows with a
   title column, so they read as the answer to the headline, not a list. */
.gy {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 6vw, 6rem); align-items: center;
}
.gy-figure { margin: 0; }
.gy-figure .photo-frame-media img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; height: auto; display: block; }
.gy-figure.photo--placeholder .photo-frame { aspect-ratio: 4 / 5; min-height: 0; }
.gy-copy .section-head { margin-bottom: 1.4rem; }
.gy-copy > p { max-width: var(--measure); color: var(--ivory-ink); }
.gy-list { list-style: none; margin: clamp(1.75rem, 3vw, 2.5rem) 0 0; padding: 0; border-top: 1px solid var(--hairline-l); }
.gy-list li {
  display: grid; grid-template-columns: minmax(0, 17.5rem) minmax(0, 1fr); gap: 0.4rem 2rem;
  padding: 1.15rem 0; border-bottom: 1px solid var(--hairline-l);
}
.gy-list h3 {
  margin: 0; font-family: var(--serif-display); font-weight: 400;
  font-size: clamp(1.2rem, 1.6vw, 1.45rem); line-height: 1.25; color: var(--ink);
}
.gy-list p { margin: 0; color: var(--muted); }
@media (max-width: 900px) {
  .gy { grid-template-columns: 1fr; }
  /* A full-width portrait would be a screen and a half tall on a phone. */
  .gy-figure .photo-frame-media img { aspect-ratio: 4 / 3; object-position: 50% 62%; }
  .gy-list li { grid-template-columns: 1fr; }
}

/* ══ USE CASES — one wide card, two beneath it ═══════════════════════════
   The custom-branded group is the commonest start, so it leads across the
   full width as image-and-text; the other two sit side by side under it.
   (Two narrow image-and-text rows beside a tall card squeezed their
   headings to two lines at 2000px.) One column below 900px. */
.gu-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.2vw, 2rem);
}
.gu-card { display: flex; flex-direction: column; background: var(--paper); border-radius: 2px; overflow: hidden; }
.section--paper .gu-card { background: var(--paper-2); }
.gu-media { margin: 0; }
.gu-media .photo-frame-media img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; height: auto; display: block; }
.gu-media.photo--placeholder .photo-frame { aspect-ratio: 16 / 9; min-height: 0; }
.gu-body { padding: clamp(1.25rem, 2.2vw, 1.9rem); display: flex; flex-direction: column; flex: 1; }
.gu-body h3 { margin: 0 0 0.55rem; font-family: var(--serif-display); font-size: var(--fs-h3); font-weight: 400; color: var(--ink); }
.gu-body p { margin: 0 0 1rem; color: var(--ivory-ink); max-width: 34rem; }
.gu-body .contact-link { margin-top: auto; align-self: flex-start; }
.gu-card--lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.gu-card--lead .gu-media .photo-frame-media img { aspect-ratio: 16 / 10; }
.gu-card--lead .gu-body { justify-content: center; padding: clamp(1.5rem, 3.5vw, 3.25rem); }
.gu-card--lead .gu-body h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.gu-card--lead .gu-body .contact-link { margin-top: 0.4rem; }
@media (max-width: 900px) {
  .gu-grid { grid-template-columns: 1fr; max-width: 40rem; }
  .gu-card--lead { display: flex; }
  .gu-card--lead .gu-media .photo-frame-media img { aspect-ratio: 16 / 9; }
}

/* ══ ENGAGEMENTS — three stages on the gold journey line ══════════════════
   The line is the brand's journey line, and here it carries information: the
   stages run in order. Across the cards at desktop, down their left edge on
   a phone. js/groups-page.js draws it in once (is-waiting → is-drawn);
   without that, or with reduced motion, it is simply there. */
.gt-grid {
  --node: 14px;
  position: relative; list-style: none; margin: 0; padding: 2.4rem 0 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.4vw, 2rem);
}
.gt-grid::before {
  content: ''; position: absolute; left: 0; right: 0; top: calc(var(--node) / 2 - 1px);
  height: 2px; background: var(--gold); transform-origin: left center;
}
.gt-grid.is-waiting::before { transform: scaleX(0); }
.gt-grid.is-drawn::before { transform: scaleX(1); transition: transform 1.1s var(--ease-out-quint); }
.gt-node {
  position: absolute; top: calc(-2.4rem); left: clamp(1.5rem, 2.6vw, 2.2rem);
  width: var(--node); height: var(--node); border-radius: 50%;
  background: var(--paper-2); border: 2px solid var(--gold); box-sizing: border-box;
}
.section--paper .gt-node { background: var(--paper); }
.gt-grid.is-waiting .gt-node { transform: scale(0); }
.gt-grid.is-drawn .gt-node { transform: scale(1); transition: transform .45s var(--ease-out-quint), background-color .25s ease; }
.gt-grid.is-drawn .gt-card:nth-child(2) .gt-node { transition-delay: .35s, 0s; }
.gt-grid.is-drawn .gt-card:nth-child(3) .gt-node { transition-delay: .7s, 0s; }
.gt-card:hover .gt-node, .gt-card:focus-within .gt-node { background: var(--gold); }

.gt-card {
  position: relative; display: flex; flex-direction: column;
  padding: clamp(1.5rem, 2.6vw, 2.2rem);
  background: var(--paper); border-radius: 2px;
  box-shadow: 0 1px 0 var(--hairline-l);
}
.section--paper .gt-card { background: var(--paper-2); }
@media (prefers-reduced-motion: no-preference) {
  .gt-card { transition: transform .35s var(--ease-out-quint), box-shadow .35s var(--ease-out-quint); }
  .gt-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px -18px rgba(19, 50, 57, 0.28); }
}
.gt-stage {
  margin: 0 0 0.55rem;
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600;
  letter-spacing: var(--track-label); text-transform: uppercase; color: var(--teal);
}
.gt-name { margin: 0 0 0.55rem; font-family: var(--serif-display); font-size: var(--fs-h3); font-weight: 400; color: var(--ink); }
.gt-promise { margin: 0 0 1.3rem; color: var(--ivory-ink); }
.gt-k { margin: 0 0 0.45rem; font-family: var(--sans); font-size: 0.8rem; font-weight: 600; color: var(--gold-deep); }
.gt-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.gt-list li { position: relative; padding: 0.22rem 0 0.22rem 1.05rem; font-size: 0.94rem; line-height: 1.45; color: var(--ivory-ink); }
.gt-list li::before { content: ''; position: absolute; left: 0; top: 0.9rem; width: 0.45rem; height: 1px; background: var(--gold-deep); }
.gt-cta { margin-top: auto; align-self: flex-start; }

@media (max-width: 960px) {
  .gt-grid { grid-template-columns: 1fr; max-width: 40rem; padding: 0 0 0 2.25rem; }
  .gt-grid::before { left: calc(var(--node) / 2 - 1px); right: auto; top: 0; bottom: 0; width: 2px; height: auto; transform-origin: center top; }
  .gt-grid.is-waiting::before { transform: scaleY(0); }
  .gt-grid.is-drawn::before { transform: scaleY(1); }
  .gt-node { left: -2.25rem; top: clamp(1.5rem, 2.6vw, 2.2rem); }
}

/* Not ready? The free routes, at the point of choosing. */
.gt-alt {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem 2rem;
  margin-top: clamp(2rem, 4vw, 3rem); padding-top: 1.4rem; border-top: 1px solid var(--hairline-l);
}
.gt-alt p { margin: 0; font-family: var(--serif); font-style: italic; font-size: 1.08rem; color: var(--ink); }
.gt-alt ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }

/* ══ CALCULATOR TEASER ════════════════════════════════════════════════════ */
.gct { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
@media (max-width: 900px) { .gct { grid-template-columns: 1fr; } }
.gct-steps { list-style: none; margin: 1.5rem 0; padding: 0; counter-reset: gct; }
.gct-steps li {
  counter-increment: gct; position: relative; padding: 0.55rem 0 0.55rem 2.6rem;
  border-bottom: 1px solid var(--hairline-l); color: var(--ivory-ink);
}
.gct-steps li::before {
  content: counter(gct); position: absolute; left: 0; top: 0.45rem;
  display: grid; place-items: center; width: 1.7rem; height: 1.7rem;
  border: 1px solid var(--teal); border-radius: 50%;
  font-family: var(--sans); font-size: 0.78rem; font-weight: 600; color: var(--teal);
}
.gct-actions { margin: 0 0 0.6rem; }
.gct-figure { margin: 0; }
.gct-figure .photo-frame-media img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; height: auto; display: block; }
.gct-figure.photo--placeholder .photo-frame { aspect-ratio: 4 / 5; min-height: 0; }

/* ══ FAQ ══════════════════════════════════════════════════════════════════ */
/* .gf-faq / .gf-q / .gf-a moved to site.css (3 Nov 2026): the FAQ is now used on
   the homepage and /advisors too. */
.gf-calc-link { margin-top: 1.4rem; }

/* ══ THE APPLICATION, IN STEPS ════════════════════════════════════════════
   Without JavaScript the four steps stack, divided by practitioners.css's
   rule. Stepped, only one shows, so that rule must not fire on it. */
.pf[data-stepped] .pf-step + .pf-step { margin-top: 0; padding-top: 0; border-top: 0; }
.pf[data-stepped] [data-gf-step][hidden] { display: none; }
.gf-nav { align-items: center; }
.gf-nav .pf-back { margin-right: auto; }
.gf-nav [data-gf-next], .gf-nav [data-gf-submit] { margin-left: auto; }
.pf .gf-attached { margin: 0 0 1.75rem; }

/* ══ THE WIZARD — /advisors/groups/calculator ═════════════════════════════ */
.gw-static { max-width: 44rem; color: var(--muted); }
.gw-progress ol {
  list-style: none; margin: 0 0 clamp(1.5rem, 3vw, 2.5rem); padding: 0;
  display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: none;
}
.gw-progress ol::-webkit-scrollbar { display: none; }
.gw-prog-btn {
  display: flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.9rem 0 0.45rem;
  font: inherit; font-family: var(--sans); font-size: 0.85rem; white-space: nowrap;
  color: var(--muted); background: transparent; border: 1px solid var(--hairline-l); border-radius: 999px; cursor: pointer;
}
.gw-prog-btn:disabled { cursor: default; opacity: 0.55; }
.gw-prog-n {
  display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  border: 1px solid currentColor; font-size: 0.75rem; font-weight: 600;
}
.gw-prog-btn.is-done { color: var(--teal); border-color: var(--teal); }
.gw-prog-btn.is-current { color: #fff; background: var(--teal); border-color: var(--teal); }
.gw-prog-btn:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }

.gw-layout { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: clamp(2rem, 4vw, 4rem); align-items: start; }
@media (max-width: 1000px) { .gw-layout { grid-template-columns: 1fr; } }
.gw-main { max-width: 52rem; }

.gw-step-head { margin: 0 0 1.5rem; }
.gw-step-n { margin: 0 0 0.4rem; font-family: var(--sans); font-size: 0.75rem; font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--gold-deep); }
.gw-step-title { margin: 0 0 0.5rem; font-family: var(--serif-display); font-size: var(--fs-h2); font-weight: 400; color: var(--ink); }
.gw-step-title:focus { outline: none; }
.gw-step-lead { margin: 0; color: var(--muted); font-size: var(--fs-lead); }

.gw-group { margin: 0 0 2rem; padding: 0; border: 0; min-width: 0; }
.gw-group > legend, .gw-group-label {
  display: block; padding: 0; margin: 0 0 0.5rem;
  font-family: var(--sans); font-size: 0.95rem; font-weight: 600; color: var(--ivory-ink);
}
.gw-why { margin: 0 0 0.8rem; font-size: 0.88rem; color: var(--muted); }
.gw-why-k { font-family: var(--sans); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-deep); margin-right: 0.35rem; }

.gw-opts { display: grid; gap: 0.6rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gw-opts--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gw-opts--bands { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .gw-opts, .gw-opts--compact, .gw-opts--bands { grid-template-columns: 1fr; } }
.gw-opt {
  position: relative; display: flex; gap: 0.75rem; align-items: flex-start;
  min-height: 44px; padding: 0.9rem 1rem;
  background: #fff; border: 1px solid #76827F; border-radius: 4px; cursor: pointer;
}
.gw-opt input { flex: none; width: 1.1rem; height: 1.1rem; margin: 0.15rem 0 0; accent-color: var(--teal); }
.gw-opt:has(input:checked) { border-color: var(--teal); background: #F0F7F6; box-shadow: inset 0 0 0 1px var(--teal); }
.gw-opt:has(input:focus-visible) { outline: 2px solid var(--gold-deep); outline-offset: 1px; }
.gw-opt-body { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.gw-opt-label { font-weight: 600; color: var(--ivory-ink); line-height: 1.35; }
.gw-opt-detail { font-size: 0.88rem; color: var(--muted); line-height: 1.4; }
.gw-opt-note { font-size: 0.85rem; color: var(--teal); font-variant-numeric: tabular-nums; }
.gw-typical {
  align-self: flex-start; margin-top: 0.25rem; padding: 0.1rem 0.5rem;
  font-family: var(--sans); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold-deep); border: 1px solid var(--gold-deep); border-radius: 999px;
}

.gw-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.gw-chips--quick { margin-top: 0.6rem; }
.gw-chip input { position: absolute; opacity: 0; pointer-events: none; }
.gw-chip span, .gw-chip-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem;
  font: inherit; font-family: var(--sans); font-size: 0.9rem; color: var(--ivory-ink);
  background: #fff; border: 1px solid #76827F; border-radius: 999px; cursor: pointer;
}
.gw-chip input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
.gw-chip input:focus-visible + span, .gw-chip-btn:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.gw-chips--quick .pf-hint { margin: 0 0.25rem 0 0; }

.gw-stepper { display: inline-flex; align-items: stretch; }
.gw-stepper input {
  width: 5.5rem; min-height: 48px; text-align: center; font: inherit; font-size: 1.3rem;
  border: 1px solid #76827F; border-left: 0; border-right: 0; background: #fff; color: var(--ivory-ink);
  appearance: textfield; -moz-appearance: textfield;
}
.gw-step-btn {
  width: 48px; min-height: 48px; font-size: 1.3rem; line-height: 1;
  background: var(--paper-2); color: var(--ivory-ink); border: 1px solid #76827F; cursor: pointer;
}
.gw-step-btn:first-child { border-radius: 4px 0 0 4px; }
.gw-step-btn:last-child { border-radius: 0 4px 4px 0; }

.gw-field { margin-top: 0.8rem; max-width: 22rem; }
.gw-field label { display: block; margin-bottom: 0.4rem; }
.gw-field input[type="number"] { display: block; width: 100%; min-height: 44px; padding: 0.6rem 0.75rem; font: inherit; border: 1px solid #76827F; border-radius: 2px; background: #fff; }
.gw-own { margin-top: 0.6rem; padding: 0.4rem 0 0.2rem 1rem; border-left: 2px solid var(--teal); }
.gw-own--pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.gw-own-note { grid-column: 1 / -1; }
@media (max-width: 560px) { .gw-own--pair { grid-template-columns: 1fr; } }

.gc-money, .gc-pct { display: flex; align-items: stretch; }
.gc-unit {
  display: grid; place-items: center; padding: 0 0.6rem;
  font-family: var(--sans); font-size: 0.8rem; color: var(--muted);
  background: var(--paper-2); border: 1px solid #76827F;
}
.gc-money .gc-unit { border-right: 0; border-radius: 2px 0 0 2px; }
.gc-pct .gc-unit { border-left: 0; border-radius: 0 2px 2px 0; }
.gc-money input, .gc-pct input { min-width: 0; }

.gw-fine { margin: 0 0 1.5rem; border-top: 1px solid var(--hairline-l); }
.gw-fine > summary { cursor: pointer; padding: 0.8rem 0; font-family: var(--sans); font-size: 0.88rem; font-weight: 600; color: var(--ivory-ink); }
.gw-fine-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
@media (max-width: 760px) { .gw-fine-grid { grid-template-columns: 1fr; } }
.gw-cost-line { margin: 0 0 1.25rem; padding: 1rem 1.2rem; background: var(--paper-2); border-left: 2px solid var(--teal); }
.gw-cost-line p { margin: 0 0 0.3rem; }
.gw-cost-line strong { font-family: var(--serif-display); font-size: 1.4rem; font-weight: 400; color: var(--ink); margin-left: 0.3rem; }
.gw-cl-k { font-family: var(--sans); font-size: 0.85rem; font-weight: 600; color: var(--ivory-ink); }
.gw-price { margin-top: 0.5rem; }

.gw-unsure { margin: 1.25rem 0 0; padding: 1.1rem 1.3rem; background: var(--paper-2); border-left: 2px solid var(--gold-deep); max-width: 46rem; }
.gw-unsure p { margin: 0 0 0.7rem; }
.gw-unsure p:last-child { margin: 0; }

.gw-nav { display: flex; gap: 0.75rem; justify-content: space-between; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--hairline-l); }
.gw-nav [data-gw-nextbtn] { margin-left: auto; }
.gw-errors ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.gw-errors p { margin: 0; }

/* ── The summary rail ─────────────────────────────────────────────────── */
.gw-rail { position: sticky; top: 6.5rem; }
.gw-rail-inner { padding: 1.4rem 1.4rem 1.2rem; background: var(--ink); color: var(--paper); border-radius: 4px; }
.gw-rail-k { margin: 0 0 0.9rem; font-family: var(--sans); font-size: 0.72rem; font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--gold); }
.gw-rail-figs { margin: 0; }
.gw-rail-figs > div { padding: 0.55rem 0; border-top: 1px solid var(--hairline-d); }
.gw-rail-figs dt { font-size: 0.8rem; color: var(--mist); }
.gw-rail-figs dd { margin: 0.15rem 0 0; font-family: var(--serif-display); font-size: 1.35rem; color: var(--paper); font-variant-numeric: tabular-nums; }
.gw-rail.is-neg [data-gw-r="profit"] { color: #F2B8A4; }
.gw-rail-toggle { display: none; }
@media (max-width: 1000px) {
  .gw-rail { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; }
  .gw-rail-inner { border-radius: 0; padding: 0.5rem var(--gutter) calc(0.5rem + env(safe-area-inset-bottom)); }
  .gw-rail-k { display: none; }
  .gw-rail-figs { display: none; }
  .gw-rail.is-open .gw-rail-figs { display: block; padding-bottom: 0.4rem; }
  .gw-rail-toggle {
    display: block; width: 100%; min-height: 44px; padding: 0;
    font: inherit; font-family: var(--sans); font-size: 0.85rem; font-weight: 600; text-align: left;
    color: var(--paper); background: transparent; border: 0; cursor: pointer;
  }
  .gw-rail-toggle::after { content: ' \25B4'; color: var(--gold); }
  .gw-rail.is-open .gw-rail-toggle::after { content: ' \25BE'; }
  .group-wizard { padding-bottom: calc(var(--section-y) + 3rem); }
}
/* On results the rail repeats what the page already says in full. */
.gw-app.is-results .gw-rail { display: none; }
.gw-app.is-results .gw-layout { grid-template-columns: 1fr; }
.gw-app.is-results .gw-main { max-width: 72rem; }

/* ── Results ──────────────────────────────────────────────────────────── */
.gw-sentences { max-width: 46rem; margin: 0 0 1.75rem; }
.gw-sentences p { margin: 0 0 0.5rem; font-size: var(--fs-lead); color: var(--ivory-ink); }
.gc-viewpoint-tag { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.gc-results-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
@media (max-width: 900px) { .gc-results-grid { grid-template-columns: 1fr; } }
.gc-figures { margin: 0; }
.gc-fig { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--hairline-l); }
.gc-fig dt { margin: 0; font-size: 0.95rem; color: var(--ivory-ink); }
.gc-fig dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 0.98rem; }
.gc-fig-note { display: block; font-size: 0.78rem; color: var(--muted); }
.gc-fig--key dt, .gc-fig--key dd { font-weight: 600; color: var(--ink); }
.gc-fig--key dd { color: var(--teal); }
.gc-fig--neg dd { color: #9A3B21; }
.gc-chart { margin: 0; }
.gc-svg { display: block; width: 100%; height: auto; }
.gc-bar { fill: var(--teal); }
.gc-bar--neg { fill: #9A3B21; }
.gc-inv { stroke: var(--gold-deep); stroke-width: 1.5; stroke-dasharray: 5 4; }
.gc-zero { stroke: var(--hairline-l); stroke-width: 1; }
.gc-legend { margin: 0.6rem 0 0; font-size: 0.78rem; color: var(--muted); }
.gc-key { display: inline-block; width: 0.8rem; height: 0.55rem; margin: 0 0.35rem 0 0.2rem; vertical-align: middle; }
.gc-key--bar { background: var(--teal); }
.gc-key--inv { height: 0; border-top: 2px dashed var(--gold-deep); margin-left: 0.8rem; }
.gc-chart-text { margin: 0.6rem 0 0; font-size: 0.82rem; line-height: 1.5; color: var(--muted); }
.gc-scenarios { margin-top: 1.75rem; overflow-x: auto; }
.gc-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.gc-table caption { text-align: left; margin-bottom: 0.5rem; font-size: 0.82rem; color: var(--muted); }
.gc-table th, .gc-table td { padding: 0.5rem 0.6rem; text-align: right; border-bottom: 1px solid var(--hairline-l); white-space: nowrap; }
.gc-table th:first-child { text-align: left; }
.gc-table thead th { font-weight: 600; font-size: 0.8rem; color: var(--ivory-ink); }
.gc-row--current { background: var(--paper-2); }
.gc-neg { color: #9A3B21; }
.gc-caveat { margin: 1.4rem 0 0; max-width: 52rem; font-size: 0.82rem; color: var(--muted); }
.gw-next { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 0.6rem; }

.gw-sources { margin-top: clamp(2rem, 4vw, 3rem); max-width: 60rem; border-top: 1px solid var(--hairline-l); font-size: 0.88rem; color: var(--muted); }
.gw-sources > summary { cursor: pointer; padding: 0.9rem 0; font-family: var(--sans); font-weight: 600; color: var(--ivory-ink); }
.gw-sources ul { padding-left: 1.2rem; }
.gw-sources li { margin: 0 0 0.45rem; }
.gw-sources a { color: var(--gold-deep); text-underline-offset: 3px; }
.gw-asof { white-space: nowrap; }

/* ══ THE ATTACHED MODEL, INSIDE THE APPLICATION ══════════════════════════ */
.pf select {
  display: block; width: 100%; min-height: 44px; padding: 0.6rem 0.75rem;
  font: inherit; font-size: 1rem; color: var(--ivory-ink); background: #fff;
  border: 1px solid #76827F; border-radius: 2px;
}
.pf select:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 1px; border-color: var(--gold-deep); }
.gf-attached { margin: 1.6rem 0 0; padding: 1rem 1.2rem; background: #F0F7F6; border-left: 2px solid var(--teal); }
.gf-attached .pf-label { display: block; margin: 0 0 0.35rem; font-size: 0.88rem; font-weight: 600; }
.gf-attached-summary { margin: 0 0 0.8rem; font-size: 0.92rem; line-height: 1.5; }
.gf-attached-stale { margin: 0 0 0.8rem; font-size: 0.88rem; color: #7A2E18; }
.pf-choice + .pf-grid--one, .pf-grid--one + .pf-choice, .pf-choice + .pf-choice { margin-top: 1.4rem; }

/* ══ THE CALCULATOR AS A TOOL (26 Oct, Duncan's review) ═══════════════════
   With JavaScript the page is stamped html[data-finder="app"] before first
   paint (lib/page.js, `appShell`), and css/site.css removes the site header,
   footer, page header (#top) and closing band (#begin). These rules finish
   the job for this page: the professional context strip goes too, the tool
   gets its own bar with Exit, a launch card over the header image, the steps
   sit in a raised card on the Finder's deeper ground, and the application is
   a screen of its own (html[data-gw-screen="apply"]), not a scroll away.
   Without JavaScript none of it applies and the page reads as a page. */
html[data-finder="app"] body[data-page="advisor-group-calculator"] .pro-context { display: none; }

.gw-bar {
  position: sticky; top: 0; z-index: 30;
  padding-block: 0.9rem; background: var(--paper); border-bottom: 1px solid var(--hairline-l);
}
.gw-bar[hidden] { display: none; }
.gw-bar-inner { display: flex; align-items: center; gap: 1rem; }
.gw-bar-brand { font-family: var(--sans); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gw-exit { text-decoration: none; display: inline-flex; align-items: center; white-space: nowrap; flex-shrink: 0; }
.gw-bar-brand { min-width: 0; }

html[data-finder="app"] .group-wizard {
  min-height: calc(100dvh - 3.7rem);
  padding-block: clamp(1.5rem, 4vh, 3rem) clamp(2.5rem, 6vh, 4rem);
  background: color-mix(in srgb, var(--ink) 5%, var(--paper-2));
}
html[data-finder="app"] .group-wizard .gw-app {
  background: var(--paper); border: 1px solid var(--hairline-l); border-radius: 3px;
  box-shadow: 0 18px 48px -34px var(--ink);
  padding: clamp(1.25rem, 3vw, 2.75rem);
}
@media (min-width: 1001px) { html[data-finder="app"] .gw-rail { top: 5.5rem; } }
html[data-finder="app"] .gw-step-title { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }

/* The launch card, over the page header's image. */
html[data-finder="app"] .group-wizard:has(.gw-launch:not([hidden])) { padding: 0; background: var(--ink); }
.gw-launch { position: relative; min-height: calc(100dvh - 3.7rem); display: flex; overflow: hidden; }
.gw-launch[hidden] { display: none; }
.gw-launch-media { position: absolute; inset: 0; }
.gw-launch-media picture { display: block; width: 100%; height: 100%; }
.gw-launch-media img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; display: block; }
.gw-launch-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(10, 16, 26, 0.72) 0%, rgba(10, 16, 26, 0.45) 45%, rgba(10, 16, 26, 0.1) 100%);
}
.gw-launch-wrap { position: relative; z-index: 1; display: flex; align-items: center; width: 100%; padding-block: clamp(2rem, 6vh, 4rem); }
.gw-launch-card {
  max-width: 40rem; padding: clamp(1.6rem, 3.6vw, 3rem);
  background: var(--paper); border-radius: 3px; box-shadow: 0 24px 60px -30px rgba(10, 16, 26, 0.6);
}
.gw-launch-card .eyebrow { margin: 0 0 1rem; }
.gw-launch-title {
  margin: 0 0 1rem; font-family: var(--serif-display); font-weight: 400;
  font-size: clamp(2.1rem, 4.2vw, 3.5rem); line-height: 1.08; color: var(--ink); text-wrap: balance;
}
.gw-launch-title em { font-style: italic; }
.gw-launch-title:focus { outline: none; }
.gw-launch-lead { margin: 0 0 1.6rem; font-size: var(--fs-lead); color: var(--ivory-ink); }
.gw-launch-go { margin: 0 0 1.25rem; }
.gw-launch-go .btn { min-width: 10rem; }
.gw-launch-note { margin: 0; font-size: var(--fs-small); color: var(--muted); }
.gw-launch-note a { color: var(--gold-deep); text-underline-offset: 3px; }
@media (max-width: 760px) {
  .gw-launch-media::after { background: linear-gradient(rgba(10, 16, 26, 0.35), rgba(10, 16, 26, 0.6)); }
  .gw-launch-wrap { align-items: flex-end; }
}

/* The application, as its own screen (26 Oct). The tool steps aside; the
   form is one card on the Finder's ground, under the tool bar, and the page
   scrolls as a page (a scrolling window inside the page cropped it). */
html[data-finder="app"] body[data-page="advisor-group-calculator"] #apply { display: none; }
html[data-finder="app"][data-gw-screen="apply"] .group-wizard { display: none; }
html[data-finder="app"][data-gw-screen="apply"] body[data-page="advisor-group-calculator"] #apply {
  display: block; min-height: calc(100dvh - 3.7rem);
  padding-block: clamp(1.5rem, 4vh, 3rem) clamp(2.5rem, 6vh, 4rem);
  background: color-mix(in srgb, var(--ink) 5%, var(--paper-2));
}
html[data-finder="app"][data-gw-screen="apply"] #apply > .wrap {
  max-width: 52rem; padding: clamp(1.4rem, 3.5vw, 2.75rem);
  background: var(--paper); border: 1px solid var(--hairline-l); border-radius: 3px;
  box-shadow: 0 18px 48px -34px var(--ink);
}
html[data-finder="app"][data-gw-screen="apply"] #apply .apply-grid { display: block; }
html[data-finder="app"][data-gw-screen="apply"] #apply .apply-intro { position: static; margin-bottom: 1.5rem; }
html[data-finder="app"][data-gw-screen="apply"] #apply .apply-intro > p:not(.apply-privacy):not(.eyebrow):not(.gf-back):not(.gf-model-note) { display: none; }
html[data-finder="app"][data-gw-screen="apply"] #apply .apply-card { padding: 0; background: transparent; border: 0; }
html[data-finder="app"][data-gw-screen="apply"] #apply .reveal-item { opacity: 1 !important; transform: none !important; }
/* In the tool, the one-line note replaces the attached-model box. */
html[data-finder="app"] body[data-page="advisor-group-calculator"] .gf-attached { display: none !important; }
.gf-back { margin: 0 0 1.25rem; }
.gf-back [hidden], .gf-model-note[hidden] { display: none; }
.gf-back-btn, .gf-link {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-family: var(--sans); font-size: 0.85rem; font-weight: 600; color: var(--gold-deep);
  text-decoration: underline; text-underline-offset: 3px;
}
.gf-back-btn { text-decoration: none; letter-spacing: 0.04em; }
.gf-back-btn:hover, .gf-link:hover { color: var(--ink); }
.gf-model-note { margin: 0 0 1rem; padding: 0.7rem 1rem; background: #F0F7F6; border-left: 2px solid var(--teal); color: var(--ivory-ink); }
.gf-model-note .gf-link { margin-left: 0.4rem; }

/* The sources, folded, on the launch card. */
.gw-launch-card .gw-sources { margin-top: 1.25rem; padding-top: 0.9rem; border-top: 1px solid var(--hairline-l); font-size: var(--fs-small); }
.gw-launch-card .gw-sources > summary { cursor: pointer; font-family: var(--sans); font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.gw-launch-card .gw-sources ul { max-height: 14rem; overflow-y: auto; padding-left: 1.1rem; }

/* What one traveller leaves you, or what an advisor earns, as the price changes. */
.gw-price .gw-earn { margin: 0.25rem 0 2.25rem; padding: 0.8rem 1rem; background: #F0F7F6; border-left: 2px solid var(--teal); color: var(--ivory-ink); }
.gw-earn:empty { display: none; }
.gw-earn strong { color: var(--ink); font-weight: 600; }
.gw-markup-own { margin-top: 0.6rem; max-width: 12rem; }
.gw-markup-own[hidden] { display: none; }
.gw-markup-own .gw-field { margin-top: 0; }

/* ── The reworked questions ───────────────────────────────────────────── */
.gw-select {
  display: block; width: 100%; max-width: 22rem; min-height: 48px; padding: 0.6rem 2.2rem 0.6rem 0.8rem;
  font: inherit; font-size: 1.05rem; color: var(--ink);
  background: #fff; border: 1px solid #76827F; border-radius: 2px;
}
.gw-select:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.gw-field--count { max-width: 12rem; }
.gw-sub { margin: 1.1rem 0 0.4rem; font-family: var(--sans); font-size: 0.88rem; font-weight: 600; color: var(--ivory-ink); }
.gw-opts--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .gw-opts--pair { grid-template-columns: 1fr; } }
[data-gw-keep][hidden], .gw-comped[hidden] { display: none; }

/* "Your price  OR  estimate it from your cost plus …" */
.gw-price-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1.5rem; margin-bottom: 1rem; }
.gw-price-row .gw-field { flex: 0 1 22rem; margin-top: 0; }
.gw-price-row .gw-field .pf-hint { min-height: 1.4em; }
.gw-or {
  align-self: center; font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--muted);
  padding-bottom: 1.4rem;
}
.gw-markups { padding-bottom: 1.4rem; }
.gw-markups .pf-label { display: block; margin: 0 0 0.4rem; }
.gw-markups .gw-chips--quick { margin-top: 0; }
/* Stacks by the width of the step, not the screen: the summary beside it
   takes a third of a laptop. */
.gw-main { container-type: inline-size; }
@container (max-width: 44rem) {
  .gw-price-row { display: block; }
  .gw-or { display: block; padding: 0.5rem 0 0.3rem; }
  .gw-markups { padding-bottom: 0; }
}

/* Profit per trip leads the summary. */
.gw-rail-figs > .gw-rail-lead { border-top: 0; padding-top: 0; }
.gw-rail-lead dd { font-size: 2rem; color: var(--gold); }
.gw-rail.is-neg .gw-rail-lead dd { color: #F2B8A4; }


/* The thank-you, across the card (26 Oct): the shared 46ch measure set it as
   a narrow column inside the wide application card. */
body[data-page="advisor-group-calculator"] .pf-done p,
body[data-page="advisor-groups"] .pf-done p { max-width: 68ch; }
