/* Loaded after the public styles; light mode keeps the original Fenix palette. */
:root{color-scheme:light}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;flex-shrink:0;min-height:44px;padding:9px 12px;border:1px solid var(--line);border-radius:6px;background:transparent;color:inherit;font:600 .75rem/1.2 'Segoe UI',Arial,sans-serif;cursor:pointer}
.theme-toggle:hover{border-color:var(--red)}
.theme-toggle:focus-visible{outline:3px solid var(--red);outline-offset:4px}
[data-theme-icon]{font-size:1.35rem;line-height:1}
.site-header .navigation{margin-left:auto}
html[data-theme="dark"]{color-scheme:dark;--ink:#f0efed;--paper:#22262c;--muted:#b4bac4;--line:#3b4048;--theme-background:#141619;--theme-surface:#1e2126;--theme-accent:#ff8d97}
html[data-theme="dark"] body{background:var(--theme-background);color:var(--ink)}
html[data-theme="dark"] :is(.site-header,.navigation nav,.navigation li ul,.menu-drawer,.menu-drawer-close,.content-card,.academy-card,.achievement-athlete,.belt-card,.memorial-card,.entry-popup,.entry-popup-close,.skip){background:var(--theme-surface);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] :is(.form-control,.form-select){background:var(--theme-background);color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:var(--muted);opacity:1}
html[data-theme="dark"] :is(.dojo-copy .lead,.principles p){color:var(--muted)}
html[data-theme="dark"] .principles strong{color:var(--ink)}
html[data-theme="dark"] :is(.principles>div,.ranking-results li,.menu-drawer-heading,.menu-drawer nav li ul){border-color:var(--line)}
html[data-theme="dark"] :is(.eyebrow,.academy-more,.ranking-dojo,.ranking-medal-label,.belt-dojo,.prose a,.page-heading h1 span,.ranking-heading h2 em,.belts-heading h1 em,.dojo-copy h2 em){color:var(--theme-accent)}
html[data-theme="dark"] :is(.hero,.dark-section,.model-destaque){background:#101114;color:#fff}
html[data-theme="dark"] .navigation>nav>ul>li:last-child>a{background:#343a44;color:#fff}
html[data-theme="dark"] .btn-light{background:#fff;color:#17191d}
html[data-theme="dark"] .academy-year{background:#342126;color:var(--theme-accent);box-shadow:0 0 0 8px var(--theme-background)}
html[data-theme="dark"] .ranking-leader .ranking-main{background:linear-gradient(110deg,#342d1f,var(--theme-surface) 65%)}
html[data-theme="dark"] .ranking-leader .ranking-position{color:#e6c273}
html[data-theme="dark"] :is(.tag,.belt-grade,.ranking-avatar){background:#303540;color:var(--ink)}
html[data-theme="dark"] :is(.memorial-card img,.memorial-story .memorial-portrait,.card-image){background:#292b30}
html[data-theme="dark"] :is(.memorial-heading .eyebrow,.memorial-card .eyebrow,.memorial-card .underlink,.memorial-dates,.memorial-dedication){color:#d0b98f}
html[data-theme="dark"] .alert-success{background:#1b3327;color:#b4e9c6;border-color:#38694b}
html[data-theme="dark"] .alert-danger{background:#3b2025;color:#ffc0c6;border-color:#80434b}
html[data-theme="dark"] .site-header .brand img,html[data-theme="dark"] .menu-drawer .brand img{background:#faf9f6;border-radius:8px;padding:3px}
@media(min-width:1001px) and (max-width:1300px){.site-header{flex-wrap:wrap;gap:16px}.site-header .navigation{order:3;width:100%;margin:0}.site-header .navigation>nav>ul{justify-content:center;flex-wrap:wrap}.theme-toggle{margin-left:auto}}
@media(max-width:1000px){.site-header{gap:12px}.theme-toggle{width:44px;padding:8px}.theme-toggle [data-theme-label]{display:none}}
@media(max-width:400px){.site-header{flex-wrap:wrap}.site-header>.brand{width:100%}.site-header .navigation{margin-left:0}.theme-toggle{margin-left:auto}}
