/* Shared palette. Photo panels retain their dark, high-contrast treatment. */
html { color-scheme: dark; }
html.lightmode { color-scheme: light; --bg:#f2ede2; --bg2:#faf6ec; --ink:#181410; --mut:#4e4b46; --gold:#7d6224; --gold-b:#7d6224; --line:rgba(125,98,36,.25); --card:#fffdf8; --card2:#faf6ec; }
html.lightmode body { background-color:#f2ede2; color:#181410; }
html.lightmode :is(nav,.m-menu,.hero,.guides-hero,.thread-sec,.asst,.orb-wrap,.ed,.pillar,.visual-break,.photo-band,.full-bleed,.quiz-launch,.lb) {
  --bg:#0f0c08; --bg2:#161109; --ink:#f2ede2; --mut:#bdb5a5; --gold:#d4b661; --gold-b:#e8c869; --line:rgba(212,182,97,.25); --card:#18130c; --card2:#1d1710;
  color:#f2ede2; color-scheme:dark;
}
html.lightmode :is(.hero,.guides-hero) { background-color:#0f0c08; }
html.lightmode nav .links a { color:#bdb5a5; }
html.lightmode nav .links a:is(:hover,.active) { color:#e8c869; }
html.lightmode body .guides-hero :is(h1,h2,p,.eyebrow),html.lightmode body .visual-break .vb-caption { color:#f2ede2!important; }
html.lightmode #rq-embed .rq-scorewrap .rq-scorelabel { color:#d4b661; }
html.lightmode #rq-embed .rq-opt.on-r { color:#3f6b3a; }
html.lightmode #rq-embed .rq-opt.on-u { color:#9c463b; }
html.lightmode #rq-embed .rq-opt.on-n { color:#7d6224; }
@media (max-width:600px) { input,select,textarea { font-size:16px; } }
@supports (height:100dvh) { .m-menu { max-height:100dvh; overflow-y:auto; } }

/* Keep the navigation switch compact despite legacy per-page overrides. */
html body nav .mode-btn-cage,html body nav .mode-btn { width:44px!important; min-width:44px!important; max-width:44px!important; height:44px!important; padding:0!important; gap:0!important; flex:0 0 44px!important; }
html body nav .mode-btn .mb-label { display:none!important; }
html body nav .mode-btn .ic-sun { display:block!important; }
html body nav .mode-btn .ic-moon { display:none!important; }
html.lightmode body nav .mode-btn .ic-sun { display:none!important; }
html.lightmode body nav .mode-btn .ic-moon { display:block!important; }

/* Closed mobile navigation must leave keyboard and accessibility navigation. */
html body .m-menu { visibility:hidden; overflow-y:auto; overscroll-behavior-y:contain; justify-content:flex-start; }
html body .m-menu.on { visibility:visible; }
/* Preserve link targets when the menu is taller than a landscape viewport. */
html body .m-menu > * { flex-shrink:0; }

/* Visible keyboard focus and comfortable target sizes on interactive controls. */
html body :is(a,button,input,select,textarea,summary,[role="button"],[tabindex="0"]):focus-visible{outline:3px solid #e8c869!important;outline-offset:3px!important;box-shadow:0 0 0 5px rgba(12,10,8,.75)!important}
html.lightmode body :is(a,button,input,select,textarea,summary,[role="button"],[tabindex="0"]):focus-visible{outline-color:#755500!important;box-shadow:0 0 0 5px rgba(255,253,248,.95)!important}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}html body :is(a,button,summary,[role="button"]){transition-duration:0.01ms!important;animation-duration:0.01ms!important;animation-iteration-count:1!important}}

/* Touch targets and long labels must survive narrow screens and larger text. */
html body .bp-x { width:44px; height:44px; min-width:44px; min-height:44px; top:2px; right:2px; }
html body .lb-nav { min-width:44px; min-height:44px; }
html body .lb-cap { width:calc(100% - 32px); text-align:center; overflow-wrap:anywhere; }
@media(max-width:600px) {
  html body #rq-embed .rq-opt { flex:1 1 8rem; font-size:12px; white-space:normal; overflow:visible; overflow-wrap:anywhere; padding:10px 8px; }
  html body #rq-embed .rq-opts { flex-wrap:wrap; }
}
