/* Directory styles (builder D). Screen only: print belongs to builder P. */
@media screen {
  /* Jost throughout on screen, including headings that style.css sets in Georgia. */
  .mark, h1, .intro-note p, .results-heading h2, .card h3, .empty h3, dialog h2, dialog h3, .template-number, .template-card h2, .working-header h2, .doc-title, .media-fallback > span:first-child, .booking-block h3, .map-popup b, .permit-card h2, .statewide-permits h2 { font-family: var(--ui); }
  dialog h2 { font-weight: 600; letter-spacing: -.01em; }

  /* Brand */
  .brand > span { display: block; }
  .brand-name { display: block; font: 600 19px/1.15 var(--ui); letter-spacing: .12em; white-space: nowrap; }
  .brand-dot { color: var(--neon); margin: 0 .1em; }
  .brand-product { letter-spacing: .03em; font-weight: 500; }
  .brand small { font: 400 13px/1.3 var(--ui); letter-spacing: .02em; margin-top: 3px; opacity: .9; }

  /* Compact intro so the first result sits high on the page. */
  .intro { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 8px 32px; padding: 18px 0 14px; margin: 0; border-bottom: 1px solid var(--rule); }
  .intro h1 { font: 600 30px/1.12 var(--ui); letter-spacing: -.01em; margin: 0 0 4px; }
  .intro > div > p { font-size: 16px; margin: 0; color: var(--soft); max-width: 64ch; }
  .intro .coverage-summary { display: block; border: 0; padding: 0; margin: 0; font-size: 14px; color: var(--soft); max-width: 460px; text-align: right; }
  .workspace { margin-top: 0; padding-top: 18px; }
  .narrow-only { display: none; }

  /* Search row: search, region and view on one line. */
  .search-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
  .search-row .search { flex: 1 1 320px; }
  .search-row .city-nav { margin: 0; padding: 0; border: 0; display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; overflow: visible; }
  .search-row .city-nav label { font-size: 15px; color: var(--soft); }
  .search-row .city-nav select { width: auto; min-width: 150px; height: 48px; min-height: 44px; background: transparent; border: 1px solid var(--rule); color: var(--ink); font-size: 16px; }
  .search-row > select { height: 48px; min-height: 44px; }
  .search-row .search { height: 48px; min-height: 48px; padding-top: 0; padding-bottom: 0; }
  .search-row .search input { padding: 0; height: 100%; }
  .project-row { padding: 10px 0; margin: 0; }
  .results-heading { padding: 10px 0; margin: 0 0 4px; }
  .results-heading h2 { font-size: 26px; }
  .results-heading > div:first-child { align-items: center; gap: 4px 14px; }
  .hub-clear { min-height: 44px; text-decoration: underline; text-underline-offset: 4px; font-size: 15px; padding: 0 4px; }
  .location-refine { margin: 10px 0; padding: 0 16px; }
  .location-refine summary { min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0; font-size: 16px; }
  .location-refine summary::after { float: none; }
  .facet-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end; gap: 12px; padding-bottom: 8px; }
  .facet-controls label { display: grid; gap: 4px; }
  .facet-controls label[hidden] { display: none; }
  .facet-controls select { min-height: 44px; }
  .location-refine .secondary { font-size: 14px; margin: 8px 0; }

  /* Result cards */
  #cards .hub-row { padding: 16px 0 14px; }
  .hub-row-meta { align-items: flex-start; }
  .hub-kind { font-size: 15px; line-height: 1.4; padding-top: 10px; }
  .hub-place { font-weight: 600; color: var(--ink); }
  .hub-badge { color: var(--ink); font-weight: 500; }
  .is-private .hub-badge { background: var(--neon); color: var(--night); padding: 1px 8px; }
  .hub-row h3 { font-size: 23px; margin: 2px 0 4px; }
  .hub-row h3 button { min-height: 44px; font-weight: 600; }
  .hub-row .description { font-size: 16px; margin: 0 0 6px; }
  .hub-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 8px 0 4px; }
  .hub-tags li { font-size: 14px; line-height: 1.3; padding: 4px 10px; border: 1px solid var(--rule); border-radius: 999px; background: var(--bg-f8f1e3,#f8f1e3); }
  .hub-tags .hub-status { background: var(--night); color: var(--cream); border-color: var(--night); }
  .hub-related { font-size: 14px; color: var(--soft); margin: 6px 0 0; }
  .hub-edit-note { font-size: 15px; }
  .hub-row-actions { gap: 6px 14px; margin-top: 8px; }
  .hub-row-actions button { min-height: 44px; }
  .hub-row-actions .quick, .hub-media-placeholder .quick { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--night); color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap; }
  .hub-row-actions .quick:hover, .hub-media-placeholder .quick:hover { background: var(--cream2); }
  .hub-row-actions span { font-size: 14px; }
  .hub-guide .hub-kind { padding-top: 0; }
  #hubMore { margin: 18px 0; min-height: 48px; padding: 0 20px; border: 1px solid var(--night); }

  /* Photos view */
  .hub-photos .hub-row { display: flex !important; flex-direction: column; }
  .hub-media-placeholder { display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; height: 180px; margin: 12px 0; padding: 16px; background: var(--cream2); border: 1px solid var(--rule); }
  .hub-media-placeholder p { margin: 0; font-size: 15px; color: var(--soft); }
  .hub-media-placeholder button { min-height: 44px; border: 1px solid var(--night); padding: 0 16px; }
  .commons-bar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 12px 16px; background: var(--cream2); border: 1px solid var(--rule); }
  .commons-bar p { margin: 0; font-size: 15px; }
  .commons-bar button { min-height: 44px; border: 1px solid var(--night); padding: 0 16px; }
  .commons-image { position: relative; width: 100%; }
  .commons-image img { display: block; width: 100%; height: 240px; object-fit: cover; background: var(--cream2); }
  #details .commons-image img { height: auto; max-height: 420px; object-fit: contain; }
  .commons-failed { margin: 0; padding: 14px 56px 14px 14px; background: var(--cream2); border: 1px solid var(--rule); font-size: 15px; min-height: 46px; }

  /* Record detail */
  #details { width: min(880px, calc(100vw - 32px)); padding: 26px 32px 32px; }
  .fb-edit-note { margin: 0 52px 14px 0; }
  .fb-head .eyebrow { margin: 0; color: var(--soft); font: 500 14px var(--ui); letter-spacing: .08em; text-transform: uppercase; }
  #details #detailTitle { font: 600 32px/1.12 var(--ui); margin: 6px 52px 6px 0; padding: 0; }
  .fb-place { margin: 0; font-size: 16px; color: var(--soft); }
  .fb-place b { color: var(--ink); font-weight: 600; }
  .fb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
  .fb-act { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--night); background: transparent; color: var(--ink); text-decoration: none; font: 500 16px/1.2 var(--ui); white-space: nowrap; }
  .fb-act:hover { background: var(--cream2); }
  .fb-act-primary { background: var(--night); color: var(--cream); }
  .fb-act-primary:hover { background: var(--bg-2a2433,#2a2433); }
  .fb-route-note { margin: 6px 0 0; font-size: 14px; }
  #details .detail-actions { margin: 12px 0 4px; gap: 8px; }
  #details .detail-actions button { min-height: 44px; padding: 0 16px; border: 1px solid var(--rule); background: transparent; }
  .fb-photos { margin: 14px 0; }
  .fb-photos[hidden] { display: none; }
  .fb-photos .hub-photo { margin: 0 0 12px; }
  .hosting-photo-omission { font-size: 15px !important; margin: 6px 0; }
  .fb-commons { margin: 8px 0 0; }
  .fb-commons .secondary { font-size: 14px; margin: 6px 0; }
  .fb-optin { display: flex !important; align-items: center; gap: 10px; min-height: 44px; font-size: 15px !important; font-weight: 400; margin: 0; }
  .fb-optin input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; }
  .fb-desc { font-size: 18px !important; line-height: 1.5; margin: 14px 0 10px; }
  .fb-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 10px 0; }
  .fb-chips li { font-size: 14px; line-height: 1.3; padding: 5px 11px; border: 1px solid var(--rule); border-radius: 999px; background: var(--bg-f8f1e3,#f8f1e3); }
  .fb-chips .fb-status { background: var(--night); color: var(--cream); border-color: var(--night); }
  .fb-chips .fb-look, .fb-chips .fb-role { border-color: var(--night); background: var(--bg-fff9ec,#fff9ec); font-weight: 500; }
  #details .detail-info { margin: 12px 0; padding: 10px 0; border-color: var(--rule); font-size: 15px; }
  #details .detail-info p { font-size: 15px; margin: 6px 0; }
  #details .detail-info:empty { display: none; }
  #details .booking-block { margin: 14px 0; padding: 14px 16px; background: var(--cream2); border-left: 3px solid var(--night); }
  #details .booking-block h3 { font: 600 18px var(--ui); margin: 0; }
  #details .booking-block p { font-size: 16px; margin: 6px 0 0; }
  .fb-block { border-top: 1px solid var(--rule); margin: 0; padding: 0; }
  .fb-block > summary { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 4px 0; font-size: 18px; font-weight: 600; }
  .fb-block > summary span { font-size: inherit; letter-spacing: 0; color: inherit; margin: 0; }
  .fb-block > summary .fb-block-title { font: 600 20px var(--ui); }
  .fb-block > summary .fb-count { font: 400 14px var(--ui); color: var(--soft); margin-left: auto; }
  .fb-block > summary::after { float: none; margin-left: 4px; }
  .fb-note { font-size: 14px !important; margin: 0 0 6px; }
  .fb-facts { margin: 0 0 14px; }
  .fb-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 2px 16px; padding: 10px 0; border-bottom: 1px solid var(--bd-dccfb8,#dccfb8); }
  .fb-row:last-child { border-bottom: 0; }
  .fb-row dt { font-weight: 600; font-size: 15px; }
  .fb-row dd { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
  .fb-src { display: block; font-size: 14px; color: var(--soft); margin-top: 2px; }
  .fb-src a { color: var(--ink); }
  .fb-unknown { font-weight: 600; color: var(--ink); }
  .is-unknown dd { color: var(--soft); }
  .fb-sun-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 6px; }
  .fb-sun-controls label { font-weight: 600; font-size: 15px; margin: 0; }
  .fb-sun-controls input { min-height: 44px; padding: 0 10px; font-size: 16px; }
  section.fb-block { padding: 6px 0 12px; }
  .fb-er h3 { font: 600 20px var(--ui); margin: 10px 0 10px; }
  .fb-er > p { font-size: 16px; }
  .fb-er-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
  .fb-er-list li { display: grid; gap: 3px; padding: 12px 14px; background: var(--cream2); font-size: 16px; }
  .fb-er-list .secondary { font-size: 14px; }
  .fb-er-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
  .fb-tag { font-size: 14px; padding: 1px 8px; border: 1px solid var(--night); margin-left: 6px; }
  .fb-rates { font-size: 16px !important; margin: 14px 0; padding: 12px 0; border-top: 1px solid var(--rule); }
  .fb-rates .secondary { font-size: 14px; }
  .fb-caveat { margin: 14px 0; }
  .fb-where p { font-size: 15px !important; margin: 8px 0; }
  .fb-sources { margin: 0 0 8px; padding-left: 20px; }
  .fb-sources li { font-size: 16px; margin: 6px 0; }
  .fb-related { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
  .fb-related button { min-height: 44px; text-align: left; }
  .fb-notes { margin-top: 16px; padding-top: 6px; border-top: 1px solid var(--rule); }
  .fb-notes .notes-label { font-size: 16px; }
  .fb-notes-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; }
  .fb-notes-row .note-save { margin: 0; min-height: 44px; }
  .fb-notes-row .secondary { font-size: 14px; }

  /* Permits: town cards, roads guide, emergency departments */
  .pg-section { margin: 36px 0 0; }
  .pg-section > h2 { font: 600 28px/1.15 var(--ui); margin: 0 0 6px; }
  .pg-section > p { font-size: 16px; margin: 0 0 14px; color: var(--soft); max-width: 72ch; }
  .pg-region { margin: 22px 0 0; }
  .pg-region > h3 { font: 600 20px var(--ui); margin: 0 0 10px; }
  .town-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 16px; }
  .town-card { background: var(--cream2); border: 1px solid var(--rule); padding: 18px 20px; scroll-margin-top: 100px; }
  .town-card h4 { font: 600 24px/1.15 var(--ui); margin: 4px 0 6px; }
  .town-card .eyebrow { margin: 0; }
  .pg-badge { display: inline-block; font-size: 14px; padding: 3px 10px; background: var(--night); color: var(--cream); margin: 4px 0 8px; }
  .pg-facts { margin: 8px 0; }
  .pg-facts > div { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
  .pg-facts dt { font-weight: 600; font-size: 15px; }
  .pg-facts dd { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
  .pg-facts dd a, .pg-src { font-size: 14px; }
  .pg-unknowns { margin: 10px 0 0; padding-left: 20px; }
  .pg-unknowns li { font-size: 15px; margin: 4px 0; }
  .pg-meta { font-size: 14px !important; color: var(--soft); margin: 10px 0 0; }
  .roads-guide { border: 1px solid var(--rule); padding: 18px 20px; scroll-margin-top: 100px; }
  .roads-guide details { border-top: 1px solid var(--rule); }
  .roads-guide summary { font-size: 17px; padding: 14px 0; }
  .roads-guide ol { margin: 0 0 10px; padding-left: 22px; }
  .roads-guide h3, .town-card p > b { font: 600 18px var(--ui); margin: 18px 0 6px; }
  .roads-guide ul { margin: 0; padding-left: 22px; }
  .roads-guide ul li { font-size: 16px; margin: 4px 0; }
  .roads-guide li { font-size: 16px; margin: 4px 0; }
  .er-guide { scroll-margin-top: 100px; }
  .er-guide .fb-er-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .er-guide h4 { font: 600 17px var(--ui); margin: 14px 0 8px; }

  /* Map popups */
  .map-pin-popup { display: grid; gap: 6px; min-width: 200px; }
  .map-pin-popup strong { font: 600 17px/1.25 var(--ui); }
  .map-pin-popup p { margin: 0; font-size: 15px; }
  .map-pin-popup .pin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
  .map-pin-popup button, .map-pin-popup a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--night); background: transparent; color: var(--ink); text-decoration: none; font: 500 15px var(--ui); }
  .pin-choices .pin-choice { display: grid; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
  .pin-choices .pin-choice span { font-size: 14px; color: var(--soft); }
  .pin-choices .pin-choice a { font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }
  #hubMapSelection .pin-precision { font-size: 15px; color: var(--soft); }
  #hubMapSelection a { display: inline-flex; align-items: center; min-height: 44px; margin-left: 12px; }
}

@media screen and (max-width: 1100px) {
  .facet-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (max-width: 760px) {
  .brand-name { font-size: 15px; letter-spacing: .08em; }
  .brand small { font-size: 12px; max-width: none; }
  .intro { display: block; padding: 14px 0 12px; }
  .intro h1 { font-size: 24px; }
  .intro > div > p { font-size: 15px; }
  .intro .coverage-summary { text-align: left; margin-top: 6px; font-size: 14px; }
  .workspace { padding-top: 12px; }
  .wide-only { display: none; }
  .narrow-only { display: inline; }
  .section-nav button { min-height: 48px; }
  .intro > div > p { display: none; }
  .search-row { gap: 8px; }
  .search-row .search { flex-basis: 100%; }
  .search-row .city-nav { flex: 1 1 140px; min-width: 0; }
  .search-row .city-nav label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .search-row .city-nav select { width: 100%; min-width: 0; }
  .search-row > select { flex: 1 1 140px; min-width: 0; max-width: none; font-size: 16px; }
  .project-row { padding: 4px 0; gap: 0 8px; }
  .project-row label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .project-row select { max-width: 52%; }
  .project-row .export { margin-left: 0; }
  .results-heading { padding: 8px 0; gap: 8px; }
  .results-heading > div:first-child { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
  .results-heading h2 { font-size: 22px; }
  .display-switch { width: 100%; }
  .display-switch button { flex: 1; }
  .facet-controls { grid-template-columns: 1fr; }
  .hub-row h3 { font-size: 21px; }
  .hub-kind { font-size: 14px; }
  .hub-photos { grid-template-columns: 1fr !important; }
  #details { padding: 20px 18px 24px; width: calc(100vw - 16px); max-width: none; max-height: calc(100dvh - 16px); }
  #details #detailTitle { font-size: 26px; }
  .fb-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .fb-act { white-space: normal; text-align: center; padding: 0 8px; font-size: 15px; }
  .fb-sun .fb-row { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; }
  .fb-sun .fb-row dd { text-align: right; }
  .hub-row-meta { display: flex !important; flex-direction: row; flex-wrap: nowrap; justify-content: space-between; gap: 8px; }
  .hub-row-meta .save { flex-shrink: 0; min-height: 44px; margin: -6px 0 0; padding: 8px 0 8px 8px; }
  .fb-act-primary { grid-column: 1 / -1; }
  .fb-row { grid-template-columns: 1fr; }
  .fb-desc { font-size: 17px !important; }
  .town-grid { grid-template-columns: 1fr; }
  .pg-facts > div { grid-template-columns: 1fr; }
  .er-guide .fb-er-list { grid-template-columns: 1fr; }
}
@media screen and (max-width: 360px) {
  .brand-name { font-size: 14px; letter-spacing: .06em; line-height: 1.2; }
  .brand-dot { display: none; }
  .brand-product { display: block; letter-spacing: .02em; }
  .brand small { font-size: 12px; margin-top: 1px; }
  .fb-actions { grid-template-columns: 1fr; }
}

/* Round 3 (builder D): shortlist tools, map legend and private pins, scout photos, ER rows, detail additions. Screen only. */
@media screen {
  .shortlist-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin: 4px 0 12px; padding: 12px 16px; background: var(--cream2); border: 1px solid var(--rule); }
  .shortlist-tools[hidden] { display: none; }
  .shortlist-tools label { display: grid; gap: 4px; font-size: 15px; font-weight: 600; flex: 1 1 180px; }
  .shortlist-tools select { min-height: 44px; font-size: 16px; font-weight: 400; width: 100%; }
  .shortlist-tools .secondary { flex: 1 1 100%; margin: 0; font-size: 14px; }

  .map-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 6px 0 0; font-size: 14px; color: var(--soft); }
  .map-legend[hidden], .map-legend [hidden] { display: none; }
  .map-legend .lg { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 4px; font-size: 14px; vertical-align: -5px; }
  .map-legend .lg-sourced { background: var(--night); color: var(--cream); border-radius: 50%; }
  .map-legend .lg-short { background: var(--bg-a64a2b,#a64a2b); color: var(--fg-ffffff,#fff); border-radius: 50%; font-size: 12px; }
  .map-legend .lg-mine { background: var(--bg-fff7e6,#fff7e6); color: var(--fg-8a3a1f,#8a3a1f); border: 2px dashed var(--bd-8a3a1f,#8a3a1f); transform: rotate(45deg); width: 16px; height: 16px; font-size: 0; }
  .field-pin.is-shortlisted { box-shadow: 0 0 0 3px var(--bd-a64a2b,#a64a2b), 0 1px 4px var(--bd-00000044,#0004); }
  .field-pin.is-shortlisted::after { content: '★'; position: absolute; top: -9px; right: -9px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--bg-a64a2b,#a64a2b); color: var(--fg-ffffff,#fff); font: 600 12px/1 var(--ui); }
  .field-pin.my-pin { background: var(--bg-fff7e6,#fff7e6); color: var(--fg-8a3a1f,#8a3a1f); border: 3px dashed var(--bd-8a3a1f,#8a3a1f); border-radius: 10px; transform-origin: center; font: 600 18px var(--ui); }
  .field-pin.my-pin.pin-group { border-style: dashed; border-width: 3px; font-size: 17px; }
  .my-pin-popup .pin-choice { grid-template-columns: minmax(0, 1fr); }
  .my-pin-popup .my-pin-name { font-size: 15px !important; color: var(--ink) !important; font-weight: 600; }
  .my-pin-popup button { display: block; min-height: 44px; margin: 4px 0 0 !important; width: auto !important; }
  #hubMapSelection .my-pin-line { color: var(--fg-8a3a1f,#8a3a1f); font-weight: 500; }

  .hub-scout-note { grid-column: 1 / -1; margin: 0; padding: 10px 16px; font-size: 15px; border-left: 3px solid var(--bd-8a3a1f,#8a3a1f); background: var(--bg-fff7e6,#fff7e6); }
  .hub-scout-photos { margin: 10px 0 4px; padding: 10px 12px; border: 1px dashed var(--bd-8a3a1f,#8a3a1f); background: var(--bg-fff7e6,#fff7e6); }
  .hub-scout-label { margin: 0 0 8px; font-size: 14px; }
  .hub-scout-photos ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .hub-scout-photos figure { margin: 0; }
  .hub-scout-photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--cream2); }
  .hub-scout-photos figcaption { font-size: 14px; line-height: 1.3; margin-top: 4px; overflow-wrap: anywhere; }
  .hub-scout-photos li.is-missing img { visibility: hidden; }

  .hub-er-row .secondary { font-size: 14px; margin: 4px 0 0; }

  .fb-act-from { flex-direction: column; line-height: 1.15; padding-top: 4px; padding-bottom: 4px; }
  .fb-act-from small { font-size: 14px; font-weight: 400; opacity: .9; }
  .fb-from { font-size: 14px; color: var(--soft); }
  .fb-sun-time { margin-top: 10px; }
  .fb-sun-at { font-size: 16px !important; font-weight: 500; margin: 4px 0 8px; }
  .fb-er-ranked { counter-reset: er; }
  .fb-er-distance { font-weight: 600; }
  .fb-er-list li > .fb-tag { justify-self: start; margin-left: 0; }
  .fb-permits p { margin: 8px 0 6px; }
  .fb-permit-links { display: flex; flex-wrap: wrap; gap: 8px; }
}
@media screen and (max-width: 760px) {
  .shortlist-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; padding: 10px 12px; }
  .shortlist-tools label { min-width: 0; }
  .shortlist-tools label:first-child, .shortlist-tools .secondary { grid-column: 1 / -1; }
  .hub-scout-photos ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fb-permit-links .fb-act { white-space: normal; }
}
@media screen {
  .fb-er-more { margin-top: 10px; }
  .fb-er-more > summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 16px; font-weight: 500; }
  .fb-er-more .fb-er-list { margin-top: 8px; }
  .fb-er-group { font: 600 16px var(--ui); margin: 16px 0 8px; }
  .fb-er-group:first-of-type { margin-top: 6px; }
}
/* Detail blocks below the first screen skip layout until scrolled near, so the dialog opens faster on phones.
   (Screen only. Off-screen block text is still in the accessibility tree and find-in-page; scripts should read textContent.) */
@media screen {
  #details .fb-block, #details .fb-where, #details .fb-rates, #details .fb-caveat { content-visibility: auto; contain-intrinsic-size: auto 280px; }
}

/* Round 4 (builder D): trauma centers, honest ER notes, town centres, My scout jump, serves badges, role gaps, lead time. */
@media screen {
  .fb-er-note { margin: 10px 0 4px; padding: 10px 14px; border-left: 4px solid var(--bd-a64a2b,#a64a2b); background: var(--bg-fff7e6,#fff7e6); font-size: 16px; }
  .fb-trauma { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--rule); }
  .fb-trauma > p.secondary { margin: 0 0 10px; }
  .fb-town-note { margin: 4px 0 10px; padding: 10px 14px; border: 2px solid var(--night); border-radius: 22px; background: transparent; font-size: 16px; }
  .fb-sun-from { align-self: center; }
  #details .detail-actions .fb-scout-jump { border-color: var(--night); font-weight: 500; }
  #details .detail-actions .fb-scout-jump[hidden] { display: none; }
  .fb-permits .secondary { margin: 8px 0 0; }
  /* Long application labels wrap instead of widening the Permits tab. */
  .town-card .fb-act, .pg-section .fb-act { white-space: normal; max-width: 100%; overflow-wrap: anywhere; text-align: left; justify-content: flex-start; padding-top: 8px; padding-bottom: 8px; }
  .town-card { min-width: 0; }
  .hub-serves { margin: 2px 0 8px; font-size: 15px; color: var(--soft); }
  .hub-serves b { color: var(--ink); font-weight: 600; }
  .hub-role-gap { margin: 0 0 16px; padding: 14px 18px; border: 1px solid var(--rule); border-left: 4px solid var(--night); background: var(--cream2); font-size: 16px; }
  .hub-role-gap p { margin: 0 0 6px; }
  .hub-role-gap p:last-child { margin-bottom: 0; }
  .hub-role-gap a { min-height: 44px; display: inline-flex; align-items: center; }
  .hub-lead { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
  .hub-lead li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 44px; padding: 4px 12px; border: 1px solid var(--bd-a64a2b,#a64a2b); background: var(--bg-fff7e6,#fff7e6); font-size: 15px; }
  .hub-lead a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; }
  .field-pin.town-pin { background: rgba(242, 232, 214, .55); color: var(--night); border: 4px solid var(--night); box-shadow: none; font: 600 16px var(--ui); }
  .field-pin.town-pin.pin-group { border-style: solid; border-width: 4px; }
  .map-legend .lg-town { border: 3px solid var(--night); border-radius: 50%; width: 18px; height: 18px; font-size: 0; }
  .town-pin-popup .pin-choice { grid-template-columns: minmax(0, 1fr); }
  .town-pin-popup button { display: block; min-height: 44px; margin: 4px 0 0 !important; width: auto !important; }
  #hubMapSelection .town-pin-line { font-weight: 500; }
  /* Round 5: street address match (US Census): a hollow square, distinct from the hollow town-centre circle. Never a venue pin. */
  .field-pin.addr-pin { background: rgba(255, 255, 255, .45); color: var(--fg-0b4f63,#0b4f63); border: 3px solid var(--bd-0b4f63,#0b4f63); border-radius: 4px; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .8); font: 600 16px var(--ui); }
  .field-pin.addr-pin.pin-group { border-width: 3px; }
  .map-legend .lg-addr { border: 3px solid var(--bd-0b4f63,#0b4f63); border-radius: 3px; width: 16px; height: 16px; font-size: 0; }
  .addr-pin-popup .pin-choice { grid-template-columns: minmax(0, 1fr); }
  .addr-pin-popup .my-pin-name { font-size: 15px !important; color: var(--ink) !important; }
  .addr-pin-popup button { display: block; min-height: 44px; margin: 4px 0 0 !important; width: auto !important; }
  #hubMapSelection .addr-pin-line { font-weight: 500; }
  .hub-map-tools { flex-wrap: wrap; gap: 8px 12px; align-items: center; }
  .hub-map-tools #hubMyPins[hidden], .hub-map-tools #hubMyPinsNote[hidden] { display: none; }
  .hub-map-tools #hubMyPinsNote { font-size: 14px; max-width: 420px; }
}

/* Round 5 (builder D): unranked town ERs, live refresh, pin line, address matches, checked-absent rows, matched chips, notes. */
@media screen {
  .fb-er-note.fb-er-unranked { border-left-color: var(--night); background: var(--cream2); margin-top: 0; }
  .fb-geo-updated { margin: 0 0 8px; padding: 8px 14px; border-left: 4px solid var(--bd-0b4f63,#0b4f63); background: var(--bg-eef6f6,#eef6f6); font-size: 16px; font-weight: 500; }
  .fb-address-note { border-radius: 4px; border-color: var(--bd-0b4f63,#0b4f63); }
  .fb-heading { margin: 10px 0 8px; padding: 10px 14px; border: 1px solid var(--rule); background: var(--cream2); }
  .fb-heading .fb-er-group { margin: 2px 0 8px; }
  .fb-heading p { margin: 0 0 6px; font-size: 16px; }
  .fb-heading p.secondary { font-size: 14px; margin-bottom: 0; }
  .fb-heading-pick select { min-height: 44px; font-size: 16px; padding: 0 8px; max-width: 100%; }
  .is-absent .fb-unknown { font-weight: 600; }
  .is-absent .fb-src a { display: inline-flex; align-items: center; min-height: 44px; }
  .hub-tags li.hub-match { background: var(--night); color: var(--cream); border-color: var(--night); }
  .hub-gap-links { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
  .hub-gap-links a { padding: 6px 0; line-height: 1.35; }
  .hub-gap-links li { margin: 0; font-size: 15px; }
  .hub-vocab-gap { margin: 0 0 16px; padding: 14px 18px; border: 1px solid var(--rule); border-left: 4px solid var(--bd-a64a2b,#a64a2b); background: var(--bg-fff7e6,#fff7e6); font-size: 16px; }
  .hub-vocab-gap p { margin: 0 0 6px; }
  .hub-vocab-gap p:last-child { margin-bottom: 0; }
}
@media screen and (max-width: 760px) {
  .fb-heading-pick { gap: 6px 10px; }
  .fb-heading-pick select { flex: 1 1 120px; }
}

/* Round 6 (builder D): a pin far from the place (review m2), the far-out ER note, a vendor row read from Staffing, look notes. */
@media screen {
  .fb-pin-warn { margin: 6px 0 10px; padding: 10px 14px; border-left: 4px solid var(--bd-a64a2b,#a64a2b); background: var(--bg-fff7e6,#fff7e6); font-size: 16px; }
  .fb-pin-warn b { font-weight: 600; }
  .fb-also-ask { display: block; margin-top: 4px; }
  .hub-look-gap { border-left-color: var(--bd-0b4f63,#0b4f63); }
}

/* Integration (c8): research prompts never print (round 6, producer 2 and 6). Printing an open record or comparison with
   Ctrl+P leaves the question cells blank; they stay on screen. */
@media print {
  .fb-row.is-unknown > dd, .cmp-ask, .cmp-ask + br + .cmp-link { visibility: hidden; }
  .cmp-absent-line { display: none; }
}

/* Final polish (c8): links in the Where row meet the 44px touch target on phones. */
.fb-where a { display: inline-flex; align-items: center; min-height: 44px; }
