@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');

html, body, #map { height: 100%; margin: 0; background:#090A0A; font-family: 'Inter', sans-serif; }

/* Road closure lines with square endcaps */
.leaflet-pane.roadClosuresPane path {
    stroke-linecap: square !important;
    stroke-linejoin: miter !important;
}

#topbar{
    position:fixed; z-index:99999999; right:0px; top:0px;
    background:rgba(0,0,0,0.9); color:#fff; padding:10px 12px;
    font: 14px/1.2 Roboto, Arial, sans-serif;
    display:flex; gap:10px; align-items:center; flex-wrap:wrap;
}
#topbar b{ font-weight:800; letter-spacing:.2px; }
#topbar .meta{ opacity:.85 }
#topbar button{
    background:#111; color:#fff; border:1px solid rgba(255,255,255,.14);
    padding:7px 10px; cursor:pointer;
}
#topbar button.active{ border-color: rgba(59,130,246,.9); box-shadow: 0 0 0 2px rgba(59,130,246,.15); }
#topbar button:hover{ background:#162033; }
#topbar label{ display:flex; gap:8px; align-items:center; cursor:pointer; user-select:none; }
#topbar select{
    background:#111; color:#fff;
    border:1px solid rgba(255,255,255,.14);
    padding:6px 8px;
}

#legend{
    z-index:1000;
    background:#000; color:#fff; padding:10px 12px;
    font: 13px/1.2 Roboto, Arial, sans-serif;
    max-width:min(460px, calc(100vw - 24px));
}
.legtitle{ font-weight:800; margin:10px 0 6px; }
.legnote{ opacity:.75; font-size:12px; margin-bottom:6px; }
.legrow{
    display:flex; align-items:center; gap:8px;
    margin:6px 0; cursor:pointer; user-select:none;
    padding:6px 8px; border-radius:10px;
    border:1px solid rgba(255,255,255,.06);
}
.legrow:hover{ background:rgba(255,255,255,.06); }
.legrow.off{ opacity:.45; }
.dot{ width:10px; height:10px; border-radius:50%; display:inline-block; border:1px solid rgba(255,255,255,.35); }
.swatch{ width:14px; height:10px; border-radius:3px; display:inline-block; border:1px solid rgba(255,255,255,.22); }
.swatch-hatch{
    background:
            repeating-linear-gradient(45deg, rgba(0,0,0,.9) 0 2px, rgba(0,0,0,0) 2px 6px),
            repeating-linear-gradient(-45deg, rgba(0,0,0,.9) 0 2px, rgba(0,0,0,0) 2px 6px),
            rgba(255,255,255,.08);
}

.err{ color:#ffb4b4; }
.leaflet-popup-content { margin: 10px 12px; }
/* .stack-item intentionally empty for consistency */
/* .stack-item > div {
    padding-left: 1em;
} */
 .leaflet-popup-close-button {
    height: 100% !important;
    background-color: rgba(0,0,0,0.1) !important;
    color: #CC2222 !important;
    font-weight: bold !important;
 }
.stack-item:first-child{ border-top:none; padding-top:0; }
.pill{
    display:inline-block; padding:2px 8px; border-radius:999px;
    font-size:12px; font-weight:700; margin-right:8px;
    border:1px solid rgba(0,0,0,.15);
}

/* Incident diamond marker - Standard theme (non-VicEmergency) */
.inc-dia.standard{
    --scale: 1;
    width:10px; height:10px;
    transform: rotate(45deg) scale(var(--scale));
    transform-origin: 50% 50%;
    transition: transform .2s ease, filter .2s ease;
    /*border-radius:5px;*/
    border:4px solid var(--fill);
    background: #FFF;
    box-shadow: 0 0 6px rgba(20,20,20,0.1), 0 0 14px rgba(20,20,20,0.4);
}
.inc-dia.standard.focus:not(.safe)::before{
    content:"";
    position:absolute;
    inset:-3px;                 /* start slightly outside the border */
    border:3px solid var(--fill); /* or var(--c) if that's your solid colour */
    pointer-events:none;
    z-index: -1;

    opacity:0;
    animation: incPulseNew 2s ease-in 1s 1;
}
.inc-dia.standard.focus{
    --scale: 5;
    z-index: 99999999 !important;
}
.inc-dia.standard.focus.safe::after{
    content:"";
    position:absolute;
    inset:-3px;                 /* start slightly outside the border */
    border:3px solid rgba(59,130,246,.95); /* or var(--c) if that's your solid colour */
    pointer-events:none;
    z-index: -1;

    opacity:0;
    animation: incPulseSafe 5s ease-out 2s 1;
}
.inc-dia.standard.safe{
    background: transparent !important;
    border:1px solid var(--fill);
}
.inc-dia.standard{
    overflow: visible;
    isolation: isolate; /* key: confines z-index layering to this element */
    z-index: 0;
}

/* pulse ONLY for not-safe */
.inc-dia.standard:not(.safe)::after{
    content:"";
    position:absolute;
    inset:-3px;                 /* start slightly outside the border */
    border:3px solid var(--fill); /* or var(--c) if that's your solid colour */
    pointer-events:none;
    z-index: -1;

    opacity:0;
    animation: incPulse 2s ease-out 2.95s infinite;
}

@keyframes incPulse{
    0%   { transform: scale(1.02);   opacity:.75; }
    100% { transform: scale(5.0); opacity:0; }
}
@keyframes incPulseSafe{
    0%   { transform: scale(1.02);   opacity:.4; }
    100% { transform: scale(30.0); opacity:0; }
}
@keyframes incPulseNew{
    0% { transform: scale(30.0); opacity:0; }
    95% { opacity: .4}
    100%   { transform: scale(1.02);   opacity:0; }
}

/* Toasts */
#toasts{
    position:fixed; z-index:9999998;
    left:12px; bottom:12px;
    display:flex; flex-direction:column; gap:8px;
    max-width: 50vw;
    pointer-events:none;
}
.toast{
    pointer-events:none;
    background:#000;
    border-left:4px solid rgba(156,163,175,.8);
    color:#fff;
    padding:10px 12px;
    font: 13px/1.25 Roboto, Arial, sans-serif;

    opacity:0;
    transform: translateX(-120%);
    animation: toastIn .25s ease-out forwards;
}
.toast[style*="pointer-events: auto"] {
    pointer-events: auto !important;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast[style*="pointer-events: auto"]:hover {
    opacity: 0.9;
    transform: translateX(-2px);
}

@keyframes toastIn{
    to{ opacity:1; transform: translateX(0); }
}
@keyframes toastOut{
    to{ opacity:0; transform: translateX(-120%); }
}

.toast.rem{ border-left-color: rgba(34,197,94,.95); }
.toast.add{ border-left-color: rgba(239,68,68,.95); }
.toast.safe{ border-left-color: rgba(59,130,246,.95); }
.toast.upd{ border-left-color: rgba(234,179,8,.95); }
.toast .t1{ font-weight:800; margin-bottom:4px; }
.toast .t2{ opacity:.85; }

/* Drawing Tool Status */
#drawingToolStatus{
    position:fixed; z-index:9999998;
    left:50%; bottom:20px;
    transform: translate(-50%, 0) translateY(10px);
    background:rgba(0,0,0,0.9);
    color:#fff;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    padding:14px 16px;
    max-width: 95%;
    text-align:center;
    pointer-events:none;
    opacity:0;
    transition: opacity .15s ease, transform .15s ease;
    font: 16px Roboto, Arial, sans-serif;
}
#drawingToolStatus.show{
    opacity:1;
    transform: translate(-50%, 0);
}
.drawing-tool-name{
    font-weight:900; font-size:22px; margin-bottom:6px;
}
.drawing-tool-desc{
    font-size:16px; opacity:.85;
}

/* Focus HUD */
#focusHud{
    position:fixed; z-index:9999998;
    left:50%; top:35%;
    transform: translate(-50%, -50%) translateY(10px) scale(1.25);
    background:rgba(0,0,0,0.9);
    color:#fff;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    padding:14px 16px;
    max-width: 95%;
    text-align:center;
    pointer-events:none;
    opacity:0;
    transition: opacity .15s ease, transform .15s ease;
    font: 16px Roboto, Arial, sans-serif;
}
@media (max-width: 520px) {
    #focusHud { width: 90%;top: 26% }
    #drawingToolStatus { width: 65%;left: 40% }
    #toasts{ max-width:calc(100vw - 50px) !important;}
}
#focusHud.on{ opacity:1; transform: translate(-50%, -50%) translateY(0); }
#focusHud .fh1{ font-weight:900; font-size:22px; margin-bottom:6px; }
#focusHud .fh2{ font-size:16px; }
/* Focus HUD theming */
#focusHud{
    --hudC: rgba(34,197,94,.95);
    --hudGlow: rgba(34,197,94,.35);
    /*box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 0 22px var(--hudGlow);*/
    border-top: 4px solid var(--hudGlow);
}

#focusHud.hud-rem  { --hudC: rgba(34,197,94,.95); --hudGlow: rgba(34,197,94,.35); }
#focusHud.hud-safe { --hudC: rgba(59,130,246,.95); --hudGlow: rgba(59,130,246,.35); }
#focusHud.hud-add  { --hudC: rgba(239,68,68,.95); --hudGlow: rgba(239,68,68,.35); }

#focusHud .fh1{
    color: var(--hudC);
}

/* Watch Area Radius Controls in Focus HUD */
#focusHud .watch-radius-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    pointer-events: all;
}

#focusHud .watch-radius-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 18px;
    font-weight: 600;
}

#focusHud .watch-radius-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
}

#focusHud .watch-radius-btn:active {
    background: rgba(255,255,255,0.3);
}

#focusHud .watch-radius-value {
    min-width: 60px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--hudC);
}

/* Legend uses the same marker class, just smaller + no glow */
.inc-dia.standard.leg{
    width:12px;
    height:12px;
    border-width:3px;      /* match your on-map look */
    box-shadow:none;       /* optional */
    animation: none !important;
}
.inc-dia.standard.leg::after {
    display: none !important;
}

/* ============================================================================
   THEME-SPECIFIC INCIDENT ICON STYLES
   ============================================================================
   Add styles for incident icons based on the selected basemap theme.
   The theme class is automatically added to incident icons when the basemap changes.
   
   Example: When VicEmergency map is selected, icons get the "theme-vicemergency" class
   ============================================================================ */

/* VicEmergency theme incident icon styles */
/* When using SVG sprites, the icon is an <svg> element instead of a <div> */
/* VicEmergency uses 36x36 icons to match their official size */
.inc-dia.theme-vicemergency {
    /* SVG icons: ensure proper sizing and display */
    width: 36px;
    height: 36px;
    display: block;
    /* Remove default div-based styles that don't apply to SVG */
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    /* Ensure SVG content is visible and properly scaled */
    opacity: 1;
    overflow: visible;
    /* Ensure SVG fills its container completely */
    max-width: 100%;
    max-height: 100%;
}

/* Ensure the <use> element inside SVG properly references the sprite and scales correctly */
.inc-dia.theme-vicemergency use {
    width: 100%;
    height: 100%;
}

/* ============================================================================
   INCIDENT TYPE-SPECIFIC STYLES
   ============================================================================
   Style incident icons based on their type (Fire, Flood, Storm, Tree Down, Other).
   Each incident icon automatically gets a class like:
   - inc-type-fire
   - inc-type-flood
   - inc-type-storm
   - inc-type-tree
   - inc-type-other
   
   Icons also have a data-incident-type attribute with the uppercase value (FIRE, FLOOD, etc.)
   ============================================================================ */

/* Example: Style Fire incidents differently */
.inc-dia.inc-type-fire {
    /* Add custom styles for fire incidents */
    /* Example: */
    /* border-width: 5px; */
    /* box-shadow: 0 0 8px rgba(204,34,34,0.6); */
    /* Placeholder - remove when adding styles */
    opacity: 1;
}

/* Example: Style Flood incidents differently */
.inc-dia.inc-type-flood {
    /* Add custom styles for flood incidents */
    /* Placeholder - remove when adding styles */
    opacity: 1;
}

/* Example: Style Storm incidents differently */
.inc-dia.inc-type-storm {
    /* Add custom styles for storm incidents */
    /* Placeholder - remove when adding styles */
    opacity: 1;
}

/* Example: Style Tree Down incidents differently */
.inc-dia.inc-type-tree {
    /* Add custom styles for tree down incidents */
    /* Placeholder - remove when adding styles */
    opacity: 1;
}

/* Example: Style Other incidents differently */
.inc-dia.inc-type-other {
    /* Add custom styles for other incidents */
    /* Placeholder - remove when adding styles */
    opacity: 1;
}

/* You can also combine type and theme classes */
/* Example: .inc-dia.theme-vicemergency.inc-type-fire { ... } */

/* Add more theme-specific styles as needed */

#panels{
    position:fixed;
    right:0px;
    bottom:0px;
    padding-bottom: 30px;
    padding-top: 60px;
    z-index:1000;
    display:flex;
    flex-direction:column;
    gap:10px;
    max-width:min(500px, calc(100vw - 24px));
    background-color: #000;
    max-height: calc(100vh - 180px); /* Account for topbar potentially stacking 3x (3 * ~60px) */
    overflow-y: auto;
    overflow-x: hidden;
}

#layers, #legend{
    position:relative;  /* panels controls positioning */
    right:auto;
    bottom:auto;
    z-index:1000;
    background:#000; color:#fff; padding:10px 12px;
    font: 13px/1.2 Roboto, Arial, sans-serif;
    max-width:min(500px, calc(100vw - 24px));
    min-width: 300px;
}

.layerrow{
    justify-content:space-between;
}

.layerrow label{
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 0;
}

.layerrow input[type="range"]{
    width:140px;
    flex-shrink: 0;
}

/* hide both panels when closed */
#legend.closed, #layers.closed { display:none !important; }

/* Old layers button - hidden, using new .layers-toggle-btn instead */
/* Old layers button styling - only hide if it doesn't have the new class */
#layersBtn:not(.layers-toggle-btn) {
    display: none !important;
}

.leaflet-control-attribution{
    background: rgba(0,0,0,.85) !important;
    color: #666 !important;
}

/* New Layers Panel */
.layers-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 70%;
    max-width: 450px;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    color: #fff;
    z-index: 10000000; /* Above drawing toolbar */
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: -2px 0 10px rgba(0,0,0,.5);
    transform: translateX(100%);
}

.layers-panel.open {
    transform: translateX(0);
}

.layers-toggle-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10000001; /* Above layers panel (10000000) */
    padding: 0;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    background:#111; 
    color:#fff; 
    border:1px solid rgba(255,255,255,.14);
    border-right: none;
}

/* Feedback */
.feedback-toggle-btn {
    position: fixed;
    right: 0;
    bottom: 220px;
    z-index: 9999999;
    padding: 0;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    background:#111; 
    color:#fff; 
    border:1px solid rgba(255,255,255,.14);
    border-right: none;
}

.feedback-toggle-btn:hover {
    background: #162033;
}

.feedback-toggle-btn.active {
    border-color: rgba(59,130,246,.9);
    box-shadow: 0 0 0 2px rgba(59,130,246,.15);
    background: rgba(59,130,246,1);
}

.feedback-toggle-btn i {
    font-size: 18px;
}

/* CFA Districts */
.cfa-districts-toggle-btn {
    position: fixed;
    right: 0;
    bottom: 170px;
    z-index: 9999999;
    padding: 0;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    background:#111; 
    color:#fff; 
    border:1px solid rgba(255,255,255,.14);
    border-right: none;
}

.cfa-districts-toggle-btn:hover {
    background: #162033;
}

.cfa-districts-toggle-btn.active {
    border-color: rgba(59,130,246,.9);
    box-shadow: 0 0 0 2px rgba(59,130,246,.15);
    background: rgba(59,130,246,1);
}

.cfa-districts-toggle-btn i {
    font-size: 18px;
}

/* District label styling */
.cfa-district-label {
    background: transparent !important;
    border: none !important;
}

.district-label-text {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-weight: bold;
    font-size: 20px;
    font-family: monospace;
    padding: 8px 12px;
    border: 2px solid white;
    text-align: center;
    pointer-events: none;
    min-width: 40px;
}

/* Watch Areas */
.watch-toggle-btn {
    position: fixed;
    right: 0;
    bottom: 120px;
    z-index: 9999999;
    padding: 0;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    background:#111; 
    color:#fff; 
    border:1px solid rgba(255,255,255,.14);
    border-right: none;
}

.watch-toggle-btn:hover {
    background: #162033;
}

.watch-toggle-btn.active {
    border-color: rgba(59,130,246,.9);
    box-shadow: 0 0 0 2px rgba(59,130,246,.15);
    background: rgba(59,130,246,1);
}

.watch-toggle-btn i {
    font-size: 18px;
}

.watch-toolbar {
    position: fixed;
    right: 50px;
    bottom: 120px;
    z-index: 9999998;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.watch-toolbar.open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.watch-tool-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    color: #fff;
    border: 1px solid rgba(255,255,255,.14);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    font-size: 12px;
}

.watch-tool-btn:hover {
    background: #162033;
}

.watch-tool-btn.active {
    background: rgba(59,130,246,1);
    border-color: rgba(59,130,246,.9);
    box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}

.watch-tool-btn i {
    font-size: 16px;
}

/* Notify button specific styling */
.watch-tool-btn[data-tool="notify"] {
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;
}

.watch-notify-icon {
    font-size: 16px;
    display: block;
}

.watch-notify-text {
    font-size: 9px;
    font-weight: 600;
    white-space: nowrap;
    padding: 0;
    line-height: 1;
}

/* Notify button state colors */
.watch-tool-btn.notify-all {
    border-color: rgba(34,197,94,.9) !important;
    box-shadow: 0 0 0 2px rgba(34,197,94,.15) !important;
}

.watch-tool-btn.notify-all:hover {
    border-color: rgba(34,197,94,1) !important;
}

.watch-tool-btn.notify-watch {
    border-color: rgba(59,130,246,.9) !important;
    box-shadow: 0 0 0 2px rgba(59,130,246,.15) !important;
}

.watch-tool-btn.notify-watch:hover {
    border-color: rgba(59,130,246,1) !important;
}

.watch-tool-btn.notify-none {
    border-color: rgba(239,68,68,.9) !important;
    box-shadow: 0 0 0 2px rgba(239,68,68,.15) !important;
}

.watch-tool-btn.notify-none:hover {
    border-color: rgba(239,68,68,1) !important;
}

/* Drawing Tools */
.draw-toggle-btn {
    position: fixed;
    right: 0;
    bottom: 70px;
    z-index: 9999999;
    padding: 0;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
    background:#111; 
    color:#fff; 
    border:1px solid rgba(255,255,255,.14);
    border-right: none;
}

.draw-toggle-btn:hover {
    background: #162033;
}

.draw-toggle-btn.active {
    border-color: rgba(59,130,246,.9);
    box-shadow: 0 0 0 2px rgba(59,130,246,.15);
    background: rgba(59,130,246,1);
}

.draw-toggle-btn i {
    font-size: 18px;
}

.draw-toolbar {
    position: fixed;
    right: 50px;
    bottom: 70px;
    z-index: 9999998;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.draw-toolbar.open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.draw-tool-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    color: #fff;
    border: 1px solid rgba(255,255,255,.14);
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.draw-tool-btn:hover {
    background: #162033;
}

.draw-tool-btn.active {
    background: rgba(34,197,94,1);
    border-color: rgba(34,197,94,.9);
    box-shadow: 0 0 0 2px rgba(34,197,94,.15);
}

.draw-tool-btn.active i::before {
    content: "\f00c"; /* FontAwesome check icon */
}

.draw-tool-btn i {
    font-size: 16px;
}

@media (max-width: 768px) {
    .draw-toggle-btn {
        width: 36px;
        height: 36px;
        bottom: 66px;
    }
    
    .draw-toggle-btn i {
        font-size: 16px;
    }
    
    .draw-toolbar {
        bottom: 66px;
        right: 48px;
    }
    
    .draw-tool-btn {
        width: 36px;
        height: 36px;
    }
    
    .draw-tool-btn i {
        font-size: 14px;
    }
}

/* When panel is open, position button to the left of it */
.layers-panel.open ~ .layers-toggle-btn {
    right: auto;
    left: calc(100% - 70% - 15px);
}

@media (min-width: 769px) {
    .layers-panel.open ~ .layers-toggle-btn {
        left: calc(100% - 450px - 15px);
    }
}

.layers-toggle-btn:hover {
    background: #162033;
}

.layers-toggle-btn.active {
    border-color: rgba(59,130,246,.9);
    box-shadow: 0 0 0 2px rgba(59,130,246,.15);
    background: rgba(59,130,246,1);
}

.layers-toggle-btn i {
    font-size: 18px;
}

/* Inline layers button for quick setup text */
.layers-button-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #111;
    color: #fff;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 4px;
    vertical-align: middle;
    margin: 0 4px;
    flex-shrink: 0;
}

.layers-button-inline i {
    font-size: 12px;
}


.layers-panel-content {
    padding: 12px;
    padding-top: 66px;
    padding-bottom: 5em;
}

.layers-section {
    margin-bottom: 16px;
}

.layers-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.layers-section-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.layers-section-header .section-toggle {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.layers-section.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.layers-section-content {
    padding-top: 10px;
    display: block;
}

.layers-section.collapsed .layers-section-content {
    display: none;
}

.layer-button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.layer-button-grid-6 {
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

@media (max-width: 768px) {
    .layer-button-grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Vertical list layout for warnings and incidents */
.layer-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.layer-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #111;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.layer-list-item:hover {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.2);
}

.layer-list-item.active {
    border-color: rgba(59,130,246,.9);
    box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}

.layer-list-item.off {
    opacity: 0.45;
}

.layer-list-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.layer-list-icon .inc-dia.standard,
.layer-list-icon .swatch {
    display: inline-block;
}

.layer-list-icon .inc-dia.standard.leg {
    width: 12px;
    height: 12px;
}

.layer-list-icon .swatch {
    width: 16px;
    height: 12px;
}

.layer-list-label {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.layer-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: #111;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.layer-button:hover {
    background: rgba(0,0,0,1);
    border-color: rgba(255,255,255,.4);
}

.layer-button.active {
    border-color: rgba(59,130,246,.9);
    box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}

.layer-button.off {
    opacity: 0.9;
}

.layer-button-image {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 6px;
    border-radius: 4px;
    overflow: visible;
    background: rgba(255,255,255,.05);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.layer-button-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.layer-loading-spinner {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.2);
    border-top-color: rgba(59,130,246,.9);
    border-radius: 50%;
    display: none;
    animation: spin 0.8s linear infinite;
}

.layer-loading-spinner.loading {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Use existing CSS classes for icons */
.layer-button-image .inc-dia.standard,
.layer-button-image .swatch {
    display: inline-block;
}

.layer-button-image .inc-dia.standard.leg {
    width: 18px;
    height: 18px;
}

.layer-button-image .swatch {
    width: 18px;
    height: 18px;
}

.layer-button-label {
    text-align: center;
    font-size: 12px;
    margin-bottom: 6px;
    font-weight: 500;
}

.layer-opacity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 2px;
}

.opacity-btn {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.opacity-btn:hover {
    background: rgba(255,255,255,.2);
}

.opacity-value {
    min-width: 32px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}

.opacity-label {
    font-size: 9px;
    opacity: 0.7;
    text-align: center;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .layers-panel {
        width: 80%;
    }
    #watchBtn,
    #watchClearBtn,
    #watchNotifyBtn {
        display: none;
    }

    .feedback-toggle-btn {
        bottom: 157px;
    }

    .cfa-districts-toggle-btn {
        bottom: 111px;
    }
    
    .layers-panel-content {
        padding: 10px;
        padding-top: 50px;
        padding-bottom: 5em;
    }
    
    .layer-button-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .layer-button-grid-6 {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .layer-button {
        padding: 6px;
    }
    
    .layers-toggle-btn,
    .cfa-districts-toggle-btn,
    .feedback-toggle-btn {
        width: 36px;
        height: 36px;
    }
    
    .layers-toggle-btn i,
    .cfa-districts-toggle-btn i,
    .feedback-toggle-btn i {
        font-size: 16px;
    }

    .feedback-buttons {
        flex-direction: column-reverse !important;
        gap: 12px;
    }

    .feedback-close-btn,
    .feedback-buttons .ack-button {
        width: 100%;
        min-width: unset;
    }
}

/* Desktop adjustments */
@media (min-width: 769px) {
    .layers-panel {
        max-width: 450px;
    }
}

.leaflet-control-attribution {
    font-size: 11px;
}

.leaflet-control-attribution a{
    color:#fff !important;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .leaflet-control-attribution {
        font-size: 9px;
        line-height: 1.2;
    }
}

#acknowledgmentModal{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 1);
    z-index: 99999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#acknowledgmentModal a {
    color: #D44343;
    font-weight: bold;
}
#acknowledgmentModal a:hover {
    color: #FFF !important;
}
#acknowledgmentModal a:visited {
    color: #D44343;
}

.ack-modal-content{
    background: #000;
    padding: 6px;
    max-width: 730px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.ack-logo{
    max-width: 200px;
    width: 200px;
    height: 100px;
    margin-bottom: 12px
}

.ack-text-container{
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}

.ack-text{
    color: #fff;
    font: 14px/1.2 Roboto, Arial, sans-serif;
    margin: 0;
    opacity: 1;
}

.ack-button{
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 16px 48px;
    font: 18px/1.2 Roboto, Arial, sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
    min-width: 200px;
    height: auto;
    box-sizing: border-box;
}

.feedback-buttons .ack-button {
    margin-top: 0;
}

.ack-button:hover{
    /*transform: scale(1.05);*/
    filter: brightness(1.2);
}

.ack-button:active{
    /*transform: scale(1.03);*/
    filter: brightness(1.1);
}
.big-warning {
    text-align: center;
    font-weight: bold;
    color: rgba(239,68,68,1);
    font-size: 1.6em
}

/* Quick Setup Modal */
#quickSetupModal{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 1);
    z-index: 99999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-setup-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    margin-bottom: 12px;
}

.quick-setup-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 12px 0 0;
    background: #111;
    border: 2px solid rgba(255,255,255,.14);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    overflow: hidden;
}

.quick-setup-option:hover {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.2);
}

.quick-setup-option.selected {
    border-color: rgba(59,130,246,.9);
    box-shadow: 0 0 0 2px rgba(59,130,246,.15);
    background: rgba(59,130,246,.1);
}

.quick-setup-thumbnail {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    overflow: hidden;
    background: rgba(255,255,255,.05);
    position: relative;
}

.quick-setup-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quick-setup-icon-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}

.quick-setup-icon-overlay .inc-dia {
    display: block;
}

/* Size the standard theme icon for thumbnails - same size as legend */
.quick-setup-icon-overlay .inc-dia.standard.leg {
    width: 12px;
    height: 12px;
    border-width: 3px; /* Maintain same border thickness as legend */
    /* Reintroduce box shadow from map view */
    box-shadow: 0 0 6px rgba(20,20,20,0.9), 0 0 14px rgba(20,20,20,0.9);
}

/* Size the VicEmergency theme SVG icon for thumbnails - same size as on map */
.quick-setup-icon-overlay .inc-dia.theme-vicemergency {
    width: 36px;
    height: 36px;
}

/* Position VicEmergency icon at edge for better alignment */
.quick-setup-icon-overlay:has(.inc-dia.theme-vicemergency) {
    bottom: 0px;
    right: 0px;
}

.quick-setup-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.quick-setup-heading {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-align: left;
}

.quick-setup-subtext {
    font-size: 14px;
    color: rgba(255,255,255,.75);
    line-height: 1.4;
    text-align: left;
}

#quickSetupContinueBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#quickSetupContinueBtn:disabled:hover {
    transform: none;
}

.warn-body{ margin-top:6px; }
.warn-body--clamped{
    max-height: 140px;
    overflow: hidden;
    position: relative;
}
.warn-body--clamped::after{
    content:"";
    position:absolute;
    left:0; right:0; bottom:0;
    height:44px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
    pointer-events:none;
}

/* Feedback Modal */
#feedbackModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 1);
    z-index: 99999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

#feedbackMessage {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    background: #111;
    border: 2px solid rgba(255,255,255,.14);
    border-radius: 8px;
    color: #fff;
    font: 14px/1.5 Roboto, Arial, sans-serif;
    resize: vertical;
    box-sizing: border-box;
}

#feedbackMessage:focus {
    outline: none;
    border-color: rgba(59,130,246,.9);
    box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}

#feedbackMessage::placeholder {
    color: rgba(255,255,255,.5);
}

.feedback-email-input {
    width: 100%;
    padding: 12px;
    background: #111;
    border: 2px solid rgba(255,255,255,.14);
    border-radius: 8px;
    color: #fff;
    font: 14px/1.5 Roboto, Arial, sans-serif;
    box-sizing: border-box;
}

.feedback-email-input:focus {
    outline: none;
    border-color: rgba(59,130,246,.9);
    box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}

.feedback-email-input::placeholder {
    color: rgba(255,255,255,.5);
}

.feedback-buttons {
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.feedback-close-btn {
    background: #333;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 16px 48px;
    font: 18px/1.2 Roboto, Arial, sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 200px;
    height: auto;
    box-sizing: border-box;
    margin: 0;
}

.feedback-close-btn:hover {
    filter: brightness(1.2);
}

.feedback-close-btn:active {
    filter: brightness(1.1);
}

#feedbackSubmitBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.warn-hint{
    margin-top:6px;
    margin-bottom: 1em;
    text-align: center;
    width: 100%;
    font-weight:700;
    opacity:.65;
}

.warn-card .heading {
    padding: 0.5em
}

.warn-card.WATCH .heading {
    background-color: rgba(249,115,22,.20);
    border-top: 4px solid rgba(249,115,22,1);
}
.warn-card.EMERGENCY .heading {
    background-color: rgba(239,68,68,.22);
    border-top: 4px solid rgba(239,68,68,1);
}
.warn-card.ADVICE .heading {
    background-color: rgba(234,179,8,.22);
    border-top: 4px solid rgba(234,179,8,1);
}
.warn-card.IMPACT .heading {
    background-color: rgba(0,0,0,.22);
    border-top: 4px solid rgba(0,0,0,0.5);
}
.warn-card.OTHER .heading {
    background-color: rgba(0,0,0,.22);
    border-top: 4px solid rgba(0,0,0,0.5);
}

/* Keep popups inside viewport + make content scroll */
.leaflet-popup{
    max-width: min(92vw, 720px);
}

.leaflet-popup-content-wrapper{
    max-height: min(70vh, 520px);
    overflow: hidden; /* wrapper clips */
    padding: 0 !important;
    box-sizing: border-box;
    border-radius: 0;
    padding-right: 2em !important
}

.leaflet-popup-content{
    max-height: min(64vh, 460px);
    overflow: auto;
    -webkit-overflow-scrolling: touch; /* smooth scroll on iOS */
    padding: 0em !important;
    margin: 0 !important;
    box-sizing: border-box;
}

.popup-content-padding {
    padding: 0.5em;
}

.popup-content-table {
    width: 100%;
}

.popup-content-table td {
    padding: 0.15em 0.25em;
}

.popup-content-table tr:nth-child(even) td {
    background-color: rgba(0,0,0,.05);
}

/* Ensure incident markers are always on top of warnings and impacts */
.leaflet-pane[name="incidentsPane"] {
    z-index: 700 !important;
}

.leaflet-popup-content .stack-item div:not(.heading) {
    box-sizing: border-box;
}

.logo {
    background-image: url('images/viclive-logo.png');
    background-size: contain;
    width: 40px;
    height: 40px;
    display: block;
}

#status-footer {
    position:fixed; z-index:9999999; right:0px; top:60px;
    background:rgba(0,0,0,1); color:#fff; padding:10px 12px;
    font: 14px/1.2 Roboto, Arial, sans-serif;
    display:flex; gap:10px; align-items:center; flex-wrap:wrap;
}

#status-footer button{
    background:#111; color:#fff; border:1px solid rgba(255,255,255,.14);
    padding:7px 10px; cursor:pointer;
}
#status-footer button.active{ border-color: rgba(59,130,246,.9); box-shadow: 0 0 0 2px rgba(59,130,246,.15); }

@keyframes hotspotPulse {
    0%,49%,100% { opacity: var(--oLow, .3); }
    50%,99%     { opacity: var(--oHigh, 0.8); }
}
@keyframes hotspotPulseInv {
    0%,49%,100% { opacity: var(--oLow, .8); }
    50%,99%     { opacity: var(--oHigh, 0.3); }
}
.dea-hotspots.pulse {
    animation: hotspotPulse 2s ease-in-out infinite;
}
.warning-evacuate {
    animation: hotspotPulseInv 2s ease-in-out infinite;
}
.warning-evacuate-emergency {
    animation: hotspotPulseInv 1s ease-in-out infinite;
}
#hotspotsLegendNew .dot {
    animation: hotspotPulse 2s ease-in-out infinite;
}
#significantWeatherLegend {
    padding-left: 3em !important;
}
#significantWeatherLegend .legrow,
#windLegend .legrow {
    margin-left: 1em !important;
}

#windLegend {
    padding-left: 3em !important;
}

/* Air Temperature Legend Styles */
.hl-wrap {
    font-size: 12px;
    color: #fff;
}

.hl-title {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 13px;
}

.hl-single-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hl-block {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hl-icon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
}

.hl-name {
    font-size: 12px;
    opacity: 0.9;
}

.hl-icon-outline {
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.leaflet-zoom-animated {
    transition: transform 0s linear !important;
}