/* School Explorer V2 — filters, carousel, profile (A2/A3). Scoped to .se-* + the
   container IDs the legacy bundle also targets (guarded by __wsSchoolV2). */

:root{
  --se-brand:#0e7a5f; --se-ink:#1c2622; --se-muted:#5f6f68; --se-line:#dbe4df;
  --se-soft:#e6f4ef; --se-bg:#f4f7f5; --se-accent:#1769aa;
  --se-good:#0e7a5f; --se-outstanding:#0b6e4f; --se-ri:#b7791f; --se-inadequate:#b3372c; --se-notrated:#8a948f;
}

/* ---------- Filters ---------- */
#schoolMapFilters{min-width:0}
.se-filters{display:flex;flex-direction:column;gap:10px;min-width:0}
.se-filter-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0}
.se-filter-label{font-size:12px;font-weight:600;color:var(--se-muted);min-width:48px;flex:none}
.se-pills{display:flex;gap:6px;flex-wrap:wrap;min-width:0}
.se-pill{appearance:none;border:1px solid var(--se-line);background:#fff;color:var(--se-ink);border-radius:999px;padding:6px 12px;font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap;min-height:38px}
.se-pill:hover{border-color:var(--se-brand);color:var(--se-brand)}
.se-pill.active{background:var(--se-brand);border-color:var(--se-brand);color:#fff}
.se-pill:focus-visible{outline:2px solid var(--se-accent);outline-offset:2px}

/* ---------- Carousel ---------- */
#schoolMapCarousel{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:6px;max-width:100%;-webkit-overflow-scrolling:touch}
#schoolMapCarousel::-webkit-scrollbar{height:6px}
#schoolMapCarousel::-webkit-scrollbar-thumb{background:var(--se-line);border-radius:999px}
.se-card{scroll-snap-align:start;border:1px solid var(--se-line);border-radius:12px;padding:14px;cursor:pointer;background:#fff;display:flex;flex-direction:column;min-width:0;flex:0 0 240px;text-align:left;font:inherit;color:inherit}
.se-card:hover{border-color:var(--se-brand)}
.se-card.selected{border-color:var(--se-brand);background:var(--se-soft);box-shadow:inset 0 0 0 2px var(--se-brand)}
.se-head{display:flex;flex-direction:column;align-items:flex-start;gap:3px;margin-bottom:4px;min-width:0}
.se-phase-badge{display:inline-block;font-size:11px;font-weight:700;color:var(--se-muted);background:var(--se-bg);border-radius:6px;padding:2px 7px;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.se-name{font-size:15px;font-weight:700;margin:0 0 4px;overflow-wrap:anywhere;color:#0b1c30}
.se-meta{font-size:12.5px;color:var(--se-muted);margin:0 0 6px}
.se-ofsted{display:inline-block;font-size:11.5px;font-weight:700;border-radius:6px;padding:2px 8px;margin:0 0 6px;width:fit-content;max-width:100%}
.se-ofsted--good{color:var(--se-good);background:#e6f4ef}
.se-ofsted--outstanding{color:var(--se-outstanding);background:#e2f3ec}
.se-ofsted--ri{color:var(--se-ri);background:#fdf3e2}
.se-ofsted--inadequate{color:var(--se-inadequate);background:#fbe9e7}
.se-ofsted--notrated{color:var(--se-notrated);background:#eef1ef}
.se-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto}
.se-dist{font-size:11px;font-weight:700;color:var(--se-brand);background:var(--se-soft);border-radius:999px;padding:2px 8px;white-space:nowrap}
.se-view{font-size:12px;font-weight:700;color:var(--se-accent);white-space:nowrap}
@media(max-width:559px){#schoolMapCarousel .se-card{flex:0 0 82%}}
@media(min-width:560px) and (max-width:899px){#schoolMapCarousel .se-card{flex:0 0 46%}}

/* ---------- Profile ---------- */
.se-profile-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:12px 14px;border-bottom:1px solid var(--se-line)}
.se-head-main{min-width:0;flex:1 1 auto}
.se-kicker{display:block;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--se-muted);margin:0 0 2px}
.se-profile-head h3{margin:0;font-size:18px;color:var(--se-ink)}
.se-head-sub{margin:2px 0 0;font-size:12.5px;color:var(--se-muted)}
.se-head-badges{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.se-head-badges span{font-size:11px;font-weight:700;color:#315344;background:#eef4f0;border-radius:8px;padding:2px 8px}
.se-head-actions{display:flex;align-items:center;gap:8px;flex:none}
.school-save-heart{appearance:none;border:1px solid var(--se-line);background:#fff;color:#b3372c;font-size:16px;line-height:1;width:34px;height:34px;border-radius:999px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.school-save-heart.saved{color:#b3372c;background:#fbe9e7;border-color:#e6b8b2}
.se-share{appearance:none;border:1px solid var(--se-line);background:#fff;color:var(--se-accent);font-weight:700;font-size:12.5px;border-radius:999px;padding:6px 12px;cursor:pointer;white-space:nowrap}
.se-share:hover{border-color:var(--se-accent)}
.se-retry{appearance:none;border:1px solid var(--se-line);background:#fff;color:var(--se-accent);font-weight:700;font-size:12.5px;border-radius:999px;padding:5px 12px;cursor:pointer}
.se-retry:hover{border-color:var(--se-accent)}
.se-profile-loading{padding:16px;color:var(--se-muted);font-size:13.5px}
.se-acc{border-top:1px solid var(--se-line)}
.se-acc>summary{padding:12px 14px;font-weight:600;font-size:14px;cursor:pointer;list-style:none;display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:44px;color:var(--se-ink);background:#eef1ef}
.se-acc[open]>summary{background:#e9f2f9;border-color:#cfe2f0}
.se-acc>summary::after{content:"+";font-size:18px;color:var(--se-muted);flex:none}
.se-acc[open]>summary::after{content:"–"}
.se-acc-body{padding:4px 14px 14px;font-size:13.5px}
.se-kv{display:grid;grid-template-columns:minmax(120px,170px) minmax(0,1fr);gap:5px 12px;margin:8px 0}
.se-kv dt{color:var(--se-muted);font-weight:600}
.se-kv dd{margin:0;min-width:0;overflow-wrap:anywhere}
.se-note{font-size:12.5px;color:var(--se-muted);background:var(--se-bg);border-radius:8px;padding:10px 12px;margin:10px 0}
.se-note--warn{background:#fdf3e2;color:#6b4a12}
.se-tag{display:inline-block;font-size:10.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:#7a3e00;background:#fdebd0;border-radius:6px;padding:2px 7px;margin-left:6px}
.se-unavailable{color:var(--se-muted);font-style:italic}
.se-grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.se-round{border:1px solid var(--se-line);border-radius:10px;padding:12px}
.se-round h4{margin:0 0 8px;font-size:14px}
.se-bar{height:8px;border-radius:999px;background:var(--se-line);overflow:hidden;margin:6px 0}
.se-bar span{display:block;height:100%;background:var(--se-brand)}
.se-link{color:var(--se-accent);font-weight:600;text-decoration:none}
.se-link:hover{text-decoration:underline}
.se-reco{display:inline-block;font-size:10px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:#087a3c;background:#e9f6ee;border-radius:5px;padding:2px 7px}
.se-p8{display:inline-block;font-size:11.5px;color:var(--se-muted)}
.se-pressure{display:inline-block;font-size:11.5px;color:var(--se-muted)}
.se-pc{display:inline-block;font-size:11.5px;color:var(--se-muted)}
.se-extras{display:flex;flex-wrap:wrap;gap:2px 10px;margin-top:6px}
.se-subhead{font-size:12px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--se-muted);margin:12px 0 4px}
.se-table-wrap{overflow-x:auto;margin:8px 0}
.se-table{border-collapse:collapse;width:100%;font-size:12.5px}
.se-table th,.se-table td{border:1px solid var(--se-line);padding:5px 8px;text-align:left;white-space:nowrap}
.se-table th{background:var(--se-bg);font-weight:600}
.se-muted{color:var(--se-muted);font-style:italic}
@media(max-width:560px){.se-grid2{grid-template-columns:1fr}.se-kv{grid-template-columns:1fr}}

/* ---------- AreaWise Picks (restored) ---------- */
#schoolTopPicks,#schoolDrawerPicks{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
#schoolTopPicks>.tp-head,#schoolDrawerPicks>.tp-head{flex:0 0 100%}
.tp-head{display:block;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:var(--se-muted);margin:0}
.tp-chip{display:flex;flex-direction:column;gap:1px;padding:7px 12px;border:1px solid var(--se-line);border-radius:999px;background:#fff;cursor:pointer;text-align:left;font:inherit;color:inherit;flex:0 0 auto;white-space:nowrap}
.tp-chip:hover{border-color:var(--se-brand)}
.tp-chip b{font-size:12px;font-weight:800;color:var(--se-brand)}
.tp-chip span{font-size:12.5px;color:var(--se-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ---------- Map markers (restored selection sync) ---------- */
.se-marker{background:transparent;border:none}
.se-marker .se-marker-dot{display:block;width:100%;height:100%;border-radius:999px;background:var(--se-accent);border:2px solid #fff;box-shadow:0 1px 3px rgba(0,0,0,.4)}
.se-marker--selected .se-marker-dot{background:var(--se-brand);box-shadow:0 0 0 2px var(--se-brand),0 1px 4px rgba(0,0,0,.5)}
.se-marker-popup b{display:block;font-size:13px;color:var(--se-ink)}
.se-marker-popup span{display:block;font-size:12px;color:var(--se-muted)}
.se-marker-popup small{display:block;font-size:11.5px;color:var(--se-brand);font-weight:700;margin-top:2px}
.se-marker-rec{display:inline-block;font-size:10px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:#0b5c3f;background:#dcf2e7;border-radius:5px;padding:1px 6px;margin-top:2px}

/* ---------- Ofsted summary + Parent View (richer detail) ---------- */
.ofsted-summary{border:1px solid var(--se-line);border-radius:10px;padding:12px 14px;margin:8px 0}
.ofsted-summary-head{display:flex;flex-direction:column;gap:4px;margin-bottom:10px}
.ofsted-summary-head .area-kicker{font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--se-muted)}
.ofsted-summary-head>strong{font-size:15px}
.ofsted-summary-head>span{font-size:12px;color:var(--se-muted)}
.school-facts{display:flex;flex-direction:column;gap:4px}
.school-fact{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:13.5px;padding:4px 0;border-bottom:1px solid var(--se-bg)}
.school-fact>span{color:var(--se-muted);font-weight:600}
.school-fact>strong{background:transparent;padding:0;border-radius:0;margin:0;font-weight:700}
.pv-questions{display:flex;flex-direction:column;gap:14px;margin:10px 0}
.pv-question>b{display:block;font-size:13px;font-weight:600;color:var(--se-ink);margin-bottom:5px}
.pv-row{display:flex;align-items:center;gap:8px;font-size:12px;margin-bottom:4px}
.pv-option{flex:0 0 128px;color:var(--se-muted)}
.pv-track{flex:1 1 auto;height:8px;background:var(--se-bg);border-radius:999px;overflow:hidden}
.pv-fill{height:100%;background:var(--se-brand);border-radius:999px}
.pv-pct{flex:0 0 42px;text-align:right;color:var(--se-ink);font-weight:600}
@media(max-width:560px){.pv-option{flex:0 0 104px}.pv-pct{flex:0 0 36px}}

/* ---------- Mobile: filters live in the drawer, not over the map (P1) ---------- */
@media(max-width:800px){
  #schoolMapFilters{display:none}
}

/* ---------- Blank-space fix: sidebar tracks content, not the map height (P1) ---------- */
@media (min-width:1101px) {
  body.ws-schools-active .schools-layout-shell > .school-explorer-side {
    align-self: start !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
}
