:root { --blue:#1d4ed8; --green:#047857; --orange:#f97316; --red:#dc2626; --gray:#475569; --bg:#f8fafc; --sidebar-width:330px; }
    body { margin:0; font-family: Arial, sans-serif; color:#0f172a; background:var(--bg); }
    .layout { display:grid; grid-template-columns:var(--sidebar-width) 7px minmax(0,1fr); height:100vh; }
    .sidebar { min-width:0; overflow:auto; padding:0; background:white; border-right:1px solid #e2e8f0; }
    .sidebar-header{position:sticky;top:0;z-index:20;background:white;padding:12px 14px;border-bottom:1px solid #e2e8f0}.sidebar-body{padding:0 14px 18px}.top-row{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.section-card{border:1px solid #e2e8f0;border-radius:12px;padding:11px;margin-top:10px;background:#fff}.section-card>summary{cursor:pointer;font-weight:bold;list-style:none}.section-card>summary::-webkit-details-marker{display:none}.section-card>summary:after{content:"▾";float:right;color:#64748b}.section-card:not([open])>summary:after{content:"▸"}.layer-note{padding:8px;border-radius:9px;background:#eff6ff;font-size:12px;margin-top:7px}.analysis-tabs{display:grid;grid-template-columns:1fr;gap:6px;margin:8px 0}.analysis-tabs button{width:100%;text-align:left;background:#334155}.analysis-panel{display:none;border-top:1px solid #e2e8f0;padding-top:9px;margin-top:8px}.analysis-panel.active{display:block}.results-panel{display:none;margin-top:8px;max-height:300px;overflow:auto}.map-layer-control{background:white;padding:9px 10px;border-radius:10px;box-shadow:0 1px 7px rgba(0,0,0,.25);font-size:12px;line-height:1.7}.map-layer-control label{display:block;font-weight:normal}.map-layer-control input{width:auto;margin:0 5px 0 0}.floating-panel,.floating-panel.right{position:static!important;left:auto!important;right:auto!important;bottom:auto!important;width:auto!important;max-height:300px!important;box-shadow:none!important;border-radius:10px!important;padding:8px!important}
    #map { min-width:0; height:100vh; }
    .sidebar-resizer { position:relative; z-index:2500; width:7px; cursor:col-resize; touch-action:none; background:#f1f5f9; border-left:1px solid #e2e8f0; border-right:1px solid #cbd5e1; box-sizing:border-box; }
    .sidebar-resizer:after { content:""; position:absolute; top:0; bottom:0; left:2px; width:2px; background:#94a3b8; opacity:.45; }
    .sidebar-resizer:hover, .sidebar-resizer.dragging { background:#dbeafe; border-color:#60a5fa; }
    .sidebar-resizer:hover:after, .sidebar-resizer.dragging:after { background:#2563eb; opacity:1; }
    body.sidebar-resizing { cursor:col-resize; user-select:none; }
    body.sidebar-resizing * { cursor:col-resize!important; }
    h1 { font-size:20px; margin:0 0 6px; }
    .small { color:#64748b; font-size:12px; line-height:1.4; }
    .cards { display:grid; grid-template-columns:1fr; gap:6px; margin:10px 0; }
    .card { background:#f8fafc; border:1px solid #e2e8f0; border-radius:11px; padding:8px 9px; }
    .summary-card { min-width:0; }
    .summary-card-title { font-size:12px; font-weight:700; line-height:1.2; margin-bottom:3px; }
    .summary-card-values { display:flex; align-items:baseline; flex-wrap:wrap; gap:2px 4px; font-size:10px; line-height:1.25; color:#475569; }
    .summary-card-values span { white-space:nowrap; }
    .summary-card-values b { display:inline; margin:0; font-size:15px; color:#0f172a; }
    .summary-card-separator { color:#94a3b8; }
    .summary-card.unicef { border-left:3px solid #1d4ed8; }
    .summary-card.total { border-left:3px solid #334155; background:#f1f5f9; }
    .section { border-top:1px solid #e2e8f0; padding-top:14px; margin-top:14px; }
    label { font-size:12px; color:#334155; font-weight:bold; }
    input, select { width:100%; box-sizing:border-box; padding:9px; margin:5px 0 8px; border:1px solid #cbd5e1; border-radius:10px; }
    input[type='range'] { padding:0; }
    input[type='checkbox'] { width:auto; margin-right:6px; }
    .inline-control { display:block; margin:7px 0; font-size:13px; }
    button, .linkbtn { display:inline-block; border:0; border-radius:10px; padding:9px 11px; margin:3px 3px 3px 0; cursor:pointer; background:#0f172a; color:white; text-decoration:none; font-size:13px; }
    button.secondary { background:#334155; }
    button.orange { background:var(--orange); }
    .legend { line-height:1.8; font-size:13px; }
    .dot { display:inline-block; width:11px; height:11px; border-radius:50%; margin-right:6px; }
    .table { width:100%; border-collapse:collapse; font-size:12px; }
    .table th, .table td { border-bottom:1px solid #e2e8f0; padding:6px; text-align:left; }
    .pill { display:inline-block; border-radius:999px; padding:2px 7px; background:#e2e8f0; font-size:11px; }
    .popup-title { font-weight:bold; font-size:14px; margin-bottom:5px; }
    .popup-row { margin:2px 0; }


    .map-display-box {
      margin: 12px 0 14px;
      padding: 10px 12px;
      border: 2px solid var(--orange);
      border-radius: 12px;
      background: #fff7ed;
      font-size: 13px;
    }
    .map-display-box label {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 0;
      font-size: 13px;
      color: #0f172a;
      cursor: pointer;
    }
    .map-display-box input[type='checkbox'] {
      width: auto;
      margin: 0;
    }
    .lc-name-label {
      background: rgba(255,255,255,0.95);
      border: 1px solid #94a3b8;
      border-radius: 5px;
      color: #0f172a;
      font-size: 11px;
      font-weight: bold;
      padding: 2px 5px;
      box-shadow: 0 1px 4px rgba(15,23,42,0.25);
      white-space: nowrap;
    }
    .lc-name-label::before {
      display: none;
    }

    .filtered-summary-box {
      position: static;
      background: rgba(255,255,255,0.96);
      border: 1px solid #cbd5e1;
      border-radius: 14px;
      box-shadow: 0 10px 25px rgba(15,23,42,0.18);
      padding: 10px 12px;
      min-width: 155px;
      font-size: 13px;
      line-height: 1.6;
    }
    .filtered-summary-box .summary-title {
      font-weight: bold;
      margin-bottom: 4px;
      color: #0f172a;
    }
    .filtered-summary-box .summary-row {
      display: flex;
      justify-content: space-between;
      gap: 10px;
    }
    .filtered-summary-box .summary-value { font-weight: bold; }
    .active-filters-box { position:sticky; top:112px; z-index:18; margin:10px 0; padding:10px; border:1px solid #bfdbfe; border-radius:12px; background:#f8fbff; box-shadow:0 2px 8px rgba(15,23,42,.08); }
    .active-filters-title { display:flex; justify-content:space-between; gap:8px; align-items:center; font-weight:bold; margin-bottom:6px; }
    .visible-count-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:6px; margin-bottom:7px; }
    .visible-count-item { background:white; border:1px solid #dbeafe; border-radius:8px; padding:6px; text-align:center; font-size:11px; }
    .visible-count-item b { display:block; font-size:16px; margin-top:2px; }
    .filter-chips { display:flex; flex-wrap:wrap; gap:5px; margin-top:5px; }
    .filter-chip { border:1px solid #cbd5e1; background:#fff; color:#334155; border-radius:999px; padding:4px 8px; margin:0; font-size:11px; }
    .filter-chip:hover { background:#fee2e2; border-color:#fca5a5; }
    .no-filter-note { color:#64748b; font-size:12px; }
    .subsection-title { margin:9px 0 3px; font-size:12px; font-weight:bold; color:#0f172a; }
    .outdated-notice { display:none; margin:8px 0; padding:9px; border:1px solid #f59e0b; border-radius:10px; background:#fffbeb; color:#92400e; font-size:12px; line-height:1.4; }
    .outdated-notice button { padding:5px 8px; margin-top:6px; }
    .scope-note { margin-top:7px; padding:7px 8px; border-radius:9px; background:#f8fafc; border:1px solid #e2e8f0; color:#475569; font-size:12px; line-height:1.4; }
    .source-actions { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:8px; }
    .status-message { font-size:12px; font-weight:bold; margin-top:5px; min-height:16px; }
    .status-success { color:#047857; } .status-error { color:#b91c1c; } .status-loading { color:#a16207; }
    .search-wrap { position:relative; }
    .school-search-input-wrap { position:relative; }
    .search-results { display:none; position:absolute; left:0; right:0; top:calc(100% - 4px); max-height:240px; overflow:auto; background:white; border:1px solid #cbd5e1; border-radius:10px; box-shadow:0 8px 24px rgba(15,23,42,.18); z-index:2500; }
    .search-result-item { padding:8px 10px; border-bottom:1px solid #e2e8f0; cursor:pointer; font-size:12px; }
    .search-result-item:hover { background:#eff6ff; }
    .search-result-name { font-weight:bold; }
    .search-result-meta { color:#64748b; margin-top:2px; }
    .search-mode-tabs { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin:8px 0 10px; }
    .search-mode-tabs button { margin:0; background:#e2e8f0; color:#334155; font-weight:bold; }
    .search-mode-tabs button.active { background:#0f172a; color:#fff; }
    .search-mode-panel { display:none; }
    .search-mode-panel.active { display:block; }
    .selected-origin-card { display:none; margin:8px 0; padding:9px 10px; border:1px solid #bfdbfe; border-radius:10px; background:#eff6ff; }
    .selected-origin-card .origin-title { font-weight:bold; color:#1e3a8a; margin-bottom:2px; }
    .selected-origin-card .origin-meta { font-size:12px; color:#475569; }
    .radius-row { display:grid; grid-template-columns:1fr 74px; gap:7px; align-items:center; }
    .radius-unit { padding:9px; margin:5px 0 8px; border:1px solid #cbd5e1; border-radius:10px; background:#f8fafc; text-align:center; font-size:13px; }
    .search-help { margin:-3px 0 8px; color:#64748b; font-size:12px; line-height:1.4; }
    .search-actions { display:flex; flex-wrap:wrap; gap:5px; }
    .search-actions button { margin:0; }
    .two-column { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
    .floating-panel { display:none; position:fixed; z-index:2200; left:398px; bottom:18px; width:min(760px, calc(100vw - 430px)); max-height:320px; overflow:auto; background:white; border:1px solid #cbd5e1; border-radius:14px; box-shadow:0 12px 30px rgba(15,23,42,.25); padding:10px; }
    .floating-panel.right { left:auto; right:190px; width:min(650px, calc(100vw - 600px)); }
    .map-results-panel { display:none; position:fixed; z-index:2400; left:calc(var(--sidebar-width) + 30px); right:190px; bottom:18px; max-height:360px; overflow:auto; background:rgba(255,255,255,.98); border:1px solid #cbd5e1; border-radius:14px; box-shadow:0 12px 32px rgba(15,23,42,.28); padding:10px; }
    .map-results-panel .panel-header { position:sticky; top:-10px; z-index:2; background:rgba(255,255,255,.98); padding:6px 0 8px; }
    .map-results-meta { color:#475569; font-size:12px; line-height:1.5; margin-top:3px; }
    .panel-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:5px; }
    .panel-actions button { margin:0; }
    .panel-header { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:8px; }
    .panel-title { font-weight:bold; }
    .results-table { width:100%; border-collapse:collapse; font-size:12px; min-width:620px; }
    .results-table th, .results-table td { border:1px solid #e2e8f0; padding:5px 6px; text-align:left; vertical-align:top; }
    .results-table th { position:sticky; top:0; background:#f8fafc; }
    .busy-overlay { display:none; position:fixed; inset:0; z-index:6000; background:rgba(255,255,255,.82); align-items:center; justify-content:center; }
    .busy-box { background:white; border:1px solid #cbd5e1; border-radius:14px; box-shadow:0 12px 30px rgba(15,23,42,.2); padding:18px 24px; text-align:center; min-width:260px; }
    .busy-spinner { width:34px; height:34px; margin:0 auto 10px; border:4px solid #dbeafe; border-top-color:#2563eb; border-radius:50%; animation:spin .8s linear infinite; }
    @keyframes spin { to { transform:rotate(360deg); } }
    @media (max-width: 900px) {
      .layout { grid-template-columns:1fr; }
      .sidebar { height:45vh; }
      .sidebar-resizer { display:none; }
      #map { height:55vh; }
      .floating-panel, .floating-panel.right { left:10px; right:10px; bottom:10px; width:auto; max-height:40vh; }
      .map-results-panel { left:10px; right:10px; bottom:10px; max-height:42vh; }
    }



/* Editable UNICEF geo-block plans */
.geo-block-main-actions, .geo-block-editor-actions, .geo-block-popup-actions { display:flex; flex-wrap:wrap; gap:5px; }
.geo-block-main-actions button, .geo-block-editor-actions button, .geo-block-popup-actions button { margin:0; }
.geo-block-popup-actions { margin-top:8px; }
.geo-block-popup-actions button { padding:5px 7px; font-size:10px; }
.geo-block-empty { padding:9px; border:1px dashed #cbd5e1; border-radius:8px; background:#f8fafc; color:#64748b; font-size:10px; text-align:center; }
.geo-block-plan-editor { margin-top:10px; padding:9px; border:1px solid #c4b5fd; border-radius:11px; background:#fafaff; }
.geo-block-editor-title { margin-bottom:8px; }
.geo-block-editor-title b, .geo-block-editor-title small { display:block; }
.geo-block-editor-title b { color:#4c1d95; font-size:12px; }
.geo-block-editor-title small { margin-top:2px; color:#6d28d9; font-size:9px; }
.geo-block-add-school { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px; align-items:end; margin:8px 0; }
.geo-block-add-school label { margin:0; }
.geo-block-add-school button { margin:0; }
.geo-block-editor-heading { margin:10px 0 6px; color:#334155; font-size:11px; font-weight:800; }
.geo-block-plan-schools { display:grid; gap:7px; }
.geo-block-school-card { padding:8px; border:1px solid #dbe3ee; border-radius:9px; background:#fff; }
.geo-block-school-head { display:flex; justify-content:space-between; gap:8px; align-items:flex-start; }
.geo-block-school-head b, .geo-block-school-head small { display:block; }
.geo-block-school-head b { color:#0f172a; font-size:11px; }
.geo-block-school-head small { margin-top:2px; color:#64748b; font-size:9px; }
.geo-block-school-head button { margin:0; padding:5px 7px; font-size:9px; }
.geo-block-grade-spans { display:flex; flex-wrap:wrap; gap:8px 14px; margin:6px 0; color:#475569; font-size:9px; }
.geo-block-grade-checks { display:grid; grid-template-columns:repeat(auto-fit,minmax(52px,1fr)); gap:4px; }
.geo-block-grade-checks label { display:flex; align-items:center; justify-content:center; gap:4px; margin:0; padding:5px 3px; border:1px solid #e2e8f0; border-radius:6px; background:#f8fafc; color:#475569; font-size:10px; cursor:pointer; }
.geo-block-grade-checks label.selected { border-color:#8b5cf6; background:#ede9fe; color:#5b21b6; font-weight:800; }
.geo-block-grade-checks input { width:auto; margin:0; }
.geo-block-missing-grades { margin:9px 0 4px; padding:8px; border:1px solid #fecaca; border-radius:8px; background:#fef2f2; color:#b91c1c; font-size:11px; font-weight:800; line-height:1.4; }
.geo-block-notes-label { display:block; margin-top:10px; }
.geo-block-notes-label textarea { display:block; width:100%; min-height:72px; box-sizing:border-box; margin-top:5px; padding:9px; border:1px solid #cbd5e1; border-radius:10px; font:inherit; resize:vertical; }
.geo-block-editor-actions { margin-top:9px; padding-top:8px; border-top:1px solid #ddd6fe; }
button.danger { background:#fff; border-color:#fecaca; color:#b91c1c; }

@media (max-width:760px) {
  .geo-block-add-school { grid-template-columns:1fr; }
  .geo-block-grade-checks { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
.geo-block-membership-badge { display:inline-block; margin-left:4px; padding:2px 5px; border-radius:999px; background:#dcfce7; color:#166534; font-size:8px; vertical-align:middle; }
.geo-block-removed-schools { margin-top:7px; padding:7px; border:1px solid #fecaca; border-radius:9px; background:#fff7f7; }
.geo-block-removed-title { margin-bottom:5px; color:#991b1b; font-size:10px; font-weight:800; }
.geo-block-removed-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px; align-items:center; padding:5px 0; border-bottom:1px solid #fee2e2; }
.geo-block-removed-row:last-child { border-bottom:0; }
.geo-block-removed-row b, .geo-block-removed-row small { display:block; }
.geo-block-removed-row b { font-size:9px; }
.geo-block-removed-row small { margin-top:2px; color:#7f1d1d; font-size:8px; }
.geo-block-removed-row button { margin:0; padding:4px 6px; font-size:8px; }


.geo-block-school-autocomplete { position:relative; }
.geo-block-school-autocomplete input { margin-bottom:0; }
.geo-block-school-autocomplete-results { display:none; position:absolute; left:0; right:0; top:calc(100% + 2px); z-index:2700; max-height:230px; overflow:auto; background:#fff; border:1px solid #cbd5e1; border-radius:10px; box-shadow:0 10px 26px rgba(15,23,42,.2); }
.geo-block-school-autocomplete-item { display:block; width:100%; margin:0; padding:8px 10px; border-radius:0; border-bottom:1px solid #e2e8f0; background:#fff; color:#0f172a; text-align:left; }
.geo-block-school-autocomplete-item:last-child { border-bottom:0; }
.geo-block-school-autocomplete-item:hover, .geo-block-school-autocomplete-item.active { background:#eff6ff; }
.geo-block-school-autocomplete-item b, .geo-block-school-autocomplete-item small { display:block; }
.geo-block-school-autocomplete-item small { margin-top:2px; color:#64748b; font-size:11px; }
.geo-block-school-autocomplete-empty { padding:9px 10px; color:#64748b; font-size:12px; }


/* Capacity overlay and students-by-grade sidebar */
.student-breakdown-title{font-weight:800;font-size:15px;margin:7px 0 3px;color:#0f172a}
.student-breakdown-totals{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:9px 0}
.student-breakdown-totals span{display:flex;flex-direction:column;padding:7px 8px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;font-size:11px;color:#475569}
.student-breakdown-totals b{font-size:15px;color:#0f172a;margin-bottom:2px}
.student-breakdown-table{margin:7px 0 9px}
.student-breakdown-table td:not(:first-child),.student-breakdown-table th:not(:first-child){text-align:right}
.student-breakdown-total td{background:#f1f5f9;border-top:2px solid #cbd5e1}
@media(max-width:520px){.student-breakdown-totals{grid-template-columns:1fr}}

.student-breakdown-warning{margin:7px 0;padding:8px 9px;border:1px solid #fed7aa;border-radius:8px;background:#fff7ed;color:#9a3412;font-size:11px;line-height:1.4}

/* Staff details sidebar */
.staff-details-totals{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:9px 0}
.staff-details-totals span{display:flex;flex-direction:column;padding:7px 8px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;font-size:11px;color:#475569}
.staff-details-totals b{font-size:15px;color:#0f172a;margin-bottom:2px}
.staff-details-table td:last-child,.staff-details-table th:last-child{text-align:right}
.staff-details-contact{margin:7px 0;padding:8px;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc;font-size:12px;line-height:1.45}
@media(max-width:520px){.staff-details-totals{grid-template-columns:1fr}}
