/* CORALIS — Coral Health Environmental Assessment
   Uses the existing CORALIS deep-ocean visual language. */
:root{
    --ch-bg:#071d2b;--ch-deep:#041520;--ch-surface:#0d2938;--ch-soft:#123443;
    --ch-cyan:#26c6c8;--ch-cyan-light:#83e5df;--ch-teal:#0d9295;
    --ch-white:#f5fbff;--ch-text:#c7dce3;--ch-muted:#91aab5;
    --ch-border:rgba(131,229,223,.14);--ch-success:#54d6a0;
    --ch-warning:#e7b95d;--ch-danger:#f07878;--ch-radius:16px;
    --ch-shadow:0 18px 45px rgba(0,0,0,.18);
    --ch-font:Arial,Helvetica,sans-serif;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;min-height:100vh;background:radial-gradient(circle at 85% 5%,rgba(20,112,124,.13),transparent 30%),var(--ch-bg);color:var(--ch-white);font-family:var(--ch-font);line-height:1.6}
button,select{font:inherit}
.ch-header{min-height:76px;padding:11px 5%;display:flex;align-items:center;justify-content:space-between;gap:20px;position:sticky;top:0;z-index:1000;background:rgba(5,27,40,.94);backdrop-filter:blur(18px);border-bottom:1px solid var(--ch-border)}
.ch-brand{display:flex;align-items:center;gap:12px;color:var(--ch-white);text-decoration:none;font-size:20px;font-weight:800;letter-spacing:1.6px}
.ch-brand img{width:47px;height:47px;object-fit:contain;border-radius:8px}
.ch-nav{display:flex;gap:22px;flex-wrap:wrap}
.ch-nav a{color:var(--ch-cyan-light);font-size:13px;font-weight:700;text-decoration:none}
.ch-nav a:hover{color:#fff}
.ch-main{width:min(1500px,92%);margin:0 auto;padding:42px 0 70px}
.ch-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:28px}
.eyebrow{margin:0 0 8px;color:var(--ch-cyan-light);font-size:10px;font-weight:800;letter-spacing:2.1px}
.ch-heading h1{margin:0 0 12px;font-size:clamp(27px,4vw,39px);line-height:1.2;letter-spacing:-1px}
.ch-intro{max-width:780px;margin:0;color:var(--ch-muted);font-size:14px;line-height:1.8}
.ch-location{white-space:nowrap;color:var(--ch-cyan-light);font-size:11px;font-weight:800;letter-spacing:1px}
.location-dot,.data-badge span{display:inline-block;width:7px;height:7px;margin-right:7px;border-radius:50%;background:var(--ch-success);box-shadow:0 0 12px rgba(84,214,160,.6)}
.ch-filter-panel{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap;padding:19px 21px;margin-bottom:20px;background:rgba(13,41,56,.92);border:1px solid var(--ch-border);border-radius:var(--ch-radius);box-shadow:var(--ch-shadow)}
.filter-title{min-width:180px;margin-right:auto}
.filter-title strong{display:block;font-size:15px}
.ch-filter-panel label{display:flex;flex-direction:column;gap:6px;min-width:145px}
.ch-filter-panel label span{color:var(--ch-muted);font-size:11px;font-weight:700}
.ch-filter-panel select{min-height:40px;padding:8px 34px 8px 11px;color:var(--ch-white);background:#061e2c;border:1px solid rgba(131,229,223,.24);border-radius:8px;outline:none}
.ch-filter-panel select:focus{border-color:var(--ch-cyan);box-shadow:0 0 0 3px rgba(38,198,200,.12)}
.period-select{min-width:190px!important}
.period-status{width:100%;color:var(--ch-muted);font-size:11px}
.ch-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:28px}
.ch-kpi{padding:18px 20px;background:linear-gradient(145deg,rgba(20,57,73,.96),rgba(12,43,58,.98));border:1px solid var(--ch-border);border-radius:14px;box-shadow:var(--ch-shadow)}
.ch-kpi span{display:block;color:var(--ch-muted);font-size:12px}
.ch-kpi strong{display:block;margin:5px 0;color:var(--ch-cyan);font-size:27px;line-height:1.3}
.ch-kpi small{color:#7896a3;font-size:10px}
.ch-section-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:14px}
.ch-section-heading h2,.ch-panel h2{margin:0;font-size:20px;letter-spacing:-.3px}
.data-badge{color:var(--ch-muted);font-size:11px;white-space:nowrap}
.ch-map-layout{display:grid;grid-template-columns:minmax(0,1fr) 315px;gap:16px}
.ch-map-card,.ch-side-panel,.ch-panel{min-width:0;background:linear-gradient(145deg,rgba(20,57,73,.96),rgba(12,43,58,.98));border:1px solid var(--ch-border);border-radius:var(--ch-radius);box-shadow:var(--ch-shadow)}
.ch-map-card{overflow:hidden}
#coralHealthMap{width:100%;height:610px;background:#d8e8e9}
.map-footnote{padding:10px 14px;color:var(--ch-muted);font-size:10px;background:rgba(4,24,36,.65);border-top:1px solid var(--ch-border)}
.ch-side-panel{padding:19px 18px}
.side-block+.side-block{margin-top:22px;padding-top:19px;border-top:1px solid var(--ch-border)}
.side-block h3{margin:0 0 13px;font-size:15px}
.layer-toggle{display:flex;align-items:center;gap:10px;padding:10px 0;cursor:pointer}
.layer-toggle input{accent-color:var(--ch-cyan);width:15px;height:15px}
.layer-toggle>span:last-child{display:flex;flex-direction:column}
.layer-toggle strong{font-size:12px}
.layer-toggle small{color:var(--ch-muted);font-size:10px}
.layer-swatch{width:13px;height:13px;flex:0 0 13px;border-radius:3px}
.coral-swatch{background:#12d6c5;border:1px solid #e7fffb}
.sst-swatch{background:#2b83ba}.chl-swatch{background:#d95f59}
.feature-info{font-size:11px;color:var(--ch-text)}
.empty-state{padding:13px;background:rgba(4,24,36,.55);border:1px dashed var(--ch-border);border-radius:9px;color:var(--ch-muted);line-height:1.7}
.feature-title{margin-bottom:9px;color:var(--ch-cyan-light);font-weight:800;font-size:12px}
.feature-row{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:1px solid rgba(131,229,223,.09)}
.feature-row span{color:var(--ch-muted)}
.feature-row strong{text-align:right;color:var(--ch-white);font-weight:700}
.profile-detail{margin-top:10px;padding:10px;background:rgba(4,24,36,.55);border-radius:8px}
.profile-detail b{display:block;margin-bottom:5px;color:var(--ch-cyan-light)}
.grid-legend{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.legend-item{display:flex;align-items:center;gap:7px;color:var(--ch-text);font-size:10px}
.legend-color{width:12px;height:12px;border-radius:3px}
.legend-note{margin:11px 0 0;color:var(--ch-muted);font-size:10px;line-height:1.7}
.ch-analysis-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:20px}
.ch-panel{padding:22px}
.panel-description{margin:8px 0 16px;color:var(--ch-muted);font-size:11px}
.distribution-list{display:grid;gap:10px}
.distribution-row{display:grid;grid-template-columns:75px minmax(0,1fr) 38px;align-items:center;gap:9px;font-size:11px}
.distribution-row .class-label{color:var(--ch-text)}
.bar-track{height:9px;background:rgba(4,24,36,.8);border-radius:20px;overflow:hidden}
.bar-fill{height:100%;border-radius:20px}
.distribution-row .count{text-align:right;color:var(--ch-cyan-light);font-variant-numeric:tabular-nums}
.ch-method{margin-top:20px}
.method-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:17px}
.method-grid>div{padding:15px;background:rgba(4,24,36,.5);border:1px solid rgba(131,229,223,.08);border-radius:10px}
.method-grid strong{color:var(--ch-cyan-light);font-size:12px}
.method-grid p{margin:7px 0 0;color:var(--ch-muted);font-size:11px;line-height:1.8}
.ch-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.ch-button{padding:11px 16px;border-radius:8px;font-size:11px;font-weight:800;cursor:pointer;transition:.2s}
.ch-button.primary{color:#04232d;background:var(--ch-cyan)}
.ch-button.secondary{color:var(--ch-cyan-light);background:transparent;border:1px solid var(--ch-border)}
.ch-button:hover{transform:translateY(-1px);filter:brightness(1.08)}
.export-status{min-height:16px;color:var(--ch-muted);font-size:10px}
.ch-footer{padding:27px 20px;background:rgba(3,21,32,.9);border-top:1px solid var(--ch-border);color:#7896a3;font-size:11px;line-height:1.8;text-align:center}
.leaflet-container{font-family:Arial,Helvetica,sans-serif}
.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#0d2938;color:#f5fbff}
.leaflet-popup-content{font-size:11px;line-height:1.6}
.leaflet-control-layers{background:rgba(13,41,56,.95);color:#f5fbff;border:1px solid rgba(131,229,223,.2)}
@media(max-width:1100px){.ch-map-layout{grid-template-columns:1fr}.ch-side-panel{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.side-block+.side-block{margin:0;padding:0;border:0}.ch-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.ch-main{width:93%;padding:28px 0 50px}.ch-header{padding:10px 4%;align-items:flex-start}.ch-brand{font-size:16px}.ch-brand img{width:39px;height:39px}.ch-nav{gap:10px;justify-content:flex-end}.ch-nav a{font-size:10px}.ch-heading{display:block}.ch-location{margin-top:15px}.ch-filter-panel{align-items:stretch}.filter-title{width:100%}.ch-filter-panel label{flex:1;min-width:calc(50% - 10px)}.period-select{min-width:100%!important}.ch-kpis{gap:9px}.ch-kpi{padding:13px}.ch-kpi strong{font-size:22px}.ch-section-heading{align-items:flex-start;flex-direction:column}.ch-section-heading h2,.ch-panel h2{font-size:17px}#coralHealthMap{height:480px}.ch-side-panel{display:block}.side-block+.side-block{margin-top:18px;padding-top:17px;border-top:1px solid var(--ch-border)}.ch-analysis-grid,.method-grid{grid-template-columns:1fr}.ch-panel{padding:17px}}
