.map-settings-panel .theme-setting { gap: 0; }
.map-settings-panel .theme-setting legend {
  color: inherit;
  font-size: 13px;
  font-weight: 550;
}
.theme-options {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--theme-subtle, #f1f3f6);
}
.map-settings-panel .theme-options label { position: relative; display: block; min-width: 0; }
.map-settings-panel .theme-options input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.theme-options span {
  display: grid;
  min-block-size: 32px;
  place-items: center;
  padding: 4px 3px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: center;
  overflow-wrap: anywhere;
}
.theme-options label:hover span { background: var(--workspace-control-hover); }
.theme-options input:checked + span {
  border-color: var(--theme-border, #d8dee7);
  background: var(--theme-raised, #fff);
  color: var(--ink);
  font-weight: 650;
}
.theme-options input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: -2px; }

html[data-theme="dark"] {
  --workspace-sticky-surface: rgb(24 31 42 / 94%);
  --workspace-sticky-border: var(--line);
}

html[data-theme="dark"] body {
  --workspace-surface: var(--surface);
  --workspace-browse-surface: rgb(27 33 43 / 92%);
  --workspace-nav-surface: rgb(19 25 34 / 80%);
  --workspace-translucent-hover: rgb(165 193 233 / 10%);
  --workspace-control-hover: var(--theme-hover);
  --workspace-control-selected: var(--blue-soft);
  --workspace-control-shadow: 0 1px 4px rgb(0 0 0 / 28%);
  --workspace-control-hover-shadow: 0 2px 9px rgb(0 0 0 / 32%);
  --workspace-list-hover: var(--theme-hover);
  --workspace-popover-border: var(--theme-border);
  --workspace-icon-hover: var(--theme-hover);
  --workspace-place-hover-shadow: 0 4px 14px rgb(0 0 0 / 42%);
  --detail-button-hover: var(--theme-hover);
  --detail-button-border: var(--line);
  --popover-pointer-fill: var(--surface);
  --split-divider-color: var(--line);
  --settings-icon-fill: var(--theme-raised);
  accent-color: var(--blue);
}

html[data-theme="dark"] #places-island { --places-control-border: var(--line); }
html[data-theme="dark"] #workspace-nav { border-inline-end-color: var(--line); }
html[data-theme="dark"] #workspace-nav > button[data-workspace-section] { color: var(--muted); }
html[data-theme="dark"] #workspace-nav > button[aria-current=page] { color: var(--ink); }
html[data-theme="dark"] #places-island-collapse { color: var(--muted); }
html[data-theme="dark"] body.places-island-collapsed:has(#place-filters-toggle[data-has-filters])
  #workspace-nav > button[data-workspace-section=search] > .icon { color: var(--theme-on-action); }

html[data-theme="dark"] :is(.workspace-section-header h1, .workspace-category-heading, .place-result-heading) {
  color: var(--ink);
}
html[data-theme="dark"] :is(#workspace-panel-close, #workspace-search-back, #workspace-collection-back,
    #pinned-filter-summary p, #reset-place-filters, #workspace-collection .workspace-empty, .place-result-empty) {
  color: var(--muted);
}
html[data-theme="dark"] :is(#island-scroll-top, #place-page-status:not(:empty)) {
  border-color: var(--line);
  background: var(--theme-raised);
  color: var(--ink);
}
html[data-theme="dark"] #island-scroll-top:hover:enabled { background: var(--theme-hover); }
html[data-theme="dark"] .atlas-icon-tip {
  border: 1px solid var(--line);
  background: var(--theme-raised);
  color: var(--ink);
}

html[data-theme="dark"] #sidebar-workspace {
  --search-surface-fill: var(--theme-raised);
  --search-surface-selected: var(--blue-soft);
  --search-tile-edge-color: var(--line);
}
html[data-theme="dark"] #sidebar-workspace[data-workspace-scrolled]::before {
  background: var(--workspace-sticky-surface);
}
html[data-theme="dark"] #sidebar-workspace :is(.place-category-heading, .compact-search-field, #compact-search-action,
    #compact-filter-toggle, .horizontal-scroll-next, #place-filters-toggle, #place-popular-filters > button) {
  color: var(--ink);
}
html[data-theme="dark"] #sidebar-workspace .compact-search-field:has(.compact-search-value:not([data-placeholder])) {
  color: var(--blue);
}
html[data-theme="dark"] :is(.compact-search-value[data-placeholder], .compact-budget-label) { color: var(--muted); }
html[data-theme="dark"] :is(#place-filters-count, #compact-filter-count) {
  background: var(--theme-action);
  color: var(--theme-on-action);
}
html[data-theme="dark"] #island-search-field kbd {
  border-color: var(--line);
  background: var(--theme-subtle);
  color: var(--muted);
}
html[data-theme="dark"] #island-search-field input { color: var(--ink); caret-color: #fff; }
html[data-theme="dark"] #island-search-field input::placeholder { color: var(--muted); }
html[data-theme="dark"] #island-search-field :is(#search-submit, #search-clear) { color: var(--blue); }
html[data-theme="dark"] #compact-search-dropdown { background: var(--surface); box-shadow: var(--shadow); }

html[data-theme="dark"] :is(.search-discovery-category-link, .search-history-heading, .search-history-entry,
    .search-discovery-recent, #recent-places-dialog, .trip-suggestion) { color: var(--ink); }
html[data-theme="dark"] :is(.search-history-empty, .search-discovery-detail, .search-discovery-recent-meta,
    .trip-suggestion-kind, .search-discovery-icon, .search-history-detail-heading > .search-history-back,
    .collection-places-empty) { color: var(--muted); }
html[data-theme="dark"] .search-discovery-card-copy .search-discovery-detail { color: inherit; }
html[data-theme="dark"] :is(.search-discovery-photo, .search-history-photo) { background: var(--theme-hover); }
html[data-theme="dark"] .trip-suggestion-visual { background: var(--theme-hover); color: var(--muted); }
html[data-theme="dark"] #search-discovery :is(button, a):focus-visible,
html[data-theme="dark"] :is(#search-history, #search-popup-history) button:focus-visible { outline-color: var(--blue); }
html[data-theme="dark"] #recent-places-dialog { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] #recent-places-dialog::backdrop { background: rgb(6 10 16 / 62%); }
html[data-theme="dark"] .collection-filters-panel { background: var(--surface); box-shadow: var(--shadow); }
html[data-theme="dark"] .collection-filters-reset { color: var(--blue); }
html[data-theme="dark"] .collection-filters-reset:enabled:hover { color: var(--ink); }

html[data-theme="dark"] :is(.filter-pane, .filter-pane-footer) { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] body[data-places-filters=dropdown] #filter-pane { box-shadow: var(--shadow); }
html[data-theme="dark"] .map-settings-panel {
  border-color: var(--workspace-popover-border);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .map-settings-section + .map-settings-section { border-block-start-color: var(--line); }
html[data-theme="dark"] .map-settings-section h3,
html[data-theme="dark"] .map-settings-panel label { color: var(--ink); }
html[data-theme="dark"] .map-settings-panel :is(legend, small),
html[data-theme="dark"] #thumbnail-scale-value { color: var(--muted); }
html[data-theme="dark"] .map-settings-panel .theme-setting legend { color: var(--ink); }
html[data-theme="dark"] .map-settings-panel :is(input[type=checkbox], input[type=radio]) { accent-color: var(--blue); }
html[data-theme="dark"] #thumbnail-scale { --thumbnail-track: var(--theme-border); }
html[data-theme="dark"] #thumbnail-scale:focus-visible { outline-color: var(--blue); }
html[data-theme="dark"] #export-button {
  border-color: var(--line);
  background: var(--theme-raised);
  color: var(--ink);
}
html[data-theme="dark"] #export-button:hover:enabled { background: var(--theme-hover); }
html[data-theme="dark"] :is(#filter-island-close, .filter-cloud-title,
    #pinned-filter-summary h3, #pinned-place-popular-title, #filter-selected-heading) { color: var(--ink); }
html[data-theme="dark"] .filter-pane-footer button,
html[data-theme="dark"] .filter-disclosure > summary { color: var(--ink); }
html[data-theme="dark"] :is(.filter-cloud-label, #filter-pane .filter-cloud-toggle > .icon) {
  color: var(--muted);
}
html[data-theme="dark"] #filter-draft-apply { background: #285bbe; color: #fff; }
html[data-theme="dark"] #filter-draft-apply:hover:enabled { background: #3167ce; }
html[data-theme="dark"] .filter-disclosure > summary::before { background-color: var(--line); }
html[data-theme="dark"] .filter-cloud-toggle { color: var(--blue); }
html[data-theme="dark"] #sidebar-workspace :is(#filter-pane, #pinned-filter-summary) button:is(.atlas-tag, .country-tab, .filter-chip),
html[data-theme="dark"] #workspace-collection :is(.collection-filter-toolbar, .collection-filter-options) .atlas-tag {
  border-color: var(--line);
  background-color: var(--theme-raised);
  color: var(--ink);
}
html[data-theme="dark"] #sidebar-workspace :is(#filter-pane, #pinned-filter-summary) button:is(.atlas-tag, .country-tab, .filter-chip):is(
    [aria-pressed=true]:not([data-filter-draft-pressed=false]), [data-filter-draft-pressed=true]),
html[data-theme="dark"] #workspace-collection :is(.collection-filter-toolbar, .collection-filter-options) .atlas-tag[aria-pressed=true] {
  border-color: var(--blue);
  background-color: var(--blue-soft);
  color: var(--blue);
}
html[data-theme="dark"] #sidebar-workspace :is(#filter-pane, #pinned-filter-summary) button:is(.atlas-tag, .country-tab, .filter-chip):hover:enabled,
html[data-theme="dark"] #workspace-collection :is(.collection-filter-toolbar, .collection-filter-options) .atlas-tag:enabled:hover {
  border-color: var(--theme-border);
}
html[data-theme="dark"] #sidebar-workspace :is(#filter-pane, #pinned-filter-summary) button:is(.atlas-tag, .country-tab, .filter-chip):is(
    [aria-pressed=true]:not([data-filter-draft-pressed=false]), [data-filter-draft-pressed=true]):hover:enabled {
  border-color: var(--blue);
  --filter-selected-border: var(--blue);
}
html[data-theme="dark"] #workspace-collection #collection-filters-toggle[aria-expanded=true] { border-color: var(--blue); }

html[data-theme="dark"] .place-category-field { color: var(--ink); }
html[data-theme="dark"] :is(.place-category-field-label, .place-category-field-chevron,
    .place-category-field:not([data-filled]) .place-category-field-value, .place-category-calendar-weekday) { color: var(--muted); }
html[data-theme="dark"] .place-category-popover { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
html[data-theme="dark"] :is(.place-category-popover-actions, .place-category-calendar-weekday) { border-color: var(--line); }
html[data-theme="dark"] .place-category-popover :is(.place-category-calendar-nav, .place-category-number-step, .place-category-popover-clear) {
  background: var(--theme-raised);
}
html[data-theme="dark"] .place-category-popover :is(.place-category-calendar-nav, .place-category-number-step, .place-category-popover-clear):hover:not(:disabled) {
  background: var(--theme-hover);
}
html[data-theme="dark"] .place-category-popover button:focus-visible { outline-color: var(--blue); }
html[data-theme="dark"] .place-category-calendar-day:is([data-in-range], :hover:not(:disabled)) { background: var(--blue-soft); }
html[data-theme="dark"] .place-category-number-editor > input {
  border-color: var(--theme-border);
  background: var(--theme-subtle);
  color: var(--ink);
}
html[data-theme="dark"] :is(.place-category-popover-actions > .place-category-popover-apply,
    .place-category-calendar-day[aria-pressed=true]) { background: var(--theme-action); color: var(--theme-on-action); }
html[data-theme="dark"] .place-category-popover-apply:focus-visible { outline-color: var(--theme-on-action) !important; }
html[data-theme="dark"] .place-category-calendar-day[aria-pressed=true]:focus-visible { outline-color: var(--theme-on-action); }

html[data-theme="dark"] :is(.trip-assistant-launch, .trip-assistant-sparkle) { color: var(--blue); }
html[data-theme="dark"] .trip-assistant-launch:is(:hover, [aria-expanded=true]) { background: var(--blue-soft); }
html[data-theme="dark"] .trip-assistant-dialog { border-color: var(--theme-border); box-shadow: var(--shadow); }
html[data-theme="dark"] .trip-assistant-dialog::backdrop { background: rgb(6 10 16 / 55%); }
html[data-theme="dark"] :is(.trip-assistant-close, .trip-assistant-composer, .trip-assistant-actions button) {
  border-color: var(--line);
  background: var(--theme-raised);
  color: var(--ink);
}
html[data-theme="dark"] :is(.trip-assistant-close:hover, .trip-assistant-actions button:hover) { background: var(--theme-hover); }
html[data-theme="dark"] .trip-assistant-composer textarea { color: var(--ink); }
html[data-theme="dark"] :is(.trip-assistant-composer textarea::placeholder, .trip-assistant-status) { color: var(--muted); }
html[data-theme="dark"] .trip-assistant-send { background: var(--blue-soft); color: var(--blue); }
