
/* ===== SinkAlert staff: mobile/tablet (<=900px) + focus mask + rings (all widths) ===== */
.sa-fm-key{display:inline-block;width:22px;height:14px;border-radius:3px;border:2px solid #0056CC;background:#fff;box-shadow:inset 0 0 0 20px #fff;flex:none}
.sa-fm-key.shade{border-color:#cbd5e1;background:rgba(255,255,255,.72);background-image:repeating-linear-gradient(45deg,#e2e8f0 0 3px,#fff 3px 6px)}
.sa-ring-key{display:inline-block;width:16px;height:16px;border-radius:50%;background:rgba(239,68,68,.25);flex:none}
.sa-ring-key.r3{background:rgba(239,68,68,.25);box-shadow:inset 0 0 0 5px rgba(239,68,68,.25)}
.sa-ring-key.r1{background:rgba(239,68,68,.55)}
.photo-missing{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;min-height:96px;margin:10px 0;border-radius:8px;background:#edf1f5;border:1px dashed #cbd5e1;color:#64748B;font-size:13px}
.sa-sheet-handle,.sa-sheet-body{display:none}
@media(max-width:900px){
 html,body{overflow-x:hidden}
 body{height:auto;min-height:100dvh;overflow-y:auto;font-size:14px}
 #app{display:flex;flex-direction:column;height:auto;min-height:100dvh}
 #topbar{position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;padding:10px 14px;min-height:0;grid-column:auto}
 #topbar .divider,#topbar .demo-tag{display:none}
 #topbar .brand{order:1;min-height:44px;align-items:center;font-size:21px;padding-right:6px}
 #topbar .brand .dots{top:6px}
 #topbar .crumb{order:2;flex:1;font-size:13px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #topbar .ov-link{order:3;display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;font-size:14px;padding:0 14px;border-radius:10px}
 #topbar .sa-mobile-nav{order:4}
 #topbar .search{order:5;flex:1 0 100%;max-width:none;margin:0;height:44px}
 .search input{height:44px;font-size:16px;padding:0 84px 0 38px;border-radius:10px}
 .search button{top:0;right:0;height:44px;min-width:72px;padding:0 14px;font-size:14px;border-radius:0 10px 10px 0;font-weight:600}
 #rail{flex:none;width:100%;flex-direction:row;align-items:center;justify-content:flex-start;gap:6px;padding:6px 12px;overflow-x:auto;overflow-y:hidden;border-right:0;border-bottom:1px solid var(--line);scroll-snap-type:x proximity;scroll-padding:0 12px;scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
 #rail::-webkit-scrollbar{display:none}
 #rail.fade-r{-webkit-mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 44px),transparent 100%);mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 44px),transparent 100%)}
 #rail.fade-l{-webkit-mask-image:linear-gradient(90deg,transparent 0,#000 44px,#000 100%);mask-image:linear-gradient(90deg,transparent 0,#000 44px,#000 100%)}
 #rail.fade-l.fade-r{-webkit-mask-image:linear-gradient(90deg,transparent 0,#000 44px,#000 calc(100% - 44px),transparent 100%);mask-image:linear-gradient(90deg,transparent 0,#000 44px,#000 calc(100% - 44px),transparent 100%)}
 .rail-btn{flex:0 0 78px;width:78px;height:60px;min-height:44px;scroll-snap-align:start;gap:3px;font-size:13px;border-radius:10px;padding:0}
 .rail-btn span{font-size:13px;line-height:1.2}
 .rail-btn svg{width:20px;height:20px}
 /* map */
 #center{flex:none;position:relative;height:calc(max(60vh,420px) + 56px);height:calc(max(60svh,420px) + 56px);min-height:0}
 #map{inset:0 0 56px 0}
 .map-tools{top:10px;left:10px;max-width:calc(100% - 74px);padding:3px}
 .map-tools button{min-height:44px;font-size:13px;padding:0 12px;white-space:nowrap}
 #open-pilot{display:none}
 .leaflet-top.leaflet-left{right:10px;top:10px}
 .leaflet-touch .leaflet-bar a{width:44px;height:44px;line-height:44px;font-size:22px}
 .leaflet-touch .leaflet-bar{border-radius:10px}
 .leaflet-control-attribution{font-size:13px!important;line-height:1.3;max-width:62vw;white-space:normal}
 .leaflet-popup-content{font-size:14px;max-width:min(260px,calc(100vw - 90px))!important;margin:12px 16px}
 .leaflet-popup-content h3{font-size:15px}
 .leaflet-container a.leaflet-popup-close-button{width:44px;height:44px;font-size:26px;padding:6px 6px 0 0;display:flex;align-items:flex-start;justify-content:flex-end}
 .leaflet-tooltip{font-size:13px}
 /* bottom sheet */
 #center>#left{position:absolute;left:0;right:0;bottom:0;z-index:500;display:flex;flex-direction:column;max-height:70%;overflow:hidden;background:#fff;border:0;border-top:1px solid var(--line);border-radius:18px 18px 0 0;box-shadow:0 -8px 24px rgba(16,24,40,.14)}
 .sa-sheet-handle{display:flex;flex:none;align-items:center;gap:10px;position:relative;width:100%;height:56px;padding:6px 16px 0;border:0;background:none;font-size:14px;font-weight:700;color:var(--ink);text-align:left;touch-action:none;cursor:grab}
 .sa-sheet-handle::before{content:"";position:absolute;top:8px;left:50%;width:44px;height:5px;margin-left:-22px;border-radius:3px;background:#CBD5E1}
 .sa-sheet-handle .lbl{flex:1}
 .sa-sheet-handle .chev{font-size:18px;transition:transform 200ms var(--ease-out)}
 #left.open .sa-sheet-handle .chev{transform:rotate(180deg)}
 .sa-sheet-body{display:none;overflow-y:auto;overscroll-behavior:contain;padding:0 0 max(16px,env(safe-area-inset-bottom))}
 #left.open .sa-sheet-body{display:block}
 #left details>summary{display:none}
 .sa-sheet-body .kpi-strip{position:static;margin:4px 14px 10px;padding:10px 2px}
 .sa-sheet-body .map-caption{position:static;display:block;max-width:none;margin:0 14px 8px;font-size:13px;padding:8px 10px}
 .sa-sheet-body .kpi-strip,.sa-sheet-body .map-caption{visibility:visible!important}
 .sa-sheet-body .kpi-strip{grid-template-columns:1fr 1fr;gap:10px 0}
 .sa-sheet-body .kpi:nth-child(2){border-right:0}
 .sa-sheet-body .lp-group{padding:6px 16px 12px}
 .lp-group .t{font-size:13px}
 .layer{min-height:44px;font-size:14px;gap:10px;padding:2px 0}
 .switch{width:44px;height:26px}
 .slider::before{height:20px;width:20px;left:3px;top:3px}
 .switch input:checked+.slider::before{transform:translateX(18px)}
 .legend-row,.small{font-size:13px;line-height:1.7}
 .kv{font-size:18px}.kl{font-size:13px;line-height:1.3}
 .lp-btn{min-height:44px;font-size:14px}
 .map-caption{font-size:13px}
 /* panel */
 #right{overflow:visible;border:0;border-top:1px solid var(--line);padding:18px 16px 36px;min-height:320px}
 .eyebrow{font-size:13px}
 h1{font-size:20px}h2{font-size:16px}h3{font-size:15px}
 p,.card p,.note,.check,.local-state,.inline-list,table,th,td{font-size:14px}
 .meta,.pill,.empty,.field-label,label.field-label{font-size:13px}
 .action{min-height:44px;font-size:14px;padding:0 16px}
 .field{min-height:44px;font-size:16px}
 .check{min-height:44px;align-items:center}.check input{width:22px;height:22px;margin-top:0;flex:none}
 summary{min-height:44px;display:flex;align-items:center}
 .report-photo{max-height:240px}
 .card-button{min-height:44px}
 #toast{font-size:14px}
 .pop .rc-row button{min-height:44px;font-size:13px}
}
@media(max-width:480px){.map-tools button{padding:0 9px}}

/* fix3: panel reveal on phone */
#sa-panel-back{display:none}
@media(max-width:900px){
 #right{scroll-margin-top:8px;padding-bottom:calc(48px + 16px + 16px + env(safe-area-inset-bottom,0px))!important}
 #sa-panel-back{display:block;position:fixed;right:14px;bottom:max(16px,env(safe-area-inset-bottom));z-index:900;min-height:48px;padding:0 18px;border:0;border-radius:24px;background:#0F172A;color:#fff;font-size:14px;font-weight:700;box-shadow:0 6px 18px rgba(16,24,40,.28);opacity:0;pointer-events:none;transform:translateY(12px);transition:opacity 200ms var(--ease-out),transform 200ms var(--ease-out)}
 #sa-panel-back.show{opacity:1;pointer-events:auto;transform:none}
}

/* ===== polish: popup bottom sheet, rail hint ===== */
#sa-pop-sheet,.sa-rail-more{display:none}
@media(max-width:900px){
 .sa-pop-on .leaflet-popup{display:none!important}
 #sa-pop-sheet{display:flex;flex-direction:column;position:fixed;left:0;right:0;bottom:0;z-index:1300;box-sizing:border-box;max-height:55vh;max-height:55dvh;background:#fff;color:#0F172A;border-top:1px solid #E5E7EB;border-radius:18px 18px 0 0;box-shadow:0 -10px 32px rgba(15,23,42,.24);font-size:15px;line-height:1.65}
 #sa-pop-sheet::before{content:"";flex:none;align-self:center;width:44px;height:5px;margin:8px 0 0;border-radius:3px;background:#CBD5E1}
 .sa-pop-x{position:absolute;top:4px;right:4px;width:44px;height:44px;border:0;border-radius:12px;background:transparent;color:#475569;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:2}
 .sa-pop-x:active{background:#F1F5F9}
 .sa-pop-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:6px 18px calc(18px + env(safe-area-inset-bottom,0px))}
 .sa-pop-body h3{margin:4px 48px 6px 0;font-size:17px;line-height:1.45;font-weight:800;color:#0F172A}
 .sa-pop-body p{margin:0 0 8px;font-size:15px;line-height:1.65;color:#0F172A}
 .sa-pop-body h3+p{color:#475569}
 .sa-pop-body small{display:block;margin-top:8px;font-size:14px;line-height:1.6;color:#475569}
 .sa-pop-body a{color:#0056CC;text-decoration:underline;text-underline-offset:2px;display:inline-block;min-height:32px;line-height:32px}
 .sa-pop-body img{display:block;width:100%;max-height:180px;object-fit:cover;border-radius:10px;margin:8px 0}
 .sa-pop-body button{min-height:44px;font-size:14px}
 .sa-pop-open #sa-panel-back{display:none!important}
 #sa-pop-sheet button:focus-visible,#sa-pop-sheet a:focus-visible,.sa-rail-more:focus-visible{outline:2px solid #007AFF;outline-offset:2px}
 /* rail: scroll hint chevron, replaces the mask fade on the right */
 #rail.fade-r{-webkit-mask-image:none;mask-image:none}
 #rail.fade-l.fade-r{-webkit-mask-image:linear-gradient(90deg,transparent 0,#000 36px,#000 100%);mask-image:linear-gradient(90deg,transparent 0,#000 36px,#000 100%)}
 .sa-rail-more{display:none;position:sticky;right:0;flex:0 0 56px;width:56px;height:60px;margin-left:-12px;border:0;padding:0 4px 0 0;align-items:center;justify-content:flex-end;color:#0F172A;cursor:pointer;background:linear-gradient(90deg,rgba(255,255,255,0),#fff 42%);z-index:3}
 #rail.fade-r .sa-rail-more{display:flex}
 .leaflet-control-attribution{max-width:calc(100vw - 80px)}
}

/* ===== EMIL POLISH: sheets (enter via starting-style, exit class, swipe grip, press) ===== */
@media(max-width:900px){
 #sa-pop-sheet{transform:none;transition:transform 300ms var(--ease-drawer)}
 @starting-style{#sa-pop-sheet{transform:translateY(100%)}}
 #sa-pop-sheet.out{transform:translateY(100%);transition-duration:200ms;pointer-events:none}
 #sa-pop-sheet.dragging{transition:none}
 .sa-pop-grip{position:absolute;top:0;left:0;right:52px;height:36px;touch-action:none;z-index:1}
 .sa-pop-x{transition:background-color 150ms ease,transform 160ms var(--ease-out)}
 .sa-pop-x:active{transform:scale(.92)}
 .sa-pop-body,.sa-pop-body h3,.sa-pop-body p,.sa-pop-body small{overflow-wrap:anywhere}
 .sa-sheet-handle{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;transition:background-color 150ms ease}
 .sa-sheet-handle:active{background:rgba(15,23,42,.04)}
 @keyframes saBodyIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
 #left.open .sa-sheet-body{animation:saBodyIn 220ms var(--ease-out) both}
 #sa-panel-back:active{transform:scale(.96)}
 .sa-rail-more:active{opacity:.7}
 .rail-btn{touch-action:manipulation}
}
@media (prefers-reduced-motion:reduce){
 #sa-pop-sheet,#sa-pop-sheet.out{transition-duration:1ms}
 @starting-style{#sa-pop-sheet{transform:none}}
 #left.open .sa-sheet-body{animation:none}
 #sa-panel-back:active,.sa-pop-x:active{transform:none}
}
