/* v50: opt-in theme. Existing dark mode is unchanged. */
.drc-theme-control{display:flex;align-items:center;gap:7px;padding:6px 9px;margin-left:6px;border:1px solid #746247;border-radius:9px;color:#f1d8ae;font-weight:750;font:700 12px/1.2 system-ui,sans-serif;white-space:nowrap;cursor:pointer}
.drc-theme-control input{appearance:none;position:relative;width:36px;height:21px;background:#3d4757;border:1px solid #9b855f;border-radius:20px;cursor:pointer;flex:0 0 auto}
.drc-theme-control input:before{content:'';position:absolute;top:2px;left:2px;width:15px;height:15px;border-radius:50%;background:#e7c07d;transition:transform .18s}
.drc-theme-control input:checked{background:#bd8e47}.drc-theme-control input:checked:before{transform:translateX(15px);background:white}
.drc-theme-control input:focus-visible{outline:2px solid #e6b75e;outline-offset:3px}
@media(max-width:1070px){.drc-theme-control{margin:12px 0 0;justify-content:space-between;padding:14px 12px;min-height:48px}}
/* Editable lineup. Exact manual state is separate from automatic optimization. */
.lineup-editor-controls{margin:16px 0;padding:18px;border:1px solid #a37c49;background:#101c2d;border-radius:12px}
.lineup-editor-controls[hidden]{display:none!important}
.lineup-editor-controls>strong{display:block;font-size:17px;color:#f4dcae;margin-bottom:8px}
.editor-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:15px 0}
.editor-slot{min-height:92px;display:flex;align-items:center;flex-direction:column;justify-content:center;gap:4px;background:#1b293c;border:1px solid #826d51;border-radius:8px;color:#f0e7db;cursor:pointer;padding:8px}
.editor-slot small{font-size:10px;letter-spacing:.05em;color:#b4bfce}.editor-slot strong{font-size:18px;color:#f1cf91}.editor-slot span{font-size:11px;color:#b9c9d9}
.editor-slot:hover,.editor-slot.is-active,.editor-slot:focus-visible{outline:2px solid #edc77f;outline-offset:1px;background:#31405b}
.editor-replace-form{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:10px 0}.editor-replace-form label{font-size:12px;font-weight:700}.editor-replace-form input{flex:1;min-width:105px;max-width:210px}.editor-delta{padding:12px;background:#1b293c;border-radius:7px;margin:10px 0;font-size:13px}
[data-drag-token]{cursor:grab}
@media(max-width:490px){.editor-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.editor-replace-form input{max-width:100%}}
/* Theme variables and broad surfaces: explicit palette changes ensure legibility. */
html[data-theme="light"]{color-scheme:light;--bg:#f7f8fb;--bg2:#edf1f6;--bg3:#e8edf4;--ink:#1e293b;--cream:#273449;--muted:#526177;--line:#c9d2df;--gold:#91601f;--gold2:#b5833f;--green:#247046;background:#f7f8fb}
html[data-theme="light"] body{background:#f7f8fb!important;color:#233044!important}
html[data-theme="light"] .site-header,html[data-theme="light"] .topbar{background:#fff!important;border-color:#d9dfe8!important}
html[data-theme="light"] .site-header .brand,html[data-theme="light"] .site-header .brand em,html[data-theme="light"] .site-header .site-nav a:not(.nav-mint){color:#263752!important}
html[data-theme="light"] .brand small,html[data-theme="light"] .section-copy,html[data-theme="light"] .micro-note,html[data-theme="light"] .section-label,html[data-theme="light"] .archive-attribution,html[data-theme="light"] .rank-metric,html[data-theme="light"] .field-label{color:#4b5d73!important}
html[data-theme="light"] h1,html[data-theme="light"] h2,html[data-theme="light"] h3,html[data-theme="light"] h4,html[data-theme="light"] .article h2,html[data-theme="light"] .article h3{color:#25344b!important}
html[data-theme="light"] p,html[data-theme="light"] li,html[data-theme="light"] small{color:#45566d}
html[data-theme="light"] .hero,html[data-theme="light"] .section,html[data-theme="light"] .bible-section,html[data-theme="light"] .community-section,html[data-theme="light"] .buildings-section{background:#f7f8fb!important;color:#24334b!important}
html[data-theme="light"] .hero{background:radial-gradient(ellipse at 80% 0%,#fff0d5 0%,transparent 55%),linear-gradient(#fbfcfe,#f0f4f8)!important}
html[data-theme="light"] .hero p,html[data-theme="light"] .article p,html[data-theme="light"] .article li,html[data-theme="light"] .card p,html[data-theme="light"] .card li{color:#43556a!important}
html[data-theme="light"] .panel,html[data-theme="light"] .card,html[data-theme="light"] .feature-card,html[data-theme="light"] .building-card,html[data-theme="light"] .building-showcase-card,html[data-theme="light"] .community-panel,html[data-theme="light"] .lineup-editor-controls,html[data-theme="light"] .wallet-lineup,html[data-theme="light"] .lineup-gold,html[data-theme="light"] .compare-card,html[data-theme="light"] .portfolio-dragon,html[data-theme="light"] .portfolio-single,html[data-theme="light"] .guide-table-wrap,html[data-theme="light"] .note{background:#fff!important;border-color:#cbd5e1!important;color:#26364f!important;box-shadow:0 8px 24px #24334b12!important}
html[data-theme="light"] .field,html[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]),html[data-theme="light"] select,html[data-theme="light"] textarea{background:#fff!important;color:#1e293b!important;border-color:#b6c4d6!important}
html[data-theme="light"] .field::placeholder,html[data-theme="light"] input::placeholder{color:#718096!important}
html[data-theme="light"] .token-chip,html[data-theme="light"] .editor-slot,html[data-theme="light"] .editor-delta,html[data-theme="light"] .trait-card,html[data-theme="light"] .reserved-set-row,html[data-theme="light"] .wallet-art-item,html[data-theme="light"] .portfolio-alternative,html[data-theme="light"] .suggestion-item,html[data-theme="light"] .bonus-chip,html[data-theme="light"] .guide-bonus-table thead th{background:#edf2f8!important;color:#23364e!important;border-color:#cbd5e1!important}
html[data-theme="light"] .editor-slot strong,html[data-theme="light"] .token-chip strong{color:#926221!important}
html[data-theme="light"] .editor-slot.is-active{background:#fff0cf!important;border-color:#ad7c2a!important}
html[data-theme="light"] .btn.ghost,html[data-theme="light"] .btn.secondary,html[data-theme="light"] .text-button,html[data-theme="light"] .edition-pill,html[data-theme="light"] .guide-back-to-top{background:#edf2f8!important;color:#24364e!important;border-color:#9faec1!important}
html[data-theme="light"] .btn.primary,html[data-theme="light"] .site-header .nav-mint{background:linear-gradient(110deg,#f9e4b6,#d6a65a)!important;color:#1e293b!important;border-color:#af813a!important}
html[data-theme="light"] .sitefoot,html[data-theme="light"] footer{background:#eaf0f6!important;color:#394a61!important;border-color:#c8d4df!important}
html[data-theme="light"] a:not(.btn):not(.nav-mint){text-decoration-color:#b98e50}
html[data-theme="light"] .guide-bonus-table th,html[data-theme="light"] .guide-bonus-table td,html[data-theme="light"] .bonus-table td,html[data-theme="light"] .bonus-table th{color:#293a52!important;border-color:#d1dae6!important}
html[data-theme="light"] .site-nav .nav-guides,html[data-theme="light"] .nav-guide-links{background:#fff!important;color:#233044!important;border-color:#cbd5e1!important}
html[data-theme="light"] .drc-theme-control{color:#27364b;border-color:#b4becd}
@media(max-width:1070px){html[data-theme="light"] .site-nav{background:#fff!important;border-color:#cbd5e1!important}}
/* Light hero must remain readable over the existing dark Dragon artwork. */
html[data-theme="light"] .hero-art{opacity:.20!important;filter:saturate(.75) brightness(1.3)!important}
html[data-theme="light"] .hero-overlay{background:linear-gradient(90deg,#f7f8fbfa 0%,#f7f8fbe8 43%,#f7f8fbc6 73%,#f7f8fba0 100%)!important}
html[data-theme="light"] .hero-content h1{color:#1f3048!important}
html[data-theme="light"] .hero-content h1 em{color:#986b2a!important}
html[data-theme="light"] .hero-content>p{color:#394c63!important}
html[data-theme="light"] .hero .eyebrow{color:#8c6129!important}
html[data-theme="light"] .hero-facts strong{color:#243750!important}
html[data-theme="light"] .hero-facts small{color:#475b72!important}
html[data-theme="light"] .hero-bottom{background:#f4f6fad9!important;color:#4b5b70!important}
html[data-theme="light"] .tcg-affiliation{background:#fff8e8!important;color:#27364b!important;border-color:#ab813e!important}
html[data-theme="light"] .tcg-affiliation strong{color:#27364b!important}
html[data-theme="light"] .site-header .site-nav>a:not(.nav-mint),html[data-theme="light"] .site-header .nav-guides>summary{color:#2d3d54!important}
html[data-theme="light"] .feature-card strong,html[data-theme="light"] .explorer-card header b,html[data-theme="light"] .empty-result strong,html[data-theme="light"] .lineup-slot b,html[data-theme="light"] .trait-card .trait-value{color:#253750!important}
html[data-theme="light"] .lineup-slot,html[data-theme="light"] .explorer-card,html[data-theme="light"] .empty-result,html[data-theme="light"] .gold-result,html[data-theme="light"] .bible-footnote,html[data-theme="light"] .notice{background:#eef3f9!important;border-color:#c4cedd!important;color:#273951!important}
html[data-theme="light"] .gold-result strong,html[data-theme="light"] .lineup-slot .slot-rank,html[data-theme="light"] .trait-card .trait-status{color:#364963!important}
html[data-theme="light"] .lineup-slot.is-pinned,html[data-theme="light"] .trait-card.is-matched{background:#e5f1e7!important;border-color:#78a68b!important}
html[data-theme="light"] .community-layout p,html[data-theme="light"] .building-card p,html[data-theme="light"] .feature-card small,html[data-theme="light"] .trait-lines{color:#405268!important}

html[data-theme="light"] .bar{background:#fff!important;color:#27364b!important;border-color:#cdd6e1!important}
html[data-theme="light"] .bar a,html[data-theme="light"] .bar strong{color:#24364a!important}
html[data-theme="light"] .bar small{color:#556579!important}
