/* Map: full screen with floating controls (sjo-map-full.js). Normal page: the button stack at the top-right of the map (full screen, zoom, fit).
   Full screen: <html class="fv-fs"> hides the sidebar and top bar, the map card fills the screen, the right-hand panels float, the floating bar / legend / alert appear. */

.fv-map .fv-mapcard { position: relative; }
.fs-stack { position: absolute; top: 10px; right: 10px; z-index: 900; display: flex; flex-direction: column; gap: 6px; }
.fs-ib { width: 34px; height: 34px; border-radius: 8px; background: var(--imat-surface); border: 1px solid var(--imat-control-line); color: var(--imat-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font: 600 18px/1 system-ui, sans-serif; box-shadow: 0 2px 6px rgba(16, 24, 40, .1); padding: 0; }
.fs-ib:hover { background: var(--imat-row-hover); }
.fs-ib svg { width: 17px; height: 17px; }
.fs-ib.fs-main { background: var(--imat-primary); border-color: var(--imat-primary); color: var(--imat-on-primary); }
.fs-ib.fs-main:hover { background: var(--imat-primary-hover); }
.fs-ib.is-on { background: var(--imat-tint); border-color: var(--imat-primary); color: var(--imat-primary); }
.fs-ask { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 900; border: 1px solid var(--imat-primary); background: var(--imat-primary); color: var(--imat-on-primary); border-radius: 999px; padding: 5px 14px; font: 600 12.5px system-ui, sans-serif; cursor: pointer; box-shadow: 0 2px 8px rgba(16, 24, 40, .2); }

/* floating controls exist only in full screen */
.fs-bar, .fs-legend, .fs-alert, .fs-hint { display: none; }
.fv-map.fs-on .fs-bar { display: flex; }
.fv-map.fs-on .fs-legend { display: flex; }
.fv-map.fs-on .fs-alert { display: flex; }
.fv-map.fs-on .fs-hint { display: block; }
.fs-bar[hidden], .fs-legend[hidden], .fs-alert[hidden], .fs-hint[hidden] { display: none !important; }

.fs-bar { position: absolute; z-index: 880; left: 10px; top: 10px; right: 56px; gap: 6px; align-items: center; flex-wrap: wrap; pointer-events: none; }
.fs-glass { pointer-events: auto; background: color-mix(in srgb, var(--imat-surface) 94%, transparent); border: 1px solid var(--imat-control-line); border-radius: 9px; box-shadow: 0 2px 8px rgba(16, 24, 40, .1); display: flex; align-items: center; gap: 8px; padding: 4px 8px; font: 12.5px system-ui, sans-serif; color: var(--imat-text); backdrop-filter: blur(4px); }
.fs-glass b { font-size: 13.5px; }
.fs-glass label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.fs-glass input[type=checkbox], .fs-glass input[type=radio] { accent-color: var(--imat-text); margin: 0; }
.fs-glass select { height: 28px; border: 1px solid var(--imat-control-line); border-radius: 7px; padding: 0 6px; font: inherit; background: var(--imat-surface); max-width: 220px; }
.fs-seg { display: inline-flex; border: 1px solid var(--imat-control-line); border-radius: 8px; overflow: hidden; background: var(--imat-surface); }
.fs-seg button { border: 0; border-right: 1px solid var(--imat-control-line); background: var(--imat-surface); padding: 4px 10px; font: inherit; cursor: pointer; }
.fs-seg button:last-child { border-right: 0; }
.fs-seg .is-on { background: var(--imat-tint); color: var(--imat-primary); font-weight: 600; }
.fs-live { font-weight: 600; padding: 5px 10px; }
.fs-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--imat-up); box-shadow: 0 0 0 0 rgba(34, 160, 107, .6); animation: fs-pulse 1.8s infinite; }
.fs-live.is-stale i { background: var(--imat-warn); animation: none; }
@keyframes fs-pulse { 70% { box-shadow: 0 0 0 7px rgba(34, 160, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 160, 107, 0); } }
.fs-bells { margin-left: auto; padding: 3px 6px; gap: 4px; }
.fs-bell { position: relative; width: 32px; height: 32px; border: 0; border-radius: 7px; background: transparent; color: var(--imat-text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.fs-bell[hidden] { display: none; }
.fs-bell:hover { background: var(--imat-row-hover); }
.fs-bell.fv-bell-network.has-unread { color: var(--imat-down); }
.fs-bell.fv-bell-customer.has-unread { color: var(--imat-primary); }
.fs-bell .nb-badge { top: -2px; right: -2px; }

.fs-hint { position: absolute; z-index: 890; left: 50%; transform: translateX(-50%); top: var(--fs-top, 58px); background: color-mix(in srgb, var(--imat-text) 92%, transparent); color: var(--imat-surface); border-radius: 8px; padding: 6px 12px; font: 12.5px system-ui, sans-serif; pointer-events: none; }
.fs-legend { position: absolute; z-index: 870; left: 10px; bottom: 10px; gap: 10px; align-items: center; background: color-mix(in srgb, var(--imat-surface) 94%, transparent); border: 1px solid var(--imat-control-line); border-radius: 9px; padding: 6px 10px; font: 12px system-ui, sans-serif; color: var(--imat-text); }
.fs-legend span { display: inline-flex; align-items: center; gap: 4px; }
.fs-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.fs-alert { position: absolute; z-index: 880; left: 50%; transform: translateX(-50%); bottom: 10px; max-width: calc(100% - 420px); border-left: 4px solid var(--imat-down); padding: 6px 12px; gap: 8px; }
.fs-alert b { color: var(--imat-down); font-size: 12px; letter-spacing: .02em; }
.fs-alert span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fs-alert button { flex: none; font: inherit; font-size: 12px; border: 1px solid var(--imat-control-line); border-radius: 6px; background: var(--imat-surface); padding: 2px 9px; cursor: pointer; }
.fs-alert button:hover { background: var(--imat-row-hover); }

/* ---------------------------------------------------------------- the page in full screen */
html.fv-fs, html.fv-fs body { overflow: hidden !important; }
html.fv-fs .fi-sidebar, html.fv-fs .fi-sidebar-close-overlay, html.fv-fs .fi-topbar, html.fv-fs .prov-bar, html.fv-fs .fv-map .fv-top, html.fv-fs .fv-map .fv-bar2.geo-bar, html.fv-fs .fv-bell-host, html.fv-fs #fv-dnd { display: none !important; }
html.fv-fs .fv-map .fv-mapcard { position: fixed !important; inset: 0 !important; z-index: 60; width: auto !important; height: auto !important; max-width: none; border-radius: 0; border: 0; margin: 0; flex: none !important; }   /* the page sets position / flex inline */
html.fv-fs .fv-map .leaflet-bottom.leaflet-left { margin-bottom: 46px; }   /* the zone / OLT legend of the map sits above the full-screen legend */
html.fv-fs .fv-map .map-canvas { border-radius: 0; height: 100%; }
html.fv-fs .fv-map .fv-body { padding: 0; }

/* the tool chips of the page (Barangay borders, Offline heat, Draw an area, Signal quality, Fibre trace ...) are one "Tools" button under the top bar (.fs-tools): its menu is the
   page's own chip row (.mp-tools-bar), opened under the button; a tool that is switched on stays beside the button as a pill with an x. The map view switch is left out of the menu:
   the top bar already has Service zones / OLT areas. --fs-bar-h and --fs-tools-h are set by sjo-map-full.js. */
.fs-tools { display: none; }
.fv-map.fs-on .fs-tools { display: flex; }
.fs-tools { position: absolute; z-index: 880; left: 10px; top: calc(var(--fs-bar-h, 36px) + 16px); flex-wrap: wrap; gap: 5px 6px; max-width: calc(100% - 70px); }
.fs-tools-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; padding: 3px 6px; border-radius: 7px; }
.fs-tools-btn:hover, .fs-tools-btn.is-on { background: var(--imat-row-hover); }
.fs-tools-n { background: var(--imat-primary); color: var(--imat-on-primary); border-radius: 999px; font-size: 11px; line-height: 1; padding: 3px 6px; }
.fs-pill { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--imat-primary-line); background: var(--imat-tint); color: var(--imat-primary); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 12px; white-space: nowrap; }
.fs-pill button { border: 0; background: transparent; color: inherit; cursor: pointer; font: 600 15px/1 system-ui, sans-serif; width: 18px; height: 18px; border-radius: 50%; padding: 0; }
.fs-pill button:hover { background: rgba(23, 92, 211, .15); }
html.fv-fs .fv-map .fv-bar2.mp-tools-bar { display: none !important; position: fixed; z-index: 890; left: 10px; top: calc(var(--fs-bar-h, 36px) + 16px + var(--fs-tools-h, 34px) + 6px); width: min(560px, calc(100vw - 80px)); min-height: 0; flex: none; flex-wrap: wrap; align-items: center; gap: 5px 6px; white-space: normal; overflow: visible; padding: 8px;
    background: color-mix(in srgb, var(--imat-surface) 96%, transparent); border: 1px solid var(--imat-control-line); border-radius: 10px; box-shadow: 0 4px 16px rgba(16, 24, 40, .16); }
html.fv-fs .fv-map.fs-tools-open .fv-bar2.mp-tools-bar { display: flex !important; }
html.fv-fs .fv-map .fv-bar2.mp-tools-bar .fv-seg { display: none; }
html.fv-fs .fv-map .fv-bar2.mp-tools-bar .fv-dim { white-space: normal; }

/* the right-hand panels (NAP details, list, cities ...) float on the right, under the bar, and can be hidden */
html.fv-fs .fv-map .fv-body > .fv-card:not(.fv-mapcard) { position: fixed; z-index: 70; right: 56px; top: var(--fs-top, 58px); width: min(340px, calc(100vw - 80px)); min-width: 0 !important; max-height: calc(100vh - var(--fs-top, 58px) - 70px); overflow: auto; flex: none; background: color-mix(in srgb, var(--imat-surface) 96%, transparent); border: 1px solid var(--imat-control-line); border-radius: 10px; box-shadow: 0 4px 16px rgba(16, 24, 40, .16); }
.fv-map.fs-nopanel .fv-body > .fv-card:not(.fv-mapcard) { display: none !important; }
html.fv-fs .fv-map .mp-find { top: var(--fs-top, 58px); left: 10px; }
html.fv-fs .fv-map .mp-msg { bottom: 58px; }

/* the bell panel and the pop-ups stay above the full-screen map */
html.fv-fs #fv-bell-panel, html.fv-fs #fv-toasts, html.fv-fs .fv-toasts { z-index: 1500; }

/* narrow screens (tablets): nothing covers anything else */
@media (max-width: 1100px) {
    .fs-alert { max-width: calc(100% - 140px); bottom: 56px; }
    .fs-legend { bottom: 10px; }
    .fs-glass select { max-width: 150px; }
}
@media (max-width: 800px) {
    .fs-live span { white-space: nowrap; }
    html.fv-fs .fv-map .fv-body > .fv-card:not(.fv-mapcard) { max-height: calc(100vh - var(--fs-top, 58px) - 120px); }
}
@media (pointer: coarse) { .fs-ib { width: 40px; height: 40px; } .fs-bell { width: 38px; height: 38px; } .fs-bar { right: 62px; } .fs-tools-btn { padding: 6px 8px; } .fs-pill button { width: 26px; height: 26px; } html.fv-fs .fv-map .fv-body > .fv-card:not(.fv-mapcard) { right: 62px; } }

/* the page-enter animation leaves a transform on the page: a transformed parent would make the fixed map card fill the PAGE instead of the screen */
html.fv-fs .fv-map, html.fv-fs .fi-page-main, html.fv-fs .fi-page, html.fv-fs .fi-main, html.fv-fs .fi-main-ctn, html.fv-fs .fv-map .fv-body { transform: none !important; animation: none !important; filter: none !important; will-change: auto !important; contain: none !important; }
@media (max-width: 1100px) { html.fv-fs .fv-map .leaflet-bottom.leaflet-left { display: none; } }   /* the legend of the full-screen bar already names the colours */
