the-header {
    flex: 0 0 4rem;
    height: 4rem;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: none;
    border-bottom: 1px solid rgba(var(--primary-rgb), .5);
    background: rgba(0, 0, 0, .75);
    /* backdrop-filter: blur(1rem); */
    box-shadow: 0px .25rem 1rem 0 rgb(0 0 0 / 50%), inset 0 0 2rem 0 rgba(var(--primary-rgb), calc(var(--glow-intensity) / 3));
    position: relative;
    padding: 0 1rem;
    gap: 1rem;
}

the-header div.content {
    flex: 0 0 auto;
    width: 100%;
    max-width: 60rem;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: stretch;
    /* overflow: hidden; */
    gap: 1rem;
}

the-header div.content div.divider {
    flex: 0 0 1px;
    background-color: rgba(var(--primary-rgb), .25);
    align-self: stretch;
}

the-header div.global {
    flex: 0 0 auto;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
}

the-header div.global svg.logo {
    flex: 0 0 5.5rem;
    width: 5.5rem;
    cursor: pointer;
}
the-header div.global svg.logo .st0 {
    fill:var(--primary-color);
}
the-header div.global svg.logo .st1{
    fill: var(--input-color);
}

/* Hamburger Button */
the-header .hamburger-button {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0.625rem;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid var(--primary-color);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0.25rem 0.5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 4));
}

the-header .hamburger-button:hover {
    box-shadow: 0 0.25rem 1rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 2));
}

the-header .hamburger-button span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s;
    border-radius: 2px;
    box-shadow: 0 0 0.5rem rgba(var(--primary-rgb), var(--glow-intensity));
}

the-header.mobile-menu-open .hamburger-button span:nth-child(1) {
    transform: rotate(45deg) translate(0.5rem, 0.5rem);
}

the-header.mobile-menu-open .hamburger-button span:nth-child(2) {
    opacity: 0;
}

the-header.mobile-menu-open .hamburger-button span:nth-child(3) {
    transform: rotate(-45deg) translate(0.5rem, -0.5rem);
}

/* Desktop Navigation - hidden on mobile */
the-header .desktop-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 1rem;
}

/* Mobile Menu Overlay */
the-header .mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

the-header.mobile-menu-open .mobile-menu-overlay {
    opacity: 1;
    pointer-events: all;
}

/* Mobile Menu Slide-out */
the-header .mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80%;
    max-width: 20rem;
    background: rgba(0, 0, 0, 0.95);
    border-left: 1px solid var(--primary-color);
    box-shadow: -0.5rem 0 2rem rgba(0, 0, 0, 0.5), inset 0 0 2rem 0 rgba(var(--primary-rgb), calc(var(--glow-intensity) / 3));
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.3s;
    overflow-y: auto;
}

the-header.mobile-menu-open .mobile-menu {
    transform: translateX(0);
}

the-header .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

the-header .mobile-menu-header .logo {
    width: 4rem;
    cursor: pointer;
}

the-header .mobile-menu-close {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid var(--primary-color);
    border-radius: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

the-header .mobile-menu-close svg {
    width: 100%;
    height: 100%;
    fill: var(--primary-color);
}

the-header .mobile-menu-content {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
}

the-header .mobile-menu-content a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(var(--primary-rgb), 0.5);
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, 0.5);
    text-decoration: none;
    transition: all 0.3s;
    min-height: 3.5rem; /* 56px minimum touch target */
}

the-header .mobile-menu-content a:hover {
    background: rgba(var(--primary-rgb), 0.1);
    box-shadow: 0 0.25rem 1rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 3));
}

the-header .mobile-menu-content a.active {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: var(--primary-color);
}

the-header .mobile-menu-content a svg {
    width: 2rem;
    height: 2rem;
    fill: var(--primary-color);
    filter: drop-shadow(0 0.25rem 0.25rem rgba(var(--primary-rgb), var(--glow-intensity)));
}

the-header .mobile-menu-content a.active svg {
    fill: var(--input-color);
    filter: drop-shadow(0 0.25rem 0.25rem rgba(var(--input-rgb), var(--glow-intensity)));
}

the-header .mobile-menu-content a span {
    flex: 1;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    text-shadow: 0 0.25rem 0.5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 4));
}

the-header .mobile-menu-content a.active span {
    color: var(--input-color);
    text-shadow: 0 0.25rem 0.5rem rgba(var(--input-rgb), calc(var(--glow-intensity) / 4));
}

the-header .mobile-menu-content .divider {
    display: none; /* Hide dividers in mobile menu */
}

/* --- Consolidated Link Styles --- */
the-header div.global a,
the-header div.local a {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    gap: .25rem;
    text-decoration: none;
}
/* Local specific link styles */
the-header div.local a {
    color: var(--primary-color);
    text-transform: uppercase;
    /* font-size: .8rem; */ /* Original local style, commented out */
    font-weight: 600;
    padding: .5rem;
    text-shadow: 0 .25rem .5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 4));
}

the-header div.global a *,
the-header div.local a * {
    pointer-events: none;
    user-select: none; /* Added from global */
}

/* the-header div.global a.active {
    cursor: default;
    pointer-events: none;
} */

the-header div.global a svg,
the-header div.local a svg {
    filter: drop-shadow(0 .25rem .25rem rgba(var(--primary-rgb), var(--glow-intensity)));
    background: rgba(0, 0, 0, 0);
    padding: 0rem;
    cursor: pointer;
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--primary-color);
}

the-header div.global a.studio svg path,
the-header div.local a.studio svg path {
    stroke: var(--primary-color);
    fill: none;
}

the-header div.global a.studio svg rect,
the-header div.local a.studio svg rect {
    fill: none;
}

the-header div.global a.active svg,
the-header div.local a.active svg {
    fill: var(--input-color);
    filter: drop-shadow(0 .25rem .25rem rgba(var(--input-rgb), var(--glow-intensity))); /* Added from global */
}

the-header div.global a.studio.active svg path,
the-header div.local a.studio.active svg path {
    stroke: var(--input-color);
}

the-header div.global a span,
the-header div.local a span {
    color: var(--primary-color);
    font-size: .6rem;
    font-weight: 600;
    text-transform: uppercase;
}
/* Global specific span style */
the-header div.global a span {
     text-shadow: 0 .25rem .5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 4));
}


the-header div.global a.active span,
the-header div.local a.active span {
    color: var(--input-color);
}
/* Global specific active span style */
the-header div.global a.active span {
    text-shadow: 0 .25rem .5rem rgba(var(--input-rgb), calc(var(--glow-intensity) / 4));
}
/* Local specific active link style */
the-header div.local a.active {
    /* cursor: default; */ /* Original local style, commented out */
    color: var(--input-color);
}
/* --- End Consolidated Link Styles --- */

the-header div.local {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    overflow: hidden;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
    gap: 1rem;
}

the-header.loaded div.local {
    opacity: 1;
    pointer-events: all;
}

the-header[type='search'] div.local {
    gap: .5rem;
}
the-header div.local button {
    flex: 0 0 auto;
    border: 1px solid var(--primary-color);
    background: #000000;
    color: var(--primary-color);
    font-weight: 800;
    border-radius: .25rem;
    width: 1.75rem;
    height: 1.75rem;
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
}

the-header div.local button * {
    pointer-events: none;
}

the-header div.local button svg {
    width: 100%;
    height: 100%;
    fill: var(--primary-color);
}

/* Removed duplicated .local a styles as they are now consolidated above */

the-header div.local div.breadcrumb {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    font-size: .8rem;
    gap: .25rem;
}
the-header div.local div.breadcrumb a {
    padding: .5rem 0;
    color: var(--primary-color);
    text-shadow: 0 .25rem .5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 3));
}
the-header div.local div.breadcrumb a.active {
    color: var(--input-color);
    text-shadow: 0 .25rem .5rem rgba(var(--input-rgb), calc(var(--glow-intensity) / 3));
}
the-header div.local div.breadcrumb span {
    color: rgba(var(--secondary-rgb), .75);
}

the-header div.local div.select-workflow-button {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    align-self: center;
    outline: none;
    padding: .25rem;
    flex: 0 1 auto;
    overflow: hidden;
    min-width: 0;
    border: 1px solid var(--primary-color);
    background: #000000;
    border-radius: .25rem;
    font-size: 1.25rem;
    cursor: pointer;
    user-select: none;
    /* margin: 0 auto; */
    box-shadow: 0 .5rem 1.5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 5));
}
the-header div.local div.select-workflow-button * {
    pointer-events: none;
}
the-header div.local div.select-workflow-button span {
    flex: 1 1 auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--primary-color);
    font-weight: 600;
    text-shadow: 0 .5rem 1.5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 5));
}
the-header div.local div.select-workflow-button svg {
    flex: 0 0 auto;
    filter: drop-shadow(0 .25rem .25rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 2)));
    background: rgba(0, 0, 0, 0);
    cursor: pointer;
    fill: var(--primary-color);
    width: 1.5rem;
    height: 1.5rem;
}
the-header div.local div.select-workflow-button svg:first-of-type {
    padding: .125rem;
}
the-header div.local div.select-workflow-button svg path {
    /* stroke: var(--primary-color); */
    /* filter: drop-shadow(0 .25rem .75rem rgba(var(--primary-rgb), var(--glow-intensity))); */
}

/* --- Consolidated Select Button Styles --- */
the-header div.local div.select-workflow-button,
the-header div.local div.select-folder-button {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    align-self: center;
    outline: none;
    padding: .25rem;
    flex: 0 1 auto;
    overflow: hidden;
    min-width: 0;
    border: 1px solid var(--primary-color);
    background: #000000;
    border-radius: .25rem;
    font-size: 1.25rem;
    cursor: pointer;
    user-select: none;
    /* margin: 0 auto; */
    box-shadow: 0 .5rem 1.5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 5));
}

the-header div.local div.select-workflow-button *,
the-header div.local div.select-folder-button * {
    pointer-events: none;
}

the-header div.local div.select-workflow-button span,
the-header div.local div.select-folder-button span {
    flex: 1 1 auto;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--primary-color);
    font-weight: 600;
    text-shadow: 0 .5rem 1.5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 5));
}

the-header div.local div.select-workflow-button svg,
the-header div.local div.select-folder-button svg {
    flex: 0 0 auto;
    filter: drop-shadow(0 .25rem .25rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 2)));
    background: rgba(0, 0, 0, 0);
    cursor: pointer;
    fill: var(--primary-color);
    width: 1.5rem;
    height: 1.5rem;
}

the-header div.local div.select-workflow-button svg:first-of-type,
the-header div.local div.select-folder-button svg:first-of-type {
    padding: .125rem;
}

the-header div.local div.select-workflow-button svg path,
the-header div.local div.select-folder-button svg path {
    /* stroke: var(--primary-color); */
    /* filter: drop-shadow(0 .25rem .75rem rgba(var(--primary-rgb), var(--glow-intensity))); */
}
/* --- End Consolidated Select Button Styles --- */


the-header div.local input[type=text] {
    flex: 1 1 auto;
    width: 100%;
    max-width: 14rem;
}
.maintenance-banner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    /* backdrop-filter: blur(1rem); */
    box-shadow: inset 0 0 2rem 0 rgba(var(--primary-rgb), calc(var(--glow-intensity) / 3));
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--primary-color);
    text-shadow: 0 0.25rem 0.5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 4));
    opacity: 0;
    animation: fadeInBanner 0.5s ease-in-out 2s forwards;
}

@keyframes fadeInBanner {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.maintenance-banner.hidden {
    display: none;
}

.maintenance-banner-text {
    flex: 1 1 auto;
    text-align: center;
}

.maintenance-banner-button {
    flex: 0 0 auto;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid var(--primary-color);
    border-radius: 0.25rem;
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 0.25rem 0.5rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 5));
    transition: all 0.2s;
}

.maintenance-banner-button:hover {
    background: rgba(var(--primary-rgb), 0.1);
    box-shadow: 0 0.25rem 1rem rgba(var(--primary-rgb), calc(var(--glow-intensity) / 3));
}

/*********** MEDIA QUERIES START HERE ***********/
@media only screen and (max-width: 720px) {

    the-header {
        flex: 0 0 3.5rem;
        height: 3.5rem;
        padding: 0 .5rem;
        gap: .5rem;
    }

    the-header div.content {
        gap: .5rem;
    }

    the-header div.global, the-header div.local {
        gap: .5rem;
    }

    the-header div.global svg.logo {
        flex: 0 1 4.75rem;
        height: 2.125rem;
    }

    /* Increase touch target sizes */
    the-header div.global a,
    the-header div.local a {
        min-width: 2.75rem;
        min-height: 2.75rem; /* 44px touch target */
        padding: 0.5rem;
    }

    the-header div.global a svg,
    the-header div.local a svg {
        width: 1.5rem;
        height: 1.5rem;
    }

    the-header div.global a span,
    the-header div.local a span {
        font-size: 0.65rem; /* Increased from 0.6rem */
    }

    /* Site header local links (features, pricing, news) - reduce size on mobile */
    the-header[type='site'] div.local a {
        font-size: 0.75rem;
        padding: 0.375rem;
        min-width: auto;
        min-height: 2.75rem;
    }

    /* Hide dividers on smaller screens for site header */
    the-header[type='site'] div.local .divider {
        display: none;
    }

    /* Combined media query styles for select buttons */
    the-header div.local div.select-workflow-button,
    the-header div.local div.select-folder-button {
        font-size: 1rem;
        min-height: 2.75rem;
    }

    the-header div.local button {
        min-width: 2.75rem;
        min-height: 2.75rem;
    }

}

@media only screen and (max-width: 480px) {

    /* Further optimize site header links for very small screens */
    the-header[type='site'] div.local a {
        font-size: 0.7rem;
        padding: 0.25rem;
    }

    the-header[type='site'] div.local {
        gap: 0.25rem;
    }

}

@media only screen and (max-width: 640px) {
    the-header {
        flex: 0 0 3.5rem;
        height: 3.5rem;
        padding: .5rem;
    }

    /* Show hamburger, hide desktop nav */
    the-header .hamburger-button {
        display: flex;
    }

    the-header .desktop-nav {
        display: none;
    }

    /* Show mobile menu elements */
    the-header .mobile-menu-overlay,
    the-header .mobile-menu {
        display: block;
    }

    the-header div.content {
        flex-direction: row;
        justify-content: space-between;
    }

    the-header div.content div.global {
        gap: 0.5rem;
        flex: 0 0 auto;
    }

    the-header div.content div.global svg.logo {
        flex: 0 0 4rem;
        width: 4rem;
        height: 2rem;
    }

    the-header div.content div.local {
        flex: 1 1 auto;
        justify-content: flex-end;
    }
}
/*********** MEDIA QUERIES END HERE ***********/
