/* 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-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #536176;
  cursor: pointer;
}

.theme-toggle:hover {
  background: #f7f9fc;
  color: #172033;
}

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

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

.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: #75aaff;
  --primary-hover: #9ac1ff;
  --primary-soft: #171d27;
  --ink: #f3f5f8;
  --text: #d5dae2;
  --muted: #929ba9;
  --soft: #070a0f;
  --surface-sidebar: #0b0f14;
  --surface: #10151d;
  --surface-raised: #131923;
  --surface-active: #161d27;
  --surface-control: #111823;
  --switch-track: #626a73;
  --switch-border: #747d87;
  --switch-thumb: #ffffff;
  --switch-active: #22a447;
  --button-primary: #2f7df4;
  --button-primary-hover: #256fe0;
  --button-primary-disabled: #182a43;
  --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: #242b35;
  --line-strong: #363f4c;
  --line-soft: #1a2029;
  --pill-bg: #141922;
  --pill-border: #303844;
  --pill-color: #c0c6cf;
  --pill-selected-bg: #1a2230;
  --pill-selected-border: #485568;
  --pill-selected-color: #eef1f5;
  --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(99, 160, 255, .2);
}

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"] .brand img {
  content: url("/assets/img/Logo_CamperID_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"] .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.is-active,
  .side-nav-group-link.is-active
) {
  background: var(--surface-active);
  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(.sidebar-camper-select label, .side-nav-toggle) {
  color: #a3acb9;
}

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,
  .record-link-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: #53657d;
  background: var(--surface-active);
  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: #52627a;
  background: #1b2431;
  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: #53657d;
  background: #171e28;
}

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: #394351;
  background: #101722;
  color: #e4e8ed;
}

html[data-theme="dark"] .compact-filter-tabs {
  border-color: #394351;
  background: #101722;
}

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: #64748b;
  background: #151a22;
  color: #eef1f5;
}

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: #394351 !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 #64748b !important;
  background: #171d26 !important;
  color: #f1f3f6 !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: #c1c8d1 !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: #64748b !important;
  background: #171d26 !important;
  color: #f1f3f6 !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: #64748b !important;
  background: #171d26 !important;
  color: #f1f3f6 !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,
  .sale-expose-rich-editor,
  .sale-expose-description-editor,
  .compact-filter-tabs,
  .business-vehicle-filter
) {
  border-color: var(--line-strong);
  background-color: #0d1726;
  color: var(--text);
}

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

html[data-theme="dark"] :is(
  .button-secondary,
  .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: #152235;
  color: var(--text);
}

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

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,
  .side-nav-link:hover,
  .dashboard-deadline-row:hover,
  .dashboard-shortcut:hover,
  .quick-action:hover
) {
  background-color: #172943;
}

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: #152235;
  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"] :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 .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(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:has(> .dashboard-mode-card.active) {
    border-color: #53657d;
    box-shadow: inset 0 0 0 1px #303b4b;
  }
}

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 #343d49;
  background: #202731;
  color: #cbd1da;
}

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 .product-toggle-button {
  border-color: #394351;
  background: #18202b;
  color: #e4e8ed;
}

html[data-theme="dark"] body .product-toggle-button:hover,
html[data-theme="dark"] body .product-toggle-button:focus-visible {
  border-color: #505c6c;
  background: #202731;
}

html[data-theme="dark"] body .product-toggle-button .mode-switch {
  border-color: var(--switch-border);
  background: var(--switch-track);
}

html[data-theme="dark"] body .product-toggle-button .mode-switch i {
  background: var(--switch-thumb);
}

html[data-theme="dark"] body .product-toggle-button .mode-switch.is-on {
  border-color: var(--switch-active);
  background: var(--switch-active);
}

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-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; }

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

  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;
  }
}
