/* Public editorial theme. Light colours and layout remain in their original stylesheets.
   This render-blocking sheet is shared by all public HTML roots. No image inversion.
   Repeated root attributes deliberately outrank legacy scoped !important colours. */
html[data-system-theme][data-system-theme][data-system-theme] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  html[data-system-theme][data-system-theme][data-system-theme] {
    color-scheme: dark;
    --paper: #181b20;
    --ink: #f0f1f3;
    --muted: #c1c7d0;
    --line: #5f6774;
    --accent: #ffb4b8;
    --theme-surface: #23272e;
    --theme-raised: #2c323b;
    --theme-text: #f0f1f3;
    --theme-muted: #c1c7d0;
    --theme-link: #ffb4b8;
    --theme-focus: #f5d788;
    --theme-button: #9e303a;
    --card-static-border: #5f6774;
    background: var(--paper) !important;
    color: var(--theme-text) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body {
    background: var(--paper) !important;
    color: var(--theme-text) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :where(*) { border-color: var(--line) !important; }
  html[data-system-theme][data-system-theme][data-system-theme] :is(main, footer, .locale-stage, .regional-shell, .editorial-wrap,
    .information-page, .storage-info, .connectivity-checklist, .original-brand-hero) {
    color: var(--theme-text) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(h1,h2,h3,h4,h5,h6,dt,dd,th,td,label,summary,strong,details) {
    color: var(--theme-text) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(h1,h2,h3,h4,h5,h6) {
    -webkit-text-fill-color: currentColor;
    background-image: none !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(p,li,figcaption,small,cite,time,caption) {
    color: var(--theme-muted) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body a { color: var(--theme-link) !important; }
  html[data-system-theme][data-system-theme][data-system-theme] body a:hover { color: #ffd9dc !important; }
  html[data-system-theme][data-system-theme][data-system-theme] body a :is(h2,h3,strong) { color: inherit !important; }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(.eyebrow,.card-kicker,.tip-label,.photo-topic-badge,
    .photo-topic-cta,.story-cta,.related-picture-cta,.link-cta,.catalog-eyebrow,.visitor-eyebrow,
    .hero-tag,.hero-search,.accent,.step,.arrow,.connector,.item-symbol,.storage-icon,
    .guest-number,.audience-number,.route-number,.panel-core,.visual-index,.knowledge-feature-link,
    .measurement-arrows,.measurement-arrows span,.dimension-drawing span) {
    color: var(--theme-link) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(.credit,.excerpt,.partner-note,.ai-note,.hero-credit,
    .hero-sub,.offer-copy>p,.service-condition,.service-link-notice,.action-context,
    .action-tab-note,.market-preferences,.notice,.ordinary-notice,.booking-notice,
    .visible-image-caption,.category-image-note,.recommendation-credit,.photo-topic-credit,
    .tip-art-credit,.tip-image-caption,.locale-translation-note,.product-limit,
    .product-for-whom,.preparation-label,.amazon-variant-note,.amazon-us-missing,
    .unified-search-status,.unified-search-results a>span,.journey-detail,.hero-motto,
    .panel-label,.editorial-tag,.mini-eyebrow,.preview-count,.visitor-note,.context-note,
    .crumbs,.crumbs span,.visitor-breadcrumb) {
    color: var(--theme-muted) !important;
  }

  /* Surfaces: cards, reading aids, comparison tables and source disclosures. */
  html[data-system-theme][data-system-theme][data-system-theme] body :is(.story,.offer,.photo-topic-card,.knowledge-preview-card,
    .tattoo-preview-card,.related-picture-card,.connectivity-card,.visitor-topic-image,
    .service-card,.packing-product-card,.shipping-product-context,.stay-booking-options,
    .airport-taxi-choices,.rail-booking-choices,.remaining-partner-choices,.completion-choice,
    .japan-experience-choices,.general-catalog-card,.storage-info-grid>article,
    .guest-panel li,.guest-important,.guest-option,.section-explainer .visual-items>li,
    .decision-visual li,.visitor-upcoming-grid>div,.guide-links a,.article-roadmap a,
    .journey-link,.preview-card,.tip-jumps a,.in-japan-jump-links a,.hungary-program-choices a,
    .visitor-toc,.glass,.theme-light-editorial .glass,.everyday-tips .tip,
    .guest-start a,.skip,.page-skip,.section-explainer.reverse .visual-items>li,
    .section-explainer .visual-items>li) {
    background: var(--theme-surface) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(.offers-section,.everyday-tips,.tattoo-guidance,
    .knowledge-feature-card,.page-contents,.guest-start,.guest-panel,.guest-details,
    .guest-connector,.guest-contents,.guest-provenance,.section-explainer,.use-case-visual,
    .decision-visual,.article-roadmap,.journey-hero,.guide-search,.storage-conditions,
    .regional-shell aside,.locale-status,.locale-disclaimer,.current-place-fact,
    .visitor-upcoming,.arrival-branches>div,.rail-route,.route,.taxi-directions span,
    .hero-preview,.preview-tag,.source-badge,.connectivity-card-badge,
    .editorial-notice,.image-transfer-note,.photo-product-missing,
    .journey-link .journey-arrow,.section-explainer .connector) {
    background: var(--theme-raised) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(.visitor-content-section,.visitor-topics-hero) {
    background: var(--paper) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(.photo-topic-credit,.in-japan-card .credit,
    .product-visual figcaption,.product-photo-missing) { background: var(--theme-surface) !important; }
  html[data-system-theme][data-system-theme][data-system-theme] body main details:not(.credit details) {
    background-color: var(--theme-surface) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body main :is(th,.connectivity-table-region th) {
    background: var(--theme-raised) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(.section-photo,.tip-picture,.story-image,.photo-topic-image) {
    background-color: var(--theme-surface) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(.tile-matcha,.tile-sand,.tile-sakura,.tile-slate,
    .motion-panel,.hero-badge,.pros-box,.cons-box) {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body .prose-premium :is(code,pre,blockquote) {
    background: var(--theme-raised) !important;
    color: var(--theme-text) !important;
  }

  /* Older article renderers retain utility classes with literal light colours. */
  html[data-system-theme][data-system-theme][data-system-theme] body :is(
    [class*="bg-white"],[class*="bg-slate-"],[class*="backdrop-blur"],
    [class*="bg-[#fa" i],[class*="bg-[#f5" i],[class*="bg-[#f4" i]) {
    background-color: var(--theme-surface) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(
    [class*="text-slate-"],[class*="text-[#4" i],[class*="text-[#5" i],
    [class*="text-[#6" i],[class*="text-[#8c9490]" i]) { color: var(--theme-muted) !important; }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(
    [class*="text-[#1" i],[class*="text-[#2" i],[class*="text-white"]) {
    color: var(--theme-text) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(
    [class*="text-[#e53e3e]" i],[class*="text-[#a94a38]" i],
    .measure-height,.measure-width,.measure-depth) { color: var(--theme-link) !important; }

  /* Legacy light rules target every header, including article headings. */
  html[data-system-theme][data-system-theme][data-system-theme] body main header {
    background: transparent !important;
  }

  /* Header, native controls and floating panels use the same solid dark surfaces. */
  html[data-system-theme][data-system-theme][data-system-theme] body header.unified-header {
    background: var(--paper) !important;
    color: var(--theme-text) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body header.unified-header a { color: var(--theme-text) !important; }
  html[data-system-theme][data-system-theme][data-system-theme] body header.unified-header a:is(:hover,[aria-current]) {
    color: var(--theme-link) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body header.unified-header :is(.unified-language>div,
    .unified-mobile nav,.unified-search-panel,.market-preferences>div) {
    background: var(--theme-surface) !important;
    color: var(--theme-text) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body header.unified-header details { background: none !important; }
  /* Keep the supplied wordmark pixels unchanged and readable on their own light plate. */
  html[data-system-theme][data-system-theme][data-system-theme] .unified-brand img { background-color: #fafaf8; border-radius: 4px; }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(input,textarea,select,select option) {
    color-scheme: dark;
    background-color: var(--theme-raised) !important;
    color: var(--theme-text) !important;
    border-color: #8c96a5 !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(input,textarea)::placeholder {
    color: #b8c0cd !important;
    opacity: 1;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body .unified-search-close {
    background: var(--theme-raised) !important;
    color: var(--theme-link) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(.page-contents a,.journey-link,.knowledge-preview-card,
    .guide-links a,.topic-jumps a):hover {
    background-color: var(--theme-raised) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(.readable-footer,.locale-footer,footer) {
    background-color: var(--paper) !important;
    color: var(--theme-muted) !important;
  }

  /* Recognizable Dinosan red actions, including all existing retailer/service variants. */
  html[data-system-theme][data-system-theme][data-system-theme] body :is(a.button,.cta-primary,.hero-primary,
    a[data-retailer-cta],a[data-travel-service],a.product-cta,.amazon-jp,
    .external-action>a,.purchase-link a,.luggage-booking-copy>a,.stay-booking-cta,
    .general-catalog-cta,.current-offer-action a,.arigato-catalog .action a,
    .completion-choice>a,.partner-choice-grid a,.airport-booking-grid a,
    .uber-airport-grid a,.taxi-choice-grid a,.rail-choice-grid a,
    .shipping-product-context>a,.service-filters a[aria-current],
    a[class*="bg-linear-to-r"],button[class*="bg-linear-to-r"]) {
    background: var(--theme-button) !important;
    color: #fff !important;
    border-color: #ee9ba3 !important;
    box-shadow: inset 0 0 0 1px #ee9ba3;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(.external-action>a,.purchase-link a,.hero-primary,
    a.button,a[data-retailer-cta],a[data-travel-service],a.product-cta,.amazon-jp):hover {
    background: #b43c47 !important;
    color: #fff !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(.hero-secondary,.cta-secondary,.amazon-us,.back-to-top) {
    background: var(--theme-surface) !important;
    color: var(--theme-link) !important;
    border-color: var(--theme-link) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(.hero-secondary,.cta-secondary,.amazon-us,.back-to-top):hover {
    background: var(--theme-raised) !important;
    color: #ffd9dc !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :is(.external-action>a,.purchase-link a,a.button,
    a[data-retailer-cta],a[data-travel-service],a.product-cta) :is(span,strong) {
    color: inherit !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body .external-action>.action-tab-note {
    background: transparent !important;
    color: var(--theme-muted) !important;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body :focus-visible {
    outline: 3px solid var(--theme-focus) !important;
    outline-offset: 4px;
  }
  html[data-system-theme][data-system-theme][data-system-theme] body ::selection { background: #ffb4b8; color: #181b20; }
  html[data-system-theme][data-system-theme][data-system-theme] ::-webkit-scrollbar-track { background: var(--paper) !important; }
  html[data-system-theme][data-system-theme][data-system-theme] ::-webkit-scrollbar-thumb { background: #7e8999 !important; }
  html[data-system-theme][data-system-theme][data-system-theme]::view-transition-group(root),
  html[data-system-theme][data-system-theme][data-system-theme]::view-transition-image-pair(root),
  html[data-system-theme][data-system-theme][data-system-theme]::view-transition-old(root),
  html[data-system-theme][data-system-theme][data-system-theme]::view-transition-new(root) { background-color: var(--paper) !important; }
}
