/* Shared expanded-detail geometry. Community and School consume one shell contract. */
:root{--map-detail-shell-max:1360px;--map-detail-content-max:1280px;--map-detail-sidebar:clamp(420px,28vw,1080px);--map-detail-sidebar-half:clamp(210px,14vw,540px);--map-detail-map-gap:8px;--map-detail-workspace-edge:10px;--map-detail-edge:16px;--map-detail-top:90px;--map-detail-bottom:16px}
.school-profile-expanded-loading{display:grid;place-items:center;min-height:320px;color:#69736d;font-size:16px;font-weight:750}
@media(min-width:761px){
  .community-map-profile.expanded,
  .school-map-profile.expanded,
  .ddf-expanded-panel,
  .ddf-expanded-panel__lazy{
    position:fixed!important;
    inset:var(--map-detail-top) auto var(--map-detail-bottom) calc(50vw + var(--map-detail-sidebar-half) + 4px)!important;
    width:min(var(--map-detail-shell-max),calc(100vw - var(--map-detail-sidebar) - var(--map-detail-map-gap) - (var(--map-detail-workspace-edge) * 2) - (var(--map-detail-edge) * 2)))!important;
    height:auto!important;
    max-height:none!important;
    padding:28px!important;
    overflow:auto!important;
    transform:none;
    translate:-50% 0!important;
  }
  .community-map-profile.expanded>.community-expanded-overview,
  .community-map-profile.expanded>.community-expanded-content,
  .school-map-profile.expanded .school-detail-view.embedded{
    width:100%!important;
    max-width:var(--map-detail-content-max)!important;
    margin-inline:auto!important;
  }
}
@media(max-width:760px){
  .community-map-profile.expanded,
  .school-map-profile.expanded,
  .ddf-expanded-panel,
  .ddf-expanded-panel__lazy{
    position:fixed!important;
    inset:78px 8px 8px!important;
    width:auto!important;
    height:auto!important;
    max-height:none!important;
    padding:18px!important;
    overflow:auto!important;
    transform:none;
    translate:none!important;
  }
}

/* Listings use the shared geometry, but keep their own fixed header and scroll body. */
.ddf-expanded-panel,.ddf-expanded-panel__lazy{padding:0!important;overflow:hidden!important}

/* Community detail keeps the expanded card inside the map workspace. */
@media(min-width:1001px){
  .community-map-profile.expanded{
    max-height:calc(100dvh - 106px)!important;
  }
  .community-map-profile.expanded .community-expanded-overview{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    gap:28px!important;
  }
  .community-map-profile.expanded .community-expanded-identity{min-height:0!important}
  .community-map-profile.expanded .community-expanded-overview .community-map-island{height:100%;min-height:480px}
  .community-map-profile.expanded .community-six-axis-body{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr)!important;gap:16px!important}
  .community-map-profile.expanded .community-six-axis-card .community-radar{width:min(100%,230px)!important;max-width:230px!important;margin-inline:auto!important}
  .community-map-profile.expanded .community-six-axis-facts{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}

/* A direct /community/:key page keeps the map visible behind its expanded card. */
.community-single-page{height:calc(100dvh - 70px)!important;min-height:700px!important;padding:8px 10px 10px!important;overflow:hidden!important}
.community-single-page>.community-directory-shell{display:block!important;height:100%!important}
.community-single-page>.community-directory-shell>.school-directory-list{display:none!important}
.community-single-page>.community-directory-shell>.community-directory-map{position:relative!important;height:100%!important;min-height:0!important;overflow:hidden!important}
.community-single-page .community-layer-toolbar,.community-single-page .community-directory-legend{display:none!important}
.community-single-page .community-map-profile.expanded{position:fixed!important;inset:90px 24px 18px!important;left:50%!important;right:auto!important;width:min(1440px,calc(100vw - 48px))!important;height:auto!important;max-height:none!important;margin:0!important;padding:32px!important;overflow:auto!important;transform:none;translate:-50% 0!important}
@media(max-width:1000px){.community-single-page{padding:6px 8px 8px!important;min-height:560px!important}.community-single-page .community-map-profile.expanded{inset:78px 8px 8px!important;left:8px!important;right:8px!important;width:auto!important;transform:none;padding:20px!important}}

/* Desktop designated-school cards read as compact horizontal cards, not loose stacks. */
@media(min-width:1001px){
  .community-map-profile.expanded .community-expanded-schools{grid-template-columns:minmax(0,1fr)!important;gap:12px}
  .community-school-card-compact{
    display:grid;
    grid-template-columns:minmax(190px,1.15fr) minmax(240px,1.35fr) minmax(130px,.75fr);
    align-items:center;
    gap:12px;
    padding:12px 14px;
  }
  .community-school-card-compact>header{display:grid;grid-template-columns:26px minmax(0,1fr) auto;align-items:center;gap:8px}
  .community-school-card-compact h4{margin:2px 0;font-size:17px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .community-school-card-compact .school-card-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0;min-width:0}
  .community-school-card-compact .school-card-metrics>div{display:flex;align-items:baseline;gap:4px;min-width:0;padding:0;border:0;background:transparent}
  .community-school-card-compact .school-card-metrics span{flex:0 0 auto;font-size:9px!important;white-space:nowrap}
  .community-school-card-compact .school-card-metrics strong{min-width:0;font-size:14px!important;white-space:nowrap}
  .community-school-card-compact .community-school-card-action-row{display:flex;align-items:center;justify-content:flex-end;gap:6px;margin:0}
  .community-school-card-compact .community-school-card-action-row .relationship-card-tags{display:flex;flex:0 1 auto;flex-wrap:nowrap;gap:4px;overflow:hidden}
  .community-school-card-compact .community-school-card-action-row .relationship-card-tags span{flex:0 0 auto;padding:4px 6px;font-size:10px;white-space:nowrap}
  .community-school-card-compact .community-school-card-action-row .relationship-card-detail{flex:0 0 auto;min-height:32px;padding:0 8px;font-size:10px}
}
/* Give the expanded community profile enough room for its six-axis radar. */
@media(min-width:1001px){.community-map-profile.expanded .community-expanded-overview{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:24px!important}.community-map-profile.expanded .community-six-axis-body{grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr)!important;gap:20px!important}.community-map-profile.expanded .community-six-axis-card .community-radar{width:360px!important;max-width:360px!important;height:300px!important}.community-map-profile.expanded .community-six-axis-card .community-radar svg{left:50px;top:20px;width:260px;height:260px}.community-map-profile.expanded .community-six-axis-card .community-radar span{font-size:13px}.community-map-profile.expanded .community-six-axis-card .community-radar span b{font-size:12px}.community-map-profile.expanded .community-six-axis-card .community-radar .axis-0{left:145px;top:0}.community-map-profile.expanded .community-six-axis-card .community-radar .axis-1{right:0;top:72px}.community-map-profile.expanded .community-six-axis-card .community-radar .axis-2{right:0;bottom:42px}.community-map-profile.expanded .community-six-axis-card .community-radar .axis-3{left:145px;bottom:0}.community-map-profile.expanded .community-six-axis-card .community-radar .axis-4{left:0;bottom:42px}.community-map-profile.expanded .community-six-axis-card .community-radar .axis-5{left:0;top:72px}}

/* A direct community URL owns the viewport. The expanded profile is the only scroll surface. */
html:has(.community-single-page),html:has(.community-detail-route),body:has(.community-single-page),body.community-detail-route{height:100%!important;overflow:hidden!important;overscroll-behavior:none}
.community-page-shell:has(.community-single-page) main,.community-page-shell.community-detail-route main{height:calc(100dvh - 70px)!important;min-height:0!important;overflow:hidden!important}
.community-single-page{box-sizing:border-box!important;height:calc(100dvh - 70px)!important;min-height:0!important;overflow:hidden!important}
