.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 2000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    animation: slideInDown 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: radial-gradient(circle at 30% 30%, var(--gold-light), var(--gold-dark));
    border-radius: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.inner-sphere {
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--black);
    border-radius: 50%;
    position: relative;
    animation: logo-meridian-spin 3s linear infinite;
}

@keyframes logo-meridian-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.inner-sphere::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 100%;
    height: 1.5px;
    background: var(--black);
    transform: translateY(-50%);
}

.brand-text h1 {
    font-family: var(--font-display);
    font-size: 1.8em;
    margin-bottom: 0;
    background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.brand-version {
    font-family: var(--font-main);
    font-size: 0.65em;
    color: var(--gold-light);
    opacity: 0.6;
    letter-spacing: 1px;
    margin-left: 2px;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(212, 175, 55, 0.05);
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.1);
}

#headerStateLabel {
    font-size: 0.85em;
    color: var(--gold-light);
    letter-spacing: 2px;
    /* text-transform: uppercase removed to allow LaTeX greek letters (e.g. \psi) */
}

@keyframes pulse-dot {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }

    70% {
        transform: scale(1.1);
        opacity: 1;
        box-shadow: 0 0 12px currentColor;
    }

    100% {
        transform: scale(0.9);
        opacity: 0.8;
    }
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

.global-actions {
    display: flex;
    gap: 12px;
}

.header-btn {
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: var(--gold-light);
    padding: 8px 18px;
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--gold);
    transform: translateY(-1px);
}

.header-btn.primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    border: none;
    color: var(--black);
    font-weight: 600;
}

.header-btn.primary:hover {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
    transform: translateY(-1px);
}

