:root {
  --text: var(--text-primary);
  --muted: var(--text-muted);
  --line: var(--border-default);
  --accent: var(--accent-primary);
  --shadow: var(--shadow-soft);
}
* { box-sizing: border-box; }
body { margin: 0; background: #f5f7f6; color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; filter: none; box-shadow: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #46b49d; outline-offset: 3px; }
/* Touch input (karte.html sets html[data-input="touch"] until the next key press): no ring on controls the page
   focused itself; text fields keep their focus style. */
html[data-input="touch"] :focus-visible:not(input, textarea, select, [contenteditable="true"]) { outline: none !important; }
button, button.secondary, .widget-collapse { color: var(--text); background: #f4f7f6; border: 1px solid var(--line); border-radius: 10px; padding: 10px 13px; font-weight: 600; box-shadow: none; }
button:hover, button.secondary:hover { background: #e8f2ee; filter: none; }
input, select, textarea { color: var(--text); background: #fff; border: 1px solid #d4dfe0; border-radius: 9px; padding: 10px 12px; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #117c6812; }
label { color: #50636c; font-size: 12px; font-weight: 600; }
.app-header { height: 72px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: none; backdrop-filter: none; position: relative; z-index: 1000; }
.brand { display: flex; gap: 11px; align-items: center; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand strong { font-size: 25px; font-weight: 750; letter-spacing: -1px; display: block; line-height: 1.05; }
.brand strong span { color: var(--accent); }
.brand small { display: block; font-size: 9px; font-weight: 650; letter-spacing: 1.6px; color: var(--muted); margin-top: 4px; }
.brand small { letter-spacing: .4px; }
.brand-mark { width: 34px; height: 34px; background: var(--accent); border-radius: 10px 3px 10px 3px; transform: rotate(-8deg); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 8px; border: 1px solid #ffffffbd; border-radius: 4px 1px; }
.toolbar-search-zone { display: flex; flex: 1; min-width: 300px; justify-content: center; }
.toolbar-search-zone > .places-search { flex: 1 1 auto; min-width: 0; max-width: 360px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; min-width: 28px; min-height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; box-shadow: none; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.search-clear:hover { background: color-mix(in srgb, currentColor 14%, transparent); color: var(--text); }
.search-clear:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (pointer: coarse) { .search-clear { width: 36px; height: 36px; min-width: 36px; min-height: 36px; right: 4px; } }
.search-clear svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.active-search-filter { background: #edf7f2; border: 1px solid #b3dccb; border-radius: 10px; padding: 10px; margin-bottom: 14px; font-size: 11px; overflow-wrap: anywhere; }
.search-filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 5px; }
.search-filter-heading button { width: auto; padding: 7px; font-size: 10px; flex-shrink: 0; }
.active-search-filter small { display: block; color: var(--muted); margin-top: 5px; }
.portfolio-filter-hint { color: #08634d; background: #e4f2ed; border-radius: 7px; padding: 8px; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.parcel-acquire-actions { display: grid; gap: 8px; margin-top: 12px; }
.parcel-acquire-actions button { width: 100%; }
.parcel-acquire-actions .parcel-reserve { color: #7a3fac; background: #f0e6fc; border-color: #dac2f4; }
.parcel-acquire-actions .parcel-reserve:hover { background: #e8d8fa; }
.toolbar { display: flex; flex: 0 1 auto; min-width: 0; gap: 6px; align-items: center; justify-content: flex-end; margin-left: 0; }
.toolbar .toolbar-button { width: auto; min-width: 0; white-space: normal; border-color: transparent; background: transparent; font-size: 13px; padding: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.toolbar .toolbar-button > span { min-width: 0; overflow-wrap: anywhere; }
.nav-icon { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.toolbar .primary, button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.toolbar .primary:hover { background: #096451; }
.database-state { display: inline-flex; flex: none; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.database-state::before, .map-live-dot { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #e89b39; display: inline-block; }
.database-state[data-state="ready"]::before { background: #169a78; }
.layout { display: grid; grid-template-columns: 332px minmax(0, 1fr); height: calc(100dvh - 72px); min-height: 0; }
.filter-sidebar, aside.filter-sidebar { background: #fff; border-right: 1px solid var(--line); padding: 25px 18px 16px; overflow: auto; min-width: 0; }
.sidebar-heading { display: flex; justify-content: space-between; align-items: center; margin: 0 3px 18px; }
.eyebrow { display: block; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 1.1px; line-height: 1.6; }
h1 { font-size: 23px; font-weight: 700; margin: 4px 0 0; letter-spacing: -.6px; }
.dialog-close { width: 44px; height: 44px; min-width: 44px; flex: 0 0 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: #f4f7f6; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); line-height: 1; transition: background .15s, border-color .15s; }
.dialog-close:hover { background: #e8f2ee; border-color: #b7cfc5; color: var(--text); }
.dialog-close svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.stats { display: flex; margin: 0 0 24px; gap: 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 0 16px; flex: 1; border: 0; background: transparent; box-shadow: none; border-radius: 0; }
.stat:first-child { padding-left: 3px; border-right: 1px solid var(--line); }
.stat b { font-size: 24px; font-weight: 650; color: var(--text); }
.stat small { font-size: 11px; color: var(--muted); }
.filter-fields { display: grid; grid-template-columns: 1.5fr 1fr; gap: 10px; }
.ctrl { margin: 0; }
.sidebar-section-heading { margin: 22px 3px 10px; font-size: 11px; color: var(--muted); }
.filter-hint { font-size: 10px; color: var(--muted); }
.status-chips { gap: 6px; margin-bottom: 20px; }
.status-chip { padding: 7px 9px; background: #f3f6f5; color: #586c73; border: 1px solid transparent; font-size: 11px; font-weight: 550; box-shadow: none; }
.status-chip.active { background: #e4f2ed; color: #08634d; border-color: #b3dccb; box-shadow: none; }
.status-chip:hover { background: #e8eeeb; }
.usage-filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.usage-filter-chips .usage-filter-chip { display: inline-flex; align-items: center; gap: 6px; width: auto; max-width: 100%; text-align: left; }
.usage-filter-label { min-width: 0; overflow-wrap: anywhere; }
.usage-filter-chips .usage-icon { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 6px; }
.usage-filter-chips .usage-icon svg { width: 16px; height: 16px; }
.usage-filter-chip small { flex: none; }
.usage-filter-note { margin: -10px 3px 14px; font-size: 10px; line-height: 1.6; }
.sidebar-list-heading { padding-top: 15px; margin: 0 3px 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.list-sort { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; margin: 0 3px 14px; }
.list-sort label { margin: 0; font-size: 11px; }
.list-sort select { font-size: 11px; padding: 8px; min-width: 0; }
#count { font-size: 10px; font-weight: 450; color: var(--muted); }
.filter-sidebar .item { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 17px 15px; margin-bottom: 13px; box-shadow: 0 2px 8px #183e2f05; }
.filter-sidebar .item:hover { background: #f6faf8; border-color: #a9cdbf; transform: none; }
.filter-sidebar .item.selected { border-color: var(--accent); background: #f1f8f5; }
.item b { font-size: 12px; font-weight: 650; display: block; margin-bottom: 7px; line-height: 1.5; }
.item .muted { color: var(--muted); font-size: 11px; line-height: 1.6; margin-top: 8px; }
.gem-dot { width: 7px; height: 7px; }
.pill { border-radius: 4px; padding: 3px 6px; margin-left: 0; margin-right: 4px; font-size: 9px; background: #eef1f2; color: #596f79; }
.pill.ok { background: #e0f2e8; color: #16734e; }
.pill.purple-pill { background: #f0e6fc !important; color: #7a3fac !important; border: 0; }
.pill.candidate-pill { background: #fff0d8; color: #916009; border: 0; }
.pill.manual-pill { background: #eaf0fa !important; color: #3e608e !important; }
.pill.dirty-pill, .pill.unpriced-pill { background: #fff1d9 !important; color: #8a641f !important; border: 0; }
.item-actions { margin-top: 8px; }
.item-actions .detailbtn { background: transparent !important; color: var(--accent); border: 0 !important; padding: 0; font-size: 11px; }
.sidebar-footnote { color: var(--muted); font-size: 10px; line-height: 1.6; margin: 20px 4px 0; }
.list-empty { color: var(--muted); padding: 22px 12px; }
.mapwrap { height: 100%; min-height: 0; overflow: hidden; isolation: isolate; }
#map { height: 100%; background: #dfe7e1; }
#map path.leaflet-interactive:focus:not(:focus-visible) { outline: 0; }
.edit-dialog.management-dialog, .tools-dialog.management-dialog { width: min(1120px, calc(100vw - 40px)); height: min(780px, calc(100dvh - 48px)); max-width: none; max-height: none; padding: 0; overflow: hidden; }
.management-dialog[open] { display: flex; flex-direction: column; }
.management-dialog > .edit-head, .management-dialog > .analysis-head { flex: none; height: 86px; margin: 0; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.management-dialog .management-title { display: flex; align-items: center; gap: 10px; }
.management-title .nav-icon { width: 22px; height: 22px; color: var(--accent); }
.edit-dialog.management-dialog #editForm { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; }
.edit-dialog.management-dialog #editForm > .edit-head { flex: none; height: 86px; margin: 0; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.edit-dialog.management-dialog #editContent { min-width: 0; min-height: 0; overflow: auto; padding: 24px 28px; scrollbar-gutter: stable; }
.edit-dialog.management-dialog #addPanel-manual > .row { flex-wrap: wrap; }
.management-nav #addTab-register { gap: 4px; }
.land-register-preview { max-width: 700px; }
.land-register-preview h2 { overflow-wrap: anywhere; hyphens: auto; }
.land-register-status { display: inline-block; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 11px; }
.land-register-illustration { color: var(--accent); }
.land-register-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.land-register-highlights article { padding: 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; line-height: 1.6; }
.land-register-highlights strong { display: block; margin-bottom: 4px; }
.land-register-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; counter-reset: register-step; }
.land-register-steps li { counter-increment: register-step; border-top: 2px solid var(--line); padding-top: 10px; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.land-register-steps li::before { content: counter(register-step); display: block; color: var(--accent); font-weight: 700; margin-bottom: 6px; }
.land-register-formats { display: flex; flex-wrap: wrap; gap: 6px; }
.land-register-formats span { padding: 4px 8px; background: #f4f7f6; border: 1px solid var(--line); border-radius: 6px; font-size: 11px; }
@media (max-width: 760px) {
 .edit-dialog.management-dialog #editForm > .edit-head { height: 74px; padding: 14px; }
 .edit-dialog.management-dialog #editContent { padding: 18px 12px; }
 .land-register-highlights { grid-template-columns: 1fr; }
 .land-register-steps { grid-template-columns: 1fr; }
}
.license-form { display: grid; gap: 12px; }
.license-form input { display: block; width: 100%; margin-top: 7px; }
.license-mode { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.edition-card { display: block; padding: 9px 6px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; }
.edition-card.selected { border-color: var(--accent); background: #f0f8f4; }
.license-check { color: var(--accent); }
.license-lock { color: var(--muted); }
.region-options { min-width: 0; padding: 0; border: 0; margin: 12px 0; }
.region-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.region-card { display: flex; gap: 10px; align-items: center; padding: 10px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; min-width: 0; }
.region-card.selected { border-color: var(--accent); background: #f0f8f4; }
.region-card input[type="checkbox"] { flex: 0 0 16px; width: 16px; min-width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--accent); }
.region-card > span { flex: 1; min-width: 0; }
.state-icon { display: inline-block; flex: none; vertical-align: middle; color: inherit; }
.region-card:not(.unavailable):hover { background: #e8f2ee; }
.map-caption .state-icon { margin: 0 2px; }
.region-card strong { display: block; color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
.region-card.unavailable { background: #f6f8f7; opacity: .55; cursor: not-allowed; }
.region-source { margin-top: 12px; line-height: 1.6; }
.management-nav #ownFamilyGraph { gap: 4px; }
.management-nav .pro-badge { flex: none; padding: 2px 5px; color: #117c68; background: #e2f2e9; border-radius: 5px; font-size: 9px; font-weight: 750; line-height: 1.5; }
.pro-preview { max-width: 640px; margin: auto; line-height: 1.7; }
.pro-preview h2 { color: var(--text); font-size: 26px; line-height: 1.2; letter-spacing: -.5px; }
.pro-network { display: block; width: 100%; max-height: 170px; margin: 16px 0; }
.pro-highlights { display: grid; gap: 8px; padding-left: 20px; color: #36584a; }
.pro-preview button { color: var(--accent); background: #eaf5ef; }
#ownershipEditor.family-active { display: flex; padding: 0; overflow: hidden; scrollbar-gutter: auto; }
.family-embedded { display: flex; flex-direction: column; width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: hidden; container-type: inline-size; }
.family-embedded .family-head { padding: 10px 12px; }
.family-embedded .family-head strong { font-size: 16px; }
.family-embedded .family-head button { width: auto; padding: 6px; font-size: 10px; }
.family-embedded .family-tools { padding: 8px; gap: 7px; }
.family-embedded .family-tools label, .family-embedded .family-search { min-width: 110px; }
.family-embedded .family-actions { flex-wrap: nowrap; overflow-x: auto; padding: 5px 8px; }
.family-embedded .family-actions button { flex: none; white-space: nowrap; }
.family-embedded .family-body { grid-template-columns: minmax(0, 1fr) 260px; }
.family-embedded #familyDetails { padding: 12px; }
.family-embedded .family-export { flex-wrap: wrap; padding: 8px; }
@container (max-width: 700px) {
 .family-embedded .family-tools { max-height: 180px; overflow-y: auto; }
 .family-embedded #familyStatus { max-height: 48px; overflow-y: auto; }
 .family-embedded .family-body { grid-template-columns: 1fr; grid-template-rows: minmax(70px, 1fr) minmax(70px, .65fr); }
 .family-embedded #familyDetails { border-left: 0; border-top: 1px solid var(--line); }
 .family-embedded .family-key { font-size: 9px; gap: 6px; padding: 5px; }
 .family-embedded .family-export span { flex-basis: 100%; }
}
@media (max-width: 760px) {
 .region-grid { grid-template-columns: 1fr; }
 .edition-card { padding: 7px 2px; }
 .pro-preview h2 { font-size: 22px; }
 .pro-network { max-height: 130px; }
 .family-embedded .family-tools label, .family-embedded .family-search { min-width: 90px; }
}
.family-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); flex: none; }
.family-head strong { display: flex; align-items: center; gap: 8px; font-size: 20px; }
.family-tools { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 16px; align-items: end; flex: none; }
.family-tools label { display: grid; gap: 5px; margin: 0; flex: 1; min-width: 130px; }
.family-tools input, .family-tools select { width: 100%; min-width: 0; padding: 8px; font-size: 12px; }
.family-search { position: relative; flex: 1; min-width: 140px; }
.family-search label { min-width: 0; }
#familySearchResults { position: absolute; z-index: 10; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); width: 300px; max-width: 70vw; max-height: 260px; overflow: auto; padding: 8px; }
#familySearchResults button { text-align: left; font-size: 12px; margin: 3px 0; }
.family-portfolios { position: relative; font-size: 12px; min-width: 130px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; }
#familyPortfolioChoices { position: absolute; z-index: 10; min-width: 230px; max-height: 220px; overflow: auto; padding: 10px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
#familyPortfolioChoices label { display: flex; align-items: center; gap: 8px; padding: 5px; }
#familyPortfolioChoices input { width: auto; }
.family-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 16px; flex: none; }
.family-actions button { width: auto; padding: 7px 10px; font-size: 11px; }
#familyStatus { margin: 5px 16px 10px; flex: none; }
.family-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; flex: 1; min-height: 0; overflow: hidden; border-top: 1px solid var(--line); }
.family-stage { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #f8faf9; }
#familyCanvas { flex: 1; min-height: 0; overflow: hidden; touch-action: none; cursor: grab; }
#familyCanvas svg { width: 100%; height: 100%; display: block; }
.family-key { display: flex; flex-wrap: wrap; gap: 14px; font-size: 10px; color: var(--muted); padding: 10px; flex: none; }
#familyDetails { min-width: 0; overflow: auto; padding: 20px; border-left: 1px solid var(--line); font-size: 12px; line-height: 1.6; }
#familyDetails h2 { font-size: 18px; overflow-wrap: anywhere; }
.family-position { border-top: 1px solid var(--line); margin-top: 12px; padding: 10px 0; overflow-wrap: anywhere; }
.family-position summary { cursor: pointer; font-weight: 600; }
.family-position p { overflow-wrap: anywhere; }
.family-totals { background: #f3f8f5; border-radius: 10px; padding: 12px; }
.family-export { display: flex; align-items: center; gap: 8px; flex: none; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 11px; }
.family-export button { width: auto; font-size: 11px; padding: 8px; }
.family-printout { display: none; }
@media (max-width: 760px) {
 .family-dialog { width: calc(100vw - 12px); height: calc(100dvh - 12px); }
 .family-head { padding: 10px 12px; }
 .family-head strong { font-size: 16px; }
 .family-tools { gap: 7px; padding: 8px; }
 .family-tools label, .family-search { min-width: 100px; }
 .family-actions { flex-wrap: nowrap; overflow-x: auto; padding: 5px 8px; }
 .family-actions button { flex: none; white-space: nowrap; }
 .family-body { grid-template-columns: 1fr; grid-template-rows: minmax(160px, 1fr) minmax(120px, .7fr); }
 #familyDetails { border-left: 0; border-top: 1px solid var(--line); padding: 12px; }
 .family-key { gap: 8px; padding: 6px; font-size: 9px; }
 .family-export { flex-wrap: wrap; padding: 8px; }
 .family-export span { flex-basis: 100%; }
}
.management-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 224px minmax(0, 1fr); overflow: hidden; }
.management-nav { min-height: 0; overflow-y: auto; padding: 20px 12px; background: #f3f6f5; border-right: 1px solid var(--line); }
.management-nav-heading { display: block; margin: 0 12px 14px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: 1px; text-transform: uppercase; }
.management-nav button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; margin-bottom: 6px; padding: 12px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: left; white-space: normal; }
.management-nav button > span { min-width: 0; overflow-wrap: anywhere; }
.management-nav button svg { flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.management-nav button[aria-pressed="true"], .management-nav button[aria-selected="true"] { background: #fff; border-color: #d5e4de; color: var(--accent); box-shadow: 0 2px 6px #243e3510; }
.management-nav button:focus-visible, #ownershipEditor:focus-visible, #manageBody:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#ownershipEditor, #manageBody { min-width: 0; min-height: 0; overflow: auto; padding: 24px 28px; scrollbar-gutter: stable; }
#manageBody { display: block; }
#ownershipEditor > h2 { margin-top: 0; font-size: 22px; letter-spacing: -.4px; }
.ownership-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ownership-editor-actions button { width: auto; }
.management-dialog input, .management-dialog select, .management-dialog textarea { min-width: 0; max-width: 100%; }
.analysis-tabs button { min-width: 0; overflow-wrap: anywhere; }
.ownership-dialog label, #editOwnership label, #ownershipFilters label, .ownership-relation label { margin-top: 12px; }
.ownership-check { display: flex !important; align-items: center; gap: 10px; padding: 8px; }
.ownership-check input { width: auto; margin: 0; }
.property-cards { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.property-card { display: grid; gap: 4px; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-primary); cursor: pointer; }
.property-card:hover { background: var(--surface-item-hover); border-color: var(--border-item-hover); }
.property-card span { color: var(--muted); font-weight: 400; }
.property-loose { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.property-flow { list-style: none; margin: 8px 0 0; padding: 0; }
.property-flow > li { padding: 4px 0 16px; border-bottom: 1px solid var(--line); }
.property-flow > li:last-child { border-bottom: 0; }
.property-flow h3 { display: flex; align-items: center; gap: 10px; }
.property-flow h3 span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-control); border: 1px solid var(--line); font-size: 12px; }
.property-unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.property-unit-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-primary); }
.property-unit-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; margin-bottom: 4px; }
.property-unit-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
#ownershipEditor .property-unit-card label { margin: 8px 0 0; }
#ownershipEditor:not(.family-active) button.property-add-unit:not(.dialog-close) { width: 100%; min-height: 40px; margin-top: 12px; border-style: dashed; background: transparent; }
.property-total { margin: 16px 0 4px; }
.property-total b { font-size: 17px; color: var(--accent); }
.property-total small { color: var(--muted); }
.property-saved { padding: 8px 12px; border-radius: 10px; background: var(--surface-selected); color: var(--text-selected); font-weight: 600; }
.property-more { margin: 8px 0 12px; }
.property-more > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.dialog-message { flex: none; display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 40px 10px 24px; position: relative; border-bottom: 1px solid var(--line); background: #fff8e8; color: #526872; font-size: 13px; line-height: 1.5; }
.dialog-message[hidden] { display: none; }
.dialog-message[data-kind="fail"] { background: #fff0ec; color: #913f29; }
.dialog-message[data-kind="success"] { background: #eaf6f1; color: #286e58; }
.dialog-message-text { min-width: 0; overflow-wrap: anywhere; }
.property-sticky-actions { position: sticky; bottom: -24px; z-index: 5; margin: 16px -28px -24px; padding: 12px 28px; background: #fff; box-shadow: 0 -4px 10px #17333314; }
.property-wizard-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.property-dissolve { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.property-spacer { flex: 1 1 auto; }
#ownershipEditor:not(.family-active) button.property-action:not(.dialog-close) { flex: 0 0 auto; width: auto; min-height: 32px; padding: 5px 12px; font-size: 12.5px; line-height: 1.4; }
#ownershipEditor:not(.family-active) button.property-icon:not(.dialog-close) { width: 36px; min-height: 36px; padding: 0; font-size: 18px; }
#ownershipEditor:not(.family-active) button.property-card:not(.dialog-close) { min-height: 0; padding: 12px 16px; font-size: 13px; }
#ownershipEditor .property-back { margin-bottom: 8px; }
.property-clarify { display: grid; gap: 6px; margin: 8px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-primary); }
.property-clarify.is-open { border-color: var(--analysis-warning-border); background: var(--analysis-warning-background); }
.property-clarify small { color: var(--muted); }
.property-parcel-extra { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.property-parcel-extra select { flex: 1 1 auto; }
#ownershipEditor:not(.family-active) button.property-link:not(.dialog-close) { min-height: 28px; margin-top: 6px; padding: 2px 10px; }
.ownership-weg-hint { margin: 16px 0; }
.ownership-new-member { margin: 10px 0; padding: 10px; border: 1px solid #d5e4de; border-radius: 8px; }
.ownership-new-member summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.ownership-bulk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.ownership-bulk-actions button { flex: 1 1 150px; width: auto; font-size: 12px; }
.ownership-selection-summary { padding: 10px; border: 1px solid #d5e4de; border-radius: 8px; font-size: 12px; }
.ownership-relation, .ownership-preview { border: 1px solid #d5e4de; border-radius: 12px; padding: 14px; margin: 12px 0; min-width: 0; }
.ownership-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ownership-dialog textarea { width: 100%; min-height: 70px; border: 1px solid #d5e4de; border-radius: 8px; padding: 10px; font: inherit; }
.ownership-marker { background: transparent; border: 0; }
.ownership-unit-badge { display: inline-block; background: #fff; color: #18453c; border: 2px solid #277966; border-radius: 10px; padding: 5px 9px; white-space: nowrap; font-size: 11px; box-shadow: 0 2px 8px #183c3640; }
.ownership-unit-badge { transform: translate(-50%, 10px); background: #18453c; color: #fff; }
.parcel-map-labels { display: flex; flex-direction: column; align-items: center; gap: 4px; width: max-content; transform: translate(-50%, -100%); pointer-events: none; }
.parcel-price-label .parcel-map-labels .price-chip { transform: none; }
.ownership-dialog[aria-busy="true"]::after, #analysisContent[aria-busy="true"]::before { content: ""; display: block; width: 20px; height: 20px; margin: 12px auto; border: 2px solid #d5e4de; border-top-color: var(--accent); border-radius: 50%; animation: catalog-spin .8s linear infinite; }
.ownership-dialog[aria-busy="true"]::after { position: absolute; top: 12px; right: 72px; pointer-events: none; }
.ownership-dialog, #toolsDialog, #importDialog, #analysisContent.management-form {
  --management-field-height: 36px;
  --management-action-height: 36px;
}
#ownershipTitle, #toolsTitle { font-size: 20px; line-height: 1.3; }
:is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form) { font-size: 13px; line-height: 1.5; }
:is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form) h2 { margin: 0 0 16px; font-size: 20px; line-height: 1.3; letter-spacing: -.3px; overflow-wrap: anywhere; }
:is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form) h3 { margin: 24px 0 12px; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
:is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form) p { margin: 12px 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
:is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form) .tiny { font-size: 12px; line-height: 1.5; }
:is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form) :where(label:not(.ownership-check):not(.region-card):not(.appearance-choice):not(.edition-card):not(.usage-label)) { display: grid; gap: 6px; margin: 16px 0 0; min-width: 0; font-size: 12px; line-height: 1.5; }
:is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form) :is(input, select):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([multiple]) { width: 100%; height: var(--management-field-height); min-width: 0; margin: 0; padding-block: 7px; font-size: 13px; line-height: 1.5; }
:is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form) textarea { width: 100%; min-height: 72px; margin: 0; padding: 7px 12px; font-size: 13px; line-height: 1.5; resize: vertical; }
:is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form) select[multiple] { width: 100%; min-height: 84px; margin: 0; padding: 7px 12px; background-image: none; font-size: 13px; line-height: 1.5; }
:is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form) button:not(.dialog-close) { min-height: var(--management-action-height); max-width: 100%; padding: 7px 12px; font-size: 13px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
:is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form) :is(input[type="checkbox"], input[type="radio"]) { flex: 0 0 16px; width: 16px; height: 16px; min-width: 16px; margin: 0; padding: 0; accent-color: var(--accent); }
:is(#ownershipEditor, #analysisContent.management-form) .analysis-row { gap: 16px; margin: 16px 0; }
:is(#ownershipEditor, #analysisContent.management-form) .analysis-row > label { margin: 0; }
:is(#ownershipEditor, #analysisContent.management-form) .ownership-check { min-height: 36px; margin: 8px 0; padding: 7px 12px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
#ownershipEditor .ownership-editor-actions, #ownershipEditor .ownership-bulk-actions { gap: 12px; margin: 16px 0; }
#ownershipEditor .ownership-editor-actions button { flex: 0 1 auto; }
#ownershipEditor > button { margin: 16px 12px 0 0; }
:is(#ownershipEditor, #analysisContent.management-form) :is(.ownership-relation, .ownership-preview, .ownership-new-member) { margin: 16px 0; padding: 16px; }
:is(#ownershipEditor, #analysisContent.management-form) .ownership-relation legend { padding: 0 6px; font-size: 13px; font-weight: 650; }
#ownershipEditor .ownership-new-member summary { font-size: 13px; line-height: 1.5; }
#ownershipEditor .ownership-selection-summary { padding: 12px 16px; }
#ownershipEditor .analysis-table { font-size: 13px; line-height: 1.5; }
#ownershipEditor .analysis-table :is(th, td) { padding: 10px 8px; overflow-wrap: anywhere; }
#ownershipEditor .pro-preview h2 { font-size: 20px; }
#manageBody .tool-section { gap: 16px; padding: 24px 0; }
#manageBody .tool-section:first-child { padding-top: 0; }
#manageBody .tool-section :is(h2, p, label), #manageBody .region-options, #manageBody .appearance-options { margin: 0; }
#manageBody .row { gap: 12px; flex-wrap: wrap; }
#manageBody .row > button { flex: 1 1 220px; }
#manageBody .rate-settings-grid { gap: 12px; margin: 12px 0 0; }
#manageBody .rate-settings-item { gap: 12px; min-height: 50px; padding: 7px 12px; }
#manageBody .rate-settings-item .usage-label { font-size: 13px; }
#manageBody .rate-settings-heading { font-size: 13px; font-weight: 650; }
#manageBody .rate-manual-note { font-size: 12px; line-height: 1.5; }
#manageBody .region-grid, #manageBody .appearance-grid { gap: 12px; }
#manageBody .region-card { padding: 9px 12px; min-height: 44px; }
#manageBody .appearance-choice { padding: 16px; gap: 12px; }
#manageBody .appearance-choice > span { overflow-wrap: anywhere; }
#manageBody .appearance-choice small { font-size: 12px; line-height: 1.5; margin-top: 6px; }
#manageBody .license-form { gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
#manageBody .license-mode { font-size: 12px; }
#settingsPanel-licenses { container-type: inline-size; }
#settingsPanel-licenses .tool-section { grid-template-columns: minmax(0, 1fr); min-width: 0; }
#licenseFeatureGroups { min-width: 0; }
#manageBody .license-products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-width: 0; border: 0; padding: 0; margin: 0; }
#manageBody .license-product-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-primary); color: var(--text); font-size: 13px; font-weight: 400; cursor: pointer; }
#manageBody .license-product-card.selected { border-color: var(--accent); background: var(--surface-region-selected); }
#manageBody .license-product-card[data-edition="business"] { background: var(--surface-secondary); cursor: default; }
#manageBody .license-card-heading { display: flex; align-items: center; gap: 8px; min-height: 36px; }
#manageBody .license-card-heading strong { min-width: 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
#manageBody .license-price { display: grid; align-content: start; gap: 4px; min-height: 62px; }
#manageBody .license-price strong { font-size: 24px; line-height: 1.2; letter-spacing: -.4px; overflow-wrap: anywhere; }
#manageBody .license-price small, #manageBody .license-card-state { font-size: 11px; line-height: 1.5; color: var(--muted); }
#manageBody .license-positioning { min-height: 40px; line-height: 1.5; }
#manageBody .license-product-card ul { display: grid; gap: 8px; margin: 0; padding-left: 16px; font-size: 12px; line-height: 1.5; }
#manageBody .license-card-state { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
#manageBody .license-product-card .pro-badge { align-self: flex-start; padding: 2px 6px; border-radius: 5px; color: var(--badge-pro-text); background: var(--badge-pro-background); font-size: 10px; font-weight: 650; }
#manageBody #licenseEditionStatus { color: var(--text); font-size: 16px; font-weight: 600; }
#manageBody #licenseEditionStatus.fail { color: var(--status-error); }
#manageBody .license-category, #manageBody .license-key-panel { margin: 12px 0 0; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
#manageBody .license-category:first-child { margin-top: 0; }
#manageBody .license-category > summary, #manageBody .license-key-panel > summary { padding: 12px 16px; font-size: 13px; font-weight: 600; cursor: pointer; }
#manageBody .license-category > summary small { margin-left: 8px; font-size: 11px; color: var(--muted); font-weight: 400; }
#manageBody .license-table-scroll { overflow-x: auto; width: 100%; max-width: 100%; min-width: 0; padding: 0 12px 12px; }
#manageBody .license-feature-table { width: 100%; min-width: 640px; table-layout: fixed; border-collapse: collapse; font-size: 12px; line-height: 1.5; }
#manageBody .license-feature-table :is(th, td) { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
#manageBody .license-feature-table th { color: var(--text); background: transparent; }
#manageBody .license-feature-table th:first-child { width: 36%; text-align: left; }
#manageBody .license-feature-table td { text-align: center; }
#manageBody .license-feature-table td:last-child { background: var(--surface-secondary); }
#manageBody .license-feature-table svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
#manageBody .license-info-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 36px; padding: 0; border: 0; background: transparent; font-size: 12px; line-height: 1.5; text-align: left; }
#manageBody .license-info-toggle:hover { background: var(--surface-hover); }
#manageBody .license-info-toggle svg { color: var(--muted); }
#manageBody .license-feature-info { padding: 12px 0 4px; font-weight: 400; }
#manageBody .license-feature-info p { font-size: 12px; line-height: 1.5; }
#manageBody .license-feature-info details { margin-top: 12px; }
#manageBody .license-feature-info summary { cursor: pointer; color: var(--accent); font-size: 12px; }
#manageBody .license-feature-info details p { margin-top: 8px; }
#manageBody .license-feature-status { display: inline-block; padding: 4px 6px; border-radius: 5px; color: var(--text-planned); background: var(--surface-planned); font-size: 11px; line-height: 1.4; }
#manageBody .license-feature-status.partial { color: var(--badge-warning-text); background: var(--badge-warning-background); }
#manageBody .license-key-panel > :not(summary) { margin: 12px 16px; }
.parcel-limit-dialog { width: min(520px, calc(100vw - 24px)); }
/* Deletion confirmation: short, with Abbrechen and a red Löschen. */
.file-dialog.delete-dialog { width: min(380px, calc(100vw - 24px)); padding: 18px 18px 16px; border-radius: 16px; }
.delete-dialog .dialog-close { display: none; }
.delete-dialog h2 { margin: 0 0 10px; font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
.delete-lines { margin: 0 0 12px; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.delete-lines li + li { margin-top: 4px; }
.delete-lines.is-blocked { list-style: none; padding-left: 0; }
.file-dialog .delete-choice { display: grid; gap: 6px; margin: 0 0 12px; font-size: 13px; font-weight: 600; }
.delete-choice[hidden] { display: none; }
.delete-choice select, .delete-choice input { width: 100%; }
.backup-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.backup-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; line-height: 1.4; }
.backup-row > span { min-width: 0; overflow-wrap: anywhere; }
.backup-row > button { flex: 0 0 auto; width: auto; }
.delete-hint { margin: 0 0 14px; color: var(--muted); }
.delete-error { margin: 0 0 12px; padding: 8px 10px; border: 1px solid var(--error-border); border-radius: 8px; background: var(--error-background); color: var(--error-text); font-size: 12px; line-height: 1.5; }
.delete-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.delete-actions button { min-width: 0; width: 100%; font-size: 13px; line-height: 1.3; white-space: normal; }
/* Blocked deletion: the way forward (e.g. "Zu den Einheiten") takes the place of "Löschen" next to "Abbrechen";
   without one, "Abbrechen" alone fills the row, so no gap suggests a missing button. */
.delete-actions:has(> #deleteAction[hidden]):has(> #deleteConfirm[hidden]) #deleteCancel { grid-column: 1 / -1; }
@media (max-width: 600px) {
 .file-dialog.delete-dialog[open] { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; border-radius: 18px 18px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); }
 .delete-actions button { font-size: 15px; }
}
.file-dialog.quick-start-dialog { width: min(780px, calc(100vw - 32px)); height: min(720px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); padding: 20px; overflow: hidden; background: var(--surface-primary); color: var(--text); }
.quick-start-dialog[open] { display: flex; flex-direction: column; gap: 12px; }
.quick-start-dialog .dialog-heading { flex: none; align-items: center; }
.quick-start-dialog .dialog-heading h2 { margin: 0; font-size: 22px; line-height: 1.3; }
.quick-start-dialog .quick-start-intro { flex: none; margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.quick-start-dialog .quick-start-progress { flex: none; margin: 0; color: var(--accent); font-size: 12px; font-weight: 600; }
.quick-start-content { flex: 1; min-height: 0; overflow: auto; }
.quick-start-content h3 { margin: 4px 0 12px; font-size: 18px; line-height: 1.4; }
.quick-start-content p { margin: 12px 0; font-size: 13px; line-height: 1.5; }
.quick-start-regions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.file-dialog.quick-start-dialog .quick-start-region { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 64px; padding: 8px 10px; border: 1px solid var(--line); background: var(--surface-control); color: var(--text); font-size: 12px; text-align: left; }
.quick-start-region > span { min-width: 0; }
.quick-start-region strong { display: block; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.quick-start-region small { display: block; margin-top: 3px; font-size: 10px; line-height: 1.4; color: var(--muted); }
.quick-start-dialog .quick-start-region.selected { background: var(--surface-region-selected); border-color: var(--accent); }
.quick-start-dialog .quick-start-region:hover { background: var(--surface-hover); }
.quick-start-entry-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.quick-start-dialog button.primary { color: var(--text-on-accent); background: var(--accent); border-color: var(--accent); }
.quick-start-dialog button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.quick-start-glossary { margin-top: 16px; color: var(--muted); font-size: 12px; }
.quick-start-content label { display: block; margin-top: 16px; }
.quick-start-content .quick-start-name { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; font-size: 14px; }
.quick-start-glossary summary { cursor: pointer; }
.quick-start-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: none; padding-top: 12px; border-top: 1px solid var(--line); }
.quick-start-actions button { flex: 1 1 110px; font-size: 12px; line-height: 1.4; }
.quick-start-dialog .quick-start-status { flex: none; max-height: 96px; overflow: auto; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-secondary); font-size: 12px; line-height: 1.5; }
.quick-start-dialog .quick-start-status.fail { color: var(--status-error); }
.quick-start-record { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; font-size: 12px; line-height: 1.5; }
.quick-start-record div { min-width: 0; }
.quick-start-record dt { color: var(--muted); }
.quick-start-record dd { margin: 3px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.file-dialog.quick-start-dialog[data-view="map"], .file-dialog.quick-start-dialog[data-view="success"] { position: fixed; inset: auto auto 64px 16px; margin: 0; width: min(420px, calc(100vw - 32px)); height: min(360px, calc(100dvh - 160px)); z-index: 1002; box-shadow: var(--shadow-file); }
.file-dialog.quick-start-dialog[data-view="map"] { height: min(280px, calc(100dvh - 160px)); }
.file-dialog.quick-start-dialog[data-view="success"] { height: min(440px, calc(100dvh - 160px)); }
.quick-start-dialog[data-view="map"] .quick-start-intro, .quick-start-dialog[data-view="success"] .quick-start-intro, .quick-start-dialog[data-view="map"] .quick-start-entry-actions, .quick-start-dialog[data-view="map"] .quick-start-glossary { display: none; }
.quick-start-dialog[data-view="map"] .dialog-heading h2, .quick-start-dialog[data-view="success"] .dialog-heading h2 { font-size: 16px; }
.quick-start-dialog[data-view="map"] .quick-start-content h3, .quick-start-dialog[data-view="success"] .quick-start-content h3 { font-size: 15px; }
.quick-start-dialog[data-view="success"] .quick-start-content h3 { margin-bottom: 6px; }
.quick-start-dialog[data-view="success"] .quick-start-content p { margin: 6px 0; }
.quick-start-dialog[data-view="success"] .quick-start-record { gap: 8px; margin: 8px 0; }
.quick-start-dialog[data-view="success"] .quick-start-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) {
 .file-dialog.quick-start-dialog { padding: 14px; width: calc(100vw - 24px); }
 .quick-start-dialog .dialog-heading h2 { font-size: 18px; }
 .quick-start-regions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .quick-start-entry-actions { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) { .quick-start-regions { grid-template-columns: minmax(0, 1fr); } }
@media print { .quick-start-dialog { display: none !important; } }
@container (min-width: 790px) { #manageBody .license-products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (max-width: 459px) { #manageBody .license-products { grid-template-columns: minmax(0, 1fr); } }
#ownershipEditor.family-active { font-size: 13px; line-height: 1.5; }
#ownershipEditor .family-head { padding: 12px 16px; }
#ownershipEditor .family-head strong, #ownershipEditor #familyDetails h2 { font-size: 18px; line-height: 1.3; }
#ownershipEditor .family-tools { gap: 12px; padding: 12px 16px; }
#ownershipEditor .family-tools label { margin: 0; gap: 6px; font-size: 12px; line-height: 1.5; }
#ownershipEditor .family-tools :is(input, select) { height: 36px; margin: 0; padding-block: 8px; font-size: 12px; }
#ownershipEditor .family-portfolios { padding: 8px 10px; font-size: 12px; }
#ownershipEditor .family-actions, #ownershipEditor .family-export { gap: 8px; padding: 8px 16px; }
#ownershipEditor :is(.family-head, .family-actions, .family-export) button { min-height: 36px; padding: 8px 10px; font-size: 12px; line-height: 1.5; }
#ownershipEditor #familyDetails { padding: 16px; font-size: 13px; line-height: 1.5; }
#ownershipEditor #familyDetails p { margin: 12px 0; }
#ownershipEditor #familyPortfolioChoices label { margin: 0; padding: 8px; font-size: 12px; }
#ownershipEditor #familyStatus { margin: 8px 16px; font-size: 12px; line-height: 1.5; }
#ownershipEditor .family-key, #ownershipEditor .family-export { font-size: 11px; line-height: 1.5; }
@media (max-width: 760px) {
  .edit-dialog.management-dialog, .tools-dialog.management-dialog { width: calc(100vw - 16px); height: calc(100dvh - 24px); }
  .management-dialog > .edit-head, .management-dialog > .analysis-head { height: 74px; padding: 14px; }
  .management-body { grid-template-columns: 116px minmax(0, 1fr); }
  .management-nav { padding: 14px 6px; }
  .management-nav-heading { margin-inline: 8px; font-size: 9px; }
  .management-nav button { gap: 6px; padding: 10px 6px; font-size: 11px; }
  .management-nav button svg { flex-basis: 16px; width: 16px; height: 16px; }
  #ownershipEditor, #manageBody { padding: 18px 12px; }
  #ownershipEditor > h2 { font-size: 18px; overflow-wrap: anywhere; }
  #ownershipEditor .analysis-row, #ownershipEditor .ownership-summary { grid-template-columns: minmax(0, 1fr); }
  .ownership-dialog[aria-busy="true"]::after { top: 6px; right: 58px; }
  #ownershipTitle, #toolsTitle { font-size: 18px; }
  :is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form) h2 { font-size: 18px; }
  :is(#ownershipEditor, #analysisContent.management-form) :is(.ownership-relation, .ownership-preview, .ownership-new-member) { padding: 12px; }
  #ownershipEditor .ownership-editor-actions button { flex: 1 1 160px; }
  #manageBody .rate-settings-item { grid-template-columns: minmax(0, 1fr); }
  #manageBody .appearance-choice { flex-wrap: wrap; padding: 12px; gap: 8px; }
  #manageBody .appearance-choice > span { flex: 1 1 100%; }
  #ownershipEditor .family-tools, #ownershipEditor .family-actions, #ownershipEditor .family-export, #ownershipEditor .family-head { padding-inline: 12px; }
  #ownershipEditor .family-key { flex-wrap: nowrap; overflow-x: auto; padding: 8px 12px; }
  #ownershipEditor .family-key > span { flex: none; white-space: nowrap; }
  .toolbar { min-width: 0; width: 100%; }
  .toolbar .toolbar-button > span { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
}
.map-caption { position: absolute; top: 20px; left: 72px; z-index: 500; display: flex; align-items: center; gap: 8px; background: #183c36e6; color: #fff; padding: 8px 12px; border-radius: 7px; font-size: 11px; pointer-events: none; }
.map-caption > span:last-child { color: #c4d7cf; font-size: 9px; margin-left: 10px; }
.map-print { position: absolute; top: 16px; right: 16px; z-index: 740; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 7px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fffffff0; box-shadow: 0 2px 6px #173a3314; }
.map-print svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.map-live-dot { background: #7be0b4; }
.map-widget, .area-widget { background: #fffffff5 !important; color: var(--text); border: 1px solid #ffffffb3 !important; padding: 14px 16px; border-radius: 13px; box-shadow: 0 8px 32px #0e292c29; backdrop-filter: blur(8px); z-index: 720; width: 304px; max-height: calc(100% - 112px); overflow: auto; }
.layers-widget { width: 244px; }
.map-widget[data-dock="top-left"] { top: 68px; left: 16px; right: auto; bottom: auto; }
.map-widget[data-dock="top-right"] { top: 68px; right: 16px; left: auto; bottom: auto; }
.map-widget[data-dock="bottom-left"] { bottom: 58px; left: 16px; right: auto; top: auto; }
.map-widget[data-dock="bottom-right"] { bottom: 14px; right: 16px; left: auto; top: auto; }
.map-widget.dragging { box-shadow: 0 14px 48px #0b292b55; opacity: .94; }
.widget-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; margin: 0; gap: 8px; }
.widget-grip { cursor: grab; display: inline-flex; align-items: center; gap: 6px; touch-action: none; user-select: none; }
.grip-dots { color: #91a6a5; font-size: 18px; font-weight: 400; }
.widget-collapse { background: transparent; width: 25px; height: 25px; padding: 0; border: 0; font-size: 17px; color: var(--muted); }
.widget-content { display: grid; gap: 9px; }
#layersBody { margin-top: 14px; }
.widget-content button { font-size: 11px; min-height: 34px; border-radius: 7px; }
.widget-content .tiny, .legend-help, .area-sub, .area-source { color: var(--muted); font-size: 10px; line-height: 1.6; }
.basemap-field { font-size: 11px; font-weight: 700; color: var(--text); }
.widget-content select#basemapSelect { width: 100%; font-size: 12px; padding: 8px; }
.basemap-notice { margin: 0; }
.basemap-quick { display: none; border: 0; margin: 0; padding: 0; min-width: 0; }
.basemap-quick legend { padding: 0; margin-bottom: 6px; }
.basemap-quick-list { display: grid; gap: 6px; }
.basemap-quick-item { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; font-weight: 500; cursor: pointer; }
.basemap-quick-item:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px #117c6812; }
.basemap-quick-item input { width: auto; margin: 0; padding: 0; accent-color: var(--accent); }
@media (max-width: 600px) { .layers-widget .basemap-field[for="basemapSelect"], .layers-widget #basemapSelect { display: none; } .layers-widget .basemap-quick { display: block; } }
.basemap-options { border: 0; margin: 0; padding: 0; min-width: 0; }
.basemap-choices { display: grid; gap: 8px; }
.basemap-choice { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.basemap-choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px #117c6812; }
.basemap-choice input { width: auto; margin: 3px 0 0; padding: 0; }
.map-engine-group { display: grid; gap: 8px; }
.basemap-nested { display: grid; gap: 6px; margin-left: 28px; }
.basemap-choice-nested { padding: 8px 12px; }
.basemap-choice-body { display: grid; gap: 4px; min-width: 0; }
.basemap-choice-body .tiny { font-weight: 400; color: var(--muted); font-size: 11px; line-height: 1.5; }
.widget-divider { background: var(--line); }
.gem-legend-grid { gap: 8px; font-size: 10px; }
.gem-legend-item { color: var(--text); }
.gem-legend summary { margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 650; cursor: pointer; }
.gem-legend-grid .gem-legend-jump { width: auto; min-height: 0; padding: 2px 0; border: 0; border-radius: 2px; background: transparent; color: var(--text); font: inherit; text-align: left; }
.gem-legend-grid .gem-legend-jump:hover { color: var(--accent); text-decoration: underline; }
.swatch { width: 10px; height: 10px; border-radius: 2px; border-width: 1px; }
.swatch-purple, .swatch-orange { margin-left: 0; }
#balanceBody { margin-top: 16px; }
.portfolio-total { font-size: 32px; font-weight: 700; line-height: 1.3; letter-spacing: -1px; font-variant-numeric: tabular-nums; color: #126c55; margin: 3px 0 13px; }
.balance-area { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 11px; margin-bottom: 7px; font-size: 11px; color: var(--muted); }
.balance-area strong { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.balance-details { margin-top: 10px; font-size: 11px; }
.balance-details summary { color: var(--muted); cursor: pointer; padding: 6px 0; }
.area-table { font-size: 11px; }
.area-table td { border-top-color: var(--line); padding: 6px 0; }
.balance-footer { display: grid; gap: 5px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 9px; color: var(--muted); }
.balance-filter-summary { font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.balance-filter-summary[data-active="true"] { color: #08634d; font-weight: 600; }
.file-dialog { width: min(940px,calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: #fff; color: var(--text); overflow: auto; box-shadow: 0 24px 80px #173a3333; }
.file-dialog::backdrop { background: #142f3a66; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.file-dialog h2 { margin: 4px 0 12px; color: var(--text); }
.file-dialog p { line-height: 1.65; }
.file-dialog label { display: block; margin: 12px 0 6px; }
.file-dialog textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; resize: vertical; }
.import-table-wrap { max-width: 100%; overflow: auto; margin: 16px 0; max-height: 48vh; }
.import-table-wrap table { min-width: 680px; }
.import-table-wrap input[type="checkbox"] { width: 20px; height: 20px; }
.document-list { list-style: none; padding: 0; margin: 0 0 16px; }
.document-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.document-open { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); text-decoration: none; border-radius: 8px; padding: 4px; }
.document-open:hover { background: #f0f7f4; }
.document-open > span:nth-child(2) { flex: 1; min-width: 0; }
.document-open strong, .document-open small { display: block; overflow-wrap: anywhere; }
.document-open strong { font-size: 13px; line-height: 1.5; }
.document-open small { color: var(--muted); font-size: 10px; line-height: 1.6; margin-top: 4px; }
.document-type { flex: 0 0 38px; color: #387563; text-align: center; }
.document-type-pdf { color: #b94a48; }
.document-type svg { display: block; width: 30px; height: 30px; margin: auto; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.document-type b { display: block; font-size: 9px; letter-spacing: .5px; }
.document-external { flex: 0 0 auto; color: var(--muted); }
.document-options { margin: 10px 4px 0 54px; font-size: 11px; }
.document-options summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.document-options label { display: block; margin-top: 8px; }
.document-options button[data-document-remove] { margin-top: 8px; color: #a43535; background: #fff; border-color: var(--line); white-space: normal; }
.document-empty { padding: 16px 0; color: var(--muted); font-size: 12px; }
.document-add { width: 100%; white-space: normal; }
.document-progress { display: flex; align-items: center; gap: 8px; min-height: 24px; font-size: 12px; }
.document-progress p { margin: 8px 0; }
.document-spinner { flex: 0 0 16px; width: 16px; height: 16px; border: 2px solid #d5e6e1; border-top-color: var(--accent); border-radius: 50%; animation: catalog-spin .75s linear infinite; }
#documentStatus[data-error="true"], #documentUploadStatus[data-error="true"] { color: #a43535; }
#parcelDocumentsPanel > label { display: block; margin: 16px 0 8px; font-size: 12px; }
#legalNotes { box-sizing: border-box; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; resize: vertical; }
#legalNotesSave { margin-top: 8px; }
#documentsDialog { width: min(520px,calc(100vw - 24px)); }
#documentsDialog .analysis-actions { flex-wrap: wrap; }
#documentsDialog .analysis-actions button { flex: 1 1 160px; }
.text-button { color: var(--accent); background: transparent; border: 0; padding: 0; width: auto; text-align: left; font-size: 11px; }
.notice { bottom: 10px; left: 16px; right: 16px; max-width: none; width: auto; background: #fff; color: #526872; border: 1px solid #ffffffcc; border-radius: 7px; padding: 9px 13px; font-size: 10px; box-shadow: 0 3px 14px #152f3324; line-height: 1.5; max-height: 52px; overflow: auto; backdrop-filter: none; }
.notice.fail { background: #fff0ec; color: #913f29; border-color: #f0cbbd; }
.notice.success { color: #286e58; }
.notice.loading { color: #8c6a25; background: #fff8e8; }
.analysis-dialog, .edit-dialog, .tools-dialog { background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 25px; box-shadow: 0 20px 70px #102c3540; max-height: 88dvh; }
.analysis-dialog::backdrop, .edit-dialog::backdrop, .tools-dialog::backdrop { background: #0e2b354f; backdrop-filter: blur(3px); }
.analysis-dialog { width: min(940px, 94vw); }
.analysis-dialog[data-view="details"] { position: fixed; inset: 88px 16px 16px auto; margin: 0; width: 392px; max-height: none; height: auto; padding: 22px; overflow: auto; box-shadow: 0 12px 44px #1332373b; z-index: 1001; }
.tools-dialog { width: min(610px, 94vw); overflow: auto; }
.edit-dialog { width: min(480px, 94vw); }
:is(.analysis-dialog, .edit-dialog, .tools-dialog, .file-dialog) :is(input, select):where(:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([multiple])) { height: 36px; min-height: 36px; padding-block: 7px; }
:is(.analysis-dialog, .edit-dialog, .tools-dialog, .file-dialog) textarea { min-height: 72px; padding-block: 7px; }
:is(.analysis-dialog, .edit-dialog, .tools-dialog, .file-dialog) button:not(.dialog-close):where(:not([role="tab"]):not([data-own-manager])) { min-height: 36px; padding: 7px 12px; }
dialog .dialog-close { width: 36px; height: 36px; min-width: 36px; flex-basis: 36px; border-radius: 10px; }
.analysis-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.analysis-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.parcel-navigation { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; color: var(--accent); background: #f4f7f6; }
.parcel-navigation svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.parcel-navigation[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.parcel-gps-marker { background: transparent; border: 0; }
.parcel-navigation-pin { display: block; width: 36px; height: 44px; filter: drop-shadow(0 2px 3px #173a3350); }
.parcel-navigation-pin svg { width: 36px; height: 44px; fill: var(--parcel-pin-color, var(--map-navigation-fill)); stroke: #fff; stroke-width: 1.5; }
.parcel-navigation-pin circle { fill: #fff; stroke: none; }
.analysis-head strong { display: block; font-size: 21px; font-weight: 650; letter-spacing: -.5px; margin-top: 4px; }
.analysis-tabs { gap: 4px; margin: 0 0 22px; background: #f3f6f5; padding: 4px; border-radius: 9px; flex-wrap: nowrap; }
.analysis-tabs button { flex: 1; font-size: 11px; background: transparent; border: 0; color: var(--muted); border-radius: 6px; padding: 9px; }
.analysis-tabs button.active { background: #fff; color: var(--accent); box-shadow: 0 2px 6px #243e3510; }
.analysis-summary { gap: 12px; }
.analysis-kpi { background: #f3f8f5; border: 1px solid #e0ebe4; border-radius: 11px; padding: 16px; }
.analysis-kpi b { font-size: 24px; color: #166c55; }
.analysis-kpi small, .analysis-sub { color: var(--muted); font-size: 11px; }
.analysis-dialog label { color: #536970; font-size: 11px; }
.analysis-dialog input, .analysis-dialog select, .analysis-dialog textarea { background: #fff; color: var(--text); border-color: #d4dfe0; }
.analysis-table { font-size: 12px; }
.analysis-table th { color: var(--muted); border-bottom-color: var(--line); font-size: 11px; }
.analysis-table td { border-bottom-color: var(--line); vertical-align: top; }
.analysis-warning { background: #fff8e9; color: #89672b; border-left-color: #dfb34c; font-size: 10px; }
.analysis-dialog[data-view="details"] .analysis-row { grid-template-columns: 1fr; gap: 10px; }
.analysis-actions button { font-size: 12px; }
.analysis-actions button:last-child { color: #fff; background: var(--accent); border-color: var(--accent); }
.parcel-detail-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.parcel-detail-actions:empty { display: none; }
.analysis-head-actions .dialog-close, .analysis-head-actions .parcel-navigation { width: 36px; height: 36px; min-width: 36px; flex-basis: 36px; border-radius: 10px; padding: 0; }
.analysis-head-actions .dialog-close svg, .analysis-head-actions .parcel-navigation svg { width: 18px; height: 18px; }
.parcel-edit-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
.parcel-detail-actions .parcel-edit-actions > button { min-width: 0; height: auto; min-height: 36px; padding: 3px 6px; font-size: 12px; line-height: 1.3; white-space: normal; text-align: center; }
/* Bearbeiten and Löschen share the first row; every further action spans the full width below. */
.parcel-edit-actions > :is(.wegbtn, .acceptbtn, .candidatebtn) { grid-column: 1 / -1; }
.analysis-dialog[data-view="details"] .analysis-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.analysis-dialog[data-view="details"] .analysis-actions button { width: 100%; min-height: 36px; padding: 7px 8px; font-size: 12px; line-height: 1.35; white-space: normal; }
.analysis-dialog[data-view="details"] .analysis-actions button:only-child { grid-column: 1 / -1; }
.rate-context { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 8px 0 16px; }
.value-optional { margin: 16px 0; color: var(--muted); font-size: 12px; }
.value-optional summary { cursor: pointer; margin-bottom: 10px; }
.active-filter-breadcrumbs { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 0 3px 12px; overflow-wrap: anywhere; }
.gem-legend-statuses { display: flex; flex-wrap: wrap; flex-basis: 100%; gap: 8px 13px; width: 100%; padding-top: 8px; margin-top: 3px; border-top: 1px solid var(--line); }
.map-collapse-all { right: 56px; }
.family-map-dismiss { right: 96px; }
.details-open .map-collapse-all { right: 448px; }
.details-open .family-map-dismiss { right: 488px; }
@media (max-width: 760px) { .details-open .map-collapse-all { right: 56px; } .details-open .family-map-dismiss { right: 96px; } }
.toolbar .toolbar-button.filters-active, .toolbar .toolbar-button.filters-active .nav-icon { color: var(--accent-primary); }
.toolbar .toolbar-button.filters-active > span { font-weight: 700; }
.filter-sidebar > .filter-fields { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.filter-sidebar select { font-size: 13px; }
/* Gemarkung and Flur sit in a div, the other filters in a label that passes its weight on. */
.filter-sidebar .ctrl select { font-weight: 600; }
.filter-sidebar .ctrl { display: grid; gap: 6px; }
.filter-sidebar .ctrl label { margin-bottom: 0; }
#ownershipFilters { display: grid; gap: 12px; padding-top: 12px; }
#ownershipFilters > label, #ownershipFilters .filter-fields > label { display: grid; gap: 6px; margin: 0; }
#ownershipFilters .filter-fields { grid-template-columns: 1fr; gap: 12px; }
.edit-dialog #editContent label { display: grid; gap: 6px; margin-bottom: 14px; font-size: 12px; }
.edit-dialog #editContent input, .edit-dialog #editContent select { margin-top: 0; min-height: 36px; font-size: 13px; }
#editOptionalDetails { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
#editOptionalDetails summary { margin-bottom: 14px; }
.parcel-detail-actions button { font-size: 11px; padding: 7px 10px; width: auto; }
.parcel-detail-actions .adoptbtn { color: #fff; }
.parcel-name { display: block; font-size: 13px; font-weight: 650; margin: 0 0 9px; overflow-wrap: anywhere; }
.parcel-statuses { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 14px; }
.parcel-statuses .pill { margin-left: 0; }
.parcel-usage { display: flex; align-items: center; gap: 10px; font-size: 12px; line-height: 1.6; margin-bottom: 13px; }
.parcel-usage > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.filter-sidebar .parcel-facts { font-size: 11px; line-height: 1.7; }
.parcel-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.parcel-value strong { color: var(--accent); font-size: 17px; }
.parcel-value small { color: var(--muted); font-size: 10px; }
.ownership-value-details { display: grid; gap: 4px; width: 100%; font-size: 12px; line-height: 1.45; }
.ownership-value-details strong { color: inherit; font-size: inherit; }
.ownership-value-details small { font-size: 11px; }
.filter-sidebar .item-actions { margin-top: 14px; }
.usage-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 10px; color: var(--usage-color); background: #f3f7f4; background: color-mix(in srgb, var(--usage-color) 12%, white); }
.usage-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.usage-label { display: flex; align-items: center; gap: 11px; }
.usage-label > span:last-child { min-width: 0; }
.parcel-metadata { display: block; flex-basis: 100%; padding: 17px 15px; margin-bottom: 4px; border: 1px solid var(--accent); border-radius: 14px; background: var(--surface-item-selected); overflow-wrap: anywhere; }
.parcel-metadata > b { display: block; font-size: 12px; font-weight: 650; margin-bottom: 7px; line-height: 1.5; }
.parcel-metadata .parcel-usage { margin-bottom: 0; }
.parcel-metadata small { color: var(--muted); font-size: 10px; }
.analysis-dialog[data-view="dashboard"] { width: min(1060px, 94vw); overflow: auto; }
.usage-section { margin: 26px 0 20px; }
.usage-section-heading, .usage-list-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.usage-section-heading h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: -.4px; }
.usage-section-heading > span, .usage-list-heading > span { color: var(--muted); font-size: 11px; }
.usage-controls { display: flex; align-items: center; gap: 10px; flex: none; }
.usage-metric { display: flex; padding: 3px; border-radius: 9px; background: #f3f6f5; }
.usage-metric button { width: auto; padding: 7px 12px; font-size: 12px; border: 0; background: transparent; color: var(--muted); }
.usage-metric button[aria-pressed="true"] { background: #fff; color: var(--accent); box-shadow: 0 1px 4px #16362a12; }
.chart-print { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 7px; border-color: transparent; background: transparent; color: var(--muted); }
.usage-print-title, .usage-printout { display: none; }
.usage-overview { display: grid; grid-template-columns: minmax(200px, .8fr) minmax(0, 1.2fr); align-items: center; gap: 28px; margin: 22px 0; }
.usage-chart { width: 100%; max-width: 290px; justify-self: center; overflow: visible; user-select: none; }
.usage-segment { pointer-events: none; stroke: #fff; stroke-width: 2; transition: opacity .15s; }
.usage-segment[data-selected="false"] { opacity: .45; }
.usage-chart-center, .usage-chart-count, .usage-chart-caption { pointer-events: none; }
.usage-chart-count { fill: var(--text); font-size: 34px; font-weight: 700; }
.usage-chart-total { fill: var(--text); font-size: 15px; font-weight: 700; }
.usage-chart-caption { fill: var(--muted); font-size: 11px; }
.usage-legend { display: grid; gap: 9px; min-width: 0; }
.usage-legend-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 13px; text-align: left; padding: 14px 12px; background: #fff; border-color: transparent; }
.usage-legend-item[aria-pressed="true"] { border-color: #b7d5c9; background: #edf6f1; }
.usage-swatch { display: block; width: 10px; height: 10px; border-radius: 3px; }
.usage-legend-item strong, .usage-legend-item small { display: block; overflow-wrap: anywhere; }
.usage-legend-item strong { font-size: 12px; font-weight: 600; }
.usage-legend-item small { color: var(--muted); font-size: 10px; font-weight: 400; margin-top: 4px; }
.usage-legend-item .usage-value { color: var(--accent); font-weight: 600; }
.usage-legend-item b { font-size: 12px; font-variant-numeric: tabular-nums; }
.usage-list-heading { border-top: 1px solid var(--line); padding-top: 18px; margin: 22px 0 12px; }
.usage-list-heading h3 { margin: 0; font-size: 15px; }
.usage-parcel-list { display: grid; gap: 11px; max-height: 400px; overflow: auto; }
.usage-parcel { display: flex; align-items: center; justify-content: space-between; gap: 18px; text-align: left; padding: 17px; background: #fff; }
.usage-parcel > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.usage-parcel strong { display: block; font-size: 13px; }
.usage-parcel .usage-parcel-name { display: flex; align-items: center; gap: 10px; }
.usage-parcel small { display: block; margin-top: 5px; font-size: 10px; color: var(--muted); font-weight: 400; line-height: 1.5; }
.usage-parcel-area { flex-shrink: 0; text-align: right; font-size: 12px; color: var(--accent); }
.usage-parcel-value { margin-top: 7px; color: var(--accent); }
.usage-group-value { display: block; margin-top: 5px; color: var(--accent); }
.edit-price-details { margin: 12px 0 18px; font-size: 12px; }
.edit-price-details summary { cursor: pointer; margin-bottom: 10px; }
.rate-settings-heading { font-size: 12px; font-weight: 650; }
.rate-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 6px 12px; margin-bottom: 12px; }
.rate-settings-item { display: grid; grid-template-columns: minmax(0, 1fr) 96px; align-items: center; gap: 10px; min-width: 0; padding: 4px 10px; border-radius: 11px; background: #f6f9f7; overflow-wrap: anywhere; font-size: 12px; }
.rate-settings-item input { width: 100%; min-width: 0; padding: 8px; }
.rate-settings-item label { margin: 0; font-size: 12px; }
.rate-settings-item .usage-icon { flex-basis: 28px; width: 28px; height: 28px; }
.rate-manual-note { color: var(--muted); font-size: 11px; line-height: 1.6; }
.edit-catalog { padding: 12px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 12px; background: #f6f9f7; }
.edit-catalog button { font-size: 12px; }
.edit-catalog-field { margin-bottom: 14px; }
.edit-dialog .edit-catalog-field label { margin-bottom: 7px; }
.edit-dialog .edit-catalog-field input { margin-top: 0; width: 100%; padding-right: 38px; }
.catalog-input-wrap { position: relative; }
.catalog-options { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 190px; overflow: auto; list-style: none; padding: 5px; margin: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.catalog-options [role="option"], .catalog-empty { padding: 10px; font-size: 12px; border-radius: 6px; overflow-wrap: anywhere; }
.catalog-options [role="option"] { cursor: pointer; }
.catalog-options [role="option"]:hover, .catalog-options [aria-selected="true"] { background: #e4f2ed; color: #08634d; }
.catalog-empty { color: var(--muted); }
.catalog-spinner { position: absolute; right: 13px; top: 50%; width: 15px; height: 15px; margin-top: -7.5px; border: 2px solid #d5e6e1; border-top-color: var(--accent); border-radius: 50%; animation: catalog-spin .75s linear infinite; pointer-events: none; }
@keyframes catalog-spin { to { transform: rotate(360deg); } }
.edit-dialog input[readonly] { background-color: #f3f8f5; color: #50636c; }
.edit-catalog p { margin: 10px 0 0; }
#editCatalogStatus[data-state="error"] { color: #a44c37; }
select, input[list], .analysis-dialog select, .edit-catalog-field input {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23647780' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 20px; background-position: right 11px center; padding-right: 38px;
}
input[list]::-webkit-calendar-picker-indicator { opacity: 0; }
.edit-catalog-field input[aria-busy="true"] { background-image: none; }
@media (max-width: 480px) {
  .rate-settings-item { grid-template-columns: minmax(0, 1fr) 72px; gap: 8px; padding: 6px 7px; }
  .rate-settings-item .usage-label { gap: 8px; }
  .rate-settings-item .usage-icon { flex-basis: 26px; width: 26px; height: 28px; }
}
.dashboard-gems { border-top: 1px solid var(--line); padding-top: 16px; margin: 18px 0; }
.dashboard-gems summary { cursor: pointer; font-size: 12px; font-weight: 600; }
.edit-dialog #editMetadataHint { padding: 10px 12px; background: #f3f8f5; border-radius: 8px; }
.tool-section { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.tool-section:first-child { padding-top: 0; }
.tool-section:last-of-type { border-bottom: 0; }
.tool-section h2 { margin: 0; font-size: 14px; font-weight: 650; }
.tool-section p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.tools-dialog .row button { font-size: 12px; }
.v31-value-setting { display: grid !important; grid-template-columns: 1fr 95px auto; align-items: center; }
.v31-value-setting input { width: 100%; min-width: 0; }
.info { background: #f2f6f4; border: 1px solid var(--line); border-radius: 8px; color: var(--text); box-shadow: none; }
.tiny { color: var(--muted); }
.leaflet-popup-content { color: var(--text); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { border-radius: 12px; box-shadow: 0 8px 28px #123a3433; }
.parcel-price-label .price-chip, .spot-value-label .spot-chip { background: #153e35f5; border-color: #d3f2e6; border-radius: 7px; font-family: inherit; box-shadow: 0 4px 14px #102b3655; }
.spot-value-label .spot-chip .spot-count { color: #ceeadd; }
.sidebar-hidden .layout { grid-template-columns: 0 minmax(0, 1fr); }
.sidebar-hidden .filter-sidebar { padding: 0; visibility: hidden; border: 0; }
.details-open .map-widget[data-dock$="right"] { right: 424px; }
.mapwrap.compact-widgets .map-widget { max-height: calc(50% - 66px); }
@media (max-width: 1300px) {
  .app-header { height: 96px; gap: 8px; }
  .toolbar-search-zone { flex: 0 0 280px; min-width: 280px; }
  .toolbar { flex: 1; gap: 2px; }
  .toolbar .toolbar-button { flex: 1; flex-direction: column; padding: 6px 2px; gap: 3px; font-size: 11px; line-height: 1.25; }
  .layout { height: calc(100dvh - 96px); }
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: 300px minmax(0, 1fr); }
  .details-open .map-widget[data-dock$="right"] { visibility: hidden; }
}
@media (max-width: 900px) {
  .brand small { font-size: 8px; letter-spacing: .2px; }
  .app-header { height: 128px; }
  .layout { height: calc(100dvh - 128px); }
}
@media (max-width: 800px) {
  .app-header { height: 160px; }
  .layout { height: calc(100dvh - 160px); }
}
@media (max-width: 760px) {
  .app-header { height: 124px; gap: 9px; flex-wrap: wrap; padding: 10px 12px; align-content: center; }
  .brand strong { font-size: 23px; }
  .brand small { font-size: 8px; }
  .brand-mark { width: 29px; height: 29px; }
  .toolbar-search-zone { flex: 1; min-width: 120px; }
  .database-state { display: none; }
  .toolbar { flex-basis: 100%; justify-content: space-between; gap: 3px; margin: 0; }
  .toolbar .toolbar-button { flex: 1; min-width: 0; padding: 5px 2px; font-size: 9px; flex-direction: column; white-space: normal; gap: 3px; }
  .layout, .sidebar-hidden .layout { display: block; height: calc(100dvh - 124px); min-height: 0; }
  .mapwrap { height: 100%; min-height: 0; }
  .filter-sidebar, aside.filter-sidebar { position: fixed; top: 124px; bottom: 0; left: 0; width: min(332px, 88vw); height: auto; z-index: 900; box-shadow: 8px 0 30px #14333730; }
  .sidebar-hidden .filter-sidebar { transform: translateX(-100%); padding: 25px 18px 16px; }
  .map-caption { left: 58px; top: 16px; font-size: 10px; padding: 7px 9px; }
  .map-caption > span:last-child { display: none; }
  .map-widget { width: min(288px, calc(100% - 24px)); max-height: calc(100% - 120px); padding: 12px 14px; }
  .layers-widget { width: 218px; }
  .map-widget[data-dock^="top"] { top: 62px; }
  .map-widget[data-dock="bottom-left"] { bottom: 58px; }
  .map-widget[data-dock="bottom-right"] { bottom: 14px; }
  .map-widget[data-dock$="left"] { left: 12px; }
  .map-widget[data-dock$="right"] { right: 12px; }
  .widget-grip { cursor: default; touch-action: auto; }
  .grip-dots { display: none; }
  .portfolio-total { font-size: 28px; }
  .analysis-dialog[data-view="details"] { inset: auto 0 0; width: 100%; max-height: 62dvh; height: auto; border-radius: 18px 18px 0 0; }
  .details-open .area-widget { visibility: hidden; }
  .notice { left: 12px; right: 12px; max-height: 46px; font-size: 9px; }
  .analysis-summary, .analysis-row { grid-template-columns: 1fr; }
  .usage-overview { grid-template-columns: 1fr; gap: 14px; }
  .usage-chart { max-width: 230px; }
  .usage-section-heading, .usage-list-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .usage-parcel { align-items: flex-start; flex-direction: column; gap: 8px; }
  .usage-parcel-area { text-align: left; }
  .analysis-dialog, .tools-dialog, .edit-dialog { padding: 20px; }
  .v31-value-setting { grid-template-columns: 1fr 85px !important; }
  .v31-value-setting button { grid-column: 1 / -1; }
}
@media (max-width: 400px) {
  .app-header { height: 176px; }
  .toolbar-search-zone { flex-basis: 100%; order: 2; }
  .toolbar { order: 3; }
  .layout, .sidebar-hidden .layout { height: calc(100dvh - 176px); }
  .filter-sidebar, aside.filter-sidebar { top: 176px; }
}
@media print {
  .app-header, .filter-sidebar, .layers-widget, .map-caption, .map-print, .notice, dialog { display: none !important; }
  .layout, .sidebar-hidden .layout { display: block; height: 100vh; }
  .mapwrap { height: 100vh; }
  .area-widget { right: 12px !important; bottom: 12px !important; max-height: none; visibility: visible !important; }
  body.print-usage > :not(#usagePrintout) { display: none !important; }
  body.print-usage .usage-printout { display: block; color: #182d33; background: #fff; }
  .usage-printout .usage-print-title { display: block; margin: 0 0 16px; font-size: 20px; }
  .usage-printout .usage-overview { grid-template-columns: minmax(180px, .8fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
  .usage-printout .usage-chart { max-width: 260px; }
  .usage-printout .usage-segment { opacity: 1; }
  .usage-printout .usage-legend-item { background: #fff; border: 0; padding: 6px 0; break-inside: avoid; }
  body.print-family > :not(#familyPrintout) { display: none !important; }
  body.print-family .family-printout { display: block; background: #fff; color: #172a32; }
  .family-printout svg { width: 100%; height: auto; max-height: 90vh; }
  .family-printout button { display: none; }
  .family-printout details { break-inside: avoid; }
  .family-printout p, .family-printout summary { overflow-wrap: anywhere; }
}
@media (max-width: 360px) {
  .toolbar #sidebarToggle { flex: .8; }
  .toolbar #toolsOpen { flex: 1.2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
  .catalog-spinner, .document-spinner { animation: none; }
}
.kpi-sub { display: block; margin-top: 2px; font-size: 11px; line-height: 1.4; color: var(--muted); }
.usage-basis { margin: 6px 0; }
.dialog-message-kind { flex: none; }
@media (max-width: 760px) { .property-sticky-actions { bottom: -18px; margin: 16px -12px -18px; padding: 12px; } }
.property-open-top { margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff8e8; font-size: 13px; line-height: 1.5; }
.property-open-top[hidden] { display: none; }
.property-open-top a, .property-open a { color: var(--accent); text-decoration: underline; }
/* UX-P3: responsive layout. Tablet: one scrollable row of icon + label tabs; phone: compact header, short labels,
   full-screen dialogs with a top tab bar; touch targets of at least 44 px on touch devices and narrow windows. */
.toolbar .nav-short { display: none; }
@media (max-width: 900px) {
  .toolbar .nav-short { display: inline; }
  .toolbar .toolbar-button:has(.nav-short) > span:not(.nav-short) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .app-header { height: 108px; flex-wrap: wrap; align-content: center; gap: 6px 12px; padding: 6px 16px; }
  .toolbar-search-zone { flex: 1 1 240px; min-width: 200px; }
  .toolbar { flex: 1 0 100%; order: 3; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; gap: 4px; }
  .toolbar .toolbar-button { flex: 1 0 auto; flex-direction: row; white-space: nowrap; min-height: 44px; min-width: 44px; padding: 8px 12px; font-size: 13px; line-height: 1.25; }
  .toolbar .toolbar-button > span { overflow-wrap: normal; }
  .layout, .sidebar-hidden .layout { height: calc(100dvh - 108px); }
}
@media (max-width: 760px) {
  .app-header { height: 112px; flex-wrap: wrap; align-content: center; gap: 6px 8px; padding: 6px 10px; }
  .brand { min-height: 44px; }
  .brand small { display: none; }
  .toolbar-search-zone { flex: 1 1 0; min-width: 0; order: 0; }
  .toolbar { flex: 1 0 100%; order: 3; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; gap: 0; margin: 0; }
  .toolbar .toolbar-button { flex: 1 0 auto; flex-direction: column; min-width: 44px; min-height: 48px; padding: 4px 2px; gap: 2px; font-size: 11px; line-height: 1.2; white-space: nowrap; }
  .toolbar .toolbar-button > span { overflow-wrap: normal; }
  .layout, .sidebar-hidden .layout { height: calc(100dvh - 112px); }
  .filter-sidebar, aside.filter-sidebar { top: 112px; }
}
@media (pointer: coarse), (max-width: 760px) {
  .leaflet-touch .leaflet-bar a, .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }
  .map-print { width: 44px; height: 44px; }
  .map-collapse-all { right: 68px; }
  .family-map-dismiss { right: 120px; }
  .details-open .map-collapse-all { right: 460px; }
  .details-open .family-map-dismiss { right: 512px; }
  .map-attribution-toggle { min-height: 44px !important; padding-inline: 12px; }
  .widget-grip { display: inline-flex; align-items: center; min-height: 44px; }
  .widget-collapse, .notice-close { min-width: 44px; min-height: 44px; }
  .notice-close { width: 44px !important; height: 44px !important; }
  .text-button { min-height: 44px; }
  .filter-sidebar :is(input:not([type=checkbox]):not([type=radio]), select, textarea), dialog :is(input:not([type=checkbox]):not([type=radio]), select, textarea) { min-height: 44px !important; font-size: 16px !important; }
  dialog :is(button, .dialog-close), .dialog-message button, .filter-sidebar button { min-height: 44px !important; }
  .dialog-close, .chart-print { width: 44px !important; min-width: 44px !important; flex-basis: 44px !important; }
  /* The navigation pin next to the print button in the details header gets the same touch size. */
  .analysis-head-actions .parcel-navigation { width: 44px; height: 44px; min-width: 44px; flex-basis: 44px; }
  dialog .ownership-check, .filter-sidebar label.ownership-check { min-height: 44px !important; }
}
@media (max-width: 760px) { .details-open .map-collapse-all { right: 68px; } .details-open .family-map-dismiss { right: 120px; } }
@media (max-width: 600px) {
  .edit-dialog.management-dialog, .tools-dialog.management-dialog, #analysisDialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; border-radius: 0; }
  .management-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .management-nav { display: flex; flex-direction: row; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .management-nav-heading { display: none; }
  .management-nav button { flex: 0 0 auto; width: auto; min-height: 44px; margin: 0; white-space: nowrap; }
  .management-nav button > span { overflow-wrap: normal; }
  .analysis-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .analysis-kpi { padding: 10px; }
  .analysis-kpi b { font-size: 18px; }
}
/* Map controls on all sizes: layer switches, Gemarkungen chip with quick-jump list, sources inside the layers panel, calm status messages. */
.layers-widget .widget-divider, .layers-widget .gem-legend { display: none !important; }
.mapwrap .map-attribution-toggle { display: none; }
.mapwrap .leaflet-bottom .leaflet-control-attribution { margin: 0 12px 12px 0; }
#layersBody button.secondary { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 36px; margin: 0; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; color: inherit; font-size: 12.5px; font-weight: 500; text-align: left; }
#layersBody button.secondary[aria-pressed]::after { content: ""; flex: none; width: 30px; height: 17px; border-radius: 9px; background: var(--line) radial-gradient(circle at 8.5px 8.5px, var(--surface-primary, #fff) 6.5px, transparent 7.5px) no-repeat; transition: background-position .2s ease, background-color .2s ease; }
#layersBody button.secondary[aria-pressed="true"]::after { background-color: var(--accent); background-position: 13px 0; }
#layersBody button.secondary:disabled { opacity: .5; }
#layersBody #mobileSources::after { content: "\203A"; font-size: 18px; color: var(--muted); }
#gridInfo { display: none !important; }
.mobile-gems { position: absolute; left: 12px; bottom: 8px; z-index: 800; width: auto; height: 40px; padding: 0 12px 0 10px; display: flex; align-items: center; gap: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-primary, #fff); color: inherit; font-size: 13px; font-weight: 600; box-shadow: 0 2px 8px #0003; }
.mobile-gems[hidden] { display: none; }
.mobile-gems-dots { display: inline-flex; align-items: center; gap: 4px; }
.mobile-gems-dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.mobile-gems-dots b { font-size: 11px; color: var(--muted); }
.mobile-gems-sheet:not([hidden]) { position: absolute; left: 12px; bottom: 56px; width: 300px; max-width: calc(100% - 24px); max-height: 60%; z-index: 900; display: flex; flex-direction: column; padding: 10px 0 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-primary, #fff); box-shadow: 0 6px 24px #0004; }
.mobile-gems-sheet[hidden] { display: none; }
.mobile-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 4px 0; }
.mobile-gems-pin { flex: none; width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); box-shadow: none; transition: background-color .15s ease, color .15s ease; }
.mobile-gems-pin:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.mobile-gems-pin:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mobile-gems-pin svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.mobile-gems-pin[aria-pressed="true"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.mobile-gems-pin[aria-pressed="true"] svg { fill: currentColor; fill-opacity: .22; transform: rotate(35deg); }
.mobile-sheet-title { padding: 0 16px 6px; font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.mobile-gems-sheet input[type="search"] { margin: 0 12px 8px; min-height: 36px; font-size: 13px; }
.mobile-gems-sheet input[hidden] { display: none; }
.mobile-gems-list { overflow-y: auto; }
.mobile-gems-list button { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 40px; padding: 0 16px; border: 0; border-radius: 0; background: none; box-shadow: none; color: inherit; font-size: 13px; text-align: left; }
.mobile-gems-list button:hover { background: var(--surface-secondary, #0000000d); }
.mobile-gems-list button[hidden] { display: none; }
.mobile-gems-list .mobile-gem-name { flex: 1; }
.mobile-gems-list small { color: var(--muted); font-size: 12px; }
.mobile-gems-list .gem-legend-statuses { display: grid; gap: 6px; padding: 10px 16px 0; font-size: 12px; color: var(--muted); }
.mapwrap .map-status { top: 12px; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); width: min(520px, calc(100% - 280px)); height: auto; align-content: start; grid-auto-rows: min-content; }
.mapwrap .map-status .notice { position: relative; left: auto; right: auto; bottom: auto; max-height: none; overflow: visible; font-size: 13px; line-height: 1.4; padding: 10px 44px 10px 42px; border-radius: 12px; }
.mapwrap .map-status .notice::before { content: ""; position: absolute; left: 14px; top: 11px; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--notice-icon) center / contain no-repeat; mask: var(--notice-icon) center / contain no-repeat; --notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E"); }
.mapwrap .map-status .notice.success::before { --notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12.5 2.7 2.7L16 9.6'/%3E%3C/svg%3E"); }
.mapwrap .map-status .notice.fail::before { --notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4 3 20h18z'/%3E%3Cpath d='M12 10v4M12 17h.01'/%3E%3C/svg%3E"); }
.mapwrap .map-status .notice.loading::before { --notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M21 12a9 9 0 1 1-6.2-8.6'/%3E%3C/svg%3E"); animation: notice-spin .9s linear infinite; }
.mapwrap .map-notice-wrap:not([hidden]) { animation: notice-in .26s ease-out; }
.mapwrap .map-notice-wrap.notice-leaving { animation: notice-out .26s ease-in forwards; }
@keyframes notice-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes notice-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-8px); } }
@keyframes notice-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mapwrap .map-notice-wrap:not([hidden]), .mapwrap .map-notice-wrap.notice-leaving, .mapwrap .map-status .notice.loading::before { animation: none; } }
.mapwrap .map-status .notice-close { z-index: 701; top: 50%; right: 4px; transform: translateY(-50%); width: 32px !important; height: 32px !important; min-width: 32px; min-height: 32px; display: grid; place-items: center; font-size: 20px; }
/* Smartphone (<= 600 px): map first. Compact 48 px header, four-target bottom bar, "+" menu and filter button on the map. */
.mobile-only { display: none; }
.management-nav button.mobile-only { display: none; }
@media (max-width: 600px) {
  .mobile-only { display: revert; }
  .app-header { height: 48px; flex-wrap: nowrap; align-content: normal; align-items: center; gap: 0; padding: 0 4px 0 12px; position: relative; }
  .app-header .brand { flex: 0 0 auto; min-height: 44px; }
  .app-header .brand strong { font-size: 19px; }
  .app-header .toolbar, .app-header .database-state, .app-header .toolbar-search-zone { display: none; }
  .app-header.search-open .toolbar-search-zone { display: flex; position: absolute; left: 0; right: 52px; top: 0; height: 48px; z-index: 3; padding: 0 8px; background: var(--surface-primary, #fff); align-items: center; }
  .app-header.search-open .places-search { flex: 1; max-width: none; }
  .app-header.search-open .brand { visibility: hidden; }
  .mobile-icon { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: inherit; border-radius: 12px; position: relative; z-index: 4; }
  /* The whole header area right of the logo opens the search; the icon stays where it was. */
  .mobile-icon.mobile-search-toggle { flex: 1 1 auto; width: auto; min-width: 44px; margin-left: auto; justify-items: end; padding-right: 11px; }
  /* The wide tap area must stay invisible: no sticky hover bar after a tap, feedback only on the icon. */
  .mobile-icon.mobile-search-toggle:hover, .mobile-icon.mobile-search-toggle:active, .mobile-icon.mobile-search-toggle:focus { background: none; }
  .mobile-icon.mobile-search-toggle:active svg { opacity: .55; }
  .app-header.search-open .mobile-icon.mobile-search-toggle { flex: 0 0 44px; width: 44px; padding-right: 0; justify-items: center; }
  .mobile-icon svg, .mobile-tab svg, .mobile-filter svg, .mobile-fab svg, .mobile-layers svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .layout, .sidebar-hidden .layout { height: calc(100dvh - 48px - 56px - env(safe-area-inset-bottom, 0px)); }
  .mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100; height: calc(56px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface-primary, #fff); border-top: 1px solid var(--line); }
  .mobile-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 56px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 11px; line-height: 1.2; border-radius: 0; }
  .mobile-tab[aria-current="page"] { color: var(--accent); }
  .mobile-filter { position: absolute; right: 12px; top: 68px; z-index: 800; width: 46px; height: 46px; padding: 0; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-primary, #fff); color: inherit; box-shadow: 0 2px 8px #0003; }
  .mobile-filter > span:not(.mobile-badge) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .mobile-badge { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; background: var(--accent); color: var(--surface-primary, #fff); font-size: 12px; }
  .mobile-badge[hidden] { display: none; }
  .mobile-fab { position: absolute; right: 14px; bottom: 14px; z-index: 800; width: 56px; height: 56px; padding: 0; border-radius: 28px; display: grid; place-items: center; border: 0; background: var(--accent); color: var(--surface-primary, #fff); box-shadow: 0 4px 14px #0005; }
  .mobile-fab svg { width: 26px; height: 26px; }
  .mobile-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 900; padding: 8px 0 16px; border-radius: 18px 18px 0 0; background: var(--surface-primary, #fff); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px #0004; }
  .mobile-sheet[hidden] { display: none; }
  .mobile-sheet button { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; width: 100%; min-height: 56px; padding: 6px 18px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; color: inherit; font-size: 16px; text-align: left; }
  .mobile-sheet button small { color: var(--muted); font-size: 12px; }
  .area-widget, .map-caption, .map-print:not(.family-map-dismiss), .map-collapse-all { display: none !important; }
  .mobile-layers { position: absolute; right: 12px; top: 12px; z-index: 800; width: 46px; height: 46px; padding: 0; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-primary, #fff); color: inherit; box-shadow: 0 2px 8px #0003; }
  .mobile-balance { position: absolute; right: 12px; top: 124px; z-index: 800; width: 46px; height: 46px; }
  .mobile-balance-toggle { width: 46px; height: 46px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface-primary, #fff); color: inherit; border-radius: 14px; box-shadow: 0 2px 8px #0003; }
  .mobile-balance-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  /* The three map panels (layers, filter, balance) slide out horizontally from their icon in the right-hand column. */
  .mapwrap .layers-widget, .mobile-balance-body, .filter-sidebar, aside.filter-sidebar { background: var(--surface-primary, #fff); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 16px #0004; overflow: auto; visibility: hidden; opacity: 0; clip-path: inset(0 0 0 100%); pointer-events: none; transform: none; transition: clip-path .25s ease, opacity .2s ease, visibility 0s linear .25s; }
  .mapwrap .layers-widget { display: block !important; position: absolute !important; left: auto !important; bottom: auto !important; top: 12px !important; right: 66px !important; width: min(300px, calc(100vw - 90px)); max-height: calc(100% - 28px); margin: 0; padding: 12px 14px; z-index: 900; }
  #layersBody { display: block !important; }
  .mapwrap.compact-widgets .layers-widget { max-height: calc(100% - 28px); }
  .layers-widget .widget-collapse { display: none; }
  .mapwrap .leaflet-bottom .leaflet-control-attribution { margin: 0 12px 84px 0; }
  .mobile-spot { position: absolute; right: 12px; top: 180px; z-index: 800; width: 46px; height: 46px; padding: 0; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-primary, #fff); color: inherit; box-shadow: 0 2px 8px #0003; }
  .mobile-spot svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-spot[aria-pressed="false"] { color: var(--muted); }
  .mobile-spot[aria-pressed="false"] svg { opacity: .55; }
  #layersBody button.secondary { min-height: 48px; gap: 12px; font-size: 15px; }
  #layersBody button.secondary[aria-pressed]::after { width: 40px; height: 24px; border-radius: 12px; background-image: radial-gradient(circle at 12px 12px, var(--surface-primary, #fff) 9px, transparent 10px); }
  #layersBody button.secondary[aria-pressed="true"]::after { background-position: 16px 0; }
  #layersBody #mobileSources::after { font-size: 22px; }
  .layers-widget #spotToggle { display: none !important; }
  .mobile-gems { position: absolute; left: 12px; bottom: 12px; right: auto; width: auto; z-index: 800; height: 46px; padding: 0 14px 0 12px; display: flex; align-items: center; gap: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-primary, #fff); color: inherit; font-size: 13px; font-weight: 600; box-shadow: 0 2px 8px #0003; }
  .mobile-gems[hidden] { display: none; }
  .mobile-gems-dots { display: inline-flex; align-items: center; gap: 4px; }
  .mobile-gems-dots i { width: 12px; height: 12px; border-radius: 50%; display: block; }
  .mobile-gems-dots b { font-size: 11px; color: var(--muted); }
  #mobileGemsPin { display: none; }
  .mobile-gems-sheet:not([hidden]) { left: 0; right: 0; bottom: 0; width: auto; max-width: none; max-height: 62%; padding: 10px 0 12px; border-width: 1px 0 0; border-radius: 18px 18px 0 0; }
  .mobile-sheet-title { padding: 0 18px 6px; font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
  .mobile-gems-sheet input[type="search"] { margin: 0 16px 8px; min-height: 44px; font-size: 16px; }
  .mobile-gems-sheet input[hidden] { display: none; }
  .mobile-gems-list { overflow-y: auto; }
  .mobile-gems-list button { flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; min-height: 52px; }
  .mobile-gems-list button[hidden] { display: none; }
  .mobile-gems-list .mobile-gem-name { flex: 1; text-align: left; }
  .mobile-gems-list small { color: var(--muted); font-size: 13px; }
  .mobile-gems-list .gem-legend-statuses { display: grid; gap: 8px; padding: 12px 18px 0; font-size: 13px; color: var(--muted); }
  #filterSidebar select, #layersPanel select { min-height: 40px !important; font-size: 14px !important; padding-block: 0; padding-inline: 10px; }
  #filterSidebar .sidebar-heading { margin-bottom: 8px; }
  #filterSidebar .sidebar-heading h1 { font-size: 20px; }
  #filterSidebar .stats { margin-bottom: 12px; padding: 8px 0; }
  #filterSidebar .stat b { font-size: 20px; }
  #filterSidebar label, #filterSidebar .ctrl label { font-size: 12px; }
  #filterSidebar .filter-fields, #filterSidebar #ownershipFilters .filter-fields { gap: 8px; }
  #filterSidebar .ctrl, #filterSidebar #ownershipFilters > label, #filterSidebar #ownershipFilters .filter-fields > label { gap: 4px; }
  #filterSidebar .sidebar-section-heading { margin: 12px 3px 6px; }
  #filterSidebar .status-chips { gap: 6px; margin-bottom: 12px; }
  #filterSidebar .status-chip { min-height: 34px !important; padding: 5px 10px; font-size: 12px; }
  #filterSidebar .tiny, #filterSidebar .analysis-warning { font-size: 12px; }
  .mobile-layers-open .mapwrap .layers-widget, .mobile-balance[data-open="true"] .mobile-balance-body { visibility: visible; opacity: 1; clip-path: inset(0); pointer-events: auto; transition-delay: 0s; }
  .mobile-balance-body { position: absolute; right: 54px; top: 0; z-index: 900; display: grid; gap: 2px; padding: 8px 14px 4px; white-space: nowrap; }
  .mobile-balance-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
  .mobile-balance-body strong { font-size: 18px; }
  #mobileBalanceMeta { font-size: 12px; color: var(--muted); }
  .mobile-balance-body .text-button { justify-self: start; min-height: 44px; padding: 0; font-size: 14px; color: var(--accent); }
  @media (prefers-reduced-motion: reduce) { .mapwrap .layers-widget, .mobile-balance-body, .filter-sidebar { transition: none !important; } }
  .leaflet-control-zoom { display: none !important; }
  .filter-sidebar, aside.filter-sidebar { position: fixed; top: 116px; bottom: auto; left: auto; right: 66px; width: min(300px, calc(100vw - 90px)); height: auto; max-height: calc(100dvh - 116px - 72px - env(safe-area-inset-bottom, 0px)); padding: 14px; z-index: 950; visibility: visible; opacity: 1; clip-path: inset(0); pointer-events: auto; }
  .sidebar-hidden .filter-sidebar { transform: none; padding: 14px; border: 1px solid var(--line); visibility: hidden; opacity: 0; clip-path: inset(0 0 0 100%); pointer-events: none; }
  .mapwrap .map-status .notice { font-size: 14px; padding: 10px 48px 10px 44px; }
  .mapwrap .map-status .notice-close { width: 40px !important; height: 40px !important; min-width: 40px; min-height: 40px; font-size: 22px; }
  .mapwrap .map-status { top: 12px; bottom: auto; left: 12px; right: 66px; transform: none; width: auto; height: auto; align-content: start; grid-auto-rows: min-content; grid-template-columns: minmax(0, 1fr); }
  #sidebarClose { display: none !important; }
}
/* Touch devices zoom by pinching; the +/- control is dropped to free space for the filter and message strip. */
@media (pointer: coarse) { .leaflet-control-zoom { display: none !important; } }
/* Smartphone dialogs: full-screen pages. Area list first, then content; back arrow instead of tab bars. */
@media (max-width: 600px) {
  :is(#ownershipDialog, #toolsDialog, #analysisDialog) :is(.edit-head, .analysis-head) { height: 56px; margin: 0; padding: 0 8px; gap: 4px; display: flex; align-items: center; justify-content: flex-start; border-bottom: 1px solid var(--line); }
  :is(#ownershipDialog, #toolsDialog, #analysisDialog) :is(.edit-head, .analysis-head) > :is(strong, div:first-child) { flex: 1; min-width: 0; margin: 0; }
  #analysisDialog .analysis-head-actions { display: contents; }
  #analysisDialog .analysis-head strong { margin: 0; font-size: 17px; }
  :is(#ownershipClose, #toolsClose, #analysisClose) { order: -1; flex: none; border: 0 !important; background: none !important; box-shadow: none !important; }
  :is(#ownershipClose, #toolsClose, #analysisClose) svg { display: none; }
  :is(#ownershipClose, #toolsClose, #analysisClose)::before { content: "\2190"; font-size: 26px; line-height: 1; }
  :is(#ownershipDialog, #toolsDialog) .management-title > span[data-mobile-title] { font-size: 0; }
  :is(#ownershipDialog, #toolsDialog) .management-title > span[data-mobile-title]::after { content: attr(data-mobile-title); content: attr(data-mobile-title) / ""; font-size: 17px; font-weight: 650; }
  :is(#ownershipDialog, #toolsDialog) .management-title .nav-icon, #toolsDialog .analysis-head .eyebrow { display: none; }
  :is(#ownershipDialog, #toolsDialog) .management-body { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  :is(#ownershipDialog, #toolsDialog) .management-body > * { grid-area: 1 / 1; }
  :is(#ownershipDialog, #toolsDialog)[data-mobile-view="content"] .management-nav { display: none; }
  :is(#ownershipDialog, #toolsDialog):not([data-mobile-view="content"]) :is(#ownershipEditor, #manageBody) { display: none; }
  :is(#ownershipDialog, #toolsDialog) :is(#ownershipEditor, #manageBody) { padding: 16px; }
  :is(#ownershipDialog, #toolsDialog) .management-nav { display: block; padding: 0; overflow-x: hidden; overflow-y: auto; border: 0; background: none; }
  :is(#ownershipDialog, #toolsDialog)[data-mobile-view="content"] .management-nav { display: none; }
  :is(#ownershipDialog, #toolsDialog) .management-nav [role="tablist"] { display: block; }
  :is(.management-nav button, #analysisDialog .analysis-tabs:not([hidden]) button) { width: 100%; }
  :is(#ownershipDialog, #toolsDialog) .management-nav button, #analysisDialog .analysis-tabs:not([hidden]) button { display: flex; align-items: center; gap: 14px; flex: none; min-height: 56px; margin: 0; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; color: inherit; font-size: 16px; text-align: left; white-space: normal; }
  :is(#ownershipDialog, #toolsDialog) .management-nav button > span:first-of-type { flex: 1; }
  :is(#ownershipDialog, #toolsDialog) .management-nav button::after, #analysisDialog .analysis-tabs:not([hidden]) button::after { content: "\203A"; margin-left: auto; font-size: 24px; color: var(--muted); }
  :is(#ownershipDialog, #toolsDialog) .management-nav button[aria-pressed="true"], :is(#ownershipDialog, #toolsDialog) .management-nav button[aria-selected="true"] { background: none; border-color: var(--line); color: inherit; }
  #ownershipDialog[data-own-disabled] .management-nav { display: none; }
  #ownershipDialog[data-own-disabled]:not([data-mobile-view="content"]) #ownershipEditor { display: block; }
  #analysisDialog.is-detail .analysis-tabs:not([hidden]) { display: flex; flex-direction: column; gap: 0; padding: 0; margin: 0; background: none; border-radius: 0; flex-wrap: nowrap; }
  #analysisDialog.is-detail .analysis-tabs button.active { background: none; box-shadow: none; color: inherit; }
  #analysisDialog.is-detail[data-mobile-view="content"] :is(.analysis-tabs, #parcelDetailActions) { display: none; }
  #analysisDialog.is-detail:not([data-mobile-view="content"]) :is(#analysisContent, #parcelDocumentsPanel) { display: none; }
}
/* Smartphone form: compact fields (44 px, 16 px type), label above, hints as small lines, fixed action bar. */
@media (max-width: 600px) {
  #editDialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; border-radius: 0; padding: 0; }
  #editDialog #editForm { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; }
  #editDialog #editForm > .edit-head { flex: none; height: 56px; margin: 0; padding: 0 8px; gap: 4px; display: flex; align-items: center; justify-content: flex-start; border-bottom: 1px solid var(--line); }
  #editDialog .edit-head > strong { flex: 1; min-width: 0; margin: 0; font-size: 17px; }
  #editDialog .edit-head .nav-icon { display: none; }
  #editClose { order: -1; flex: none; border: 0 !important; background: none !important; box-shadow: none !important; }
  #editClose svg { display: none; }
  #editClose::before { content: "\2190"; font-size: 26px; line-height: 1; }
  #editDialog #editWorkspace.management-body { display: block; flex: 1; min-height: 0; overflow: hidden; }
  #editDialog #addNavigation { display: none; }
  #editDialog #editContent { height: 100%; overflow: auto; padding: 12px 16px 0; }
  #editDialog #editContent { display: flex; flex-direction: column; }
  #editDialog #addPanel-manual:not([hidden]) { flex: 1; display: flex; flex-direction: column; }
  #editDialog #editContent label { display: grid; gap: 4px; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
  #editDialog #editContent :is(input, select):not([type="checkbox"]):not([type="radio"]) { min-height: 44px; font-size: 16px; margin: 0; }
  #editDialog .edit-catalog { padding: 0; margin: 0 0 8px; border: 0; background: none; }
  #editDialog .edit-catalog p { margin: 0; font-size: 12px; color: var(--muted); }
  #editDialog .edit-catalog-field { margin-bottom: 12px; }
  #editDialog .edit-catalog-field label { margin-bottom: 4px; }
  #editDialog #editContent .tiny, #editDialog #editMetadataHint { margin: -6px 0 12px; padding: 0; background: none; border: 0; font-size: 12px; color: var(--muted); }
  #editDialog .edit-result { display: grid; gap: 2px; margin: 0 0 12px; padding: 4px 0 4px 12px; border-left: 3px solid var(--accent); }
  #editDialog .edit-result[hidden] { display: none; }
  #editDialog .edit-result-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
  #editDialog .edit-result span:last-child { font-size: 13px; color: var(--muted); }
  #editDialog #editOptionalDetails { margin: 0 0 12px; border: 0; padding: 0; background: none; }
  #editDialog #editOptionalDetails > summary { min-height: 44px; display: flex; align-items: center; padding: 0; font-size: 16px; }
  #editDialog #editMobileFields details { margin: 0 0 12px; border: 0; padding: 0; background: none; }
  #editDialog #editMobileFields details > summary { min-height: 44px; display: flex; align-items: center; font-size: 14px; }
  #editDialog #addPanel-manual > .row { position: sticky; bottom: 0; z-index: 2; display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin: auto -16px 0; padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--surface-primary, #fff); border-top: 1px solid var(--line); }
  #editDialog #addPanel-manual > .row button { min-height: 48px; font-size: 16px; }
}
/* Smartphone: settings as list rows, dashboard with four key figures first. */
@media (max-width: 600px) {
  #toolsDialog .management-nav { display: flex; flex-direction: column; }
  #toolsDialog[data-mobile-view="content"] .management-nav { display: none; }
  #toolsDialog .management-nav [role="tablist"] { display: contents; }
  #toolsDialog #settingsTab-exchange { order: 1; }
  #toolsDialog #settingsBackupRow { order: 2; }
  #toolsDialog #mobilePrint { order: 2; }
  #toolsDialog :is(#settingsTab-regions, #settingsTab-mapservices, #settingsTab-licenses, #settingsTab-other) { order: 3; }
  #manageBody .tool-section { margin: 0 0 16px; padding: 0; border: 0; background: none; }
  #manageBody .tool-section > h2 { margin: 0 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: none; }
  #manageBody .tool-section > button:not(.text-button), #manageBody .tool-section > .secondary { display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 48px; margin: 0; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; color: var(--accent); font-size: 16px; text-align: left; }
  #manageBody .tool-section > button:not(.text-button)::after { content: "\203A"; margin-left: auto; font-size: 22px; color: var(--muted); }
  #analysisContent[data-dash] > .analysis-sub:first-child { display: none; }
  #analysisContent[data-dash] .analysis-summary { margin: 4px 0 8px; }
  #analysisContent[data-dash] #dashDetailsToggle { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; margin: 0 0 8px; border: 0; background: none; color: var(--accent); font-size: 15px; }
  #analysisContent[data-dash]:not([data-dash-open="1"]) .analysis-summary ~ :not(#dashDetailsToggle):not(.analysis-warning) { display: none; }
}
/* Tablet in portrait (601-900 px): the same work navigation, moved from the header to the bottom edge. */
@media (min-width: 601px) and (max-width: 900px) and (orientation: portrait) {
  .app-header { height: 64px; flex-wrap: nowrap; align-content: normal; align-items: center; gap: 12px; padding: 0 16px; }
  .app-header .brand small { display: none; }
  .toolbar-search-zone { flex: 1 1 0; min-width: 0; order: 0; }
  .toolbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100; flex: none; order: 0; width: auto; height: calc(64px + env(safe-area-inset-bottom, 0px)); margin: 0; padding: 0 8px env(safe-area-inset-bottom, 0px); justify-content: space-between; align-items: stretch; gap: 4px; overflow: visible; background: var(--surface-primary, #fff); border-top: 1px solid var(--line); }
  .toolbar .toolbar-button { flex: 1 1 0; flex-direction: column; justify-content: center; min-height: 56px; margin: 4px 0; padding: 4px 2px; gap: 2px; font-size: 11px; line-height: 1.2; white-space: nowrap; }
  .layout, .sidebar-hidden .layout { height: calc(100dvh - 64px - 64px - env(safe-area-inset-bottom, 0px)); }
  .filter-sidebar, aside.filter-sidebar { top: 64px; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}
/* Tablet (601-1000 px): multi-step dialogs get a wider navigation column; the work area on the right is set smaller. */
@media (min-width: 601px) and (max-width: 1000px) {
  .management-body { grid-template-columns: 240px minmax(0, 1fr); }
  .management-nav { padding: 16px 10px; }
  .management-nav-heading { margin: 0 10px 12px; font-size: 10px; }
  .management-nav button { gap: 12px; padding: 12px; font-size: 14px; line-height: 1.3; min-height: 52px; }
  .management-nav button svg { flex-basis: 20px; width: 20px; height: 20px; }
  .management-nav button > span { overflow-wrap: normal; }
  #ownershipEditor, #manageBody, .edit-dialog.management-dialog #editContent { padding: 16px 18px; }
  :is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form, #editContent) { font-size: 12px; line-height: 1.45; }
  :is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form) h2 { margin: 0 0 12px; font-size: 17px; }
  :is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form) h3 { margin: 18px 0 8px; font-size: 14px; }
  :is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form) p { margin: 8px 0; font-size: 12px; }
  :is(#ownershipEditor:not(.family-active), #manageBody, #importDialog, #analysisContent.management-form) .tiny { font-size: 11px; }
  :is(#ownershipEditor:not(.family-active), #manageBody, #editContent) label:not(.ownership-check) { font-size: 12px; margin-bottom: 10px; }
  :is(#ownershipEditor:not(.family-active), #manageBody, #editContent) :is(input, select):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]) { min-height: 38px !important; padding-block: 6px; }
  :is(#ownershipEditor:not(.family-active), #manageBody, #editContent) button:not(.text-button) { min-height: 40px !important; padding: 7px 12px; font-size: 12px; }
}
/* Toolbar 1001-1600 px: calm single row. Icon above a one-line short label, equal button widths, 72 px header. */
.toolbar .toolbar-button > span { overflow-wrap: normal; word-break: normal; }
@media (min-width: 1001px) and (max-width: 1600px) {
  .app-header { height: 72px; }
  .layout, .sidebar-hidden .layout { height: calc(100dvh - 72px); }
  .toolbar { flex: 1 1 auto; align-items: stretch; justify-content: flex-end; gap: 4px; }
  .toolbar .toolbar-button { flex: 0 1 112px; min-width: max-content; flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 8px 6px; font-size: 12px; line-height: 1.2; white-space: nowrap; text-align: center; }
  .toolbar .nav-short { display: inline; }
  .toolbar .toolbar-button:has(.nav-short) > span:not(.nav-short) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (min-width: 1001px) and (max-width: 1200px) {
  .app-header .brand small { display: none; }
  .toolbar-search-zone { flex: 0 0 240px; min-width: 240px; }
  .database-state { max-width: 14px; overflow: hidden; white-space: nowrap; }
  .toolbar .toolbar-button { padding: 8px 4px; font-size: 11px; }
}
/* Toolbar: icons share one top line, labels wrap below by words; the long ownership label shortens to "Eigentümer" when space is tight. */
@media (max-width: 1000px) {
  .toolbar { align-items: stretch; }
  .toolbar .toolbar-button { justify-content: flex-start; }
  .toolbar .toolbar-button > span { overflow-wrap: normal; word-break: normal; }
}
@media (max-width: 1100px) {
  #ownershipLaunch .nav-short { display: inline; }
  #ownershipLaunch > span:not(.nav-short) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* Tablet / touch: collapsed map widgets stay slim (one 40 px header row) instead of 70 px. */
@media (min-width: 601px) and (max-width: 1000px), (pointer: coarse) and (min-width: 601px) {
  .map-widget, .area-widget { padding: 0 8px 0 12px; }
  .widget-head { min-height: 40px; }
  .widget-grip { min-height: 40px; }
  .widget-collapse { min-width: 40px; min-height: 40px; width: 40px; height: 40px; }
  #layersBody, #balanceBody { padding-bottom: 12px; }
}
/* Filter, all sizes: the active-filter count sits on the Filter button; reset lives in the filter menu; the map no longer shows a filter text box. */
.map-filter-box { display: none !important; }
.toolbar-badge { flex: none; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border-radius: 9px; background: var(--accent); color: var(--surface-primary, #fff); font-size: 11px; font-weight: 700; line-height: 1; }
.toolbar-badge[hidden] { display: none; }
@media (min-width: 1001px) and (max-width: 1600px), (min-width: 601px) and (max-width: 900px) and (orientation: portrait) {
  .toolbar .toolbar-badge { position: absolute; top: 3px; left: calc(50% + 9px); margin: 0; }
}
.toolbar .toolbar-button { position: relative; }
#sidebarFilterReset { display: block; width: auto; margin: 0 0 8px; padding: 0; min-height: 36px; font-size: 13px; font-weight: 600; color: var(--accent); }
#sidebarFilterReset[hidden] { display: none; }
@media (max-width: 600px) { #sidebarFilterReset { min-height: 44px; font-size: 14px; margin-bottom: 4px; } }
/* Collapsed map widgets stay movable above the phone layout (drag handle visible, touch drag enabled). */
@media (min-width: 601px) { .widget-grip { cursor: grab; touch-action: none; } .grip-dots { display: inline; } }
/* Tablet portrait below 761 px: the search field matches the look from 761 px up (13 px type, 38 px high). */
@media (min-width: 601px) and (max-width: 760px) {
  .app-header { gap: 12px; padding: 0 16px; }
}
/* Sorting the parcel list shows a small spinner and dims the list while it is rebuilt. */
.list-sort { position: relative; }
.list-sort.is-busy::after { content: ""; position: absolute; right: 38px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: list-spin .7s linear infinite; pointer-events: none; }
#items[aria-busy="true"] { opacity: .5; transition: opacity .15s ease; pointer-events: none; }
@keyframes list-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .list-sort.is-busy::after { animation: none; } }
/* Parcel already linked to a WEG: a named, accented chip instead of the create button. */
.parcel-edit-actions .wegbtn.is-linked { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent); }
.parcel-edit-actions .wegbtn.is-linked svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.parcel-edit-actions .wegbtn.is-linked span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Stock search in the filter widget: field, live hit list, then the official ALKIS address search (in flow, no overlay). */
.sidebar-search { margin: 0 0 12px; }
.search-field { position: relative; }
.sidebar-search input { width: 100%; background: #f4f7f6; border-color: transparent; padding-left: 40px; padding-right: 46px; font-size: 13px; }
.sidebar-search input.has-filter { border-color: var(--accent); background: #edf7f2; }
.search-hits[hidden] { display: none; }
.search-hits-summary { margin: 8px 2px 4px; font-size: 12px; font-weight: 650; color: var(--muted); }
.search-hits-summary[data-empty="true"] { color: var(--danger, #a52525); }
.search-hits-list { list-style: none; margin: 0; padding: 0; max-height: 232px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.search-hits-list:empty { display: none; }
.search-hits-list li + li { border-top: 1px solid var(--line); }
.search-hit { display: flex; align-items: baseline; gap: 8px; width: 100%; min-height: 38px; margin: 0; padding: 7px 12px; border: 0; border-radius: 0; background: none; box-shadow: none; color: inherit; font-size: 13px; font-weight: 500; text-align: left; }
.search-hit strong { flex: none; font-weight: 700; }
.search-hit .gem-dot { flex: none; align-self: center; }
.search-hit-place { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.search-hit:hover, .search-hit:focus-visible { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.search-hits-more { margin: 6px 2px 0; font-size: 11px; line-height: 1.4; color: var(--muted); }
@media (pointer: coarse) { .search-hit { min-height: 44px; } }
.search-panel { margin-top: 10px; padding: 6px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-primary, #fff); }
.search-panel[hidden] { display: none; }
.search-group + .search-group { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.search-group-title { margin: 4px 14px 4px; font-size: 11px; font-weight: 650; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.search-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 40px; padding: 8px 14px; border: 0; border-radius: 0; background: none; box-shadow: none; color: inherit; font-size: 13px; font-weight: 500; text-align: left; }
.search-row:hover, .search-row:focus-visible { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.search-row small { color: var(--muted); font-size: 12px; font-weight: 400; }
.search-results { list-style: none; margin: 0; padding: 0; }
.search-status { margin: 4px 14px; font-size: 12px; color: var(--muted); }
.search-status[hidden] { display: none; }
@media (max-width: 600px) { .search-row { min-height: 44px; font-size: 15px; } }
/* Google engine (AP4, only with ?engine=google): Google draws the base map, FLURO's Leaflet overlays follow in a Google pane. */
#map.fluro-engine-google { position: relative; overflow: hidden; }
.fluro-google-base { position: absolute; inset: 0; }
.fluro-google-overlay.leaflet-container { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: transparent; overflow: visible; pointer-events: none; isolation: isolate; }
.fluro-google-overlay .leaflet-popup { pointer-events: auto; }
.fluro-google-controls.leaflet-container { position: absolute; inset: 0; background: transparent; pointer-events: none; }
.fluro-google-overlay { transition: opacity .18s ease; }
.fluro-google-overlay.fluro-google-zooming { opacity: 0; visibility: hidden; transition: none; }
@media (prefers-reduced-motion: reduce) { .fluro-google-overlay { transition: none; } }
/* Google's logo (bottom left, 26 px high) must stay visible: the Gemarkungen chip and its list sit above it. */
#map.fluro-engine-google ~ .mobile-gems { bottom: 32px; }
#map.fluro-engine-google ~ .mobile-gems-sheet:not([hidden]) { bottom: 80px; }
@media (max-width: 600px) { #map.fluro-engine-google ~ .mobile-gems { bottom: 34px; } #map.fluro-engine-google ~ .mobile-gems-sheet:not([hidden]) { bottom: 0; } }
.fluro-engine-error { position: absolute; z-index: 1100; left: 50%; top: 16px; transform: translateX(-50%); width: max-content; max-width: min(520px, calc(100% - 32px)); padding: 10px 14px; border: 1px solid currentColor; border-radius: 10px; background: var(--surface-primary, #fff); color: var(--danger, #a52525); font-size: 13px; line-height: 1.45; box-shadow: 0 6px 18px #0002; }
/* Mask outside Germany (Google engine): neutral, like the empty area around the Leaflet basemap. */
/* Soft border: the blur fades the mask out over a few pixels instead of cutting at the border line. */
.fluro-germany-mask { fill: #e8ecea; filter: blur(12px); }
:root[data-theme="dark"] .fluro-germany-mask { fill: #131d1f; }
/* Google place search (AP6/AP7, Google engine only): the only search in the header. */
.places-search[hidden] { display: none; }
.places-search gmp-basic-place-autocomplete { display: block; width: 100%; height: 38px; color-scheme: light; font-family: inherit; font-size: 13px; background-color: var(--surface-control, #f4f7f6); border: 1px solid transparent; border-radius: 10px; }
:root[data-theme="dark"] .places-search gmp-basic-place-autocomplete { color-scheme: dark; }
.places-search[data-state="error"] gmp-basic-place-autocomplete { border-color: var(--danger, #a52525); }
.places-flag { display: inline-flex; color: var(--accent, #1f7a5a); opacity: .85; }
.google-place-marker { background: none; border: 0; }
.google-place-pin { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #ea4335; border: 2px solid #fff; box-shadow: 0 3px 10px #0005; color: #fff; }
.google-place-x { position: absolute; top: -6px; right: -10px; width: 20px; height: 20px; padding: 0; display: grid; place-items: center; border: 1px solid #ea4335; border-radius: 50%; background: #fff; color: #c5221f; font-size: 14px; line-height: 1; box-shadow: 0 1px 4px #0004; cursor: pointer; }
.google-place-x:hover, .google-place-x:focus-visible { background: #ea4335; color: #fff; }
@media (pointer: coarse) { .google-place-x { width: 28px; height: 28px; top: -12px; right: -16px; font-size: 18px; } }
.google-place-pin .places-flag-icon { transform: rotate(45deg); }
@media (max-width: 600px) {
  .places-search gmp-basic-place-autocomplete { height: 44px; min-height: 44px; font-size: 16px; }
}
/* Solar & Gelände (FLURO Pro): the Pro label is the same as for the Family Graph (.management-nav .pro-badge). */
.analysis-tabs .pro-badge, .site-filters .pro-badge, .site-section-head .pro-badge, .site-dashboard .pro-badge, .site-tools .pro-badge, .site-panel-head .pro-badge, .report-upsell .pro-badge { flex: none; display: inline-block; padding: 2px 5px; color: var(--badge-pro-text, #117c68); background: var(--badge-pro-background, #e2f2e9); border-radius: 5px; font-size: 9px; font-weight: 750; line-height: 1.5; letter-spacing: 0; vertical-align: middle; }
#parcelTab-site { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
/* Five detail tabs: whole words, a second row instead of words broken mid-word (the phone list layout stays). */
.analysis-tabs { flex-wrap: wrap; }
.analysis-tabs button { flex: 1 1 auto; white-space: nowrap; overflow-wrap: normal; }
.site-lock { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }
.site-filters { margin: 14px 0 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-primary, #fff); }
.site-filters > summary { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; cursor: pointer; font-size: 13px; font-weight: 800; list-style: none; }
.site-filters > summary::-webkit-details-marker { display: none; }
.site-filters > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s ease; }
.site-filters[open] > summary::after { transform: rotate(-135deg); }
.site-filters-title { flex: none; }
#siteFilterSummaryLock { display: inline-flex; color: var(--muted); }
.site-filter-body { display: grid; gap: 10px; padding: 0 12px 12px; }
.site-filter-note { margin: 0; color: var(--muted); }
.site-filter-group { display: grid; gap: 8px; margin: 0; padding: 10px 0 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.site-filter-group legend { padding: 0; font-size: 12px; font-weight: 750; }
.site-filter-group label { display: grid; gap: 4px; font-size: 11px; font-weight: 650; color: var(--muted); }
.site-filter-group input, .site-filter-group select { width: 100%; min-width: 0; font-size: 13px; }
.site-filter-group input:disabled, .site-filter-group select:disabled { opacity: .55; cursor: not-allowed; }
.site-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.site-filter-lock { display: grid; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--surface-secondary); font-size: 12px; }
.site-filter-lock[hidden] { display: none; }
.site-filter-lock p { margin: 0; }
.site-tools { display: grid; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.site-tools-title { font-size: 11px; font-weight: 700; color: var(--text); }
.site-tools-buttons { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.site-tool { display: flex; align-items: center; justify-content: flex-start; gap: 6px; min-width: 0; width: 100%; white-space: nowrap; min-height: 34px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-secondary); color: var(--text); font-size: 11px; font-weight: 650; }
.site-tool[data-locked="true"] { color: var(--muted); }
.site-tool > span:not(.pro-badge) { overflow: hidden; text-overflow: ellipsis; }
.site-tool .pro-badge { margin-left: auto; }
#siteMeasureToggle[hidden] { display: none; }
.site-capture { cursor: crosshair; }
.site-building-marker { background: none; border: 0; }
/* Numbered buildings (Gebäude 1, 2, …): the one chosen in the list is solid, the others are light. */
.site-building-no { font-size: 13px; font-weight: 800; font-family: inherit; }
.site-building-no.is-quiet { background: #fff6d6; color: #8a6a00; box-shadow: 0 1px 4px #0003; }
.site-sun { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #ffd24d; border: 2px solid #fff; box-shadow: 0 2px 8px #0005; color: #6b4c00; font-size: 16px; line-height: 1; }
.site-measure-panel { position: absolute; z-index: 760; left: 50%; bottom: 52px; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); max-height: min(70vh, 520px); overflow: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-primary, #fff); color: var(--text); box-shadow: 0 8px 26px #0003; }
.site-measure-panel[hidden] { display: none; }
.site-panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.site-panel-head strong { font-size: 14px; }
.site-panel-close { margin-left: auto; }
.site-panel-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.site-point-value { margin: 4px 0; font-size: 13px; }
.site-point-value b { font-size: 22px; color: var(--accent); }
.site-chart { border-radius: 8px; outline-offset: 2px; }
.profile-chart { display: block; width: 100%; height: auto; touch-action: none; }
.profile-tick line { stroke: var(--line); stroke-width: 1; }
.profile-tick text, .profile-xtick { fill: var(--muted); font-size: 11px; }
.profile-area { fill: var(--accent); opacity: .14; }
.profile-line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; }
.profile-cursor { stroke: var(--text); stroke-width: 1; stroke-dasharray: 3 3; }
.profile-dot { fill: var(--surface-primary, #fff); stroke: var(--accent); stroke-width: 3; }
.profile-cursor[hidden], .profile-dot[hidden] { display: none; }
.profile-hit { fill: transparent; cursor: crosshair; }
.site-chart-readout { min-height: 1.4em; margin: 4px 0; }
.site-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 8px 0; }
.site-figures div { padding: 8px 10px; border: 1px solid var(--border-kpi, var(--line)); border-radius: 8px; background: var(--surface-kpi, var(--surface-secondary)); }
.site-figures dt { font-size: 10px; font-weight: 650; color: var(--muted); }
.site-figures dd { margin: 2px 0 0; font-size: 14px; font-weight: 750; color: var(--value-kpi, var(--text)); }
.analysis-actions button.site-quiet:last-child { color: var(--text); background: var(--surface-secondary); border-color: var(--line); }
.site-segments-title { margin: 4px 0 0; }
.site-sum { padding: 8px 10px; border: 1px solid var(--accent); border-radius: 10px; }
.site-building-select { display: grid; gap: 4px; margin-top: 4px; font-size: 11px; font-weight: 650; color: var(--muted); }
.site-building-select select { font-size: 13px; }
.site-segments { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; font-size: 12px; }
.site-segments li { display: grid; grid-template-columns: 34px 48px 1fr auto; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.site-segments li:last-child { border-bottom: 0; }
.site-section { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.site-section-head { display: flex; align-items: center; gap: 8px; }
.site-section-head h3 { margin: 0; font-size: 15px; }
.site-state { margin: 0; font-size: 12px; }
.site-state.is-expired { color: var(--warning-text, #8a5a00); }
.site-result { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.site-result p { margin: 0 0 4px; font-size: 12px; }
.site-result.is-inside { border-color: var(--accent); }
.site-result.is-separate { border-style: dashed; }
.site-start { justify-content: flex-start; flex-wrap: wrap; }
.site-tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.site-disclaimer { color: var(--muted); }
.site-dashboard h2 { display: flex; align-items: center; gap: 8px; }
.site-summary { margin-top: 8px; }
.site-distribution { display: grid; gap: 6px; margin-top: 12px; }
.site-distribution > small { color: var(--muted); font-size: 11px; }
.site-bars { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 12px; }
.site-bars li { display: grid; grid-template-columns: 110px 1fr 32px; align-items: center; gap: 8px; }
.site-bar { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) calc(var(--share, 0) * 100%), var(--surface-secondary) 0); }
.site-bars b { text-align: right; }
@media (max-width: 600px) {
  .site-measure-panel { z-index: 900; left: 8px; right: 8px; bottom: 8px; width: auto; transform: none; max-height: 58vh; }
  body.site-panel-open :is(.mobile-gems, .mobile-gems-sheet, .mobile-fab, .mobile-filter, .mobile-layers, .mobile-balance) { display: none; }
  .site-range { grid-template-columns: 1fr; }
  .site-tool { min-height: 44px; font-size: 14px; }
  .site-filters > summary { min-height: 48px; }
  .site-bars li { grid-template-columns: 90px 1fr 28px; }
}

/* Flurstückbericht (print preview). The sheet is a light A4 page in every theme; content, map and tables have the
   same sizes on screen and on paper (182 mm content width), so the live map prints exactly as previewed. */
#reportDialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; border-radius: 0; background: #59666b; color: #1d2b30; overflow: hidden; }
#reportDialog[open] { display: flex; flex-direction: column; }
#reportDialog::backdrop { background: rgba(20, 30, 35, .6); }
.report-toolbar { display: flex; align-items: center; gap: 12px; flex: none; padding: 10px 16px; background: var(--surface-primary, #fff); color: var(--text-primary, #172a32); border-bottom: 1px solid var(--line); }
.report-toolbar-title { display: flex; flex-direction: column; min-width: 0; }
.report-toolbar-title strong { font-size: 16px; }
.report-status { flex: 1; min-width: 0; margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.report-toolbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.report-toolbar-actions button { width: auto; }
#reportPrint { display: inline-flex; align-items: center; gap: 6px; }
#reportPrint svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.report-upsell { flex: none; margin: 0; padding: 8px 16px; font-size: 12px; background: var(--surface-secondary, #f3f6f5); color: var(--text-primary, #172a32); border-bottom: 1px solid var(--line); }
.report-upsell .pro-badge { margin-right: 6px; }
.report-stage { flex: 1; overflow: auto; padding: 24px 12px 48px; }
.report-doc { box-sizing: border-box; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 14mm; background: #fff; color: #1d2b30; box-shadow: 0 8px 30px rgba(0, 0, 0, .35); transform-origin: top left; font: 400 9.5pt/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; text-align: left; }
.report-doc[style*="scale"] { margin-left: 0; }
.rp-cover { margin: 0 0 5mm; }
.rp-brand { display: flex; justify-content: space-between; align-items: baseline; gap: 6mm; padding-bottom: 3mm; margin-bottom: 4mm; border-bottom: 2px solid #117c68; }
.rp-logo { font-size: 16pt; font-weight: 800; letter-spacing: .02em; color: #12313a; }
.rp-logo span { color: #117c68; }
.rp-kind { font-size: 8.5pt; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: #56707a; }
.report-doc h1 { margin: 0 0 1mm; font-size: 21pt; line-height: 1.15; color: #12313a; }
.rp-name { margin: 0 0 2mm; font-size: 12pt; color: #3c555e; }
.rp-meta { display: flex; flex-wrap: wrap; gap: 2mm 8mm; margin: 3mm 0 0; }
.rp-meta dt { font-size: 6.8pt; letter-spacing: .08em; text-transform: uppercase; color: #6a7f87; }
.rp-meta dd { margin: 0; font-weight: 650; }
.rp-map-figure { margin: 0 0 5mm; break-inside: avoid; }
.rp-map-frame { position: relative; width: 100%; height: 100mm; overflow: hidden; border: 1px solid #c9d4d6; border-radius: 2mm; background: #e8eeec; }
.rp-map-canvas, .rp-map-google { position: absolute; inset: 0; }
/* The sheet stays light in the dark theme too, including the source note in the map. */
.report-doc .rp-map-frame .leaflet-control-attribution { display: block !important; font-size: 6.8pt; line-height: 1.35; background: rgba(255, 255, 255, .88) !important; color: #33464d !important; }
.report-doc .rp-map-frame .leaflet-control-attribution a { color: #33464d !important; }
.rp-map-status { position: absolute; left: 3mm; right: 3mm; bottom: 3mm; margin: 0; padding: 2mm 3mm; border-radius: 1.5mm; background: rgba(255, 255, 255, .94); color: #1d2b30; font-size: 8.5pt; z-index: 1000; }
.rp-map-status[data-kind="error"] { top: 3mm; bottom: auto; background: #fff3f1; color: #8a1f17; }
.rp-map-status:empty, .rp-map-status[data-kind="ready"] { display: none; }
/* Solar buildings on the report map: numbered like the report's building list. */
.rp-building-marker { background: none; border: 0; }
.rp-building-google { position: absolute; transform: translate(-50%, -50%); }
.rp-building-no { display: grid; place-items: center; width: 22px; height: 22px; box-sizing: border-box; border-radius: 50%; border: 2px solid #fff; background: #ffd24d; color: #5a4000; font: 800 11px/1 system-ui, -apple-system, "Segoe UI", sans-serif; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.rp-map-figure figcaption { margin-top: 1.5mm; font-size: 7.5pt; line-height: 1.4; color: #5b7079; }
.rp-attribution { display: block; overflow-wrap: anywhere; }
.rp-no-map { margin: 0 0 5mm; padding: 4mm; border: 1px dashed #c9d4d6; border-radius: 2mm; }
.rp-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3mm; margin: 0 0 6mm; break-inside: avoid; }
.rp-kpi { padding: 3mm; border: 1px solid #d5e0de; border-radius: 2mm; background: #f5f9f8; }
.rp-kpi small { display: block; font-size: 7pt; letter-spacing: .06em; text-transform: uppercase; color: #5b7079; }
.rp-kpi b { display: block; margin-top: 1mm; font-size: 12.5pt; color: #12313a; overflow-wrap: anywhere; }
.rp-kpi span { display: block; font-size: 7.5pt; color: #5b7079; overflow-wrap: anywhere; }
.rp-section { margin: 0 0 6mm; }
.rp-section h2 { margin: 0 0 3mm; padding-bottom: 1.5mm; border-bottom: 1px solid #cfdcda; font-size: 12.5pt; color: #117c68; break-after: avoid; }
.rp-section h3 { margin: 3mm 0 2mm; font-size: 10.5pt; color: #12313a; break-after: avoid; }
.rp-lead { margin: -1mm 0 3mm; font-weight: 650; color: #3c555e; }
.rp-block { margin: 0 0 4mm; }
.rp-facts { width: 100%; border-collapse: collapse; }
.rp-facts tr { break-inside: avoid; }
.rp-facts th { width: 38%; padding: 1.4mm 3mm 1.4mm 0; border-bottom: 1px solid #e3eae9; text-align: left; vertical-align: top; font-weight: 500; color: #56707a; }
.rp-facts td { padding: 1.4mm 0; border-bottom: 1px solid #e3eae9; font-weight: 650; color: #1d2b30; overflow-wrap: anywhere; }
.rp-facts small, .rp-table small { display: block; font-size: 7.5pt; font-weight: 400; color: #6a7f87; }
.rp-table { width: 100%; margin: 2mm 0; border-collapse: collapse; font-size: 8.3pt; }
.rp-table caption { margin-bottom: 1.5mm; text-align: left; font-weight: 650; color: #12313a; }
.rp-table thead { display: table-header-group; }
.rp-table tr { break-inside: avoid; }
.rp-table th { padding: 1.6mm 2mm; border-bottom: 1px solid #c9d6d4; background: #eef4f3; text-align: left; vertical-align: bottom; font-weight: 650; color: #2e464e; }
.rp-table td { padding: 1.6mm 2mm; border-bottom: 1px solid #e3eae9; vertical-align: top; overflow-wrap: break-word; hyphens: auto; }
.rp-buildings td, .rp-buildings th { white-space: nowrap; }
.rp-table .num { text-align: right; white-space: nowrap; }
.rp-line { display: block; }
.rp-notes { margin: 2mm 0 0; padding-left: 4.5mm; font-size: 8pt; color: #4b616a; }
.rp-notes li { margin: 0 0 1mm; }
.rp-empty { color: #5b7079; font-style: italic; }
.rp-sources { font-size: 8pt; }
.rp-source-list { margin: 2mm 0 0; padding-left: 4.5mm; color: #4b616a; overflow-wrap: anywhere; }
.rp-end { margin-top: 8mm; padding-top: 2mm; border-top: 1px solid #cfdcda; font-size: 7.5pt; color: #6a7f87; }
@media (max-width: 760px) {
 .report-toolbar { flex-wrap: wrap; gap: 6px 10px; padding: 8px 10px; }
 .report-status { order: 3; flex-basis: 100%; }
 .report-toolbar-actions { margin-left: auto; }
 #reportBack { display: none; }
 .report-stage { padding: 12px 8px 32px; }
}
@media print {
 body.print-report > :not(#reportDialog) { display: none !important; }
 body.print-report #reportDialog { position: static; display: block !important; width: auto; height: auto; max-width: none; max-height: none; overflow: visible; background: #fff; }
 body.print-report #reportDialog::backdrop { display: none; }
 body.print-report :is(.report-toolbar, .report-upsell) { display: none !important; }
 body.print-report .report-stage { padding: 0; overflow: visible; }
 body.print-report .report-doc { width: auto; min-height: 0; margin: 0 !important; padding: 0; box-shadow: none; transform: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.restore-dialog { width: min(640px, calc(100vw - 32px)); }
.restore-dialog #restoreStatus.fail { color: var(--status-error); }
.restore-compare { width: 100%; border-collapse: collapse; font-size: 13px; }
.restore-compare:empty { display: none; }
.restore-compare th, .restore-compare td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.restore-compare thead th { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.restore-compare tbody th { font-weight: 500; }
.restore-warning { margin: 12px 0; padding: 10px 12px; border-radius: 8px; color: var(--badge-warning-text); background: var(--badge-warning-background); font-size: 13px; line-height: 1.5; }
.backup-hint { color: var(--text-muted); }
@media (max-width: 520px) { .restore-compare th, .restore-compare td { padding: 6px 4px; font-size: 12px; } }
.update-banner { position: fixed; z-index: 3000; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; width: min(560px, calc(100vw - 24px)); padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text-primary); background: var(--surface-elevated); box-shadow: 0 8px 24px rgb(0 0 0 / 18%); font-size: 13px; line-height: 1.4; }
.update-banner[hidden] { display: none; }
.update-banner span { flex: 1 1 260px; }
.update-banner small { flex-basis: 100%; color: var(--text-muted); }
.update-banner small:empty { display: none; }

/* Map source notes: compact toggle, full text on demand (always visible when printing). */
.map-attribution-toggle { position: absolute; right: 10px; bottom: 10px; width: auto; z-index: 900; display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-elevated, rgba(255, 255, 255, .92)); color: var(--text); font-size: 11px; font-weight: 600; box-shadow: var(--shadow); }
.mapwrap .leaflet-control-attribution { display: none; margin: 0 10px 46px 0; max-width: min(460px, calc(100vw - 32px)); padding: 8px 10px; border-radius: 10px; font-size: 11px; line-height: 1.5; white-space: normal; box-shadow: var(--shadow); }
.mapwrap[data-attribution="open"] .leaflet-control-attribution { display: block; }
@media print { .map-attribution-toggle { display: none !important; } .mapwrap .leaflet-control-attribution { display: block !important; margin: 0; max-width: none; } }

/* Map messages: errors (red, dismissible) and the filter state (neutral, with reset) are separate boxes. */
.map-status { position: absolute; z-index: 700; left: 16px; right: 110px; bottom: 10px; display: grid; gap: 6px; pointer-events: none; }
.map-status > * { pointer-events: auto; }
.map-status .notice { position: static; max-width: none; margin: 0; width: auto; padding-right: 34px; }
.map-notice-wrap { position: relative; }
.map-notice-wrap[hidden], .map-filter-box[hidden] { display: none; }
.notice-close { position: absolute; top: 4px; right: 6px; width: 24px; height: 24px; min-height: 0; padding: 0; border: 0; background: transparent; color: inherit; font-size: 18px; line-height: 1; border-radius: 6px; }
.notice-close[hidden] { display: none; }
.map-filter-box { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 7px 13px; border-radius: 10px; font-size: 11px; line-height: 1.5; background: var(--surface-elevated); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); }
.map-filter-title { font-weight: 700; }
.map-filter-trail { flex: 1 1 auto; min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
.map-filter-box .text-button { width: auto; white-space: nowrap; font-weight: 600; }
@media (max-width: 760px) { .map-status { left: 12px; } }
@media print { .map-status { display: none !important; } }

/* Cloud licensing (Einstellungen → Lizenzen). Theme tokens only, so Light and Dark stay consistent. */
.license-account .license-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.license-account .license-actions button { width: auto; flex: 1 1 160px; }
.license-account .license-login { margin-bottom: 8px; }
.license-subheading { margin: 18px 0 8px; font-size: 13px; }
.license-devices { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.license-devices li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.license-devices li > span { display: grid; gap: 2px; min-width: 0; }
.license-devices small { color: var(--muted); font-size: 11px; }
.license-devices button { width: auto; flex: 0 0 auto; }
.license-delete { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.license-delete > summary { cursor: pointer; font-weight: 600; }
.license-delete label { display: block; margin-top: 10px; }
.license-delete .license-confirm { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; }
.license-delete .license-confirm input { width: auto; margin-top: 2px; }
.license-delete button.danger { margin-top: 12px; width: auto; color: var(--error-text); border-color: var(--error-border); background: var(--error-background); }
.license-account .fail { color: var(--error-text); }

/* Phone in the browser and PWA: the section dialogs open non-modal (karte.html) and end above the bottom bar, so the
   bar stays visible and usable, as in the app (which adds the safe areas, see below). Dialogs that are still modal
   (opened before the window became narrow) keep their layout. */
@media screen and (max-width: 600px) {
  html:not([data-shell="native"]) :is(#analysisDialog, #ownershipDialog, #toolsDialog)[open]:not(:modal) { position: fixed; inset-inline: 0; inset-block: 0 calc(56px + env(safe-area-inset-bottom, 0px)); margin: 0; width: 100vw; max-width: none; height: auto !important; max-height: none !important; z-index: 1000; }
}
/* A section dialog opened non-modal on a phone stays non-modal when the screen turns or widens (landscape, split view):
   there it is centred and scrolls like a modal one, instead of running off the bottom of the screen. App and browser. */
@media screen and (min-width: 601px) {
  :is(#ownershipDialog, #toolsDialog)[open]:not(:modal), #analysisDialog[open][data-view="dashboard"]:not(:modal) { position: fixed; inset-block: 0; overflow: auto; z-index: 1000; }
}
/* App (AP11a.2, html[data-shell="native"] is set only by tools/build_app.py together with viewport-fit=cover):
   the page starts below the status bar and .layout fills the remaining height instead of 100dvh minus the fixed
   header heights. Dialogs start below the status bar as well; the parcel details panel keeps its own position (full
   screen up to 600 px, bottom sheet up to 760 px, side panel above) and only moves down by the inset. Screen only, so printing is unchanged. Android: with viewport-fit=cover and
   WebView 140+ Capacitor passes the insets through to env(); older WebViews are padded natively (insets 0).
   Browser and PWA: no effect. */
@media screen {
  html[data-shell="native"] { --fluro-safe-top: env(safe-area-inset-top, 0px); --fluro-bottom-bar: 0px; }
  html[data-shell="native"] body { display: flex; flex-direction: column; height: 100dvh; padding: var(--fluro-safe-top) env(safe-area-inset-right, 0px) var(--fluro-bottom-bar) env(safe-area-inset-left, 0px); }
  html[data-shell="native"] body > .app-header { flex: none; }
  html[data-shell="native"] body > .layout { flex: 1 1 auto; height: auto; min-height: 0; }
  html[data-shell="native"] dialog[open]:not(:where(.analysis-dialog[data-view="details"])) { inset-block-start: var(--fluro-safe-top); max-height: calc(100dvh - var(--fluro-safe-top)) !important; }
}
/* App only: no text selection and no "Copy / Look Up / Translate" menu on controls and labels; fields, tables and
   the report preview stay selectable. */
html[data-shell="native"] body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* App only: a double tap does not zoom the whole page (the map keeps its own double-tap zoom, pinch zoom stays). */
html[data-shell="native"], html[data-shell="native"] body { touch-action: manipulation; }
html[data-shell="native"] :is(input, textarea, select, [contenteditable="true"], table, #reportDocument) { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
@media screen and (max-width: 600px) { html[data-shell="native"] .analysis-dialog[data-view="details"] { inset-block-start: var(--fluro-safe-top); max-height: calc(100dvh - var(--fluro-safe-top)) !important; } }
@media screen and (min-width: 761px) { html[data-shell="native"] .analysis-dialog[data-view="details"] { inset-block-start: calc(88px + var(--fluro-safe-top)); } }
@media screen and (max-width: 600px) { html[data-shell="native"] { --fluro-bottom-bar: calc(56px + env(safe-area-inset-bottom, 0px)); } }
/* App on a phone: the bottom bar stays visible in the main sections (karte.html opens these dialogs non-modal, so the
   bar in the page stays usable; they end above it). A sliding indicator and a lifted icon mark the active tab; the section content fades
   in. Only opacity/transform of the content and the indicator are animated, never the dialog (a transform on the
   dialog would become the containing block of the fixed bar). */
@media screen and (max-width: 600px) {
  html[data-shell="native"] :is(#analysisDialog, #ownershipDialog, #toolsDialog)[open] { position: fixed; inset-inline: 0; inset-block: var(--fluro-safe-top) var(--fluro-bottom-bar); margin: 0; width: 100vw; max-width: none; height: auto !important; max-height: none !important; z-index: 1000; }
  html[data-shell="native"] .mobile-bar::after { content: ""; position: absolute; top: 0; left: calc(var(--mobile-tab-index, 0) * 25% + 12.5% - 16px); width: 32px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); transition: left .22s cubic-bezier(.2, .8, .2, 1); }
  html[data-shell="native"] .mobile-tab svg { transition: transform .18s ease-out; }
  html[data-shell="native"] .mobile-tab[aria-current="page"] svg { transform: translateY(-1px) scale(1.08); }
  html[data-shell="native"] .mobile-tab { transition: color .18s ease-out; }
  html[data-shell="native"] :is(#analysisDialog, #ownershipDialog, #toolsDialog)[open] > :not(#mobileBar) { animation: fluro-section-in .16s ease-out; }
}
@keyframes fluro-section-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media screen and (max-width: 600px) and (prefers-reduced-motion: reduce) {
  html[data-shell="native"] .mobile-bar::after, html[data-shell="native"] .mobile-tab, html[data-shell="native"] .mobile-tab svg { transition: none; }
  html[data-shell="native"] :is(#analysisDialog, #ownershipDialog, #toolsDialog)[open] > :not(#mobileBar) { animation: none; }
}
@media screen and (min-width: 601px) and (max-width: 900px) and (orientation: portrait) { html[data-shell="native"] { --fluro-bottom-bar: calc(64px + env(safe-area-inset-bottom, 0px)); } }
