/* The portfolio map (portfolio-map.html). Loaded after site-2026.css and tours.css; uses the shared tokens and the
   v4 page parts (.ph, .v4-short, .v4-sec, .v4-head, .v4-nums, .v4-cards, .next-band). Written phone first; wider
   layouts use min-width. */

/* ---------- The sample portfolio (portfolio-dashboard.js) ----------
   An interactive sample on FEMA's flood zones. Status marks differ by shape as well as colour, and every status
   also has a label. */
.pf { background: var(--white); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 30px 70px -30px rgba(16, 40, 63, .35); overflow: hidden; overflow: clip; }
.pf-top { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--navy); color: var(--white); }
.pf-top img { width: 32px; height: 32px; flex: none; }
.pf-top p { display: grid; gap: 1px; min-width: 0; }
.pf-top b { font-size: 17px; line-height: 1.25; font-weight: 600; }
.pf-top p span { font-size: 15px; line-height: 1.3; color: rgba(255, 255, 255, .86); }
.pf-tag { margin-left: auto; flex: none; padding: 4px 12px; border-radius: 999px; background: rgba(156, 203, 235, .2); color: #DCEBF7; font-size: 14px; font-weight: 500; }
@media (max-width: 400px) { .pf-tag { display: none; } }

/* What to show: two rows of big chips you can thumb (each row works like radio buttons), and the rarer filters
   folded under "More filters" (overnight review, November 27, 2026: five small menus read as a form, not a map). */
.pf-controls { display: grid; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.pf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-chip { min-height: 44px; padding: 0 16px; border: 1.5px solid #B9C3CD; border-radius: 999px; background: var(--white); font: 500 16px/1.2 'Outfit', Arial, sans-serif; color: var(--navy); cursor: pointer; }
.pf-chip:hover { border-color: var(--navy); }
.pf-chip[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: var(--white); }
.pf-chip:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pf-areas .pf-chip { min-height: 40px; font-size: 15px; }
.pf-more > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; font-size: 16px; font-weight: 500; color: var(--sky); cursor: pointer; list-style: none; }
.pf-more > summary::-webkit-details-marker { display: none; }
.pf-more > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.pf-more[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.pf-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 8px 0 4px; }
.pf-filters label { display: grid; gap: 6px; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.pf-filters select { min-width: 0; width: 100%; height: 48px; padding: 0 10px; border: 1.5px solid #6B7785; border-radius: 10px; background: var(--white); font: 16px/1.2 'Outfit', Arial, sans-serif; color: var(--navy); }
.pf-reset { min-height: 48px; padding: 0 18px; border: 1.5px solid #6B7785; border-radius: 999px; background: var(--white); font: 500 16px/1 'Outfit', Arial, sans-serif; color: var(--navy); cursor: pointer; }
.pf-reset:hover { border-color: var(--navy); background: var(--sky-wash); }
@media (min-width: 641px) {
  .pf-controls { padding: 18px 20px; }
  .pf-filters { display: flex; flex-wrap: wrap; align-items: flex-end; }
  .pf-filters label { flex: 1 1 170px; }
  .pf-filters .pf-reset { flex: none; }
}
@media (max-width: 640px) {
  /* On a phone the area chips scroll sideways in one row, so the two rows stay short. */
  .pf-areas { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .pf-areas .pf-chip { flex: none; }
}

/* The totals for whatever the filters show. */
/* Tiles: two a row on a phone, three on a tablet, five on a laptop. */
.pf-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.pf-kpis > div { display: grid; gap: 2px; align-content: start; padding: 14px 16px; border-top: 1px solid var(--line); }
.pf-kpis > div:nth-child(-n + 2) { border-top: 0; }
.pf-kpis > div:nth-child(2n) { border-left: 1px solid var(--line); }
.pf-kpis > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.pf-kpis small { font-size: 15px; line-height: 1.3; font-weight: 500; color: var(--ink-2); }
.pf-kpis span { font-size: 15px; line-height: 1.3; color: var(--ink-2); }
.pf-kpis b { font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; color: var(--navy); }
.pf-kpis .warn b { color: var(--alert); }
@media (min-width: 641px) {
  .pf-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pf-kpis > div { padding: 16px 20px; }
  .pf-kpis > div:last-child:nth-child(odd) { grid-column: auto; }
  .pf-kpis > div:nth-child(n) { border-left: 1px solid var(--line); border-top: 0; }
  .pf-kpis > div:nth-child(3n + 1) { border-left: 0; }
  .pf-kpis > div:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .pf-kpis b { font-size: 34px; }
}
@media (min-width: 1081px) {
  .pf-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .pf-kpis > div:nth-child(n) { border-top: 0; border-left: 1px solid var(--line); }
  .pf-kpis > div:first-child { border-left: 0; }
}

/* The map and what sits beside it. On one column (phone, tablet) the two groups dissolve, so the property that was
   chosen opens straight under the map, above the key. */
.pf-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px; }
.pf-mapcol, .pf-side { display: contents; }
.pf-stage { order: 1; }
.pf-near { order: 2; }
.pf-profile { order: 2; }
.pf-how { order: 3; }
.pf-legend { order: 4; }
.pf-zones { order: 5; }
.pf-card { order: 6; }
.pf-tablewrap { order: 7; }
.pf-stage, .pf-how, .pf-legend, .pf-zones { width: 100%; max-width: 560px; margin-inline: auto; }
@media (min-width: 641px) { .pf-body { padding: 20px; gap: 18px; } }
@media (min-width: 1081px) {
  .pf-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
  .pf-stage { aspect-ratio: 6 / 7; }
  .pf-mapcol { display: block; }
  .pf-side { display: grid; gap: 16px; align-content: start; min-width: 0; }
  .pf-stage, .pf-how, .pf-legend, .pf-zones { max-width: none; }
}
.pf-stage { position: relative; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; background: #C9DEE5; cursor: default; box-shadow: inset 0 0 0 1px rgba(16, 40, 63, .08); }
.pf-svg { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .3s; }
.pf-stage.is-ready .pf-svg { opacity: 1; }
.pf-pins { position: absolute; inset: 0; }
/* The pin is a 24px target (WCAG 2.5.8); the mark is drawn inside it. A tap anywhere near a mark opens it. */
.pf-pin { position: absolute; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: none; transform: translate(-50%, -50%); cursor: pointer; transition: left .35s, top .35s; }
@media (prefers-reduced-motion: reduce) { .pf-pin, .pf-svg { transition: none; } }
.pf-pin::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; box-sizing: border-box; border: 2px solid #FFFFFF; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 1px 3px rgba(10, 28, 46, .35); }
.pf-pin:focus-visible { outline: 3px solid var(--navy); outline-offset: 0; }
.pf-pin.is-selected { z-index: 2; }
.pf-pin.is-selected::after { width: 20px; height: 20px; box-shadow: 0 0 0 3px var(--navy); }
.pf-pin.pf-approved::after, .pf-key.pf-approved { background: #0CA30C; }
.pf-pin.pf-review::after, .pf-key.pf-review { background: #FFFFFF; border: 3px solid var(--navy); }
.pf-pin.pf-review::after { box-shadow: 0 0 0 2px #FFFFFF, 0 1px 3px rgba(10, 28, 46, .35); }
.pf-pin.pf-gap::after, .pf-pin.pf-placement::after { width: 13px; height: 13px; border-radius: 2px; transform: translate(-50%, -50%) rotate(45deg); }
.pf-pin.pf-gap::after, .pf-key.pf-gap { background: #EC835A; }
.pf-pin.pf-placement::after, .pf-key.pf-placement { background: #D03B3B; }
.pf-pin.pf-gap.is-selected::after, .pf-pin.pf-placement.is-selected::after { width: 18px; height: 18px; }
.pf-pin.pf-clear::after { width: 9px; height: 9px; background: #8A97A3; }
.pf-key.pf-clear { background: #8A97A3; }
.pf-tip { position: absolute; z-index: 3; max-width: 240px; padding: 8px 12px; border-radius: 10px; background: var(--navy); color: #FFFFFF; font-size: 15px; line-height: 1.4; transform: translate(-50%, calc(-100% - 14px)); pointer-events: none; }
.pf-tip.below { transform: translate(-50%, 22px); }
.pf-tip b, .pf-tip span { display: block; }
.pf-tip span { color: rgba(255, 255, 255, .88); }
.pf-fail { display: none; position: absolute; inset: auto 16px 16px; margin: 0; font-size: 16px; color: var(--navy); }
.pf-stage.is-failed .pf-fail { display: block; }
.pf-how { font-size: 16px; line-height: 1.45; color: var(--ink-2); }
.pf-key { display: inline-block; flex: none; width: 11px; height: 11px; margin-right: 8px; border-radius: 50%; vertical-align: -1px; }
.pf-key.pf-review { box-sizing: border-box; border-width: 2px; }
.pf-key.pf-gap, .pf-key.pf-placement { width: 10px; height: 10px; border-radius: 1px; transform: rotate(45deg); }
.pf-key.pf-clear { width: 9px; height: 9px; }
.pf-legend, .pf-zones { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 15px; line-height: 1.4; color: var(--ink-2); }
.pf-zones i { display: inline-block; width: 13px; height: 13px; margin-right: 7px; border-radius: 3px; vertical-align: -2px; }
.pf-zones .z-v { background: #726293; } .pf-zones .z-a { background: #568BAE; } .pf-zones .z-xs { background: #D9A574; }
@media (min-width: 1081px) { .pf-how { margin-top: 12px; } .pf-legend { margin: 12px 0 0; } .pf-zones { margin: 8px 0 0; } }

/* Marks that sit close together: a tap between them lists the properties near that spot, each a full-size button. */
.pf-near { padding: 14px; border: 1px solid var(--line); border-top: 4px solid var(--sky-mid); border-radius: 14px; background: var(--white); }
.pf-near[hidden] { display: none; }
/* Brought into view under the sticky header, with room to spare. */
.pf-near, .pf-profile { scroll-margin: 96px 0 16px; }
.pf-near-h { font-size: 17px; font-weight: 600; color: var(--navy); }
.pf-near > .pf-close { float: right; margin: -6px -6px 6px 12px; }
@media (min-width: 1081px) { .pf-near > .pf-close { display: none; } }
.pf-near ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.pf-near-btn { display: flex; align-items: baseline; gap: 4px; width: 100%; min-height: 52px; padding: 8px 14px; border: 1.5px solid #6B7785; border-radius: 12px; background: var(--white); font: inherit; text-align: left; color: var(--navy); cursor: pointer; }
.pf-near-btn:hover { border-color: var(--navy); background: var(--sky-wash); }
.pf-near-btn b, .pf-near-btn small { display: block; }
.pf-near-btn b { font-size: 16px; line-height: 1.3; font-weight: 600; }
.pf-near-btn small { font-size: 15px; line-height: 1.35; color: var(--ink-2); }
@media (min-width: 1081px) { .pf-near { margin-top: 12px; } }
.pf-nojs { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--warm); font-size: 18px; line-height: 1.55; color: var(--ink-2); }
.pf-nojs .text-link { display: inline; padding-bottom: 1px; }
.pf[hidden], .pf[hidden] + .pf-cap { display: none; }

/* The property that was chosen. On a laptop it takes the place of the breakdown and the list beside the map; on a
   phone or a tablet it rises as a sheet from the foot of the screen, over the page, so nothing scrolls. The same goes
   for the short list of properties near a tap. */
@media (min-width: 1081px) {
  .pf.has-profile .pf-card, .pf.has-profile .pf-tablewrap { display: none; }
  /* Opened from far down a long list, the profile stays in view while its column keeps the list's height. */
  .pf.has-profile .pf-profile { position: sticky; top: 88px; }
}
@media (max-width: 1080px) {
  .pf .pf-profile, .pf .pf-near { position: fixed; z-index: 95; left: 0; right: 0; bottom: 0; max-height: 78vh; max-height: 78svh; overflow: auto; margin: 0; padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); border: 0; border-top: 4px solid var(--sky-mid); border-radius: 22px 22px 0 0; box-shadow: 0 -24px 60px rgba(10, 28, 46, .35); }
  .pf.has-sheet::after { content: ""; position: fixed; z-index: 94; inset: 0; background: rgba(10, 28, 46, .35); }
}
@media (max-width: 1080px) and (prefers-reduced-motion: no-preference) {
  .pf .pf-profile:not([hidden]), .pf .pf-near:not([hidden]) { animation: pf-rise .25s ease-out; }
}
@keyframes pf-rise { from { transform: translateY(40px); opacity: .4; } }
.pf-profile { position: relative; padding: 18px 18px 20px; border: 1px solid var(--line); border-top: 4px solid var(--sky-mid); border-radius: 14px; background: var(--white); }
.pf-profile[hidden] { display: none; }
.pf-close { float: right; min-height: 48px; font-size: 16px; margin: -6px -6px 6px 12px; padding: 0 16px; border: 1.5px solid #6B7785; border-radius: 999px; background: var(--white); font: 500 15px/1 'Outfit', Arial, sans-serif; color: var(--navy); cursor: pointer; }
.pf-close:hover { border-color: var(--navy); background: var(--sky-wash); }
.pf-eyebrow { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--sky); }
.pf-profile h3 { margin: 4px 0 0; font-size: 21px; line-height: 1.25; color: var(--navy); }
.pf-meta, .pf-zone, .pf-approval, .pf-renewal, .pf-note { font-size: 15px; line-height: 1.45; }
.pf-meta { margin: 6px 0 0; color: var(--ink-2); clear: both; }
.pf-zone { display: inline-block; margin: 12px 0 0; padding: 5px 12px; border-radius: 20px; font-weight: 500; color: var(--navy); }
.pf-zone.z-v { background: #ECE8F4; } .pf-zone.z-a { background: #E2ECF4; } .pf-zone.z-xs { background: #F6ECDF; } .pf-zone.z-x { background: #EFEDE8; }
.pf-mini { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: 15px; }
.pf-mini[hidden] { display: none; }
.pf-mini th { padding: 4px 6px 6px 0; font-size: 14px; font-weight: 500; color: var(--ink-2); text-align: left; border-bottom: 1px solid var(--line); }
.pf-mini td { padding: 7px 6px 7px 0; border-bottom: 1px solid var(--line); color: var(--navy); }
.pf-mini .num, .pf-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pf-gapv { color: var(--alert); font-weight: 600; }
.pf-muted { color: var(--ink-2); }
.pf-status { display: flex; align-items: baseline; margin: 14px 0 0; font-size: 16px; line-height: 1.4; font-weight: 500; color: var(--navy); }
.pf-approval, .pf-renewal { margin: 4px 0 0; color: var(--ink-2); }
.pf-renewal:empty { display: none; }
.pf-note { margin: 12px 0 0; color: var(--ink-2); }
.pf-note .text-link { display: inline; padding-bottom: 1px; }

/* Where the exposure sits: shown from a tablet up; on a phone the totals above the map carry it. */
.pf-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; }
@media (max-width: 640px) { .pf-card { display: none; } }
.pf-title { margin: 0; font-size: 17px; font-weight: 600; color: var(--navy); }
.pf-title span { font-weight: 400; color: var(--ink-2); }
.pf-sub { margin: 2px 0 0; font-size: 15px; color: var(--ink-2); }
.pf-bars { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.pf-bars li { display: grid; grid-template-columns: minmax(0, 132px) minmax(40px, 1fr) auto; align-items: center; gap: 10px; font-size: 15px; color: var(--navy); }
.pf-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-bar-track { height: 10px; border-radius: 5px; background: #EFEDE8; overflow: hidden; }
.pf-bar-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--sky); transition: width .3s; }
.pf-bar-val { font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-bars .pf-empty { display: block; color: var(--ink-2); }

/* The list of properties: the keyboard's way into every profile. */
.pf-tablewrap { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.pf-all { display: block; width: calc(100% - 24px); min-height: 48px; margin: 4px 12px 12px; border: 1.5px solid #B9C3CD; border-radius: 999px; background: var(--white); font: 500 16px/1 'Outfit', Arial, sans-serif; color: var(--navy); cursor: pointer; }
.pf-all:hover { border-color: var(--navy); background: var(--sky-wash); }
.pf-all[hidden] { display: none; }
.pf-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.4; }
.pf-table th { padding: 10px 12px; background: var(--warm); font-size: 14px; font-weight: 500; color: var(--ink-2); text-align: left; white-space: nowrap; }
.pf-table td { padding: 12px; border-top: 1px solid var(--line); vertical-align: top; color: var(--navy); }
.pf-table td b, .pf-table td small { display: block; }
.pf-table td b { font-size: 16px; font-weight: 600; }
.pf-table td small { font-size: 15px; color: var(--ink-2); }
.pf-st { display: flex; align-items: baseline; }
.pf-table td:first-child { min-width: 170px; }
.pf-table tbody tr { cursor: pointer; }
.pf-table tbody tr:hover, .pf-table tbody tr.is-selected { background: var(--sky-wash); }
.pf-table tbody tr:focus-visible { outline: 3px solid var(--navy); outline-offset: -3px; }
.pf-none { margin: 0; padding: 16px; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.pf-none[hidden] { display: none; }
.pf-none .pf-reset { margin-top: 10px; display: block; }
/* On a phone the list stacks into labelled rows instead of scrolling sideways. */
@media (max-width: 640px) {
  .pf-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pf-table, .pf-table tbody { display: block; }
  .pf-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 14px; border-top: 1px solid var(--line); }
  .pf-table tbody tr:first-child { border-top: 0; }
  .pf-table td { padding: 0; border: 0; }
  .pf-table td:first-child, .pf-table td:nth-child(4) { grid-column: 1 / -1; min-width: 0; }
  .pf-table td.num { text-align: left; font-weight: 500; }
  .pf-table td:nth-child(2)::before { content: "Required "; font-weight: 400; color: var(--ink-2); }
  .pf-table td:nth-child(3)::before { content: "Gap "; font-weight: 400; color: var(--ink-2); }
}
.pf-cap { margin-top: 14px; font-size: 15px; line-height: 1.5; color: var(--ink-3); }

/* ---------- Which loans it finds: four cards, two a row on a phone ---------- */
.pm-finds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 1081px) { .pm-finds { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
@media (max-width: 640px) {
  .pm-finds > li { padding: 16px 14px 18px; border-radius: 16px; }
  .pm-finds h3 { font-size: 18px; }
  .pm-finds p { margin-top: 6px; font-size: 15px; line-height: 1.45; }
  .pm-finds .v4-card-ic { margin-bottom: 10px; }
}
@media (max-width: 359px) { .pm-finds { grid-template-columns: minmax(0, 1fr); } }

/* ---------- The closing band: one line and two buttons ---------- */
.fc-end { background: var(--navy-deep); color: var(--white); padding: 72px 0; text-align: center; }
.fc-end h2 { max-width: 20em; margin-inline: auto; font-size: clamp(28px, 3.6vw, 44px); line-height: 1.1; letter-spacing: -.025em; font-weight: 700; color: var(--white); }
.fc-end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
@media (max-width: 640px) {
  .fc-end { padding: 44px 0; }
  .fc-end-actions { flex-direction: column; }
  .fc-end-actions .btn { justify-content: center; }
}

/* ---------- Windows high contrast (Edge): keep edges and marks visible ---------- */
@media (forced-colors: active) {
  .pf, .pf-kpis > div, .pf-profile, .pf-near, .pf-card, .pf-tablewrap, .pf-chip, .pf-all { border: 1px solid CanvasText; }
  .pf-chip[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .pf-pin::after, .pf-key, .pf-zones i, .pf-bar-track i { forced-color-adjust: none; }
}
