.account-control {
    position: relative;
}
.account-control .profile {
    min-height: 44px;
    cursor: pointer;
}
.account-chevron {
    width: 7px;
    height: 7px;
    border: solid var(--muted);
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
    margin: -4px 4px 0 2px;
}
.profile[aria-expanded="true"] .account-chevron {
    transform: rotate(225deg);
    margin-top: 3px;
}
.account-options {
    position: absolute;
    z-index: 1050;
    inset-inline-end: 0;
    top: calc(100% + 8px);
    width: min(245px, calc(100vw - 32px));
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--theme-surface, white);
    box-shadow: 0 10px 32px rgb(8 18 35 / 18%);
}
.account-options[hidden] { display: none; }
.account-options :is(a, button) {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 550;
    text-align: start;
    color: var(--ink);
}
.account-options :is(a, button):is(:hover, :focus-visible) {
    background: var(--theme-raised, #f0f4fa);
}
.account-options .icon { width: 17px; height: 17px; vertical-align: middle; }
.account-options #logout {
    margin-top: 4px;
    border-top: 1px solid var(--line);
    border-radius: 0 0 7px 7px;
}
.account-switch {
    margin-inline-start: auto;
    width: 34px;
    height: 20px;
    border-radius: 12px;
    background: #64748b;
    padding: 3px;
}
.account-switch::after {
    content: "";
    display: block;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
}
[aria-checked="true"] .account-switch { background: #426ed7; }
[aria-checked="true"] .account-switch::after { transform: translateX(14px); }

@media screen {
    :root[data-bs-theme="dark"] {
        color-scheme: dark;
        --bg: #121924;
        --nav: #0e1622;
        --ink: #e5ebf5;
        --muted: #adbbcd;
        --line: #39475a;
        --blue: #a0bdff;
        --green: #85d8b5;
        --theme-surface: #1b2533;
        --theme-raised: #233042;
        --theme-text: var(--ink);
        --theme-muted: var(--muted);
        --theme-line: var(--line);
        --theme-focus: #92b5ff;
        --theme-accent: var(--blue);
        --theme-accent-soft: #233651;
        --theme-violet: #ceb9f9;
        --theme-violet-soft: #332b49;
        --theme-success: var(--green);
        --theme-success-soft: #193a32;
        --theme-danger: #ffabb2;
        --theme-danger-soft: #422830;
        --theme-warning: #f3cc82;
        --theme-warning-soft: #3b3224;
        --surface-alt: var(--theme-raised);
        --border: var(--line);
        --primary: var(--blue);
        --bs-body-color: var(--ink);
        --bs-body-bg: var(--bg);
        --bs-secondary-color: var(--muted);
        --bs-border-color: var(--line);
        --bs-heading-color: var(--ink);
        --bs-link-color: var(--blue);
        --bs-link-hover-color: #c0d3ff;
    }
    [data-bs-theme="dark"] dialog { background: var(--theme-surface); }
    [data-bs-theme="dark"] dialog::backdrop { background: rgb(5 10 18 / 70%); }
    [data-bs-theme="dark"] .btn-primary {
        --bs-btn-hover-bg: #375fbd;
        --bs-btn-active-bg: #3157ae;
        background-color: #335fbf;
        border-color: #5982d9;
        color: white;
    }
    [data-bs-theme="dark"] .btn-primary:hover { background-color: #375fbd; }
    [data-bs-theme="dark"] .btn-light:is(:hover, :active, :focus-visible),
    [data-bs-theme="dark"] .btn-outline-secondary:hover {
        color: var(--ink);
        background: var(--theme-raised);
        border-color: var(--theme-focus);
    }
    [data-bs-theme="dark"] .auth-page { background: var(--bg); }
    [data-bs-theme="dark"] :is(.form-control, .form-select):focus {
        background-color: var(--theme-surface);
        color: var(--ink);
        border-color: var(--theme-focus);
    }
}
@media print {
    :root[data-bs-theme="dark"] {
        color-scheme: light;
        --bs-heading-color: #172439;
        --bs-body-color: #172439;
        --bs-body-bg: white;
    }
}
