:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #1a1d21;
  --muted: #5e6873;
  --line: #e1e5ea;
  --surface: #ffffff;
  --surface-dim: #f5f6f8;
  --accent: #2f6bd8;
  --danger: #c93b3b;
  --radius: 12px;
  --shadow: 0 12px 36px rgb(15 23 32 / 16%);
  --shadow-soft: 0 2px 10px rgb(15 23 32 / 8%), 0 0 0 1px rgb(15 23 32 / 4%);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; color: var(--ink); background: #dfe2e6; font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
[hidden] { display: none !important; }

.layout, .map-shell, #map { position: absolute; inset: 0; }
.map-shell { min-width: 0; }

.map-loading { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 10px; background: #e7e9ec; color: var(--muted); font-size: 13px; font-weight: 500; pointer-events: none; transition: opacity .3s ease; }
.map-loading[hidden] { display: none; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; border: 1px solid transparent; border-radius: 9px; padding: 8px 13px; font-size: 13px; font-weight: 600; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease; }
.button.secondary { background: var(--surface); border-color: var(--line); }
.button.secondary:hover { background: var(--surface-dim); border-color: #d0d5db; }
.button.primary { width: 100%; margin-top: 18px; min-height: 44px; color: #fff; background: var(--accent); }
.button.primary:hover { background: #2558b8; }
.button.primary:disabled { opacity: .6; cursor: default; }
.button.primary.compact { width: auto; margin-top: 0; min-height: 38px; }
.project-membership-button { width: 100%; margin-top: 8px; }
.button.danger { width: 100%; margin-top: 8px; border-color: #efc7c7; color: var(--danger); background: #fff8f8; }
.button.danger:hover { background: #fff0f0; }

/* ---------- Search ---------- */
.search-shell { position: absolute; z-index: 20; top: 16px; left: 88px; width: min(380px, calc(100vw - 112px)); transition: left .24s cubic-bezier(.2, .75, .25, 1); }
.layout:has(.sidebar.open) .search-shell { left: 382px; width: min(380px, calc(100vw - 406px)); }
.map-search { display: flex; align-items: center; gap: 9px; height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-soft); }
.map-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(47 107 216 / 14%), var(--shadow-soft); }
.search-icon { width: 17px; height: 17px; flex: 0 0 auto; color: var(--muted); }
.map-search input { flex: 1; min-width: 0; border: 0; padding: 0; background: transparent; font-size: 14px; }
.map-search input:focus { outline: none; }
.map-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-kbd { flex: 0 0 auto; padding: 2px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-dim); color: var(--muted); font-size: 11px; font-family: inherit; }
.search-results { margin-top: 6px; display: grid; overflow: hidden; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-soft); }
.search-results:empty { display: none; }
.search-note { margin: 0; padding: 11px 13px; color: var(--muted); font-size: 12px; }
.search-result { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--surface-dim); padding: 10px 13px; background: var(--surface); text-align: left; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--surface-dim); }
.search-result strong, .search-result span { display: block; }
.search-result strong { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.search-result span { margin-top: 1px; color: var(--muted); font-size: 11px; }

/* ---------- Sidebar / workspace ---------- */
.sidebar { position: fixed; z-index: 24; top: 16px; left: 16px; width: 58px; overflow: visible; transition: width .24s cubic-bezier(.2, .75, .25, 1); }
.sidebar.open { width: min(352px, calc(100vw - 32px)); }
.drawer-toggle { width: 58px; height: 46px; display: flex; align-items: center; gap: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--surface); box-shadow: var(--shadow-soft); text-align: left; transition: width .22s ease, background .15s ease; }
.sidebar.open .drawer-toggle { width: 148px; }
.drawer-toggle:hover { background: var(--surface-dim); }
.drawer-icon { width: 19px; height: 19px; flex: 0 0 auto; color: var(--accent); }
.drawer-icon svg { width: 100%; height: 100%; }
.drawer-label { opacity: 0; font-size: 13px; font-weight: 600; white-space: nowrap; transition: opacity .12s ease; }
.drawer-chevron { width: 16px; height: 16px; margin-left: auto; flex: 0 0 auto; opacity: 0; color: var(--muted); transition: opacity .12s ease, transform .2s ease; }
.sidebar.open .drawer-label, .sidebar.open .drawer-chevron { opacity: 1; }
.sidebar.open .drawer-chevron { transform: rotate(180deg); }
.sidebar-content { width: 352px; max-width: calc(100vw - 32px); max-height: calc(100vh - 86px); max-height: calc(100dvh - 86px); overflow-y: auto; padding: 0 2px 18px 0; opacity: 0; visibility: hidden; transform: translateY(-5px); scrollbar-width: thin; transition: opacity .16s ease .06s, transform .16s ease .06s, visibility 0s linear .22s; }
.sidebar.open .sidebar-content { opacity: 1; visibility: visible; transform: translateY(0); transition-delay: .06s, .06s, 0s; }

.card { margin-top: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }

.sidebar-heading, .panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 3px; font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
h2 { margin-bottom: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.sidebar-heading p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.workspace-heading { min-width: 0; }
.account-row { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 9px; margin-top: 9px; font-size: 11px; color: var(--muted); }
.account-row span { min-width: 0; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-link { color: var(--accent); font-weight: 650; text-decoration: none; }
.account-link:hover { text-decoration: underline; }
.eyebrow { margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 0; background: var(--surface); }
.icon-button svg { width: 15px; height: 15px; }
.icon-button:hover { background: var(--surface-dim); }

.field-label { display: block; margin: 15px 0 6px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
select, input, textarea { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(47 107 216 / 13%); }
textarea { resize: vertical; }

.control-card > .field-label:first-child { margin-top: 0; }
.control-card { padding: 11px; }
.control-card .field-label { margin: 11px 0 5px; }
.zoom-controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.control-button { min-height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.control-button svg { width: 16px; height: 16px; }
.control-button:hover { background: var(--surface-dim); }
.map-actions { display: grid; gap: 5px; margin-top: 5px; }
.theme-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.theme-swatch { display: flex; align-items: center; gap: 6px; min-height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 7px; background: var(--surface); font-size: 12px; font-weight: 500; color: var(--muted); }
.theme-swatch:hover { background: var(--surface-dim); }
.theme-swatch.active { border-color: var(--accent); color: var(--ink); box-shadow: 0 0 0 1px var(--accent); }
.theme-swatch span { width: 16px; height: 16px; flex: 0 0 auto; border-radius: 5px; }
.swatch-natural { background: linear-gradient(135deg, #9cc58e, #76a9d4); }
.swatch-blueprint { background: linear-gradient(135deg, #0c2d57, #54b7e6 48%, #f7fbff); }
.swatch-dusk { background: linear-gradient(135deg, #39264f, #bb5b74 52%, #f6b46a); }
.swatch-thermal { background: linear-gradient(135deg, #121217, #e84118 46%, #ffd166); }
.swatch-infrared { background: linear-gradient(135deg, #1d2430, #e94f9b 48%, #9cf46f); }
.swatch-paper { background: linear-gradient(135deg, #f7f0d6, #d9c28f 54%, #54735b); }
.swatch-noir { background: linear-gradient(135deg, #0f1115, #72777d 52%, #f4f6f8); }
.swatch-volt { background: linear-gradient(135deg, #221063, #03d9ff 45%, #e7ff3f); }
.swatch-ghost { background: linear-gradient(135deg, #eef7f4, #b9c8d8 55%, #5e6f7c); }

.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-dim); font-size: 11px; color: var(--muted); }
.legend-row { display: flex; align-items: center; gap: 7px; }
.legend-swatch { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 3px; }

/* ---------- Saved parcels drawer ---------- */
.saved-drawer { position: fixed; z-index: 14; left: 16px; bottom: 16px; width: min(430px, calc(100vw - 32px)); pointer-events: none; }
.saved-toggle { min-width: 184px; height: 48px; display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 0 11px 0 13px; background: var(--surface); box-shadow: var(--shadow-soft); color: var(--ink); font-weight: 650; pointer-events: auto; transition: background .15s ease, border-color .15s ease, transform .18s ease; }
.saved-toggle:hover { background: var(--surface-dim); border-color: #d0d5db; }
.saved-drawer.open .saved-toggle { transform: translateY(4px); }
.saved-toggle-icon { width: 18px; height: 18px; color: var(--accent); }
.saved-toggle strong { min-width: 24px; height: 24px; display: inline-grid; place-items: center; margin-left: auto; border-radius: 999px; padding: 0 7px; background: var(--ink); color: #fff; font-size: 11px; line-height: 1; }
.saved-content { position: absolute; left: 0; bottom: 58px; width: 100%; max-height: min(640px, calc(100vh - 96px)); max-height: min(640px, calc(100dvh - 96px)); display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: var(--shadow); overflow: hidden; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(10px); transition: opacity .16s ease, transform .18s cubic-bezier(.2, .75, .25, 1), visibility 0s linear .2s; }
.saved-drawer.open .saved-content { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); transition-delay: 0s; }
.saved-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.saved-header h2 { margin-bottom: 3px; }
.saved-header p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.saved-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; padding: 12px 14px 10px; background: var(--surface); }
.toolbar-field { display: grid; gap: 4px; min-width: 0; }
.toolbar-field .field-label { margin: 0; }
.toolbar-field select { min-height: 36px; padding: 7px 9px; font-size: 12px; }
.saved-toolbar .button { grid-column: 1 / -1; min-height: 38px; }
.saved-content .legend { margin: 0 14px 10px; }
.pursuit-list { min-height: 0; margin: 0; padding: 0 14px 16px; display: grid; gap: 14px; overflow-y: auto; scrollbar-width: thin; }
.empty-state { margin: 4px 2px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.status-group h3 { display: flex; justify-content: space-between; margin: 0 2px 6px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.pursuit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 6px; border: 1px solid var(--line); border-left: 4px solid var(--stage-color); border-radius: 10px; padding: 10px; background: var(--surface); box-shadow: var(--shadow-soft); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.pursuit-row:hover { border-color: #cfd6de; box-shadow: 0 5px 18px rgb(15 23 32 / 10%); transform: translateY(-1px); }
.pursuit-row.project-row { border-left-width: 6px; }
.project-badge { display: inline-flex !important; width: max-content; margin-bottom: 4px; border-radius: 999px; padding: 2px 6px; background: var(--surface-dim); color: var(--accent) !important; font-size: 9px !important; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.project-member-list { grid-column: 1 / -1; display: grid; gap: 5px; margin: 1px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); }
.project-member { width: 100%; border: 0; padding: 3px 0; background: none; color: var(--muted); font-size: 11px; text-align: left; }
.project-member:hover { color: var(--accent); }
.row-main { min-width: 0; border: 0; padding: 0; background: none; text-align: left; }
.row-main strong, .row-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main strong { font-size: 13px; font-weight: 600; }
.row-main span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.row-main .overdue { color: var(--danger); font-weight: 600; }
.row-status { width: auto; min-height: 34px; padding: 5px 8px; border-radius: 8px; font-size: 11px; color: var(--muted); background: var(--surface-dim); border-color: transparent; }
.row-status:hover, .row-status:focus { border-color: var(--line); }

/* ---------- Map overlays ---------- */
.zoom-hint { position: absolute; z-index: 5; top: 16px; right: 16px; display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(330px, calc(100vw - 500px)); padding: 8px 13px 8px 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-soft); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.zoom-hint.is-hidden { opacity: 0; transform: translateY(-8px); }
.zoom-hint-icon { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: var(--surface-dim); color: var(--accent); }
.zoom-hint-icon svg { width: 15px; height: 15px; }
.zoom-hint strong, .zoom-hint small { display: block; }
.zoom-hint strong { font-size: 12px; }
.zoom-hint small { margin-top: 1px; color: var(--muted); font-size: 11px; }
#map canvas { transition: filter .25s ease; }

.notice, .map-message { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: 12px; }
.notice { margin-top: 14px; background: #fdf3d9; }
.map-message { position: absolute; z-index: 7; top: 74px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); background: var(--surface); box-shadow: var(--shadow); }
.parcel-context-menu { position: fixed; z-index: 35; width: min(238px, calc(100vw - 20px)); border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--surface); box-shadow: var(--shadow); }
.parcel-context-menu[hidden] { display: none; }
.context-title { padding: 5px 7px 8px; border-bottom: 1px solid var(--line); }
.context-title strong, .context-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-title strong { font-size: 13px; font-weight: 700; }
.context-title span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.context-stage-grid { display: grid; gap: 3px; padding-top: 6px; }
.context-stage { min-height: 34px; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 8px; padding: 6px 8px; background: transparent; text-align: left; font-size: 12px; font-weight: 600; }
.context-stage:hover, .context-stage.active { background: var(--surface-dim); }
.context-stage.active { box-shadow: inset 0 0 0 1px var(--line); }
.context-swatch { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 3px; background: var(--stage-color); }
.project-selection-bar { position: absolute; z-index: 26; top: 16px; left: 50%; width: min(720px, calc(100vw - 40px)); display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; transform: translateX(-50%); border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px 11px 15px; background: var(--surface); box-shadow: var(--shadow); }
.project-selection-bar[hidden] { display: none; }
.project-selection-bar strong, .project-selection-bar span { display: block; }
.project-selection-bar strong { font-size: 13px; }
.project-selection-bar span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.layout:has(.project-selection-bar:not([hidden])) .search-shell,
.layout:has(.project-selection-bar:not([hidden])) .zoom-hint { opacity: 0; pointer-events: none; }
.project-suggestions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 9px; }
.project-suggestions[hidden] { display: none; }
.project-selection-bar .project-suggestions-label { margin: 0 3px 0 0; color: var(--ink); font-size: 11px; font-weight: 700; }
.project-suggestion-chip { min-height: 28px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; background: var(--surface-dim); color: var(--ink); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.project-suggestion-chip.owner { border-color: #83cccc; color: #087979; }
.project-suggestion-chip.adjacent { border-color: #edbc83; color: #9b5107; }
.project-suggestion-chip[aria-pressed="true"] { color: #fff; }
.project-suggestion-chip.owner[aria-pressed="true"] { border-color: #009c9c; background: #009c9c; }
.project-suggestion-chip.adjacent[aria-pressed="true"] { border-color: #e47b12; background: #e47b12; }
.project-suggestion-chip:disabled { opacity: .46; cursor: default; }
.project-selection-bar .project-suggestions small { flex-basis: 100%; color: var(--muted); font-size: 10px; line-height: 1.35; }
.layout:has(.project-selection-bar:not([hidden])) .map-message { top: 126px; }

.project-dialog, .onboarding-dialog { width: min(470px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--surface); box-shadow: var(--shadow); }
.project-dialog::backdrop, .onboarding-dialog::backdrop { background: rgb(15 23 32 / 44%); backdrop-filter: blur(2px); }
.project-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.dialog-copy { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.onboarding-dialog { width: min(540px, calc(100vw - 32px)); padding: 0; }
.onboarding-content { padding: 24px; }
.onboarding-content h2 { font-size: 24px; letter-spacing: -.025em; }
.onboarding-steps { display: grid; gap: 15px; margin: 22px 0 0; padding: 0; list-style: none; }
.onboarding-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; }
.onboarding-steps li > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 750; }
.onboarding-steps strong, .onboarding-steps small { display: block; }
.onboarding-steps strong { margin-top: 1px; font-size: 13px; }
.onboarding-steps small { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.onboarding-actions { align-items: center; justify-content: space-between; }
.project-only input { margin-top: 6px; text-transform: none; letter-spacing: normal; }

/* ---------- Detail panel ---------- */
.detail-panel { position: fixed; z-index: 18; top: 16px; right: 16px; bottom: 16px; width: min(390px, calc(100vw - 32px)); overflow-y: auto; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); scrollbar-width: thin; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.detail-actions:empty { display: none; }
.action-link { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 11px; background: var(--surface-dim); color: var(--ink); font-size: 12px; font-weight: 600; text-decoration: none; }
.action-link:hover { background: #eceef1; border-color: #d0d5db; }
.project-action-link { border-color: #b9cbef; background: var(--accent-soft); color: var(--accent); }
.project-action-link:hover { border-color: #91ade2; background: #e8effd; }
.county-fields { display: grid; grid-template-columns: 108px 1fr; gap: 7px 12px; margin: 14px 0; padding: 13px 0; border-block: 1px solid var(--line); font-size: 12px; }
.county-fields dt { color: var(--muted); }
.county-fields dd { margin: 0; overflow-wrap: anywhere; }
.address-value, .address-provenance { display: block; }
.address-provenance { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 650; line-height: 1.35; }
.address-provenance-inferred_nearest { color: #8a5a12; }
.address-provenance-unavailable { font-weight: 500; }

/* ---------- MapLibre chrome ---------- */
.maplibregl-ctrl-attrib { border-radius: 8px 0 0; background: rgb(255 255 255 / 75%); font-size: 10px; }
.maplibregl-popup-content { padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-soft); font: 11px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; }
.maplibregl-popup-tip { opacity: .85; }

/* ---------- Mobile: bottom sheets, field-friendly targets ---------- */
@media (max-width: 760px) {
  select, input, textarea, .map-search input { font-size: 16px; }
  .button, .control-button, .icon-button { min-height: 44px; }
  .icon-button { width: 44px; }

  .search-shell { top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; width: auto; }
  .search-kbd { display: none; }
  .search-results { max-height: 40vh; max-height: 40dvh; overflow-y: auto; }

  .zoom-hint { top: auto; bottom: calc(88px + env(safe-area-inset-bottom)); left: 50%; right: auto; transform: translateX(-50%); max-width: calc(100vw - 24px); }
  .zoom-hint.is-hidden { transform: translate(-50%, 8px); }
  .zoom-hint small { display: none; }
  .map-message { top: calc(66px + env(safe-area-inset-top)); }

  .sidebar { top: auto; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); left: auto; }
  .sidebar.open { width: 58px; }
  .sidebar.open .drawer-toggle { width: 148px; }
  .sidebar-content { position: fixed; left: 12px; right: 12px; bottom: calc(70px + env(safe-area-inset-bottom)); width: auto; max-width: none; max-height: 62vh; max-height: 62dvh; border-radius: 16px; transform: translateY(8px); }
  .sidebar.open .sidebar-content { transform: translateY(0); }

  .saved-drawer { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; }
  .saved-toggle { min-width: 176px; max-width: calc(100vw - 92px); }
  .layout:has(.sidebar.open) .saved-toggle { opacity: 0; pointer-events: none; }
  .layout:has(.saved-drawer.open) .sidebar .drawer-toggle { opacity: 0; pointer-events: none; }
  .saved-content { position: fixed; left: 0; right: 0; bottom: 0; width: auto; max-height: 72vh; max-height: 72dvh; border-radius: 16px 16px 0 0; border-bottom: 0; transform: translateY(18px); }
  .saved-header { padding-top: 14px; }
  .pursuit-list { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }

  .detail-panel { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 76vh; max-height: 76dvh; border-radius: 16px 16px 0 0; border-bottom: 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .project-selection-bar { top: calc(10px + env(safe-area-inset-top)); width: calc(100vw - 24px); grid-template-columns: 1fr 1fr; }
  .project-selection-bar > div { grid-column: 1 / -1; }
  .project-selection-bar .button { width: 100%; }
  .layout:has(.project-selection-bar:not([hidden])) .map-message { top: calc(188px + env(safe-area-inset-top)); }
  .onboarding-content { padding: 20px; }
  .onboarding-actions { display: grid; }
  .onboarding-actions .button { width: 100%; }

  .layout:has(.sidebar.open) .search-shell { left: 12px; width: auto; }
  .maplibregl-ctrl-bottom-left { bottom: calc(64px + env(safe-area-inset-bottom)); }
}
