:root[data-theme="dark"] {
  --place-result-surface: var(--theme-raised);
  --place-media-control: rgb(25 33 45 / 92%);
  --place-media-border: rgb(204 218 238 / 30%);
  --place-sticker-paper: #dde5ef;
  --place-action-active-border: #64748b;
}

/* Place details and source material */
:root[data-theme="dark"] #place-dialog {
  background: var(--surface);
  box-shadow: 1px 0 16px rgb(0 0 0 / 32%);
}
:root[data-theme="dark"] #place-dialog .detail-scroll {
  scrollbar-color: var(--theme-border) transparent;
}
:root[data-theme="dark"] #place-dialog :is(
  .detail-heading h2, .detail-body h3, .detail-sticky-header,
  .detail-contacts, .detail-stay-price, .stay-price-secondary,
  .rating-item, .detail-section, .detail-section-heading,
  .detail-compact-rating, .detail-rating-star, .detail-review-heading,
  .detail-review-author, .detail-review-score
) {
  color: var(--ink);
}
:root[data-theme="dark"] #place-dialog :is(
  .detail-photo-status, .detail-location, .detail-contacts small, .stay-price-unit,
  .stay-price-context, .stay-price-note, .detail-description, .highlights li,
  .rating-scale, .rating-source, .rating-subject, .ratings-loading, .rating-empty,
  .detail-section-anchor, .detail-rating-count, .detail-source-empty, .verification-date,
  .detail-review-summary-text, .detail-review-empty, .detail-review-limitations,
  .detail-review-context, .detail-review-sample, .detail-review-meta,
  .detail-review-excerpt, .detail-review-entity, .detail-review-topic ul
),
:root[data-theme="dark"] #place-dialog #detail-section-sources .source-details > summary {
  color: var(--muted);
}
:root[data-theme="dark"] #place-dialog :is(.detail-source-list a, .detail-review-source) {
  color: var(--blue);
}
:root[data-theme="dark"] #place-dialog :is(
  .detail-contacts a:hover, .detail-section-anchor:hover, .rating-item:hover .rating-source
) {
  color: var(--ink);
}
:root[data-theme="dark"] #place-dialog :is(.detail-section-nav, .detail-section, .detail-review-card) {
  border-color: var(--line);
}
:root[data-theme="dark"] #place-dialog .detail-section-nav .detail-section-anchor[aria-current="location"] {
  border-color: var(--blue);
  color: var(--blue);
}
:root[data-theme="dark"] #place-dialog :is(.winter-note, .detail-review-card) {
  background: var(--theme-raised);
  color: var(--ink);
}
:root[data-theme="dark"] #place-dialog .winter-note :is(h3, p) {
  color: var(--ink);
}
:root[data-theme="dark"] #place-dialog .detail-action-row > :is(button, .detail-external-action) {
  color: var(--ink);
}
:root[data-theme="dark"] #place-dialog .detail-body .detail-action-row > :is(button, .detail-external-action) {
  background-color: var(--theme-raised);
}
@media (hover: hover) {
  :root[data-theme="dark"] #place-dialog .detail-body .detail-action-row > :is(button:enabled, a[href]):hover {
    background-color: var(--theme-hover);
  }
}

/* Photos, collection cards and the expanded gallery */
:root[data-theme="dark"] .atlas-place-cards .atlas-place-card {
  background: transparent;
  color: var(--ink);
}
:root[data-theme="dark"] .atlas-place-cards :is(
  .apc-meta, .apc-food, .apc-rating-count, .apc-rating-empty, .apc-description
) {
  color: var(--muted);
}
:root[data-theme="dark"] .atlas-place-cards :is(
  .apc-rating-link, .apc-rating-facts, .apc-rating-score, .apc-price
) {
  color: var(--ink);
}
:root[data-theme="dark"] .apc-lodging :is(
  .apc-rating-count, .apc-rating-empty, .apc-lodging-missing, .apc-lodging-address,
  .apc-lodging-description, .apc-lodging-room, .apc-lodging-price-unit
) {
  color: var(--muted);
}
:root[data-theme="dark"] .apc-lodging :is(
  .apc-lodging-description-toggle, .apc-lodging-description-tail, .apc-rating-link
) {
  color: var(--blue);
}
:root[data-theme="dark"] .apc-lodging-stars[role="img"] { color: var(--amber); }
:root[data-theme="dark"] .apc-lodging-breakfast { color: var(--theme-success); }
:root[data-theme="dark"] .atlas-place-cards .apc-no-photo .apc-type > .atlas-sticker-copy {
  color: var(--muted);
}
:root[data-theme="dark"] :is(
  #place-dialog .gallery, .atlas-place-cards .apc-gallery:not(.apc-no-photo),
  .dg-mosaic-tile, .dg-photo-frame, .dg-viewer-frame,
  .explore-photo-frame, .explore-thumbnail, .reference-preview-stage
) {
  background-color: var(--theme-subtle);
}
:root[data-theme="dark"] :is(
  .dg-dialog, .dg-mosaic, .dg-credit-panel, .atlas-photo-info-panel,
  .reference-preview-surface, .reference-preview-photo-details
) {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
:root[data-theme="dark"] :is(.dg-guide-header, .dg-viewer-thumbs) {
  border-color: var(--line);
}
:root[data-theme="dark"] :is(.dg-credit-changes, .dg-guide-subtitle, .dg-viewer-thumb) {
  color: var(--muted);
}
:root[data-theme="dark"] :is(.dg-guide-tile, .dg-viewer-thumb[aria-current="true"]) {
  color: var(--ink);
}
:root[data-theme="dark"] .dg-viewer-thumb[aria-current="true"] > .dg-photo-frame {
  border-color: var(--blue);
}
:root[data-theme="dark"] .dg-dialog::backdrop {
  background: rgb(5 9 15 / 72%);
}
:root[data-theme="dark"] #place-dialog:not(.is-detail-scrolled) > .dialog-close,
:root[data-theme="dark"] #place-dialog .gallery > .gallery-arrow,
:root[data-theme="dark"] .atlas-place-cards :is(.apc-arrow, .apc-photo-actions > button),
:root[data-theme="dark"] :is(.explore-result, .explore-detail) .explore-photo-arrow,
:root[data-theme="dark"] :is(
  .dg-all-photos, .dg-guide-close, .dg-guide-back, .dg-viewer-arrow,
  .hover-photo-arrow, .reference-preview-close, .reference-preview-arrow
) {
  background-color: var(--place-media-control);
  border-color: var(--place-media-border);
  color: var(--ink);
}
:root[data-theme="dark"] #place-dialog.is-detail-scrolled > .dialog-close {
  color: var(--ink);
}
:root[data-theme="dark"] .atlas-place-cards .apc-like[aria-pressed="true"] {
  color: #ff6680;
}
:root[data-theme="dark"] .atlas-place-cards .apc-route[data-in-route="true"] {
  color: var(--blue);
}
@media (hover: hover) {
  :root[data-theme="dark"] #place-dialog > .dialog-close:enabled:hover,
  :root[data-theme="dark"] #place-dialog .gallery > .gallery-arrow:enabled:hover,
  :root[data-theme="dark"] .dg-dialog .dg-viewer-arrow:enabled:hover,
  :root[data-theme="dark"] .atlas-place-cards :is(.apc-arrow, .apc-photo-actions > button):enabled:hover,
  :root[data-theme="dark"] :is(.explore-result, .explore-detail) .explore-photo-arrow:enabled:hover,
  :root[data-theme="dark"] :is(
    .dg-all-photos:enabled, .dg-guide-close:enabled, .dg-guide-back:enabled,
    .hover-photo-arrow:enabled, .reference-preview-close, .reference-preview-arrow
  ):hover {
    background-color: var(--theme-hover);
    color: var(--ink);
  }
  :root[data-theme="dark"] .atlas-place-cards .apc-like[aria-pressed="true"]:hover {
    color: #ff6680;
  }
  :root[data-theme="dark"] .atlas-place-cards .apc-route[data-in-route="true"]:hover {
    color: var(--blue);
  }
}

/* Reference links and popovers */
:root[data-theme="dark"] .reference-trigger {
  text-decoration-color: var(--theme-faint);
}
:root[data-theme="dark"] .reference-trigger:is(:hover, [aria-expanded="true"]) {
  color: var(--blue);
  text-decoration-color: currentColor;
}
:root[data-theme="dark"] .reference-theme:not(.atlas-sticker) {
  background: #322840;
  color: #dfc4f5;
}
:root[data-theme="dark"] .reference-preview {
  color: var(--ink);
}
:root[data-theme="dark"] .reference-preview:is([data-placement="above"], [data-placement="below"])::before {
  background: var(--surface);
  border-color: var(--line);
}
:root[data-theme="dark"] .reference-preview :is(
  .reference-preview-no-photo, .reference-preview-changes,
  .reference-preview-meta, .reference-preview-description
) {
  color: var(--muted);
}
:root[data-theme="dark"] .reference-preview a {
  color: var(--blue);
}
:root[data-theme="dark"] .reference-preview :is(
  .reference-preview-back, .reference-preview-place, .reference-preview-related-item,
  .reference-preview-membership
) {
  background: var(--theme-raised);
  border-color: var(--line);
  color: var(--ink);
}
:root[data-theme="dark"] .reference-preview :is(
  .reference-preview-back, .reference-preview-place, .reference-preview-related-item,
  .reference-preview-membership
):hover {
  background: var(--theme-hover);
}
:root[data-theme="dark"] .reference-preview :is(button:not(.reference-preview-info-button), a):focus-visible,
:root[data-theme="dark"] .hover-card-actions .hover-card-action:focus-visible,
:root[data-theme="dark"] .hover-photo-controls button:focus-visible {
  outline-color: var(--blue);
}

/* Explore results and map previews */
:root[data-theme="dark"] :is(
  .explore-result-heading, .explore-result-button, .explore-result-food,
  .explore-result-rating, .explore-result-price, .explore-card-title,
  .explore-hover .explore-card-score.has-rating, .explore-hover .explore-review-link
) {
  color: var(--ink);
}
:root[data-theme="dark"] :is(
  .explore-status, .explore-route-message, .explore-awards,
  .explore-result-description, .explore-result-facts, .explore-existing-heading,
  .explore-card-credit, .explore-card-score, .explore-card-meta,
  .explore-card-description, .explore-hover .explore-card-description, .explore-google-status
) {
  color: var(--muted);
}
:root[data-theme="dark"] :is(
  .explore-awards a, .explore-attributions a, .explore-site-link, .explore-card-credit a,
  .explore-editorial a, .explore-detail-back, .explore-google-button
) {
  color: var(--blue);
}
:root[data-theme="dark"] :is(.explore-rating, .explore-card-score.has-rating) {
  color: #eec58b;
}
:root[data-theme="dark"] :is(.explore-hover, .explore-google-rating, .explore-photo-category) {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
:root[data-theme="dark"] .explore-google-button:hover {
  background: var(--theme-hover);
}
:root[data-theme="dark"] .explore-detail :is(.explore-review-link, .explore-add-route:disabled) {
  background: var(--theme-raised);
  border-color: var(--line);
  color: var(--ink);
}
:root[data-theme="dark"] .explore-detail .explore-add-route:enabled {
  background: var(--theme-action);
  border-color: var(--theme-action);
  color: var(--theme-on-action);
}
:root[data-theme="dark"] .explore-detail .explore-add-route:enabled:hover {
  background: color-mix(in srgb, var(--theme-action) 82%, var(--ink));
}
:root[data-theme="dark"] .explore-detail .explore-review-link:hover {
  background: var(--theme-hover);
}
:root[data-theme="dark"] :is(.hover-card-action, .hover-route-control),
:root[data-theme="dark"] .hover-card-actions > :is(.hover-card-action.is-liked, .hover-route-control.is-in-route) {
  background-color: var(--theme-raised);
  border-color: var(--place-action-active-border);
  color: var(--ink);
}
:root[data-theme="dark"] .hover-card-actions > .hover-route-control > .hover-card-action {
  background-color: transparent;
}
:root[data-theme="dark"] .hover-card-actions .hover-card-action:hover:enabled {
  background-color: var(--theme-hover);
}
:root[data-theme="dark"] .hover-route-main.is-in-route > .route-action-icon {
  color: var(--blue);
}
:root[data-theme="dark"] #map :is(.photo-marker, .photo-cluster) {
  --map-photo-frame: #d9e2ee;
}
:root[data-theme="dark"] #map :is(.photo-pin, .photo-stack) > img {
  background-color: var(--theme-subtle);
}
:root[data-theme="dark"] #map :is(.photo-marker, .photo-cluster) :is(.pin-label, .cluster-label) {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
:root[data-theme="dark"] #map :is(.compact-map-marker, .atlas-landmark, .explore-marker).is-selected
  :is(.compact-map-caption, .atlas-landmark-label, .explore-marker-label) {
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--surface);
}
:root[data-theme="dark"] #map .photo-stack .cluster-count {
  background: var(--surface);
  border-color: var(--map-photo-frame);
  color: var(--map-label-color);
}
:root[data-theme="dark"] #map .photo-cluster.is-selected .cluster-count {
  background: var(--map-selection-color);
  color: var(--theme-on-action);
}
:root[data-theme="dark"] #map .is-photo-preview > :is(.photo-pin, .photo-stack) {
  background: var(--surface);
}
:root[data-theme="dark"] #map .is-photo-preview > :is(.photo-pin, .photo-stack) > .marker-info-label {
  background: transparent;
}
:root[data-theme="dark"] #map :is(.photo-marker, .photo-cluster) .marker-info-label > :is(.marker-title, .marker-description) {
  color: var(--ink);
}
:root[data-theme="dark"] #map .marker-info-label .marker-fact-sticker {
  --atlas-sticker-paper: transparent;
  color: inherit;
}
:root[data-theme="dark"] #map .marker-rating-star {
  color: currentColor;
}

/* The paper silhouette also protects the artwork and lettering against busy photos. */
:root[data-theme="dark"] .atlas-sticker {
  --atlas-sticker-paper: var(--place-sticker-paper);
}
:root[data-theme="dark"] #atlas-sticker-outline feFlood[result="white"] {
  flood-color: var(--place-sticker-paper);
}
:root[data-theme="dark"] :is(.pin-like-badge > .icon, .pin-route-badge > .route-pin-sticker) > use {
  stroke: var(--place-sticker-paper);
}
:root[data-theme="dark"] .pin-route-badge > .route-pin-sticker > use {
  fill: #2865e5;
}
:root[data-theme="dark"] .atlas-sticker > .atlas-sticker-copy:is(.pin-like-count, .pin-route-count) {
  -webkit-text-stroke-color: var(--place-sticker-paper);
}
:root[data-theme="dark"] .atlas-text-sticker {
  color: var(--ink);
}
