.dl-common-header-shell,
.dl-common-header-shell * {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    background-color: #f8fafc;
}

html[data-theme="dark"],
body[data-theme="dark"] {
    background-color: #0b1220 !important;
}

.dl-common-header-shell {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

.dl-common-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dl-common-header-shell .brand-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dl-common-header-shell .brand-actions,
.dl-common-header-shell .auth-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dl-common-header-shell .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--ink, #0f172a);
    border: 1px solid rgba(15, 118, 110, 0.18);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dl-common-header-shell .brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.dl-common-header-shell .login-btn {
    text-decoration: none;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 11px 18px;
    border-radius: 999px;
    background: linear-gradient(120deg, #0f766e, #0ea5e9);
    box-shadow: 0 5px 14px rgba(15, 118, 110, 0.18);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.dl-common-header-shell .login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
    filter: saturate(1.01);
}

.dl-common-header-shell .theme-switch {
    border: 1px solid rgba(17, 94, 89, 0.24);
    background: rgba(255, 255, 255, 0.82);
    border-radius: 999px;
    padding: 6px 10px 6px 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #0f766e;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 6px 14px rgba(15, 118, 110, 0.14);
}

.dl-common-header-shell .theme-switch-track {
    width: 42px;
    height: 22px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.5);
    position: relative;
    border: 1px solid rgba(100, 116, 139, 0.34);
}

.dl-common-header-shell .theme-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.28);
    transition: transform 180ms ease;
}

.dl-common-header-shell .theme-switch.is-dark .theme-switch-track {
    background: linear-gradient(120deg, #0f766e, #f97316);
    border-color: rgba(14, 165, 233, 0.45);
}

.dl-common-header-shell .theme-switch.is-dark .theme-switch-thumb {
    transform: translateX(20px);
}

.dl-common-header-shell .quick-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dl-common-header-shell .quick-nav > .user-menu:not(:last-child) { --chip-a: #14b8a6; --chip-b: #0f766e; --chip-glow: rgba(15, 118, 110, 0.24); }
.dl-common-header-shell .quick-nav > .user-menu:nth-child(1) { --chip-a: #0ea5e9; --chip-b: #2563eb; --chip-glow: rgba(37, 99, 235, 0.24); }
.dl-common-header-shell .quick-nav > .user-menu:nth-child(2) { --chip-a: #06b6d4; --chip-b: #0f766e; --chip-glow: rgba(8, 145, 178, 0.24); }
.dl-common-header-shell .quick-nav > .user-menu:nth-child(3) { --chip-a: #f59e0b; --chip-b: #ea580c; --chip-glow: rgba(234, 88, 12, 0.24); }
.dl-common-header-shell .quick-nav > .user-menu:nth-child(4) { --chip-a: #22c55e; --chip-b: #15803d; --chip-glow: rgba(21, 128, 61, 0.24); }
.dl-common-header-shell .quick-nav > .user-menu:nth-child(5) { --chip-a: #f97316; --chip-b: #dc2626; --chip-glow: rgba(220, 38, 38, 0.24); }

.dl-common-header-shell .user-menu {
    position: relative;
    z-index: 40;
    min-width: 0;
}

.dl-common-header-shell .user-badge {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(17, 94, 89, 0.22);
    background: rgba(255, 255, 255, 0.78);
    color: #0f766e;
    font-weight: 700;
    font-size: 0.86rem;
}

.dl-common-header-shell .user-trigger {
    border: 1px solid rgba(17, 94, 89, 0.22);
    cursor: pointer;
    transition: transform 150ms ease;
}

.dl-common-header-shell .nav-trigger {
    min-width: 94px;
    text-align: center;
    font-size: 0.82rem;
    padding: 9px 12px;
}

.dl-common-header-shell .quick-nav > .user-menu:not(:last-child) .nav-trigger {
    border: 1px solid rgba(255, 255, 255, 0.42);
    background: linear-gradient(140deg, color-mix(in srgb, var(--chip-a) 22%, #ffffff 78%), color-mix(in srgb, var(--chip-b) 15%, #ffffff 85%));
    color: #0f172a;
    box-shadow: 0 10px 22px var(--chip-glow);
    font-weight: 800;
    letter-spacing: 0.01em;
}

.dl-common-header-shell .quick-nav > .user-menu:not(:last-child) .nav-trigger:hover,
.dl-common-header-shell .user-trigger:hover {
    transform: translateY(-2px);
}

.dl-common-header-shell .user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 170px;
    max-width: calc(100vw - 32px);
    border-radius: 12px;
    border: 1px solid rgba(15, 118, 110, 0.18);
    background: #ffffff;
    box-shadow: 0 16px 30px rgba(31, 42, 55, 0.15);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 160ms ease;
    z-index: 9999;
}

.dl-common-header-shell .service-menu .user-dropdown {
    left: 0;
    right: auto;
    width: 440px;
    max-width: min(440px, calc(100vw - 32px));
}

.dl-common-header-shell .service-dropdown-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
    gap: 12px;
    align-items: start;
}

.dl-common-header-shell .service-dropdown-column {
    display: grid;
    gap: 0;
    min-width: 0;
}

.dl-common-header-shell .service-dropdown-workspace {
    padding-left: 14px;
    border-left: 1px solid rgba(148, 163, 184, 0.28);
}

.dl-common-header-shell .user-menu.is-open .user-dropdown,
.dl-common-header-shell .user-menu:hover .user-dropdown,
.dl-common-header-shell .user-menu:focus-within .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dl-common-header-shell .menu-link,
.dl-common-header-shell .menu-btn {
    width: 100%;
    display: block;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    color: #1f2937;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
}

.dl-common-header-shell .menu-title {
    padding: 8px 12px 6px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 700;
}

.dl-common-header-shell .menu-link:hover,
.dl-common-header-shell .menu-btn:hover {
    background: #eef6f5;
}

body[data-theme="dark"] .dl-common-header-shell .brand {
    color: #e5e7eb;
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.42);
}

body[data-theme="dark"] .dl-common-header-shell .theme-switch {
    background: rgba(15, 23, 42, 0.78);
    border-color: rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
}

body[data-theme="dark"] .dl-common-header-shell .user-badge {
    background: rgba(15, 23, 42, 0.78);
    color: #d1fae5;
    border-color: rgba(148, 163, 184, 0.24);
}

body[data-theme="dark"] .dl-common-header-shell .quick-nav > .user-menu:not(:last-child) .nav-trigger {
    background: linear-gradient(140deg, color-mix(in srgb, var(--chip-a) 35%, #0f172a 65%), color-mix(in srgb, var(--chip-b) 42%, #020617 58%));
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.28);
}

body[data-theme="dark"] .dl-common-header-shell .user-dropdown {
    background: #0f172a !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    box-shadow: 0 16px 30px rgba(2, 6, 23, 0.55) !important;
}

body[data-theme="dark"] .dl-common-header-shell .service-dropdown-workspace {
    border-left-color: rgba(100, 116, 139, 0.34);
}

body[data-theme="dark"] .dl-common-header-shell .menu-link,
body[data-theme="dark"] .dl-common-header-shell .menu-btn {
    color: #e5e7eb !important;
}

body[data-theme="dark"] .dl-common-header-shell .menu-title,
body[data-theme="dark"] .dl-common-header-shell .menu-subtitle {
    color: #94a3b8 !important;
}

body[data-theme="dark"] .dl-common-header-shell .menu-title {
    color: #94a3b8;
}

body[data-theme="dark"] .dl-common-header-shell .menu-link:hover,
body[data-theme="dark"] .dl-common-header-shell .menu-btn:hover {
    background: rgba(30, 41, 59, 0.72);
}

@media (max-width: 900px) {
    .dl-common-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dl-common-header-shell .brand-group,
    .dl-common-header-shell .auth-actions {
        width: 100%;
        justify-content: center;
    }

    .dl-common-header-shell .quick-nav {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .dl-common-header-shell .brand-group {
        flex-direction: column;
        align-items: stretch;
    }

    .dl-common-header-shell .brand,
    .dl-common-header-shell .brand-actions,
    .dl-common-header-shell .auth-actions,
    .dl-common-header-shell .login-btn,
    .dl-common-header-shell .theme-switch {
        width: 100%;
        justify-content: center;
    }

    .dl-common-header-shell .quick-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .dl-common-header-shell .quick-nav > .user-menu {
        width: 100%;
    }

    .dl-common-header-shell .quick-nav > .user-menu:last-child {
        grid-column: 1 / -1;
    }

    .dl-common-header-shell .nav-trigger,
    .dl-common-header-shell .user-badge {
        width: 100%;
        min-width: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .dl-common-header-shell .user-dropdown {
        left: 0;
        right: auto;
        min-width: min(240px, calc(100vw - 36px));
    }

    .dl-common-header-shell .service-menu .user-dropdown {
        width: min(100vw - 36px, 320px);
        max-width: min(100vw - 36px, 320px);
    }

    .dl-common-header-shell .service-dropdown-grid {
        grid-template-columns: 1fr;
    }
}
