/* Existing AFFM selector, extended in place. */
#controls.affm-layer-selector{width:286px!important;max-width:calc(100vw - 84px);padding:0!important;background:rgba(255,255,255,.96);opacity:1!important;border:1px solid #c4d1c2;border-radius:8px;box-shadow:0 2px 10px #183d2420;overflow:hidden;right:16px!important;left:auto!important;}
.affm-layer-tabs{display:flex;align-items:center;gap:2px;padding:2px 6px;border-bottom:1px solid #dce5d9;background:#f1f6ee;}
.affm-layer-tabs button{border:0;background:transparent;color:#28533a;font:600 14px/1.25 Arial,sans-serif;min-height:38px;padding:8px 10px;border-radius:5px;cursor:pointer;}
.affm-layer-tabs button[aria-selected=true]{background:#fff;box-shadow:0 1px 3px #21453224;}
.affm-layer-tabs #affm-alert-tab{color:#ad2d26;white-space:nowrap;}
.affm-layer-tabs #affm-selector-collapse{margin-left:auto;font-size:19px;min-width:38px;padding:4px;}
.affm-layer-tabs button:focus-visible,.affm-alert-body input:focus-visible{outline:2px solid #28533a;outline-offset:2px;}
.affm-layer-body{min-height:0;flex:0 1 auto;overflow-y:auto;overscroll-behavior:contain;padding:12px 13px 10px;scrollbar-width:thin;}
.affm-layer-body[hidden],.affm-layer-tabs button[hidden]{display:none!important;}
#controls.affm-layer-selector .camp-filter-toggle{display:none!important;}
.affm-layer-selector .camp-filter-body{display:block!important;}
.affm-layer-selector .camp-filter-header{display:block!important;}
.affm-layer-selector h4:empty{display:none;}
.affm-layer-selector .checkbox{margin:5px 0;}
.affm-layer-selector .checkbox label{padding-top:5px;padding-bottom:5px;line-height:1.3;}
.affm-layer-selector .checkbox input{margin-top:3px;}
.affm-alert-body{font-size:13px;line-height:1.45;color:#294836;}
/* Match the sidecar National Importance card's orange theme and rounded border. */
.affm-alert-card{border:1px solid #ecd3b8;border-left:4px solid #a65c20;border-radius:8px;background:rgba(255,237,224,.75);padding:0 9px 10px;}
.affm-alert-card+.affm-alert-card{margin-top:12px;}
.affm-alert-card:has(.affm-alert-layer-toggle input:not(:checked)){padding-bottom:0;}
.affm-alert-body p{margin:7px 0;}
.affm-alert-body .muted{color:#637366;font-size:11px;line-height:1.45;}
.affm-time-options{display:flex;gap:3px;margin:10px 0;}
.affm-time-options label{flex:1;position:relative;text-align:center;cursor:pointer;font-size:12px;margin:0;}
.affm-time-options input{position:absolute;opacity:0;}
.affm-time-options span{display:block;padding:8px 3px;border:1px solid #c6d3c3;border-radius:5px;white-space:nowrap;}
.affm-time-options input:checked+span{background:#2c6845;color:white;border-color:#2c6845;}
.affm-time-options input:focus-visible+span{outline:2px solid #bc6b1c;outline-offset:2px;}
.affm-alert-body select{width:auto;max-width:100%;border:1px solid #c6d3c3;border-radius:4px;background:white;padding:6px;color:#294836;}
.affm-alert-row{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.affm-heat-scale{height:9px;border-radius:3px;margin-top:10px;}
.affm-scale-labels{display:flex;justify-content:space-between;font-size:10px;}
.affm-layer-tabs [role=tablist]{display:flex;flex-wrap:nowrap;}
.affm-hsf-link{display:block;margin:5px 0 2px;}
.affm-hsf-link img{display:block;max-width:100%;width:100%;height:auto;}
.affm-source-state{color:#84551d;font-size:11px;padding:6px 12px;border-top:1px solid #eee2cd;background:#fff9ee;}
.affm-source-state:empty{display:none;}
.affm-alert-body a{color:#275d3d;text-decoration:underline;}
.affm-food-scale{background:linear-gradient(to right,#fff1db,#b05a1c);background:linear-gradient(to right in srgb,#fff1db,#b05a1c);height:8px;border-radius:3px;}
.affm-preview-states{position:fixed;bottom:8px;left:50%;transform:translateX(-50%);z-index:1005;background:#fff9e9;color:#745223;border:1px solid #decba2;border-radius:5px;padding:5px 8px;font:11px Arial;box-shadow:0 1px 5px #0002;}
.affm-preview-states summary{cursor:pointer;}
.affm-preview-states select{display:block;margin-top:6px;max-width:230px;}
#controls.affm-collapsed .affm-layer-body{display:none!important;}
#main-nav{flex-wrap:wrap;}
#main-nav a{white-space:nowrap;}
@media(max-width:1050px){#main-nav{gap:0;}#main-nav a{font-size:12px;padding-left:10px;padding-right:10px;}}
@media(max-width:760px){#controls.affm-layer-selector{right:9px!important;max-width:calc(100vw - 70px);width:270px!important;}.affm-layer-tabs button{min-height:42px;}.affm-preview-states{left:8px;transform:none;bottom:48px;max-width:190px;}#main-nav a{font-size:14px;}}
@media(max-width:760px){body #controls.affm-layer-selector:not(.camp-filters-open),body #controls.affm-layer-selector.camp-filters-open{width:270px!important;}#controls.affm-layer-selector .camp-filter-header .full-label{display:inline!important;}#controls.affm-layer-selector .camp-filter-header .short-label{display:none!important;}#controls.affm-layer-selector .camp-filter-header{display:block!important;}}

.affm-heat-scale + .affm-scale-labels{position:relative;height:16px;display:block;}.affm-heat-scale + .affm-scale-labels span{position:absolute;transform:translateX(-50%);}.affm-heat-scale + .affm-scale-labels span:first-child{transform:none;}.affm-heat-scale + .affm-scale-labels span:last-child{transform:translateX(-100%);}
#controls.affm-layer-selector .full-label{display:inline!important;}#controls.affm-layer-selector .short-label{display:none!important;}
#controls.affm-layer-selector .date-range-show-label{display:inline!important;}#controls.affm-layer-selector .date-range-hide-label{display:none!important;}#controls.affm-layer-selector .date-range-disclosure[open] .date-range-show-label{display:none!important;}#controls.affm-layer-selector .date-range-disclosure[open] .date-range-hide-label{display:inline!important;}
#controls.affm-collapsed .affm-source-state{max-height:22px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-top:3px;padding-bottom:3px;}
.affm-alert-body p{text-align:left!important;}
#controls.affm-layer-selector .affm-layer-tabs button{min-height:36px;padding-top:5px;padding-bottom:5px;}
@media(pointer:coarse){#controls.affm-layer-selector .affm-layer-tabs button{min-height:50px;}}
@media(max-width:760px){#controls.affm-layer-selector .affm-layer-tabs button{min-height:44px;}}

/* Compact, mutually exclusive HSF status categories for the chosen time window. */
#affm-heat-summary{margin:12px 0 8px;}
.affm-heat-status-row{display:grid;grid-template-columns:12px minmax(0,1fr) auto;align-items:center;gap:7px;padding:9px 6px;margin-top:7px;background:#fff;border:1px solid #dce2d7;}
.affm-heat-status-row strong{font-size:13px;line-height:1.3;}
.affm-status-dot{width:12px;height:12px;border-radius:50%;box-shadow:0 0 0 4px #f2f2f0;}
.affm-status-high{background:#ca1533;}.affm-status-medium{background:#ea880b;}
.affm-status-description{display:block;font-size:10px;line-height:1.4;color:#637366;margin-top:2px;}
.affm-status-count{white-space:nowrap;padding:5px 4px;border:1px dashed #a7b49c;background:#f7f8f4;}
#affm-heat-load-state:empty{display:none;}
#affm-heat-legend[hidden],#affm-heat-empty[hidden]{display:none!important;}

/* Clip the tab fill to the same 8px corners as the camp cards. */
#controls.affm-layer-selector{border-radius:8px!important;overflow:hidden!important;}
#controls.affm-layer-selector>.affm-layer-tabs{border-radius:7px 7px 0 0;}
#controls.affm-layer-selector>.affm-source-state{border-radius:0 0 7px 7px;}

/* A single checkbox controls both section visibility and its map layer. */
.affm-alert-heading{display:flex;align-items:center;min-height:48px;}
.affm-alert-layer-toggle{display:flex;align-items:center;gap:7px;min-height:48px;width:100%;margin:0;padding:3px 0;border-radius:4px;color:#294836;font:700 14px/1.35 Arial,sans-serif;cursor:pointer;}
.affm-alert-layer-toggle input{margin:0;accent-color:#2c6845;width:17px;height:17px;flex:none;}
.affm-alert-heading-text{flex:1;min-width:0;}
.affm-alert-heading-icon{width:34px;height:28px;flex:none;}
.affm-alert-layer-toggle:has(input:focus-visible){outline:2px solid #28533a;outline-offset:1px;}
.affm-alert-layer-toggle:hover{background:#ffe6d3;}
#affm-heat-details[hidden],#affm-food-details[hidden]{display:none!important;}
.affm-temperature-control{align-items:center;gap:12px;margin-bottom:10px;}
.affm-temperature-key{flex:1;min-width:0;}
.affm-temperature-key>label{display:block;margin-bottom:0;}
.affm-temperature-control>select{flex:none;}
.affm-temperature-key .affm-heat-scale{margin-top:5px;height:7px;}
.affm-temperature-key .affm-scale-labels{font-size:9px;}

/* Grow into available map space; only the contents scroll on shorter screens. */
#controls.affm-layer-selector{display:flex;flex-direction:column;max-height:var(--affm-selector-max-height,calc(100dvh - var(--header-height,140px) - 150px));}
#controls.affm-layer-selector>.affm-layer-tabs,#controls.affm-layer-selector>.affm-source-state{flex:none;}

/* Camp totals toggle an additional, colour-matched map halo. */
.affm-status-count{font:700 13px/1.3 Arial,sans-serif;color:#294836;border-radius:3px;cursor:pointer;}
.affm-status-count:not(:disabled):hover{background:#fff1da;border-color:#a65c20;}
.affm-status-count[aria-pressed=true]{background:#fff0d8;border:2px solid #a65c20;padding:4px 3px;}
.affm-status-count:focus-visible{outline:2px solid #28533a;outline-offset:2px;}
.affm-status-count:disabled{cursor:default;opacity:.75;}

/* Reuse the camp card contribution button and account note. */
.affm-food-contribute{margin-top:14px;font-size:14px;line-height:1.45;}
.affm-food-contribute p{margin-bottom:0;}

/* Compact food-alert contents, using the existing branded badge and camp button. */
.affm-food-key{margin-top:14px;}
.affm-food-key .affm-food-scale{margin-top:5px;}
.affm-food-more{margin-top:16px;}
/* Original header badge treatment, scoped here so cached legacy CSS cannot strip it. */
#affm-food-details a.affm-info-badge{display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:44px;padding:9px 14px;border:1px solid #e4c8ad;border-radius:4px;background:#fff1e6;color:#754313;font:700 16px/1.25 Arial,sans-serif;text-decoration:none;text-align:center;}
.affm-alert-transparency{display:flex;align-items:center;justify-content:flex-end;gap:9px;margin-top:10px;color:#637366;font-size:11px;}
.affm-alert-transparency label{margin:0;font-weight:400;}
.affm-alert-transparency input{width:100px;max-width:45%;height:22px;margin:0;accent-color:#718d78;cursor:pointer;}
.affm-alert-transparency input:disabled{opacity:.45;cursor:default;}

/* Source attribution and an accessible, unobtrusive method explanation. */
.affm-food-source{display:block;font:11px/1.45 Arial,sans-serif;margin-top:4px;}
#affm-food-method-link.affm-help-link{display:inline;appearance:none;border:0;border-radius:0;outline:none;box-shadow:none;background:none;padding:0;margin:0;min-height:0;width:auto;font:inherit;color:#007a3e;text-decoration:none;cursor:pointer;}
#affm-food-method-link:focus-visible,.affm-food-method button:focus-visible{outline:2px solid #275d3d;outline-offset:2px;}
.affm-food-method{position:fixed;z-index:2100;box-sizing:border-box;overflow:auto;border:1px solid #ddb58e;border-left:4px solid #b4631b;border-radius:7px;padding:13px 15px;background:#fff8ef;color:#3e493e;box-shadow:0 3px 16px #0003;font:13px/1.5 Arial,sans-serif;text-align:left;}
.affm-food-method[hidden]{display:none!important;}
.affm-food-method-header{display:flex;align-items:center;gap:12px;justify-content:space-between;margin-bottom:10px;}
.affm-food-method-header button{flex:none;border:1px solid #ddc9b6;border-radius:4px;background:#fffaf4;color:#58412d;font:22px/1 Arial,sans-serif;width:32px;height:32px;cursor:pointer;}
.affm-food-method-copy p{font:inherit;text-align:left;margin:0 0 12px;}
.affm-food-method-copy p:last-child{margin-bottom:0;}
#affm-source-state[hidden]{display:none!important;}
