/* Account and guest menus share the same display controls. */
html body .account-menu > .account-menu-panel { animation: none; }
@media (prefers-reduced-motion: no-preference) {
    html body .account-menu[open] > .account-menu-panel {
        animation: account-menu-reveal 200ms ease-out both;
    }
    .preference-chevron { transition: transform 220ms ease-out; }
}
@keyframes account-menu-reveal {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
html body .top-nav .account-menu > summary { border-radius: 999px !important; gap: 10px; padding-inline: 16px !important; }
/* Guest login and display preferences are separate keyboard and pointer targets. */
html body .top-nav .account-menu > summary.nav-user-name,
html body .top-nav .guest-account-control.nav-user-name {
    height: 44px; min-height: 44px; box-sizing: border-box;
    font-size: 1.45rem; font-weight: 750; line-height: 1.2;
}
html body .top-nav .guest-account-control.nav-user-name {
    gap: 0; padding: 0 !important; border-radius: 999px;
    color: var(--color-physio-green-dark); background: var(--color-physio-green-light);
    box-shadow: inset 0 0 0 1px var(--color-physio-green-border); font-weight: 750; line-height: 1.2;
}
html body .top-nav .guest-account-control > .account-menu-guest {
    flex: 0 0 44px; width: 44px;
}
html body .top-nav .guest-login-link {
    display: inline-flex; align-items: center; flex: 1 1 auto; height: 44px; min-height: 44px; padding: 4px 4px 4px 16px;
    border-radius: 999px 0 0 999px; color: inherit; font: inherit; text-decoration: none;
    transition: background-color .18s ease, color .18s ease;
}
html body .top-nav .account-menu-guest > summary {
    width: 44px; min-height: 44px; padding: 0 !important; justify-content: center;
    border: 0; border-radius: 0 999px 999px 0 !important; background: transparent;
    color: inherit; font: inherit; transform: none;
}
html body .top-nav .guest-login-link:hover,
html body .top-nav .account-menu-guest > summary:hover,
html body .top-nav .account-menu-guest[open] > summary { background: #ccebd9; color: #104f35; }
html[data-theme='dark'] body .top-nav .guest-account-control { color: #c8f5db; background: #263f30; }
html[data-theme='dark'] body .top-nav .guest-login-link:hover,
html[data-theme='dark'] body .top-nav .account-menu-guest > summary:hover,
html[data-theme='dark'] body .top-nav .account-menu-guest[open] > summary { background: #31553f; color: #c8f5db; }
html body .top-nav .guest-login-link:focus-visible,
html body .top-nav .account-menu-guest > summary:focus-visible { outline: 3px solid #b97722; outline-offset: -3px; }
@media (prefers-reduced-motion: reduce) {
    html body .top-nav .guest-login-link { transition: none; }
}
html body .account-menu .account-menu-panel {
    width: 280px; min-width: 0; max-width: calc(100vw - 32px); padding: 8px;
    border-radius: 14px; border: 1px solid #c5dfd0; background: #fff;
    box-shadow: 0 8px 24px #0e4d3126; max-height: min(650px, 70vh); overflow-y: auto;
    color: #193c2e; font-size: 1.6rem; line-height: 1.4; z-index: 1050;
}
html body .account-menu-panel > a, .account-preference-group > summary {
    display: flex; align-items: center; gap: 12px; padding: 12px; min-height: 48px; margin-inline: 0;
    border-radius: 8px; font-size: inherit; font-weight: 600; color: inherit;
    text-decoration: none; cursor: pointer; list-style: none;
}
.account-menu-icon { width: 22px; height: 22px; flex: 0 0 22px; }
.account-preference-group > summary::-webkit-details-marker { display: none; }
html body .account-preference-group > summary:hover,
html body .account-preference-group[open] > summary { background: #eaf6ef; color: #0e4d31; }
.preference-chevron { width: 8px; height: 8px; border-right: 2px solid; border-bottom: 2px solid; transform: rotate(45deg); margin-left: auto; margin-right: 4px; }
.account-preference-group[open] .preference-chevron { transform: rotate(225deg); }
.account-preference-group.is-collapsing .preference-chevron { transform: rotate(45deg); }
.account-preference-content { margin: 2px 8px 8px; padding: 8px; border: 1px solid #d5e8dd; border-radius: 10px; }
.appearance-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 3px; border-radius: 8px; gap: 8px; }
.appearance-options [data-appearance-mode='system'] { grid-column: 1 / -1; }
html body .account-menu-panel button { font: inherit; cursor: pointer; }
.appearance-options button { border: 1px solid #a9c9b7; border-radius: 8px; background: #f0f8f3; color: #284d3c; padding: 9px 4px; min-height: 44px; }
.appearance-options button:hover { background: #dfefe5; border-color: #658e77; }
html body .appearance-options button[aria-pressed='true'] { background: #0e4d31; border-color: #0e4d31; color: #fff; }
.account-preference-switch { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: transparent; color: inherit; border: 0; padding: 8px; text-align: left; }
.preference-switch-track { width: 42px; height: 24px; border-radius: 999px; background: #738578; flex: 0 0 42px; padding: 3px; }
.preference-switch-track::before { content: ''; display: block; width: 18px; height: 18px; border-radius: 50%; background: white; transition: transform .15s; }
[aria-checked='true'] > .preference-switch-track { background: #0e4d31; }
[aria-checked='true'] > .preference-switch-track::before { transform: translateX(18px); }
html body .account-menu-panel :focus-visible { outline: 2px solid #b97722; outline-offset: 2px; }
html[data-theme='dark'] body .account-menu-panel { background: #14251c; color: #e7f5ec; border-color: #668273; }
html[data-theme='dark'] .account-preference-content { border-color: #668273; }
html[data-theme='dark'] body .account-preference-group > summary:hover,
html[data-theme='dark'] body .account-preference-group[open] > summary { background: #263f30; color: #e7f5ec; }
html[data-theme='dark'] .appearance-options button { background: #263f30; border-color: #668273; color: #e7f5ec; }
html[data-theme='dark'] .appearance-options button:hover { background: #31553f; border-color: #9bc5ad; }
html[data-theme='dark'] body .appearance-options button[aria-pressed='true'] { background: #bfe6cf; border-color: #bfe6cf; color: #14251c; }
html[data-high-contrast='1'] body .account-menu-panel { border: 2px solid currentColor; }
html[data-high-contrast='1'] body .account-menu-panel [aria-checked='true'] .preference-switch-track { background: #000; border: 1px solid #fff; }
html[data-high-contrast='1'][data-theme='dark'] body .account-menu-panel [aria-checked='true'] .preference-switch-track { background: #fff; }
html[data-high-contrast='1'][data-theme='dark'] .preference-switch-track::before { background: #000; }
html[data-large-text='1'] body .account-menu-panel { font-size: 1.9rem; }
@media (max-width: 1199px) { html body .account-menu-panel { left: auto; right: 0; } }
@media (prefers-reduced-motion: reduce) { .preference-switch-track::before { transition: none; } }

html[data-high-contrast='1'] body .account-menu-panel .appearance-options button[aria-pressed='true'] { outline: 3px solid currentColor; outline-offset: -4px; font-weight: 800; }

.display-preferences-status { margin: 8px 12px; font-size: 1.4rem; line-height: 1.5; }
.account-preference-switch:disabled { opacity: .6; cursor: wait; }
