@layer pages {
  /* ── Funnel pages (landing / demographics / login) ──────────────────────
     These reuse home-wrap / home-card / home-email-input / home-submit. The
     classes below are the freemium-specific additions. */

  .lm-card-title {
    text-align: center;
  }

  .lm-card-note {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--color-text-light);
    margin: 0 0 1rem;
    text-align: center;
  }

  .lm-alt-action {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-light);
    text-align: center;
  }

  .lm-alt-action a {
    color: var(--color-accent-dark);
    font-weight: 600;
  }

  .lm-link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--color-accent-dark);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
  }

  .lm-link-btn--submit {
    -webkit-appearance: none;
    appearance: none;
  }

  .lm-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--color-accent-dark);
    text-align: center;
  }

  .lm-form-error {
    margin: 0 0 1.25rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    color: var(--color-danger);
    background: var(--color-danger-bg);
    border: 1px solid var(--color-danger-border);
    border-radius: var(--radius-sm);
    text-align: left;
  }

  /* ── Starting-point satisfaction question (demographics) ─────────────── */

  .lm-divider {
    height: 0;
    margin: 1.35rem 0;
    border: 0;
    border-top: 1px solid var(--color-border-light);
  }

  .lm-scale-field {
    margin: 0 0 1.25rem;
    padding: 0;
    border: 0;
    text-align: left;
  }

  /* A <legend> would break the card's flow width, so it is reset to a block. */
  .lm-question {
    display: block;
    width: 100%;
    padding: 0;
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--color-heading);
  }

  .lm-required {
    color: var(--color-danger);
  }

  .lm-question-sub {
    margin: 0.3rem 0 0.9rem;
    font-size: 0.85rem;
    color: var(--color-text-light);
  }

  /* 11 equal boxes; wraps to two rows on narrow screens. */
  .lm-scale {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 0.35rem;
  }

  .lm-scale-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.6rem;
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }

  .lm-scale-box:hover {
    border-color: var(--color-accent);
  }

  /* The radio stays in the accessibility tree — only visually hidden. */
  .lm-scale-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .lm-scale-box:has(.lm-scale-input:checked) {
    color: var(--color-white);
    background: var(--color-primary);
    border-color: var(--color-primary);
    font-weight: 600;
  }

  .lm-scale-box:has(.lm-scale-input:focus-visible) {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
  }

  .lm-scale-anchors {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
  }

  @media (max-width: 520px) {
    .lm-scale {
      grid-template-columns: repeat(6, 1fr);
    }
  }

  /* Notes/privacy consent block, shared with the intake modal's htr- styles. */
  .lm-privacy {
    margin: 0 0 1.25rem;
    padding: 0.9rem 1rem;
    background: var(--color-bg-warm);
    border: 1px solid var(--color-border-light);
    border-top: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    text-align: left;
  }

  /* Age-confirmation and consent checkboxes (demographics) */
  .lm-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0 0 0.7rem;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--color-text);
    text-align: left;
    cursor: pointer;
  }

  .lm-checkbox:last-of-type {
    margin-bottom: 1.35rem;
  }

  .lm-checkbox input {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
    accent-color: var(--color-accent-dark);
    cursor: pointer;
  }

  .lm-field {
    margin-bottom: 1.25rem;
    text-align: left;
  }

  .lm-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.4rem;
  }

  .lm-label-optional {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--color-text-muted);
  }

  .lm-select {
    width: 100%;
    padding: 0.85rem 1rem;
    font: inherit;
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
  }

  /* ── Report page ────────────────────────────────────────────────────── */

  .lm-report {
    min-height: 100vh;
    background: var(--color-bg-warm);
  }

  .lm-report-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.35rem 1.75rem;
    background: var(--color-primary);
    color: var(--color-white);
  }

  /* White wordmark on the left of the dark bar */
  .lm-report-bar-logo {
    display: block;
    height: 40px;
    width: auto;
  }

  /* Email + log-out grouped on the right of the dark bar */
  .lm-report-bar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
  }

  .lm-report-bar-email {
    font-size: 0.9rem;
    color: var(--color-bg-warm);
    opacity: 0.85;
    overflow-wrap: anywhere;
  }

  /* Logo below the dark bar, above the report content */
  .lm-report-logo {
    display: block;
    height: 60px;
    width: auto;
    margin: 0 auto 1.75rem;
  }

  .lm-link-btn--bar {
    color: var(--color-bg-warm);
    text-decoration: none;
    opacity: 0.85;
  }

  .lm-report-main {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
  }

  /* Feedback and the dashboard explainer, stacked top-right above the report
     head. The column is what's pinned, so the two stay together. */
  .lm-report-links {
    position: absolute;
    top: 2.5rem;
    right: 1.5rem;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
  }

  /* The two external links sit side by side; the explainer stays below them. */
  .lm-report-links-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem 1rem;
  }

  .lm-feedback-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-accent-dark);
    text-decoration: underline;
  }

  .lm-how-to-read-link--corner {
    margin: 0;
    text-align: right;
  }

  /* Section explainer ⓘ. Sits on the title's baseline and keeps a touch-sized
     hit area without pushing the heading around. */
  .lm-quad-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: -6px 0 -6px 0.15rem;
    padding: 0;
    vertical-align: middle;
    color: var(--color-text-muted);
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
  }

  .lm-quad-info:hover,
  .lm-quad-info:focus-visible {
    color: var(--color-accent-dark);
    background: var(--color-bg-warm);
  }

  /* ── Self-serve intake header (mirrors the report header) ─────────────── */
  .lm-intake-head {
    text-align: center;
    padding: 2.5rem 1.5rem 0;
  }

  .lm-intake-head .lm-report-logo {
    margin-bottom: 1rem;
  }

  /* Mirrors the root page's .home-brand wordmark. Duplicated rather than shared
     so a tweak here can't move the home page. */
  .lm-intake-eyebrow {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--color-accent);
    margin: 0 0 0.75rem;
  }

  .lm-intake-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    color: var(--color-heading);
    margin: 0 0 0.4rem;
  }

  /* Framing copy under the title: a centered column, but left-aligned prose. */
  .lm-intake-intro {
    max-width: 640px;
    margin: 1.25rem auto 0;
    text-align: left;
  }

  @media (max-width: 520px) {
    .lm-intake-title {
      font-size: 1.75rem;
    }
  }

  .lm-report-head {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 2rem;
  }

  /* Below the "how to read" link: the date navigator with the retake control
     sitting directly beside it. */
  .lm-report-head-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .lm-report-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    color: var(--color-heading);
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .lm-how-to-read-link--head {
    margin: 0;
    align-self: flex-start;
    text-align: left;
  }

  /* Date navigator (top-right): jump between report periods */
  .lm-date-select {
    padding: 0.55rem 2.2rem 0.55rem 1rem;
    font: inherit;
    font-size: 0.95rem;
    color: var(--color-text);
    background-color: var(--color-white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235c4f3a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
  }

  .lm-date-select:focus {
    outline: none;
    border-color: var(--color-accent);
  }

  /* Static date shown when there's only one report to view */
  .lm-viewing {
    display: inline-block;
    padding: 0.45rem 1rem;
    font-size: 0.95rem;
    color: var(--color-text-light);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
  }

  .lm-viewing strong {
    color: var(--color-text);
  }

  /* ── Alignment bands (number / badge / bar colors) ───────────────────── */
  .lm-band--thriving   { color: var(--color-align-thriving); }
  .lm-band--aligned    { color: var(--color-align-aligned); }
  .lm-band--drifting   { color: var(--color-align-drifting); }
  .lm-band--misaligned { color: var(--color-align-misaligned); }
  .lm-band--none       { color: var(--color-text-muted); }

  .lm-band-bg--thriving   { background: var(--color-align-thriving-bg); }
  .lm-band-bg--aligned    { background: var(--color-align-aligned-bg); }
  .lm-band-bg--drifting   { background: var(--color-align-drifting-bg); }
  .lm-band-bg--misaligned { background: var(--color-align-misaligned-bg); }

  /* Solid, saturated band fills (domain bars) */
  .lm-fill--thriving   { background: var(--color-align-thriving); }
  .lm-fill--aligned    { background: var(--color-align-aligned); }
  .lm-fill--drifting   { background: var(--color-align-drifting); }
  .lm-fill--misaligned { background: var(--color-align-misaligned); }

  /* ── Report grid: far-left column + trend/domains + full-height map ───── */
  .lm-quad-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.82fr) minmax(0, 0.72fr);
    grid-template-areas:
      "map align   side"
      "map domains side";
    gap: 1.25rem;
    align-items: stretch;
  }

  .lm-side-col {
    grid-area: side;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  /* Let the "Where you stand" card absorb the column's spare height so the CTA
     sits directly below it (one consistent gap) instead of being pushed to the
     bottom — keeps the column the same height as the other two without a large
     floating gap between the two sections. */
  .lm-side-col .lm-quad--stand {
    flex: 1;
  }

  .lm-quad--align   { grid-area: align; }
  .lm-quad--domains { grid-area: domains; }
  .lm-quad--map {
    grid-area: map;
    display: flex;
    flex-direction: column;
  }

  /* Keep the map header pinned to the top so its title (and the "how to read"
     link beneath it) line up with the other columns; center only the chart in
     the remaining space. */
  .lm-quad--map > [data-controller="bubble-chart"] {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Take Life Map action row, above the three columns */
  /* Brief dim while the report frame swaps to another period */
  #lm-report-body[busy] {
    opacity: 0.6;
    transition: opacity 0.1s ease;
  }

  /* "Where you stand" summary */
  .lm-stand-meaning {
    margin: 0;
    font-size: 0.98rem;
    color: var(--color-text-light);
  }

  /* ── Key Insights: the generated recommendation card ────────────────────
     Empty on maps that predate it and on failed generations, so it carries no
     margin of its own — an absent card leaves no gap behind. */

  .lm-insights-label {
    margin: 0.9rem 0 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--color-accent-dark);
  }

  .lm-insights-headline {
    margin: 0 0 0.5rem;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.3;
    color: var(--color-heading);
  }

  .lm-insights-body {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--color-text-light);
  }

  .lm-insights-loading {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.1rem;
  }

  .lm-insights-loading-text {
    margin: 0;
    font-size: 0.88rem;
    color: var(--color-text-muted);
  }

  .lm-insights-spinner {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: lm-spin 0.8s linear infinite;
  }

  @keyframes lm-spin {
    to { transform: rotate(360deg); }
  }

  /* Respect a reduced-motion preference: the spinner still reads as "working"
     without the rotation. */
  @media (prefers-reduced-motion: reduce) {
    .lm-insights-spinner {
      animation-duration: 2.4s;
    }
  }

  .lm-quad {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.35rem;
  }

  .lm-quad-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .lm-quad-head--center {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 0;
  }

  .lm-quad-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--color-heading);
    margin: 0;
  }

  .lm-quad-hint {
    font-size: 0.85rem;
    color: var(--color-accent-dark);
    margin: 0.4rem 0 0.75rem;
  }

  /* Life Alignment Score — its own section above the trend chart */
  .lm-score-block {
    position: relative;
    text-align: left;
    margin-bottom: 1rem;
  }

  .lm-score-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-light);
    cursor: help;
  }

  .lm-score-label .htr-icon {
    color: var(--color-text-muted);
  }

  .lm-score-value {
    font-family: var(--font-serif);
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0.25rem 0 0;
  }

  /* Hover/focus tooltip explaining the bands. Anchored to the right edge
     because this card sits in the right-hand column — at 280px wide it is
     wider than the column, so opening leftward keeps it on screen instead of
     pushing the page into a horizontal scroll. */
  .lm-score-tip {
    position: absolute;
    top: calc(100% - 0.4rem);
    right: 0;
    z-index: 30;
    width: max-content;
    max-width: 280px;
    padding: 0.8rem 0.95rem;
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    text-align: left;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--color-text-light);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    pointer-events: none;
  }

  .lm-score-tip p {
    margin: 0 0 0.35rem;
  }

  .lm-score-tip p:last-child {
    margin-bottom: 0;
  }

  .lm-score-tip strong {
    font-weight: 700;
  }

  .lm-score-block:hover .lm-score-tip,
  .lm-score-block:focus-within .lm-score-tip {
    opacity: 1;
    visibility: visible;
  }

  /* Reusable inline info tooltip shown next to a section title or label.
     Hover or keyboard-focus the icon to reveal the bubble. */
  .lm-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 0.3rem;
    color: var(--color-text-muted);
    cursor: help;
  }

  .lm-tip .htr-icon {
    color: var(--color-text-muted);
  }

  .lm-tip-bubble {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    width: max-content;
    max-width: 240px;
    padding: 0.7rem 0.85rem;
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    /* Reset any inherited title styling so the copy reads as body text. */
    text-align: left;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: normal;
    text-transform: none;
    color: var(--color-text-light);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    pointer-events: none;
  }

  .lm-tip-line {
    display: block;
    margin-bottom: 0.35rem;
  }

  .lm-tip-line:last-child {
    margin-bottom: 0;
  }

  .lm-tip:hover .lm-tip-bubble,
  .lm-tip:focus .lm-tip-bubble,
  .lm-tip:focus-within .lm-tip-bubble {
    opacity: 1;
    visibility: visible;
  }

  .lm-align-chart {
    position: relative;
    height: 230px;
  }

  .lm-how-to-read-link {
    margin-top: 0.4rem;
    margin-bottom: 1.1rem;
    padding: 0;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-accent-dark);
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
  }

  /* Domain View quadrant — vertical bars, one column per domain */
  .lm-domain-cols {
    list-style: none;
    margin: 1.25rem 0 0;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    /* Six domains share this row, so the columns are only as wide as the panel
       divided six ways — the gap is what the labels need back. */
    gap: 0.25rem;
  }

  .lm-domain-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .lm-domain-icon {
    width: 20px;
    height: 20px;
    color: var(--color-heading);
  }

  .lm-domain-icon svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  /* Change-over-time indicator, sits below the domain label */
  .lm-domain-trend {
    margin-top: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
  }

  .lm-trend--up   { color: var(--color-trend-up); }
  .lm-trend--down { color: var(--color-trend-down); }
  .lm-trend--flat { color: var(--color-heading); }
  .lm-trend--none { visibility: hidden; }

  /* Value number — black, at the top of the bar */
  .lm-domain-score {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-heading);
    margin: 0.45rem 0 0.35rem;
  }

  /* Grey track shows the full 0–10 range; the fill grows from the bottom */
  .lm-vbar {
    width: 26px;
    height: 130px;
    background: var(--color-bar-track);
    border-radius: 8px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
  }

  .lm-vbar-fill {
    width: 100%;
    min-height: 3px;
    border: 1.5px solid;
    border-bottom: none;
    border-radius: 7px 7px 0 0;
  }

  .lm-domain-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.4em;
    margin-top: 0.6rem;
    font-size: 0.64rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-align: center;
    line-height: 1.2;
  }

  /* Retake + cooldown */
  .lm-retake {
    text-align: center;
    margin: 2.5rem 0 1.5rem;
  }


  .lm-retake-btn {
    padding: 0.9rem 2rem;
    font: inherit;
    font-weight: 600;
    color: var(--color-white);
    background: var(--color-accent-dark);
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
  }

  .lm-retake-btn--disabled {
    color: var(--color-text-muted);
    background: var(--color-border-light);
    cursor: not-allowed;
  }

  /* Retake pill — sits next to the date navigator and shares its look */
  .lm-retake-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    font: inherit;
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: default;
  }

  /* Active "Take Life Map" button, sized to sit inline beside the navigator */
  .lm-retake-btn--inline {
    padding: 0.55rem 1.4rem;
    font-size: 0.95rem;
  }

  .lm-retake-note {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
  }

  /* CTA */
  .lm-cta {
    text-align: center;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
  }

  /* Top banner variant: copy on the left, actions on the right */
  .lm-cta--banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    text-align: left;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
  }

  .lm-cta-copy { min-width: 0; }

  .lm-cta-text {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    margin: 0 0 1.25rem;
  }

  .lm-cta--banner .lm-cta-text {
    margin: 0 0 0.35rem;
  }

  .lm-cta-sub {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-bg-warm);
    opacity: 0.85;
  }

  .lm-cta-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
  }

  .lm-cta--banner .lm-cta-actions {
    flex-shrink: 0;
  }

  .lm-cta-btn {
    padding: 0.8rem 1.75rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    text-decoration: none;
    border: 1px solid var(--color-bg-warm);
    color: var(--color-white);
    white-space: nowrap;
  }

  .lm-cta-btn--primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-primary);
  }

  /* Stacked CTA card in the far-left column */
  .lm-cta--stack {
    text-align: center;
    padding: 1.5rem 1.4rem;
  }

  .lm-cta--stack .lm-cta-text {
    font-size: 1.15rem;
    margin: 0 0 1.1rem;
  }

  .lm-cta--stack .lm-cta-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .lm-cta--stack .lm-cta-btn {
    text-align: center;
  }

  .lm-report-foot {
    text-align: center;
    margin: 2.5rem 0 0;
    font-size: 0.9rem;
    font-style: italic;
    color: var(--color-text-muted);
  }

  /* Wider canvas for the report's three-column layout */
  .lm-report .lm-report-main {
    max-width: 1300px;
  }

  @media (max-width: 960px) {
    .lm-quad-grid {
      grid-template-columns: 1fr;
      /* Same sequence as the three columns read on desktop, so the map still
         comes first when they stack. */
      grid-template-areas:
        "map"
        "align"
        "domains"
        "side";
    }

    .lm-cta--banner {
      flex-direction: column;
      align-items: flex-start;
    }
  }

  /* On phones the centered logo and the pinned links can collide — let them
     flow above the logo instead. */
  @media (max-width: 600px) {
    .lm-report-links {
      position: static;
      margin-bottom: 0.75rem;
    }
  }

  /* ── First-run dashboard tour ─────────────────────────────────────────────
     Three layers: the backdrop dims the page, highlighted sections are lifted
     above it (they already have opaque card backgrounds, so no cutout is
     needed), and the step card sits above both. */

  .lm-tour-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 20, 0.55);
    z-index: 200;
  }

  /* The spotlight. .lm-report-main is position:relative with no z-index, so it
     creates no stacking context and these can rise above the backdrop from
     wherever they sit in the grid. */
  .lm-tour-lit {
    position: relative;
    z-index: 201;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 0 3px var(--color-accent), 0 18px 44px rgba(0, 0, 0, 0.28);
  }

  /* Sections that are whole cards bring their own background, so rising above
     the backdrop is enough to light them. The score block is a bare div inside
     one, and would otherwise show the dimmed card straight through it — lit
     ring, dim contents. Give it the card's surface and room to breathe. */
  .lm-score-block.lm-tour-lit {
    padding: 0.6rem 0.8rem;
    margin: -0.6rem -0.8rem 0.4rem;
    background: var(--color-surface);
  }

  .lm-tour-card {
    position: fixed;
    z-index: 202;
    width: min(430px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 26px 28px 22px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
  }

  /* Steps with no anchor, and every step on a phone. */
  .lm-tour-card--centered {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .lm-tour-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    padding: 0;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
  }

  .lm-tour-counter {
    margin: 0 0 10px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
  }

  .lm-tour-eyebrow {
    margin: 0 0 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--color-accent-dark);
  }

  .lm-tour-title {
    margin: 0 0 0.9rem;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--color-heading);
  }

  .lm-tour-body {
    margin: 0 0 0.85rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--color-text);
  }

  .lm-tour-body--lead {
    font-weight: 600;
    margin-bottom: 0.6rem;
  }

  .lm-tour-points {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1rem;
  }

  .lm-tour-point strong {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: var(--color-heading);
  }

  .lm-tour-point p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--color-text-light);
  }

  .lm-tour-icon {
    color: var(--color-accent-dark);
    flex-shrink: 0;
  }

  .lm-tour-aside {
    margin: 0 0 1.1rem;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--color-text-light);
  }

  .lm-tour-aside .htr-icon {
    vertical-align: -3px;
  }

  .lm-tour-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .lm-tour-next {
    flex: 1;
    padding: 0.85rem 1.5rem;
    font: inherit;
    font-weight: 600;
    color: var(--color-white);
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
  }

  .lm-tour-back {
    padding: 0.85rem 0.25rem;
    font: inherit;
    font-size: 0.9rem;
    color: var(--color-text-light);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
  }

  /* ── Step 2: callouts sitting in the chart's own quadrants ─────────────────
     Each .lm-tour-quad is given the exact box of its quadrant by the
     controller; the inner card is what's actually drawn, tucked into the
     corner nearest the axes so it covers as few bubbles as possible. */

  .lm-tour-quad {
    z-index: 202;
    display: flex;
    padding: 10px;
    pointer-events: none;
  }

  .lm-tour-quad-inner {
    align-self: center;
    max-width: 100%;
    padding: 11px 13px;
    background: rgba(30, 26, 22, 0.94);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  }

  .lm-tour-quad strong {
    display: block;
    margin-bottom: 3px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-white);
  }

  .lm-tour-quad p {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.88);
  }

  /* Hidden until the controller positions them, so they never flash at the
     top-left of the page on the way in. */
  .lm-tour-card[hidden] .lm-tour-quads,
  .lm-tour-quad:not([style]) {
    display: none;
  }

  /* The in-card quadrant list only stands in for the chart overlay, so it is
     absent whenever the callouts themselves are shown. */
  .lm-tour-quad-list {
    display: none;
  }

  /* Below this the chart cannot hold four legible callouts. The controller
     centres the card; the overlay gives way to the same four quadrants listed
     inside it. */
  @media (max-width: 600px) {
    .lm-tour-quads {
      display: none;
    }

    .lm-tour-quad-list {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.55rem;
      margin-bottom: 1rem;
    }

    .lm-tour-quad-listing {
      padding: 10px 12px;
      border-radius: var(--radius-sm);
    }

    .lm-tour-quad-where {
      display: block;
      margin-bottom: 2px;
      font-size: 0.65rem;
      color: var(--color-text-muted);
    }

    .lm-tour-quad-listing strong {
      display: block;
      margin-bottom: 2px;
      font-size: 0.8rem;
    }

    .lm-tour-quad-listing p {
      margin: 0;
      font-size: 0.72rem;
      line-height: 1.4;
      color: var(--color-text-light);
    }

    /* Same quadrant tints the "Your Life Map" modal uses, so the two readings
       of the same four boxes stay recognisable as each other. */
    .lm-tour-quad-listing--urgent     { background: rgba(229, 134, 107, 0.09); border: 1px solid rgba(229, 134, 107, 0.25); }
    .lm-tour-quad-listing--urgent strong { color: #e5866b; }
    .lm-tour-quad-listing--working    { background: rgba(71, 128, 96, 0.08);   border: 1px solid rgba(71, 128, 96, 0.2); }
    .lm-tour-quad-listing--working strong { color: var(--color-positive); }
    .lm-tour-quad-listing--consider   { background: rgba(217, 217, 217, 0.4);  border: 1px solid var(--color-divider); }
    .lm-tour-quad-listing--consider strong { color: var(--color-gray); }
    .lm-tour-quad-listing--background { background: rgba(194, 221, 248, 0.15); border: 1px solid rgba(194, 221, 248, 0.5); }

    .lm-tour-lit {
      box-shadow: 0 0 0 3px var(--color-accent);
    }
  }
}
