:root {
    --mf-primary: #0A2742;
    --mf-secondary: #123F69;
    --mf-accent: #C69A32;
    --mf-topbar-bg: #0A2742;
    --mf-topbar-text: #FFFFFF;
    --mf-sidebar-bg: #09223A;
    --mf-sidebar-text: #FFFFFF;
    --mf-workspace-start: #F4F7FA;
    --mf-workspace-end: #E7ECF0;
    --mf-surface: #FFFFFF;
    --mf-surface-alt: #F0F2F4;
    --mf-glass-bg: rgba(255,255,255,0.92);
    --mf-glass-blur: 10px;
    --mf-heading: #09243D;
    --mf-text: #1F2937;
    --mf-text-muted: #5B6472;
    --mf-link: #123F69;
    --mf-link-hover: #0F3456;
    --mf-button-primary-bg: #0A2742;
    --mf-button-primary-text: #FFFFFF;
    --mf-button-primary-hover: #0F3456;
    --mf-button-secondary-bg: #F0F2F4;
    --mf-button-secondary-text: #09243D;
    --mf-menu-active-bg: #C69A32;
    --mf-menu-active-text: #171717;
    --mf-input-bg: #FFFFFF;
    --mf-input-text: #111827;
    --mf-input-placeholder: #667085;
    --mf-input-border: #BAC3CA;
    --mf-border: #C9CFD5;
    --mf-focus-ring: #C69A32;
    --mf-success-bg: #DCFCE7;
    --mf-success-text: #14532D;
    --mf-warning-bg: #FEF3C7;
    --mf-warning-text: #78350F;
    --mf-error-bg: #FEE2E2;
    --mf-error-text: #7F1D1D;
    --mf-info-bg: #E0F2FE;
    --mf-info-text: #0C4A6E;
    --mf-shadow: 0 16px 40px rgba(15,23,42,0.12);
    --mf-radius-sm: 10px;
    --mf-radius-md: 18px;
    --mf-radius-lg: 28px;
    --mf-font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    --mf-display-font: Manrope, Inter, system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--mf-text);
    background:
        radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--mf-accent) 12%, transparent), transparent 28%),
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--mf-secondary) 18%, transparent), transparent 34%),
        linear-gradient(135deg, var(--mf-workspace-start), var(--mf-workspace-end));
    font-family: var(--mf-font-family);
}

a {
    color: var(--mf-link);
}

a:hover {
    color: var(--mf-link-hover);
}

button,
input,
select,
textarea {
    font: inherit;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--mf-focus-ring);
    outline-offset: 3px;
}

.mf-body,
.mf-shell {
    min-height: 100vh;
}

.mf-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
    align-items: center;
    gap: 18px;
    min-height: 76px;
    padding: 14px clamp(18px, 4vw, 48px);
    color: var(--mf-topbar-text);
    background-color: var(--mf-topbar-bg);
    background-image: linear-gradient(135deg, var(--mf-topbar-bg), color-mix(in srgb, var(--mf-secondary) 42%, var(--mf-topbar-bg)));
    border-bottom: 1px solid var(--mf-border);
    box-shadow: var(--mf-shadow);
}

.mf-brand,
.mf-user,
.mf-topnav {
    display: flex;
    align-items: center;
}

.mf-brand {
    gap: 12px;
    color: var(--mf-topbar-text);
    text-decoration: none;
}

.mf-brand-mark {
    display: grid;
    place-items: center;
    min-width: 46px;
    min-height: 46px;
    padding: 0 10px;
    border: 1px solid var(--mf-border);
    border-radius: var(--mf-radius-sm);
    color: var(--mf-topbar-text);
    background-color: var(--mf-surface);
    background-image: linear-gradient(135deg, var(--mf-glass-bg), color-mix(in srgb, var(--mf-surface) 72%, transparent));
    font-weight: 900;
    letter-spacing: .04em;
}

.mf-brand-logo {
    display: block;
    max-width: 180px;
    max-height: 54px;
    object-fit: contain;
}

.mf-brand strong,
.mf-brand small {
    display: block;
}

.mf-brand small,
.mf-login-brand p,
.mf-eyebrow {
    margin: 0;
    color: var(--mf-text-muted);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.mf-topbar .mf-brand small,
.mf-topbar .mf-user,
.mf-topbar .mf-menu summary {
    color: var(--mf-topbar-text);
}

.mf-topnav {
    justify-content: center;
    gap: 10px;
}

.mf-menu {
    position: relative;
}

.mf-menu summary {
    cursor: pointer;
    list-style: none;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid var(--mf-border);
    border-radius: 999px;
    background-color: color-mix(in srgb, var(--mf-surface) 14%, transparent);
    font-size: 13px;
    font-weight: 800;
}

.mf-menu summary::-webkit-details-marker {
    display: none;
}

.mf-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    min-width: 240px;
    padding: 10px;
    transform: translateX(-50%);
    color: var(--mf-text);
    background-color: var(--mf-surface);
    border: 1px solid var(--mf-border);
    border-radius: var(--mf-radius-md);
    box-shadow: var(--mf-shadow);
}

.mf-menu-panel a,
.mf-menu-panel span {
    display: block;
    padding: 10px 12px;
    border-radius: var(--mf-radius-sm);
    color: var(--mf-text);
    font-size: 14px;
    text-decoration: none;
}

.mf-menu-panel a:hover {
    color: var(--mf-menu-active-text);
    background: var(--mf-menu-active-bg);
}

.mf-user {
    justify-content: flex-end;
    gap: 10px;
    color: var(--mf-topbar-text);
    font-size: 13px;
    font-weight: 800;
}

.mf-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--mf-button-primary-text);
    background: var(--mf-button-primary-bg);
}

.mf-logout,
.mf-link {
    color: var(--mf-link);
    font-weight: 900;
    text-decoration: none;
}

.mf-topbar .mf-logout {
    color: var(--mf-topbar-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mf-main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(28px, 6vw, 72px) 0 80px;
}

.mf-hero,
.mf-card,
.mf-panel,
.mf-login-card,
.mf-preview-card,
.mf-preview-board {
    color: var(--mf-text);
    background-color: var(--mf-surface);
    background-image: linear-gradient(135deg, var(--mf-glass-bg), color-mix(in srgb, var(--mf-surface) 82%, transparent));
    border: 1px solid var(--mf-border);
    box-shadow: var(--mf-shadow);
    backdrop-filter: blur(var(--mf-glass-blur));
    -webkit-backdrop-filter: blur(var(--mf-glass-blur));
}

.mf-hero {
    padding: clamp(34px, 6vw, 72px);
    border-radius: var(--mf-radius-lg);
    overflow: hidden;
}

.mf-hero-compact {
    padding-block: clamp(30px, 4vw, 48px);
}

.mf-hero h1 {
    max-width: 850px;
    margin: 8px 0 14px;
    color: var(--mf-heading);
    font-family: var(--mf-display-font);
    font-size: clamp(38px, 6vw, 68px);
    line-height: .98;
}

.mf-hero p {
    max-width: 760px;
    color: var(--mf-text);
    font-size: 18px;
    line-height: 1.65;
}

.mf-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.mf-card {
    padding: 24px;
    border-radius: var(--mf-radius-md);
}

.mf-card h2,
.mf-panel h2,
.mf-preview-card h3 {
    margin: 10px 0;
    color: var(--mf-heading);
    font-family: var(--mf-display-font);
    font-size: 24px;
    line-height: 1.15;
}

.mf-card p,
.mf-panel p,
.mf-preview-card p {
    color: var(--mf-text-muted);
    line-height: 1.6;
}

.mf-card-badge,
.mf-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 7px 10px;
    border-radius: 999px;
    color: var(--mf-menu-active-text);
    background: var(--mf-menu-active-bg);
    font-size: 12px;
    font-weight: 900;
}

.mf-panel {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 24px;
    margin-top: 22px;
    padding: clamp(24px, 4vw, 42px);
    border-radius: var(--mf-radius-lg);
}

.mf-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mf-list span {
    padding: 14px;
    border: 1px solid var(--mf-border);
    border-radius: var(--mf-radius-sm);
    color: var(--mf-text);
    background: var(--mf-surface-alt);
    font-weight: 800;
}

.mf-alert {
    width: min(1180px, calc(100% - 32px));
    margin: 16px auto 0;
    padding: 13px 16px;
    border: 1px solid var(--mf-info-text);
    border-radius: var(--mf-radius-sm);
    color: var(--mf-info-text);
    background: var(--mf-info-bg);
    font-weight: 800;
}

.mf-alert-success {
    color: var(--mf-success-text);
    background: var(--mf-success-bg);
    border-color: var(--mf-success-text);
}

.mf-alert-warning {
    color: var(--mf-warning-text);
    background: var(--mf-warning-bg);
    border-color: var(--mf-warning-text);
}

.mf-alert-error {
    color: var(--mf-error-text);
    background: var(--mf-error-bg);
    border-color: var(--mf-error-text);
}

.mf-preview-card .mf-alert {
    width: auto;
    margin: 0;
    min-height: 48px;
}

.mf-login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 0;
    background:
        radial-gradient(circle at 15% 8%, color-mix(in srgb, var(--mf-accent) 14%, transparent), transparent 24%),
        radial-gradient(circle at 92% 12%, color-mix(in srgb, var(--mf-secondary) 22%, transparent), transparent 34%),
        linear-gradient(135deg, var(--mf-workspace-start), var(--mf-workspace-end));
}

.mf-login-shell {
    width: min(520px, calc(100% - 32px));
}

.mf-login-card {
    padding: clamp(28px, 6vw, 36px);
    border-radius: var(--mf-radius-lg);
}

.mf-login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mf-login-brand h1 {
    margin: 0;
    color: var(--mf-heading);
    font-family: var(--mf-display-font);
    font-size: clamp(28px, 5vw, 36px);
    line-height: 1.05;
}

.mf-login-copy {
    color: var(--mf-text);
    font-size: 16px;
    line-height: 1.65;
}

.mf-form {
    display: grid;
    gap: 15px;
    margin-top: 18px;
}

.mf-form label {
    display: grid;
    gap: 7px;
    color: var(--mf-text);
    font-weight: 900;
}

.mf-form input,
.mf-form select,
.mf-form textarea {
    width: 100%;
    min-height: 48px;
    padding: 14px 15px;
    color: var(--mf-input-text);
    background: var(--mf-input-bg);
    border: 1px solid var(--mf-input-border);
    border-radius: var(--mf-radius-sm);
}

.mf-form input::placeholder,
.mf-form textarea::placeholder {
    color: var(--mf-input-placeholder);
}

.mf-button-primary,
.mf-button-secondary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 13px 18px;
    border: 1px solid transparent;
    border-radius: var(--mf-radius-sm);
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

.mf-button-primary {
    color: var(--mf-button-primary-text);
    background: var(--mf-button-primary-bg);
    box-shadow: 0 14px 30px color-mix(in srgb, var(--mf-button-primary-bg) 30%, transparent);
}

.mf-button-primary:hover {
    color: var(--mf-button-primary-text);
    background: var(--mf-button-primary-hover);
    transform: translateY(-1px);
}

.mf-button-secondary {
    color: var(--mf-button-secondary-text);
    background: var(--mf-button-secondary-bg);
    border-color: var(--mf-border);
}

.mf-button-secondary:hover {
    color: var(--mf-menu-active-text);
    background: var(--mf-menu-active-bg);
}

.mf-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.mf-theme-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 24px;
}

.mf-preview-board {
    padding: 18px;
    border-radius: var(--mf-radius-lg);
    background:
        linear-gradient(135deg, var(--mf-workspace-start), var(--mf-workspace-end));
}

.mf-preview-board h2 {
    margin: 0 0 4px;
    color: var(--mf-heading);
    font-family: var(--mf-display-font);
}

.mf-preview-variants {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.mf-preview-card {
    padding: 14px;
    border-radius: var(--mf-radius-md);
}

.mf-preview-chrome {
    display: grid;
    grid-template-columns: 72px 1fr;
    min-height: 72px;
    margin: 10px 0;
    overflow: hidden;
    border: 1px solid var(--mf-border);
    border-radius: var(--mf-radius-sm);
}

.mf-preview-sidebar {
    color: var(--mf-sidebar-text);
    background: var(--mf-sidebar-bg);
}

.mf-preview-topbar {
    color: var(--mf-topbar-text);
    background: var(--mf-topbar-bg);
}

.mf-preview-sidebar,
.mf-preview-topbar {
    padding: 10px;
    font-size: 11px;
    font-weight: 900;
}

.mf-preview-field {
    display: block;
    width: 100%;
    margin: 8px 0;
    padding: 10px 12px;
    color: var(--mf-input-text);
    background: var(--mf-input-bg);
    border: 1px solid var(--mf-input-border);
    border-radius: var(--mf-radius-sm);
}

@media (max-width: 1000px) {
    .mf-topbar {
        position: static;
        grid-template-columns: 1fr;
    }

    .mf-topnav,
    .mf-user {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .mf-menu-panel {
        left: 0;
        transform: none;
    }

    .mf-grid,
    .mf-panel,
    .mf-list,
    .mf-theme-preview-grid,
    .mf-preview-variants {
        grid-template-columns: 1fr;
    }

    .mf-hero h1 {
        font-size: clamp(34px, 12vw, 48px);
    }
}

@media (max-width: 430px) {
    .mf-login-body {
        padding: 18px 0;
    }

    .mf-login-card {
        padding: 28px;
    }

    .mf-login-brand {
        align-items: flex-start;
    }

    .mf-login-brand h1 {
        font-size: 28px;
    }

    .mf-brand-mark {
        min-width: 42px;
        min-height: 42px;
    }
}
/* MainFace theme gallery v2: complete scenes per variant. */
.mf-preview-card {
    padding: 0;
    color: var(--mf-text);
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.mf-preview-scene {
    min-height: 360px;
    padding: 14px;
    overflow: hidden;
    border: 1px solid var(--mf-border);
    border-radius: var(--mf-radius-lg);
    background:
        radial-gradient(circle at 12% 10%, color-mix(in srgb, var(--mf-accent) 20%, transparent), transparent 25%),
        radial-gradient(circle at 88% 0%, color-mix(in srgb, var(--mf-secondary) 24%, transparent), transparent 32%),
        linear-gradient(135deg, var(--mf-workspace-start), var(--mf-workspace-end));
    box-shadow: var(--mf-shadow);
}

.mf-preview-mini-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--mf-topbar-text);
    background: var(--mf-topbar-bg);
    border: 1px solid var(--mf-border);
    border-radius: var(--mf-radius-sm);
    font-size: 12px;
    font-weight: 900;
}

.mf-preview-mini-topbar a {
    color: var(--mf-topbar-text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mf-preview-mini-body {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 12px;
    margin-top: 12px;
}

.mf-preview-mini-sidebar {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 244px;
    padding: 10px;
    color: var(--mf-sidebar-text);
    background: var(--mf-sidebar-bg);
    border: 1px solid var(--mf-border);
    border-radius: var(--mf-radius-sm);
    font-size: 11px;
    font-weight: 850;
}

.mf-preview-mini-sidebar span {
    padding: 8px 7px;
    border-radius: var(--mf-radius-sm);
}

.mf-preview-menu-active {
    color: var(--mf-menu-active-text);
    background: var(--mf-menu-active-bg);
}

.mf-preview-mini-content {
    min-width: 0;
}

.mf-preview-mini-card {
    min-height: 244px;
    padding: 14px;
    color: var(--mf-text);
    background-color: var(--mf-surface);
    background-image: linear-gradient(135deg, var(--mf-glass-bg), color-mix(in srgb, var(--mf-surface) 80%, transparent));
    border: 1px solid var(--mf-border);
    border-radius: var(--mf-radius-md);
    box-shadow: var(--mf-shadow);
    backdrop-filter: blur(var(--mf-glass-blur));
    -webkit-backdrop-filter: blur(var(--mf-glass-blur));
}

.mf-preview-mini-card h3 {
    margin: 10px 0 6px;
    color: var(--mf-heading);
    font-size: 19px;
}

.mf-preview-mini-card p {
    min-height: 44px;
    margin: 0 0 10px;
    color: var(--mf-text-muted);
    font-size: 12px;
    line-height: 1.45;
}

.mf-preview-mini-alert {
    display: inline-flex;
    margin-top: 10px;
    padding: 8px 10px;
    color: var(--mf-info-text);
    background: var(--mf-info-bg);
    border: 1px solid var(--mf-info-text);
    border-radius: var(--mf-radius-sm);
    font-size: 12px;
    font-weight: 850;
}

@media (max-width: 520px) {
    .mf-preview-mini-body {
        grid-template-columns: 1fr;
    }

    .mf-preview-mini-sidebar {
        min-height: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/*
 * MainFace visual variants. Color comes from the active theme; these rules
 * deliberately change the construction of the workspace and surfaces.
 */
.mf-style-light,
.mf-style-dark,
.mf-style-soft-glass,
.mf-style-premium-glass {
    --mf-scene-orb-one: color-mix(in srgb, var(--mf-accent) 18%, transparent);
    --mf-scene-orb-two: color-mix(in srgb, var(--mf-secondary) 18%, transparent);
}

body.mf-style-light,
.mf-preview-card.mf-style-light .mf-preview-scene {
    background:
        linear-gradient(145deg, var(--mf-workspace-start), var(--mf-workspace-end));
}

.mf-style-light .mf-hero,
.mf-style-light .mf-card,
.mf-style-light .mf-panel,
.mf-style-light .mf-login-card,
.mf-preview-card.mf-style-light .mf-preview-mini-card {
    background: var(--mf-surface);
    border-color: var(--mf-border);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.mf-style-light .mf-topbar,
.mf-preview-card.mf-style-light .mf-preview-mini-topbar {
    background: var(--mf-topbar-bg);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .12);
}

.mf-style-light .mf-sidebar,
.mf-preview-card.mf-style-light .mf-preview-mini-sidebar {
    background: var(--mf-sidebar-bg);
}

.mf-style-light .mf-menu-panel,
.mf-style-light .mf-list span {
    color: var(--mf-text);
    background: var(--mf-surface);
    border-color: var(--mf-border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}

.mf-style-light .mf-alert {
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

body.mf-style-dark,
.mf-preview-card.mf-style-dark .mf-preview-scene {
    background:
        linear-gradient(145deg, var(--mf-workspace-start), var(--mf-workspace-end));
}

.mf-style-dark .mf-hero,
.mf-style-dark .mf-card,
.mf-style-dark .mf-panel,
.mf-style-dark .mf-login-card,
.mf-preview-card.mf-style-dark .mf-preview-mini-card {
    background: var(--mf-surface);
    border-color: var(--mf-border);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .28);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.mf-style-dark .mf-topbar,
.mf-preview-card.mf-style-dark .mf-preview-mini-topbar {
    background: var(--mf-topbar-bg);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}

.mf-style-dark .mf-sidebar,
.mf-preview-card.mf-style-dark .mf-preview-mini-sidebar {
    background: var(--mf-sidebar-bg);
}

.mf-style-dark .mf-menu-panel,
.mf-style-dark .mf-list span {
    color: var(--mf-text);
    background: var(--mf-surface);
    border-color: var(--mf-border);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .26);
}

.mf-style-dark .mf-menu-panel a,
.mf-style-dark .mf-menu-panel span {
    color: var(--mf-text);
}

.mf-style-dark .mf-alert {
    color: var(--mf-text);
    background: color-mix(in srgb, var(--mf-info-text) 18%, var(--mf-surface));
    border-color: color-mix(in srgb, var(--mf-info-text) 62%, var(--mf-border));
    box-shadow: 0 14px 28px rgba(0, 0, 0, .22);
}

body.mf-style-soft-glass,
.mf-preview-card.mf-style-soft-glass .mf-preview-scene {
    background:
        var(--mf-glass-scene, none),
        radial-gradient(circle at 12% 16%, var(--mf-scene-orb-one), transparent 25%),
        radial-gradient(circle at 87% 6%, var(--mf-scene-orb-two), transparent 31%),
        linear-gradient(135deg, var(--mf-workspace-start), color-mix(in srgb, var(--mf-workspace-end) 82%, #ffffff));
}

.mf-style-soft-glass .mf-hero,
.mf-style-soft-glass .mf-card,
.mf-style-soft-glass .mf-panel,
.mf-style-soft-glass .mf-login-card,
.mf-preview-card.mf-style-soft-glass .mf-preview-mini-card {
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--mf-secondary) 28%, var(--mf-glass-bg)),
            color-mix(in srgb, var(--mf-primary) 16%, var(--mf-glass-bg)));
    border-color: rgba(255, 255, 255, .72);
    box-shadow: 0 24px 56px rgba(15, 23, 42, .18), inset 0 1px 0 rgba(255, 255, 255, .68);
    backdrop-filter: blur(var(--mf-glass-blur)) saturate(130%);
    -webkit-backdrop-filter: blur(var(--mf-glass-blur)) saturate(130%);
}

.mf-style-soft-glass .mf-topbar,
.mf-preview-card.mf-style-soft-glass .mf-preview-mini-topbar {
    color: var(--mf-heading);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--mf-secondary) 22%, rgba(255,255,255,.82)),
        color-mix(in srgb, var(--mf-primary) 12%, rgba(255,255,255,.74)));
    border-color: rgba(255, 255, 255, .28);
    backdrop-filter: blur(14px) saturate(125%);
    -webkit-backdrop-filter: blur(14px) saturate(125%);
}

.mf-style-soft-glass .mf-sidebar,
.mf-preview-card.mf-style-soft-glass .mf-preview-mini-sidebar {
    background: color-mix(in srgb, var(--mf-sidebar-bg) 84%, transparent);
    border-color: rgba(255, 255, 255, .30);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .20);
    backdrop-filter: blur(14px) saturate(125%);
    -webkit-backdrop-filter: blur(14px) saturate(125%);
}

.mf-style-soft-glass .mf-topbar a,
.mf-preview-card.mf-style-soft-glass .mf-preview-mini-topbar a {
    color: var(--mf-heading);
}

.mf-style-soft-glass .mf-menu-panel,
.mf-style-soft-glass .mf-list span {
    color: var(--mf-text);
    background: color-mix(in srgb, var(--mf-glass-bg) 90%, transparent);
    border-color: rgba(255, 255, 255, .68);
    box-shadow: 0 20px 44px rgba(15, 23, 42, .15), inset 0 1px 0 rgba(255, 255, 255, .60);
    backdrop-filter: blur(var(--mf-glass-blur)) saturate(130%);
    -webkit-backdrop-filter: blur(var(--mf-glass-blur)) saturate(130%);
}

.mf-style-soft-glass .mf-alert {
    box-shadow: 0 14px 28px rgba(15, 23, 42, .11), inset 0 1px 0 rgba(255, 255, 255, .54);
}

body.mf-style-premium-glass,
.mf-preview-card.mf-style-premium-glass .mf-preview-scene {
    background:
        var(--mf-glass-scene, none),
        radial-gradient(circle at 8% 14%, color-mix(in srgb, var(--mf-glow-color) 19%, transparent), transparent 24%),
        radial-gradient(circle at 90% 5%, color-mix(in srgb, var(--mf-secondary) 46%, transparent), transparent 31%),
        radial-gradient(circle at 54% 114%, color-mix(in srgb, var(--mf-glow-color) 14%, transparent), transparent 36%),
        linear-gradient(135deg, var(--mf-workspace-start), var(--mf-workspace-end));
}

.mf-style-premium-glass .mf-hero,
.mf-style-premium-glass .mf-card,
.mf-style-premium-glass .mf-panel,
.mf-style-premium-glass .mf-login-card,
.mf-preview-card.mf-style-premium-glass .mf-preview-mini-card {
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--mf-primary) 64%, rgba(3,10,20,.84)),
            color-mix(in srgb, var(--mf-secondary) 34%, rgba(3,10,20,.70)));
    border-color: color-mix(in srgb, var(--mf-glow-color) 32%, rgba(255, 255, 255, .24));
    box-shadow:
        0 30px 78px rgba(0, 0, 0, .46),
        0 0 0 1px rgba(255, 255, 255, .05) inset,
        0 0 30px color-mix(in srgb, var(--mf-glow-color) 12%, transparent);
    backdrop-filter: blur(var(--mf-glass-blur)) saturate(145%);
    -webkit-backdrop-filter: blur(var(--mf-glass-blur)) saturate(145%);
}

.mf-style-premium-glass .mf-topbar,
.mf-preview-card.mf-style-premium-glass .mf-preview-mini-topbar {
    background: color-mix(in srgb, var(--mf-topbar-bg) 78%, transparent);
    border-color: color-mix(in srgb, var(--mf-glow-color) 20%, rgba(255, 255, 255, .28));
    box-shadow: 0 14px 34px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .10);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.mf-style-premium-glass .mf-sidebar,
.mf-preview-card.mf-style-premium-glass .mf-preview-mini-sidebar {
    background: color-mix(in srgb, var(--mf-sidebar-bg) 78%, transparent);
    border-color: color-mix(in srgb, var(--mf-glow-color) 20%, rgba(255, 255, 255, .24));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 10px 0 28px rgba(0, 0, 0, .14);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.mf-style-premium-glass .mf-menu-panel,
.mf-style-premium-glass .mf-list span {
    color: var(--mf-text);
    background: linear-gradient(135deg, color-mix(in srgb, var(--mf-glass-bg) 80%, transparent), color-mix(in srgb, var(--mf-surface) 20%, transparent));
    border-color: color-mix(in srgb, var(--mf-glow-color) 25%, rgba(255, 255, 255, .24));
    box-shadow: 0 22px 56px rgba(0, 0, 0, .40), 0 0 20px color-mix(in srgb, var(--mf-glow-color) 9%, transparent), inset 0 1px 0 rgba(255, 255, 255, .07);
    backdrop-filter: blur(var(--mf-glass-blur)) saturate(145%);
    -webkit-backdrop-filter: blur(var(--mf-glass-blur)) saturate(145%);
}

.mf-style-premium-glass .mf-menu-panel a,
.mf-style-premium-glass .mf-menu-panel span {
    color: var(--mf-text);
}

.mf-style-premium-glass .mf-alert {
    color: var(--mf-text);
    background: linear-gradient(135deg, color-mix(in srgb, var(--mf-info-text) 18%, var(--mf-surface)), color-mix(in srgb, var(--mf-glass-bg) 72%, transparent));
    border-color: color-mix(in srgb, var(--mf-info-text) 58%, var(--mf-border));
    box-shadow: 0 16px 38px rgba(0, 0, 0, .30), 0 0 16px color-mix(in srgb, var(--mf-glow-color) 7%, transparent);
}

.mf-style-premium-glass .mf-brand-mark,
.mf-style-premium-glass .mf-card-badge,
.mf-preview-card.mf-style-premium-glass .mf-card-badge {
    box-shadow: 0 0 18px color-mix(in srgb, var(--mf-glow-color) 28%, transparent);
}

.mf-style-premium-glass .mf-button-primary,
.mf-preview-card.mf-style-premium-glass .mf-button-primary {
    box-shadow: 0 12px 28px color-mix(in srgb, var(--mf-button-primary-bg) 34%, transparent), 0 0 16px color-mix(in srgb, var(--mf-glow-color) 12%, transparent);
}

/* MainFace social-professional dashboard shell. */
.mf-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.mf-brand-symbol {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 12px;
}

.mf-topbar {
    grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
    min-height: 68px;
    padding-block: 10px;
}

.mf-iconbar {
    gap: 4px;
}

.mf-iconbar-item,
.mf-profile-menu > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 10px 12px;
    color: var(--mf-topbar-text);
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.mf-iconbar-item:hover,
.mf-iconbar-item:focus-visible,
.mf-profile-menu > summary:hover {
    color: var(--mf-topbar-text);
    background: color-mix(in srgb, var(--mf-topbar-text) 10%, transparent);
    border-color: color-mix(in srgb, var(--mf-topbar-text) 16%, transparent);
}

.mf-iconbar .mf-menu summary {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
}

.mf-profile-menu {
    position: relative;
    justify-self: end;
}

.mf-profile-menu summary {
    cursor: pointer;
    list-style: none;
}

.mf-profile-menu summary::-webkit-details-marker { display: none; }

.mf-profile-menu .mf-icon { width: 15px; height: 15px; }

.mf-profile-panel {
    right: 0;
    left: auto;
    transform: none;
}

.mf-menu-logout { color: var(--mf-error-text) !important; }

.mf-main-dashboard {
    width: min(1420px, calc(100% - 48px));
    max-width: none;
    padding-top: 0;
}

.mf-dashboard-cover {
    position: relative;
    height: clamp(260px, 22vw, 340px);
    margin: 0 calc((min(1420px, calc(100% - 48px)) - 100vw) / 2) -58px;
    overflow: hidden;
    background: var(--mf-dashboard-cover) center / cover no-repeat, linear-gradient(135deg, var(--mf-primary), var(--mf-secondary));
}

.mf-dashboard-cover::after {
    position: absolute;
    inset: auto 0 0;
    height: 44%;
    content: '';
    background: linear-gradient(transparent, color-mix(in srgb, var(--mf-workspace-start) 92%, transparent));
}

.mf-dashboard-cover-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,.20), transparent 52%, rgba(0,0,0,.08));
}

.mf-identity-block {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: end;
    gap: 22px;
    min-height: 152px;
    padding: 0 28px 24px;
}

.mf-user-avatar-large {
    display: grid;
    place-items: center;
    width: clamp(112px, 10vw, 138px);
    height: clamp(112px, 10vw, 138px);
    margin-top: -64px;
    color: var(--mf-button-primary-text);
    background: linear-gradient(135deg, var(--mf-button-primary-bg), var(--mf-secondary));
    border: 5px solid color-mix(in srgb, var(--mf-surface) 90%, white);
    border-radius: 50%;
    box-shadow: 0 18px 40px rgba(0,0,0,.28), 0 0 0 1px color-mix(in srgb, var(--mf-accent) 45%, transparent);
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 900;
    letter-spacing: .03em;
}

.mf-identity-copy h1 {
    margin: 4px 0 6px;
    color: var(--mf-heading);
    font-family: var(--mf-display-font);
    font-size: clamp(26px, 3vw, 38px);
    letter-spacing: 0;
}

.mf-identity-role { margin: 0; color: var(--mf-text); font-weight: 800; }
.mf-dashboard-eyebrow--empty { min-height: 15px; visibility: hidden; }
.mf-master-greeting { display: inline-flex; width: fit-content; margin: 10px 0 0; padding: 7px 11px; color: color-mix(in srgb, var(--mf-heading) 82%, #171717); background: color-mix(in srgb, var(--mf-accent) 24%, var(--mf-surface)); border: 1px solid color-mix(in srgb, var(--mf-accent) 52%, var(--mf-border)); border-radius: 999px; box-shadow: 0 8px 18px color-mix(in srgb, var(--mf-accent) 16%, transparent); font-size: 11px; font-weight: 900; letter-spacing: .08em; line-height: 1.25; }

.mf-identity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 10px;
    color: var(--mf-text-muted);
    font-size: 13px;
    font-weight: 750;
}

.mf-identity-meta span + span::before {
    margin-right: 16px;
    color: var(--mf-accent);
    content: '•';
}

.mf-dashboard-layout {
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.mf-sidebar {
    position: sticky;
    top: 86px;
    padding: 14px;
    color: var(--mf-text);
    background: color-mix(in srgb, var(--mf-surface) 84%, transparent);
    border: 1px solid var(--mf-border);
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(15,23,42,.08);
    backdrop-filter: blur(12px);
}

.mf-sidebar-heading {
    padding: 7px 10px 10px;
    color: var(--mf-text-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.mf-sidebar-nav { display: grid; gap: 4px; }

.mf-sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 9px 10px;
    color: var(--mf-text);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 760;
    text-decoration: none;
}

.mf-sidebar-item:hover { color: var(--mf-heading); background: color-mix(in srgb, var(--mf-primary) 9%, transparent); }
.mf-sidebar-item.is-active { color: var(--mf-menu-active-text); background: var(--mf-menu-active-bg); }
.mf-sidebar-item.is-upcoming { opacity: .58; cursor: default; }

.mf-dashboard-content { min-width: 0; }

.mf-dashboard-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: start;
    margin-bottom: 22px;
}

.mf-dashboard-heading h2,
.mf-internal-header h1 {
    margin: 4px 0 8px;
    color: var(--mf-heading);
    font-family: var(--mf-display-font);
    font-size: clamp(28px, 3.4vw, 42px);
    letter-spacing: 0;
}

.mf-dashboard-heading p,
.mf-internal-header > p { max-width: 780px; margin: 0; color: var(--mf-text-muted); line-height: 1.6; }

.mf-widget-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.mf-stat-card,
.mf-insight-card,
.mf-next-action,
.mf-module-status,
.mf-internal-content > .mf-insight-card {
    border: 1px solid var(--mf-border);
    box-shadow: 0 16px 36px rgba(15,23,42,.09);
    backdrop-filter: blur(var(--mf-glass-blur));
}

.mf-stat-card {
    display: grid;
    gap: 5px;
    min-height: 150px;
    padding: 18px;
    color: var(--mf-text);
    background: linear-gradient(140deg, color-mix(in srgb, var(--mf-surface) 88%, transparent), color-mix(in srgb, var(--mf-surface-alt) 54%, transparent));
    border-radius: 16px;
}

.mf-stat-icon,
.mf-card-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: var(--mf-menu-active-text);
    background: var(--mf-menu-active-bg);
    border-radius: 11px;
}

.mf-stat-value { color: var(--mf-heading); font-family: var(--mf-display-font); font-size: 30px; font-weight: 900; line-height: 1; }
.mf-stat-label { font-size: 13px; font-weight: 850; }
.mf-stat-trend { color: var(--mf-text-muted); font-size: 12px; }

.mf-dashboard-columns { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; margin-top: 16px; }

.mf-insight-card,
.mf-next-action,
.mf-module-status {
    padding: clamp(20px, 3vw, 28px);
    color: var(--mf-text);
    background: linear-gradient(135deg, color-mix(in srgb, var(--mf-surface) 90%, transparent), color-mix(in srgb, var(--mf-glass-bg) 68%, transparent));
    border-radius: 18px;
}

.mf-card-heading { display: flex; align-items: center; gap: 12px; }
.mf-card-heading h3,
.mf-next-action h3,
.mf-module-status h3 { margin: 3px 0 0; color: var(--mf-heading); font-family: var(--mf-display-font); font-size: 21px; }

.mf-activity-list { display: grid; gap: 0; margin-top: 18px; }
.mf-activity-list > div { display: grid; grid-template-columns: 16px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid color-mix(in srgb, var(--mf-border) 62%, transparent); }
.mf-activity-list p { margin: 0; color: var(--mf-text-muted); line-height: 1.5; }
.mf-activity-dot { width: 8px; height: 8px; margin-top: 7px; background: var(--mf-accent); border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, var(--mf-accent) 16%, transparent); }

.mf-next-action { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; background: linear-gradient(135deg, color-mix(in srgb, var(--mf-primary) 89%, var(--mf-surface)), color-mix(in srgb, var(--mf-secondary) 76%, var(--mf-primary))); }
.mf-next-action .mf-eyebrow,
.mf-next-action h3,
.mf-next-action p { color: #FFFFFF; }
.mf-next-action p { line-height: 1.6; }
.mf-next-action .mf-button-primary { margin-top: 8px; color: var(--mf-menu-active-text); background: var(--mf-menu-active-bg); box-shadow: none; }

.mf-module-status { margin-top: 16px; }
.mf-module-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.mf-module-status-grid > div { display: grid; gap: 5px; padding: 14px; background: color-mix(in srgb, var(--mf-surface-alt) 68%, transparent); border-radius: 12px; }
.mf-module-status-grid .mf-icon { color: var(--mf-primary); }
.mf-module-status-grid p { margin: 0; color: var(--mf-text); font-weight: 850; }
.mf-module-status-grid small { color: var(--mf-text-muted); }

.mf-internal-layout { margin-top: 26px; }
.mf-internal-content { min-width: 0; }
.mf-internal-header { margin-bottom: 20px; }

body.mf-login-body {
    background-color: var(--mf-workspace-start);
    background-image:
        linear-gradient(125deg, color-mix(in srgb, var(--mf-primary) 70%, rgba(0,0,0,.54)), color-mix(in srgb, var(--mf-secondary) 56%, rgba(0,0,0,.28))),
        var(--mf-login-background),
        linear-gradient(135deg, var(--mf-workspace-start), var(--mf-workspace-end));
    background-position: center, center, center;
    background-size: auto, cover, auto;
    background-repeat: no-repeat, no-repeat, no-repeat;
}

.mf-login-logo { display: block; width: min(180px, 44vw); max-height: 72px; object-fit: contain; }

@media (max-width: 1050px) {
    .mf-widget-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mf-dashboard-columns { grid-template-columns: 1fr; }
    .mf-dashboard-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 18px; }
}

@media (max-width: 760px) {
    .mf-topbar { grid-template-columns: auto 1fr auto; gap: 8px; padding: 10px 14px; }
    .mf-brand strong, .mf-brand small, .mf-user-name, .mf-iconbar-item > span { display: none; }
    .mf-brand-symbol { width: 38px; height: 38px; }
    .mf-topnav { justify-content: center; }
    .mf-iconbar-item, .mf-iconbar .mf-menu summary { min-width: 40px; padding: 10px; }
    .mf-profile-menu > summary { padding: 5px; }
    .mf-dashboard-cover { height: clamp(150px, 45vw, 210px); margin: 0 calc((min(100% - 32px, 1420px) - 100vw) / 2) -42px; }
    .mf-main-dashboard { width: min(100% - 32px, 1420px); }
    .mf-identity-block { align-items: center; gap: 14px; min-height: 128px; padding: 0 4px 20px; }
    .mf-user-avatar-large { width: 82px; height: 82px; margin-top: -42px; border-width: 4px; font-size: 24px; }
    .mf-identity-copy h1 { font-size: 24px; }
    .mf-identity-meta { display: grid; gap: 3px; }
    .mf-identity-meta span + span::before { display: none; }
    .mf-dashboard-layout { display: block; }
    .mf-sidebar { position: static; display: block; margin-bottom: 18px; overflow-x: auto; white-space: nowrap; }
    .mf-sidebar-heading { display: none; }
    .mf-sidebar-nav { display: flex; width: max-content; gap: 6px; }
    .mf-sidebar-item { min-height: 38px; padding: 8px 10px; }
    .mf-sidebar-item .mf-icon { width: 16px; height: 16px; }
    .mf-dashboard-heading { display: block; }
    .mf-dashboard-heading .mf-badge { margin-top: 12px; }
    .mf-module-status-grid { grid-template-columns: 1fr; }
}

/* Unified user avatar: every rendered profile image stays circular and cropped. */
.mf-avatar {
    display: inline-flex;
    position: relative;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    color: var(--mf-button-primary-text);
    background: var(--mf-avatar-bg, var(--mf-button-primary-bg));
    border: 3px solid color-mix(in srgb, var(--mf-surface) 82%, #fff);
    border-radius: 50%;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .28);
    font-weight: 900;
    line-height: 1;
}

.mf-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center center;
    border-radius: inherit;
}

.mf-avatar--sm { width: 40px; height: 40px; font-size: 13px; }
.mf-avatar--md { width: 72px; height: 72px; font-size: 22px; }
.mf-avatar--lg { width: 128px; height: 128px; font-size: 34px; }
.mf-avatar--xl { width: 148px; height: 148px; font-size: 42px; }

.mf-dashboard-avatar {
    width: clamp(128px, 10vw, 148px);
    height: clamp(128px, 10vw, 148px);
    margin-top: 0;
    border-width: 5px;
    box-shadow: 0 18px 40px rgba(0,0,0,.28), 0 0 0 1px color-mix(in srgb, var(--mf-accent) 45%, transparent);
}

.mf-profile-photo { width: 148px; height: 148px; margin: 0; }

/* Explicit user menu: intentionally separate from profile content panels. */
.mf-topbar { overflow: visible; }
.mf-user-menu { position: relative; z-index: 100; justify-self: end; }
.mf-user-menu__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    padding: 5px 9px;
    color: var(--mf-topbar-text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
}
.mf-user-menu__trigger:hover,
.mf-user-menu__trigger:focus-visible,
.mf-user-menu__trigger[aria-expanded="true"] { color: var(--mf-topbar-text); background: color-mix(in srgb, var(--mf-topbar-text) 10%, transparent); border-color: color-mix(in srgb, var(--mf-topbar-text) 18%, transparent); outline: 0; }
.mf-user-menu__trigger .mf-icon { width: 15px; height: 15px; }
.mf-user-menu__dropdown { position: absolute; top: calc(100% + 10px); right: 0; z-index: 2000; display: grid; min-width: 220px; padding: 7px; overflow: hidden; color: #122033; background: color-mix(in srgb, var(--mf-surface) 96%, #fff); border: 1px solid color-mix(in srgb, var(--mf-border) 80%, rgba(15,23,42,.12)); border-radius: 16px; box-shadow: 0 24px 60px rgba(15,23,42,.22); }
.mf-user-menu__dropdown[hidden] { display: none; }
.mf-user-menu__dropdown a { display: block; padding: 11px 12px; color: var(--mf-text); border-radius: 10px; font-size: 14px; font-weight: 800; text-decoration: none; }
.mf-user-menu__dropdown a:hover,
.mf-user-menu__dropdown a:focus-visible { color: var(--mf-menu-active-text); background: var(--mf-menu-active-bg); outline: 0; }
.mf-user-menu__dropdown .mf-menu-logout { color: var(--mf-error-text) !important; }

@media (max-width: 760px) {
    .mf-avatar--sm { width: 40px; height: 40px; }
    .mf-dashboard-avatar { width: 96px; height: 96px; border-width: 4px; font-size: 28px; }
    .mf-profile-photo { width: 128px; height: 128px; }
    .mf-user-menu__trigger { padding: 5px; }
    .mf-user-menu__dropdown { min-width: 208px; }
}

/* Clear premium login: intentionally independent from dashboard dark variants. */
body.mf-login-page {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--mf-login-text, #405166);
    background-color: #f7f8fa;
    background-image: var(--mf-login-background);
    background-position: var(--mf-login-background-position, center center);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

.mf-login-stage {
    position: relative;
    isolation: isolate;
    display: grid;
    justify-items: center;
    gap: 22px;
    width: min(100% - 32px, 720px);
    min-height: 100vh;
    margin: 0 auto;
    padding: clamp(32px, 6vw, 70px) 0;
}

.mf-login-stage::before,
.mf-login-stage::after {
    display: none;
    position: fixed;
    z-index: -2;
    width: min(48vw, 620px);
    aspect-ratio: 1;
    content: '';
    pointer-events: none;
    border-radius: 50%;
    filter: blur(4px);
    opacity: var(--mf-login-pattern-opacity, .10);
}

.mf-login-stage::before {
    top: 12%;
    left: -18%;
    background: color-mix(in srgb, var(--mf-login-soft-primary, #1c5f97) 78%, transparent);
}

.mf-login-stage::after {
    right: -18%;
    bottom: -8%;
    background: color-mix(in srgb, var(--mf-login-soft-accent, #c89a3d) 76%, transparent);
}

.mf-login-watermark {
    display: none;
    position: fixed;
    z-index: -1;
    top: 50%;
    left: 50%;
    width: min(58vw, 700px);
    transform: translate(-50%, -44%);
    pointer-events: none;
    opacity: var(--mf-login-watermark-opacity, .08);
}

.mf-login-watermark img {
    display: block;
    width: 100%;
    max-height: min(60vh, 600px);
    object-fit: contain;
}

.mf-login-brand {
    display: block;
    width: 100%;
}

.mf-login-brand-surface {
    display: grid;
    min-height: 104px;
    padding: 20px clamp(22px, 5vw, 44px);
    place-items: center;
    background: rgba(255, 255, 255, .92);
    border: 1px solid color-mix(in srgb, var(--mf-login-soft-primary, #1c5f97) 18%, rgba(255,255,255,.8));
    border-radius: 24px;
    box-shadow: 0 16px 44px rgba(15, 23, 42, .08), inset 0 1px 0 rgba(255,255,255,.82);
    backdrop-filter: blur(16px) saturate(118%);
    -webkit-backdrop-filter: blur(16px) saturate(118%);
}

.mf-login-logo {
    display: block;
    width: min(100%, 470px);
    max-height: 116px;
    object-fit: contain;
}

.mf-login-logo.is-symbol-fallback {
    width: 88px;
    height: 88px;
    max-height: 88px;
}

.mf-login-logo-fallback {
    display: none;
    width: 84px;
    height: 84px;
    place-items: center;
    color: var(--mf-login-button-text, #111827);
    background: var(--mf-login-button-bg, #c89a3d);
    border-radius: 50%;
    font-family: var(--mf-display-font, Inter, sans-serif);
    font-size: 28px;
    font-weight: 900;
}

.mf-login-logo-fallback.is-visible {
    display: grid;
}

body.mf-login-page .mf-login-card {
    position: relative;
    width: 100%;
    padding: clamp(30px, 6vw, 52px);
    overflow: hidden;
    color: var(--mf-login-text, #405166);
    background: var(--mf-login-card-bg, rgba(255,255,255,.94));
    border: 1px solid color-mix(in srgb, var(--mf-login-soft-accent, #c89a3d) 35%, rgba(255,255,255,.92));
    border-radius: 32px;
    box-shadow: var(--mf-login-card-shadow, 0 28px 80px rgba(15,23,42,.18));
    backdrop-filter: blur(18px) saturate(118%);
    -webkit-backdrop-filter: blur(18px) saturate(118%);
}

.mf-login-card-accent {
    position: absolute;
    top: 0;
    right: 12%;
    left: 12%;
    height: 4px;
    background: linear-gradient(90deg, var(--mf-login-soft-primary, #1c5f97), var(--mf-login-soft-accent, #c89a3d));
    border-radius: 0 0 999px 999px;
}

.mf-login-heading h1 {
    max-width: 600px;
    margin: 0;
    color: var(--mf-login-heading, #122033);
    font-family: var(--mf-display-font, Inter, sans-serif);
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 780;
    letter-spacing: 0;
    line-height: 1.08;
}

.mf-login-heading p {
    max-width: 590px;
    margin: 14px 0 0;
    color: var(--mf-login-text, #405166);
    font-size: clamp(16px, 2.2vw, 19px);
    line-height: 1.5;
}

.mf-login-alert {
    margin: 22px 0 0;
    padding: 13px 15px;
    color: #7f1d1d;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 14px;
    font-weight: 750;
}

.mf-login-form {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.mf-login-form label {
    margin-top: 8px;
    color: var(--mf-login-heading, #122033);
    font-size: 15px;
    font-weight: 800;
}

.mf-login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 58px;
    color: var(--mf-login-muted, #68788c);
    background: var(--mf-login-input-bg, #fff);
    border: 1px solid var(--mf-login-input-border, rgba(51,65,85,.26));
    border-radius: 14px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.mf-login-input-wrap:focus-within {
    border-color: var(--mf-login-input-focus, #1c5f97);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--mf-login-input-focus, #1c5f97) 15%, transparent);
}

.mf-login-input-wrap svg {
    width: 21px;
    height: 21px;
    margin-left: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.mf-login-input-wrap input {
    width: 100%;
    min-width: 0;
    height: 56px;
    padding: 0 16px 0 13px;
    color: var(--mf-login-input-text, #111827);
    background: transparent;
    border: 0;
    outline: 0;
    font: inherit;
}

.mf-login-input-wrap input::placeholder {
    color: var(--mf-login-muted, #68788c);
    opacity: .9;
}

.mf-login-password-wrap input {
    padding-right: 84px;
}

.mf-password-toggle {
    position: absolute;
    right: 10px;
    min-height: 36px;
    padding: 6px 10px;
    color: var(--mf-login-heading, #122033);
    background: transparent;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
}

.mf-password-toggle:hover,
.mf-password-toggle:focus-visible {
    color: var(--mf-login-input-focus, #1c5f97);
    background: color-mix(in srgb, var(--mf-login-soft-primary, #1c5f97) 10%, transparent);
    outline: 0;
}

.mf-login-submit {
    min-height: 60px;
    margin-top: 18px;
    padding: 14px 22px;
    color: var(--mf-login-button-text, #111827);
    background: var(--mf-login-button-bg, #c89a3d);
    border: 1px solid color-mix(in srgb, var(--mf-login-button-bg, #c89a3d) 82%, #000);
    border-radius: 14px;
    box-shadow: 0 14px 26px color-mix(in srgb, var(--mf-login-button-bg, #c89a3d) 28%, transparent);
    cursor: pointer;
    font: inherit;
    font-size: 16px;
    font-weight: 850;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.mf-login-submit:hover {
    filter: brightness(1.05);
    box-shadow: 0 18px 32px color-mix(in srgb, var(--mf-login-button-bg, #c89a3d) 36%, transparent);
    transform: translateY(-1px);
}

.mf-login-submit:focus-visible,
.mf-login-input-wrap input:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--mf-login-input-focus, #1c5f97) 34%, transparent);
    outline-offset: 2px;
}

.mf-login-security {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 24px 0 0;
    color: var(--mf-login-muted, #68788c);
    font-size: 14px;
    font-weight: 720;
}

.mf-login-security span {
    color: var(--mf-login-soft-accent, #c89a3d);
    font-size: 14px;
}

/* Personal profile */
.mf-profile-layout { align-items: start; }

.mf-profile-content { min-width: 0; }

.mf-profile-header,
.mf-profile-card,
.mf-profile-photo-card,
.mf-profile-panel {
    color: var(--mf-text);
}

.mf-profile-header { margin-bottom: 24px; }
.mf-profile-header h1 { margin: 4px 0 10px; color: var(--mf-heading); font-size: clamp(30px, 4vw, 44px); }
.mf-profile-header > p:last-child { max-width: 680px; margin: 0; line-height: 1.6; }

.mf-profile-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 6px;
    overflow-x: auto;
    background: color-mix(in srgb, var(--mf-surface) 84%, transparent);
    border: 1px solid var(--mf-border);
    border-radius: 14px;
    scrollbar-width: thin;
}

.mf-profile-tab {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 9px 14px;
    color: var(--mf-text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
}

.mf-profile-tab:hover,
.mf-profile-tab:focus-visible,
.mf-profile-tab.is-active {
    color: var(--mf-menu-active-text);
    background: var(--mf-menu-active-bg);
    border-color: color-mix(in srgb, var(--mf-accent) 35%, var(--mf-border));
    outline: 0;
}

.mf-profile-panel { display: none; }
.mf-profile-panel.is-active { display: block; }
.mf-profile-panel[hidden] { display: none; }

.mf-profile-photo-card,
.mf-profile-card {
    background: var(--mf-surface);
    border: 1px solid var(--mf-border);
    border-radius: 18px;
    box-shadow: 0 16px 38px color-mix(in srgb, var(--mf-shadow-color, #0f172a) 12%, transparent);
}

.mf-profile-photo-card {
    display: grid;
    grid-template-columns: minmax(130px, 170px) minmax(0, 1fr);
    gap: clamp(20px, 4vw, 38px);
    align-items: center;
    padding: clamp(22px, 4vw, 34px);
    margin-bottom: 22px;
}

.mf-profile-photo {
    display: grid;
    width: min(100%, 160px);
    aspect-ratio: 1;
    place-items: center;
    overflow: hidden;
    color: var(--mf-button-primary-text);
    background: linear-gradient(135deg, var(--mf-button-primary-bg), var(--mf-secondary));
    border: 5px solid color-mix(in srgb, var(--mf-surface) 82%, #fff);
    border-radius: 50%;
    box-shadow: 0 16px 32px color-mix(in srgb, var(--mf-button-primary-bg) 24%, transparent);
    font-family: var(--mf-display-font, Inter, sans-serif);
    font-size: 46px;
    font-weight: 900;
}

.mf-profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.mf-avatar { overflow: hidden; }
.mf-avatar img,
.mf-user-avatar-large img { width: 100%; height: 100%; object-fit: cover; }
.mf-profile-photo-card h2,
.mf-profile-card h2,
.mf-profile-section-heading h2 { margin: 3px 0 8px; color: var(--mf-heading); }
.mf-profile-photo-card p:not(.mf-eyebrow), .mf-profile-card > p { margin: 0; line-height: 1.6; }

.mf-photo-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.mf-photo-actions small { flex-basis: 100%; color: var(--mf-muted); }
.mf-photo-actions input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mf-file-button { cursor: pointer; }
.mf-inline-form { margin-top: 10px; }
.mf-text-button { padding: 0; color: var(--mf-error-text); background: transparent; border: 0; cursor: pointer; font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

.mf-profile-form,
.mf-profile-security-grid { display: grid; gap: 22px; }
.mf-profile-form { padding: clamp(22px, 4vw, 34px); background: var(--mf-surface); border: 1px solid var(--mf-border); border-radius: 18px; box-shadow: 0 16px 38px color-mix(in srgb, var(--mf-shadow-color, #0f172a) 12%, transparent); }
.mf-profile-section-heading { margin-top: 8px; }
.mf-profile-section-heading + .mf-profile-form-grid { margin-top: -6px; }
.mf-profile-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mf-profile-form label { display: grid; gap: 7px; color: var(--mf-text); font-size: 14px; font-weight: 800; }
.mf-profile-form input,
.mf-profile-form select,
.mf-profile-form textarea { width: 100%; box-sizing: border-box; color: var(--mf-input-text); background: var(--mf-input-bg); border: 1px solid var(--mf-input-border); border-radius: 12px; font: inherit; }
.mf-profile-form input,
.mf-profile-form select { min-height: 50px; padding: 12px 14px; }
.mf-profile-form textarea { min-height: 112px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.mf-profile-form input:focus,
.mf-profile-form select:focus,
.mf-profile-form textarea:focus { border-color: var(--mf-input-focus, var(--mf-primary)); outline: 3px solid color-mix(in srgb, var(--mf-input-focus, var(--mf-primary)) 24%, transparent); outline-offset: 1px; }
.mf-profile-form small { color: var(--mf-muted); font-size: 12px; font-weight: 600; line-height: 1.45; }
.mf-profile-span-2,
.mf-profile-email-field { grid-column: span 2; }
.mf-profile-email-field input[readonly] { color: var(--mf-muted); background: color-mix(in srgb, var(--mf-input-bg) 82%, var(--mf-secondary)); cursor: not-allowed; }

.mf-profile-security-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mf-profile-card { padding: clamp(22px, 4vw, 30px); }
.mf-profile-card.mf-profile-form { gap: 14px; }
.mf-password-field { position: relative; }
.mf-password-field input { padding-right: 88px; }
.mf-password-field button { position: absolute; top: 50%; right: 8px; padding: 7px 9px; color: var(--mf-text); background: transparent; border: 0; border-radius: 8px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 800; transform: translateY(-50%); }
.mf-password-field button:hover { background: color-mix(in srgb, var(--mf-primary) 10%, transparent); }
.mf-password-strength { display: grid; gap: 7px; }
.mf-password-strength span { display: block; width: 22%; height: 6px; background: var(--mf-border); border-radius: 999px; transition: width .2s ease, background .2s ease; }
.mf-password-strength small { color: var(--mf-muted); }
.mf-password-strength[data-strength="weak"] span { width: 34%; background: var(--mf-error-text); }
.mf-password-strength[data-strength="medium"] span { width: 66%; background: var(--mf-accent); }
.mf-password-strength[data-strength="strong"] span { width: 100%; background: var(--mf-success-text, #087a4b); }
.mf-password-rules { display: grid; gap: 4px; margin: 0; padding-left: 20px; color: var(--mf-muted); font-size: 13px; line-height: 1.45; }

.mf-access-card { margin-top: 22px; }
.mf-access-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.mf-access-list div { display: grid; gap: 6px; padding: 14px; background: color-mix(in srgb, var(--mf-surface) 82%, var(--mf-secondary)); border: 1px solid var(--mf-border); border-radius: 12px; }
.mf-access-list span { color: var(--mf-muted); font-size: 12px; font-weight: 700; }
.mf-access-list strong { color: var(--mf-heading); font-size: 14px; }

.mf-preference-list { display: grid; gap: 12px; }
.mf-switch { display: grid !important; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--mf-border); border-radius: 12px; cursor: pointer; }
.mf-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mf-switch > span { position: relative; grid-row: span 2; width: 42px; height: 24px; background: color-mix(in srgb, var(--mf-muted) 38%, transparent); border-radius: 999px; transition: background .18s ease; }
.mf-switch > span::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; content: ''; background: #fff; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,.16); transition: transform .18s ease; }
.mf-switch input:checked + span { background: var(--mf-button-primary-bg); }
.mf-switch input:checked + span::after { transform: translateX(18px); }
.mf-switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--mf-primary) 30%, transparent); outline-offset: 2px; }
.mf-switch b { color: var(--mf-heading); }
.mf-switch small { grid-column: 2; }

.mf-profile-tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mf-profile-tool-card { display: grid; gap: 10px; padding: 24px; color: var(--mf-text); background: var(--mf-surface); border: 1px solid var(--mf-border); border-radius: 16px; box-shadow: 0 14px 30px color-mix(in srgb, var(--mf-shadow-color, #0f172a) 10%, transparent); }
.mf-profile-tool-card h3 { margin: 0; color: var(--mf-heading); font-size: 21px; }
.mf-profile-tool-card > p:not(.mf-tool-status) { margin: 0; line-height: 1.55; }
.mf-profile-tool-card .mf-button-primary { justify-self: start; margin-top: 4px; }
.mf-tool-status { margin: 0; color: var(--mf-success-text, #087a4b); font-size: 12px; font-weight: 850; text-transform: uppercase; }

.mf-modal-open { overflow: hidden; }
.mf-avatar-crop-modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; }
.mf-avatar-crop-modal[hidden] { display: none; }
.mf-avatar-crop-backdrop { position: absolute; inset: 0; background: rgba(3, 18, 34, .52); backdrop-filter: blur(7px); }
.mf-avatar-crop-dialog { position: relative; z-index: 1; width: min(100%, 680px); max-height: calc(100vh - 48px); overflow: auto; padding: clamp(24px, 5vw, 38px); color: var(--mf-text); background: color-mix(in srgb, var(--mf-surface) 94%, #fff); border: 1px solid color-mix(in srgb, var(--mf-accent) 32%, var(--mf-border)); border-radius: 24px; box-shadow: 0 28px 78px rgba(3, 18, 34, .3); }
.mf-avatar-crop-dialog h2 { margin: 4px 0 8px; color: var(--mf-heading); font-size: clamp(25px, 4vw, 34px); }
.mf-avatar-crop-dialog header > p:last-child { margin: 0; line-height: 1.55; }
.mf-avatar-crop-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 108px; gap: 22px; align-items: center; margin: 24px 0 18px; }
.mf-avatar-crop-frame { position: relative; width: min(100%, 420px); aspect-ratio: 1; justify-self: center; overflow: hidden; touch-action: none; background: color-mix(in srgb, var(--mf-secondary) 42%, #0b1a2b); border: 1px solid var(--mf-border); border-radius: 16px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); cursor: grab; }
.mf-avatar-crop-frame:active { cursor: grabbing; }
.mf-avatar-crop-frame::after { position: absolute; inset: 0; pointer-events: none; content: ''; border: 1px solid rgba(255,255,255,.7); border-radius: inherit; box-shadow: inset 0 0 0 999px rgba(3,18,34,.08); }
.mf-avatar-crop-frame img,
.mf-avatar-crop-preview img { position: absolute; top: 0; left: 0; max-width: none; user-select: none; -webkit-user-drag: none; }
.mf-avatar-crop-preview { position: relative; width: 108px; aspect-ratio: 1; overflow: hidden; background: color-mix(in srgb, var(--mf-secondary) 42%, #0b1a2b); border: 5px solid color-mix(in srgb, var(--mf-surface) 88%, #fff); border-radius: 50%; box-shadow: 0 14px 28px color-mix(in srgb, var(--mf-shadow-color, #0f172a) 20%, transparent); }
.mf-avatar-zoom-control { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 14px; align-items: center; color: var(--mf-heading); font-weight: 800; }
.mf-avatar-zoom-control input { width: 100%; accent-color: var(--mf-button-primary-bg); }
.mf-avatar-crop-help { margin: 14px 0 0; color: var(--mf-muted); font-size: 13px; line-height: 1.5; }
.mf-avatar-crop-error { margin: 14px 0 0; color: var(--mf-error-text); font-weight: 750; }
.mf-avatar-crop-dialog footer { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; margin-top: 24px; }

@media (max-width: 760px) {
    .mf-profile-header { margin-top: 6px; }
    .mf-profile-photo-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .mf-profile-photo-card > div:last-child { width: 100%; }
    .mf-photo-actions { justify-content: center; }
    .mf-profile-form-grid,
    .mf-profile-security-grid,
    .mf-profile-tools-grid,
    .mf-access-list { grid-template-columns: 1fr; }
    .mf-profile-span-2,
    .mf-profile-email-field { grid-column: span 1; }
    .mf-profile-form { padding: 22px; }
    .mf-profile-tab { min-height: 40px; }
    .mf-profile-tool-card .mf-button-primary { width: 100%; }
    .mf-avatar-crop-modal { padding: 12px; }
    .mf-avatar-crop-dialog { max-height: calc(100vh - 24px); padding: 24px; border-radius: 20px; }
    .mf-avatar-crop-workspace { grid-template-columns: 1fr; justify-items: center; }
    .mf-avatar-crop-preview { width: 86px; }
    .mf-avatar-crop-dialog footer { grid-template-columns: 1fr 1fr; }
    .mf-avatar-crop-dialog footer > span { display: none; }
    .mf-avatar-crop-dialog footer .mf-button-secondary,
    .mf-avatar-crop-dialog footer .mf-button-primary { width: 100%; }
}

.mf-preview-login {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(70px, .72fr) auto;
    gap: 8px;
    align-items: center;
    margin-top: 14px;
    padding: 10px;
    color: var(--mf-login-text, #405166);
    background:
        radial-gradient(circle at 5% 0%, color-mix(in srgb, var(--mf-login-soft-primary, #1c5f97) 14%, transparent), transparent 40%),
        linear-gradient(135deg, var(--mf-login-page-bg-start, #f9fbfe), var(--mf-login-page-bg-end, #eef4f9));
    border: 1px solid var(--mf-login-card-border, rgba(15,23,42,.12));
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(15,23,42,.08);
    font-size: 10px;
}

.mf-preview-login-mark {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    color: var(--mf-login-button-text, #111827);
    background: var(--mf-login-button-bg, #c89a3d);
    border-radius: 8px;
}

.mf-preview-login strong,
.mf-preview-login span {
    display: block;
}

.mf-preview-login span:not(.mf-preview-login-mark):not(.mf-preview-login-field):not(.mf-preview-login-button) {
    margin-top: 2px;
    color: var(--mf-login-muted, #68788c);
}

.mf-preview-login-field {
    padding: 7px 8px;
    color: var(--mf-login-muted, #68788c);
    background: var(--mf-login-input-bg, #fff);
    border: 1px solid var(--mf-login-input-border, rgba(51,65,85,.26));
    border-radius: 7px;
}

.mf-preview-login-button {
    padding: 8px 10px;
    color: var(--mf-login-button-text, #111827);
    background: var(--mf-login-button-bg, #c89a3d);
    border-radius: 7px;
    font-weight: 850;
}

@media (max-width: 620px) {
    body.mf-login-page {
        background-attachment: scroll;
        background-position: var(--mf-login-background-position-mobile, center center);
    }

    .mf-login-stage {
        width: min(100% - 24px, 720px);
        gap: 16px;
        padding: 24px 0 32px;
    }

    .mf-login-brand-surface {
        min-height: 82px;
        padding: 14px 22px;
        border-radius: 18px;
    }

    .mf-login-logo {
        width: min(100%, 300px);
        max-height: 74px;
    }

    .mf-login-card {
        padding: 30px 26px;
        border-radius: 25px;
    }

    .mf-login-heading h1 {
        font-size: clamp(28px, 9vw, 34px);
    }

    .mf-preview-login {
        grid-template-columns: auto 1fr auto;
    }

    .mf-preview-login-field {
        display: none;
    }
}

@media (max-width: 460px) {
    .mf-widget-grid { grid-template-columns: 1fr; }
    .mf-dashboard-cover { margin-bottom: -34px; }
    .mf-identity-role { font-size: 13px; }
}

.mf-style-soft-glass .mf-preview-mini-card,
.mf-style-premium-glass .mf-preview-mini-card {
    min-height: 250px;
}

.mf-style-light .mf-preview-mini-card,
.mf-style-dark .mf-preview-mini-card {
    min-height: 244px;
}

/*
 * Gallery contrast pass: the previews deliberately exaggerate the structural
 * difference that the same style classes apply across the live platform.
 */
.mf-theme-preview-grid {
    max-width: 1640px;
    margin-right: auto;
    margin-left: auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
}

/* The gallery is a comparison canvas, not a normal dashboard column. */
body:has(.mf-theme-preview-grid) .mf-main {
    width: min(1680px, calc(100% - 64px));
}

.mf-preview-board {
    padding: 28px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--mf-border) 78%, transparent);
    box-shadow: 0 24px 52px rgba(0, 0, 0, .16);
}

.mf-preview-board > .mf-eyebrow {
    margin-bottom: 6px;
}

.mf-preview-board > p:last-of-type {
    max-width: 620px;
    margin-bottom: 20px;
}

.mf-preview-scene-label {
    display: inline-flex;
    margin: 0;
    padding: 7px 10px;
    color: var(--mf-text-muted);
    background: color-mix(in srgb, var(--mf-surface) 40%, transparent);
    border: 1px solid color-mix(in srgb, var(--mf-border) 76%, transparent);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.mf-preview-variants {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.mf-preview-scene {
    position: relative;
    isolation: isolate;
    min-height: 442px;
    padding: 16px;
    border-radius: 18px;
}

.mf-preview-mini-topbar,
.mf-preview-mini-body {
    position: relative;
    z-index: 2;
}

.mf-preview-mini-topbar {
    min-height: 48px;
    padding: 11px 14px;
}

.mf-preview-mini-body {
    grid-template-columns: minmax(88px, .42fr) minmax(0, 1.58fr);
    gap: 14px;
    margin-top: 14px;
}

.mf-preview-mini-sidebar,
.mf-preview-mini-card,
.mf-style-light .mf-preview-mini-card,
.mf-style-dark .mf-preview-mini-card,
.mf-style-soft-glass .mf-preview-mini-card,
.mf-style-premium-glass .mf-preview-mini-card {
    min-height: 326px;
}

.mf-preview-mini-sidebar {
    padding: 12px;
}

.mf-preview-mini-card {
    padding: 18px;
}

.mf-preview-mini-card h3 {
    font-size: clamp(18px, 1.35vw, 23px);
    line-height: 1.12;
}

.mf-preview-mini-card p {
    min-height: 67px;
    font-size: 13px;
}

.mf-preview-atmosphere {
    position: absolute;
    z-index: 1;
    display: none;
    pointer-events: none;
    border-radius: 999px;
    filter: blur(14px);
}

.mf-preview-card.mf-style-light .mf-preview-scene {
    background: linear-gradient(150deg, #ffffff 0%, #f8fafc 58%, #eaf0f7 100%);
}

.mf-preview-card.mf-style-light .mf-preview-mini-topbar,
.mf-preview-card.mf-style-light .mf-preview-mini-sidebar,
.mf-preview-card.mf-style-light .mf-preview-mini-card {
    border-color: rgba(15, 23, 42, .13);
}

.mf-preview-card.mf-style-dark .mf-preview-scene {
    background: linear-gradient(150deg, #081a2c 0%, #061220 100%);
}

.mf-preview-card.mf-style-dark .mf-preview-mini-topbar,
.mf-preview-card.mf-style-dark .mf-preview-mini-sidebar,
.mf-preview-card.mf-style-dark .mf-preview-mini-card {
    border-color: rgba(148, 163, 184, .23);
}

.mf-preview-card.mf-style-soft-glass .mf-preview-scene {
    overflow: hidden;
    background:
        linear-gradient(125deg, rgba(239, 248, 255, .68), rgba(146, 185, 226, .38)),
        linear-gradient(145deg, #e5f0fb, #8baeda);
}

.mf-preview-card.mf-style-soft-glass .mf-preview-atmosphere {
    display: block;
}

.mf-preview-card.mf-style-soft-glass .mf-preview-atmosphere-one {
    top: 12%;
    left: -15%;
    width: 62%;
    height: 56%;
    background: rgba(255, 255, 255, .88);
}

.mf-preview-card.mf-style-soft-glass .mf-preview-atmosphere-two {
    top: -8%;
    right: -12%;
    width: 55%;
    height: 45%;
    background: color-mix(in srgb, var(--mf-accent) 52%, white);
}

.mf-preview-card.mf-style-soft-glass .mf-preview-atmosphere-three {
    right: 10%;
    bottom: -15%;
    width: 75%;
    height: 38%;
    background: rgba(255, 255, 255, .78);
}

.mf-preview-card.mf-style-soft-glass .mf-preview-mini-topbar,
.mf-preview-card.mf-style-soft-glass .mf-preview-mini-sidebar,
.mf-preview-card.mf-style-soft-glass .mf-preview-mini-card {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--mf-secondary) 30%, rgba(255,255,255,.78)),
        color-mix(in srgb, var(--mf-primary) 17%, rgba(255,255,255,.70)));
    border-color: rgba(255, 255, 255, .88);
    box-shadow: 0 18px 34px rgba(32, 62, 95, .16), inset 0 1px 0 rgba(255, 255, 255, .82);
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.mf-preview-card.mf-style-soft-glass .mf-preview-mini-topbar {
    color: var(--mf-heading);
}

.mf-preview-card.mf-style-soft-glass .mf-preview-mini-sidebar {
    color: #FFFFFF;
    background: linear-gradient(160deg,
        color-mix(in srgb, var(--mf-primary) 74%, rgba(4,16,30,.40)),
        color-mix(in srgb, var(--mf-secondary) 38%, rgba(4,16,30,.58)));
}

.mf-preview-card.mf-style-premium-glass .mf-preview-scene {
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 18%, color-mix(in srgb, var(--mf-glow-color) 46%, transparent), transparent 28%),
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--mf-secondary) 58%, transparent), transparent 34%),
        linear-gradient(145deg, #020a14 0%, #071d35 48%, #03101f 100%);
}

.mf-preview-card.mf-style-premium-glass .mf-preview-atmosphere {
    display: block;
    filter: blur(24px);
}

.mf-preview-card.mf-style-premium-glass .mf-preview-atmosphere-one {
    top: -18%;
    right: -14%;
    width: 58%;
    height: 58%;
    background: color-mix(in srgb, var(--mf-secondary) 68%, transparent);
}

.mf-preview-card.mf-style-premium-glass .mf-preview-atmosphere-two {
    bottom: -17%;
    left: -12%;
    width: 55%;
    height: 45%;
    background: color-mix(in srgb, var(--mf-glow-color) 54%, transparent);
}

.mf-preview-card.mf-style-premium-glass .mf-preview-atmosphere-three {
    top: 28%;
    left: 43%;
    width: 18%;
    height: 34%;
    background: rgba(104, 198, 255, .48);
}

.mf-preview-card.mf-style-premium-glass .mf-preview-mini-topbar,
.mf-preview-card.mf-style-premium-glass .mf-preview-mini-sidebar,
.mf-preview-card.mf-style-premium-glass .mf-preview-mini-card {
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--mf-primary) 70%, rgba(2,8,18,.76)),
        color-mix(in srgb, var(--mf-secondary) 40%, rgba(2,8,18,.68)));
    border-color: color-mix(in srgb, var(--mf-glow-color) 38%, rgba(190, 224, 255, .5));
    box-shadow: 0 22px 46px rgba(0, 0, 0, .42), 0 0 28px color-mix(in srgb, var(--mf-glow-color) 13%, transparent), inset 0 1px 0 rgba(255, 255, 255, .12);
    backdrop-filter: blur(28px) saturate(150%);
    -webkit-backdrop-filter: blur(28px) saturate(150%);
}

.mf-preview-card.mf-style-premium-glass .mf-preview-scene::after {
    position: absolute;
    inset: 8px;
    z-index: 1;
    content: '';
    pointer-events: none;
    border: 1px solid color-mix(in srgb, var(--mf-glow-color) 34%, transparent);
    border-radius: 13px;
    box-shadow: inset 0 0 32px rgba(56, 189, 248, .11), 0 0 24px color-mix(in srgb, var(--mf-glow-color) 14%, transparent);
}

@media (max-width: 1000px) {
    body:has(.mf-theme-preview-grid) .mf-main {
        width: min(100% - 32px, 760px);
    }

    .mf-preview-board {
        padding: 20px;
    }

    .mf-preview-variants {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mf-preview-scene {
        min-height: 390px;
    }
}

@media (max-width: 620px) {
    .mf-preview-variants {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Dashboard platform polish: contained cover, readable navigation and no viewport overflow. */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    overflow-x: hidden;
}

html {
    background:
        radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--mf-accent) 12%, transparent), transparent 28%),
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--mf-secondary) 18%, transparent), transparent 34%),
        linear-gradient(135deg, var(--mf-workspace-start), var(--mf-workspace-end));
}

.mf-body {
    width: 100%;
    max-width: 100%;
}

.mf-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--mf-accent) 12%, transparent), transparent 28%),
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--mf-secondary) 18%, transparent), transparent 34%),
        linear-gradient(135deg, var(--mf-workspace-start), var(--mf-workspace-end));
}

.mf-topbar {
    position: sticky;
    isolation: isolate;
    color: var(--mf-topbar-text);
    background: color-mix(in srgb, var(--mf-topbar-bg) 92%, #061727);
    border-bottom-color: color-mix(in srgb, var(--mf-topbar-text) 14%, transparent);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .20);
    backdrop-filter: blur(18px) saturate(125%);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
}

.mf-style-premium-glass .mf-topbar {
    background: color-mix(in srgb, var(--mf-topbar-bg) 88%, #031222);
    border-bottom-color: rgba(255, 255, 255, .12);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.mf-topbar .mf-menu-panel,
.mf-topbar .mf-profile-panel {
    z-index: 40;
    color: var(--mf-topbar-text);
    background: color-mix(in srgb, var(--mf-topbar-bg) 94%, #061727);
    border-color: color-mix(in srgb, var(--mf-topbar-text) 18%, transparent);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .35);
    backdrop-filter: blur(20px) saturate(130%);
    -webkit-backdrop-filter: blur(20px) saturate(130%);
}

.mf-topbar .mf-menu-panel a,
.mf-topbar .mf-menu-panel span {
    color: var(--mf-topbar-text);
}

.mf-topbar .mf-menu-panel a:hover,
.mf-topbar .mf-menu-panel a:focus-visible {
    color: #fff;
    background: color-mix(in srgb, var(--mf-accent) 18%, transparent);
}

.mf-iconbar .mf-menu.is-open summary,
.mf-profile-menu.is-open > summary {
    color: #fff;
    background: color-mix(in srgb, var(--mf-accent) 18%, transparent);
    border-color: color-mix(in srgb, var(--mf-accent) 45%, transparent);
}

.mf-main-dashboard {
    width: min(100% - 32px, 1240px);
    padding: 28px 0 80px;
}

.mf-dashboard-cover {
    width: 100%;
    height: auto;
    min-height: 210px;
    max-height: 260px;
    margin: 0;
    aspect-ratio: 5 / 1;
    border-radius: 16px 16px 0 0;
    background-position: center center;
}

.mf-identity-block {
    margin: -58px 24px 0;
    padding: 0 0 24px;
}

.mf-user-avatar-large {
    margin-top: 0;
}

.mf-dashboard-layout {
    grid-template-columns: 244px minmax(0, 1fr);
    gap: 26px;
}

.mf-sidebar-mobile-toggle {
    display: none;
}

@media (max-width: 760px) {
    .mf-topbar {
        min-height: 60px;
    }

    .mf-main-dashboard {
        width: min(100% - 24px, 1240px);
        padding-top: 12px;
    }

    .mf-dashboard-cover {
        min-height: 150px;
        max-height: 210px;
        aspect-ratio: auto;
        height: clamp(150px, 48vw, 210px);
        border-radius: 14px 14px 0 0;
    }

    .mf-identity-block {
        align-items: center;
        min-height: 0;
        margin: -38px 12px 0;
        padding-bottom: 20px;
    }

    .mf-user-avatar-large {
        width: 80px;
        height: 80px;
        border-width: 4px;
    }

    .mf-sidebar-mobile-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 42px;
        margin: 0 0 14px;
        padding: 9px 12px;
        color: var(--mf-text);
        background: var(--mf-surface);
        border: 1px solid var(--mf-border);
        border-radius: 10px;
        font-weight: 800;
    }

    .mf-dashboard-layout {
        display: block;
    }

    .mf-dashboard-layout .mf-sidebar {
        position: fixed;
        top: 72px;
        bottom: 16px;
        left: 12px;
        z-index: 35;
        display: block;
        width: min(292px, calc(100vw - 24px));
        margin: 0;
        overflow: auto;
        white-space: normal;
        transform: translateX(calc(-100% - 28px));
        transition: transform .2s ease;
    }

    .mf-dashboard-layout .mf-sidebar.is-open {
        transform: translateX(0);
    }

    .mf-sidebar-heading {
        display: block;
    }

    .mf-sidebar-nav {
        display: grid;
        width: auto;
    }

    .mf-sidebar-item {
        white-space: normal;
    }
}
