/* Eigenständige Darkmode-Erweiterung. Der bestehende Lightmode in app.css bleibt unberührt. */

.sidebar-session-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 6px;
  align-items: center;
}

.theme-picker {
  position: relative;
  width: 42px;
  height: 42px;
}

.theme-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--surface-active);
  color: var(--ink);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-picker-menu {
  position: absolute;
  z-index: 80;
  right: 0;
  bottom: calc(100% + 8px);
  width: 148px;
  display: grid;
  gap: 3px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 5px;
  box-shadow: var(--shadow-md);
}

.theme-picker-menu[hidden] {
  display: none;
}

.theme-picker-option {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0 10px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.theme-picker-option::after {
  content: "✓";
  opacity: 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.theme-picker-option:hover,
.theme-picker-option:focus-visible {
  outline: 0;
  background: var(--surface-active);
  color: var(--ink);
}

.theme-picker-option.is-selected {
  background: var(--primary-soft);
  color: var(--primary);
}

.theme-picker-option.is-selected::after {
  opacity: 1;
}

.theme-toggle-moon,
html[data-theme="dark"] .theme-toggle-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle-moon {
  display: block;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --primary: #9fb292;
  --primary-hover: #b7c6ad;
  --primary-soft: #1b241e;
  --ink: #f9faf7;
  --text: #e2e5de;
  --muted: #9ca3af;
  --soft: #090a09;
  --surface-sidebar: #070807;
  --surface: #131513;
  --surface-raised: #191b19;
  --surface-active: #202320;
  --surface-control: #1a1c1a;
  --surface-soft: #202320;
  --switch-track: #626a73;
  --switch-border: #747d87;
  --switch-thumb: #ffffff;
  --switch-active: #378352;
  --button-primary: #2e523a;
  --button-primary-hover: #3d694c;
  --button-primary-disabled: #26372b;
  --button-danger: #b63840;
  --button-danger-hover: #c8444c;
  --button-danger-disabled: #2a191d;
  --button-overlay: rgba(16, 21, 29, .9);
  --button-overlay-hover: rgba(22, 29, 39, .96);
  --line: #2b2e2b;
  --line-strong: #414541;
  --line-soft: #222422;
  --border: var(--line);
  --pill-bg: #1b1d1b;
  --pill-border: #3c403c;
  --pill-color: #c0c6cf;
  --pill-selected-bg: #202620;
  --pill-selected-border: #526052;
  --pill-selected-color: #eef1e9;
  --legacy-neutral-surface: var(--surface-active);
  --legacy-active-surface: #242824;
  --legacy-neutral-track: #343734;
  --legacy-neutral-gradient-end: #1d201d;
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, .2);
  --shadow-md: 0 16px 44px rgba(0, 0, 0, .32);
  --focus-ring: 0 0 0 4px rgba(159, 178, 146, .22);
}


html[data-theme="dark"] body .settings-plus-content .plus-status-summary {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  color: var(--text);
}

html[data-theme="dark"] body .settings-plus-content .plus-status-summary h3,
html[data-theme="dark"] body .settings-plus-hint h3 {
  color: var(--ink);
}

html[data-theme="dark"] body .settings-plus-hint {
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="dark"] body .settings-plus-hint a {
  color: var(--primary);
}

html[data-theme="dark"] body .button:not(.button-secondary):not(.button-danger):not(.button-light) {
  background: var(--button-primary);
  color: #fff;
}

html[data-theme="dark"] body .button:not(.button-secondary):not(.button-danger):not(.button-light):hover:not(:disabled):not(.is-waiting):not(.is-loading) {
  background: var(--button-primary-hover);
}

html[data-theme="dark"] body .button:not(.button-secondary):not(.button-danger):not(.button-light):is(:disabled, .is-waiting, .is-loading) {
  background: var(--button-primary-disabled);
  color: #7796c2;
}

html[data-theme="dark"] body .button.button-danger {
  background: var(--button-danger);
  color: #fff;
}

html[data-theme="dark"] body .button.button-danger:hover:not(:disabled):not(.is-waiting):not(.is-loading) {
  background: var(--button-danger-hover);
}

html[data-theme="dark"] body .button.button-danger:is(:disabled, .is-waiting, .is-loading) {
  background: var(--button-danger-disabled);
  color: #a86b71;
}

html[data-theme="dark"] body .button.button-light {
  border: 1px solid #46556a;
  background: var(--button-overlay);
  color: var(--ink);
}

html[data-theme="dark"] body .button.button-light:hover:not(:disabled):not(.is-waiting):not(.is-loading) {
  border-color: #596b84;
  background: var(--button-overlay-hover);
  color: #fff;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .app-main,
html[data-theme="dark"] .app-content,
html[data-theme="dark"] .public-body,
html[data-theme="dark"] .auth-panel,
html[data-theme="dark"] .public-expose-page {
  background-color: var(--soft);
  color: var(--text);
}

html[data-theme="dark"] .auth-passkey-status[data-state="error"] {
  color: #ff9ba2;
}

html[data-theme="dark"] .brand:not(.qampr-wordmark--personal) img {
  content: url("/assets/img/Logo_QAMPR_on_dark.png");
}

html[data-theme="dark"] .brand.qampr-wordmark--personal img {
  content: url("/assets/img/Logo_myQAMPR_on_dark.png");
}

html[data-theme="dark"] .legal-section p,
html[data-theme="dark"] .contact-form-grid .field-title {
  color: var(--text);
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .mobile-tabbar,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .site-footer {
  border-color: var(--line);
  background-color: var(--surface-sidebar);
}

html[data-theme="dark"] .sidebar {
  background: rgba(11, 15, 20, .98);
}

html[data-theme="dark"] .mobile-tabbar {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(14, 21, 17, .97);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .08);
}

html[data-theme="dark"] .sidebar-bottom {
  border-color: var(--line);
}

html[data-theme="dark"] .sidebar-user:hover {
  background: var(--surface-active);
}

html[data-theme="dark"] .sidebar-user .user-avatar {
  background: var(--surface-active);
  color: var(--primary);
}

html[data-theme="dark"] .theme-toggle {
  color: #a3acb9;
}

html[data-theme="dark"] :is(.side-nav-link, .side-nav-group-link, .side-nav-group-trigger) {
  color: #bdc4ce;
}

html[data-theme="dark"] .side-nav-subitem {
  color: #9da7b5;
}

html[data-theme="dark"] :is(.side-nav-link, .side-nav-group-link, .side-nav-group-trigger) .nav-icon {
  color: #8995a5;
}

html[data-theme="dark"] :is(
  .side-nav-link:hover,
  .side-nav-group-link:hover,
  .side-nav-group-trigger:hover,
  .side-nav-link:focus-visible,
  .side-nav-group-link:focus-visible,
  .side-nav-group-trigger:focus-visible,
  .side-nav-link.is-active,
  .side-nav-group-link.is-active
) {
  background: rgba(183, 198, 173, .17);
  color: #f4f6f9;
  box-shadow: inset 0 0 0 1px rgba(183, 198, 173, .08);
}

html[data-theme="dark"] :is(.side-nav-link.is-active, .side-nav-group-link.is-active) {
  background: rgba(183, 198, 173, .17);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(183, 198, 173, .08);
}

html[data-theme="dark"] :is(
  .side-nav-link:hover,
  .side-nav-group-link:hover,
  .side-nav-group-trigger:hover,
  .side-nav-toggle:hover,
  .side-nav-link:focus-visible,
  .side-nav-group-link:focus-visible,
  .side-nav-group-trigger:focus-visible,
  .side-nav-toggle:focus-visible
) {
  color: #f4f6f9;
}

html[data-theme="dark"] :is(
  .side-nav-link:hover,
  .side-nav-group-link:hover,
  .side-nav-group-trigger:hover,
  .side-nav-link.is-active,
  .side-nav-group-link.is-active
) .nav-icon {
  color: var(--primary);
}

html[data-theme="dark"] :is(
  .side-nav-link:hover,
  .side-nav-group-link:hover,
  .side-nav-group-trigger:hover
) .nav-icon {
  color: var(--primary-hover);
}

html[data-theme="dark"] :is(.sidebar-camper-select label, .side-nav-toggle) {
  color: #a3acb9;
}

html[data-theme="dark"] .side-nav-toggle:hover {
  color: var(--primary-hover);
}

html[data-theme="dark"] .sidebar-camper-control {
  border-color: var(--line);
  background-color: var(--surface-control);
  color: #f1f3f6;
}

html[data-theme="dark"] .sidebar-camper-control:hover,
html[data-theme="dark"] .sidebar-camper-control:focus-within {
  background-color: var(--surface-raised);
}

html[data-theme="dark"] .sidebar-camper-select select {
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m6.5 8 3.5 3.5L13.5 8' stroke='%23a3acb9' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color: #f1f3f6;
}

html[data-theme="dark"] .sidebar-camper-control.is-enhanced {
  background: transparent;
}

html[data-theme="dark"] .sidebar-camper-trigger {
  border-color: var(--line-strong);
  background: var(--surface-control);
  color: #f1f3f6;
}

html[data-theme="dark"] .sidebar-camper-trigger:hover,
html[data-theme="dark"] .sidebar-camper-control.is-open .sidebar-camper-trigger {
  border-color: var(--primary);
  background: var(--surface-raised);
}

html[data-theme="dark"] .sidebar-camper-chevron {
  color: #a3acb9;
}

html[data-theme="dark"] .sidebar-camper-option-primary.is-secondary {
  color: #7f8a99;
}

html[data-theme="dark"] .sidebar-camper-options {
  border-color: var(--line-strong);
  background: var(--surface-raised);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .38);
}

html[data-theme="dark"] .sidebar-camper-option {
  color: var(--text);
}

html[data-theme="dark"] .sidebar-camper-option-row:hover,
html[data-theme="dark"] .sidebar-camper-option-row:focus-within,
html[data-theme="dark"] .sidebar-camper-option-row.is-selected {
  background: var(--surface-active);
}

html[data-theme="dark"] .sidebar-camper-option:hover,
html[data-theme="dark"] .sidebar-camper-option:focus-visible,
html[data-theme="dark"] .sidebar-camper-option[aria-checked="true"] {
  background: transparent;
  color: var(--primary);
}

html[data-theme="dark"] .sidebar-camper-primary-action {
  color: #7f8a99;
}

html[data-theme="dark"] .sidebar-camper-primary-action:hover,
html[data-theme="dark"] .sidebar-camper-primary-action:focus-visible {
  background: #1d3352;
  color: var(--primary);
}

html[data-theme="dark"] .sidebar-camper-primary-action:disabled {
  background: transparent;
  color: var(--primary);
}

html[data-theme="dark"] :is(
  .card,
  .auth-card,
  .sidebar-user,
  .intro-panel,
  .dashboard-section,
  .dashboard-mode-card,
  .dashboard-deadline-row,
  .dashboard-shortcut,
  .form-accordion,
  .form-accordion-body,
  .business-modal,
  .mode-settings-dialog,
  .confirm-dialog-panel,
  .file-picker,
  .file-preview-card,
  .context-note,
  .equipment-item,
  .vehicle-gallery-item,
  .vehicle-photo-dropzone,
  .upload-choice,
  .assistant-ai-result,
  .assistant-dropzone,
  .business-relationship-card,
  .business-code-result,
  .vehicle-identity-card,
  .sale-expose-content-card,
  .sale-expose-details-card,
  .sale-expose-profile-card,
  .sale-expose-preview-panel,
  .sale-expose-sheet,
  .public-expose-gallery,
  .public-expose-section,
  .public-expose-contact,
  .inventory-card,
  .vehicle-delete-confirm,
  .finder-card,
  .mode-card,
  .quick-action,
  .setup-steps > div,
  .qr-scanner-panel,
  .product-row,
  .referral-link-panel,
  .referral-status-item,
  .product-explain-card,
  .product-card,
  .inspection-card,
  .reminder-card,
  .inspection-action-card,
  .inspection-history-card,
  .cost-summary,
  .cost-chart-main,
  .cost-donut-card,
  .report-option,
  .qr-owner-accordion,
  .qr-rental-damage-accordion,
  .qr-message-card,
  .notice,
  .check-row,
  .checklist-info,
  .switch-line,
  .trip-overview-card,
  .trip-step-content,
  .trip-step-accordion,
  .place-view-accordion,
  .public-trip-password-box,
  .trip-comment-form,
  .public-place-map-shell
) {
  border-color: var(--line);
  background-color: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] .usage-module-card,
html[data-theme="dark"] .usage-module-accordion {
  border-color: var(--line);
  background: var(--surface);
}

html[data-theme="dark"] .usage-module-icon {
  background: rgba(79, 140, 255, .16);
}

html[data-theme="dark"] .usage-rental-vehicle,
html[data-theme="dark"] .usage-rental-empty {
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--text);
}

html[data-theme="dark"] .usage-rental-vehicle small {
  color: var(--text);
}

html[data-theme="dark"] .dashboard-mode-card {
  border-color: #2b323d;
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] .dashboard-mode-card:hover {
  border-color: #414b59;
  background: var(--surface-raised);
}

html[data-theme="dark"] .dashboard-mode-card.active {
  border-color: #607b66;
  background: #18211b;
  box-shadow: inset 3px 0 0 var(--primary);
}

html[data-theme="dark"] .mode-icon {
  border-color: #303844;
  background: #171c24;
  color: #c3cad4;
}

html[data-theme="dark"] .dashboard-mode-card.active .mode-icon {
  border-color: #526b58;
  background: #202c23;
  color: var(--primary);
}

html[data-theme="dark"] .mode-lock {
  border-color: #343d49;
  background: #171c24;
  color: #e5e8ed;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .32);
}

html[data-theme="dark"] .dashboard-mode-card > :is(.mode-card-actions, .mode-toggle-status) {
  border-color: #292f39;
}

html[data-theme="dark"] .all-places-list > .place-row,
html[data-theme="dark"] .all-places-list > .place-view-accordion,
html[data-theme="dark"] .all-places-list > .place-view-accordion.form-accordion > summary.place-row {
  border-color: var(--line);
  background: #0d1118;
  color: var(--text);
}

html[data-theme="dark"] .all-places-list > .place-row-link:hover,
html[data-theme="dark"] .all-places-list > .place-row-link:focus-visible,
html[data-theme="dark"] .all-places-list > .place-view-accordion.form-accordion > summary.place-row:hover {
  border-color: #414b59;
  background: #151b24;
}

html[data-theme="dark"] .all-places-list > .place-view-accordion.form-accordion[open] > summary.place-row,
html[data-theme="dark"] .all-places-list > .place-view-accordion.form-accordion[open] > summary.place-row:hover {
  border-color: #607b66;
  background: #18211b;
}

html[data-theme="dark"] .place-view-accordion .form-accordion-body {
  border-color: var(--line);
  background: #0a0e14;
}

html[data-theme="dark"] .all-places-list .place-row-copy strong {
  color: var(--ink);
}

html[data-theme="dark"] .all-places-list .place-row-copy :is(small, p) {
  color: var(--muted);
}

html[data-theme="dark"] .place-share-link-card {
  border-color: var(--line);
  background: #11161e;
  color: var(--text);
}

html[data-theme="dark"] .place-share-link-card .share-link-main > span,
html[data-theme="dark"] .place-share-link-card .share-link-main > small {
  color: #b7bec8;
}

html[data-theme="dark"] .place-share-link-card .share-link-main strong {
  color: var(--ink);
}

html[data-theme="dark"] .place-share-link-card .share-link-url {
  color: #cbd1da;
}

html[data-theme="dark"] .assistant-primary-choice {
  border-color: #303844;
  background: #11161e;
  color: var(--text);
  box-shadow: none;
}

html[data-theme="dark"] .assistant-primary-choice-ai {
  border-color: #3b4b61;
  background: linear-gradient(135deg, #172232 0%, #11161e 58%);
}

html[data-theme="dark"] .assistant-primary-choice:hover,
html[data-theme="dark"] .assistant-primary-choice:focus-visible {
  border-color: #596678;
  background: #171d26;
}

html[data-theme="dark"] .assistant-primary-choice strong {
  color: #f3f5f8;
}

html[data-theme="dark"] .assistant-primary-choice > span:not(.assistant-choice-sparkles) {
  color: #a3acb9;
}

html[data-theme="dark"] .vehicle-file-filter-select select,
html[data-theme="dark"] .vehicle-file-search input {
  border-color: var(--line-strong);
  background: var(--surface-control);
  color: var(--text);
}

html[data-theme="dark"] .compact-filter-tabs {
  border-color: var(--line-strong);
  background: var(--surface-control);
}

html[data-theme="dark"] .compact-filter-tabs span {
  color: #9ba5b3;
}

html[data-theme="dark"] .compact-filter-tabs label.is-active span,
html[data-theme="dark"] .compact-filter-tabs input:checked + span {
  background: #29313c;
  color: #f1f3f6;
  box-shadow: none;
}

html[data-theme="dark"] .vehicle-file-search-button {
  border-color: #394351;
  background: #18202b;
  color: #d9dee5;
}

html[data-theme="dark"] .form-accordion:not([open]) .inspection-accordion-title em {
  background: #202731;
  color: #cbd1da;
}

html[data-theme="dark"] .form-accordion[open] > summary,
html[data-theme="dark"] .vehicle-edit-form .form-accordion[open] > summary,
html[data-theme="dark"] .vehicle-edit-form .form-accordion[open] > summary:hover {
  border-left-color: #7f9a85;
  background: #18211b;
  color: #f1f5f2;
}

html[data-theme="dark"] .vehicle-edit-form .form-accordion[open] > summary .accordion-progress,
html[data-theme="dark"] .form-accordion[open] > summary .accordion-progress {
  border-color: #3b4552;
  background: #202731;
  color: #d8dde4;
}

html[data-theme="dark"] .vehicle-gallery-count {
  border-color: #3b4552;
  background: #202731;
  color: #d8dde4;
}

html[data-theme="dark"] .vehicle-slideshow-setting {
  border-color: #3b4552;
  background: #171d26;
}

html[data-theme="dark"] .vehicle-photo-slot {
  border-color: #2d3540;
  background: #11161e;
}

html[data-theme="dark"] .vehicle-photo-title {
  color: #aab2bd;
}

html[data-theme="dark"] .vehicle-gallery-lightbox,
html[data-theme="dark"] .vehicle-gallery-new-preview {
  border-color: #2d3540;
  background: #090d13;
}

/* Einheitliche Akkordeonköpfe – überschreibt bewusst alle hellen Spezialvarianten. */
html[data-theme="dark"] details.form-accordion > summary {
  border-color: var(--line) !important;
  background: #11161e !important;
  color: #e7ebf0 !important;
}

html[data-theme="dark"] details.form-accordion > summary:hover {
  background: #171d26 !important;
}

html[data-theme="dark"] details.form-accordion[open] {
  border-color: #405847 !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
}

html[data-theme="dark"] details.form-accordion[open] > summary,
html[data-theme="dark"] details.form-accordion[open] > summary:hover {
  border-left: 4px solid #7f9a85 !important;
  background: #18211b !important;
  color: #f1f5f2 !important;
}

html[data-theme="dark"] details.form-accordion > summary .accordion-chevron {
  border-color: #7f8b9b !important;
}

html[data-theme="dark"] details.form-accordion[open] > summary .accordion-chevron {
  border-color: #a8bba9 !important;
}

html[data-theme="dark"] details.form-accordion > summary .accordion-progress {
  border-color: #3b4552 !important;
  background: #202731 !important;
  color: #cbd1da !important;
}

html[data-theme="dark"] details.form-accordion > summary .accordion-progress.is-complete {
  border-color: #315d45 !important;
  background: #10241a !important;
  color: #7ed7a2 !important;
}

html[data-theme="dark"] details.form-accordion > summary .inspection-accordion-title em,
html[data-theme="dark"] details.form-accordion > summary .status {
  border-color: #3b4552 !important;
  background: #202731 !important;
  color: #cbd1da !important;
}

html[data-theme="dark"] details.form-accordion > .form-accordion-body {
  border-top-color: #2a313c !important;
}

html[data-theme="dark"] body .vehicle-edit-form > details.form-accordion#sonderausstattung[open] > summary,
html[data-theme="dark"] body .vehicle-edit-form > details.form-accordion#sonderausstattung[open] > summary:hover {
  border-left-color: #7f9a85 !important;
  background: #18211b !important;
  color: #f1f5f2 !important;
}

html[data-theme="dark"] body .vehicle-edit-form #sonderausstattung[open] .equipment-accordion > summary,
html[data-theme="dark"] body .vehicle-edit-form #sonderausstattung[open] .equipment-accordion:not([open]) > summary,
html[data-theme="dark"] body .vehicle-edit-form #sonderausstattung[open] .equipment-accordion:not([open]) > summary:hover {
  border-color: #2d3540 !important;
  background: #11161e !important;
  color: #e7ebf0 !important;
}

html[data-theme="dark"] body .vehicle-edit-form #sonderausstattung[open] .equipment-accordion[open] > summary,
html[data-theme="dark"] body .vehicle-edit-form #sonderausstattung[open] .equipment-accordion[open] > summary:hover {
  border-left-color: #7f9a85 !important;
  background: #18211b !important;
  color: #f1f5f2 !important;
}

html[data-theme="dark"] body .vehicle-edit-form #sonderausstattung .equipment-item {
  border-color: #2d3540 !important;
  background: #11161e !important;
}

html[data-theme="dark"] body .vehicle-edit-form #sonderausstattung > summary .accordion-progress {
  border-color: #3b4552 !important;
  background: #202731 !important;
  color: #cbd1da !important;
}

html[data-theme="dark"] .mode-switch {
  border-color: #3b4552;
  background: #242b35;
}

html[data-theme="dark"] .mode-switch i {
  background: #d9dde3;
}

html[data-theme="dark"] :is(
  input,
  select,
  textarea,
  .readonly-field,
  .readonly-grid > span,
  .sale-expose-rich-editor,
  .sale-expose-description-editor,
  .compact-filter-tabs,
  .business-vehicle-filter
) {
  border-color: var(--line-strong);
  background-color: var(--surface-control);
  color: var(--text);
}

html[data-theme="dark"] :is(input, textarea)::placeholder {
  color: var(--muted);
}

html[data-theme="dark"] :is(
  .file-picker-button,
  .inventory-status-button,
  .vehicle-file-search-button,
  .social-login-button,
  .legal-check,
  .checkbox-line,
  .vehicle-sale-option,
  .check-grid label
) {
  border-color: var(--line-strong);
  background-color: var(--surface-control);
  color: var(--text);
}

html[data-theme="dark"] .button-secondary {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--ink);
}

html[data-theme="dark"] .button-secondary:hover:not(:disabled):not(.is-waiting):not(.is-loading) {
  border-color: var(--primary-hover);
  background: #263228;
  color: #fff;
}

html[data-theme="dark"] .button-secondary:is(:disabled, .is-waiting, .is-loading) {
  border-color: var(--line-strong);
  background: var(--surface-active);
  color: var(--muted);
}

html[data-theme="dark"] :is(
  .form-accordion summary,
  .place-row,
  .vehicle-delete-zone summary,
  .mobile-mode-accordion-toggle,
  .qr-contact-disclosure summary,
  .qr-rental-unlock summary
) {
  border-color: var(--line);
  background-color: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] :is(
  .form-accordion summary:hover,
  .sidebar-logout:hover,
  .theme-toggle:hover,
  .dashboard-deadline-row:hover,
  .dashboard-shortcut:hover,
  .quick-action:hover
) {
  background-color: var(--surface-active);
}

html[data-theme="dark"] :is(
  .field-placeholder,
  .readonly-empty,
  .place-photo-placeholder,
  .inventory-photo-placeholder,
  .finder-placeholder,
  .assistant-file-preview-frame,
  .vehicle-photo-preview,
  .upload-progress-track,
  .assistant-progress-track,
  .demo-start-progress-track
) {
  border-color: var(--line);
  background-color: var(--surface-active);
  color: var(--muted);
}

html[data-theme="dark"] :is(
  .status-soft,
  .mode-settings-chip,
  .dashboard-product-chip,
  .inventory-meta span,
  .qr-mode-pill,
  .assistant-breadcrumbs span,
  .trip-meta-strip span,
  .place-trip-badge,
  .public-trip-hero-pills span
) {
  border-color: #345176;
  background-color: #18202b;
  color: #d2d7df;
}

html[data-theme="dark"] .document-visibility-badges > .status {
  border-color: transparent !important;
  background-color: transparent !important;
  color: var(--text) !important;
}

html[data-theme="dark"] :is(
  .demo-banner,
  .dashboard-security-notice,
  .license-lock-banner,
  .dashboard-overdue-banner,
  .dashboard-service-approval-banner,
  .account-key-notice,
  .qr-safety-notice,
  .qr-key-found-compact,
  .qr-pet-notice,
  .notice-warning
) {
  border-color: #5d4b22;
  background-color: #2b2415;
  color: #f4d78c;
}

html[data-theme="dark"] body .qr-pet-notice :is(strong, .qr-pet-name) {
  color: #f7e2a7;
}

html[data-theme="dark"] body .qr-pet-phone {
  background: #151713;
  color: #f4d78c;
}

html[data-theme="dark"] body .license-lock-banner.is-warning {
  border-color: #4b4128;
  background: #171812;
  color: #e4d6a2;
}

html[data-theme="dark"] body .license-lock-banner.is-warning strong {
  color: #f0e4bb;
}

html[data-theme="dark"] body .license-lock-banner.is-warning p {
  color: #b9ad83;
}

html[data-theme="dark"] body .license-lock-banner.is-warning .license-lock-icon {
  border-color: #5d4b22;
  background: #211d14;
  color: #e3bd63;
  box-shadow: none;
}

html[data-theme="dark"] :is(
  .danger-card,
  .alert-error,
  .notice-danger,
  .vehicle-delete-zone,
  .admin-product-delete,
  .vin-warning
) {
  border-color: #68353b;
  background-color: #2b171c;
  color: #ffb4ba;
}

html[data-theme="dark"] body .admin-product-delete strong {
  color: #ff9ba2;
}

html[data-theme="dark"] body .admin-product-delete span {
  color: #d8a2a6;
}

html[data-theme="dark"] body .qr-product-url > span {
  border-color: var(--line);
  background: var(--surface-control);
  color: var(--text);
}

html[data-theme="dark"] body .qr-product-url > span strong {
  color: var(--muted);
}

html[data-theme="dark"] body .qr-product-url > span a {
  color: var(--ink);
}

html[data-theme="dark"] body .mode-settings-actions,
html[data-theme="dark"] body .checklist-settings-dialog > .mode-settings-actions,
html[data-theme="dark"] body .workshop-order-panel .mode-settings-actions,
html[data-theme="dark"] body .rental-settings-panel .mode-settings-actions {
  border-top-color: var(--line);
  background: var(--surface);
}

html[data-theme="dark"] body .workshop-order-panel .workshop-point {
  border-color: var(--line);
  background: var(--surface-raised);
}

html[data-theme="dark"] body .business-relationship-logo {
  border-color: var(--line);
  background: var(--surface-control);
}

html[data-theme="dark"] body .business-relationship-logo-placeholder,
html[data-theme="dark"] body .business-relationship-main .verified-inline-badge {
  border-color: #345176;
  background: #18202b;
  color: var(--primary);
}

html[data-theme="dark"] body .business-traffic-light {
  border-color: #5d4b22;
  background: #2b2415;
  color: #f4d78c;
}

html[data-theme="dark"] body .business-traffic-light i {
  box-shadow: none;
}

html[data-theme="dark"] body .business-traffic-light.is-accepted {
  border-color: #285942;
  background: #122a20;
  color: #91ddb5;
}

html[data-theme="dark"] body .business-traffic-light.is-rejected {
  border-color: #68353b;
  background: #2b171c;
  color: #ff9ba2;
}

html[data-theme="dark"] :is(.alert-success, .business-code-result.is-success) {
  border-color: #285942;
  background-color: #122a20;
  color: #91ddb5;
}

html[data-theme="dark"] :is(
  h1,
  h2,
  h3,
  strong,
  .auth-title,
  .trip-cover-copy strong,
  .public-trip-hero-copy h1,
  .sale-expose-hero h2
) {
  color: var(--ink);
}

html[data-theme="dark"] :is(
  small,
  .muted,
  .field-help,
  .sidebar-user small,
  .vehicle-completeness-label,
  .inventory-meta,
  .cost-legend-row
) {
  color: var(--muted);
}

html[data-theme="dark"] .leaflet-layer,
html[data-theme="dark"] .leaflet-control-zoom-in,
html[data-theme="dark"] .leaflet-control-zoom-out,
html[data-theme="dark"] .leaflet-control-attribution {
  filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9);
}

html[data-theme="dark"] :is(.mobile-map-touch-hint, .desktop-map-scroll-hint) {
  border-color: rgba(255, 255, 255, .14);
  background: rgba(19, 21, 19, .94);
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .42);
}

html[data-theme="dark"] :is(img, video, .vehicle-photo-preview, .public-expose-gallery) {
  color-scheme: normal;
}

@media (max-width: 900px) {
  .sidebar-session-actions {
    grid-template-columns: minmax(0, 1fr) 42px;
  }
}

html[data-theme="dark"] body .product-row-icon,
html[data-theme="dark"] body .product-row-icon.is-sticker {
  border: 1px solid var(--line-strong);
  background: var(--surface-active);
  color: var(--primary);
}

html[data-theme="dark"] body .product-explain-label {
  border: 1px solid var(--line-strong);
  background: var(--surface-active);
  color: var(--primary);
}

html[data-theme="dark"] body .product-explain-copy li::before {
  border: 1px solid #315d45;
  background: #10241a;
  color: #7ed7a2;
}

html[data-theme="dark"] body :is(
  .place-share-switch,
  .mode-switch,
  .switch-line i,
  .sale-expose-toggle-control,
  .admin-shipped-toggle i,
  .qr-check-toggle span
) {
  border-color: var(--switch-border);
  background: var(--switch-track);
  box-shadow: inset 0 0 0 1px var(--switch-border);
}

html[data-theme="dark"] body :where(
  .legal-check,
  .checkbox-line,
  .vehicle-checkbox-option,
  .vehicle-sale-option,
  .stolen-public-options .check-grid label
):has(> input[type="checkbox"])::before {
  background: var(--switch-track);
  box-shadow: inset 0 0 0 1px var(--switch-border);
}

html[data-theme="dark"] body .place-share-switch::after,
html[data-theme="dark"] body .mode-switch i,
html[data-theme="dark"] body .switch-line i::after,
html[data-theme="dark"] body .sale-expose-toggle-control::after,
html[data-theme="dark"] body .admin-shipped-toggle i::after,
html[data-theme="dark"] body .qr-check-toggle span::after {
  background: var(--switch-thumb);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .45);
}

html[data-theme="dark"] body :where(
  .legal-check,
  .checkbox-line,
  .vehicle-checkbox-option,
  .vehicle-sale-option,
  .stolen-public-options .check-grid label
):has(> input[type="checkbox"])::after {
  background: var(--switch-thumb);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .45);
}

html[data-theme="dark"] body :is(
  .place-share-toggle input:checked + .place-share-switch,
  .mode-switch.is-on,
  .dashboard-mode-card.active .mode-switch,
  .switch-line input:checked + i,
  .sale-expose-option-main input[type="checkbox"]:checked + .sale-expose-toggle-control,
  .sale-expose-inline-toggle input[type="checkbox"]:checked + .sale-expose-toggle-control,
  .admin-shipped-toggle input:checked + i,
  .admin-shipped-toggle.is-static i,
  .qr-check-toggle input:checked + span
) {
  border-color: var(--switch-active);
  background: var(--switch-active);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

html[data-theme="dark"] body :where(
  .legal-check,
  .checkbox-line,
  .vehicle-checkbox-option,
  .vehicle-sale-option,
  .stolen-public-options .check-grid label
):has(> input[type="checkbox"]:checked)::before {
  background: var(--switch-active);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}

@media (max-width: 520px) {
  html[data-theme="dark"] .mobile-mode-accordion,
  html[data-theme="dark"] .mobile-mode-accordion-toggle {
    border-color: var(--line);
    background: #0c1016;
    color: var(--ink);
  }

  html[data-theme="dark"] .mobile-mode-accordion-chevron {
    background: #1a2029;
    color: #b7bfca;
  }

  html[data-theme="dark"] .mobile-mode-accordion.is-open > .mobile-mode-accordion-toggle {
    background: #18211b;
    color: #dce8de;
  }

  html[data-theme="dark"] .mobile-mode-accordion:has(> .dashboard-mode-card.active) {
    border-color: #607b66;
    box-shadow: inset 0 0 0 1px #344a39;
  }
}

html[data-theme="dark"] body span.accordion-progress {
  border-color: #414b59 !important;
  background-color: #202731 !important;
  background-image: none !important;
  color: #d1d6de !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body span.accordion-progress.is-complete {
  border-color: #315d45 !important;
  background-color: #10241a !important;
  background-image: none !important;
  color: #7ed7a2 !important;
}

html[data-theme="dark"] body .upload-choice > span:not(.upload-choice-preview),
html[data-theme="dark"] body .upload-choice > .qr-public-icon {
  border: 1px solid var(--line-strong);
  background: var(--surface-active);
  color: var(--primary);
}

html[data-theme="dark"] body .app-toast {
  border-color: #394351;
  background: #151a22;
  color: #d7dce3;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .42);
}

html[data-theme="dark"] body .app-toast.is-success {
  border-color: #315d45;
  background: #10241a;
}

html[data-theme="dark"] body .app-toast.is-error {
  border-color: #68353b;
  background: #2b171c;
}

html[data-theme="dark"] body .app-toast.is-info {
  border-color: #3b4b61;
  background: #151e2a;
}

html[data-theme="dark"] body .app-toast.is-warning {
  border-color: #5d4b22;
  background: #2b2415;
}

html[data-theme="dark"] body .app-toast-copy,
html[data-theme="dark"] body .app-toast-copy strong {
  color: #eef1f5;
}

html[data-theme="dark"] body .app-toast-close {
  background: #202731;
  color: #d7dce3;
}

html[data-theme="dark"] body .app-toast-close:hover {
  background: #2a323e;
}

html[data-theme="dark"] body .inventory-stat {
  border-color: #2d3540;
  background: #11161e;
  box-shadow: none;
}

html[data-theme="dark"] body .inventory-stat > span {
  color: #a3acb9;
}

html[data-theme="dark"] body .inventory-stat strong {
  color: #eef1f5;
}

html[data-theme="dark"] body .inventory-stat strong.is-positive {
  color: #7ed7a2;
}

html[data-theme="dark"] body .inventory-weight-summary > span,
html[data-theme="dark"] body .technical-payload {
  border-color: #2d3540;
  background: #151a22;
}

html[data-theme="dark"] body .inventory-weight-summary > span > strong,
html[data-theme="dark"] body .technical-payload > strong {
  color: #9fa8b5;
}

html[data-theme="dark"] body .inventory-weight-summary > span > :is(output, span),
html[data-theme="dark"] body .technical-payload > span {
  color: #e4e8ed;
}

html[data-theme="dark"] body .sale-expose-master-panel,
html[data-theme="dark"] body .stolen-master-panel {
  border-color: #303844;
  background: #11161e;
}

html[data-theme="dark"] body .sale-expose-master-toggle {
  color: #eef1f5;
}

html[data-theme="dark"] body .sale-expose-master-toggle small {
  color: #a3acb9;
}

html[data-theme="dark"] body .sale-expose-disabled-message {
  border-color: #394351;
  background: #151a22;
  color: #aab2bd;
}

html[data-theme="dark"] body .sale-expose-disabled-message strong {
  color: #e7ebf0;
}

html[data-theme="dark"] body .place-share-switch {
  border-color: var(--switch-border);
  background: var(--switch-track);
  box-shadow: inset 0 0 0 1px var(--switch-border);
}

html[data-theme="dark"] body .place-share-switch::after {
  background: var(--switch-thumb);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .45);
}

html[data-theme="dark"] body .place-share-toggle input:checked + .place-share-switch {
  background: var(--switch-active);
}

html[data-theme="dark"] body .vehicle-sale-expose .sale-expose-master-panel {
  border-color: #303844 !important;
  background: #11161e !important;
}

html[data-theme="dark"] body .vehicle-sale-expose .sale-expose-master-toggle strong {
  color: #eef1f5 !important;
}

html[data-theme="dark"] body .vehicle-sale-expose .sale-expose-master-toggle small {
  color: #a3acb9 !important;
}

html[data-theme="dark"] body .sale-expose-profile-badge {
  border: 1px solid #414b59;
  background: #202731;
  color: #d1d6de;
}

html[data-theme="dark"] body .sale-expose-format-toolbar {
  border-color: #394351;
  background: #171d26;
}

html[data-theme="dark"] body .sale-expose-format-toolbar button {
  background: transparent;
  color: #cbd1da;
}

html[data-theme="dark"] body .sale-expose-format-toolbar button:hover,
html[data-theme="dark"] body .sale-expose-format-toolbar button[aria-pressed="true"] {
  background: #29313c;
  color: #f1f3f6;
}

html[data-theme="dark"] body .vehicle-delete-summary {
  border-color: #68353b;
  background: #241316;
  color: #efb2b5;
}

html[data-theme="dark"] body .vehicle-delete-summary h2 {
  color: #ff9299;
}

html[data-theme="dark"] body .vehicle-delete-summary :is(ul, li, p) {
  color: #e2a1a5;
}

html[data-theme="dark"] body .vehicle-delete-confirm {
  border-color: #343d49;
  background: #11161e;
}

html[data-theme="dark"] body .referral-status-item > strong {
  border-color: #3b4552;
  background: #202731;
  color: #d8dde4;
}

html[data-theme="dark"] body .referral-progress li::before {
  box-shadow: 0 0 0 5px #11161e;
}

@media (max-width: 760px) {
  html[data-theme="dark"] body .referral-progress li::before {
    box-shadow: 0 0 0 4px #11161e;
  }
}

html[data-theme="dark"] body .cost-kpi {
  border-color: #2d3540;
  background: #11161e;
  box-shadow: none;
}

html[data-theme="dark"] body .cost-kpi span {
  color: #9fa8b5;
}

html[data-theme="dark"] body .cost-kpi strong {
  color: #eef1f5;
}

html[data-theme="dark"] body .cost-kpi small {
  color: #a3acb9;
}

html[data-theme="dark"] body :is(.cost-chart-main, .cost-donut-card) {
  border-color: #2d3540;
  background: #11161e;
  box-shadow: none;
}

html[data-theme="dark"] body .cost-month-chart {
  background: linear-gradient(180deg, #151b24, #0d1118);
}

html[data-theme="dark"] body .cost-month-bar :is(span, em) {
  color: #aab2bd;
}

html[data-theme="dark"] body .cost-donut > div {
  background: #151a22;
}

html[data-theme="dark"] body .cost-donut > div span {
  color: #9fa8b5;
}

html[data-theme="dark"] body .cost-donut > div strong {
  color: #eef1f5;
}

html[data-theme="dark"] body .cost-legend-row {
  border-color: #303844;
  background: #151a22;
}

html[data-theme="dark"] body .cost-legend-row span {
  color: #b7bec8;
}

html[data-theme="dark"] body .cost-legend-row strong {
  color: #e4e8ed;
}

html[data-theme="dark"] body .cost-legend-row em {
  color: #a3acb9;
}

html[data-theme="dark"] body :is(.deadline-icon, .shortcut-icon, .dashboard-product-chip > .product-chip-icon, .dashboard-product-chip.is-empty > span) {
  border: 1px solid #343d49;
  background: #202731;
  color: #8fb7f5;
}

html[data-theme="dark"] body .deadline-calendar {
  border-color: #3b4552;
  background: #202731;
  color: #e4e8ed;
}

html[data-theme="dark"] body .deadline-calendar strong {
  background: #29362f;
  color: #b9cebf;
}

html[data-theme="dark"] body .deadline-badge {
  border: 1px solid #3b4552;
  background: #202731;
  color: #cbd1da;
}

html[data-theme="dark"] body .deadline-badge.is-warning {
  border-color: #5d4b22;
  background: #2b2415;
  color: #f0cc75;
}

html[data-theme="dark"] body .deadline-badge.is-danger {
  border-color: #68353b;
  background: #2b171c;
  color: #ff9ba2;
}

html[data-theme="dark"] body :is(.deadline-badge.is-soft, .deadline-badge.is-neutral) {
  border-color: #3b4552;
  background: #202731;
  color: #aab2bd;
}

html[data-theme="dark"] body .dashboard-product-chip em {
  border: 1px solid #315d45;
  background: #10241a;
  color: #7ed7a2;
}

html[data-theme="dark"] body .dashboard-product-chip em.is-paused {
  border-color: #3b4552;
  background: #202731;
  color: #aab2bd;
}

html[data-theme="dark"] body .vehicle-completeness span strong i {
  border: 1px solid #315d45;
  background: #10241a;
  color: #7ed7a2;
}

html[data-theme="dark"] body .vehicle-completeness-track {
  background: #252c36;
}

html[data-theme="dark"] body .admin-tabs a {
  border-color: #394351;
  background: #171d26;
  color: #b7bec8;
}

html[data-theme="dark"] body .admin-tabs a:hover {
  border-color: #505c6c;
  background: #202731;
  color: #eef1f5;
}

html[data-theme="dark"] body .admin-tabs a.active {
  border-color: #53657d;
  background: #202a38;
  color: #9fc0f3;
}

html[data-theme="dark"] body .readonly-grid > span {
  border-color: #303844;
  background: #151a22;
  color: #d8dde4;
}

html[data-theme="dark"] body .readonly-grid > span > strong {
  color: #9fa8b5;
}

html[data-theme="dark"] body .vehicle-sale-summary {
  border-color: var(--line);
  background: var(--surface-active);
  color: var(--text);
}

html[data-theme="dark"] body .vehicle-sale-summary strong {
  color: var(--ink);
}

html[data-theme="dark"] body .ki-assistant-card {
  border-color:var(--line);
  background:var(--surface);
  box-shadow:var(--shadow-sm);
}
html[data-theme="dark"] body .ki-assistant-card.is-locked { background:var(--surface); }
html[data-theme="dark"] body .ki-assistant-card.is-locked .ki-assistant-mark { color:#a7b5c6; background:#263342; }
html[data-theme="dark"] body .ki-assistant-lock { border-color:#72591f; background:#2b2518; }
html[data-theme="dark"] body .ki-assistant-lock-icon { border-color:#72591f; color:#f0bd57; background:#211d14; }
html[data-theme="dark"] body .ki-assistant-lock strong { color:#f5ca75; }
html[data-theme="dark"] body .ki-assistant-lock p { color:#d8b56d; }
html[data-theme="dark"] body .ki-assistant-input-shell { border-color:var(--line); background:var(--surface-active); box-shadow:none; }
html[data-theme="dark"] body .ki-assistant-input-shell:focus-within { border-color:#4c91dc; box-shadow:0 0 0 4px rgba(53,133,220,.13); }
html[data-theme="dark"] body .ki-assistant-input-shell textarea,
html[data-theme="dark"] body .ki-assistant-input-shell textarea:focus,
html[data-theme="dark"] body .ki-assistant-input-shell textarea:focus-visible { border:0; outline:0; background:transparent; box-shadow:none; }
html[data-theme="dark"] body .ki-assistant-card.is-query-limit .ki-assistant-input-shell,
html[data-theme="dark"] body .ki-assistant-card.is-query-limit .ki-assistant-input-shell:focus-within { border-color:#f97066; box-shadow:0 0 0 4px rgba(249,112,102,.12); }
html[data-theme="dark"] body .ki-assistant-card.is-query-limit .ki-assistant-input-meta > span { color:#fda29b; }
html[data-theme="dark"] body .ki-assistant-icon-button { color:#b8c9dc; background:#202d3d; }
html[data-theme="dark"] body .ki-assistant-icon-button:hover { color:#85c9ff; background:#26394e; }
html[data-theme="dark"] body .ki-assistant-send:disabled { color:#697686; background:#27303b; }
html[data-theme="dark"] body .ki-assistant-response { border-color:#35465b; background:rgba(12,19,28,.72); }
html[data-theme="dark"] body .ki-assistant-request,
html[data-theme="dark"] body .ki-assistant-request::before { border-color:#526277; background:#182331; }
html[data-theme="dark"] body .ki-assistant-highlight { border-color:#365f83; background:linear-gradient(135deg,rgba(38,119,202,.18),rgba(40,184,209,.1) 72%,rgba(114,83,215,.1)); }
html[data-theme="dark"] body .ki-assistant-safety { background:#352c19; color:#f2d083; }

html[data-theme="dark"] body .ki-assistant-card.is-locked .ki-assistant-mark,
html[data-theme="dark"] body .ki-assistant-icon-button,
html[data-theme="dark"] body .ki-assistant-icon-button:hover,
html[data-theme="dark"] body .ki-assistant-send:disabled,
html[data-theme="dark"] body .ki-assistant-response,
html[data-theme="dark"] body .ki-assistant-request,
html[data-theme="dark"] body .ki-assistant-request::before,
html[data-theme="dark"] body .ki-assistant-highlight {
  border-color: var(--line) !important;
  background: var(--surface-active) !important;
  color: var(--text) !important;
}

@media (max-width: 900px) {
  html[data-theme="dark"] body .mobile-appbar {
    border-bottom-color: var(--line);
    background: rgba(14, 21, 17, .97);
  }

  html[data-theme="dark"] body .mobile-menu-button {
    background: transparent;
    color: var(--ink);
  }

  html[data-theme="dark"] body .mobile-menu-button span {
    background: #d8dde4;
  }

  html[data-theme="dark"] body .mobile-user-link {
    color: #d8dde4;
  }
}

/* App-Refresh: Formulare und Uploads bleiben im Darkmode neutral statt Camper-ID-blau oder weiss. */
html[data-theme="dark"] body.app-body :is(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .readonly-field,
  .readonly-grid > span,
  .sale-expose-rich-editor,
  .sale-expose-description-editor,
  .compact-filter-tabs,
  .business-vehicle-filter
) {
  border-color: var(--line-strong) !important;
  background-color: var(--surface-control) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] body.app-body .legacy-content-modal .place-memory .readonly-field {
  background-color: transparent !important;
}

html[data-theme="dark"] body.app-body :is(input, textarea)::placeholder {
  color: var(--muted);
  opacity: 1;
}

html[data-theme="dark"] body.app-body select option {
  background: var(--surface-control);
  color: var(--text);
}

html[data-theme="dark"] body.app-body :is(
  .upload-choice,
  .file-picker,
  .file-preview-card,
  .assistant-file-preview-frame,
  .assistant-dropzone,
  .vehicle-photo-dropzone
) {
  border-color: var(--line-strong) !important;
  background: var(--surface-control) !important;
  color: var(--text) !important;
  box-shadow: none;
}

html[data-theme="dark"] body.app-body :is(.upload-choice, .file-picker):focus-within,
html[data-theme="dark"] body.app-body :is(.upload-choice, .file-picker):hover {
  border-color: var(--primary) !important;
  background: var(--surface-raised) !important;
}

html[data-theme="dark"] body.app-body :is(
  .upload-choice > span:not(.upload-choice-preview),
  .upload-choice > .qr-public-icon,
  .upload-choice-file-icon,
  .upload-choice-file-image,
  .file-picker-button
) {
  border-color: var(--line-strong) !important;
  background: var(--surface-active) !important;
  color: var(--primary) !important;
}

html[data-theme="dark"] body.app-body .upload-choice-file {
  border-color: var(--line) !important;
  background: var(--surface-raised) !important;
  color: var(--text) !important;
  box-shadow: none;
}

html[data-theme="dark"] body.app-body .upload-choice-thumb img {
  border-color: var(--line-strong);
  background: var(--surface-active) !important;
  box-shadow: none;
}

html[data-theme="dark"] body.app-body .vehicle-photo-slot {
  border-color: var(--line) !important;
  background: var(--surface) !important;
}

html[data-theme="dark"] body.app-body :is(
  .upload-choice strong,
  .upload-choice-file-name,
  .file-picker-name
) {
  color: var(--text);
}

/* Im Dark Mode bleibt die Navigation schwarz; Gruen dient nur als Akzent. */
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .mobile-tabbar {
  background: #050605;
}

html[data-theme="dark"] .dashboard-mode-card.active {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}

html[data-theme="dark"] .dashboard-mode-card.active .mode-icon {
  border-color: #303844;
  background: #171c24;
  color: #c3cad4;
}

@media (max-width: 900px) {
  html[data-theme="dark"] body .mobile-appbar,
  html[data-theme="dark"] body .sidebar,
  html[data-theme="dark"] body .mobile-tabbar {
    background: #050605;
  }
}

@media (max-width: 520px) {
  html[data-theme="dark"] .mobile-mode-accordion:has(> .dashboard-mode-card.active) {
    border-color: var(--line);
    box-shadow: none;
  }

  html[data-theme="dark"] .mobile-mode-accordion:has(> .dashboard-mode-card.active) > .mobile-mode-accordion-toggle .mode-icon,
  html[data-theme="dark"] .mobile-mode-accordion.is-open > .mobile-mode-accordion-toggle {
    border-color: var(--line);
    background: #171c24;
    color: var(--ink);
  }
}

/* App-Refresh: Dark-Variablen muessen direkt am Body die hellen lokalen Werte ersetzen. */
html[data-theme="dark"] body.app-body {
  --soft: #090a09;
  --surface: #131513;
  --surface-raised: #191b19;
  --surface-active: #202320;
  --surface-control: #1a1c1a;
  --line: #2b2e2b;
  --line-strong: #414541;
  --line-soft: #222422;
  --accordion-bg: #131513;
  --accordion-hover-bg: #191b19;
  --accordion-active-bg: #202320;
  --accordion-active-hover-bg: #252825;
  --accordion-active-line: #454a45;
  --shadow-sm: none;
  --shadow-md: 0 18px 48px rgba(0, 0, 0, .34);
  background: var(--soft);
  color: var(--text);
}

html[data-theme="dark"] body.app-body :is(.app-main, .app-content) {
  background: var(--soft);
  color: var(--text);
}

html[data-theme="dark"] body.app-body .app-modal::backdrop {
  background: rgba(0, 0, 0, .66);
}

@media (max-width: 700px) {
  html[data-theme="dark"] body.app-body .mobile-dialog-overlay {
    background: rgba(0, 0, 0, 0);
  }

  html[data-theme="dark"] body.app-body .mobile-dialog-overlay.is-visible {
    background: rgba(0, 0, 0, .66);
  }
}

html[data-theme="dark"] body.app-body .mobile-create-sheet {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 -18px 54px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .05);
}

html[data-theme="dark"] body.app-body .mobile-create-drag-handle {
  background: var(--surface);
}

html[data-theme="dark"] body.app-body .mobile-create-drag-handle span {
  background: var(--line-strong);
}

html[data-theme="dark"] body.app-body .mobile-create-header span {
  color: var(--muted);
}

html[data-theme="dark"] body.app-body .mobile-create-header h2 {
  color: var(--ink);
}

html[data-theme="dark"] body.app-body .mobile-create-grid a {
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: none;
}

html[data-theme="dark"] body.app-body .mobile-create-grid a:hover {
  border-color: var(--line-strong);
  background: var(--surface-active);
}

html[data-theme="dark"] body.app-body .mobile-create-grid .nav-icon {
  color: var(--primary);
}

html[data-theme="dark"] body.app-body .mobile-create-grid a::after {
  border-color: var(--muted);
}

@media (max-width: 900px) {
  html[data-theme="dark"] body.app-body .mobile-create-grid a.mobile-create-active-trip {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
  }

  html[data-theme="dark"] body.app-body .mobile-create-grid a.mobile-create-active-trip:hover {
    border-color: var(--primary-hover);
    background: var(--primary-hover);
  }

  html[data-theme="dark"] body.app-body .mobile-create-grid a.mobile-create-active-trip :is(.nav-icon, strong) {
    color: #fff;
  }

  html[data-theme="dark"] body.app-body .mobile-create-grid a.mobile-create-active-trip small {
    color: rgba(255, 255, 255, .78);
  }

  html[data-theme="dark"] body.app-body .mobile-create-grid a.mobile-create-active-trip::after {
    border-color: rgba(255, 255, 255, .86);
  }
}

html[data-theme="dark"] body.app-body :is(.card, .section-card, .settings-panel) {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] body.app-body :is(
  .dashboard-kpis,
  .dashboard-kpis a,
  .product-row,
  .dashboard-product-chip,
  .personalization-option,
  .settings-emoji-option
) {
  border-color: var(--line-soft);
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] body.app-body :is(
  .dashboard-kpis a:hover,
  .product-row:hover,
  .personalization-option:hover,
  .settings-emoji-option:hover
) {
  background: var(--surface-raised);
}

html[data-theme="dark"] body.app-body :is(
  .dashboard-access-panel > summary::after,
  .mode-icon,
  .dashboard-mode-card.active .mode-icon,
  .product-row-icon,
  .product-row-icon.is-sticker,
  .dashboard-product-chip > .product-chip-icon,
  .dashboard-product-chip.is-empty > span,
  .deadline-icon,
  .shortcut-icon
) {
  border-color: var(--line-strong);
  background: var(--surface-active);
  color: var(--primary);
}

html[data-theme="dark"] body.app-body .camper-travel-latest {
  background: var(--surface-active) !important;
}

html[data-theme="dark"] body.app-body .settings-accordion .form-accordion-body,
html[data-theme="dark"] body.app-body .mobile-mode-accordion > .dashboard-mode-card {
  background: var(--surface-raised);
}

html[data-theme="dark"] body.app-body :is(.sidebar, .mobile-appbar, .mobile-tabbar),
html[data-theme="dark"] body.app-body .site-footer {
  border-color: rgba(255, 255, 255, .10);
  background: #050605;
}

html[data-theme="dark"] body.app-body .mobile-tabbar {
  border-top-color: rgba(255, 255, 255, .16);
  box-shadow: 0 -5px 18px rgba(0, 0, 0, .34);
}

html[data-theme="dark"] body.app-body .mobile-tabbar :is(a, button) {
  color: rgba(249, 250, 247, .78);
}

html[data-theme="dark"] body.app-body .mobile-tabbar :is(a, button) .nav-icon {
  color: currentColor;
}

html[data-theme="dark"] body.app-body .mobile-tabbar a.is-active {
  background: rgba(255, 255, 255, .11);
  color: #fff;
}

html[data-theme="dark"] body.app-body .mobile-tabbar .mobile-tabbar-create > .nav-icon {
  background: var(--primary);
  color: #fff;
}

html[data-theme="dark"] body.app-body .mobile-appbar-brand .brand img {
  content: url("/assets/img/Logo_myQAMPR_on_dark.png");
}

html[data-theme="dark"] body.app-body .mobile-tabbar .mobile-tabbar-create > .nav-icon {
  box-shadow: 0 8px 20px rgba(0, 0, 0, .38), 0 0 0 4px #050605;
}

html[data-theme="dark"] body.app-body .site-footer :is(a, span, p) {
  color: rgba(238, 243, 239, .72);
}

html[data-theme="dark"] body.app-body .site-footer a:hover {
  color: #fff;
}

@media (max-width: 900px) {
  html[data-theme="dark"] body.app-body .section-card:has(> .list > .document-accordion),
  html[data-theme="dark"] body.app-body :is(.mobile-mode-accordion-toggle, .mobile-mode-accordion.is-open > .mobile-mode-accordion-toggle) {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
  }
}

/* App-Refresh: gruppierte Listen duerfen keine fest verdrahteten Lightmode-Flaechen behalten. */
html[data-theme="dark"] body.app-body :is(
  .form-accordion,
  .form-accordion > summary,
  .form-accordion > .form-accordion-body,
  .record-overview-list,
  .record-overview-list > .record-overview-card,
  .vehicle-edit-form,
  .vehicle-edit-form > .record-overview-card,
  .all-places-list,
  .all-places-list > .place-row-link,
  .all-places-list > .place-view-accordion.form-accordion,
  .all-places-list > .legacy-overview-card.place-view-accordion
) {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] body.app-body .form-accordion[open] > summary {
  background: var(--surface-active) !important;
  color: var(--ink) !important;
}

html[data-theme="dark"] body.app-body .form-accordion:not([open]) > summary:hover,
html[data-theme="dark"] body.app-body .record-overview-card .legacy-overview-card-head:hover,
html[data-theme="dark"] body.app-body .all-places-list > .place-row-link:hover,
html[data-theme="dark"] body.app-body .all-places-list > .place-row-link:focus-visible {
  background: var(--surface-raised) !important;
}

html[data-theme="dark"] body.app-body :is(
  .record-overview-card .legacy-card-summary,
  .inspection-accordion-title,
  .all-places-list .place-row-copy
) {
  color: var(--text);
}

html[data-theme="dark"] body.app-body :is(
  .record-overview-card .legacy-card-summary strong,
  .record-overview-card .legacy-card-summary > span:first-child,
  .inspection-accordion-title strong,
  .all-places-list .place-row-copy strong
) {
  color: var(--ink);
}

html[data-theme="dark"] body.app-body :is(
  .record-overview-card .legacy-card-summary small,
  .record-overview-card .legacy-card-summary .service-accordion-meta,
  .inspection-accordion-title small,
  .all-places-list .place-row-copy small,
  .all-places-list .place-row-copy p
) {
  color: var(--muted);
}

html[data-theme="dark"] body.app-body .inspection-accordion-title .service-due-badge {
  border: 1px solid var(--line-strong);
  background: var(--surface-active) !important;
  color: var(--muted) !important;
}

html[data-theme="dark"] body.app-body .inspection-accordion-title .service-due-badge.is-danger {
  border-color: #68353b;
  background: #2b171c !important;
  color: #ff9ba2 !important;
}

html[data-theme="dark"] body.app-body .inspection-accordion-title .service-due-badge.is-warning {
  border-color: #5d4b22;
  background: #2b2415 !important;
  color: #f0cc75 !important;
}

html[data-theme="dark"] body.app-body .inspection-accordion-title :is(
  .service-due-badge.is-soft,
  .service-due-badge.is-neutral
) {
  border-color: #3b4552;
  background: #202731 !important;
  color: #aab2bd !important;
}

html[data-theme="dark"] body.app-body .legacy-content-modal:has(.dashboard-quick-view-body) {
  border-color: var(--line-strong);
  background: var(--surface) !important;
  color: var(--text);
}

html[data-theme="dark"] body.app-body .legacy-content-modal:has(.dashboard-quick-view-body) > .functional-sheet-handle {
  background: var(--surface);
}

html[data-theme="dark"] body.app-body .legacy-content-modal:has(.dashboard-quick-view-body) .functional-sheet-handle span {
  background: var(--line-strong);
}

html[data-theme="dark"] body.app-body .legacy-content-modal:has(.dashboard-quick-view-body) .legacy-modal-head h2 {
  color: var(--ink);
}

html[data-theme="dark"] body.app-body .dashboard-quick-view-body :is(.dashboard-quick-section, .dashboard-quick-link) {
  border-color: var(--line);
  background: var(--surface-raised);
}

html[data-theme="dark"] body.app-body .dashboard-quick-view-body :is(.dashboard-quick-section > summary, .dashboard-quick-link) {
  color: var(--text);
}

html[data-theme="dark"] body.app-body .dashboard-quick-view-body :is(
  .dashboard-quick-section > summary > .nav-icon,
  .dashboard-quick-link > .nav-icon,
  .dashboard-quick-link > i
) {
  color: var(--muted);
}

html[data-theme="dark"] body.app-body .dashboard-quick-view-body :is(
  .dashboard-quick-section > summary > span:not(.nav-icon),
  .dashboard-quick-link > span:not(.nav-icon)
) {
  background: var(--surface-active);
  color: var(--text);
}

html[data-theme="dark"] body.app-body .dashboard-quick-view-body .dashboard-quick-section > summary::after {
  border-color: var(--muted);
}

html[data-theme="dark"] body.app-body .dashboard-quick-view-body .dashboard-quick-section[open] > summary {
  border-bottom-color: var(--line);
  background: var(--surface-active);
}

html[data-theme="dark"] body .dashboard-checklist-celebration {
  border-color: #3a463d;
  background: rgba(25, 29, 25, .98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .56), inset 0 1px 0 rgba(255, 255, 255, .05);
}

html[data-theme="dark"] body .dashboard-checklist-celebration strong {
  color: #9dd7ad;
}

html[data-theme="dark"] body .dashboard-checklist-celebration small {
  color: #b5bdb7;
}

html[data-theme="dark"] body.app-body :is(
  .section-card:has(.costs-table) > .split-head,
  .costs-table tbody tr,
  .settings-panel,
  .personalization-option,
  .settings-emoji-option
) {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] body.app-body .settings-accordion .form-accordion-body,
html[data-theme="dark"] body.app-body .mobile-mode-accordion > .dashboard-mode-card {
  background: var(--surface-raised);
}

@media (max-width: 900px) {
  html[data-theme="dark"] body.app-body .section-card:not(.record-overview-shell):has(> .list > :is(.document-accordion, .reminder-accordion)),
  html[data-theme="dark"] body.app-body .section-card.damage-grid:not(.record-overview-shell),
  html[data-theme="dark"] body.app-body .all-places-list,
  html[data-theme="dark"] body.app-body .all-places-list > :is(
    .place-row-link,
    .place-view-accordion.form-accordion,
    .legacy-overview-card.place-view-accordion
  ) {
    border-color: var(--line);
    background: var(--surface);
    color: var(--text);
  }
}
