/* Public appearance only. Theme boot runs before styles; images retain original colour. */
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;padding:0;border:1px solid var(--line);border-radius:6px;background:transparent;color:var(--ink);cursor:pointer}
.theme-toggle .theme-sun{display:none}
.theme-toggle:hover{background:var(--cream);color:var(--ink)}
.theme-toggle:focus-visible{outline:3px solid var(--coral);outline-offset:3px}
@media(max-width:760px){body .site-header.mobile-menu-ready.has-theme-toggle{grid-template-columns:1fr auto auto;column-gap:10px!important}body .site-header.has-theme-toggle .theme-toggle{grid-column:2;grid-row:1}body .site-header.has-theme-toggle .mobile-menu-toggle{grid-column:3;grid-row:1}body .site-header.has-theme-toggle>nav{grid-column:1/-1}}
html[data-theme=dark]{color-scheme:dark;--cream:#141c28;--paper:#1c2736;--ink:#f3eee5;--muted:#b6bdbb;--line:#3e4a59;--green:#b3c9b5;--coral:#f39180;--coral-hover:#f6a08f;--arc-dark-surface:#243244;--arc-dark-accent:#f3a28f;--arc-control-border:var(--line);background:var(--cream);color:var(--ink)}
html[data-theme=dark] .theme-toggle .theme-moon{display:none}
html[data-theme=dark] .theme-toggle .theme-sun{display:block}
html[data-theme=dark] body{background:var(--cream);color:var(--ink)}
html[data-theme=dark] :is(.site-header,.site-footer,.thai-gl-menu-links){background:var(--paper);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.site-header,.site-footer) .brand img,html[data-theme=dark] .site-footer-identity img{background:#fffdf8;border-radius:6px;padding:5px;filter:none}
html[data-theme=dark] :is(h1 em,.directory-heading em,.books-intro h1 em,.text-link,.eyebrow,.news-meta>span,.home-arc-category,.person-directory-info h2,.cast-nickname,.pair-deck em,.calendar-page .release-date,.calendar-page .episode,.calendar-page .slot a,.calendar-page .jump-links,.site-search-result small){color:var(--arc-dark-accent)!important}
html[data-theme=dark] a:hover{color:var(--coral)}
html[data-theme=dark] :is(.hero,.hero-balanced,.hero-copy){background:var(--cream)}
html[data-theme=dark] :is(.hero-guide,.hero-guide-day,.calendar-page .week-section,.calendar-page .agenda-day,.pair-hub-main,.book-buy,.article-contents,.collection,.notice,.pair-empty,.kr-trailer,.kr-watch,.al-summary,.shelly-feature .source-document){background:var(--paper);border-color:var(--line)}
html[data-theme=dark] :is(.hero-guide-day.is-today,.calendar-page .agenda-day.today){background:linear-gradient(180deg,#352d30,var(--paper));border-color:var(--coral)}
html[data-theme=dark] :is(.newsletter,body main .arc-sidebar>.newsletter){background:var(--arc-dark-surface);color:var(--ink)}
html[data-theme=dark] :is(.newsletter p,.newsletter small,.newsletter label,.newsletter .newsletter-status){color:var(--muted)}
html[data-theme=dark] :is(.intro,.books-intro p,.ships-directory-header p,.ship-directory-copy p,.cast-filter-label,.ship-status-label,.person-directory-name,.person-directory-bio,.person-directory-agency,.person-directory-birthday>span,.person-directory-birthday .person-directory-age,.person-directory-age,.actor-full-name,.actor-thai-name,.actor-editorial .actor-bio,.actor-fan-facts dd,.actor-professional dd,.actor-fan-facts dt,.actor-professional dt,.cast-full-name,.cast-birthday-label,.show-editorial .cast-full-name,.pair-description,.pair-context,.pair-hero-duo figcaption,.pair-hero-duo figcaption span,.pair-news-preview,.home-arc-excerpt,.news-excerpt,.calendar-page .synopsis,.calendar-page .quiet-day,.hero-guide-open,.hero-schedule-note,.hero-preview-search-note,.book-search-hint,.book-sort,.book-tools #book-count,.book-card p,.book-suggestions small,.side-note,.kr-dek){color:var(--muted)!important}
html[data-theme=dark] :is(.actor-zodiac,.show-editorial .cast-birthday .zodiac,.person-directory-zodiac,.actor-editorial .actor-socials a,.pair-card-copy>span,.pair-hub-heading>.eyebrow,.pair-section-head .eyebrow,.pair-hero-copy>.eyebrow){color:var(--arc-dark-accent);border-color:var(--line)}
html[data-theme=dark] :is(.actor-zodiac,.show-editorial .cast-birthday .zodiac){background:#352d30}
html[data-theme=dark] :is(.person-directory-photo,.person-directory-initials,.ship-directory-art,.pair-portrait,.pair-portrait:nth-child(even),.book-profile-art,.news-image,.home-arc-image,.calendar-page .calendar-art,.calendar-page .release-card>img,.calendar-page .agenda-card>img,.article-show-poster,.kr-pair-photo img,.kr-portrait img){background:var(--arc-dark-surface);color:var(--muted)}
/* Shared search and native controls, including lazy-rendered filter dialogs. */
html[data-theme=dark] body main#main:not(:has(#admin-content,.admin,.admin-studio)) :is(.search,.book-search,.people-directory-search,.ships-directory-search,.home-book-search,.book-suggestions,.hero-search-suggestions,.filter-options,.filter-menu,.directory-filter-drawer,.actor-page .actor-socials a){background:var(--paper);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(input,select,textarea){color:var(--ink);background-color:var(--paper);border-color:var(--line);accent-color:var(--coral)}
html[data-theme=dark] :is(.search,.book-search,.people-directory-search,.ships-directory-search) input{background:transparent}
html[data-theme=dark] body main#main:not(:has(#admin-content,.admin,.admin-studio)) input::placeholder{color:#acb5bc!important;opacity:1}
html[data-theme=dark] :is(.filter-option-search,.directory-bar select,.filter-group,.filter-panel,.sort-control,.book-option span){border-color:var(--line)}
html[data-theme=dark] :is(.book-suggestions [role=option]:hover,.book-suggestions [aria-selected=true],.hero-search-suggestions [aria-selected=true],.site-search-result:hover,#directory-form .filter-options label:hover,.thai-gl-menu-links>a:hover){background:var(--arc-dark-surface);color:var(--ink)}
/* Keep text dark on coral; never invert the primary action with --ink. */
html[data-theme=dark] body :is(.button:not(.secondary),.pill,.show-watch-button,.pair-watch-button,.newsletter button){color:#182030!important;background:var(--coral);border-color:transparent}
html[data-theme=dark] body main#main:not(:has(#admin-content,.admin,.admin-studio)) :is(.search,.book-search,.people-directory-search,.ships-directory-search) button:not([type=button]),html[data-theme=dark] body main#main:not(:has(#admin-content,.admin,.admin-studio)) :is(.people-directory-search,.ships-directory-search) .button{background:var(--coral);border-color:var(--coral);color:#182030!important}
html[data-theme=dark] body main#main:not(:has(#admin-content,.admin,.admin-studio)) :is(.chip.active,.chip[aria-selected=true],.chip[aria-pressed=true],.book-active .chip,.calendar-page .filters button[aria-pressed=true],.calendar-page .week-tabs button[aria-selected=true]),html[data-theme=dark] :is(.hero-category-filters button[aria-pressed=true],.cast-signs .active,.cast-age-filters .chip.active,.ship-status-filters .chip.active,#book-filters .book-filter-tabs [aria-selected=true],#book-filters .book-option input:checked+span){background:var(--coral);border-color:var(--coral);color:#182030}
html[data-theme=dark] body main#main:not(:has(#admin-content,.admin,.admin-studio)) #buy.book-buy .book-retailer:not(:first-child) .show-watch-button{background:var(--paper);border-color:var(--line);color:var(--ink)!important}
html[data-theme=dark] body main#main:not(:has(#admin-content,.admin,.admin-studio)) #buy.book-buy .book-retailer:not(:first-child) .show-watch-button:hover{background:var(--coral);color:#182030!important}
html[data-theme=dark] body main#main:not(:has(#admin-content,.admin,.admin-studio)) .profile-trailer-action{color:var(--ink)!important;border-color:var(--line)!important;background:transparent!important}
html[data-theme=dark] body main#main:not(:has(#admin-content,.admin,.admin-studio)) .profile-trailer-action:hover{background:var(--arc-dark-surface)!important}
html[data-theme=dark] :is(.hero-category-filters button,.calendar-page .filters button,.calendar-page .week-tabs button){background:var(--paper);border-color:var(--line);color:var(--ink)}
html[data-theme=dark] :is(.release-status,.release-status-completed){background:#303b49;color:#e5e8eb}
html[data-theme=dark] :is(.release-status-airing,.pair-hub .ship-profile-status strong){background:#284437;color:#c3e6ce}
html[data-theme=dark] .release-status-upcoming{background:#4b3333;color:#ffd0c4}
html[data-theme=dark] .pair-hub .ship-profile-status :is(.ship-status-ended,.ship-status-unknown){background:#303b49;color:#e5e8eb}
html[data-theme=dark] .site-footer .site-footer-bottom{color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.show-watch,.watch-panel,.show-watch-panel){--ink:#f3eee5;--paper:#1c2736;--cream:#141c28}
html[data-theme=dark] :is(.ad-space,.pair-banner-desktop,.pair-banner-mobile,.pair-rectangle-ad,.actor-banner-placeholder,.news-page .pair-banner-desktop,.news-page .pair-banner-mobile){background:var(--paper);border-color:var(--line);color:var(--muted)}
html[data-theme=dark] :is(dialog,.directory-filter-drawer)::backdrop{background:#080d16b8}
html[data-theme=dark] .home-shelf,html[data-theme=dark] .pair-rail{scrollbar-color:var(--line) transparent}

html[data-theme=dark] body main#main:not(:has(#admin-content,.admin,.admin-studio)) #hero-search{background:var(--paper);border-color:var(--line)}
html[data-theme=dark] body main#main:not(:has(#admin-content,.admin,.admin-studio)) #hero-search button[type=submit]{background:var(--coral);border-color:var(--coral);color:#182030}
html[data-theme=dark] :is(.site-header .brand img,.site-footer-identity img){mix-blend-mode:normal}
html[data-theme=dark] :is(.site-header .brand img,.site-footer-identity img){background:transparent;padding:0;filter:brightness(0) invert(94%)}
html[data-theme=dark] body main#main :is(.featured-person,.featured-portrait,.cast-initials,.cast-initials-large,.show-editorial .tag,.zodiac,.artwork-compact,.catalogue-title){background:var(--paper);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] body main#main :is(.show-synopsis,.synopsis-preview,.native-title,.series-meta,.cast-character,.show-editorial .cast-person p,.show-production dt,.show-production dd,.poster-credit,.pair-prominence,.pair-pending>summary,.pair-news-slot small){color:var(--muted)}
html[data-theme=dark] body main#main :is(.cast-display-name,.cast-explore,.synopsis-more,.synopsis-less,.actor-zodiac>div>span,.calendar-page .text-action,.calendar-page .empty-category a){color:var(--arc-dark-accent)}
html[data-theme=dark] body main#main :is(.profile-nav,.show-production,.show-production dl>div,.show-main-column,.show-sidebar){border-color:var(--line)}
html[data-theme=dark] :is(.actor-source-panel,.actor-editorial .actor-portrait figcaption,.book-cover-credit,.pair-hero-duo figcaption){color:var(--muted)!important}
html[data-theme=dark] :is(.hero-guide-meta>a,.calendar-page .release-meta>span){color:var(--arc-dark-accent)}
html[data-theme=dark] :is(.pair-watch-button,.show-watch-button) :is(span,small){color:inherit}
html[data-theme=dark] .pair-watch-menu>summary,html[data-theme=dark] .pair-watch-menu>summary small{color:#182030}
html[data-theme=dark] .pair-watch-menu a:hover{background:var(--arc-dark-surface);color:var(--ink)}
html[data-theme=dark] .sunflower{color:#e4b94e}
html[data-theme=dark] .ship-directory-portrait{color:var(--muted)}
