/* Owner-supplied compact pastel composition. Existing SaNes type, imagery and map. */
#step-result.has-personal-story {
  --story-ink: #0b2140; --story-muted: #52677c; --story-line: #dce5ec;
  --story-sky: #eaf3fe; --story-sage: #edf6e9; --story-sand: #fff4e4; --story-lilac: #f4edfa;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px;
  max-width: 1280px; margin-inline: auto; padding-inline: 24px; padding-block-end: 40px;
}
.has-personal-story > *, .has-personal-story .rx-body > * { min-width: 0; grid-column: 1 / -1; }
.has-personal-story .rx-report, .has-personal-story .rx-body, #neighborhood-story { display: contents; }
.has-personal-story .rx-toc, .has-personal-story #result-overview,
.has-personal-story #result-told-us, .has-personal-story #personalized-neighborhood-content,
.has-personal-story #neighborhood-considerations, .has-personal-story #hood-day,
.has-personal-story #hood-gaps, .has-personal-story #neighborhood-statistics,
.has-personal-story #hood-tour, .has-personal-story #next,
.has-personal-story #hood-schools, .has-personal-story #hood-parks, .has-personal-story #hood-evening,
.has-personal-story .rx-num,
.has-personal-story .rx-hero__kicker, .has-personal-story .rx-personal__eyebrow,
.has-personal-story .rx-map__eyebrow { display: none; }
.has-personal-story .rx-all-matches { order: -3; background: none; border: 0; padding: 0; margin: 0; min-height: 44px; }
.has-personal-story .rx-all-matches > span:first-child { display: none; }
.has-personal-story .rx-hero { order: -2; grid-column: 1 / -1; align-self: center; background: none; overflow: visible; margin: 0;
  display: flex; flex-direction: column; }
/* The guide's title sits above the photo (owner, 2026-11-02). */
.has-personal-story .rx-hero__caption { order: -1; }

.has-personal-story #city-photo { border-radius: 16px; overflow: hidden; }
.has-personal-story #city-photo img { height: clamp(240px, 32vw, 390px); }
.has-personal-story .rx-hero__caption { position: static; padding: 8px 0; color: var(--story-ink); background: none; }
.has-personal-story #hood-name { color: var(--story-ink); font-size: clamp(32px, 3.5vw, 48px); line-height: 1.18; }
.has-personal-story .result__city { color: var(--story-muted); font-size: 21px; }
#neighborhood-story > * { min-width: 0; grid-column: 1 / -1; color: var(--story-ink); }
:is(#neighborhood-story, #neighborhood-story-followup) h2 { font-family: Rubik, Assistant, sans-serif; font-size: clamp(21px, 2vw, 26px); line-height: 1.3; margin: 0 0 16px; text-wrap: balance; }
:is(#neighborhood-story, #neighborhood-story-followup) p { margin: 0 0 12px; max-inline-size: 70ch; }
:is(#neighborhood-story, #neighborhood-story-followup) a, :is(#neighborhood-story, #neighborhood-story-followup) button { color: #255f9b; text-underline-offset: 4px; }
:is(#neighborhood-story, #neighborhood-story-followup) :focus-visible { outline: 3px solid #2f73ba; outline-offset: 4px; }
#neighborhood-story ::selection { background: #c8dcec; color: #0b2140; }
#neighborhood-story details { min-width: 0; }
:is(#neighborhood-story, #neighborhood-story-followup) summary { cursor: pointer; min-height: 44px; }
:is(#neighborhood-story, #neighborhood-story-followup) summary::marker { color: #255f9b; }
#neighborhood-story > .story-intro {
  grid-column: 1 / -1; background: none; border-radius: 0;
  display: grid; grid-template-columns: minmax(0, 1fr); padding: 24px; align-items: start;
}
.story-intro__message { min-width: 0; font-size: 18px; line-height: 1.75; }
.story-overview__headline { display: block; margin-block-end: 10px; font-size: 21px; }
.story-meta, .story-school__preview { color: var(--story-muted); font-size: 14px; line-height: 1.5; }
.story-ask { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 0; background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; text-align: start; }
.story-ask:hover, :is(#neighborhood-story, #neighborhood-story-followup) a:hover { text-decoration: underline; }
.story-topics { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
/* Housing table colors follow the owner's mockup (2026-10-31): cream rows, stone header and rules, navy text.
   The section itself sits on the page background like the other topics. */
#story-topic-housing {
  --housing-surface: color-mix(in srgb, var(--color-surface-muted) 30%, var(--color-surface));
  --housing-head: color-mix(in srgb, var(--color-border-stone) 22%, var(--color-surface));
  --housing-rule: color-mix(in srgb, var(--color-border-stone) 50%, var(--color-surface));
  color: var(--color-text);
}
#story-topic-housing .story-topic__body { color: var(--color-text); }
.story-housing-request h4 { margin: 0 0 8px; font-family: var(--head); font-size: clamp(20px, 2.2vw, 24px); font-weight: 700; }
.story-housing-summary { margin: 0 0 24px; font-size: 17px; }
.story-housing-table-wrap { overflow-x: auto; border: 1px solid var(--housing-rule); border-radius: 10px; background: var(--housing-surface); }
.story-housing-table { width: 100%; border-collapse: collapse; font-size: 17px; }
.story-housing-table :is(th, td) { padding: 14px 18px; text-align: start; font-weight: 400; border-block-end: 1px solid var(--housing-rule); }
.story-housing-table :is(th, td) + :is(th, td) { border-inline-start: 1px solid var(--housing-rule); }
.story-housing-table tbody tr:last-child > * { border-block-end: 0; }
.story-housing-table thead th { font-weight: 700; background: var(--housing-head); }
/* Keep numeric bidi ordering without moving the value away from its RTL label. */
.story-housing-price { display: block; margin-block-start: 4px; font-weight: 700; font-variant-numeric: tabular-nums; unicode-bidi: plaintext; text-align: right; }
.story-housing-finding { display: inline-flex; align-items: center; gap: 8px; }
.story-housing-none { width: 18px; height: 18px; flex: none; color: var(--color-error); }
.story-search-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-block: 32px 0; }
:is(#neighborhood-story, #neighborhood-story-followup) .story-search-cta { color: var(--color-on-dark); background: var(--color-primary-hover); min-height: 52px; padding: 12px 40px; border: 0; border-radius: 8px; box-shadow: none; font-weight: 700; white-space: normal; text-align: center; }
:is(#neighborhood-story, #neighborhood-story-followup) .story-search-cta:hover { background: var(--color-primary); }
#story-topic-housing .story-search-actions > .story-meta { margin: 0 !important; color: var(--color-text); font-size: 14px; }
@media (max-width: 480px) {
  .story-housing-table :is(th, td) { padding: 10px 12px; font-size: 15px; }
  .story-search-cta { width: 100%; }
}
.story-tone--sky { --topic-color: var(--story-sky); --icon-color: #255f9b; }
.story-tone--sage { --topic-color: var(--story-sage); --icon-color: #387347; }
.story-tone--sand { --topic-color: var(--story-sand); --icon-color: #945329; }
.story-tone--lilac { --topic-color: var(--story-lilac); --icon-color: #744a96; }
.story-topic { border: 0; border-block-start: 1px solid var(--color-divider); background: none; border-radius: 0; padding-block: clamp(24px, 3vw, 34px); }
.story-topic__summary { text-align: start; }
.story-topic__summary::-webkit-details-marker { display: none; }
.story-topic__summary::marker { content: ''; }
.story-icon { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; flex-shrink: 0; color: var(--icon-color, #255f9b); }
.story-topic__insight { font-size: 17px; line-height: 1.6; }
.story-status { font-size: 14px; font-weight: 600; color: var(--color-text-secondary); }
.story-status--tradeoff { color: #87531d; }
.story-topic__body { padding-block-start: 22px; font-size: 16px; line-height: 1.65; }
.story-topic[open] > summary .rx-section__chevron { transform: rotate(180deg); }
.story-explanation { margin-block: 12px; }
.story-explanation > summary { padding-block: 10px; color: #255f9b; font-weight: 600; }
.story-paragraph { line-height: 1.65; }
.story-source { font-size: 13px; color: var(--story-muted); }
.story-source > summary { padding-block: 10px; color: #255f9b; }
.story-source__body { padding: 12px; background: #fffdf9; border-radius: 12px; overflow-wrap: anywhere; }
.story-source__body + .story-source__body { margin-block-start: 8px; }
.story-priorities { margin-block: 12px; }
.story-priorities > summary { font-weight: 600; }
.story-priority { padding-block: 12px; }
.story-topic__body > a, .story-panel > a, .story-park > a, .story-school > a, .story-followup > a { display: inline-flex; align-items: center; min-height: 44px; }
.story-panel { border: 1px solid var(--story-line); border-radius: 16px; padding: 20px; background: #fff; min-width: 0; }
.story-schools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.story-school { border-block-start: 2px solid #c8dcec; padding-block: 12px; }
.story-school > summary { font-weight: 700; font-size: 17px; }
.story-school__preview { display: block; font-weight: 400; margin-block-start: 10px; }
.story-place-list { list-style: none; padding: 0; margin: 10px 0; }
.story-place-list li { padding-block: 12px; border-block-end: 1px solid var(--story-line); }
.story-place-list span, .story-place-list small { display: block; font-size: 14px; color: var(--story-muted); }
.story-parks { display: grid; gap: 10px; }
.story-park { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-divider); padding: 12px 14px; border-radius: var(--r-sm); }
.story-park:hover { border-color: var(--color-border-hover); }
.story-park > summary:focus-visible { outline: var(--focus-outline); outline-offset: 4px; border-radius: 2px; }
.story-park > summary { position: relative; font-size: 17px; font-weight: 700; }
.story-park p { margin-block-start: 12px !important; }
.story-more > summary { padding-block: 10px; color: #255f9b; }
.story-more > .story-park-card { margin-block-start: 10px; }
.story-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.story-metric { border-block-end: 1px solid var(--story-line); padding-block: 12px; }
.story-metric > summary { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 5px 10px; }
.story-metric .story-icon { grid-row: 1 / 4; align-self: center; }
.story-metric strong { font-size: 25px; font-variant-numeric: tabular-nums; }
.story-metric span { font-size: 15px; }
.story-metric small { grid-column: 2; font-size: 12px; color: var(--story-muted); }
.story-metric[open] { grid-column: 1 / -1; }
.has-personal-story #neighborhood-story-followup { color: var(--story-ink); }
.story-followup { background: var(--story-sky); padding: 22px; border-radius: 16px; }
.story-recommendation { font-size: 17px; line-height: 1.6; }
.has-personal-story #hood-map-card { grid-column: 1 / -1; margin: 0; min-width: 0; }
.has-personal-story .rx-map__stage { aspect-ratio: 5 / 3; min-height: 0; }
.has-personal-story .rx-map__stage:has(.rx-maplibre) { aspect-ratio: auto; height: clamp(460px, 48vw, 620px); }
.has-personal-story .rx-map__svg { height: 100%; }
.has-personal-story .rx-section__summary { padding-block: 12px; }
.has-personal-story #result-reliability { order: -1; }
@media (max-width: 800px) {
  #step-result.has-personal-story { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-inline: 14px; }
  .has-personal-story .rx-hero { margin-block: 18px; }
  .has-personal-story #hood-name { font-size: 32px; }
  #neighborhood-story > .story-intro { grid-column: 1; padding: 16px; grid-template-columns: minmax(0, 1fr); }
  .story-topics { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .story-topic__summary { padding: 4px 0; }
  .story-topic__body { padding: 18px 0 0; }
  .story-topic__insight { font-size: 15px; }
  .story-panel { padding: 16px; }
  .story-schools { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .has-personal-story #hood-map-card { grid-column: 1; }
  .has-personal-story .rx-map__stage:has(.rx-maplibre) { height: max(380px, 60dvh); }
}
@media (prefers-reduced-motion: reduce) {
  .has-personal-story *, .has-personal-story *::before, .has-personal-story *::after { scroll-behavior: auto !important; }
}

.story-guide { display: flex; align-items: flex-start; gap: 12px; padding-block-end: 12px; margin-block-end: 12px; border-block-end: 1px solid var(--story-line); }
.story-followup__header { display: flex; align-items: center; gap: 16px; margin-block-end: 16px; }
#neighborhood-story-followup .story-followup__header h2 { margin: 0; min-width: 0; }
.story-followup__yosef { width: 80px; height: auto; flex: 0 0 80px; object-fit: contain; }
.story-next-actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
.story-next-actions > .btn { width: 100%; min-height: 48px; white-space: normal; }
@media (max-width: 800px) {
  .story-followup { padding: 16px; }
  .story-followup__yosef { width: 64px; flex-basis: 64px; }
}

.has-personal-story #result-unranked-focus { order: -2; }

.story-guide__bulb { flex: 0 0 26px; width: 26px; height: 26px; margin-block-start: 3px; color: #d6a300; filter: drop-shadow(0 0 5px #facc1580); }
.story-guide > p { flex: 1; min-width: 0; margin: 0; }

.story-demo-profiles { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; padding-block: 24px; margin-block-start: 24px; border-block-start: 1px solid var(--color-divider); }
.story-demo-profiles > span { flex-basis: 100%; text-align: center; }
.story-demo-profiles.is-hidden { display: none; }
.alpha-profiles { flex-basis: 100%; max-width: 40rem; }
.alpha-profiles > summary { padding-block: 12px; cursor: pointer; }
.alpha-profiles label { display: grid; gap: 8px; }
.alpha-profiles__save, .alpha-profiles__actions { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-block: 12px; }
.alpha-profiles__save label { flex: 1 1 220px; }
.alpha-profiles input, .alpha-profiles select { width: 100%; min-height: 44px; padding: 8px 12px; color: inherit; background: var(--color-surface, #fffdf9); border: 1px solid var(--color-divider); border-radius: 8px; font: inherit; }

.story-school[open] .story-school__preview { display: none; }
@media (max-width: 640px) {
  #neighborhood-story > .story-intro { grid-template-columns: minmax(0, 1fr); }
}

/* The guide's bar (owner, 2026-11-02): reading-time and fit chips, then sticky tabs to the guide's parts. */
.story-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.story-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 16px;
  border: 1px solid var(--color-border); border-radius: var(--r-pill, 999px);
  background: var(--color-surface); color: var(--color-text); font-size: 16px;
}
.story-chip__icon { width: 20px; height: 20px; flex: none; }
.story-chip--warm { border-color: transparent; background: var(--color-accent-surface); }
.story-chip--warm .story-chip__icon { color: var(--color-accent); }
.has-personal-story .story-tabs {
  position: sticky; top: 8px; z-index: 5; align-self: start;
  border: 1px solid var(--color-border); border-radius: 18px; padding: 6px;
  background: var(--color-surface); box-shadow: 0 6px 18px color-mix(in srgb, var(--color-text) 8%, transparent);
}
.story-tabs__list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
#neighborhood-story .story-tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 72px; padding: 8px 4px; border-radius: 14px;
  color: var(--color-text-secondary); font-size: 16px; text-decoration: none;
}
.story-tab__icon { width: 26px; height: 26px; }
#neighborhood-story .story-tab:hover { background: var(--color-surface-hover); text-decoration: none; }
#neighborhood-story .story-tab.is-active { background: var(--color-accent-surface); color: var(--color-text); font-weight: 700; }
.story-tab.is-active .story-tab__icon { color: var(--color-accent); }
.story-tab.is-active::after {
  content: ''; position: absolute; inset-inline: 30%; bottom: 4px; height: 3px; border-radius: 2px; background: var(--color-accent);
}
.has-personal-story :is(#story-letter, .story-topic, #hood-map-card, .story-mismatch__item) { scroll-margin-top: 104px; }
@media (max-width: 480px) {
  .story-chip { font-size: 14px; padding-inline: 12px; }
  #neighborhood-story .story-tab { min-height: 64px; font-size: 14px; }
  .story-tab__icon { width: 22px; height: 22px; }
}

/* The full article inside the story (owner, 2026-11-02): one button opens it in place. */
.story-article { margin-block-start: 8px; }
#neighborhood-story .story-article__toggle { display: block; margin-inline: auto; min-height: 40px; padding: 6px 20px; font-size: 15px; }
.story-article__body { display: grid; gap: 24px; margin-block-start: 20px; }
.story-article__body[hidden] { display: none; }
.story-article__segment h3 { margin: 0 0 8px; font-family: var(--head); font-size: clamp(19px, 2vw, 22px); line-height: 1.3; }

/* One size for every section heading in the guide, the smallest one (owner, 2026-11-02). */
.has-personal-story .rx-section__heading > h3 { font-size: 20px; }
/* The full article is now part of the guide, so the link out to it is gone (owner, 2026-11-02). */
.has-personal-story #hood-guide { display: none; }

/* Park cards (owner's mockup, 2026-11-02): a tree tile in the nature tone, the name, then area and distance. */
.story-park-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center;
  padding: 16px; border: 1px solid var(--color-divider); border-radius: 16px; background: var(--color-surface); color: var(--color-text);
}
.story-park-card__tile { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 12px; background: var(--story-sage); color: var(--icon-color); }
.story-park-card__icon { width: 36px; height: 36px; }
.story-park-card__name { margin: 0 0 10px; font-family: var(--head); font-size: 19px; font-weight: 700; line-height: 1.3; }
.story-park-card__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.story-park-card__fact { display: grid; gap: 2px; min-width: 0; }
.story-park-card__fact + .story-park-card__fact { padding-inline-start: 16px; border-inline-start: 1px solid var(--color-divider); }
.story-park-card__value { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; }
.story-park-card__fact-icon { width: 20px; height: 20px; flex: none; color: var(--color-text-secondary); }
.story-park-card__label { font-size: 14px; color: var(--color-text-secondary); }
.story-parks__note { margin-block-start: 12px; }
@media (max-width: 480px) {
  .story-park-card { gap: 12px; padding: 14px; }
  .story-park-card__tile { width: 52px; height: 52px; }
  .story-park-card__fact + .story-park-card__fact { padding-inline-start: 12px; }
}

/* "חוסר התאמה" (owner, 2026-11-02): the chip opens a small list of links to the blocks at the bottom. */
.story-mismatch-chip { position: relative; display: inline-flex; }
#neighborhood-story .story-chip--alert {
  border-color: transparent; background: var(--color-error-surface); color: var(--color-error);
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.story-chip--alert:focus-visible { outline: var(--focus-outline); outline-offset: 3px; }
.story-mismatch-menu {
  position: absolute; z-index: 6; inset-block-start: calc(100% + 8px); inset-inline-start: 0; min-width: 220px;
  padding: 12px 16px; border: 1px solid var(--color-border); border-radius: 12px;
  background: var(--color-surface); box-shadow: 0 8px 24px color-mix(in srgb, var(--color-text) 14%, transparent);
}
.story-mismatch-menu[hidden] { display: none; }
#neighborhood-story .story-mismatch-menu__title { margin: 0 0 6px; font-size: 14px; color: var(--color-text-secondary); }
.story-mismatch-menu__list { margin: 0; padding: 0; list-style: none; }
.story-mismatch-menu__list a { display: flex; align-items: center; min-height: 40px; font-weight: 600; }
.story-mismatch { padding: 22px; border-radius: 16px; background: var(--color-error-surface); color: var(--color-text); margin-block-end: 22px; }
.story-mismatch__item + .story-mismatch__item { margin-block-start: 16px; padding-block-start: 16px; border-block-start: 1px solid var(--color-divider); }
.story-mismatch__item h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-family: var(--head); font-size: 20px; }
.story-mismatch__icon { width: 20px; height: 20px; flex: none; color: var(--color-error); }
.story-mismatch__item p { margin: 0 0 8px; }
.story-mismatch__item a { display: inline-flex; align-items: center; min-height: 44px; }
