/* CAFA2 light-mode control, shared across study and exam pages. */
:root{--study-surface:#fff;--study-wash:#f3f6fa;--study-ink:#292e42;--study-muted:#58677a;--study-line:#d9e2eb;--study-accent:#087c66}
html[data-study-theme=light]{color-scheme:light}
html[data-study-theme=dark]{color-scheme:dark;--study-surface:#152129;--study-wash:#10191f;--study-ink:#e5edf3;--study-muted:#a7b7c3;--study-line:#354852;--study-accent:#70dec0}
body.study-shell .study-theme-control{position:relative;flex:none;line-height:1.3;color:inherit;font:12px/1.3 Arial,sans-serif;z-index:90}
body.study-shell .study-theme-control>summary{display:flex;align-items:center;gap:7px;padding:7px 9px;min-height:40px;list-style:none;cursor:pointer;border:1px solid #ffffff55;border-radius:7px;color:inherit}
.study-theme-control>summary::-webkit-details-marker{display:none}
.study-theme-control>summary>span:first-child{font-size:21px}
.study-theme-control [data-theme-label]{font-size:11px;opacity:.85}
body.study-shell .study-theme-menu{position:absolute;top:calc(100% + 8px);right:0;width:300px;max-width:calc(100vw - 20px);padding:15px;color:var(--study-ink);background:var(--study-surface);border:1px solid var(--study-line);border-radius:12px;box-shadow:0 12px 40px #08132c36;z-index:100;white-space:normal}
.study-theme-menu p{font-size:14px!important;margin:0 0 10px!important}
.study-theme-menu>div{display:grid;grid-template-columns:1fr 1fr 1.5fr;gap:5px}
body.study-shell .study-topbar .study-theme-menu button{display:block;width:100%;border:1px solid var(--study-line);border-radius:7px;background:var(--study-wash);color:var(--study-ink);padding:9px 4px;min-height:52px;height:auto;font:13px/1.3 Arial,sans-serif;white-space:normal;cursor:pointer}
body.study-shell .study-topbar .study-theme-menu button:hover{border-color:var(--study-accent);background:var(--study-wash)}
.study-theme-menu button small{display:block;margin-top:4px;color:var(--study-muted);font-size:10px}
.study-theme-menu button[aria-pressed=true]{outline:2px solid var(--study-accent);outline-offset:-2px}
.study-theme-menu .study-theme-hint{font-size:11px!important;line-height:1.5;margin:12px 0 0!important;color:var(--study-muted)}
@media(max-width:760px){body.study-shell .study-theme-control>summary{padding:6px;gap:5px;border-color:#ffffff44}.study-theme-word{display:none}.study-theme-control [data-theme-label]{font-size:10px;max-width:64px;overflow:hidden;text-overflow:ellipsis}body.study-shell .study-theme-menu{width:280px}}
@media(max-width:680px){body.study-shell .study-theme-menu{position:fixed;top:calc(var(--study-header-height,58px) + 8px);right:10px}}
@media print{.study-theme-control{display:none!important}}
