  body { background: var(--cream); }
  /* Fluid page width — caps at the design max but never overflows
     the viewport. Replaces the previous hard 1440px width that caused
     horizontal scrolling on anything smaller than a desktop. */
  .page { width: 100%; margin: 0 auto; min-height: 100vh; }

  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 48px; border-bottom: 1px solid var(--rule);
    background: var(--cream); position: sticky; top: 0; z-index: 10;
  }
  .topbar-links { display: flex; gap: 28px; font-size: var(--t-small); color: var(--ink); font-weight: 500; }
  .topbar-search {
    flex: 1; max-width: 420px; margin: 0 40px;
    display: flex; align-items: center;
    background: var(--paper);
    border: 1px solid var(--rule);
    padding: 9px 14px;
    border-radius: var(--r-pill);
    gap: 10px;
    font-size: var(--t-small);
    color: var(--muted);
  }
  .topbar-search input {
    flex: 1; border: 0; background: transparent; outline: none;
    font-family: inherit; font-size: var(--t-small); color: var(--ink);
  }
  .topbar-search .icon {
    width: 14px; height: 14px;
    border: 1.5px solid var(--muted);
    border-radius: 50%;
    position: relative;
  }
  .topbar-search .icon::after {
    content: "";
    position: absolute;
    bottom: -5px; right: -3px;
    width: 6px; height: 1.5px;
    background: var(--muted);
    transform: rotate(45deg);
  }
  .topbar-search kbd {
    border: 1px solid var(--rule); padding: 1px 5px; border-radius: 3px;
    font-family: var(--mono); font-size: 10px; color: var(--muted);
    background: var(--cream);
  }

  /* Page head */
  .dir-head {
    padding: var(--s-7) var(--s-7) var(--s-5);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
  }
  .dir-head h1 {
    font-size: 44px;
    color: var(--ink);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.05;
  }
  .dir-head .sub {
    font-size: 14px;
    color: var(--muted);
    margin-top: 6px;
  }

  /* Match-recall strip — full-width contextual banner shown when the
     visitor came in from quiz-06.html. Sits directly under the global
     header so the path back to their personalized matches is the first
     thing they see. Olive-tint signals "warm guidance" not "warning".

     Hidden by default; the directory init unhides it once it confirms
     the active quiz session actually produced matches.   */
  .match-recall {
    background: var(--grow-tint);
    border-bottom: 1px solid var(--grow);
    color: var(--olive-deep);
    /* Sticks right below the global header (~62px on desktop). */
    position: sticky;
    top: 62px;
    z-index: 9;
  }
  .match-recall[hidden] { display: none; }
  .match-recall-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--s-3) var(--s-7);
    display: flex;
    align-items: center;
    gap: var(--s-4);
  }
  .match-recall-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--olive-deep);
    color: var(--grow-tint);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
  }
  .match-recall-copy {
    flex: 1;
    font-size: var(--t-small);
    line-height: 1.4;
  }
  .match-recall-copy strong {
    color: var(--ink);
    font-weight: 600;
  }
  .match-recall-copy .sub {
    color: var(--olive-deep);
    margin-inline-start: 6px;
  }
  .match-recall-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--r-pill);
    background: var(--forest);
    color: var(--cream) !important;
    border: 1px solid var(--forest);
    font-size: var(--t-small);
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 1px 0 rgba(1,66,73,0.25);
    transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
    white-space: nowrap;
  }
  .match-recall-cta:hover {
    background: var(--forest-deep);
    border-color: var(--forest-deep);
    transform: translateY(-1px);
  }
  .match-recall-cta .arrow {
    display: inline-block;
    transition: transform 160ms ease;
  }
  .match-recall-cta:hover .arrow { transform: translateX(-3px); }
  /* "Adjust criteria" variant (signed-in) leads forward, not back. */
  .match-recall-cta.is-adjust:hover .arrow { transform: translateX(3px); }
  @media (max-width: 720px) {
    .match-recall-inner { padding: 10px 20px; gap: 10px; }
    .match-recall-icon { width: 28px; height: 28px; font-size: 14px; }
    .match-recall-copy .sub { display: none; }
    .match-recall-cta { padding: 7px 12px; font-size: 12px; }
  }
  .dir-head .sort {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: var(--t-small);
    color: var(--ink);
  }
  .sort-pill {
    padding: 7px 14px;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-pill);
    display: flex;
    gap: var(--s-2);
    align-items: center;
    font-family: inherit;
    font-size: var(--t-small);
    color: var(--ink);
    cursor: pointer;
  }

  /* Layout */
  .dir {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--s-6);
    padding: 0 var(--s-7) var(--s-8);
  }

  /* Filter sidebar — compact density: tighter spacing, smaller type,
     so all filters fit in one screen without scrolling on a laptop. */
  aside.filters {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    padding: 16px 18px;
    align-self: start;
    position: sticky;
    top: 80px;
    font-size: var(--t-small);
  }
  .filter-group { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
  .filter-group:last-of-type { margin-bottom: 12px; border-bottom: 0; padding-bottom: 0; }
  .filter-group h5 {
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 500;
  }
  .filter-chips { display: flex; flex-wrap: wrap; gap: 5px; }
  .filter-chip {
    padding: 4px 10px;
    border: 1px solid var(--rule);
    background: var(--cream);
    border-radius: var(--r-pill);
    font-size: var(--t-micro);
    color: var(--ink);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 120ms ease, background 120ms ease;
  }
  .filter-chip:hover { border-color: var(--ink-soft); }
  .filter-chip.active {
    background: var(--ink);
    color: var(--cream);
    border-color: var(--ink);
  }
  .filter-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: var(--s-1);
  }
  .filter-list li {
    display: flex; align-items: center; gap: 9px;
    font-size: var(--t-small); color: var(--ink);
    padding: 2px 0;
    cursor: pointer;
  }
  .checkbox {
    width: 14px; height: 14px;
    border: 1.5px solid var(--rule);
    border-radius: 3px;
    flex-shrink: 0;
    background: var(--cream);
    transition: background 120ms ease, border-color 120ms ease;
  }
  .filter-list li:hover .checkbox { border-color: var(--ink-soft); }
  .filter-list li.checked .checkbox {
    background: var(--forest);
    border-color: var(--forest);
  }
  .filter-list li.checked .checkbox::after {
    content: "";
    display: block;
    width: 7px; height: 3px;
    border-inline-start: 2px solid var(--cream);
    border-bottom: 2px solid var(--cream);
    transform: rotate(-45deg);
    margin: 3px 0 0 2px;
  }
  .filter-list .count { margin-inline-start: auto; font-size: var(--t-micro); color: var(--muted); font-family: var(--mono); }
  .price-slider {
    height: 5px;
    background: var(--rule);
    border-radius: 3px;
    position: relative;
    margin: 14px 7px 4px;
  }
  .price-slider .range {
    position: absolute;
    left: 18%; right: 24%;
    top: 0; bottom: 0;
    background: var(--forest);
    border-radius: 3px;
  }
  .price-slider .knob {
    position: absolute;
    top: 50%;
    width: 13px; height: 13px;
    border-radius: 50%;
    background: var(--cream);
    border: 2px solid var(--forest);
    transform: translate(-50%, -50%);
    cursor: grab;
  }
  .price-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: var(--t-micro); color: var(--muted); padding: 0 7px; }

  /* ===== Responsive breakpoints ==========================================
     Pattern borrowed from the quiz pages: laptop (≤1100px) tightens the
     two-column layout, mobile (≤720px) collapses everything into a single
     scrollable column. */
  @media (max-width: 1100px) {
    .topbar { padding: 14px 24px; }
    .topbar-search { margin: 0 var(--s-4); max-width: 320px; }
    .match-recall-inner { padding: 11px 24px; }
    .dir-head { padding: 36px 24px 20px; }
    .dir-head h1 { font-size: var(--t-h1); }
    .dir { grid-template-columns: 220px 1fr; gap: var(--s-5); padding: 0 var(--s-5) var(--s-7); }
    .grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-4); }
    aside.filters { padding: 14px 14px; }
  }

  @media (max-width: 720px) {
    .topbar { padding: var(--s-3) var(--s-4); gap: 10px; }
    .topbar-search { display: none; }      /* search input drops off mobile to free space; users can use the page filters instead */
    .match-recall { top: 56px; }            /* topbar shorter on mobile, restick to its new height */
    .match-recall-inner { padding: 10px 16px; gap: 10px; }
    .match-recall-icon { width: 28px; height: 28px; font-size: 14px; }
    .match-recall-copy { font-size: var(--t-small); }
    .match-recall-copy .sub { display: none; }
    .match-recall-cta { padding: 7px 12px; font-size: 12px; }
    .dir-head {
      padding: var(--s-5) var(--s-4) var(--s-4);
      flex-direction: column;
      align-items: flex-start;
      gap: 14px;
    }
    .dir-head h1 { font-size: var(--t-h2); }
    .dir-head .sort { width: 100%; justify-content: space-between; }
    .dir {
      grid-template-columns: 1fr;
      gap: var(--s-4);
      padding: 0 16px 40px;
    }
    /* Sidebar drops below the cards-list on mobile and stops being
       sticky — sticky filters would hide the cards beneath them. */
    aside.filters { position: static; top: auto; order: 2; }
    section.grid { order: 1; grid-template-columns: 1fr; gap: var(--s-3); }
  }

  .clear-filters {
    margin-top: 4px;
    background: none;
    border: 0;
    color: var(--forest);
    font-family: var(--mono);
    font-size: var(--t-micro);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0;
  }

  /* Grid of therapists */
  .grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
  .t {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: transform 200ms, box-shadow 200ms;
    cursor: pointer;
  }
  .t:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
  .t .photo {
    height: 220px;
    background: var(--cream-deep);
    position: relative;
    /* center the fallback monogram — without this the 62px initials
       sit at the flow origin and clip on the card's rounded corner */
    display: flex;
    align-items: center;
    justify-content: center;
  }
  /* Match score badge — top-right corner of each card. Stacked label +
     big number reads as a data point (not a button). Terra fill for top
     matches (≥85%) gives an instant visual cue to the patient about
     their strongest fit. */
  .t .match-badge {
    position: absolute; top: 14px; right: 14px;
    min-width: 64px;
    padding: 7px 12px;
    background: rgba(253,252,246,0.96);
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    text-align: center;
    box-shadow: 0 4px 14px rgba(6,38,43,0.10);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .t .match-badge .lbl {
    display: block;
    font-family: var(--mono);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin-bottom: 2px;
    line-height: 1;
  }
  .t .match-badge .pct {
    display: block;
    font-family: var(--display);
    font-weight: 700;
    font-size: 19px;
    color: var(--ink);
    line-height: 1.05;
    letter-spacing: -0.02em;
  }
  .t .match-badge.top {
    background: var(--forest);
    border-color: var(--forest);
    box-shadow: 0 6px 18px rgba(184,93,58,0.32);
  }
  .t .match-badge.top .lbl { color: rgba(247,245,239,0.85); }
  .t .match-badge.top .pct { color: var(--cream); }
  .t .info { padding: 20px; }
  .t h4 {
    font-size: var(--t-lead);
    color: var(--ink);
    margin-bottom: 4px;
    font-weight: 600;
    letter-spacing: -0.01em;
  }
  .t .creds { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
  .t .ch { display: flex; gap: var(--s-1); flex-wrap: wrap; margin-bottom: 14px; }
  .t .ch .chip { font-size: var(--t-micro); padding: 3px 8px; }
  .t .foot {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 12px; border-top: 1px solid var(--rule);
    font-size: var(--t-small); color: var(--muted);
  }
  .t .foot strong { color: var(--ink); font-family: var(--display); font-weight: 600; font-size: var(--t-small); }
  .t .foot .slot { color: var(--olive-deep); font-size: var(--t-micro); font-family: var(--mono); }
