/* The surrounding dialog stays fixed while each tab has its own reading area. */
#detail.detail-workspace {
  --detail-ink: #123849;
  --detail-teal: #007f88;
  --detail-line: #d7e2e7;
  width: min(1460px, calc(100vw - 64px));
  height: min(920px, calc(100dvh - 60px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid #cbd9df;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  color: var(--detail-ink);
}
#detail.detail-workspace[open] {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: "head head" "tabs tabs" "map reading";
}
#detail::backdrop { background: rgb(10 37 53 / 55%); }
#detail .detail-heading {
  grid-area: head;
  position: static;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 19px 25px 17px;
  border: 0;
  border-top: 4px solid #04adc1;
  background: #fff;
}
#detail .detail-identity-symbol {
  flex: 0 0 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid #bee0e3;
  border-radius: 10px;
  background: #edf8f7;
  color: var(--detail-teal);
}
#detail .detail-identity-symbol svg { width: 28px; height: 28px; }
#detail :is(.detail-heading,.detail-tabs,#detail-map-options > summary) svg {
  fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round;
}
#detail .detail-identity { flex: 1; min-width: 0; }
#detail #detail-eyebrow { color: #387282; font-size: .68rem; font-weight: 750; letter-spacing: .105em; }
#detail #detail-title { color: var(--detail-ink); font-size: clamp(1.45rem, 2.2vw, 2rem); line-height: 1.1; margin: 3px 0 4px; letter-spacing: -.04em; overflow-wrap: anywhere; }
#detail #detail-address { color: #506675; font-size: .88rem; line-height: 1.3; margin: 0; }
#detail #detail-close { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--detail-line); background: white; color: var(--detail-ink); flex: none; }
#detail #detail-close svg { height: 19px; width: 19px; }
#detail .detail-tabs {
  grid-area: tabs;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-inline: 23px;
  background: #fbfcfd;
  border-block: 1px solid var(--detail-line);
  white-space: nowrap;
}
#detail .detail-tabs button {
  display: inline-flex; align-items: center; justify-content: center; flex: none; gap: 8px;
  min-height: 47px; padding: 9px 13px 8px; border: 0; border-bottom: 3px solid transparent;
  border-radius: 0; background: transparent; color: #4a6372; font-size: .88rem; font-weight: 650;
}
#detail .detail-tabs button svg { width: 17px; height: 17px; }
#detail .detail-tabs button[aria-selected=true] { border-color: var(--detail-teal); color: #006d79; background: #e7f4f4; }
#detail .detail-tabs button:hover { color: #006d79; background-color: #edf5f5; }
#detail .detail-tabs [hidden], #detail [role=tabpanel][hidden] { display: none; }
#detail :is(.detail-tabs button, #detail-close, #detail-fit-map, #detail-map-options > summary):focus-visible {
  outline: 2px solid #0b8797; outline-offset: -3px;
}
#detail .detail-geography {
  grid-area: map; position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-right: 1px solid var(--detail-line);
  background: #f3f7f8;
  min-height: 0; min-width: 0;
}
#detail .detail-map-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 15px; min-height: 48px; background: #fff; }
#detail .detail-map-heading h3 { flex: 1; margin: 0; font-size: .99rem; color: var(--detail-ink); }
#detail #detail-fit-map { color: #006d79; padding: 6px 3px; font-size: .82rem; }
#detail .detail-map-wrapper { position: relative; min-height: 0; border: 0; border-block: 1px solid var(--detail-line); border-radius: 0; overflow: hidden; }
#detail #detail-environment-map { width: 100%; height: 100%; }
#detail #detail-map-options {
  z-index: 450; margin: 0; padding: 0; flex: none;
  background: #fff; border: 1px solid #c3d3da; border-radius: 6px;
  box-shadow: none;
}
#detail #detail-map-options > summary {
  display: flex; align-items: center; gap: 7px; color: var(--detail-ink); padding: 8px 11px; min-height: 36px;
  list-style: none; cursor: pointer; font-weight: 650; font-size: .82rem; margin: 0;
}
#detail #detail-map-options > summary::-webkit-details-marker { display: none; }
#detail #detail-map-options > summary::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: -3px 1px 0 4px; }
#detail #detail-map-options[open] > summary::after { transform: rotate(225deg); margin-top: 3px; }
#detail #detail-map-options svg { width: 17px; height: 17px; }
#detail .detail-map-options-body {
  position: absolute; right: 9px; top: 48px; z-index: 450; width: min(330px, calc(100% - 18px)); max-height: calc(100% - 68px);
  padding: 10px 12px; border: 1px solid var(--detail-line); border-radius: 6px; background: white; box-shadow: 0 2px 8px #173a4b25; overflow: auto; overscroll-behavior: contain;
}
#detail #detail-poi-count { margin: 0; padding: 9px 18px; font-size: .77rem; line-height: 1.35; color: #405c6a; background: #fff; }
#detail #detail-reading {
  grid-area: reading; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable;
  min-height: 0; min-width: 0; padding: clamp(16px,2.1vw,30px); background: #fff;
}
#detail [role=tabpanel] { min-width: 0; }
#detail [role=tabpanel]:focus-visible { outline: 2px solid var(--detail-teal); outline-offset: -2px; }
#detail .detail-panel-title, #detail #detail-reading .insights-title { font-size: 1.26rem; font-weight: 700; color: var(--detail-ink); letter-spacing: -.025em; margin: 0 0 16px; }
#detail #detail-score-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin: 0 0 16px; border: 1px solid var(--detail-line); background: #f8fafb; border-radius: 7px; overflow: hidden; }
#detail #detail-score-strip > div { padding: 15px 11px; gap: 6px; border-top: 0; min-width: 0; }
#detail #detail-score-strip > div:first-child { color: white; background: var(--detail-ink); }
#detail #detail-score-strip span { font-size: .76rem; line-height: 1.2; }
#detail #detail-score-strip small { font-size: .72rem; line-height: 1.25; }
#detail #detail-score-strip strong { color: var(--detail-ink); font-size: clamp(1.35rem,2.1vw,2.1rem); line-height: 1.03; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#detail #detail-score-strip > div:first-child strong { color: white; }
#detail #detail-score-strip > div:last-child strong { color: var(--detail-teal); }
#detail #detail-headline { margin: 0 0 23px; padding: 11px 14px; background: #edf6f6; border: 0; border-left: 3px solid #0b8893; border-radius: 0 4px 4px 0; font-size: .88rem; line-height: 1.5; color: #244b58; }
#detail #detail-overview h3 { margin: 0 0 10px; font-size: 1.05rem; letter-spacing: -.012em; }
#detail #detail-info { display: grid; grid-template-columns: minmax(8rem,.85fr) minmax(0,1.3fr); margin: 0; gap: 0; font-size: .875rem; }
#detail #detail-info dt, #detail #detail-info dd { margin: 0; padding: 9px 0; border-bottom: 1px solid #e6ecef; }
#detail #detail-info dd { font-weight: 550; overflow-wrap: anywhere; }
#detail #detail-comparison-actions:not(:empty) { padding-top: 14px; }
#detail #detail-pois { max-height: none; overflow: visible; }
#detail :is(#dimensions-section,#detail-insights) { margin-top: 0; padding-top: 0; border: 0; }
#detail #detail-reading .insights-grid, #detail #detail-reading .insights-demography-grid { grid-template-columns: minmax(0,1fr); }
#detail #detail-reading .insights-eyebrow { color: #437682; }
#detail #detail-reading .review-section { margin: 0; }
#detail .detail-map-options-body .map-context-legends:empty { display: none; }
@media(max-width:850px) {
  #detail.detail-workspace { width: calc(100vw - 24px); height: calc(100dvh - 24px); }
  #detail.detail-workspace[open] { grid-template-columns: minmax(0,.8fr) minmax(0,1fr); }
  #detail #detail-score-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #detail #detail-score-strip > div:nth-child(n+3) { border-top: 1px solid var(--detail-line); }
  #detail .detail-tabs { padding-inline: 10px; }
  #detail .detail-tabs button { padding-inline: 9px; }
}
@media(max-width:650px) {
  #detail.detail-workspace { width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  #detail.detail-workspace[open] { grid-template-columns: minmax(0,1fr); grid-template-rows: auto clamp(140px,28dvh,290px) auto minmax(0,1fr); grid-template-areas: "head" "map" "tabs" "reading"; }
  #detail .detail-heading { padding: 9px 13px; gap: 9px; border-top-width: 3px; }
  #detail .detail-identity-symbol { flex-basis: 34px; height: 34px; border-radius: 7px; }
  #detail .detail-identity-symbol svg { width: 21px; height: 21px; }
  #detail #detail-title { font-size: 1.22rem; margin: 1px 0; line-height: 1.14; }
  #detail #detail-address { font-size: .77rem; }
  #detail .detail-geography { border-right: 0; grid-template-rows: auto minmax(0,1fr) auto; }
  #detail .detail-map-heading { min-height: 35px; padding: 2px 9px; gap: 8px; }
  #detail #detail-environment-title { font-size: .85rem; }
  #detail #detail-map-options > summary { min-height: 29px; font-size: .74rem; padding: 3px 7px; }
  #detail .detail-map-options-body { top: 34px; max-height: calc(100% - 41px); }
  #detail #detail-poi-count { padding: 4px 11px; font-size: .73rem; }
  #detail #detail-fit-map { min-height: 30px; padding: 4px; }
  #detail .detail-tabs { padding-inline: 5px; gap: 0; scrollbar-width: thin; }
  #detail .detail-tabs button { min-height: 43px; padding-inline: 10px; gap: 5px; font-size: .82rem; }
  #detail .detail-tabs button svg { width: 15px; height: 15px; }
  #detail #detail-reading { padding: 17px 15px 25px; }
  #detail #detail-score-strip > div { padding: 10px; gap: 4px; }
  #detail .detail-panel-title { margin-bottom: 11px; font-size: 1.13rem; }
}
@media(max-height:520px) and (max-width:650px) {
  #detail.detail-workspace[open] { grid-template-rows: auto minmax(82px,23dvh) auto minmax(0,1fr); }
}
