/* Semantic UI tokens. Light values preserve the existing component colors. */
:root {
 color-scheme: light;
 --app-background: #f5f7f6;
 --surface-primary: #fff;
 --surface-secondary: #f3f6f5;
 --surface-control: #f4f7f6;
 --surface-elevated: #fff;
 --surface-hover: #e8f2ee;
 --surface-selected: #e4f2ed;
 --surface-search: #edf7f2;
 --surface-kpi: #f3f8f5;
 --surface-pro: #f5faf7;
 --surface-readonly: #f3f8f5;
 --surface-graph: #f8faf9;
 --surface-chip-hover: #e8eeeb;
 --surface-item-hover: #f6faf8;
 --surface-item-selected: #f1f8f5;
 --surface-region-selected: #f0f8f4;
 --surface-region-unavailable: #f6f8f7;
 --surface-catalog: #f6f9f7;
 --surface-info: #f2f6f4;
 --surface-legend-selected: #edf6f1;
 --text-chip: #586c73;
 --text-highlight: #36584a;
 --notice-text: #526872;
 --border-item-hover: #a9cdbf;
 --border-kpi: #e0ebe4;
 --border-legend-selected: #b7d5c9;
 --value-kpi: #166c55;
 --analysis-warning-background: #fff8e9;
 --analysis-warning-text: #89672b;
 --analysis-warning-border: #dfb34c;
 --badge-default-background: #eef1f2;
 --badge-default-text: #596f79;
 --badge-candidate-background: #fff0d8;
 --badge-candidate-text: #916009;
 --surface-pro-preview: #eaf5ef;
 --surface-planned: #eaf1ed;
 --text-planned: #64796e;
 --surface-document-hover: #f0f7f4;
 --document-icon-text: #387563;
 --document-pdf-text: #b94a48;
 --danger-action-background: #fff4f1;
 --danger-action-text: #b05141;
 --danger-action-border: #f0d3cb;
 --danger-solid: #a64f47;
 --danger-solid-hover: #8f3d36;
 --text-on-danger: #ffffff;
 --accept-solid: #44796a;
 --accept-solid-hover: #366f61;
 --text-on-accept: #ffffff;
 --text-primary: #172a32;
 --text-muted: #647780;
 --text-label: #50636c;
 --text-detail-label: #536970;
 --text-selected: #08634d;
 --text-on-accent: #fff;
 --border-default: #dfe7e7;
 --border-control: #dfe7e7;
 --border-input: #d4dfe0;
 --border-selected: #b3dccb;
 --border-management: #d5e4de;
 --accent-primary: #117c68;
 --accent-hover: #096451;
 --focus-ring: #46b49d;
 --input-focus-shadow: #117c6812;
 --input-background: #fff;
 --overlay-background: #0e2b354f;
 --file-overlay-background: #142f3a66;
 --shadow-soft: 0 12px 40px #132c351a;
 --shadow-dialog: 0 20px 70px #102c3540;
 --shadow-file: 0 24px 80px #173a3333;
 --shadow-details: 0 12px 44px #1332373b;
 --link-text: #0000ee;
 --map-navigation-fill: #117c68;
 --quick-title: #172b45;
 --quick-meta: #4b5b6b;
 --quick-label: #334355;
 --quick-input-background: #fff;
 --quick-input-text: #182738;
 --quick-input-border: #9aa8b7;
 --quick-focus: #2970d6;
 --quick-preview-background: #edf4fc;
 --quick-preview-text: #142b42;
 --quick-details: #44576b;
 --quick-action-background: #265db0;
 --quick-action-text: white;
 --quick-action-border: #295ea6;
 --quick-action-hover: #265db0;
 --quick-reset-background: #f7f8fa;
 --quick-reset-text: #304050;
 --quick-reset-hover: #f7f8fa;
 --quick-error: #a52525;
 --quick-disclaimer: #667587;
 --gallery-light-ink: #172a32;
 --gallery-light-background: #f4f7f6;
 --gallery-dark-ink: #eff7f4;
 --gallery-dark-background: #172a32;
 --status-success: #286e58;
 --status-warning: #8c6a25;
 --status-error: #a43535;
 --warning-background: #fff8e8;
 --error-background: #fff0ec;
 --error-text: #913f29;
 --error-border: #f0cbbd;
 --badge-pro-background: #e2f2e9;
 --badge-pro-text: #117c68;
 --badge-reserved-background: #f0e6fc;
 --badge-reserved-text: #7a3fac;
 --reserve-action-border: #dac2f4;
 --reserve-action-hover: #e8d8fa;
 --badge-manual-background: #eaf0fa;
 --badge-manual-text: #3e608e;
 --badge-warning-background: #fff1d9;
 --badge-warning-text: #8a641f;
 --badge-success-background: #e0f2e8;
 --badge-success-text: #16734e;
 --widget-background: #fffffff5;
 --widget-border: #ffffffb3;
 --map-background: #dfe7e1;
 --map-control-text: #10233e;
 --map-control-background: rgba(255,255,255,.92);
 --map-control-hover: #f4f4f4;
 --map-print-background: #fffffff0;
 --notice-border: #ffffffcc;
 --value-text: #126c55;
 --graph-edge: #647780;
 --graph-relation: #a8b8ba;
 --graph-edgeText: #344950;
 --graph-halo: white;
 --graph-node: #f5f8f6;
 --graph-border: #b7c9c5;
 --graph-group: #edf2f0;
 --graph-accent: #117c68;
 --graph-text: #172a32;
 --graph-caption: #647780;
 --chart-arable: #d5a548;
 --chart-grass: #71a865;
 --chart-shrubs: #98a669;
 --chart-forest: #24735d;
 --chart-garden: #b97897;
 --chart-transport: #84929d;
 --chart-built: #c77c59;
 --chart-agriculture: #b9ac71;
 --chart-mixed: #9a8eb4;
 --chart-other: #739ca4;
 --chart-unknown: #c7cfd1;
}
:root[data-theme="dark"] {
 /* Neutral chrome in the green-black of the FLURO brand (website); luminance as before, so contrast is unchanged.
    Status, badge, chart, accent and value colours keep their values. */
 color-scheme: dark;
 --app-background: #111d20;
 --surface-primary: #1d2c30;
 --surface-secondary: #182629;
 --surface-control: #25383b;
 --surface-elevated: #233438;
 --surface-hover: #2b3f3b;
 --surface-selected: #203d33;
 --surface-search: #213c35;
 --surface-kpi: #20352f;
 --surface-pro: #1c332e;
 --surface-readonly: #26352f;
 --surface-graph: #162528;
 --surface-chip-hover: #2a3d3b;
 --surface-item-hover: #263c36;
 --surface-item-selected: #223f35;
 --surface-region-selected: #223f35;
 --surface-region-unavailable: #223134;
 --surface-catalog: #223337;
 --surface-info: #243437;
 --surface-legend-selected: #264338;
 --text-chip: #bacfcb;
 --text-highlight: #c0d8cc;
 --notice-text: #bbd0cc;
 --border-item-hover: #6c9f8d;
 --border-kpi: #537365;
 --border-legend-selected: #78a28f;
 --value-kpi: #a5dfc4;
 --analysis-warning-background: #3b3224;
 --analysis-warning-text: #edd297;
 --analysis-warning-border: #b99952;
 --badge-default-background: #2b3f43;
 --badge-default-text: #bbcfcb;
 --badge-candidate-background: #423522;
 --badge-candidate-text: #ecd395;
 --surface-pro-preview: #213c32;
 --surface-planned: #2b3b35;
 --text-planned: #c2d3ca;
 --surface-document-hover: #253d34;
 --document-icon-text: #a9d9c3;
 --document-pdf-text: #efb0ae;
 --danger-action-background: #3b2528;
 --danger-action-text: #f1b6aa;
 --danger-action-border: #b16e60;
 --danger-solid: #a64f47;
 --danger-solid-hover: #8f3d36;
 --text-on-danger: #ffffff;
 --accept-solid: #44796a;
 --accept-solid-hover: #366f61;
 --text-on-accept: #ffffff;
 --text-primary: #d8e8e5;
 --text-muted: #aec3bf;
 --text-label: #bacfcb;
 --text-detail-label: #bacfcb;
 --text-selected: #a2d9be;
 --text-on-accent: #112b23;
 --border-default: #496065;
 --border-control: #6c888d;
 --border-input: #6c888d;
 --border-selected: #6c9f8d;
 --border-management: #6c888d;
 --accent-primary: #85cbb2;
 --accent-hover: #a1dbc4;
 --focus-ring: #9bddc8;
 --input-focus-shadow: #85cbb226;
 --input-background: #1b2a2e;
 --overlay-background: #071012a6;
 --file-overlay-background: #071012a6;
 --shadow-soft: 0 12px 40px #0003;
 --shadow-dialog: 0 20px 70px #0005;
 --shadow-file: 0 24px 80px #0005;
 --shadow-details: 0 12px 44px #0005;
 --link-text: #a5c8ed;
 --map-navigation-fill: #117c68;
 --quick-title: var(--text-primary);
 --quick-meta: var(--text-muted);
 --quick-label: var(--text-label);
 --quick-input-background: var(--input-background);
 --quick-input-text: var(--text-primary);
 --quick-input-border: var(--border-input);
 --quick-focus: var(--focus-ring);
 --quick-preview-background: var(--surface-kpi);
 --quick-preview-text: var(--text-primary);
 --quick-details: var(--text-muted);
 --quick-action-background: var(--accent-primary);
 --quick-action-text: var(--text-on-accent);
 --quick-action-border: var(--accent-primary);
 --quick-action-hover: var(--accent-hover);
 --quick-reset-background: var(--surface-control);
 --quick-reset-text: var(--text-primary);
 --quick-reset-hover: var(--surface-hover);
 --quick-error: var(--status-error);
 --quick-disclaimer: var(--text-muted);
 --gallery-light-ink: #172a32;
 --gallery-light-background: #f4f7f6;
 --gallery-dark-ink: #eff7f4;
 --gallery-dark-background: #172a32;
 --status-success: #9bd7bd;
 --status-warning: #e8c885;
 --status-error: #f2b1aa;
 --warning-background: #3b3224;
 --error-background: #3b2528;
 --error-text: #f3b9ab;
 --error-border: #b16e60;
 --badge-pro-background: #1f483b;
 --badge-pro-text: #a5dfc4;
 --badge-reserved-background: #3e2d52;
 --badge-reserved-text: #d7bde9;
 --reserve-action-border: #ad8fc7;
 --reserve-action-hover: #4e3862;
 --badge-manual-background: #273b53;
 --badge-manual-text: #b6d0ed;
 --badge-warning-background: #423522;
 --badge-warning-text: #ecd395;
 --badge-success-background: #1f483b;
 --badge-success-text: #a5dfc4;
 --widget-background: #1d2c30f5;
 --widget-border: #6c888d;
 --map-background: #172528;
 --map-control-text: #d8e8e5;
 --map-control-background: #233438;
 --map-control-hover: #2b3f3b;
 --map-print-background: #233438f0;
 --notice-border: #6c888d;
 --value-text: #a5dfc4;
 --graph-edge: #97b4ba;
 --graph-relation: #7d9ba1;
 --graph-edgeText: #bad3ce;
 --graph-halo: #162528;
 --graph-node: #24363a;
 --graph-border: #7b979c;
 --graph-group: #31474b;
 --graph-accent: #a0dcc4;
 --graph-text: #d8e8e5;
 --graph-caption: #b7cfca;
 --chart-arable: #e3bc70;
 --chart-grass: #93c388;
 --chart-shrubs: #bdcc92;
 --chart-forest: #78b5a0;
 --chart-garden: #d29cbc;
 --chart-transport: #afbecb;
 --chart-built: #e1a47f;
 --chart-agriculture: #cfc48e;
 --chart-mixed: #b6a7cf;
 --chart-other: #91c0c7;
 --chart-unknown: #b9c4ca;
}
/* Phase 1: application chrome and native controls. Geometry is unchanged. */
body { background: var(--app-background); }
label { color: var(--text-label); }
.app-header, .filter-sidebar, aside.filter-sidebar { background: var(--surface-primary); }
button, button.secondary, .dialog-close { background: var(--surface-control); }
button, button.secondary, .dialog-close { border-color: var(--border-control); }
button:hover, button.secondary:hover, .dialog-close:hover { background: var(--surface-hover); }
input, select, textarea { background-color: var(--input-background); color: var(--text); border-color: var(--border-input); }
input:focus, select:focus { box-shadow: 0 0 0 3px var(--input-focus-shadow); }
:focus-visible { outline-color: var(--focus-ring); }
.sidebar-search input { background: var(--surface-control); border-color: transparent; }
.sidebar-search input.has-filter { background: var(--surface-search); border-color: var(--accent); }
.toolbar .primary, button.primary { color: var(--text-on-accent); }
.toolbar .primary:hover { background: var(--accent-hover); }
button.primary:hover { color: var(--text-on-accent); background: var(--accent-hover); border-color: var(--accent-hover); }
/* Toolbar: the open section (Dashboard, Eigentümer, Einstellungen) is marked like the tab in the phone bar;
   no toolbar button is a permanent call to action. */
.toolbar .toolbar-button[aria-current="true"], .toolbar .toolbar-button[aria-current="true"]:hover { background: var(--surface-selected); color: var(--text-selected); }
.toolbar .toolbar-button[aria-current="true"] .nav-icon { color: var(--accent-primary); }
.toolbar .toolbar-button[aria-current="true"] > span { font-weight: 700; }
.parcel-acquire-actions .parcel-reserve { color: var(--badge-reserved-text); background: var(--badge-reserved-background); border-color: var(--reserve-action-border); }
.parcel-acquire-actions .parcel-reserve:hover { background: var(--reserve-action-hover); }
.status-chip { background: var(--surface-secondary); }
.status-chip.active { background: var(--surface-selected); color: var(--text-selected); border-color: var(--border-selected); }
.filter-sidebar .item { background: var(--surface-primary); }
.active-search-filter { background: var(--surface-search); border-color: var(--border-selected); }
/* Phase 2: each management, editing and status component keeps its Light values. */
.status-chip { color: var(--text-chip); }
.status-chip:hover { background: var(--surface-chip-hover); }
.status-chip.active { color: var(--text-selected); }
.filter-sidebar .item:hover { background: var(--surface-item-hover); border-color: var(--border-item-hover); }
.filter-sidebar .item.selected { background: var(--surface-item-selected); }
.pill { background: var(--badge-default-background); color: var(--badge-default-text); }
.pill.ok { background: var(--badge-success-background); color: var(--badge-success-text); }
.pill.purple-pill { background: var(--badge-reserved-background) !important; color: var(--badge-reserved-text) !important; }
.pill.candidate-pill { background: var(--badge-candidate-background); color: var(--badge-candidate-text); }
.pill.manual-pill { background: var(--badge-manual-background) !important; color: var(--badge-manual-text) !important; }
.pill.dirty-pill, .pill.unpriced-pill { background: var(--badge-warning-background) !important; color: var(--badge-warning-text) !important; }
.analysis-dialog, .edit-dialog, .tools-dialog, .file-dialog { background: var(--surface-primary); box-shadow: var(--shadow-dialog); }
.file-dialog { box-shadow: var(--shadow-file); }
.analysis-dialog[data-view="details"] { box-shadow: var(--shadow-details); }
.analysis-dialog::backdrop, .edit-dialog::backdrop, .tools-dialog::backdrop { background: var(--overlay-background); }
.file-dialog::backdrop { background: var(--file-overlay-background); }
.management-nav, .analysis-tabs { background: var(--surface-secondary); }
.management-nav button[aria-pressed="true"], .management-nav button[aria-selected="true"] { background: var(--surface-primary); border-color: var(--border-management); }
.analysis-tabs button.active { background: var(--surface-primary); }
.ownership-new-member, .ownership-selection-summary, .ownership-relation, .ownership-preview, .ownership-dialog textarea { border-color: var(--border-management); }
.analysis-dialog label { color: var(--text-detail-label); }
.analysis-dialog input, .analysis-dialog select, .analysis-dialog textarea { background-color: var(--input-background); border-color: var(--border-input); }
.edit-dialog input[readonly] { background-color: var(--surface-readonly); color: var(--text-label); }
.edit-dialog #editMetadataHint { background: var(--surface-kpi); }
.edit-catalog, .rate-settings-item { background: var(--surface-catalog); }
.catalog-options, #familySearchResults, #familyPortfolioChoices { background: var(--surface-elevated); }
.catalog-options [role="option"]:hover, .catalog-options [aria-selected="true"] { background: var(--surface-selected); color: var(--text-selected); }
.catalog-spinner, .document-spinner { border-color: var(--border-management); border-top-color: var(--accent); }
#editCatalogStatus[data-state="error"] { color: var(--status-error); }
#documentStatus[data-error="true"], #documentUploadStatus[data-error="true"], .theme-status[data-error="true"] { color: var(--status-error); }
:root[data-theme="dark"] input::placeholder, :root[data-theme="dark"] textarea::placeholder { color: var(--text-muted); opacity: 1; }
:root[data-theme="dark"] select, :root[data-theme="dark"] input[list], :root[data-theme="dark"] .edit-catalog-field input {
 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23bfccd9' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
}
.edit-catalog-field input[aria-busy="true"] { background-image: none; }
/* License and feature previews use UI tokens, not the GIS palette. */
.management-nav .pro-badge { color: var(--badge-pro-text); background: var(--badge-pro-background); }
.edition-card.selected, .region-card.selected { background: var(--surface-region-selected); }
.region-card { background: var(--surface-primary); }
.region-card.unavailable { background: var(--surface-region-unavailable); }
.region-card:not(.unavailable):hover { background: var(--surface-hover); }
.pro-highlights { color: var(--text-highlight); }
.pro-preview button { background: var(--surface-pro-preview); }
.land-register-formats span { background: var(--surface-control); }
.portfolio-capacity { color: var(--text-muted); font-size: 11px; line-height: 1.6; }
.portfolio-limit-notice { color: var(--text-primary); }
.portfolio-limit-notice .pro-network { color: var(--accent-primary); }
.portfolio-limit-notice button.primary { color: var(--text-on-accent); background: var(--accent-primary); border-color: var(--accent-primary); }
.portfolio-limit-notice button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
:root[data-theme="dark"] .pro-network g[fill="#eef7f2"] { fill: var(--graph-node); }
:root[data-theme="dark"] .pro-network g[fill="#466459"] { fill: var(--graph-edgeText); }
:root[data-theme="dark"] .pro-network g[stroke="#117c68"] { stroke: var(--graph-accent); }
:root[data-theme="dark"] .pro-network g[stroke="#a2c3b8"] { stroke: var(--graph-border); }
/* Dashboard and diagram surfaces. Series colors have their own tokens. */
.analysis-kpi, .family-totals { background: var(--surface-kpi); }
.parcel-metadata { background: var(--surface-item-selected); }
.analysis-kpi { border-color: var(--border-kpi); }
.analysis-kpi b { color: var(--value-kpi); }
.analysis-warning { color: var(--analysis-warning-text); background: var(--analysis-warning-background); border-left-color: var(--analysis-warning-border); }
.analysis-actions button:last-child { color: var(--text-on-accent); }
.usage-metric { background: var(--surface-secondary); }
.usage-metric button[aria-pressed="true"] { background: var(--surface-primary); }
.usage-segment { stroke: var(--surface-primary); }
.usage-chart-center { fill: var(--surface-primary); }
.usage-icon { background: color-mix(in srgb, var(--usage-color) 12%, var(--surface-primary)); }
.usage-legend-item, .usage-parcel { background: var(--surface-primary); }
.usage-legend-item[aria-pressed="true"] { background: var(--surface-legend-selected); border-color: var(--border-legend-selected); }
.family-stage { background: var(--surface-graph); }
:root[data-theme="dark"] .family-node.muted { opacity: .75; }
:root[data-theme="dark"] .family-edge.muted { opacity: .7; }
/* Document rows and contextual notices. Native PDF/image content is unchanged. */
.document-open:hover { background: var(--surface-document-hover); }
.document-type { color: var(--document-icon-text); }
.document-type-pdf { color: var(--document-pdf-text); }
/* Subdued green for "In Bestand aufnehmen" in the parcel detail widget. */
.parcel-detail-actions .acceptbtn { background: var(--accept-solid); color: var(--text-on-accept); border-color: var(--accept-solid); }
.parcel-detail-actions .acceptbtn:hover:not(:disabled) { background: var(--accept-solid-hover); border-color: var(--accept-solid-hover); color: var(--text-on-accept); }
/* Deletion: the final confirmation (deletion dialog, account deletion) is solid red. The buttons that only open that
   confirmation are quiet: red text on a red-tinted outline, so they no longer weigh as much as "Bearbeiten" or "Speichern". */
button.danger { background: var(--danger-solid); color: var(--text-on-danger); border-color: var(--danger-solid); }
button.danger:hover:not(:disabled) { background: var(--danger-solid-hover); border-color: var(--danger-solid-hover); }
.parcel-detail-actions .removebtn, #portfolioDelete, #propertyDissolve, #ownerDelete, #resetAll, .backup-delete, #valueClear, #parcelQuickClear, .historyDelete, .document-options button[data-document-remove] { background: transparent; color: var(--danger-action-text); border-color: var(--danger-action-border); }
.parcel-detail-actions .removebtn:hover:not(:disabled), #portfolioDelete:hover:not(:disabled), #propertyDissolve:hover:not(:disabled), #ownerDelete:hover:not(:disabled), #resetAll:hover:not(:disabled), .backup-delete:hover:not(:disabled), #valueClear:hover:not(:disabled), #parcelQuickClear:hover:not(:disabled), .historyDelete:hover:not(:disabled), .document-options button[data-document-remove]:hover:not(:disabled) { background: var(--danger-action-background); color: var(--danger-action-text); border-color: var(--danger-action-text); }
.notice { background: var(--surface-primary); color: var(--notice-text); border-color: var(--notice-border); }
.notice.fail { background: var(--error-background); color: var(--error-text); border-color: var(--error-border); }
.notice.success { color: var(--status-success); }
.notice.loading { background: var(--warning-background); color: var(--status-warning); }
.info { background: var(--surface-info); }
/* GIS geometry/status colors and marker panes intentionally remain unchanged. */
#map { background: var(--map-background); }
.map-widget, .area-widget { background: var(--widget-background) !important; border-color: var(--widget-border) !important; }
.portfolio-total { color: var(--value-text); }
.balance-filter-summary[data-active="true"] { color: var(--text-selected); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface-elevated); }
.leaflet-popup-content { color: var(--text); }
/* The existing selected-parcel quick editor has its own high-specificity rules. */
.leaflet-popup-content .value-quick-edit h3 { color: var(--quick-title); }
.leaflet-popup-content .value-quick-edit .value-meta { color: var(--quick-meta); }
.leaflet-popup-content .value-quick-edit label { color: var(--quick-label); }
.leaflet-popup-content .value-quick-edit input { background-color: var(--quick-input-background); color: var(--quick-input-text); border-color: var(--quick-input-border); }
.leaflet-popup-content .value-quick-edit input:focus { outline-color: var(--quick-focus); border-color: var(--quick-focus); }
.leaflet-popup-content .value-quick-edit .value-preview { background: var(--quick-preview-background); color: var(--quick-preview-text); }
.leaflet-popup-content .value-quick-edit details { color: var(--quick-details); }
.leaflet-popup-content .value-quick-edit .value-actions button { background: var(--quick-action-background); color: var(--quick-action-text); border-color: var(--quick-action-border); }
.leaflet-popup-content .value-quick-edit .value-actions button:hover { background: var(--quick-action-hover); }
.leaflet-popup-content .value-quick-edit .value-actions .value-erase { background: var(--quick-reset-background); color: var(--quick-reset-text); border-color: var(--quick-input-border); }
.leaflet-popup-content .value-quick-edit .value-actions .value-erase:hover { background: var(--quick-reset-hover); }
.leaflet-popup-content .value-quick-edit .value-error { color: var(--quick-error); }
.leaflet-popup-content .value-quick-edit .value-disclaimer { color: var(--quick-disclaimer); }
.parcel-navigation { background: var(--surface-control); }
.map-print { background: var(--map-print-background); }
.leaflet-control-zoom a { background: var(--map-control-background); color: var(--map-control-text); }
.leaflet-control-zoom a:hover { background: var(--map-control-hover); }
:root[data-theme="dark"] .leaflet-control-attribution { background: var(--surface-elevated); color: var(--text-muted); }
:root[data-theme="dark"] a:not([class]) { color: var(--link-text); }
:root[data-theme="dark"] .analysis-table th, :root[data-theme="dark"] .file-dialog th { background: var(--surface-secondary); }
:root[data-theme="dark"] .parcel-navigation-pin svg { fill: var(--parcel-pin-color, var(--map-navigation-fill)); }
.analysis-head-actions .parcel-navigation { color: var(--text-muted); }
.widget-content button[aria-pressed="true"] { color: var(--text-selected); background: var(--surface-selected); border-color: var(--border-selected); }
/* Appearance is a new component and exclusively consumes the semantic tokens. */
.appearance-options { border: 0; margin: 12px 0; padding: 0; min-width: 0; }
.appearance-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.appearance-choice { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-primary); color: var(--text); cursor: pointer; margin: 0; }
.appearance-choice.selected { border-color: var(--accent); background: var(--surface-region-selected); }
.appearance-choice input[type="radio"] { flex: 0 0 16px; width: 16px; min-width: 16px; margin: 3px 0 0; padding: 0; accent-color: var(--accent); }
.appearance-choice svg { flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.appearance-choice > span { min-width: 0; }
.appearance-choice strong { display: block; font-size: 13px; }
.appearance-choice small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.6; margin-top: 4px; }
@media (max-width: 760px) { .appearance-grid { grid-template-columns: 1fr; } }
/* Existing prints stay light without changing the on-screen preference. */
@media print {
 :root[data-theme] {
  color-scheme: light !important;
  --app-background: #f5f7f6; --map-background: #dfe7e1; --surface-control: #f4f7f6;
  --text-label: #50636c; --text-detail-label: #536970; --text-on-accent: #fff;
  --text-primary: #172a32; --text-muted: #647780; --accent-primary: #117c68;
  --surface-primary: #fff; --surface-secondary: #f3f6f5; --surface-elevated: #fff;
  --surface-kpi: #f3f8f5; --surface-graph: #f8faf9; --widget-background: #fffffff5;
  --widget-border: #ffffffb3; --value-text: #126c55; --value-kpi: #166c55;
  --graph-edge: #647780; --graph-relation: #a8b8ba; --graph-edgeText: #344950;
  --graph-halo: white; --graph-node: #f5f8f6; --graph-border: #b7c9c5;
  --graph-group: #edf2f0; --graph-accent: #117c68; --graph-text: #172a32; --graph-caption: #647780;
  --chart-arable: #d5a548; --chart-grass: #71a865; --chart-shrubs: #98a669; --chart-forest: #24735d;
  --chart-garden: #b97897; --chart-transport: #84929d; --chart-built: #c77c59;
  --chart-agriculture: #b9ac71; --chart-mixed: #9a8eb4; --chart-other: #739ca4; --chart-unknown: #c7cfd1;
 }
 .family-node.muted, .family-edge.muted { opacity: .35 !important; }
}

.dialog-message { background: var(--warning-background); color: var(--notice-text); border-color: var(--border-management); }
.dialog-message[data-kind="fail"] { background: var(--error-background); color: var(--error-text); }
.dialog-message[data-kind="success"] { background: var(--surface-primary); color: var(--status-success); }
.property-sticky-actions { background: var(--surface-primary); border-color: var(--border-management); }
.property-open-top { background: var(--warning-background); color: var(--notice-text); border-color: var(--border-management); }
