/* The original navy-and-gold palette remains the dark theme. */
:root { color-scheme: dark; }
:root[data-theme=light] {
  color-scheme: light;
  --bg: #F6F2E9;
  --panel: #FFFFFF;
  --ink: #19283A;
  --muted: #596574;
  --line: #D7CCBA;
  --gold: #AD8540;
  /* Smaller gold text needs a deeper shade to meet normal-text contrast. */
  --gold-text: #806024;
}
.theme-toggle { display:inline-flex; align-items:center; justify-content:center; gap:8px; flex-shrink:0; min-height:44px; padding:10px 13px; border:1px solid var(--line); border-radius:24px; background:var(--panel); color:var(--ink); font-size:12px; cursor:pointer; white-space:nowrap; }
.theme-toggle:hover { border-color:var(--gold); }
.theme-toggle:focus-visible { outline:2px solid var(--gold); outline-offset:4px; }
.theme-toggle [data-theme-icon] { font-size:18px; line-height:1; }
header { position:relative; }
header nav { gap:18px; }
header nav .brand { margin-right:auto; }
header nav .links { gap:20px; }
:root[data-theme=light] .links { color:var(--ink); }
:root[data-theme=light] :is(.gold,.brand b,.eyebrow,.rank,.avatar,.metric,.reward-place,.reward-bottom strong,.reward-equation,.certificate h3,.certificate-amount strong,.text-button,.required,.upload-symbol,.sequence-title strong,.attachment button,.review-block h3,.completion-summary,.status-tag) { color:var(--gold-text); }
:root[data-theme=light] :is(.tabs button[aria-selected=true],.links a:hover,.progress-steps button[aria-current=step]) { color:var(--gold-text); }
:root[data-theme=light] .btn { color:#101721; }
:root[data-theme=light] .btn.alt { color:var(--ink); border-color:#867B69; }
:root[data-theme=light] .hero { background:radial-gradient(ellipse at 85% 70%,#AD854018,transparent 55%); }
:root[data-theme=light] .hero-art { border-color:var(--line); background:linear-gradient(135deg,#AD85400D,transparent); }
:root[data-theme=light] .piece { text-shadow:12px 20px 35px #19283A20; }
:root[data-theme=light] .art-caption { color:var(--gold-text); }
:root[data-theme=light] .art-corner { color:var(--muted); }
:root[data-theme=light] .regions { background:#EEE7DA; }
:root[data-theme=light] .trader.first { background:linear-gradient(145deg,#F4EADB,#FFFFFF 70%); border-color:var(--gold); }
:root[data-theme=light] :is(.standings,.reward-shell) { background:var(--panel); }
:root[data-theme=light] .reward-status { color:var(--gold-text); background:#F4EADB; }
:root[data-theme=light] .certificate { background:linear-gradient(135deg,#F4EADB,#FFFFFF); }
:root[data-theme=light] :is(.certificate-tier,.certificate-studio) { --metal:#536477; }
:root[data-theme=light] :is(.certificate-tier[data-certificate-tier=gold],.certificate-studio[data-tier=gold]) { --metal:#806024; }
:root[data-theme=light] :is(.certificate-tier[data-certificate-tier=platinum],.certificate-studio[data-tier=platinum]) { --metal:#386A70; }
:root[data-theme=light] :is(.certificate-tier[data-certificate-tier=ruby],.certificate-studio[data-tier=ruby]) { --metal:#9B3F59; }
:root[data-theme=light] :is(.certificate-tier:hover,.certificate-tier[aria-pressed=true]) { background:#F0EADF; }
:root[data-theme=light] .certificate-studio { background:var(--panel); }
:root[data-theme=light] .certificate-stage { background:radial-gradient(ellipse at center,#D7CCBA66,transparent 70%); }
:root[data-theme=light] .certificate-stage a { box-shadow:0 18px 44px #19283A24; }
:root[data-theme=light] .negative, :root[data-theme=light] #ranking td:nth-child(6) { color:#A43B32; }
:root[data-theme=light] #ranking td:nth-child(4) { color:#336A47; }
:root[data-theme=light] .portal label { color:var(--ink); }
:root[data-theme=light] .portal :is(input:not([type=checkbox]),select,textarea) { color-scheme:light; background:var(--panel); color:var(--ink); border-color:#867B69; }
:root[data-theme=light] .portal :is(input,textarea)::placeholder { color:var(--muted); }
:root[data-theme=light] :is(.upload-zone,.attachment,.attachment img,.attachment .evidence-open,.sequence-entry) { background:var(--bg); }
:root[data-theme=light] .form-errors { color:#8B2E27; background:#FCE9E5; border-color:#B9655C; }
:root[data-theme=light] .text-button.muted { color:var(--muted); }
@media(max-width:1050px) and (min-width:701px) { header nav { height:auto; min-height:84px; flex-wrap:wrap; padding-block:16px; } header nav .links { order:3; width:100%; justify-content:center; } }
@media(max-width:700px) { header nav { gap:10px; } header nav .links { top:100%; } .theme-toggle { padding:9px 11px; } header nav .brand { font-size:13px; letter-spacing:1px; } #menu { min-height:44px; } }
@media(max-width:380px) { header nav { flex-wrap:wrap; height:auto; min-height:70px; padding-block:12px; } .theme-toggle { gap:5px; } }
