/* ═══════════════════════════════════════════════════════════════════════════════════════
   THE WIZARD, IN THE RECORD SYSTEM'S LANGUAGE
   Loaded LAST. Restyles the app's existing classes rather than replacing their markup,
   because the hero and share strip carry wired-up ids and behaviour that must not move.

   Reads tokens only. No hex except white on the navy banner, which the brief specifies.
   ═══════════════════════════════════════════════════════════════════════════════════════ */

body {
  background: var(--canvas);
  color: var(--ink);
  font: 400 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* An author `display` beats the `hidden` attribute's UA rule, so any class here that sets
   display would keep painting an element the JS had hidden. That is exactly what left an
   empty amber notice bar on screen once the advisor profile loaded. Restore the contract. */
[hidden] { display: none !important; }

/* ─── structural idea 2: two columns, the right one never scrolls away ───────────────── */

.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px 64px;
  display: block;
  gap: 0;
}

.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gutter);
  align-items: start;
  margin-top: 32px;
}

@media (min-width: 1200px) {
  .cols { grid-template-columns: minmax(0, 1fr) var(--panel-w); }
}

/* Pages that have no rail, or whose rail has nothing honest to say yet, collapse to one
   column instead of reserving an empty 440px. */
@media (min-width: 1200px) {
  .cols--single,
  .cols--norail { grid-template-columns: minmax(0, 1fr); }
}
.cols--norail .rail { display: none; }
.rail:empty { display: none; }

.col-main { min-width: 0; }

.rail { min-width: 0; display: grid; gap: 20px; align-content: start; }

@media (min-width: 1200px) {
  .rail {
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
    max-height: calc(100vh - var(--topbar-h) - 32px);
    overflow-y: auto;
  }
}

/* ─── the banner: navy, 56px, sticky, 2px gradient rule ─────────────────────────────── */

.hero {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  background: var(--banner);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 32px;
  margin: 0 calc(-50vw + 50%);
  padding-left: calc(50vw - 50% + 32px);
  padding-right: calc(50vw - 50% + 32px);
  overflow: visible;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--azure), var(--sky));
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.hero-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; }
.hero-brand { min-width: 0; }

.hero-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: #fff;
  white-space: nowrap;
}

.logo { width: 22px; height: 22px; flex: none; }
.logo img { width: 100%; height: 100%; object-fit: contain; }

/* .hero-right on the advisor form; .hero-actions on the mirror. Same job. */
.hero-right,
.hero-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* The mirror and secure-link pages put .hero-left directly in .hero, with no .hero-inner. */
.hero > .hero-left { flex: none; }
.hero > .hero-actions { margin-left: auto; }

/* Controls on navy: faint white fills, blue-300 labels, sky focus ring. */
.hero .select,
.hero-form-select {
  height: 34px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgb(255 255 255 / .08);
  color: #fff;
  font: 500 13px/1 Inter, system-ui, sans-serif;
  padding: 0 30px 0 12px;
  max-width: 230px;
}
.hero .select option { color: var(--ink); background: var(--card); }

.hero .btn-icon,
.hero .changelog-nav-btn {
  /* styles.css:467 also targets `.hero .btn-icon` at this specificity with
     `padding: 6px 10px; min-height: 32px`. Anything not declared here loses to it, and
     10px of side padding on a 30px box pushed the 16px icon 4px off centre. Declare the
     whole box, and centre on both axes rather than only vertically. */
  display: grid;
  place-items: center;
  place-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgb(255 255 255 / .08);
  color: var(--blue-300);
  box-shadow: none;
  line-height: 0;
}
/* Specificity has to clear `.btn:hover:not(:disabled)` further down this file, which is
   also (0,3,0) but declared later — it was winning and painting an opaque --sunken square
   on the navy bar, which in light mode reads as a bright white block on hover. */
.hero .btn.btn-icon:hover:not(:disabled),
.hero .btn.changelog-nav-btn:hover:not(:disabled),
.hero .btn-icon:hover:not(:disabled),
.hero .changelog-nav-btn:hover:not(:disabled) {
  background: rgb(255 255 255 / .18);
  border-color: transparent;
  color: #fff;
}
.hero .btn-icon svg { width: 16px; height: 16px; stroke-width: 1.6; }

/* The group is a tray on white elsewhere; on the navy banner it must recede. */
.hero .status-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgb(255 255 255 / .06);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 3px;
}

.hero .status-badge {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgb(255 255 255 / .08);
  color: var(--blue-300);
  gap: 5px;
}
.hero .status-badge--active { background: rgb(255 255 255 / .08); color: var(--blue-300); }
.hero .status-badge__indicator { width: 5px; height: 5px; box-shadow: none; animation: none; }
.hero .status-badge--active .status-badge__indicator { background: var(--sky); }

/* Text buttons that live IN the banner are banner controls, not page controls.
   `.btn-secondary` paints `var(--card)` — #ffffff in light — so "Back to form" rendered as
   a glaring white pill on the navy bar. In dark, --card is dark and it blended in, which is
   why the problem only showed after toggling back to light.

   Scoped to the banner's own rows on purpose: the share modal is a SIBLING of .hero-inner,
   not a descendant, so its buttons keep normal page styling on their white dialog.
   .btn-icon is excluded so the icon buttons keep their --blue-300 labels. */
.hero-inner > .hero-right .btn:not(.btn-icon),
.hero-inner > .hero-left .btn:not(.btn-icon),
.hero > .hero-actions .btn:not(.btn-icon),
.hero-inner .btn-secondary:not(.btn-icon) {
  background: rgb(255 255 255 / .08);
  border-color: transparent;
  color: #fff;
}

.hero-inner > .hero-right .btn:not(.btn-icon):hover:not(:disabled),
.hero-inner > .hero-left .btn:not(.btn-icon):hover:not(:disabled),
.hero > .hero-actions .btn:not(.btn-icon):hover:not(:disabled),
.hero-inner .btn-secondary:not(.btn-icon):hover:not(:disabled) {
  background: rgb(255 255 255 / .18);
  border-color: transparent;
  color: #fff;
}

/* The lift on hover is fine on a card; on a 56px bar it makes controls jitter. */
.hero .btn:hover { transform: none; }

.hero :focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

/* ─── cards: white on warm paper, hairline border, elevation almost invisible ────────── */

.panel,
.panel-compact {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-xs);
  padding: 24px;
}

.step-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
  font-family: inherit;
}

.hero-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 62ch;
}

/* The "Submitting…" / result panels centre their text inline. A 62ch-capped paragraph with
   margin:0 sits flush left inside a centred panel, so the heading centred and the sentence
   did not. Centre the block too. */
.panel[style*="text-align:center"] .hero-subtitle,
.panel[style*="text-align: center"] .hero-subtitle {
  margin-left: auto;
  margin-right: auto;
}

/* ─── progress: a hairline track, tabular figures, no decorative journey ────────────── */

.progress { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }

.progress .chip,
.progress > .chip {
  /* inline-flex + center, or a fixed height leaves the label sitting at the top of the pill */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--sunken);
  color: var(--muted);
  font: 500 12px/1 Inter, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: none;
}

.progress-bar { flex: 1 1 auto; position: relative; }

.progress-bar__track {
  height: 4px;
  border-radius: 999px;
  background: var(--pressed);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  background: var(--azure);
  border-radius: 999px;
  transition: width var(--base);
}

/* Decorative emoji marker: the brief allows one icon family, stroked, and no ornament. */
.progress-journey { display: none; }

/* ─── fields ─────────────────────────────────────────────────────────────────────────── */

.question-grid { display: grid; gap: 20px; }
.question-group { display: grid; gap: 20px; }

.field { display: grid; gap: 6px; }

.label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0;
  text-transform: none;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--ink);
  font: 400 14px/1.5 Inter, system-ui, sans-serif;
  box-shadow: none;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }

/* Focus is a 3px accent wash ring, not a browser outline. This is a keyboard-driven form. */
.input:focus,
.select:focus,
.textarea:focus,
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: none;
  border-color: var(--azure);
  box-shadow: 0 0 0 3px var(--sel-bg);
}

.error { font-size: 13px; color: var(--att-text); }
.field--invalid .input,
.field--invalid .textarea { border-color: var(--att-strong); }

/* Required marker on a question label, explained once per step by .req-legend. */
.req { margin-left: 3px; color: var(--att-text); font-weight: 600; }
.req-legend { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.req-legend .req { margin: 0 2px 0 0; }

/* ─── yes/no and option pills ────────────────────────────────────────────────────────── */

.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }

.pill,
.pill-small {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--secondary);
  font: 500 12px/1 Inter, system-ui, sans-serif;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  transition: background var(--fast), border-color var(--fast), color var(--fast);
}
.pill:hover, .pill-small:hover { background: var(--sunken); border-color: var(--border-strong); }

/* The field components mark selection with `.active` (see fields/singleSelect.js,
   multiSelect.js, booleanToggle.js). aria-pressed is kept for anything that grows one. */
.pill.active,
.pill-small.active,
.pill[aria-pressed="true"],
.pill-small[aria-pressed="true"] {
  background: var(--sel-bg);
  border-color: var(--azure);
  color: var(--azure-deep);
  font-weight: 500;
}
.pill.active:hover,
.pill-small.active:hover {
  background: var(--sel-bg-2);
  border-color: var(--azure);
}

/* ─── buttons: sentence case, 36px, 8px radius ───────────────────────────────────────── */

.btn {
  /* A <button> centres its own label; an <a class="btn"> does not, and stays display:inline
     so the height is ignored entirely. That is why "Back to form" sat off-centre while
     every real button looked fine. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--ink);
  font: 500 13px/1 Inter, system-ui, sans-serif;
  text-transform: none;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
  transition: background var(--fast), border-color var(--fast), color var(--fast);
}
.btn:hover:not(:disabled) { background: var(--sunken); border-color: var(--border-strong); }
.btn:disabled { opacity: .45; }

.btn-primary {
  background: var(--azure);
  border-color: var(--azure);
  /* Dark lightens the accent, so the ink flips. Handled once, in tokens.css. */
  color: var(--on-azure);
}
.btn-primary:hover:not(:disabled) { background: var(--azure-hover); border-color: var(--azure-hover); }

.btn-secondary { background: var(--card); border-color: var(--border-strong); color: var(--ink); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; }

.btn-icon {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}
.nav-row .btn-primary { margin-left: auto; }

/* Continue reads as unavailable until nothing on the step blocks. It stays clickable
   (aria-disabled, not disabled) so a click can show what is missing. */
.btn-primary.is-blocked,
.btn-primary.is-blocked:hover { background: var(--azure); border-color: var(--azure); opacity: .45; cursor: not-allowed; }
.nav-hint { flex: 1 1 auto; margin: 0; font-size: 13px; color: var(--muted); text-align: right; }

/* ─── structural idea 3: limits are structural, not footnotes ───────────────────────── */

.advisor-profile-guard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--att-bg);
  border: 1px solid var(--att-border);
  color: var(--att-text);
  font-size: 13px;
  font-weight: 400;
  text-align: left;
}

/* the rail's own cards */
.rail-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow-xs);
}

.rail-card__h {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.rail-summary {
  margin: -6px 0 12px;
  font-size: 13px;
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

.rail-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rail-steps li { margin: 0; }

.rail-step {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--secondary);
  font: 400 13px/1.3 Inter, system-ui, sans-serif;
  cursor: pointer;
}
.rail-step:hover { background: var(--sunken); }

.rail-step--now {
  background: var(--sel-bg);
  color: var(--azure-deep);
  font-weight: 500;
}

.rail-step__n {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--att-text);
  text-align: right;
  min-width: 12px;
  display: grid;
  place-items: center end;
}
.rail-step__n svg { width: 13px; height: 13px; color: var(--ok-text); }

/* A step you cannot jump to yet, because an earlier one still blocks. */
.rail-step--locked { cursor: default; opacity: .55; }
.rail-step--locked:hover { background: none; }
.rail-step--now .rail-step__n { color: var(--azure-deep); }

.rail-step__mark { display: grid; place-items: center; }
.rail-step__mark svg { width: 14px; height: 14px; }
.rail-step--done .rail-step__mark { color: var(--ok-text); }
.rail-step--todo .rail-step__mark { color: var(--border-strong); }



.rail-end {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
}
.rail-end svg { width: 16px; height: 16px; margin-top: 1px; }
.rail-end strong { display: block; font-size: 13px; font-weight: 600; }
.rail-end span { display: block; margin-top: 2px; }
.rail-end--last { background: var(--ok-bg); border: 1px solid var(--ok-border); color: var(--ok-text); }
.rail-end--more { background: var(--att-bg); border: 1px solid var(--att-border); color: var(--att-text); }

/* ─── misc existing components brought into line ─────────────────────────────────────── */

.total-indicator {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--sunken);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.total-indicator.invalid { background: var(--att-bg); border-color: var(--att-border); color: var(--att-text); }

.tag {
  border-radius: 999px;
  border: 1px solid var(--info-border);
  background: var(--info-bg);
  color: var(--info-text);
  font-size: 12px;
  padding: 3px 9px;
}

.mirror-card,
.session-box,
.trust-panel,
.changelog-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-xs);
}

.share-modal__dialog {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.share-modal { background: var(--scrim); }

/* .address-suggestions is ALWAYS in the DOM under the Risk Address input, empty until the
   user types. Giving it a border painted a stray 1px line under the field. Only the list —
   which exists only when there are suggestions — gets a box. */
.address-suggestions { border: 0; background: none; box-shadow: none; }
.suggestion-list { display: grid; gap: 6px; margin-top: 8px; }
.suggestion-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  font: 400 14px/1.4 Inter, system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition: background var(--fast), border-color var(--fast);
}
.suggestion-item:hover { background: var(--sunken); border-color: var(--border-strong); box-shadow: none; transform: none; }

/* Global focus: visible everywhere, accent wash, never a bare browser outline. */
:focus-visible { outline: 2px solid var(--azure); outline-offset: 2px; }

@media (max-width: 720px) {
  .app-shell { padding: 0 16px 48px; }
  .hero { padding-left: calc(50vw - 50% + 16px); padding-right: calc(50vw - 50% + 16px); }
  .panel, .panel-compact { padding: 18px; }

  /* A step can run past 1500px on a phone — the materials step is six questions and
     thirty-eight options — and Continue used to sit at the very bottom of all of it.
     Pinning it means the way forward is always on screen, and a client who scrolls back up
     to change an answer does not have to scroll all the way down again to carry on. */
  .wizard-body .nav-row {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 28px -18px 0;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--card);
    border-top: 1px solid var(--hairline);
  }
  /* Back keeps its natural width; the primary action takes the rest of the bar. */
  .wizard-body .nav-row .btn-primary { flex: 1 1 auto; }
  /* What is still needed sits on its own line above the buttons, inside the pinned bar. */
  .wizard-body .nav-row { flex-wrap: wrap; }
  .wizard-body .nav-hint { flex-basis: 100%; order: -1; text-align: left; }

  /* The question is what the screen is for. 17px reads as a caption next to a 44px control. */
  .step-title { font-size: 19px; }

  /* The advisor banner's control cluster is 577px wide, and neither side of .hero-inner was
     allowed to shrink — so the whole PAGE scrolled sideways at every width below 720px
     (417px of it at 320px). Let the bar become two rows instead. Wrapping hides nothing and
     clips nothing; an overflow container would have cut off the share dropdown, which is a
     sibling of .hero-inner only by luck. */
  .hero {
    height: auto;
    min-height: var(--topbar-h);
    padding-block: 8px;
    /* Wrapped, the advisor's banner is 172px tall. Pinning that to the top of an 844px phone
       would spend a fifth of the screen on chrome for the whole form. The banner is branding
       and occasional controls, not navigation, so on a phone it scrolls away with the page —
       and the sticky Continue bar below is what stays in reach instead. */
    position: static;
  }
  .hero-inner { flex-wrap: wrap; row-gap: 8px; }
  .hero-left { flex: 1 1 auto; min-width: 0; }
  .hero-right,
  .hero-actions {
    margin-left: 0;
    flex: 1 1 100%;
    flex-wrap: wrap;
  }
  .hero-form-select { flex: 1 1 160px; min-width: 0; }
}

/* The rail is a one-column grid, but it never said so: an implicit `auto` track can never be
   narrower than its widest child's min-content, and the mirror prints the advisor's raw email
   address in there. That pushed the mirror 11px wider than a 320px screen. */
.rail { grid-template-columns: minmax(0, 1fr); }
.trust-detail,
.rail-summary { overflow-wrap: anywhere; }

/* ─── touch input ────────────────────────────────────────────────────────────────────
   Scoped to coarse pointers and narrow screens, so the advisor's desktop view keeps its
   tighter density — someone doing twenty of these a day does not want phone-sized controls. */

@media (pointer: coarse), (max-width: 720px) {
  /* iOS Safari zooms the entire page whenever a focused control computes under 16px. The
     `font` shorthand above hard-set 14px, so every one of ~44 questions cost the client a
     zoom in and a pinch back out. This is the single worst thing that can happen to a form
     on a phone. */
  .input,
  .select,
  .textarea {
    font-size: 16px;
    min-height: 44px;
  }

  /* 44px is the floor for a thumb to hit reliably. The answer pills were 32px tall with
     12px labels, eight of them to a screen on the materials step. */
  .pill,
  .pill-small {
    height: auto;
    min-height: 44px;
    padding: 0 16px;
    font-size: 15px;
  }
  .pill-group { gap: 10px; }

  .btn {
    height: auto;
    min-height: 44px;
    font-size: 15px;
  }

  /* Touch has no hover, so a tap that is not acknowledged gets tapped again. */
  .pill:active,
  .pill-small:active { background: var(--sunken); }
  .btn:active:not(:disabled) { transform: translateY(1px); }
}

/* ─── changelog ──────────────────────────────────────────────────────────────────────── */

/* White on the accent fails in dark, where the accent lightens (2.64:1). Same fix as the
   buttons: --on-azure flips to navy ink. One token, no per-theme override. */
.changelog-card__badge {
  background: var(--azure);
  color: var(--on-azure);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 9px;
}

/* The brief has no uppercase-tracked eyebrow. Labels are 12px, sentence case. */
.changelog-card__category {
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.changelog-card__date,
.changelog-card__meta { font-size: 13px; color: var(--muted); }
.changelog-card__title { font-size: 17px; font-weight: 600; color: var(--ink); }
.changelog-intro__text { color: var(--secondary); }
.changelog-badge { background: var(--azure); color: var(--on-azure); }

/* ─── client-friendly question presentation ──────────────────────────────────────────── */

/* Progress names the part you are in rather than counting down screens. */
.progress--sections { display: block; margin-bottom: 22px; }
.progress--sections .progress-meta {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 7px;
}
.progress-section { font-size: 13px; font-weight: 600; color: var(--ink); }
.progress-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* styles.css:607 makes the track `position:absolute; inset:0`, which was right when it lived
   inside `.progress-bar` (position:relative). The section progress puts the track straight
   into `.progress--sections`, which is not positioned — so it escaped all the way to <body>
   and painted its azure fill at document (0,0), underneath the sticky banner. The bar has
   been invisible on every screen since. */
.progress--sections .progress-bar__track {
  position: relative;
  inset: auto;
  height: 4px;
}

.step-intro { margin: 0 0 20px; }
.step-intro .hero-subtitle { margin-top: 6px; }

/* Helper text under a question, and the policy term it replaced. */
.q__hint {
  display: block; margin: 2px 0 8px;
  font-size: 13px; color: var(--muted); max-width: 58ch;
}
.q__term { margin-top: 7px; font-size: 12px; color: var(--muted); }

/* "Why we ask" — collapsed by default so it never adds noise. */
.why { margin-top: 10px; }
.why summary {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--azure); cursor: pointer; list-style: none;
}
.why summary::-webkit-details-marker { display: none; }
.why summary::before {
  content: "?"; display: grid; place-items: center;
  width: 16px; height: 16px; border-radius: 999px;
  border: 1px solid currentColor; font-size: 10px; font-weight: 600;
}
.why__body {
  margin-top: 8px; padding: 12px 14px; border-radius: 9px;
  background: var(--info-bg); border: 1px solid var(--info-border); color: var(--info-text);
  font-size: 13px; line-height: 1.5; max-width: 60ch;
}

/* "I'm not sure" is a real answer, not an escape hatch — same size as the options it sits
   beside, dashed until chosen so it reads as distinct without reading as lesser. */
.pill--unsure { border-style: dashed; color: var(--secondary); }
.pill--unsure.on,
.pill--unsure[aria-pressed="true"] {
  background: var(--info-bg); border-color: var(--info-border);
  border-style: solid; color: var(--info-text); font-weight: 500;
}
.unsure-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* When "not sure" is chosen, the control itself steps back. */
.field--unsure .input,
.field--unsure .select,
.field--unsure .textarea { opacity: .5; }

/* Explanation block, used by the credit-consent screen. */
.explain {
  display: grid; gap: 6px; margin: 0 0 22px; padding: 14px 16px;
  border-radius: 9px; background: var(--info-bg);
  border: 1px solid var(--info-border); color: var(--info-text);
  font-size: 13px; line-height: 1.55;
}
.explain strong { font-size: 13px; font-weight: 600; }

/* Reassurance note on the screens that need one. */
.notice {
  display: block; margin: 0 0 20px; padding: 13px 15px;
  border-radius: 9px; font-size: 13px; line-height: 1.5;
  border: 1px solid var(--info-border); background: var(--info-bg); color: var(--info-text);
}
.notice--ok { border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok-text); }

/* A pair of half-width questions (first/last name, city/province). The divider belongs to
   the pair, not to each cell, or a stray line appears mid-row. */
/* align-items: start — when only one field of a pair shows a message, its partner must not
   stretch to match and push its input down out of line. */
.q-pair { display: grid; gap: 20px 16px; align-items: start; }
@media (min-width: 620px) { .q-pair { grid-template-columns: 1fr 1fr; } }

/* The conditional "anyone else on this policy?" block. */
.reveal-prompt { margin-top: 4px; }
.reveal {
  margin-top: 16px; padding: 18px;
  border-radius: 10px; background: var(--sunken); border: 1px solid var(--border);
}
.reveal__h { margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--ink); }

/* ─── client welcome (client wizards only; advisors skip straight to the questions) ───── */

.welcome__h { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.welcome__lead { margin: 10px 0 0; font-size: 15px; color: var(--secondary); max-width: 54ch; }

.welcome__advisor {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 0; padding: 14px;
  background: var(--sunken); border: 1px solid var(--border); border-radius: 10px;
}
.welcome__avatar {
  width: 42px; height: 42px; border-radius: 999px; flex: none;
  background: var(--mist); color: var(--ink);
  display: grid; place-items: center; font-size: 14px; font-weight: 600;
}
.welcome__who { display: grid; min-width: 0; }
.welcome__who strong { font-size: 15px; font-weight: 600; color: var(--ink); }
.welcome__who span { font-size: 13px; color: var(--muted); }
.welcome__who .tag { display: inline-flex; align-items: center; gap: 4px; }
.welcome__who .tag svg { width: 11px; height: 11px; }

.welcome__points { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 13px; }
.welcome__points li {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px;
  align-items: start; font-size: 14px; color: var(--secondary);
}
.welcome__points svg { width: 18px; height: 18px; color: var(--azure); margin-top: 1px; flex: none; }
.welcome__points strong { color: var(--ink); font-weight: 500; }

/* ─── share with client: one obvious job, everything else folded away ────────────────
   The window used to open on four rows of screen-mirroring controls with the secure link
   last, below the fold. Sending a secure link is the common task by a wide margin, so it
   now leads and the mirroring controls sit behind a collapsed Advanced section.

   Note on type: the house design system calls for slab uppercase eyebrows, but this app
   deliberately shipped sentence-case 12px labels (see the note at .progress-section).
   Matching the app the advisor is actually looking at beats matching the reference. */



/* ── the Advanced disclosure ── */

.share-advanced {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}

.share-advanced__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  /* Kill the native disclosure triangle in both engines; we draw our own chevron. */
  list-style: none;
}
.share-advanced__summary::-webkit-details-marker { display: none; }
.share-advanced__summary::marker { content: ""; }
.share-advanced__summary:hover { background: var(--sunken); }

.share-advanced__chevron {
  flex: none;
  color: var(--muted);
  transition: transform var(--fast);
}
.share-advanced[open] .share-advanced__chevron { transform: rotate(90deg); }

.share-advanced__label { flex: none; }

/* Says what is behind the fold, so nobody has to open it to find out. */
.share-advanced__hint {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

/* Collapse it ourselves rather than trusting the user agent. Two reasons: a bare
   `display: grid` below would override the UA's own hiding and leave the section on screen
   while claiming to be collapsed, and the UA rule is not something to depend on anyway —
   headless Chromium does not apply it at all. Saying it explicitly makes the state the same
   everywhere, which for a privacy-adjacent panel is worth the one extra line. */
.share-advanced:not([open]) .share-advanced__body { display: none; }

.share-advanced[open] .share-advanced__body {
  display: grid;
  gap: 10px;
  padding: 4px 12px 12px;
  border-top: 1px solid var(--hairline);
  margin-top: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .share-advanced__chevron { transition: none; }
}

/* On a narrow window the rows stack, and the hint would push the label off — drop it. */
@media (max-width: 560px) {
  .share-modal__secure-link--primary { padding: 12px; }
  .share-advanced__hint { display: none; }
  .share-advanced__body .share-modal__row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

/* ─── share with client: type an address, press send ─────────────────────────────────
   The link is already made by the time this is on screen (see ensureClientLink), so the
   window is two fields and two buttons. Mirroring is still here, one line down at the
   bottom, because it is a working feature some advisors use on calls. */

.share2 { display: grid; gap: 14px; }

.share2__lede {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--secondary);
}

.share2__field { display: grid; }

.share2__label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.share2__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

/* "or" between the two routes, so it reads as a choice rather than two things to fill in. */
.share2__or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}
.share2__or::before,
.share2__or::after { content: ""; height: 1px; background: var(--hairline); }

.share2__link {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--sunken);
  border: 1px solid var(--hairline);
}

.share2__link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.share2__status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.share2__status--ready { color: var(--ok-text); }
.share2__status--error { color: var(--danger); }
.share2__dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: none; }

.share2 .input { width: 100%; }

/* The mirroring disclosure, reduced to one quiet sentence. */
.share-advanced { border: 0; background: none; }
.share-advanced__summary {
  justify-content: center;
  gap: 5px;
  padding: 10px 0 0;
  border-top: 1px solid var(--hairline);
  border-radius: 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.share-advanced__summary:hover { background: none; }
.share-advanced__summary:hover .share-advanced__link { color: var(--azure-deep); }
.share-advanced__link { color: var(--azure); text-decoration: underline; }
.share-advanced[open] .share-advanced__body { padding-top: 12px; border-top: 0; }

@media (max-width: 520px) {
  .share2__row { grid-template-columns: minmax(0, 1fr); }
  .share2__row .btn { width: 100%; }
  .share2__link-row { grid-template-columns: minmax(0, 1fr); }
  .share2__link-row .btn { width: 100%; }
}

/* ─── end-of-road screens: who has this, and how to reach them ───────────────────────
   Shown once the form is out of the client's hands — submitted, expired, closed, or
   failed. The old versions centred hardcoded hex text (#c62828, #2e7d32, #999) which
   went unreadable in dark mode and said "contact your advisor" without naming one. */

.end-panel {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 28px;
  display: grid;
  gap: 10px;
  justify-items: start;
}

.end-panel__title { margin: 0; font-size: 21px; font-weight: 600; color: var(--ink); }
.end-panel__lede  { margin: 0; font-size: 15px; line-height: 1.55; color: var(--secondary); }
.end-panel__next  { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.end-panel__ref {
  margin: 0; font-size: 12px; color: var(--muted);
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.end-panel__retry { margin: 4px 0 2px; }

/* The tick is the only ornament, and it carries the good news. */
.end-panel__tick {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  color: var(--ok-text);
  margin-bottom: 2px;
}

/* ── the advisor contact card ──
   Same vocabulary as .welcome__advisor: sunken tray, hairline, 10px radius, initials. */

.advisor-card {
  width: 100%;
  margin-top: 14px;
  padding: 16px;
  display: grid;
  gap: 12px;
  border-radius: 10px;
  background: var(--sunken);
  border: 1px solid var(--border);
}

.advisor-card__who { display: flex; align-items: center; gap: 10px; }

.advisor-card__avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 999px;
  background: var(--azure);
  color: var(--on-azure);
  font-size: 14px;
  font-weight: 600;
}

.advisor-card__id { min-width: 0; }
.advisor-card__name { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.advisor-card__role { margin: 1px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.advisor-card__intro { margin: 0; font-size: 13px; line-height: 1.5; color: var(--secondary); }

.advisor-card__lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.advisor-card__line {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
}
.advisor-card__k { color: var(--muted); font-size: 12px; }

/* styles.css:52 resets every anchor to inherit colour with no underline, so a bare tel: or
   mailto: link reads as plain text. Inside this card they must look like links. */
.advisor-card__line a {
  color: var(--azure);
  text-decoration: underline;
  overflow-wrap: anywhere;
}
.advisor-card__line a:hover { color: var(--azure-deep); }

.advisor-card__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* .btn sets white-space: nowrap, which would push a long name off a narrow screen. The label
   is a verb plus a first name, so it stays short — but let it wrap rather than overflow. */
.advisor-card__action { white-space: normal; }

@media (max-width: 520px) {
  .end-panel { padding: 24px 18px; }
  /* One thumb, one column: each contact action gets the full width. */
  .advisor-card__actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .advisor-card__action { width: 100%; }
  .advisor-card__line { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
