:root {
  --bg: #07111c;
  --surface-0: #0a1622;
  --surface-1: #0d1c2a;
  --surface-2: #122536;
  --surface-3: #173044;
  --line: rgba(177, 205, 225, .13);
  --line-strong: rgba(177, 205, 225, .24);
  --text: #edf6fb;
  --muted: #8ca6b8;
  --faint: #627b8e;
  --accent: #62e8c5;
  --accent-strong: #18cba0;
  --blue: #62a9ff;
  --warning: #f8c65c;
  --danger: #ff7484;
  --success: #55e6a5;
  --violet: #ad8cff;
  --shadow: 0 18px 55px rgba(0, 0, 0, .32);
  --header-h: 68px;
  --left-w: 294px;
  --right-w: 360px;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 190px; }
.brand-lockup strong { display: block; letter-spacing: .16em; font-size: 15px; }
.brand-lockup small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.brand-lockup--large strong { font-size: 21px; }
.brand-lockup--large small { font-size: 11px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(98,232,197,.19), rgba(98,169,255,.08)); border: 1px solid rgba(98,232,197,.25); box-shadow: inset 0 0 20px rgba(98,232,197,.08); }
.brand-mark svg { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linejoin: round; }
.brand-mark svg circle { fill: var(--accent); stroke: none; }

.button { min-height: 38px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 0 14px; background: var(--surface-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 12px; transition: transform .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(98,232,197,.45); }
.button:disabled { opacity: .42; cursor: not-allowed; }
.button--primary { color: #05231c; border-color: transparent; background: linear-gradient(135deg, var(--accent), #42dcb7); box-shadow: 0 9px 26px rgba(24,203,160,.18); }
.button--success { color: #09251b; background: var(--success); border-color: transparent; }
.button--danger { color: #2a070c; background: var(--danger); border-color: transparent; }
.button--warning { color: #2b1b00; background: var(--warning); border-color: transparent; }
.button--quiet { background: rgba(17,38,54,.75); }
.button--wide { width: 100%; }
.button--small { min-height: 34px; }
kbd { min-width: 20px; height: 20px; padding: 0 5px; display: inline-grid; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 5px; background: rgba(0,0,0,.18); font-family: inherit; font-size: 10px; color: currentColor; box-shadow: inset 0 -1px rgba(255,255,255,.08); }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.muted { color: var(--muted); }

/* Login */
.login-page { min-height: 100%; background: #06101a; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(420px, .75fr); }
.login-story { position: relative; overflow: hidden; padding: clamp(34px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(circle at 28% 20%, rgba(28,189,158,.16), transparent 28%), radial-gradient(circle at 72% 76%, rgba(61,132,227,.16), transparent 34%), linear-gradient(145deg, #071522, #091b29); }
.login-story::before { content: ""; position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 46px 46px; transform: perspective(500px) rotateX(60deg) scale(1.4) translateY(15%); transform-origin: bottom; }
.login-story::after { content: ""; position: absolute; width: 420px; height: 420px; right: -110px; top: 15%; border: 1px solid rgba(98,232,197,.14); border-radius: 44% 56% 60% 40%; box-shadow: 0 0 0 38px rgba(98,232,197,.025), 0 0 0 90px rgba(98,169,255,.02); transform: rotate(24deg); }
.login-story > * { position: relative; z-index: 1; }
.login-copy { max-width: 770px; margin: auto 0; padding: 70px 0; }
.login-copy h1 { max-width: 720px; margin: 16px 0 20px; font-size: clamp(44px, 5.6vw, 82px); line-height: .98; letter-spacing: -.055em; }
.login-copy > p { max-width: 680px; color: #abc0ce; font-size: clamp(16px, 1.35vw, 21px); line-height: 1.6; }
.capability-grid { max-width: 690px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 42px; }
.capability-grid div { padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: rgba(7,17,28,.44); backdrop-filter: blur(8px); }
.capability-grid b { display: block; color: var(--accent); font-size: 10px; letter-spacing: .12em; }
.capability-grid span { display: block; margin-top: 10px; font-weight: 700; font-size: 12px; }
.login-disclaimer { max-width: 720px; color: var(--faint); font-size: 11px; line-height: 1.55; }
.login-panel { display: grid; place-items: center; padding: 34px; background: #08131f; border-left: 1px solid var(--line); }
.login-card { width: min(420px, 100%); }
.status-pill { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; }
.status-pill i, .sync-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 13px var(--success); }
.login-card h2 { margin: 28px 0 8px; font-size: 34px; letter-spacing: -.035em; }
.login-card > p { color: var(--muted); line-height: 1.6; }
.auth-form { margin-top: 32px; }
.auth-form label { display: block; color: #bfd0da; font-size: 11px; font-weight: 700; margin: 18px 0 7px; }
.auth-form input, .attribute-form input, .attribute-form select, .attribute-form textarea, .kenav-dialog textarea { width: 100%; color: var(--text); background: #0b1b29; border: 1px solid var(--line-strong); border-radius: 9px; padding: 12px; outline: none; transition: border-color .16s, box-shadow .16s; }
.auth-form input { min-height: 48px; }
.auth-form input:focus, .attribute-form input:focus, .attribute-form select:focus, .attribute-form textarea:focus, .kenav-dialog textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(98,232,197,.10); }
.auth-form .button { margin-top: 24px; min-height: 47px; }
.demo-credentials { margin-top: 24px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--muted); font-size: 11px; }
.demo-credentials code { color: var(--accent); }
.alert { margin: 18px 0; border-radius: 9px; padding: 11px 12px; font-size: 12px; line-height: 1.45; }
.alert--danger { color: #ffbdc5; background: rgba(255,116,132,.09); border: 1px solid rgba(255,116,132,.25); }

/* Workspace shell */
.workspace-page { overflow: hidden; }
.app-shell { height: 100vh; display: grid; grid-template-columns: var(--left-w) minmax(420px, 1fr) var(--right-w); grid-template-rows: var(--header-h) 1fr; background: var(--bg); }
.app-header { grid-column: 1 / -1; display: grid; grid-template-columns: var(--left-w) 1fr auto; align-items: center; border-bottom: 1px solid var(--line); background: rgba(8,19,31,.96); padding: 0 18px; z-index: 1002; }
.workspace-context { height: 42px; padding-left: 21px; border-left: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.context-kicker { color: var(--faint); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.context-title { width: max-content; border: 0; background: none; padding: 2px 0 0; font-size: 13px; font-weight: 750; cursor: default; }
.context-title span { color: var(--muted); }
.header-actions { display: flex; align-items: center; justify-content: end; gap: 10px; }
.sync-status { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; color: var(--muted); font-size: 10px; }
.sync-status.is-error i { background: var(--danger); box-shadow: 0 0 13px var(--danger); }
.icon-button, .ghost-icon { border: 1px solid var(--line); border-radius: 9px; background: rgba(16,37,53,.68); cursor: pointer; display: grid; place-items: center; }
.icon-button { width: 38px; height: 36px; font-size: 10px; font-weight: 800; }
.ghost-icon { width: 29px; height: 29px; color: var(--muted); font-size: 17px; }
.icon-button:hover, .ghost-icon:hover { color: var(--accent); border-color: rgba(98,232,197,.32); }
.user-chip { height: 38px; display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 5px; border: 1px solid var(--line); border-radius: 10px; }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), var(--blue)); color: #062019; display: grid; place-items: center; font-weight: 900; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: 10px; }
.user-chip small { margin-top: 1px; color: var(--muted); font-size: 9px; }
.header-actions form { margin: 0; }
.left-rail { grid-column: 1; grid-row: 2; background: var(--surface-0); border-right: 1px solid var(--line); overflow: hidden; z-index: 800; }
.rail-scroll { height: 100%; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.rail-section { padding: 17px 17px 18px; border-bottom: 1px solid var(--line); }
.rail-section--hero { padding-top: 19px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.section-heading small, .section-heading strong { display: block; }
.section-heading small { margin-bottom: 3px; color: var(--faint); font-size: 8px; text-transform: uppercase; letter-spacing: .13em; }
.section-heading strong { font-size: 12px; }
.progress-ring-wrap { display: flex; align-items: center; gap: 17px; }
.progress-ring { --progress: 0; position: relative; width: 77px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--progress) * 1%), rgba(255,255,255,.07) 0); }
.progress-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface-0); }
.progress-ring span { position: relative; text-align: center; }
.progress-ring strong, .progress-ring small { display: block; }
.progress-ring strong { font-size: 16px; }
.progress-ring small { color: var(--muted); font-size: 8px; }
.progress-copy strong { display: block; font-size: 21px; letter-spacing: -.04em; }
.progress-copy span, .progress-copy small { display: block; color: var(--muted); }
.progress-copy span { margin-top: 3px; font-size: 10px; }
.progress-copy small { margin-top: 8px; color: var(--faint); font-size: 9px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 11px; }
.metric-card { position: relative; min-height: 70px; padding: 11px; color: var(--text); border: 1px solid var(--line); border-radius: 10px; background: rgba(17,38,54,.46); text-align: left; cursor: pointer; }
.metric-card:hover, .metric-card.is-active { border-color: rgba(98,232,197,.35); background: rgba(23,48,68,.72); }
.metric-card strong, .metric-card small { display: block; padding-left: 29px; }
.metric-card strong { font-size: 17px; line-height: 1.05; }
.metric-card small { margin-top: 5px; color: var(--muted); font-size: 8px; }
.metric-icon { position: absolute; left: 10px; top: 11px; width: 21px; height: 21px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 900; }
.metric-icon--all { color: var(--accent); background: rgba(98,232,197,.12); }
.metric-icon--low { color: var(--danger); background: rgba(255,116,132,.12); }
.metric-icon--medium { color: var(--warning); background: rgba(248,198,92,.12); }
.metric-icon--high { color: var(--blue); background: rgba(98,169,255,.12); }
.layer-list { display: grid; gap: 5px; }
.layer-row { min-height: 34px; padding: 0 9px; display: flex; align-items: center; justify-content: space-between; border-radius: 8px; cursor: pointer; color: #c6d5de; font-size: 10px; }
.layer-row:hover { background: rgba(255,255,255,.025); }
.layer-row span { display: flex; align-items: center; gap: 9px; }
.layer-row input { appearance: none; width: 28px; height: 16px; position: relative; border-radius: 99px; background: #20394b; cursor: pointer; transition: .15s; }
.layer-row input::after { content: ""; position: absolute; width: 12px; height: 12px; left: 2px; top: 2px; border-radius: 50%; background: #7690a1; transition: .15s; }
.layer-row input:checked { background: rgba(98,232,197,.28); }
.layer-row input:checked::after { transform: translateX(12px); background: var(--accent); }
.swatch { width: 12px; height: 12px; border-radius: 3px; }
.swatch--building { background: rgba(98,232,197,.22); border: 1px solid var(--accent); }
.swatch--road { height: 2px; background: var(--blue); }
.swatch--parcel { background: transparent; border: 1px dashed var(--warning); }
.swatch--entrance { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 0 3px rgba(173,140,255,.12); }
.segmented { display: flex; padding: 3px; background: rgba(0,0,0,.18); border-radius: 9px; }
.segmented--wrap { flex-wrap: wrap; gap: 3px; }
.segmented button { flex: 1 0 auto; min-height: 27px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 9px; cursor: pointer; }
.segmented button:hover, .segmented button.is-active { color: var(--text); background: var(--surface-3); }
.model-card { background: linear-gradient(145deg, rgba(98,232,197,.05), transparent 60%); }
.mini-badge { padding: 4px 6px; border: 1px solid rgba(98,232,197,.25); border-radius: 5px; color: var(--accent); font-size: 8px; }
.model-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.model-metrics span { padding: 9px 7px; background: rgba(0,0,0,.14); border-radius: 7px; }
.model-metrics small, .model-metrics strong { display: block; }
.model-metrics small { color: var(--faint); font-size: 7px; }
.model-metrics strong { margin-top: 4px; font-size: 12px; }
.model-card p { margin: 10px 0 0; color: var(--faint); font-size: 8px; line-height: 1.5; }

/* Map */
.map-stage { grid-column: 2; grid-row: 2; position: relative; overflow: hidden; background: #10212f; }
#map { position: absolute; inset: 0; background: #132736; }
.leaflet-container { font-family: inherit; }
.leaflet-control-zoom a { color: var(--text) !important; background: rgba(9,23,34,.92) !important; border-color: var(--line) !important; }
.leaflet-control-attribution { color: #7e96a5; background: rgba(5,14,22,.72) !important; font-size: 8px !important; }
.leaflet-control-attribution a { color: #a9c0ce; }
.leaflet-tooltip.kenav-label { color: #dffaf3; background: rgba(4,16,24,.78); border: 1px solid rgba(98,232,197,.25); box-shadow: none; font-size: 8px; font-weight: 700; padding: 3px 5px; }
.leaflet-tooltip.kenav-label::before { display: none; }
.map-search { position: absolute; z-index: 600; left: 18px; top: 17px; width: min(360px, calc(100% - 180px)); height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid rgba(198,221,236,.18); border-radius: 10px; background: rgba(7,20,31,.91); backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.map-search > span { color: var(--accent); font-size: 20px; }
.map-search input { min-width: 0; flex: 1; color: var(--text); border: 0; outline: 0; background: transparent; font-size: 11px; }
.map-search input::placeholder { color: #7892a3; }
.map-search kbd { color: var(--muted); }
.map-toolbar { position: absolute; z-index: 600; left: 18px; top: 72px; padding: 5px; display: flex; gap: 3px; border: 1px solid rgba(198,221,236,.16); border-radius: 10px; background: rgba(7,20,31,.91); backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.map-toolbar button { min-width: 46px; height: 43px; padding: 0 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-size: 15px; }
.map-toolbar button span { font-size: 7px; font-weight: 700; }
.map-toolbar button:hover, .map-toolbar button.is-active { color: var(--accent); background: rgba(98,232,197,.10); }
.imagery-panel { position: absolute; z-index: 600; right: 17px; top: 17px; width: 246px; padding: 7px; border: 1px solid rgba(198,221,236,.16); border-radius: 11px; background: rgba(7,20,31,.91); backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.imagery-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.imagery-tabs button { min-height: 34px; padding: 4px 8px; text-align: left; color: var(--muted); border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-size: 9px; font-weight: 700; }
.imagery-tabs button.is-active { color: var(--text); background: var(--surface-3); }
.imagery-tabs small { display: block; margin-top: 2px; color: var(--faint); font-size: 7px; }
.opacity-control { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 7px; padding: 8px 4px 2px; color: var(--faint); font-size: 7px; }
.opacity-control input { accent-color: var(--accent); min-width: 0; }
.opacity-control output { width: 28px; text-align: right; color: var(--muted); }
.map-legend { position: absolute; z-index: 600; left: 18px; bottom: 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 8px 10px; border: 1px solid rgba(198,221,236,.14); border-radius: 8px; background: rgba(7,20,31,.86); color: var(--muted); font-size: 8px; backdrop-filter: blur(10px); }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.legend-line { display: inline-block; width: 13px; height: 4px; border-radius: 2px; }
.legend-line--verified { background: var(--success); }.legend-line--high { background: var(--blue); }.legend-line--medium { background: var(--warning); }.legend-line--low { background: var(--danger); }.legend-line--change { background: var(--violet); }
.edit-bar { position: absolute; z-index: 650; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(540px, calc(100% - 36px)); min-height: 52px; padding: 7px 8px 7px 14px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid rgba(98,232,197,.3); border-radius: 12px; background: rgba(6,21,31,.96); box-shadow: var(--shadow); }
.edit-bar span { font-size: 10px; color: #c5d6df; }
.edit-bar > div { display: flex; gap: 5px; }
.edit-bar .button { min-height: 34px; }
.demo-banner { position: absolute; z-index: 590; left: 50%; top: 18px; transform: translateX(-50%); max-width: 390px; min-height: 42px; padding: 7px 34px 7px 9px; display: flex; align-items: center; gap: 9px; border: 1px solid rgba(248,198,92,.23); border-radius: 9px; background: rgba(42,30,8,.88); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.demo-banner > span { flex: none; color: #f8ce74; border: 1px solid rgba(248,198,92,.3); border-radius: 4px; padding: 3px 5px; font-size: 7px; font-weight: 900; letter-spacing: .1em; }
.demo-banner p { margin: 0; color: #d9c9a5; font-size: 8px; line-height: 1.35; }
.demo-banner button { position: absolute; right: 6px; top: 5px; color: #c2ad7c; border: 0; background: none; cursor: pointer; }

/* Inspector */
.right-panel { grid-column: 3; grid-row: 2; position: relative; border-left: 1px solid var(--line); background: var(--surface-0); overflow: hidden; z-index: 800; }
.inspector-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 38px; text-align: center; }
.empty-icon { width: 70px; height: 70px; display: grid; place-items: center; border-radius: 22px; color: var(--accent); background: rgba(98,232,197,.08); border: 1px solid rgba(98,232,197,.2); font-size: 30px; }
.inspector-empty h2 { margin: 20px 0 8px; font-size: 19px; }
.inspector-empty p { margin: 0 0 18px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.inspector { height: 100%; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.inspector-header { min-height: 76px; padding: 17px 18px 14px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.inspector-header h2 { margin: 5px 0 0; font-size: 16px; letter-spacing: -.015em; }
.inspector-header .eyebrow { font-size: 8px; }
.confidence-card { margin: 14px 16px; padding: 13px; display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(135deg, rgba(98,232,197,.07), rgba(98,169,255,.03)); }
.confidence-score { width: 65px; aspect-ratio: 1; flex: none; border: 5px solid rgba(98,232,197,.24); border-radius: 50%; display: grid; place-content: center; text-align: center; }
.confidence-score strong { display: block; font-size: 16px; }
.confidence-score small { display: block; margin-top: 1px; color: var(--muted); font-size: 6px; }
.confidence-card > div:last-child span { font-size: 11px; font-weight: 800; }
.confidence-card > div:last-child p { margin: 4px 0 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.review-actions { padding: 0 16px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.review-actions .button { min-height: 40px; font-size: 10px; }
.review-actions .button--warning { grid-column: 1 / -1; }
.review-actions .button span { font-size: 14px; }.review-actions kbd { margin-left: auto; }
.inspector-tabs { height: 40px; padding: 0 16px; display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.inspector-tabs button { position: relative; flex: 1; color: var(--muted); border: 0; background: transparent; cursor: pointer; font-size: 9px; font-weight: 700; }
.inspector-tabs button::after { content: ""; position: absolute; left: 15%; right: 15%; bottom: -1px; height: 2px; background: transparent; }
.inspector-tabs button.is-active { color: var(--text); }
.inspector-tabs button.is-active::after { background: var(--accent); }
.tab-panel { display: none; padding: 14px 16px 68px; }
.tab-panel.is-active { display: block; }
.detail-list { margin: 0; }
.detail-list div { min-height: 39px; padding: 9px 0; display: flex; justify-content: space-between; align-items: start; gap: 18px; border-bottom: 1px solid rgba(177,205,225,.08); }
.detail-list dt { color: var(--muted); font-size: 9px; }
.detail-list dd { max-width: 210px; margin: 0; text-align: right; font-size: 9px; font-weight: 700; line-height: 1.4; }
.review-reasons { margin: 12px 0; display: flex; flex-wrap: wrap; gap: 5px; }
.reason-chip { padding: 5px 7px; border-radius: 6px; color: #d2c6ed; background: rgba(173,140,255,.10); border: 1px solid rgba(173,140,255,.16); font-size: 7px; }
.attribute-form { display: grid; gap: 12px; }
.attribute-form label { color: var(--muted); font-size: 8px; font-weight: 700; }
.attribute-form input, .attribute-form select, .attribute-form textarea { margin-top: 5px; min-height: 36px; padding: 8px 9px; font-size: 9px; }
.attribute-form textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.history-list { display: grid; gap: 9px; }
.history-item { position: relative; padding: 11px 11px 11px 30px; border: 1px solid var(--line); border-radius: 9px; background: rgba(16,37,53,.45); }
.history-item::before { content: ""; position: absolute; left: 13px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(98,232,197,.08); }
.history-item strong, .history-item span, .history-item small { display: block; }
.history-item strong { font-size: 9px; text-transform: capitalize; }
.history-item span { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.history-item small { margin-top: 6px; color: var(--faint); font-size: 7px; }
.inspector-footer { position: sticky; bottom: 0; min-height: 50px; padding: 9px 16px; display: flex; flex-direction: column; justify-content: center; gap: 3px; color: var(--faint); border-top: 1px solid var(--line); background: rgba(10,22,34,.96); font-size: 7px; }

/* Dialogs and notices */
.toast-region { position: fixed; right: calc(var(--right-w) + 18px); bottom: 18px; z-index: 3000; width: min(340px, calc(100vw - 36px)); display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 12px 13px; display: flex; align-items: flex-start; gap: 9px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(8,22,33,.96); box-shadow: var(--shadow); color: #dceaf2; font-size: 10px; line-height: 1.45; animation: toast-in .2s ease-out; }
.toast::before { content: "✓"; color: var(--accent); font-weight: 900; }
.toast.is-error::before { content: "!"; color: var(--danger); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.kenav-dialog { width: min(450px, calc(100vw - 32px)); color: var(--text); border: 1px solid var(--line-strong); border-radius: 15px; background: #0b1926; box-shadow: 0 30px 90px rgba(0,0,0,.55); padding: 0; }
.kenav-dialog::backdrop { background: rgba(1,6,10,.72); backdrop-filter: blur(4px); }
.kenav-dialog form { position: relative; padding: 26px; }
.dialog-close { position: absolute; right: 14px; top: 12px; width: 29px; height: 29px; border: 0; border-radius: 8px; color: var(--muted); background: var(--surface-2); cursor: pointer; }
.dialog-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: var(--accent); background: rgba(98,232,197,.09); border: 1px solid rgba(98,232,197,.18); font-size: 20px; }
.dialog-icon--warning { color: var(--warning); background: rgba(248,198,92,.09); border-color: rgba(248,198,92,.18); }
.kenav-dialog h2 { margin: 16px 0 7px; font-size: 21px; }
.kenav-dialog p { color: var(--muted); font-size: 10px; line-height: 1.6; }
.kenav-dialog textarea { margin-top: 12px; resize: vertical; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 17px; }
.shortcut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.shortcut-grid span { padding: 10px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 9px; }
.shortcut-grid kbd { color: var(--accent); }

@media (max-width: 1180px) {
  :root { --left-w: 250px; --right-w: 320px; }
  .brand-lockup { min-width: 150px; }
  .app-header { grid-template-columns: var(--left-w) 1fr auto; }
  .user-chip span:last-child { display: none; }
  .demo-banner { display: none; }
}
@media (max-width: 920px) {
  :root { --left-w: 0px; --right-w: 320px; }
  .app-shell { grid-template-columns: minmax(0,1fr) var(--right-w); }
  .app-header { grid-template-columns: auto 1fr auto; }
  .left-rail { display: none; }
  .map-stage { grid-column: 1; }
  .right-panel { grid-column: 2; }
  .brand-lockup { min-width: auto; }
  .brand-lockup small { display: none; }
  .workspace-context { margin-left: 15px; }
  .toast-region { right: calc(var(--right-w) + 15px); }
}
@media (max-width: 690px) {
  :root { --right-w: 0px; }
  .app-shell { display: block; padding-top: var(--header-h); }
  .app-header { position: fixed; inset: 0 0 auto; height: var(--header-h); grid-template-columns: auto 1fr auto; }
  .workspace-context { display: none; }
  .header-actions .sync-status, .header-actions .user-chip, .header-actions .icon-button:first-of-type { display: none; }
  .map-stage { height: calc(100vh - var(--header-h)); }
  .right-panel { position: fixed; z-index: 1600; right: 0; bottom: 0; top: 32%; width: 100%; border-radius: 18px 18px 0 0; box-shadow: 0 -20px 50px rgba(0,0,0,.4); transform: translateY(100%); transition: transform .2s; }
  .right-panel.has-selection { transform: translateY(0); }
  .imagery-panel { width: 190px; }
  .map-toolbar button { min-width: 38px; }
  .map-toolbar button span { display: none; }
  .map-legend { display: none; }
  .toast-region { right: 12px; bottom: 12px; }
  .login-shell { display: block; }
  .login-story { min-height: 52vh; }
  .login-copy { padding: 55px 0; }
  .capability-grid { grid-template-columns: 1fr 1fr; }
  .login-panel { border-left: 0; border-top: 1px solid var(--line); padding: 50px 24px; }
}


/* =========================================================
   KENAV map display manager — professional POC refinement
   ========================================================= */

.rail-help {
  margin: 9px 0 0;
  color: var(--faint);
  font-size: 8px;
  line-height: 1.5;
}

.map-search {
  left: 18px;
  right: 142px;
  width: auto;
  max-width: 520px;
}

.map-layers-trigger {
  position: absolute;
  z-index: 700;
  right: 18px;
  top: 17px;
  height: 42px;
  min-width: 112px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #dcebf3;
  border: 1px solid rgba(198,221,236,.18);
  border-radius: 10px;
  background: rgba(7,20,31,.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}

.map-layers-trigger:hover,
.map-layers-trigger[aria-expanded="true"] {
  color: var(--accent);
  border-color: rgba(98,232,197,.38);
  background: rgba(14,38,51,.96);
}

.map-layers-trigger__icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--accent);
  background: rgba(98,232,197,.08);
  font-size: 16px;
}

.map-layer-manager {
  position: absolute;
  z-index: 740;
  right: 18px;
  top: 68px;
  width: min(326px, calc(100% - 36px));
  max-height: calc(100% - 88px);
  overflow-y: auto;
  color: var(--text);
  border: 1px solid rgba(198,221,236,.18);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(15,35,49,.98), rgba(7,20,31,.985));
  box-shadow: 0 24px 70px rgba(0,0,0,.46);
  backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(-8px) scale(.985);
  transform-origin: top right;
  transition: opacity .16s ease, transform .16s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.map-layer-manager.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.layer-manager__header {
  position: sticky;
  z-index: 2;
  top: 0;
  min-height: 60px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(10,26,38,.96);
  backdrop-filter: blur(16px);
}

.layer-manager__header small,
.layer-manager__header strong {
  display: block;
}

.layer-manager__header small {
  margin-bottom: 3px;
  color: var(--faint);
  font-size: 8px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.layer-manager__header strong {
  font-size: 12px;
}

.layer-manager__section {
  padding: 14px;
  border-bottom: 1px solid rgba(177,205,225,.09);
}

.layer-manager__label {
  display: block;
  margin-bottom: 9px;
  color: #b8cbd7;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
}

.layer-manager__row-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.layer-manager__row-heading .layer-manager__label {
  margin-bottom: 0;
}

.layer-manager__hint {
  margin: 9px 0 0;
  padding: 8px 9px;
  color: #cfb46d;
  border: 1px solid rgba(248,198,92,.16);
  border-radius: 7px;
  background: rgba(248,198,92,.055);
  font-size: 8px;
  line-height: 1.45;
}

.layer-manager__hint code {
  color: #f8ce74;
  font-size: 7px;
}

.layer-manager__footer {
  padding: 12px 14px 14px;
}

.basemap-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.basemap-switch button {
  min-width: 0;
  padding: 7px;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 8px;
  text-align: left;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8,25,37,.72);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, transform .15s;
}

.basemap-switch button:hover:not(.is-disabled) {
  transform: translateY(-1px);
  border-color: rgba(98,232,197,.28);
}

.basemap-switch button.is-active {
  color: var(--text);
  border-color: rgba(98,232,197,.42);
  background: rgba(98,232,197,.08);
  box-shadow: inset 0 0 0 1px rgba(98,232,197,.04);
}

.basemap-switch button.is-disabled {
  opacity: .42;
  cursor: not-allowed;
}

.basemap-switch strong,
.basemap-switch small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.basemap-switch strong {
  font-size: 9px;
}

.basemap-switch small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 7px;
}

.basemap-preview {
  width: 42px;
  height: 36px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
}

.basemap-preview--streets {
  background:
    linear-gradient(33deg, transparent 43%, rgba(141,192,255,.75) 44% 47%, transparent 48%),
    linear-gradient(-28deg, transparent 39%, rgba(248,198,92,.45) 40% 43%, transparent 44%),
    linear-gradient(145deg, #1e3848, #102433);
}

.basemap-preview--satellite {
  background:
    radial-gradient(circle at 23% 26%, #405f43 0 15%, transparent 16%),
    radial-gradient(circle at 72% 63%, #344f39 0 17%, transparent 18%),
    linear-gradient(34deg, transparent 45%, #6e6b5e 46% 53%, transparent 54%),
    linear-gradient(145deg, #2f4835, #27372d 55%, #45533b);
}

.imagery-tabs--manager {
  gap: 5px;
}

.imagery-tabs--manager button {
  min-height: 42px;
  border: 1px solid transparent;
  background: rgba(5,17,27,.46);
}

.imagery-tabs--manager button.is-active {
  border-color: rgba(98,232,197,.22);
  background: rgba(23,48,68,.9);
}

.opacity-control--manager {
  grid-template-columns: 52px 1fr 34px;
  padding: 11px 2px 0;
  font-size: 8px;
}

.opacity-control--manager input {
  width: 100%;
}

.mini-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--faint);
  font-size: 8px;
  cursor: pointer;
}

.mini-toggle input,
.layer-row input {
  appearance: none;
  width: 30px;
  height: 17px;
  position: relative;
  flex: none;
  border-radius: 99px;
  background: #20394b;
  cursor: pointer;
  transition: background .15s;
}

.mini-toggle input::after,
.layer-row input::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: #7690a1;
  transition: transform .15s, background .15s;
}

.mini-toggle input:checked,
.layer-row input:checked {
  background: rgba(98,232,197,.28);
}

.mini-toggle input:checked::after,
.layer-row input:checked::after {
  transform: translateX(13px);
  background: var(--accent);
}

.layer-list--manager {
  gap: 3px;
}

.layer-list--manager .layer-row {
  min-height: 36px;
  padding: 0 4px;
}

.swatch--label {
  width: 12px;
  height: 9px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.65) 0 1px, transparent 1px 3px, rgba(255,255,255,.45) 3px 4px, transparent 4px);
}

/* The old floating imagery panel is no longer used. */
.imagery-panel {
  display: none !important;
}

/* Keep search and editing tools visually separated from the layer manager. */
.map-toolbar {
  top: 72px;
  max-width: calc(100% - 36px);
}

.map-legend {
  max-width: calc(100% - 92px);
}

/* Improved Leaflet stacking */
.leaflet-map-pane canvas,
.leaflet-map-pane svg {
  outline: none;
}

.leaflet-control-zoom {
  margin-right: 16px !important;
  margin-bottom: 16px !important;
}

/* Responsive refinements */
@media (max-width: 1180px) {
  .map-search {
    max-width: 430px;
  }
}

@media (max-width: 920px) {
  .map-search {
    right: 128px;
    max-width: none;
  }

  .map-layers-trigger {
    right: 14px;
    min-width: 104px;
  }

  .map-layer-manager {
    right: 14px;
  }
}

@media (max-width: 690px) {
  .map-search {
    left: 12px;
    right: 112px;
    top: 12px;
    height: 40px;
  }

  .map-layers-trigger {
    right: 12px;
    top: 12px;
    min-width: 92px;
    height: 40px;
    padding: 0 10px;
  }

  .map-layer-manager {
    top: 60px;
    right: 12px;
    width: min(310px, calc(100% - 24px));
    max-height: calc(100% - 72px);
  }

  .map-toolbar {
    left: 12px;
    top: 62px;
  }

  .basemap-switch {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   KENAV professional mapping workspace — large-map refinement
   ========================================================= */
:root { --left-w: 248px; --right-w: 326px; --header-h: 64px; }
.app-shell { grid-template-columns: var(--left-w) minmax(640px, 1fr) var(--right-w); transition: grid-template-columns .2s ease; }
.app-header { min-width: 0; }
.map-search { left: 16px; top: 14px; height: 40px; max-width: 500px; }
.map-toolbar { left: 16px; top: 64px; padding: 4px; }
.map-toolbar button { min-width: 50px; height: 42px; }
.map-layers-trigger { right: 16px; top: 14px; height: 40px; min-width: 108px; }
.map-view-controls { position:absolute; z-index:700; right:16px; top:62px; display:flex; align-items:center; gap:6px; }
.map-zoom-readout,.map-focus-toggle { height:34px; border:1px solid rgba(198,221,236,.18); border-radius:9px; background:rgba(7,20,31,.92); color:#dcebf3; box-shadow:0 8px 25px rgba(0,0,0,.22); backdrop-filter:blur(12px); }
.map-zoom-readout { min-width:44px; padding:0 9px; display:inline-grid; place-items:center; color:var(--accent); font-size:10px; font-weight:850; letter-spacing:.04em; }
.map-focus-toggle { padding:0 10px; display:inline-flex; align-items:center; gap:7px; cursor:pointer; font-size:9px; font-weight:800; }
.map-focus-toggle:hover,.map-focus-toggle[aria-pressed="true"] { color:var(--accent); border-color:rgba(98,232,197,.38); background:rgba(14,38,51,.96); }
.map-focus-toggle>span:first-child { font-size:15px; line-height:1; }
#kenav-app.map-focus-mode { grid-template-columns:0 minmax(0,1fr) 0; }
#kenav-app.map-focus-mode .left-rail,#kenav-app.map-focus-mode .right-panel { visibility:hidden; pointer-events:none; opacity:0; }
#kenav-app.map-focus-mode .map-stage { grid-column:1 / -1; }
#kenav-app.map-focus-mode .app-header { grid-template-columns:205px minmax(220px,1fr) auto; }
.left-rail,.right-panel { transition:opacity .18s ease,visibility .18s ease; }
.map-stage { min-width:0; }
.leaflet-control-zoom a { width:34px !important; height:34px !important; line-height:34px !important; font-size:20px !important; }
.edit-bar { bottom:22px; width:min(700px,calc(100% - 140px)); min-height:56px; padding:8px 9px 8px 16px; }
.edit-bar span { font-size:11px; line-height:1.35; }
.right-panel { min-width:0; }
.inspector-header { min-height:70px; }
.confidence-card { margin:12px 14px; }
.review-actions { padding:0 14px 12px; }
@media (max-width:1450px) { :root { --left-w:224px; --right-w:300px; } .app-shell { grid-template-columns:var(--left-w) minmax(520px,1fr) var(--right-w); } .rail-section { padding-left:14px; padding-right:14px; } .map-search { max-width:440px; } }
@media (max-width:1180px) { :root { --left-w:200px; --right-w:280px; } .app-shell { grid-template-columns:var(--left-w) minmax(460px,1fr) var(--right-w); } .brand-lockup { min-width:150px; } .map-focus-label { display:none; } .map-focus-toggle { width:36px; padding:0; justify-content:center; } }
@media (max-width:920px) { :root { --left-w:0px; --right-w:300px; } .app-shell { grid-template-columns:minmax(0,1fr) var(--right-w); } .map-view-controls { right:14px; top:60px; } #kenav-app.map-focus-mode { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:var(--header-h) 1fr; } }
@media (max-width:690px) { .map-view-controls { top:58px; right:12px; } .map-zoom-readout { display:none; } .map-focus-toggle { width:38px; height:34px; } .edit-bar { width:calc(100% - 24px); bottom:12px; } }

/* =========================================================
   KENAV PROFESSIONAL WORKSPACE V2
   Desktop-first GIS workspace + complete mobile drawers
   ========================================================= */

:root {
  --header-h: 64px;
  --left-w: 272px;
  --right-w: 356px;
  --panel-bg: rgba(8, 20, 31, .985);
  --panel-bg-soft: rgba(11, 28, 41, .96);
  --map-chrome: rgba(6, 19, 29, .91);
  --map-chrome-border: rgba(186, 216, 233, .18);
  --map-shadow: 0 16px 42px rgba(0,0,0,.34);
}

.workspace-page { overflow: hidden; }
.app-shell {
  --left-current: var(--left-w);
  --right-current: 0px;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  display: grid !important;
  grid-template-columns: var(--left-current) minmax(0, 1fr) var(--right-current);
  grid-template-rows: var(--header-h) minmax(0, 1fr);
  background: var(--bg);
  transition: grid-template-columns .22s cubic-bezier(.2,.8,.2,1);
}
.app-shell.inspector-open { --right-current: var(--right-w); }
.app-shell.left-rail-collapsed { --left-current: 0px; }
.app-shell.map-focus-mode { --left-current: 0px; --right-current: 0px; }

.app-header {
  position: relative;
  inset: auto;
  height: auto;
  min-width: 0;
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8,21,32,.99), rgba(7,18,29,.97));
  box-shadow: 0 1px 0 rgba(255,255,255,.015);
  z-index: 1800;
}
.brand-lockup { min-width: 0; }
.brand-lockup strong { font-size: 16px; letter-spacing: .18em; }
.brand-lockup small { font-size: 9px; letter-spacing: .10em; }
.workspace-context {
  height: 38px;
  min-width: 0;
  margin: 0;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}
.context-kicker { font-size: 9px; }
.context-title { max-width: min(520px, 46vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.header-actions { min-width: 0; }
.sync-status { font-size: 10px; }
.user-chip { height: 40px; }
.user-chip strong { font-size: 10px; }
.user-chip small { font-size: 8px; }

.left-rail,
.right-panel {
  min-width: 0;
  background: linear-gradient(180deg, #091724, #07131f 82%);
  transition: opacity .18s ease, transform .22s ease, visibility .18s ease;
}
.left-rail {
  display: block !important;
  grid-column: 1;
  grid-row: 2;
  position: relative;
  z-index: 900;
  overflow: hidden;
  border-right: 1px solid var(--line);
}
.right-panel {
  display: block !important;
  grid-column: 3;
  grid-row: 2;
  position: relative;
  z-index: 910;
  overflow: hidden;
  border-left: 1px solid var(--line);
}
.app-shell.left-rail-collapsed .left-rail,
.app-shell.map-focus-mode .left-rail {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-14px);
}
.app-shell:not(.inspector-open) .right-panel,
.app-shell.map-focus-mode .right-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(14px);
}

.rail-panel-topbar {
  height: 56px;
  padding: 0 14px 0 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(12,29,42,.82);
}
.rail-panel-topbar small,
.rail-panel-topbar strong { display: block; }
.rail-panel-topbar small { margin-bottom: 2px; color: var(--faint); font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.rail-panel-topbar strong { font-size: 12px; }
.panel-close { font-size: 20px; }
.rail-scroll { height: calc(100% - 56px); }
.rail-section { padding: 18px 17px 19px; }
.section-heading { margin-bottom: 15px; }
.section-heading small { font-size: 8.5px; }
.section-heading strong { font-size: 12.5px; }
.progress-ring { width: 82px; }
.progress-ring strong { font-size: 17px; }
.progress-copy strong { font-size: 22px; }
.progress-copy span { font-size: 10px; }
.progress-copy small { font-size: 9px; line-height: 1.45; }
.metric-card { min-height: 76px; padding: 12px; }
.metric-card strong { font-size: 18px; }
.metric-card small { font-size: 8.5px; }
.rail-help { font-size: 9px; line-height: 1.55; }
.segmented button { min-height: 30px; font-size: 9px; }
.model-card p { font-size: 8.5px; }

.map-stage {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: #10212f;
}
#map { position: absolute; inset: 0; }

.map-search,
.map-toolbar,
.map-layers-trigger,
.map-view-controls,
.map-panel-launcher,
.map-layer-manager,
.map-legend,
.edit-bar,
.demo-banner {
  font-synthesis: none;
}
.map-search {
  left: 16px;
  right: auto;
  top: 16px;
  width: min(560px, calc(100% - 370px));
  max-width: none;
  height: 44px;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--map-chrome-border);
  border-radius: 12px;
  background: var(--map-chrome);
  box-shadow: var(--map-shadow);
  backdrop-filter: blur(18px) saturate(1.1);
}
.search-icon { width: 20px; height: 20px; flex: none; color: var(--accent); }
.search-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.map-search input { font-size: 12px; }
.map-search kbd { margin-left: 4px; }

.map-toolbar {
  left: 16px;
  top: 70px;
  max-width: calc(100% - 32px);
  padding: 5px;
  gap: 3px;
  border-radius: 12px;
  border: 1px solid var(--map-chrome-border);
  background: var(--map-chrome);
  box-shadow: var(--map-shadow);
  backdrop-filter: blur(18px) saturate(1.1);
}
.map-toolbar button {
  min-width: 54px;
  width: 54px;
  height: 48px;
  padding: 4px 5px;
  gap: 3px;
  border-radius: 8px;
  color: #91a8b8;
}
.map-toolbar button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.map-toolbar button span { font-size: 8px; font-weight: 750; letter-spacing: .01em; }
.map-toolbar button:hover,
.map-toolbar button.is-active { color: var(--accent); background: rgba(98,232,197,.105); }

.map-layers-trigger {
  right: 16px;
  top: 16px;
  min-width: 114px;
  height: 44px;
  border-radius: 12px;
  background: var(--map-chrome);
  box-shadow: var(--map-shadow);
}
.map-layers-trigger__icon { width: 24px; height: 24px; }
.map-layers-trigger__icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.map-view-controls {
  position: absolute;
  z-index: 710;
  right: 16px;
  top: 68px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.map-zoom-readout,
.map-focus-toggle {
  height: 36px;
  border: 1px solid var(--map-chrome-border);
  border-radius: 10px;
  background: var(--map-chrome);
  box-shadow: 0 10px 28px rgba(0,0,0,.24);
  backdrop-filter: blur(14px);
}
.map-zoom-readout { min-width: 48px; padding: 0 10px; display: inline-grid; place-items: center; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .05em; }
.map-focus-toggle { padding: 0 11px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: #c7d7e0; font-size: 9px; font-weight: 800; }
.map-focus-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.map-focus-toggle:hover,
.map-focus-toggle[aria-pressed="true"] { color: var(--accent); border-color: rgba(98,232,197,.40); background: rgba(13,37,49,.96); }

.map-panel-launchers {
  position: absolute;
  z-index: 705;
  left: 16px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: none;
}
.map-panel-launcher {
  min-height: 38px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #c7d7e0;
  border: 1px solid var(--map-chrome-border);
  border-radius: 10px;
  background: var(--map-chrome);
  box-shadow: 0 10px 28px rgba(0,0,0,.24);
  backdrop-filter: blur(14px);
  cursor: pointer;
  pointer-events: auto;
  font-size: 9px;
  font-weight: 800;
}
.map-panel-launcher svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.map-panel-launcher strong { min-width: 24px; height: 21px; padding: 0 6px; display: grid; place-items: center; color: #062019; border-radius: 999px; background: var(--accent); font-size: 8px; }
.map-panel-launcher:hover { color: var(--accent); border-color: rgba(98,232,197,.36); }
.app-shell:not(.left-rail-collapsed) .map-panel-launcher--queue { display: none; }
.app-shell.inspector-open .map-panel-launcher--inspector { display: none !important; }

.map-layer-manager {
  top: 68px;
  right: 16px;
  width: min(360px, calc(100% - 32px));
  max-height: calc(100% - 86px);
  border-radius: 15px;
  box-shadow: 0 26px 70px rgba(0,0,0,.46);
}
.layer-manager__header { min-height: 62px; }
.layer-manager__header strong { font-size: 13px; }
.layer-manager__section { padding: 15px; }
.layer-manager__label { font-size: 9.5px; }
.layer-row { font-size: 10px; }
.basemap-switch strong { font-size: 9.5px; }
.basemap-switch small { font-size: 7.5px; }

.map-legend {
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  max-width: calc(100% - 360px);
  gap: 11px;
  padding: 8px 11px;
  font-size: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
}
.edit-bar {
  bottom: 22px;
  width: min(720px, calc(100% - 180px));
  min-height: 58px;
  padding: 8px 9px 8px 16px;
  border-radius: 13px;
}
.edit-bar span { font-size: 11px; line-height: 1.4; }
.demo-banner { top: 16px; max-width: 360px; }

.leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 20px !important;
}
.leaflet-control-zoom { margin-right: 16px !important; margin-bottom: 16px !important; }
.leaflet-control-scale { margin-left: 16px !important; margin-bottom: 16px !important; }
.leaflet-control-scale-line { color: #dceaf2 !important; border-color: rgba(220,234,242,.6) !important; background: rgba(5,16,24,.66) !important; font-size: 8px !important; }
.leaflet-tooltip.kenav-label { font-size: 9px; padding: 5px 7px; border-radius: 6px; }

/* Inspector */
.right-panel { background: linear-gradient(180deg, #0a1926, #07131f); }
.inspector-empty { padding: 36px 28px; }
.inspector-empty h2 { font-size: 20px; }
.inspector-empty p { max-width: 280px; font-size: 11px; }
.inspector-header { min-height: 76px; padding: 17px 18px; }
.inspector-header h2 { font-size: 15px; overflow-wrap: anywhere; }
.confidence-card { margin: 14px 16px; padding: 14px; }
.confidence-card > div:last-child span { font-size: 11px; }
.confidence-card > div:last-child p { font-size: 8.5px; }
.review-actions { padding: 0 16px 15px; }
.inspector-tabs button { font-size: 9.5px; }
.detail-list dt,
.detail-list dd { font-size: 9.5px; }
.attribute-form label { font-size: 9px; }
.attribute-form input,
.attribute-form select,
.attribute-form textarea { font-size: 10px; }
.mobile-sheet-handle { display: none; }

.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2050;
  padding: 0;
  border: 0;
  background: rgba(1,7,11,.55);
  backdrop-filter: blur(2px);
}

.toast-region { right: calc(var(--right-current) + 18px); transition: right .2s ease; }

/* Medium desktop */
@media (max-width: 1360px) and (min-width: 901px) {
  :root { --left-w: 244px; --right-w: 330px; }
  .map-search { width: min(470px, calc(100% - 330px)); }
  .rail-section { padding-left: 14px; padding-right: 14px; }
  .progress-ring-wrap { gap: 12px; }
  .map-toolbar button { width: 50px; min-width: 50px; }
  .map-legend { display: none; }
  .demo-banner { display: none; }
}

/* Complete tablet / mobile workspace */
@media (max-width: 900px) {
  :root { --header-h: 58px; --left-w: 0px; --right-w: 0px; }
  html, body, .workspace-page { width: 100%; height: 100%; overflow: hidden; }
  .app-shell,
  .app-shell.inspector-open,
  .app-shell.left-rail-collapsed,
  .app-shell.map-focus-mode {
    --left-current: 0px;
    --right-current: 0px;
    display: block !important;
    height: 100vh;
    height: 100dvh;
    padding-top: var(--header-h);
  }
  .app-header {
    position: fixed;
    z-index: 2400;
    inset: 0 0 auto;
    height: var(--header-h);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 0 12px;
  }
  .brand-lockup { min-width: 0; gap: 8px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-mark svg { width: 24px; height: 24px; }
  .brand-lockup strong { font-size: 13px; }
  .brand-lockup small { display: none; }
  .workspace-context, .sync-status, .header-actions > a.icon-button { display: none !important; }
  .header-actions { gap: 6px; }
  .user-chip { width: 35px; height: 35px; padding: 3px; border-radius: 10px; }
  .user-chip .avatar { width: 27px; height: 27px; }
  .user-chip span:last-child { display: none; }
  .header-actions form .icon-button { width: 34px; height: 34px; }

  .map-stage {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    min-height: 0;
  }

  .left-rail {
    display: block !important;
    position: fixed;
    z-index: 2200;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: min(88vw, 360px);
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateX(-104%) !important;
    border-right: 1px solid var(--line-strong);
    box-shadow: 24px 0 70px rgba(0,0,0,.42);
  }
  .app-shell.review-panel-open .left-rail { transform: translateX(0) !important; }
  .rail-panel-topbar { height: 58px; }
  .panel-close { font-size: 0; }
  .panel-close::after { content: "×"; font-size: 19px; }
  .rail-scroll { height: calc(100% - 58px); padding-bottom: 20px; }
  .rail-section { padding: 18px; }
  .section-heading strong { font-size: 13px; }
  .metric-card { min-height: 80px; }
  .metric-card strong { font-size: 19px; }
  .metric-card small { font-size: 9px; }
  .button { min-height: 42px; }

  .right-panel,
  .app-shell:not(.inspector-open) .right-panel,
  .app-shell.map-focus-mode .right-panel {
    display: block !important;
    position: fixed;
    z-index: 2250;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    height: min(74dvh, 720px);
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateY(104%) !important;
    border: 1px solid var(--line-strong);
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -24px 70px rgba(0,0,0,.48);
    background: #081722;
  }
  .app-shell.inspector-open:not(.map-focus-mode) .right-panel { transform: translateY(0) !important; }
  .mobile-sheet-handle { height: 22px; display: grid; place-items: center; background: #081722; }
  .mobile-sheet-handle span { width: 42px; height: 4px; border-radius: 99px; background: rgba(184,203,216,.28); }
  .inspector { height: calc(100% - 22px); }
  .inspector-header { min-height: 70px; padding: 13px 16px; }
  .inspector-header h2 { font-size: 14px; }
  .confidence-card { margin: 12px 14px; }
  .review-actions { padding: 0 14px 13px; }
  .review-actions .button { min-height: 42px; font-size: 10px; }
  .inspector-tabs { padding: 0 12px; }
  .inspector-tabs button { font-size: 10px; }
  .tab-panel { padding: 14px 16px 80px; }
  .detail-list dt, .detail-list dd { font-size: 10px; }

  .map-search {
    left: 10px;
    right: 104px;
    top: 10px;
    width: auto;
    height: 42px;
    padding: 0 10px;
    border-radius: 11px;
  }
  .map-search input { font-size: 11px; }
  .map-search kbd { display: none; }
  .map-layers-trigger {
    right: 10px;
    top: 10px;
    min-width: 86px;
    width: 86px;
    height: 42px;
    padding: 0 9px;
    border-radius: 11px;
    font-size: 9px;
  }
  .map-layers-trigger__icon { width: 21px; height: 21px; }
  .map-view-controls { top: 60px; right: 10px; }
  .map-zoom-readout { display: none; }
  .map-focus-toggle { width: 38px; height: 36px; padding: 0; justify-content: center; }
  .map-focus-label { display: none; }

  .map-toolbar {
    z-index: 730;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 10px;
    width: auto;
    max-width: none;
    padding: 5px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2px;
    border-radius: 13px;
  }
  .map-toolbar button {
    width: 100%;
    min-width: 0;
    height: 50px;
    padding: 4px 2px;
    border-radius: 9px;
  }
  .map-toolbar button svg { width: 17px; height: 17px; }
  .map-toolbar button span { display: block !important; font-size: 7px; }

  .map-panel-launchers {
    left: 10px;
    top: 60px;
    bottom: auto;
    gap: 6px;
  }
  .map-panel-launcher { min-height: 36px; padding: 0 9px; }
  .app-shell:not(.left-rail-collapsed) .map-panel-launcher--queue { display: inline-flex; }
  .app-shell.review-panel-open .map-panel-launcher--queue { visibility: hidden; }
  .map-panel-launcher--inspector { padding-right: 10px; }

  .map-layer-manager {
    z-index: 2150;
    top: 60px;
    right: 10px;
    width: calc(100% - 20px);
    max-height: calc(100% - 134px);
    border-radius: 14px;
  }
  .basemap-switch { grid-template-columns: 1fr 1fr; }
  .map-legend, .demo-banner { display: none !important; }
  .edit-bar {
    z-index: 760;
    left: 10px;
    right: 10px;
    bottom: 70px;
    transform: none;
    width: auto;
    min-height: 54px;
    padding: 8px 8px 8px 12px;
    gap: 8px;
  }
  .edit-bar span { font-size: 9px; }
  .edit-bar .button { min-height: 36px; padding: 0 10px; font-size: 9px; }

  .leaflet-control-zoom { margin-right: 10px !important; margin-bottom: 72px !important; }
  .leaflet-control-scale { margin-left: 10px !important; margin-bottom: 72px !important; }
  .leaflet-control-attribution { max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .toast-region { right: 10px; left: 10px; bottom: 74px; width: auto; }

  .mobile-backdrop { display: block; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .18s ease, visibility .18s ease; }
  .app-shell.review-panel-open .mobile-backdrop { opacity: 1; visibility: visible; pointer-events: auto; }
}

@media (max-width: 520px) {
  .header-actions form .icon-button { display: none; }
  .map-toolbar button span { font-size: 6.5px; }
  .map-toolbar button svg { width: 16px; height: 16px; }
  .map-search { right: 96px; }
  .map-layers-trigger { width: 82px; min-width: 82px; }
  .basemap-switch { grid-template-columns: 1fr; }
  .edit-bar { flex-direction: column; align-items: stretch; }
  .edit-bar > div { justify-content: flex-end; }
}
.leaflet-container.pm-enabled {
  cursor: crosshair !important;
}

.leaflet-marker-icon.leaflet-pm-marker {
  width: 12px !important;
  height: 12px !important;
}