/* Resolved data-theme reuses the app's palette; the two saved modes stay fixed. */
:root[data-theme="light"]{color-scheme:only light;--muted:#596b60}
:root[data-theme="dark"]{
  color-scheme:dark;--bg:#17231e;--paper:#223129;--ink:#edf5ee;--muted:#b9c9bd;--line:#506354;
  --jade:#8dd7b5;--jade-soft:#304c3e;--seal:#a6dab7;--seal-soft:#334b39;--gold:#eed49a;--gold-soft:#4c412a;
  --night:#14201a;--shadow:none;--e-wood:#9bd4a2;--e-fire:#ffb6a4;--e-earth:#e4c19b;--e-metal:#f0d78b;--e-water:#aacff4;
}
.theme-icons{display:inline-flex;align-items:center;gap:0;flex-shrink:0}
.theme-icons button{position:relative;display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:0;border-radius:12px;background:transparent;color:var(--muted);flex-shrink:0}
.theme-icons button::before{content:'';position:absolute;inset:6px;border:1px solid var(--line);border-radius:50%;background:var(--paper)}
.theme-icons button[aria-pressed="true"]{color:var(--ink)}
.theme-icons button[aria-pressed="true"]::before{border:2px solid var(--jade);background:var(--jade-soft)}
.theme-icons svg{position:relative;z-index:1;width:18px;height:18px}
.theme-icons button:focus-visible{outline:3px solid var(--jade);outline-offset:1px}
.theme-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.header-account{min-width:0;flex-wrap:nowrap}
@media(max-width:374px){.wrap>header{column-gap:6px}.wrap>header .brand-home{font-size:17px;gap:5px}.wrap>header .brand-icon{width:30px;height:30px}.header-account{gap:2px}.header-account .header-login{font-size:12px;padding-inline:8px}}
.brand-icon,.service-art,.toy-dashboard,.card-preview,#cardImg{color-scheme:only light}
html[data-theme="light"] .lucky-hero :is(.hero-copy,.hero-method),html[data-theme="light"] .login-welcome .label{color:#526354}
html[data-theme="light"] #services .svc>span:last-child{color:#56665c}
html[data-theme="light"] #services .svc>.tag.mem{color:#56696c}
html[data-theme="light"] .home-invite .invite-eyebrow{color:#796260}
html[data-theme="light"] .partner-disclaimer{color:var(--muted)}
html[data-theme="light"] :is(#result,.saved-result-body) .summary{--e-wood:#347046;--e-fire:#ac4935;--e-earth:#805c31;--e-metal:#7f621d;--e-water:#386793}
html[data-theme="light"] :is(#result,.saved-result-body) .summary .pillar .hz{color:#56685c}
html[data-theme="light"] .result-feedback small{color:#596751}
html[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
html[data-theme="dark"] .wrap>header{background:var(--bg)}
html[data-theme="dark"] :is(.card,.blk,.locked,.mbox,.bnav,.carbtn,.garage-extra,.drive-brief){background:var(--paper);color:var(--ink);border-color:var(--line);box-shadow:none}
html[data-theme="dark"] :is(input,select,textarea){background:var(--bg);color:var(--ink);border-color:var(--line);color-scheme:dark}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:var(--muted)}
html[data-theme="dark"] :is(button,a,input,select,textarea,summary):focus-visible{outline-color:var(--jade)}
html[data-theme="dark"] .brand-home{color:var(--ink)}
html[data-theme="dark"] :is(.header-login,.go,.copy,#cardModal #cardShare,.lucky-hero .cta){background:#317763;color:#fff;border-color:#82b6a0}
html[data-theme="dark"] .imgbtn{background:#317763;color:#fff}
html[data-theme="dark"] :is(.again,.imgbtn,.tabs button,.bnav button){color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .bnav button[aria-current="page"]{background:var(--jade-soft);color:var(--ink)}
html[data-theme="dark"] .lucky-hero{background:linear-gradient(130deg,#253d31,#2d3d30);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .lucky-hero :is(h2,.label,.hero-copy,.hero-method){color:var(--ink)}
html[data-theme="dark"] .lucky-hero :is(.hero-copy,.hero-method){color:var(--muted)}
html[data-theme="dark"] .toy-dashboard{background:#e9eee4;border-color:#b4c8b7}
html[data-theme="dark"] #services .svc[data-go="p"]{background:#383a2a!important}
html[data-theme="dark"] #services .svc[data-go="m"]{background:#3b2e39!important}
html[data-theme="dark"] #services .svc[data-go="k"]{background:#2e3c2c!important}
html[data-theme="dark"] #services .svc[data-go="g"]{background:#293c45!important}
html[data-theme="dark"] #services .svc{border-color:var(--line)}
html[data-theme="dark"] #services .svc :is(b,.tag){color:var(--ink)}
html[data-theme="dark"] #services .svc>.tag.mem{background:var(--jade-soft);color:var(--ink)}
html[data-theme="dark"] #services .svc>span:last-child{color:#cfdbd1}
html[data-theme="dark"] #services .service-art{background:#e9eee4;border-radius:14px}
html[data-theme="dark"] .home-invite{background:#342e2b;color:var(--ink)}
html[data-theme="dark"] .home-invite :is(p,.invite-eyebrow){color:#d7c8bf}
html[data-theme="dark"] .home-invite #homeShare{background:#223129;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] :is(.faq-section,.business-footer){background:var(--paper);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] :is(.faq-section,.business-footer) :is(p,li,small,a,button){color:var(--muted)}
html[data-theme="dark"] :is(.faq-contact,.contact-button,.contact-email){color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .faq-contact .contact-button{background:var(--jade-soft);color:var(--ink)}
html[data-theme="dark"] :is(.community-banner,.review-invite,.login-welcome,.welcome-pill,.garage-overview,.garage-toolbar,.garage-empty,.empty-state,#loading,#dailyProgress){background:var(--jade-soft);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] :is(.community-banner,.review-invite,.login-welcome,.garage-overview,.garage-toolbar,.garage-empty,.empty-state) :is(h2,h3,strong,small,p,time){color:var(--ink)}
html[data-theme="dark"] :is(.empty-hint,.garage-extra summary small,.maintenance-source,.partner-disclaimer,#loading .ls){color:var(--muted)}
html[data-theme="dark"] :is(.bureung-guide,#recentLoginNote){color:var(--muted)}
html[data-theme="dark"] :is(.fortune-sign-in,.result-feedback){background:var(--paper);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .result-feedback :is(.feedback-question,.feedback-label,small){color:var(--muted)}
html[data-theme="dark"] .result-feedback a{color:var(--jade)}
html[data-theme="dark"] .luck li.keepi .lk{color:#263728}
html[data-theme="dark"] .garage-extra summary strong{color:var(--ink)}
html[data-theme="dark"] :is(.garage-extra-body,.log-head,.brief-heading,.brief-source){border-color:var(--line)}
html[data-theme="dark"] :is(.drive-brief .brief-eyebrow,.drive-brief small,.brief-source summary,#briefWeather,#briefTrip){color:var(--muted)}
html[data-theme="dark"] :is(.drive-brief .brief-location,#briefSafety){background:var(--jade-soft);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] :is(.lucky-hero .drive-brief #weatherCity,#dailyCar,.weather-retry){background:var(--bg);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] :is(#result,.saved-result-body) .summary{--ink:#edf5ee;--muted:#b9c9bd;--line:#506354;--bg:#17231e;--paper:#223129;--e-wood:#9bd4a2;--e-fire:#ffb6a4;--e-earth:#e4c19b;--e-metal:#f0d78b;--e-water:#aacff4;background:linear-gradient(135deg,#253d31,#303b2c);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] :is(#result,.saved-result-body) .summary :is(.verdict,.pillar .v){color:var(--ink)}
html[data-theme="dark"] :is(#result,.saved-result-body) .summary .pillar{background:#223129;border-color:var(--line)}
html[data-theme="dark"] :is(#result,.saved-result-body) .summary :is(.pillar .hz,.pillar .s,.oh){color:var(--muted)}
html[data-theme="dark"] :is(#result,.saved-result-body) .summary .oh .ob{background:#445346}
html[data-theme="dark"] #cardModal .card-preview{background:#dfe8df}
html[data-theme="dark"] #cardModal .card-formats button[aria-pressed=true]{background:var(--jade-soft)}
/* High contrast modes remain controlled by the browser; artwork is never filtered/inverted. */
@media(forced-colors:active){.theme-icons button[aria-pressed="true"]::before{border:3px solid Highlight}.theme-icons button:focus-visible{outline-color:Highlight}}
