body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: #1c1e21;
}
.main-content-area {
    flex-grow: 1;
}

/* --- Master Header Styles --- */
.header {
    border-bottom: 1px solid #e5e7eb;
    padding: 5px 0;
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
    padding: 0 1rem;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    flex: 1 0 auto; /* Allow sides to have a size but not grow */
}

.header-left { 
    justify-content: flex-start; 
}

.header-right { 
    justify-content: flex-end; 
}

.header-center { 
    display: flex;
    justify-content: center;
    align-items: center;
    /* Allow center to shrink and take up remaining space */
    flex: 0 1 auto; 
    min-width: 0; /* CRUCIAL for shrinking */
}

.logo {
    font-family: 'Playfair Display', serif;
    /* NEW Responsive Font: Larger base size on mobile (1.5rem) */
    font-size: clamp(1.5rem, 5vw, 1.75rem); 
    font-weight: 600;
    color: #000;
    text-decoration: none;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
}

.logo .vector-animation {
    height: 1.4em;
    width: auto;
    margin-right: 0.4em; /* Slightly reduced margin */
    flex-shrink: 0;
    color: #3498db;
    display: flex; /* Ensure it's treated as a block for showing/hiding */
    align-items: center;
}

.logo .tmp-text {
    font-size: 80px;
    font-weight: bold;
    fill: #0a0707;
}

.logo .square {
    fill: currentColor;
}

.logo .rotating-circle {
    transform-origin: center;
    animation: rotate 10s linear infinite;
    stroke: currentColor;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Profile Icon Sizing Fix --- */
#profile-pic-container, #profile-pic-img, #profile-initial-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

#profile-pic-img {
    object-fit: cover;
}

#profile-initial-circle {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    font-weight: bold;
    color: white;
}

/* --- NEW RESPONSIVE RULES --- */

/* For devices (around 390px wide) and up, both logo and text are visible */
@media (min-width: 381px) {
    .logo .vector-animation {
        display: flex;
    }
    .logo .logo-text {
        display: inline;
    }
}

/* For smaller phones (380px and below), hide the logo to make space for the text */
@media (max-width: 380px) {
    .logo .vector-animation {
        display: none; /* Hide the SVG logo */
    }
    .header-center {
        justify-content: flex-start; /* Align title to the left of center space */
        padding-left: 0.5rem;
    }
}