/* Color-scheme theming. Light tokens stay in existing stylesheets.
   Dark tokens and photo treatment live here so values can be tuned in one place.
   Sources: web.dev/articles/prefers-color-scheme, web.dev/articles/color-scheme,
   MDN color-scheme / theme-color, WCAG 2.2 AA contrast 4.5:1 (3:1 large text). */

:root {
  color-scheme: light dark;
  --photo-brightness: 1;
  --photo-saturate: 1;
  --photo-filter: none;
  --caption-scrim: linear-gradient(to top, rgba(15, 22, 20, 0.78) 0%, rgba(15, 22, 20, 0.42) 45%, transparent 100%);
  --trust-card-bg: #e8e2d6;
  --trust-card-border: #c3bbae;
  --on-accent: #f6f1e8;
  --input-bg: #fffdf9;
  --input-border: #a9afa4;
  --surface: #eee7da;
  --raised: #fffdf9;
  --whatsapp: #146c43;
  --theme-chrome: #f6f1e8;
  --button-bg: #9b432d;
  --button-fg: #f6f1e8;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #161916;
    --paper-2: #1c201d;
    --green: #9ec9ab;
    --red: #e09176;
    --ink: #eeeae3;
    --muted: #b6bbb4;
    --line: #3d4540;
    --accent: #e09176;
    --on-accent: #f6f1e8;
    --input-bg: #1c201d;
    --input-border: #6a736d;
    --surface: #1c201d;
    --raised: #232926;
    --whatsapp: #146c43;
    --theme-chrome: #161916;
    --button-bg: #8a3c28;
    --button-fg: #f6f1e8;
    --photo-brightness: .8;
    --photo-saturate: .9;
    --photo-filter: brightness(var(--photo-brightness)) saturate(var(--photo-saturate));
    --caption-scrim: linear-gradient(to top, rgba(8, 10, 9, 0.96) 0%, rgba(8, 10, 9, 0.82) 38%, rgba(8, 10, 9, 0.4) 68%, transparent 100%);
    --trust-card-bg: #e8e2d6;
    --trust-card-border: #8a8478;
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #161916;
  --paper-2: #1c201d;
  --green: #9ec9ab;
  --red: #e09176;
  --ink: #eeeae3;
  --muted: #b6bbb4;
  --line: #3d4540;
  --accent: #e09176;
  --on-accent: #f6f1e8;
  --input-bg: #1c201d;
  --input-border: #6a736d;
  --surface: #1c201d;
  --raised: #232926;
  --whatsapp: #146c43;
  --theme-chrome: #161916;
  --button-bg: #8a3c28;
  --button-fg: #f6f1e8;
  --photo-brightness: .8;
  --photo-saturate: .9;
  --photo-filter: brightness(var(--photo-brightness)) saturate(var(--photo-saturate));
  --caption-scrim: linear-gradient(to top, rgba(8, 10, 9, 0.96) 0%, rgba(8, 10, 9, 0.82) 38%, rgba(8, 10, 9, 0.4) 68%, transparent 100%);
  --trust-card-bg: #e8e2d6;
  --trust-card-border: #8a8478;
}

html[data-theme="light"] {
  color-scheme: light;
}

html, body,
.demo-b {
  background: var(--paper);
  color: var(--ink);
}

.seal,
.brand-mark {
  color: var(--on-accent);
}

/* Photographs: never invert. Dark-mode dimming is a tunable filter variable.
   Licence / document images opt out so they stay readable. */
img {
  filter: var(--photo-filter);
}
.trust-license img,
img.theme-photo-preserve {
  filter: none;
}

/* Text on photos: keep / deepen the scrim so captions stay at least AA 4.5:1. */
.home-hero figcaption,
.product-hero figcaption,
.b-hero-photo figcaption,
.destination-card:after,
.home-hero:after,
.b-hero-photo::after {
  background: var(--caption-scrim);
}
.b-hero-photo::after {
  inset: 40% 0 0;
}

/* Licence / white-background documents: card chassis only, no dimming. */
.trust-license,
.demo-b .trust-license {
  background: var(--trust-card-bg);
  border: 1px solid var(--trust-card-border);
  border-radius: 6px;
  overflow: hidden;
}
.trust-license img,
.demo-b .trust-license img,
.trust-license-dialog img {
  background: #f7f4ee;
  filter: none;
}

.trust-license-dialog {
  width: min(960px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: auto;
  padding: 12px;
  border: 1px solid #c3bbae;
  border-radius: 8px;
  background: #f7f4ee;
  color: #1c1914;
}

.trust-license-dialog::backdrop {
  background: rgba(20, 18, 14, 0.72);
}

.trust-license-dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.trust-license-dialog-bar p {
  margin: 0;
  color: #1c1914;
  font-size: 16px;
}

.trust-license-close {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #8a8478;
  border-radius: 4px;
  background: #fffdf9;
  color: #1c1914;
  font: inherit;
  cursor: pointer;
}

.trust-license-dialog img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 120px);
  object-fit: contain;
}

input, select, textarea,
.demo-b .demo-filters select,
.decision-panel select,
.decision-panel textarea {
  background: var(--input-bg);
  color: var(--ink);
  border-color: var(--input-border);
  color-scheme: inherit;
}

.preview-panel,
.preview-panel pre,
.page-top,
.collection-band,
.coverage,
.destination-section,
.local-edit,
.route-experiences,
.route-without-photo,
.intro,
.notice,
#tour-empty,
.tour-filters,
.sample-card .card-image,
.language-switcher > summary,
header .menu-toggle,
.language-options,
.theme-switcher > summary,
.theme-options,
.skip,
.skip-link,
.days-badge {
  background: var(--raised);
  color: var(--ink);
  border-color: var(--line);
}

.page-top,
.collection-band, .coverage, .destination-section, .local-edit,
.route-experiences, .route-without-photo, .intro,
.notice, #tour-empty, .tour-filters,
.sample-card .card-image {
  background: var(--surface);
}

header,
.demo-header,
.demo-b .b-local,
.demo-footer,
.demo-b .demo-footer {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}

.whatsapp-float,
.whatsapp-button,
.button.whatsapp-button,
.demo-b .b-contact-options .b-whatsapp {
  background: var(--whatsapp) !important;
  border: 2px solid var(--on-accent);
  color: #fff !important;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) footer {
    background: #101412;
    color: var(--muted);
  }
  :root:not([data-theme="light"]) footer .brand { color: var(--ink); }
  :root:not([data-theme="light"]) footer .quiet { color: var(--muted); }
}

html[data-theme="dark"] footer {
  background: #101412;
  color: var(--muted);
}
html[data-theme="dark"] footer .brand { color: var(--ink); }

html[data-theme="dark"] .closing,
:root:not([data-theme="light"]) .closing {
  /* filled band stays distinct; text uses on-accent for contrast */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .closing {
    background: #24362f;
    color: var(--ink);
  }
  :root:not([data-theme="light"]) .closing .button {
    background: #f3d3ba;
    color: #161916;
    border-color: #f3d3ba;
  }
  :root:not([data-theme="light"]) .demo-b .b-consult {
    background: #1c201d;
    color: var(--ink);
  }
  :root:not([data-theme="light"]) .demo-b .b-consult .button:not(.b-whatsapp) {
    background: var(--button-bg);
    border-color: var(--button-bg);
    color: var(--button-fg);
  }
  :root:not([data-theme="light"]) .language-options a:hover,
  :root:not([data-theme="light"]) .language-options a[aria-current="true"],
  :root:not([data-theme="light"]) .theme-options button:hover,
  :root:not([data-theme="light"]) .theme-options button[aria-current="true"] {
    background: #2a322e;
  }
  :root:not([data-theme="light"]) .review-strip {
    background: #1c201d;
    color: var(--ink);
    border-color: var(--line);
  }
  :root:not([data-theme="light"]) .review-tabs a[aria-current="page"] {
    background: #24302b;
    border-color: var(--red);
  }
  :root:not([data-theme="light"]) .card,
  :root:not([data-theme="light"]) .route-card,
  :root:not([data-theme="light"]) .concept {
    border-color: var(--line);
    background: var(--paper);
  }
  :root:not([data-theme="light"]) .route-image,
  :root:not([data-theme="light"]) .route-no-photo {
    background: #1c201d;
  }
  :root:not([data-theme="light"]) .route-tags li {
    background: #1c201d;
    color: var(--green);
    border-color: var(--green);
  }
  :root:not([data-theme="light"]) .route-price strong { color: var(--red); }
  :root:not([data-theme="light"]) .demo-b .demo-filters select {
    background: var(--input-bg);
    color: var(--ink);
    border-color: var(--input-border);
  }
  :root:not([data-theme="light"]) .demo-b [data-demo-more] {
    background: var(--paper);
    color: var(--ink);
    border-color: var(--line);
  }
  :root:not([data-theme="light"]) .demo-b .button.secondary {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
  }
  :root:not([data-theme="light"]) .skip,
  :root:not([data-theme="light"]) .skip-link {
    background: var(--raised);
    color: var(--ink);
  }
  :root:not([data-theme="light"]) .button:not(.whatsapp-button):not(.secondary):not(.outline) {
    color: var(--on-accent);
  }
  :root:not([data-theme="light"]) header #nav .button,
  :root:not([data-theme="light"]) .button:not(.secondary):not(.outline):not(.whatsapp-button) {
    background: var(--button-bg);
    border-color: var(--button-bg);
    color: var(--button-fg);
  }
  :root:not([data-theme="light"]) .text-link,
  :root:not([data-theme="light"]) .outline {
    color: var(--red);
    border-color: var(--red);
  }
}

html[data-theme="dark"] .closing {
  background: #24362f;
  color: var(--ink);
}
html[data-theme="dark"] .closing .button {
  background: #f3d3ba;
  color: #161916;
  border-color: #f3d3ba;
}
html[data-theme="dark"] .demo-b .b-consult {
  background: #1c201d;
  color: var(--ink);
}
html[data-theme="dark"] .demo-b .b-consult .button:not(.b-whatsapp) {
  background: var(--button-bg);
  border-color: var(--button-bg);
  color: var(--button-fg);
}
html[data-theme="dark"] .language-options a:hover,
html[data-theme="dark"] .language-options a[aria-current="true"],
html[data-theme="dark"] .theme-options button:hover,
html[data-theme="dark"] .theme-options button[aria-current="true"] {
  background: #2a322e;
}
html[data-theme="dark"] .review-strip {
  background: #1c201d;
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="dark"] .review-tabs a[aria-current="page"] {
  background: #24302b;
  border-color: var(--red);
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .route-card,
html[data-theme="dark"] .concept {
  border-color: var(--line);
  background: var(--paper);
}
html[data-theme="dark"] .route-image,
html[data-theme="dark"] .route-no-photo { background: #1c201d; }
html[data-theme="dark"] .route-tags li {
  background: #1c201d;
  color: var(--green);
  border-color: var(--green);
}
html[data-theme="dark"] .route-price strong { color: var(--red); }
html[data-theme="dark"] .demo-b .demo-filters select {
  background: var(--input-bg);
  color: var(--ink);
  border-color: var(--input-border);
}
html[data-theme="dark"] .demo-b [data-demo-more] {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="dark"] .demo-b .button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="dark"] .skip,
html[data-theme="dark"] .skip-link {
  background: var(--raised);
  color: var(--ink);
}
html[data-theme="dark"] header #nav .button,
html[data-theme="dark"] .button:not(.secondary):not(.outline):not(.whatsapp-button) {
  background: var(--button-bg);
  border-color: var(--button-bg);
  color: var(--button-fg);
}
html[data-theme="dark"] .text-link,
html[data-theme="dark"] .outline {
  color: var(--red);
  border-color: var(--red);
}

/* Appearance switcher: same chrome as the language control, keyboard-sized targets. */
.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.theme-switcher {
  position: relative;
  flex-shrink: 0;
}
.theme-switcher > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 12px;
  list-style: none;
  background: var(--raised);
  color: var(--ink);
}
.theme-switcher > summary::-webkit-details-marker,
.theme-switcher > summary::marker { content: ''; display: none; }
.theme-icon { width: 17px; height: 17px; }
.theme-chevron { width: 12px; height: 12px; }
.theme-switcher[open] .theme-chevron { transform: rotate(180deg); }
.theme-options {
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  background: var(--raised);
  color: var(--ink);
  border: 1px solid var(--line);
  width: 190px;
  max-width: calc(100vw - 32px);
  padding: 6px;
  margin: 0;
  list-style: none;
  box-shadow: 0 12px 32px #00000040;
  z-index: 30;
}
.theme-options button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.theme-options button:hover,
.theme-options button[aria-current="true"] {
  background: #e8eddf;
}
html[data-theme="dark"] .theme-options button:hover,
html[data-theme="dark"] .theme-options button[aria-current="true"] {
  background: #2a322e;
}

#chatwoot-slot,
.woot-widget-holder,
.woot-widget-bubble {
  color-scheme: inherit;
}

@media (max-width: 640px) {
  .theme-switcher .theme-current { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .theme-switcher > summary { padding-inline: 8px; }
}

/* Demo-B and leftover light-only surfaces. */
.lead { color: var(--muted); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .demo-b .b-catalog,
  :root:not([data-theme="light"]) .demo-b .route-card,
  :root:not([data-theme="light"]) .demo-b .b-chaoshan-card,
  :root:not([data-theme="light"]) .demo-b .b-discoveries,
  :root:not([data-theme="light"]) .demo-b .trust-review-list li,
  :root:not([data-theme="light"]) .demo-b .trust-guarantee-list li,
  :root:not([data-theme="light"]) .demo-b .b-gateway-card,
  :root:not([data-theme="light"]) .demo-b .demo-footer,
  :root:not([data-theme="light"]) .demo-footer {
    background: var(--raised);
    color: var(--ink);
    border-color: var(--line);
  }
  :root:not([data-theme="light"]) .demo-b .b-hero-photo {
    background: #1c201d;
  }
  :root:not([data-theme="light"]) .demo-b .b-hero-photo::after {
    background: var(--caption-scrim);
    inset: 40% 0 0;
  }
  :root:not([data-theme="light"]) .demo-b .b-contact-options .button.secondary {
    color: var(--ink);
    border-color: var(--line);
  }
  :root:not([data-theme="light"]) .intro,
  :root:not([data-theme="light"]) .closing,
  :root:not([data-theme="light"]) .notice,
  :root:not([data-theme="light"]) .coverage,
  :root:not([data-theme="light"]) .preview-panel,
  :root:not([data-theme="light"]) .review-strip {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line);
  }
  :root:not([data-theme="light"]) .home-hero figcaption,
  :root:not([data-theme="light"]) .product-hero figcaption {
    background: var(--caption-scrim);
    color: #fff;
  }
}

html[data-theme="dark"] .demo-b .b-catalog,
html[data-theme="dark"] .demo-b .route-card,
html[data-theme="dark"] .demo-b .b-chaoshan-card,
html[data-theme="dark"] .demo-b .b-discoveries,
html[data-theme="dark"] .demo-b .trust-review-list li,
html[data-theme="dark"] .demo-b .trust-guarantee-list li,
html[data-theme="dark"] .demo-b .b-gateway-card,
html[data-theme="dark"] .demo-b .demo-footer,
html[data-theme="dark"] .demo-footer {
  background: var(--raised);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="dark"] .demo-b .b-hero-photo { background: #1c201d; }
html[data-theme="dark"] .demo-b .b-hero-photo::after {
  background: var(--caption-scrim);
  inset: 40% 0 0;
}
html[data-theme="dark"] .demo-b .b-contact-options .button.secondary {
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="dark"] .intro,
html[data-theme="dark"] .closing,
html[data-theme="dark"] .notice,
html[data-theme="dark"] .coverage,
html[data-theme="dark"] .preview-panel,
html[data-theme="dark"] .review-strip {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
html[data-theme="dark"] .home-hero figcaption,
html[data-theme="dark"] .product-hero figcaption {
  background: var(--caption-scrim);
  color: #fff;
}


/* Force typography colors in dark mode so leftover light-theme hexes cannot linger.
   Filled buttons use --button-bg (dark rust) so cream labels meet 4.5:1. */
html[data-theme="dark"] body,
html[data-theme="dark"] .demo-b,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] dt,
html[data-theme="dark"] dd,
html[data-theme="dark"] label,
html[data-theme="dark"] summary,
html[data-theme="dark"] a,
html[data-theme="dark"] span,
html[data-theme="dark"] small,
html[data-theme="dark"] strong,
html[data-theme="dark"] select,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] button,
html[data-theme="dark"] th,
html[data-theme="dark"] td {
  color: var(--ink) !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body,
  :root:not([data-theme="light"]) .demo-b,
  :root:not([data-theme="light"]) h1,
  :root:not([data-theme="light"]) h2,
  :root:not([data-theme="light"]) h3,
  :root:not([data-theme="light"]) p,
  :root:not([data-theme="light"]) li,
  :root:not([data-theme="light"]) dt,
  :root:not([data-theme="light"]) dd,
  :root:not([data-theme="light"]) label,
  :root:not([data-theme="light"]) summary,
  :root:not([data-theme="light"]) a,
  :root:not([data-theme="light"]) span,
  :root:not([data-theme="light"]) small,
  :root:not([data-theme="light"]) strong,
  :root:not([data-theme="light"]) select,
  :root:not([data-theme="light"]) input,
  :root:not([data-theme="light"]) textarea,
  :root:not([data-theme="light"]) button,
  :root:not([data-theme="light"]) th,
  :root:not([data-theme="light"]) td {
    color: var(--ink) !important;
  }
}

html[data-theme="dark"] .fine,
html[data-theme="dark"] .quiet,
html[data-theme="dark"] .lead,
html[data-theme="dark"] .muted,
html[data-theme="dark"] .route-caption,
html[data-theme="dark"] .route-price-label,
html[data-theme="dark"] .b-intro,
html[data-theme="dark"] .b-service-note,
html[data-theme="dark"] .b-quick-start > span,
html[data-theme="dark"] .photo-notes,
html[data-theme="dark"] .photo-gallery figcaption,
html[data-theme="dark"] .why-grid p,
html[data-theme="dark"] .highlight-grid p,
html[data-theme="dark"] .photo-placeholder span,
html[data-theme="dark"] .demo-results .fine {
  color: var(--muted) !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fine,
  :root:not([data-theme="light"]) .quiet,
  :root:not([data-theme="light"]) .lead,
  :root:not([data-theme="light"]) .muted,
  :root:not([data-theme="light"]) .route-caption,
  :root:not([data-theme="light"]) .route-price-label,
  :root:not([data-theme="light"]) .b-intro,
  :root:not([data-theme="light"]) .b-service-note,
  :root:not([data-theme="light"]) .b-quick-start > span,
  :root:not([data-theme="light"]) .photo-notes,
  :root:not([data-theme="light"]) .photo-gallery figcaption,
  :root:not([data-theme="light"]) .why-grid p,
  :root:not([data-theme="light"]) .highlight-grid p,
  :root:not([data-theme="light"]) .photo-placeholder span,
  :root:not([data-theme="light"]) .demo-results .fine {
    color: var(--muted) !important;
  }
}

html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .route-meta,
html[data-theme="dark"] .route-meta span,
html[data-theme="dark"] .day-number,
html[data-theme="dark"] .meal,
html[data-theme="dark"] .category-grid span,
html[data-theme="dark"] .glance th {
  color: var(--red) !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .eyebrow,
  :root:not([data-theme="light"]) .route-meta,
  :root:not([data-theme="light"]) .route-meta span,
  :root:not([data-theme="light"]) .day-number,
  :root:not([data-theme="light"]) .meal,
  :root:not([data-theme="light"]) .category-grid span,
  :root:not([data-theme="light"]) .glance th {
    color: var(--red) !important;
  }
}

html[data-theme="dark"] .button:not(.secondary):not(.outline):not(.whatsapp-button):not(.b-whatsapp),
html[data-theme="dark"] .button:not(.secondary):not(.outline):not(.whatsapp-button):not(.b-whatsapp) span {
  background: var(--button-bg);
  border-color: var(--button-bg);
  color: var(--button-fg) !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .button:not(.secondary):not(.outline):not(.whatsapp-button):not(.b-whatsapp),
  :root:not([data-theme="light"]) .button:not(.secondary):not(.outline):not(.whatsapp-button):not(.b-whatsapp) span {
    background: var(--button-bg);
    border-color: var(--button-bg);
    color: var(--button-fg) !important;
  }
}

html[data-theme="dark"] .seal,
html[data-theme="dark"] .seal span {
  background: var(--button-bg);
  color: var(--button-fg) !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .seal,
  :root:not([data-theme="light"]) .seal span {
    background: var(--button-bg);
    color: var(--button-fg) !important;
  }
}

html[data-theme="dark"] .home-hero figcaption,
html[data-theme="dark"] .product-hero figcaption,
html[data-theme="dark"] .b-hero-photo figcaption,
html[data-theme="dark"] .b-hero-photo figcaption span,
html[data-theme="dark"] .home-hero figcaption span,
html[data-theme="dark"] .product-hero figcaption span {
  color: #fff !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .home-hero figcaption,
  :root:not([data-theme="light"]) .product-hero figcaption,
  :root:not([data-theme="light"]) .b-hero-photo figcaption,
  :root:not([data-theme="light"]) .b-hero-photo figcaption span,
  :root:not([data-theme="light"]) .home-hero figcaption span,
  :root:not([data-theme="light"]) .product-hero figcaption span {
    color: #fff !important;
  }
}

html[data-theme="dark"] .photo-placeholder,
html[data-theme="dark"] .why-grid article,
html[data-theme="dark"] .highlight-grid article,
html[data-theme="dark"] .price-panel {
  background: var(--raised);
  border-color: var(--line);
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .photo-placeholder,
  :root:not([data-theme="light"]) .why-grid article,
  :root:not([data-theme="light"]) .highlight-grid article,
  :root:not([data-theme="light"]) .price-panel {
    background: var(--raised);
    border-color: var(--line);
    color: var(--ink);
  }
}

html[data-theme="dark"] .trust-license,
html[data-theme="dark"] .trust-license figcaption,
html[data-theme="dark"] .trust-license figcaption span,
html[data-theme="dark"] .trust-license p {
  color: #3a3d38 !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .trust-license,
  :root:not([data-theme="light"]) .trust-license figcaption,
  :root:not([data-theme="light"]) .trust-license figcaption span,
  :root:not([data-theme="light"]) .trust-license p {
    color: #3a3d38 !important;
  }
}

html[data-theme="dark"] .whatsapp-float,
html[data-theme="dark"] .whatsapp-button,
html[data-theme="dark"] .b-whatsapp,
html[data-theme="dark"] .whatsapp-float svg,
html[data-theme="dark"] .b-whatsapp span {
  color: #fff !important;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .whatsapp-float,
  :root:not([data-theme="light"]) .whatsapp-button,
  :root:not([data-theme="light"]) .b-whatsapp,
  :root:not([data-theme="light"]) .whatsapp-float svg,
  :root:not([data-theme="light"]) .b-whatsapp span {
    color: #fff !important;
  }
}


/* Homepage B redeclares tokens on `.demo-b`; re-apply dark values there or the page stays split. */
html[data-theme="dark"] body,
html[data-theme="dark"] .demo-b {
  --paper: #161916;
  --paper-2: #1c201d;
  --green: #9ec9ab;
  --red: #e09176;
  --ink: #eeeae3;
  --muted: #b6bbb4;
  --line: #3d4540;
  --accent: #e09176;
  --on-accent: #f6f1e8;
  --input-bg: #1c201d;
  --input-border: #6a736d;
  --surface: #1c201d;
  --raised: #232926;
  --whatsapp: #146c43;
  --theme-chrome: #161916;
  --button-bg: #8a3c28;
  --button-fg: #f6f1e8;
  --photo-brightness: .8;
  --photo-saturate: .9;
  --photo-filter: brightness(var(--photo-brightness)) saturate(var(--photo-saturate));
  --caption-scrim: linear-gradient(to top, rgba(8, 10, 9, 0.96) 0%, rgba(8, 10, 9, 0.82) 38%, rgba(8, 10, 9, 0.4) 68%, transparent 100%);
  --trust-card-bg: #e8e2d6;
  --trust-card-border: #8a8478;
  background: var(--paper);
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body,
  :root:not([data-theme="light"]) .demo-b {
    --paper: #161916;
    --paper-2: #1c201d;
    --green: #9ec9ab;
    --red: #e09176;
    --ink: #eeeae3;
    --muted: #b6bbb4;
    --line: #3d4540;
    --accent: #e09176;
    --on-accent: #f6f1e8;
    --input-bg: #1c201d;
    --input-border: #6a736d;
    --surface: #1c201d;
    --raised: #232926;
    --whatsapp: #146c43;
    --theme-chrome: #161916;
    --button-bg: #8a3c28;
    --button-fg: #f6f1e8;
    --photo-brightness: .8;
    --photo-saturate: .9;
    --photo-filter: brightness(var(--photo-brightness)) saturate(var(--photo-saturate));
    --caption-scrim: linear-gradient(to top, rgba(8, 10, 9, 0.96) 0%, rgba(8, 10, 9, 0.82) 38%, rgba(8, 10, 9, 0.4) 68%, transparent 100%);
    --trust-card-bg: #e8e2d6;
    --trust-card-border: #8a8478;
    background: var(--paper);
    color: var(--ink);
  }
}


html[data-theme="dark"] .demo-b .b-destination-chips a,
html[data-theme="dark"] .demo-b .demo-filters,
html[data-theme="dark"] .demo-b .b-planning,
html[data-theme="dark"] .demo-b .b-trust,
html[data-theme="dark"] .demo-b .b-catalog,
html[data-theme="dark"] .demo-b .trust-photo-list figure {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .demo-b .b-destination-chips a,
  :root:not([data-theme="light"]) .demo-b .demo-filters,
  :root:not([data-theme="light"]) .demo-b .b-planning,
  :root:not([data-theme="light"]) .demo-b .b-trust,
  :root:not([data-theme="light"]) .demo-b .b-catalog,
  :root:not([data-theme="light"]) .demo-b .trust-photo-list figure {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--line);
  }
}
html[data-theme="dark"] .demo-b .b-destination-chips a:hover,
html[data-theme="dark"] .demo-b [data-demo-more]:hover {
  background: var(--raised);
  border-color: var(--accent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .demo-b .b-destination-chips a:hover,
  :root:not([data-theme="light"]) .demo-b [data-demo-more]:hover {
    background: var(--raised);
    border-color: var(--accent);
  }
}

/* The zoom dialog stays a light sheet in every theme. Dark-mode rules above
   force button and p text to --ink with !important, which is near-white and
   disappears on this beige. These rules come last and name the dialog. */
.trust-license-dialog {
  color-scheme: light;
  background: #f7f4ee !important;
  color: #1c1914 !important;
}
html[data-theme="dark"] .trust-license-dialog,
html[data-theme="dark"] .trust-license-dialog p,
html[data-theme="dark"] .trust-license-dialog button,
html[data-theme="light"] .trust-license-dialog,
html[data-theme="light"] .trust-license-dialog p,
html[data-theme="light"] .trust-license-dialog button,
:root:not([data-theme="light"]) .trust-license-dialog,
:root:not([data-theme="light"]) .trust-license-dialog p,
:root:not([data-theme="light"]) .trust-license-dialog button {
  color: #1c1914 !important;
  color-scheme: light;
}
.trust-license-zoom,
.trust-license-dialog .trust-license-close,
html[data-theme="dark"] .trust-license-zoom,
html[data-theme="dark"] .trust-license-dialog .trust-license-close,
html[data-theme="light"] .trust-license-zoom,
html[data-theme="light"] .trust-license-dialog .trust-license-close,
:root:not([data-theme="light"]) .trust-license-zoom,
:root:not([data-theme="light"]) .trust-license-dialog .trust-license-close {
  background: #fffdf9 !important;
  color: #1c1914 !important;
  border: 1px solid #5c564c !important;
}
.trust-license-dialog .trust-license-close:focus,
.trust-license-dialog .trust-license-close:focus-within,
.trust-license-zoom:focus,
.trust-license-zoom:focus-within,
.trust-license-zoom:focus-visible {
  outline: 3px solid #6e2e1c;
  outline-offset: 3px;
}

/* 图片署名在浅色和深色均保持可读。 */
html:root body .credited-image .image-credit{background:#fff!important;color:#192f32!important}html:root body .credited-image .image-credit a{color:#174e62!important}
