/*
 * SITARU WebGIS (/maps/{type}) - fullscreen MapLibre map with floating panels.
 * Layout and visual language ported from the SiDaTraWa WebGIS (Kota Bekasi), adapted
 * to SITARU's official RDTR data: per-kelurahan layers, zoning regulation by road class.
 */
:root {
	--slate-900: #0F172A;
	--slate-700: #334155;
	--slate-600: #475569;
	--slate-500: #64748B;
	--slate-400: #94A3B8;
	--slate-300: #CBD5E1;
	--slate-200: #E2E8F0;
	--slate-100: #F1F5F9;
	--surface: #FFFFFF;
	--accent-700: #115E59;
	--accent-600: #0F766E;
	--accent-500: #14B8A6;
	--accent-100: #CCFBF1;
	--accent-50: #F0FDFA;
	--radius-sm: 8px;
	--radius: 12px;
	--shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
	--shadow: 0 10px 30px -12px rgba(15, 23, 42, .25);
	--focus: 0 0 0 3px rgba(20, 184, 166, .45);
	--font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body.webgis-page { margin: 0; height: 100%; }
body.webgis-page { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--slate-900); -webkit-font-smoothing: antialiased; }
.webgis-page h1, .webgis-page h2, .webgis-page h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
.webgis-page p { margin: 0; }
.webgis-page a { color: var(--accent-600); text-decoration: none; }
.webgis-page :focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.webgis-page [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[data-lucide], .lucide { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: var(--radius-sm); font: 600 15px/1.2 var(--font); cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; white-space: nowrap; text-decoration: none; }
.btn--primary { background: var(--accent-600); color: #fff !important; box-shadow: 0 6px 16px -6px rgba(15, 118, 110, .6); }
.btn--primary:hover { background: var(--accent-700); }
.btn--outline { background: var(--surface); border-color: var(--slate-200); color: var(--slate-900) !important; }
.btn--outline:hover { border-color: var(--accent-500); color: var(--accent-600) !important; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: middle; line-height: 1.5; background: var(--slate-100); color: var(--slate-600); }

.autocomplete { position: relative; }
.autocomplete__list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); max-height: 320px; overflow: auto; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow); }
.autocomplete__item { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; color: var(--slate-900); }
.autocomplete__item[aria-selected="true"], .autocomplete__item:hover { background: var(--accent-50); }
.autocomplete__item .lucide { width: 16px; height: 16px; color: var(--slate-500); }
.autocomplete__item span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.autocomplete__item strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autocomplete__item small { font-size: 12px; color: var(--slate-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autocomplete__empty { padding: 10px; font-size: 14px; color: var(--slate-500); }

body.webgis-page { overflow: hidden; height: 100%; background: #E5E7EB; }
.webgis { position: fixed; inset: 0; --gap: 12px; --top: 72px; --dock-h: 64px; --panel-w: 360px; --drawer-w: 336px; }
.webgis__map { position: absolute; inset: 0; }
.webgis .lucide { width: 18px; height: 18px; }

.card-float { background: rgba(255, 255, 255, .97); border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: 0 8px 28px -12px rgba(15, 23, 42, .35); }

.tb-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--slate-200); border-radius: var(--radius-sm); background: var(--surface); color: var(--slate-700); cursor: pointer; flex-shrink: 0; }
.tb-btn:hover { color: var(--slate-900); border-color: var(--slate-300); }
.tb-btn--ghost { border-color: transparent; background: transparent; }

/* Top bar */
.topbar { position: absolute; z-index: 20; top: var(--gap); left: var(--gap); right: var(--gap); display: flex; align-items: center; gap: 8px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.topbar__brand { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px 0 8px; color: var(--slate-900) !important; background: rgba(255, 255, 255, .97); border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: 0 8px 28px -12px rgba(15, 23, 42, .35); width: var(--drawer-w); flex-shrink: 0; }
.topbar__brand img { width: auto; height: 32px; max-width: 136px; object-fit: contain; }
.topbar__brand span { display: flex; flex-direction: column; line-height: 1.15; }
.topbar__brand strong { font-size: 15px; font-weight: 800; }
.topbar__brand small { font-size: 12px; color: var(--slate-500); font-weight: 600; }
.topbar__layers { display: none; width: 48px; height: 48px; border-radius: var(--radius); box-shadow: 0 8px 28px -12px rgba(15, 23, 42, .35); }
.webgis.drawer-collapsed .topbar__layers { display: inline-grid; }
.topbar__search { position: relative; flex: 0 1 520px; min-width: 0; }
.topbar__search > .lucide { position: absolute; left: 14px; top: 15px; color: var(--slate-400); pointer-events: none; }
.topbar__search input { width: 100%; height: 48px; padding: 0 14px 0 42px; border: 1px solid var(--slate-200); border-radius: var(--radius); background: rgba(255, 255, 255, .97); box-shadow: 0 8px 28px -12px rgba(15, 23, 42, .35); font: 500 15px var(--font); color: var(--slate-900); }
.topbar__search input:focus { outline: none; border-color: var(--accent-500); box-shadow: var(--focus); }
.topbar__search input::placeholder { color: var(--slate-400); }
.crs-toggle { display: inline-flex; padding: 4px; height: 48px; align-items: center; border-radius: var(--radius); background: rgba(255, 255, 255, .97); border: 1px solid var(--slate-200); box-shadow: 0 8px 28px -12px rgba(15, 23, 42, .35); }
.crs-toggle button { height: 38px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--slate-600); font: 700 13px var(--font); cursor: pointer; white-space: nowrap; }
.crs-toggle button[aria-checked="true"] { background: var(--slate-900); color: #fff; }

/* Left drawer */
.drawer { position: absolute; z-index: 15; top: var(--top); left: var(--gap); bottom: calc(var(--gap) + 36px); width: var(--drawer-w); display: flex; flex-direction: column; background: rgba(255, 255, 255, .98); border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: 0 8px 28px -12px rgba(15, 23, 42, .35); transition: transform .25s ease, visibility .25s; }
.webgis.drawer-collapsed .drawer { transform: translateX(calc(-100% - 24px)); visibility: hidden; }
.drawer__home { display: none; align-items: center; gap: 6px; margin-right: auto; margin-left: 8px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--slate-100); color: var(--slate-700) !important; font-size: 13px; font-weight: 600; }
.drawer__home .lucide { width: 16px; height: 16px; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--slate-200); }
.drawer__title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; }
.drawer__title .lucide { color: var(--accent-600); }
.drawer__body { flex: 1; overflow-y: auto; padding: 8px 8px 16px; overscroll-behavior: contain; }
.drawer__note { display: flex; gap: 8px; margin: 12px 8px 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--slate-100); font-size: 12px; color: var(--slate-600); line-height: 1.5; }
.drawer__note > .lucide { width: 16px; height: 16px; margin-top: 1px; color: var(--slate-500); }
.drawer__note .badge { font-size: 9px; padding: 0 5px; }

.acc { border-bottom: 1px solid var(--slate-100); }
.acc__head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 8px; border: 0; background: none; text-align: left; font: 700 14px var(--font); color: var(--slate-900); cursor: pointer; border-radius: var(--radius-sm); }
.acc__head:hover { background: var(--slate-100); }
.acc__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--tone-bg); color: var(--tone); flex-shrink: 0; }
.acc__icon .lucide { width: 16px; height: 16px; }
.acc__label { flex: 1; display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.acc__label .badge { font-size: 9px; padding: 0 5px; margin-left: 4px; vertical-align: 1px; }
.acc__label small { font-size: 12px; font-weight: 500; color: var(--slate-500); }
.acc__chev { color: var(--slate-400); transition: transform .2s; }
.acc__head[aria-expanded="true"] .acc__chev { transform: rotate(180deg); }
.acc__panel { padding: 2px 8px 14px 50px; }
.layer-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; color: var(--slate-700); cursor: pointer; }
.layer-row input { width: 18px; height: 18px; accent-color: var(--accent-600); margin: 0; flex-shrink: 0; cursor: pointer; }
.layer-row__sym { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.layer-row__sym--line { height: 3px; border-radius: 2px; box-shadow: none; }
.layer-row__sym--point { border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, .2); width: 10px; height: 10px; margin: 0 2px; }
.layer-row__name { flex: 1; min-width: 0; }
.layer-row .badge { font-size: 9px; padding: 0 5px; }
.layer-row__count { font-size: 12px; color: var(--slate-500); font-variant-numeric: tabular-nums; }
.opacity { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--slate-500); }
.opacity input[type="range"] { flex: 1; accent-color: var(--accent-600); height: 24px; }
.opacity output { width: 36px; text-align: right; font-variant-numeric: tabular-nums; color: var(--slate-700); }

.legend { margin: 12px 8px 0; }
.legend__head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.legend__head h2 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--slate-500); }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--slate-700); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--slate-300); transition: background .15s; flex-shrink: 0; }
.switch__track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + .switch__track { background: var(--accent-600); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus); }
.legend__list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.legend__group { margin-top: 8px; font-size: 11px; font-weight: 700; color: var(--slate-500); text-transform: uppercase; letter-spacing: .05em; }
.legend__item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--slate-700); }
.legend__item code { font: 700 11px var(--font); color: var(--slate-500); min-width: 40px; }
.legend__empty { font-size: 13px; color: var(--slate-500); }

/* Right info panel */
.info-panel { position: absolute; z-index: 16; top: var(--top); right: var(--gap); bottom: calc(var(--gap) + 36px); width: var(--panel-w); display: flex; flex-direction: column; background: rgba(255, 255, 255, .99); border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: 0 8px 28px -12px rgba(15, 23, 42, .35); animation: panel-in .2s ease; }
.info-panel:focus { outline: none; }
@keyframes panel-in { from { opacity: 0; transform: translateX(12px); } }
.info-panel__grip { display: none; }
.info-panel__head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 8px 14px 16px; border-bottom: 1px solid var(--slate-200); }
.info-panel__head > div { flex: 1; min-width: 0; }
.info-panel__body { flex: 1; overflow-y: auto; padding: 16px; overscroll-behavior: contain; }
.info-panel__foot { padding: 12px 16px 16px; border-top: 1px solid var(--slate-200); }
.info-panel__foot:empty { display: none; }
.info-kicker { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--slate-500); text-transform: uppercase; letter-spacing: .05em; }
.info-title { margin-top: 6px; font-size: 18px; font-weight: 800; line-height: 1.3; }
.info-title .zone-chip { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 6px; background: var(--c); font-size: 14px; vertical-align: 2px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.info-sub { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--slate-600); }
.info-sub span { display: inline-flex; align-items: center; gap: 4px; }
.info-sub .lucide { width: 14px; height: 14px; color: var(--slate-400); }
.info-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; }
.info-metrics div { padding: 10px 6px; border-radius: var(--radius-sm); background: var(--slate-100); text-align: center; }
.info-metrics dt { font-size: 11px; font-weight: 700; color: var(--slate-500); letter-spacing: .04em; }
.info-metrics dd { margin: 2px 0 0; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.info-metrics dd small { font-size: 12px; color: var(--slate-500); }
.info-alert { display: flex; gap: 8px; margin-bottom: 14px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.45; background: #EFF6FF; color: #1E3A8A; border: 1px solid #BFDBFE; }
.info-alert .lucide { width: 16px; height: 16px; margin-top: 1px; }
.info-alert--warn { background: #FEF2F2; color: #7F1D1D; border-color: #FECACA; }
.itbx { margin-bottom: 14px; }
.itbx h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; font-weight: 800; }
.itbx h3 .lucide { width: 16px; height: 16px; }
.itbx--i h3 { color: #15803D; }
.itbx--t h3 { color: #B45309; }
.itbx--x h3 { color: #B91C1C; }
.itbx ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.itbx li { position: relative; padding-left: 14px; font-size: 14px; color: var(--slate-700); }
.itbx li::before { content: ''; position: absolute; left: 2px; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .5; }
.info-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.info-meta dt { color: var(--slate-500); }
.info-meta dd { margin: 0; font-weight: 600; word-break: break-word; }
.info-note { margin-top: 12px; font-size: 12px; color: var(--slate-500); }
.info-panel__foot .btn { width: 100%; }

/* Dock */
.dock { position: absolute; z-index: 18; left: 50%; bottom: var(--gap); transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 6px; background: rgba(255, 255, 255, .98); border: 1px solid var(--slate-200); border-radius: 14px; box-shadow: 0 12px 32px -12px rgba(15, 23, 42, .45); }
.dock__btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 76px; height: 52px; padding: 4px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--slate-700); font: 600 12px var(--font); cursor: pointer; white-space: nowrap; }
.dock__btn:hover { background: var(--slate-100); color: var(--slate-900); }
.dock__btn[aria-pressed="true"], .dock__btn[aria-expanded="true"] { background: var(--slate-900); color: #fff; }
.dock__btn--danger:hover { background: #FEF2F2; color: #B91C1C; }
.dock__sep { width: 1px; height: 32px; margin: 0 4px; background: var(--slate-200); }
.dock__basemap { position: relative; }
.basemap-menu { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: repeat(2, 128px); gap: 8px; padding: 10px; background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow); }
.basemap-menu button { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 2px solid transparent; border-radius: var(--radius-sm); background: none; font: 600 12px var(--font); color: var(--slate-700); cursor: pointer; text-align: left; }
.basemap-menu button:hover { background: var(--slate-100); }
.basemap-menu button[aria-checked="true"] { border-color: var(--accent-600); color: var(--slate-900); }
.basemap-menu__thumb { display: block; height: 64px; border-radius: 6px; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.basemap-menu__thumb--netral { background-image: url('https://a.basemaps.cartocdn.com/light_all/13/6530/4238.png'); }
.basemap-menu__thumb--osm { background-image: url('https://a.basemaps.cartocdn.com/rastertiles/voyager/13/6530/4238.png'); }
.basemap-menu__thumb--satelit { background-image: url('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/13/4238/6530'); }
.basemap-menu__thumb--kontur { background-image: url('https://a.tile.opentopomap.org/13/6530/4238.png'); }

.tool-hint { position: absolute; z-index: 19; left: 50%; bottom: calc(var(--gap) + var(--dock-h) + 14px); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; max-width: calc(100% - 24px); border-radius: var(--radius); background: var(--slate-900); color: #fff; font-size: 13px; box-shadow: var(--shadow); }
.tool-hint strong { font-variant-numeric: tabular-nums; }
.tool-hint button { height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .14); color: #fff; font: 600 12px var(--font); cursor: pointer; white-space: nowrap; }
.tool-hint button:hover { background: rgba(255, 255, 255, .24); }

.map-loading { position: absolute; z-index: 21; top: calc(var(--top) + 8px); left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px; background: var(--slate-900); color: #fff; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
.map-loading[hidden] { display: none; }
.map-loading__spin { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.statusbar { position: absolute; z-index: 14; left: calc(var(--gap) + var(--drawer-w) + var(--gap)); bottom: var(--gap); padding: 4px 10px; border-radius: 6px; background: rgba(255, 255, 255, .9); font: 600 12px var(--font); color: var(--slate-700); font-variant-numeric: tabular-nums; box-shadow: var(--shadow-sm); pointer-events: none; }
.webgis.drawer-collapsed .statusbar { left: var(--gap); }

/* MapLibre controls: keep clear of the floating panels */
.webgis .maplibregl-ctrl-bottom-right { right: var(--gap); bottom: calc(var(--gap) + 2px); transition: right .2s; }
.webgis.panel-open .maplibregl-ctrl-bottom-right { right: calc(var(--gap) * 2 + var(--panel-w)); }
.webgis .maplibregl-ctrl-bottom-left { left: calc(var(--gap) + var(--drawer-w) + var(--gap)); bottom: calc(var(--gap) + 30px); }
.webgis.drawer-collapsed .maplibregl-ctrl-bottom-left { left: var(--gap); }
.webgis .maplibregl-ctrl-group { border-radius: var(--radius-sm); box-shadow: 0 6px 20px -8px rgba(15, 23, 42, .4); }
.webgis .maplibregl-ctrl-group button { width: 36px; height: 36px; }
.webgis .maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 0 8px; }
.webgis .maplibregl-ctrl-bottom-left { display: flex; align-items: flex-end; gap: 8px; }
.webgis .maplibregl-ctrl-bottom-left .maplibregl-ctrl { margin: 0; }
.webgis .maplibregl-ctrl-attrib.maplibregl-compact:not(:hover):not(:focus-within) .maplibregl-ctrl-attrib-inner { display: none; }
.webgis .maplibregl-ctrl-attrib.maplibregl-compact:not(:hover):not(:focus-within) { padding-right: 0; }
.webgis .maplibregl-ctrl-scale { border-color: var(--slate-600); color: var(--slate-700); font: 600 11px var(--font); background: rgba(255, 255, 255, .85); }
.webgis .maplibregl-popup-content { padding: 12px 14px; border-radius: var(--radius-sm); font-family: var(--font); box-shadow: var(--shadow); }
.webgis .maplibregl-popup-close-button { width: 28px; height: 28px; font-size: 18px; }
.coord-pop { display: grid; gap: 4px; min-width: 210px; font-size: 13px; }
.coord-pop strong { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-500); }
.coord-pop code { font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--slate-900); }
.coord-pop button { justify-self: start; margin-top: 4px; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--slate-200); border-radius: 6px; background: #fff; font: 600 12px var(--font); cursor: pointer; }
.coord-pop button .lucide { width: 14px; height: 14px; }
.measure-label { padding: 3px 8px; border-radius: 6px; background: var(--slate-900); color: #fff; font: 700 12px var(--font); white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none; }
.drawer-backdrop { display: none; }

/* Tablet */
@media (max-width: 1100px) {
	.webgis { --drawer-w: 300px; --panel-w: 320px; }
	.dock__btn { min-width: 64px; padding: 4px 6px; }
}

/* Mobile: drawer as off-canvas, info panel as bottom sheet, scrollable dock */
@media (max-width: 768px) {
	.webgis { --gap: 10px; --top: 66px; }
	.topbar { gap: 6px; }
	.topbar__brand { display: none; }
	.drawer__home { display: inline-flex; }
	.topbar__layers, .webgis.drawer-collapsed .topbar__layers { display: inline-grid; width: 44px; height: 44px; }
	.topbar__search { flex: 1; }
	.topbar__search input { height: 44px; font-size: 16px; }
	.topbar__search > .lucide { top: 13px; }
	.crs-toggle { height: 44px; padding: 3px; }
	.crs-toggle button { height: 36px; padding: 0 8px; font-size: 11px; }
	.crs-toggle button span { display: none; }
	.drawer { top: 0; left: 0; bottom: 0; width: min(88vw, 360px); border-radius: 0 var(--radius) var(--radius) 0; z-index: 40; }
	.webgis:not(.drawer-open) .drawer { transform: translateX(-105%); visibility: hidden; }
	.drawer-backdrop { position: absolute; inset: 0; z-index: 39; background: rgba(15, 23, 42, .45); }
	.webgis.drawer-open .drawer-backdrop { display: block; }
	.info-panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 62vh; border-radius: 16px 16px 0 0; z-index: 30; animation-name: sheet-in; }
	@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
	.info-panel__grip { display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 4px; background: var(--slate-300); }
	.info-panel__head { padding-top: 8px; }
	.info-metrics dd { font-size: 18px; }
	.dock { left: var(--gap); right: var(--gap); transform: none; padding: 4px; gap: 0; }
	.dock__sep { display: none; }
	.dock__btn { flex: 1 1 0; min-width: 0; height: 56px; padding: 4px 2px; font-size: 11px; line-height: 1.15; white-space: normal; text-align: center; }
	.dock__basemap { flex: 1 1 0; display: flex; }
	.dock__basemap { position: static; }
	.basemap-menu { position: fixed; left: var(--gap); right: var(--gap); bottom: calc(var(--gap) + var(--dock-h) + 12px); transform: none; grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.basemap-menu__thumb { height: 52px; }
	.statusbar { display: none; }
	.webgis .maplibregl-ctrl-bottom-right { bottom: calc(var(--gap) + var(--dock-h) + 12px); }
	.webgis.panel-open .maplibregl-ctrl-bottom-right { right: var(--gap); }
	.webgis .maplibregl-ctrl-bottom-left, .webgis.drawer-collapsed .maplibregl-ctrl-bottom-left { left: var(--gap); bottom: calc(var(--gap) + var(--dock-h) + 12px); }
	.tool-hint { bottom: calc(var(--gap) + var(--dock-h) + 56px); }
}

/* Printable ITR/KRK summary */
.print-sheet { display: none; }
@media print {
	@page { size: A4; margin: 16mm; }
	body.webgis-page { overflow: visible; background: #fff; }
	.webgis { display: none !important; }
	.print-sheet { display: block !important; font-family: var(--font); color: #000; font-size: 11pt; }
	.print-sheet h1 { font-size: 16pt; margin: 0 0 4pt; }
	.print-sheet h2 { font-size: 12pt; margin: 14pt 0 6pt; border-bottom: 1px solid #999; padding-bottom: 3pt; }
	.print-sheet table { width: 100%; border-collapse: collapse; }
	.print-sheet td, .print-sheet th { border: 1px solid #999; padding: 4pt 6pt; text-align: left; vertical-align: top; }
	.print-sheet .print-head { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 8pt; margin-bottom: 10pt; }
	.print-sheet .print-watermark { margin: 8pt 0; padding: 6pt 8pt; border: 1px dashed #B45309; color: #92400E; font-weight: 700; }
	.print-sheet .print-map { width: 100%; max-height: 90mm; object-fit: cover; border: 1px solid #999; }
}

/* ---------- SITARU additions ---------- */
.section-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--slate-500); }

/* Map type tabs under the drawer header */
.type-tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--slate-200); overflow-x: auto; scrollbar-width: none; }
.type-tabs::-webkit-scrollbar { display: none; }
.type-tabs a { flex: 1 0 auto; padding: 7px 10px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; color: var(--slate-600) !important; text-align: center; white-space: nowrap; }
.type-tabs a:hover { background: var(--slate-100); color: var(--slate-900) !important; }
.type-tabs a[aria-current="page"] { background: var(--slate-900); color: #fff !important; }

/* Region (kelurahan) picker */
.region { margin: 8px 8px 4px; display: grid; gap: 8px; }
.region__card { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-50); border: 1px solid var(--accent-100); font-size: 13px; font-weight: 600; color: var(--accent-700); line-height: 1.4; }
.region__card .lucide { width: 16px; height: 16px; margin-top: 1px; }
.region__card small { display: block; font-weight: 500; color: var(--slate-600); }
.region__card.is-empty { background: var(--slate-100); border-color: var(--slate-200); color: var(--slate-600); font-weight: 500; }
.region__select { width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--slate-200); border-radius: var(--radius-sm); background: var(--surface); font: 500 14px var(--font); color: var(--slate-900); }
.region__select:focus { outline: none; border-color: var(--accent-500); box-shadow: var(--focus); }
.link-btn { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 2px; border: 0; background: none; font: 600 13px var(--font); color: var(--accent-600); cursor: pointer; }
.link-btn .lucide { width: 14px; height: 14px; }
.link-btn:hover { color: var(--accent-700); text-decoration: underline; }

/* Layer accordion: counts, empty layers, select all */
.acc__count { margin-left: auto; padding: 1px 7px; border-radius: 999px; background: var(--slate-100); font-size: 11px; font-weight: 700; color: var(--slate-600); font-variant-numeric: tabular-nums; }
.acc__count.is-on { background: var(--accent-100); color: var(--accent-700); }
.acc__tools { display: flex; gap: 12px; margin: 0 0 4px; }
.layer-row.is-empty { opacity: .45; cursor: default; }
.layer-row.is-empty input { cursor: default; }
.layer-row__sym--polygon { border: 2px solid var(--stroke, rgba(0, 0, 0, .25)); box-shadow: none; }
.drawer__empty { margin: 16px 8px; padding: 14px; border-radius: var(--radius-sm); background: var(--slate-100); font-size: 13px; color: var(--slate-600); }

/* Info panel: road class tabs, activity groups, overlapping objects, photos */
.road-tabs { display: flex; gap: 4px; margin-bottom: 8px; padding: 3px; border-radius: var(--radius-sm); background: var(--slate-100); }
.road-tabs button { flex: 1; height: 32px; border: 0; border-radius: 6px; background: none; font: 700 12px var(--font); color: var(--slate-600); cursor: pointer; }
.road-tabs button[aria-selected="true"] { background: var(--surface); color: var(--slate-900); box-shadow: var(--shadow-sm); }
.info-metrics dt abbr { text-decoration: underline dotted; cursor: help; }
.info-hint { margin: -8px 0 16px; font-size: 12px; color: var(--slate-500); }
.itbx--b h3 { color: #B45309; }
.itbx--t h3 { color: #C2410C; }
.info-also { display: grid; gap: 6px; margin-bottom: 16px; }
.info-also h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--slate-500); }
.info-also button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid var(--slate-200); border-radius: var(--radius-sm); background: var(--surface); font: 600 13px var(--font); color: var(--slate-700); text-align: left; cursor: pointer; }
.info-also button:hover { border-color: var(--accent-500); color: var(--accent-700); }
.info-also .layer-row__sym { width: 12px; height: 12px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 16px; }
.photos a { display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--slate-100); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.info-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.info-actions .btn { min-height: 40px; padding: 8px 10px; font-size: 13px; }
.info-panel__foot { display: grid; gap: 8px; }
.skeleton { display: grid; gap: 10px; }
.skeleton span { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--slate-100), var(--slate-200), var(--slate-100)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton span:nth-child(2) { width: 70%; }
.skeleton span:nth-child(3) { width: 85%; height: 56px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Toast */
.toast { position: absolute; z-index: 25; left: 50%; top: calc(var(--top) + 8px); transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; background: var(--slate-900); color: #fff; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }

/* Hover label for kelurahan in city overview */
.webgis .maplibregl-popup.hover-tip .maplibregl-popup-content { padding: 4px 10px; font: 700 12px var(--font); color: var(--slate-900); pointer-events: none; }
.webgis .maplibregl-popup.hover-tip .maplibregl-popup-tip { display: none; }

@media (max-width: 768px) {
	.info-panel { max-height: 70vh; }
	.photos { grid-template-columns: repeat(4, 1fr); }
}

@media print {
	.print-sheet .print-note { margin-top: 14pt; font-size: 9pt; }
	.print-sheet .print-sub { font-size: 10pt; color: #333; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Site menu (same items as the site header) ---------- */
.topbar__menu { width: auto; height: 48px; padding: 0 14px; gap: 8px; display: inline-flex; align-items: center; margin-left: auto; border-radius: var(--radius); box-shadow: 0 8px 28px -12px rgba(15, 23, 42, .35); font: 700 14px var(--font); color: var(--slate-900); }
.site-menu-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .45); }
.site-menu { position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(92vw, 380px); display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow); animation: menu-in .2s ease; }
@keyframes menu-in { from { transform: translateX(24px); opacity: 0; } }
.site-menu__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 12px 16px; border-bottom: 1px solid var(--slate-200); }
.site-menu__brand { display: inline-flex; align-items: center; gap: 10px; color: var(--slate-900) !important; }
.site-menu__brand img { border-radius: 6px; }
.site-menu__brand span { display: flex; flex-direction: column; line-height: 1.15; }
.site-menu__brand strong { font-size: 15px; font-weight: 800; }
.site-menu__brand small { font-size: 12px; color: var(--slate-500); font-weight: 600; }
.site-menu__body { flex: 1; overflow-y: auto; padding: 8px 8px 16px; overscroll-behavior: contain; }
.site-menu__list, .site-menu__sub { margin: 0; padding: 0; list-style: none; }
.site-menu__sub { margin: 0 0 6px 18px; padding-left: 8px; border-left: 2px solid var(--slate-200); }
.site-menu__link { display: flex; align-items: center; gap: 8px; padding: 10px 10px; border-radius: var(--radius-sm); color: var(--slate-700) !important; font-size: 15px; font-weight: 600; }
.site-menu__link:hover { background: var(--slate-100); color: var(--slate-900) !important; }
.site-menu__item.active > .site-menu__link { background: var(--accent-50); color: var(--accent-700) !important; }
.site-menu__link.site-menu__group { color: var(--slate-500) !important; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; pointer-events: none; padding-top: 14px; }
.site-menu__sub .site-menu__link { font-size: 14px; font-weight: 500; padding: 8px 10px; }
.site-menu__sub .site-menu__link.site-menu__group { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 700; color: var(--slate-700) !important; padding-top: 8px; }
.site-menu__link .mdi { display: none; }
.site-menu__foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--slate-200); }
.site-menu__foot .btn { min-height: 42px; font-size: 14px; }
@media (max-width: 768px) {
	.topbar__menu { width: 44px; height: 44px; padding: 0; justify-content: center; margin-left: 0; }
	.topbar__menu-label { display: none; }
}
