/* A separate user control keeps account settings distinct from the profile link. */
.user-control{position:relative;align-self:center}
.user-trigger{display:flex;align-items:center;gap:9px;border:1px solid #ffffff30;background:#ffffff0c;border-radius:12px;padding:8px 11px;min-height:48px;color:#fff}
.user-trigger:hover,.user-trigger[aria-expanded="true"]{background:#ffffff1c;border-color:#ffffff65}
.user-trigger-avatar{display:grid;place-items:center;width:31px;height:31px;border-radius:50%;background:#cde9ff;color:#164b74;font-weight:700;font-size:.75rem}
.user-trigger-copy{text-align:left;display:grid;gap:2px;max-width:110px;line-height:1.2}
.user-trigger-copy small{font-size:.65rem;color:#c2d6e9}.user-trigger-copy strong{font-size:.8rem;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.user-trigger>svg{width:15px;height:15px;transition:transform .15s}.user-trigger[aria-expanded="true"]>svg{transform:rotate(180deg)}
.user-settings[hidden]{display:none}
.user-settings{position:absolute;z-index:30;top:calc(100% + 12px);right:0;width:310px;max-width:calc(100vw - 30px);background:#fff;color:#27394d;border:1px solid #dfe7ef;border-radius:14px;box-shadow:0 16px 50px #06152635;padding:18px;text-align:left}
.user-settings:before{content:"";position:absolute;right:25px;top:-6px;width:10px;height:10px;background:inherit;border:inherit;border-right:0;border-bottom:0;transform:rotate(45deg)}
.user-settings-heading{display:grid;gap:4px;border-bottom:1px solid var(--line);padding-bottom:15px;margin-bottom:16px}
.user-settings-heading h2{font-size:.95rem;line-height:1.5}.user-settings-heading p{font-size:.75rem;color:var(--muted);overflow-wrap:anywhere;line-height:1.5}
.appearance-options{border:0;padding:0;margin:0 0 15px;min-width:0}.appearance-options legend{font-size:.8rem;font-weight:650;padding:0;margin-bottom:10px}
.appearance-options>div{display:flex;gap:6px}
.appearance-option{position:relative;flex:1;min-width:0;cursor:pointer}
.appearance-option input{position:absolute;opacity:0;width:1px;height:1px}
.appearance-option span{display:grid;place-items:center;gap:8px;border:1px solid #dce5ee;border-radius:8px;padding:11px 4px;color:#557087;font-size:.75rem}
.appearance-option svg{width:18px;height:18px}.appearance-option input:checked+span{color:#126caf;border-color:#258fe0;background:#eaf5ff;box-shadow:0 0 0 1px #258fe0}
.appearance-option input:focus-visible+span{outline:3px solid #79bdf4;outline-offset:3px}
.user-settings-note{font-size:.7rem;line-height:1.6;color:var(--muted);margin-bottom:14px}
.user-settings-links{border-top:1px solid var(--line);padding-top:9px;display:grid;gap:2px}
.user-settings-links :is(a,button){display:flex;align-items:center;gap:10px;width:100%;padding:11px 9px;border-radius:7px;font-size:.8rem;text-align:left;color:inherit}
.user-settings-links :is(a,button):hover{background:#edf5fc}.user-settings-links svg{width:18px;height:18px}.user-settings-links .user-signout{color:#b8394c}
@media(max-width:650px){.mfit-account{margin-left:auto}.user-trigger{padding:7px;gap:6px}.user-trigger-copy{display:none}.user-settings{right:0}.mfit-account>.demo-tag{display:none}}

/* Dark surfaces apply to the app, forms, dialogs and account entry screens. */
html[data-theme="dark"]{color:#e1eaf3;background:#101824;--surface:#1a2738;--line:#344256;--muted:#abbad0;--purple:#8fc8ff;--purple-dark:#7ab5f0;--green:#8ed8b3;--orange:#f3c381;--red:#f0a5b2}
html[data-theme="dark"] body{background:#101824;color:#e1eaf3}
html[data-theme="dark"] :is(.panel,.mfit-shortcuts,.finance-metrics article,.user-settings,dialog,.login-form-wrap,.login-box,.rest-clock){background:#1a2738;color:#e1eaf3;border-color:#344256}
html[data-theme="dark"] .mfit-header{background:#101c2b}
html[data-theme="dark"] .mfit-nav :is(button,a).active{background:#101824;color:#e5effa}
html[data-theme="dark"] .mfit-main :is(h1,h2,h3,strong),html[data-theme="dark"] .panel-header h2{color:#e1eaf3}
html[data-theme="dark"] :is(.input,input:not([type=checkbox]):not([type=radio]),select,textarea){background:#122032;color:#e5edf7;border-color:#45576d}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#9bafc7}
html[data-theme="dark"] :is(label,.field label,legend,th){color:#c5d3e4}
html[data-theme="dark"] :is(.page-heading p,.mfit-student-info small,.mfit-library-content p,.exercise-card p,.exercise-card small,.panel-header p,.method-session-tools>p,.method-summary small,.method-technique p,.block-sequence){color:#abbad0}
html[data-theme="dark"] :is(.button.secondary,.button.ghost,.tabs,.method-session-tools,.method-summary,.method-technique,.training-block>header,.student-welcome,.notice,.editor-session,.completion-control,.execution-record,.mfit-summary-link:hover,.mfit-review-row:hover,.mfit-student-row:hover,.mfit-shortcut:hover,.exercise-picker-row:hover,.assessment-photo-slot [data-photo-preview]){background:#23364d;color:#deebfa;border-color:#3b526c}
html[data-theme="dark"] .button.primary{background:#2389d8;color:#fff;border-color:#2389d8}
html[data-theme="dark"] .button.secondary:hover{background:#304b67}
html[data-theme="dark"] .tabs :is(button,a).active{background:#345775;color:#fff}
html[data-theme="dark"] :is(.button.ghost,.back-button,.exercise-reference,.mfit-shortcut,.mfit-student-row,.method-technique>strong){color:#8fcbff}
html[data-theme="dark"] :is(.coach-alert-grid .execution-record,.panel,.training-block,.exercise-picker,.technique-stage,.method-exercises){border-color:#344256}
html[data-theme="dark"] .notice.warning{background:#3a2e20;color:#f4d7a6;border-color:#705739}
html[data-theme="dark"] :is(.status.neutral,.status.purple){background:#34435d;color:#d9e7fb}
html[data-theme="dark"] .status.orange{background:#543d23;color:#ffdb9f}
html[data-theme="dark"] .status.green{background:#244537;color:#b2f1cc}
html[data-theme="dark"] .status.red{background:#542b37;color:#ffd2dd}
html[data-theme="dark"] :is(.progress-plot,.assessment-chart svg text){fill:#c2d3e8}
html[data-theme="dark"] :is(.exercise-photo,.exercise-detail-photo,.workout-exercise-photo){background:#e6e9ee}
html[data-theme="dark"] .user-settings-links :is(a,button):hover{background:#29415b}
html[data-theme="dark"] .user-settings-links .user-signout{color:#ffb2bd}
html[data-theme="dark"] .appearance-option span{border-color:#45576d;color:#c4d4e7}
html[data-theme="dark"] .appearance-option input:checked+span{background:#23476a;color:#d7edff;border-color:#73baff}
html[data-theme="dark"] .user-settings .user-settings-heading h2{color:#e1eaf3}
html[data-theme="dark"] :is(.form-error,.toast.error){background:#502d39;color:#ffdae2;border-color:#845061}
html[data-theme="dark"] :is(.info-row,td,.session-header,.mfit-student-row,.mfit-review-row,.exercise){border-color:#344256}
html[data-theme="dark"] .login-story{background:#101c2b}
html[data-theme="dark"] :is(th,.metric,.cycle-panel,.topbar,.login-page){background:#1a2738;color:#e1eaf3;border-color:#344256}
html[data-theme="dark"] .mfit-main .search-box input{background:#122032;color:#e5edf7}
html[data-theme="dark"] :is(tbody tr:hover,.modal-header .icon-button,.inline-code){background:#293d54;color:#e1eaf3}
html[data-theme="dark"] :is(.button.warning,.protocol-choice[aria-pressed="true"]){background:#453b28;color:#ffe0a6;border-color:#79613f}
html[data-theme="dark"] :is(.button.danger,.notice.danger){background:#502d39;color:#ffdae2;border-color:#845061}
html[data-theme="dark"] :is(.mfit-tile-icon,.session-letter,.timeline-icon,.library-group-title span){background:#294968;color:#b5ddff}
html[data-theme="dark"] .mfit-main .tabs :is(button,a){color:#bed2e8}
html[data-theme="dark"] .mfit-main .tabs :is(button,a).active{color:#fff}
html[data-theme="dark"] .panel-header{border-color:#344256}
