html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #eee;
}

body {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
    z-index: 0;
    background: linear-gradient(135deg, #2b2b2b 0%, #444 50%, #2b2b2b 100%);
    padding-top: 70px;
    padding-bottom: 70px;
    min-height: 100vh;
    overflow-y: auto;
	margin-top: 10px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: grayscale(100%);
    opacity: 0.8;
    z-index: -1;
}

::-webkit-scrollbar {
    width: 10px; height: 10px;
}
::-webkit-scrollbar-track {
    background: #2b2b2b; border-radius: 5px;
}
::-webkit-scrollbar-thumb {
    background-color: #007acc; border-radius: 5px; border: 2px solid #2b2b2b;
}
::-webkit-scrollbar-thumb:hover {
    background-color: #00a8ff;
}
::-webkit-scrollbar-corner {
    background: #222;
}

header {
    width: 100%;
    background: #222;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.5);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 102;
    box-sizing: border-box;
    height: 70px;
    border-bottom: 3px solid #00a8ff;
}
.header-left {
    flex: 1; display: flex; justify-content: flex-start; align-items: center;
}
.header-left a {
    display: flex; align-items: center; text-decoration: none;
}
.header-left h1 {
    font-size: 1.6rem; color: #00a8ff; margin: 0; user-select: none; white-space: nowrap;
}
.header-left .tagline {
    font-size: 0.8rem; color: #aaa; font-weight: 400; margin-left: 8px; font-weight: bold; display: inline-block; white-space: nowrap;
}
.header-center {
    flex-shrink: 0; display: flex; justify-content: center; align-items: center;
}
#headerMainLogo {
    max-height: 70px; width: auto; display: block; margin-top: -5px;
    filter: drop-shadow(0px 0px 8px rgba(0, 122, 204, 0.7));
}
.header-right-controls {
    flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 10px;
}
.header-buttons {
    display: flex; align-items: center; gap: 10px;
}

.btn, .btn-header {
    font-weight: bold; border-radius: 20px;
    cursor: pointer; white-space: nowrap; text-decoration: none;
    display: inline-flex; align-items: center;
    font-size: 14px;
    line-height: 1.4; padding: 0 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.1s ease;
    user-select: none;
    -webkit-appearance: none; appearance: none;
    background-image: none;
    box-sizing: border-box;
    outline: none; overflow: hidden; position: relative; z-index: 0;
    text-align: center; text-transform: none;
    vertical-align: middle; min-width: min-content;
    margin: 8px 0;
    background-color: #131314;
    border: 1px solid #00a8ff;
    color: #e3e3e3;
    height: 40px;
}

.btn:not(:disabled):hover, .btn:not(:disabled):focus {
    border-color: #4dc4ff;
    box-shadow: 0 1px 2px 0 rgba(0, 168, 255, .30), 0 1px 3px 1px rgba(0, 168, 255, .15);
    transform: translateY(-1px);
}
.btn::before {
    content: ""; position: absolute; top: 0; left: 0;
    width: 100%; height: 100%; background-color: white;
    opacity: 0; border-radius: inherit; transition: opacity 0.218s;
    pointer-events: none; z-index: -1;
}
.btn:not(:disabled):hover::before { opacity: 0.08; }
.btn:not(:disabled):active, .btn:not(:disabled):focus { border-color: #00a8ff; }
.btn:not(:disabled):active::before, .btn:not(:disabled):focus::before { opacity: 0.12; }

.btn:disabled {
    cursor: default;
    background-color: rgba(19, 19, 20, 0.38);
    border-color: rgba(0, 168, 255, 0.38);
    color: rgba(227, 227, 227, 0.38);
}
.btn:disabled::before { opacity: 0; }
.btn:disabled .btn-text, .btn:disabled .btn-icon { opacity: 0.38; }

.btn .btn-text { order: 1; }
.btn .btn-icon { order: 2; margin-left: 6px; display: inline-flex; align-items: center; }

.btn-header {
    margin: 0 4px;
    box-shadow: none;
}
.header-text-link {
    font-weight: bold; border-radius: 6px; cursor: pointer; white-space: nowrap; text-decoration: none;
    display: inline-flex; align-items: center; font-size: 0.9rem; line-height: 1.4; padding: 8px 12px;
    color: #00a8ff; background: none; border: none; box-shadow: none;
}
.header-text-link:hover {
    text-decoration: underline; color: #00e0ff; transform: translateY(-1px);
}

#signUpButtonHeader {
    font-weight: bold;
}

.dropdown { position: relative; display: inline-block; }

.dropdown-content {
    display: none; position: absolute; background-color: #1e1e1e; min-width: 240px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4); z-index: 1001; border-radius: 8px;
    border: 1px solid #00a8ff;
    left: 0;
    top: calc(100% + 5px);
    overflow-y: auto; max-height: 300px; padding: 0;
}
.header-buttons .dropdown-content::-webkit-scrollbar { width: 8px; }
.header-buttons .dropdown-content::-webkit-scrollbar-track { background: #2c2f33; border-radius: 0 8px 8px 0; }
.header-buttons .dropdown-content::-webkit-scrollbar-thumb { background: #555; border-radius: 8px; }
.header-buttons .dropdown-content::-webkit-scrollbar-thumb:hover { background: #00a8ff; }
.dropdown-content.show { display: block; }
.dropdown.align-right .dropdown-content { left: auto; right: 0; }
.dropdown-content a {
    color: #d0d0d0; padding: 10px 15px; text-decoration: none; display: block;
    font-size: 0.9rem; font-weight: bold; white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease; position: relative; text-align: left;
}
#usefulLinksDropdown a::after { content: "\00a0\00a0🔗"; }
.dropdown-content a:hover { background-color: #333333; color: #00c0ff; }

.main-content-wrapper {
    flex-grow: 1;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.image-glow {
    position: fixed;
    left: -3%;
    bottom: 0;
    filter: drop-shadow(0px 0px 12px #00a8ff);
    max-width: 30%;
    z-index: 0;
    pointer-events: none;
}
.image-glow-flipped {
    position: fixed;
    right: -3%;
    bottom: 0;
    transform: scaleX(-1);
    filter: drop-shadow(0px 0px 12px #00a8ff);
    max-width: 30%;
    z-index: 0;
    pointer-events: none;
}

footer.footer {
    flex-shrink: 0;
    background-color: #222;
    color: #999;
    padding-top: 12px;
    padding-bottom: 6px;
    padding-left: 20px;
    padding-right: 20px;
    text-align: center;
    font-size: 14px;
    border-top: 2px solid #00a8ff;
    width: 100%;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.5);
    position: fixed;
    bottom: 0;
    left: 0;
    user-select: none;
    z-index: 102;
    box-sizing: border-box;
    height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
footer.footer .footer-links {
    margin-bottom: 4px;
}
footer.footer .footer-links a { color: #00a8ff; margin: 0 5px; text-decoration: none; }
footer.footer .footer-links a:hover { text-decoration: underline; }
footer.footer > p {
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.2;
}

main {
    max-width: 1500px; margin: 20px auto; padding: 20px;
    background-color: rgba(34, 34, 34, 0.85); border-radius: 12px; box-shadow: 0 0 15px rgba(0, 122, 204, 0.3);
    width: 90%;
}
h2 { color: #007acc; margin-bottom: 20px; font-weight: 600; text-align: center; }
ul { list-style: none; padding-left: 0; }
ul li { padding: 10px 0; border-bottom: 1px solid #333; font-size: 1rem; color: #ccc; }
ul li:last-child { border-bottom: none; }

.custom-input {
    width: 100%; padding: 12px 15px; margin-bottom: 10px; border: 1px solid #555;
    border-radius: 5px; background-color: #333; color: #fff; font-size: 16px;
    box-sizing: border-box;
}
.custom-input::placeholder { color: #aaa; opacity: 1; }
.custom-input:focus { border-color: #00a8ff; outline: none; box-shadow: 0 0 5px rgba(0, 168, 255, 0.5); }

.loading-overlay {
    position: fixed;top: 0;left: 0;width: 100%;height: 100%;background-color: rgba(0, 0, 0, 0.75);
    display: flex;justify-content: center;align-items: center;z-index: 2000;
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    visibility: hidden;opacity: 0;transition: visibility 0s, opacity 0.3s ease-in-out;
}
.loading-overlay.visible {visibility: visible;opacity: 1;}
.spinner {
    border: 8px solid #444; border-top: 8px solid #00a8ff;border-radius: 50%;
    width: 60px;height: 60px;animation: spin 1s linear infinite;
}
@keyframes spin {0% { transform: rotate(0deg); }100% { transform: rotate(360deg); }}

.modal-overlay {
    position: fixed;top: 0;left: 0;width: 100%;height: 100%;background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;align-items: center;z-index: 1500;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;padding: 20px;box-sizing: border-box;
}
.modal-overlay.visible {
    display: flex;
    opacity: 1;
}
.modal-content {
    background-color: var(--modal-content-bg, #282828); color: var(--text-color-light, #eee);
    padding: 25px 30px; border-radius: var(--modal-border-radius, 12px);
    border: 1px solid var(--theme-accent-color, #00a8ff); box-shadow: 0 0 30px var(--modal-shadow-color, rgba(0, 168, 255, 0.7));
    width: 100%; max-width: 480px; position: relative; text-align: center; box-sizing: border-box; margin: auto;
}

.modal-content h2 {
    color:#00a8ff; margin-top: 0; margin-bottom: 25px; font-size: 1.8rem; font-weight: 600;
}
.modal-content p {
    color: var(--text-color-normal); margin-bottom: 20px; font-size: 0.95rem; line-height: 1.6; text-align: left;
}
.modal-content p:last-of-type {
    margin-bottom: 25px;
}
.modal-content a {
    color: var(--theme-accent-color); text-decoration: underline; font-weight: 500;
}
.modal-content a:hover {
    color: var(--theme-accent-hover-color);
}
.modal-content .custom-input {
    margin-bottom: 18px; text-align: left;
}
.modal-content .btn {
    margin-top: 15px; width: 100%; padding-top: 10px; padding-bottom: 10px; font-size: 1rem;
}
.modal-content .modal-close-btn {
    position: absolute; top: 12px; right: 12px; background: none; border: none;
    font-size: var(--btn-close-font-size, 1.8rem); color: var(--btn-close-color, #00a8ff);
    cursor: pointer; line-height: 1;
}
.modal-content .modal-close-btn:hover {
    color: var(--btn-close-hover-color, #00e0ff);
}

#firebaseui-auth-container {
    margin-top: 25px; margin-bottom: 15px; text-align: left;
}

.custom-report-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    text-align: left;
}

.report-dropdown-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.report-dropdown-group label {
    font-weight: bold;
    color: #00a8ff;
    font-size: 0.95em;
}

.report-dropdown-group select {
    background-color: #1a1a1a;
    border: 1px solid #007acc;
    border-radius: 4px;
    padding: 8px 12px;
    color: #eee;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
    
    appearance: none; 
    -webkit-appearance: none;
    
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23eee" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
}

.report-dropdown-group select:focus {
    border-color: #00a8ff;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 168, 255, 0.5);
}

.modal-content .small-text {
    font-size: 0.8em;
    color: #ff9900;
    margin-top: 15px;
    text-align: center;
} 

#reportOptionsModal .small-text {
    color: #ff9900 !important;
}

@media (max-width: 768px) {
    /* Main container and layout adjustments for mobile */
    #activityPeeperContainer {
        padding: 10px;
        gap: 15px;
    }
    
    /* Input and control panel to stack inputs vertically */
    #topControlPanel {
        display: flex;
        flex-direction: column;
        align-items: stretch; /* Stretch children to fill the width */
        gap: 15px;
        padding: 10px;
        /* Hiding desktop grid overrides */
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
    }

    /* Style for each input and button group */
    .control-grid-item {
        width: 100%;
        max-width: 100%;
        margin: 0 !important; /* Reset any desktop margins */
        text-align: left;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        /* Resetting desktop grid styles */
        grid-column: auto !important;
        grid-row: auto !important;
    }
    .control-grid-item label { text-align: left; }
    
    /* Input, Select, and Button Styles for mobile */
    .control-grid-item input[type="text"],
    .control-grid-item select {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        text-align: center;
        margin-top: 5px; /* Add space below label */
    }

    /* Center the Status and Last Refresh spans */
    #statusGroup, #lastRefreshGroup {
        flex-direction: row;
        align-items: center;
    }
    #statusGroup label, #statusGroup span,
    #lastRefreshGroup label, #lastRefreshGroup span {
        text-align: left;
    }
    
    /* Action Buttons Group */
    #actionButtonsGroup {
        flex-direction: column; /* Stack buttons vertically */
        align-items: center;
        gap: 10px;
    }
    .action-btn {
        width: 100%;
        max-width: 250px; /* Limit button width on larger phones */
        font-size: 1rem;
        padding: 10px 15px;
    }

    /* Charts Grid Area for mobile */
    #chartsGridArea {
        display: flex; /* Use flexbox for stacking charts */
        flex-direction: column;
        gap: 15px;
    }
    .chart-panel {
        height: auto;
        min-height: 250px; /* Ensure charts have a minimum height to be visible */
    }

    /* NEW: Hide the specific charts by default on mobile */
    #myFactionIndividualsChart,
    #enemyFactionIndividualsChart {
        display: none !important;
    }
    
    /* Make the canvas elements fill their parent */
    .chart-panel canvas {
        width: 100% !important;
        height: 100% !important;
    }
}

/* NEW: Styles for the mobile tabs container and buttons */
    #mobileTabs {
        display: flex;
        justify-content: space-around;
        gap: 5px;
        background-color: #1a1a1a;
        padding: 8px;
        border-bottom: 2px solid #00a8ff;
        margin-bottom: 15px;
        width: 100%;
        box-sizing: border-box;
    }
    .tab-button {
        flex-grow: 1;
        background-color: #222;
        color: #eee;
        border: 1px solid #00a8ff;
        border-radius: 5px;
        padding: 8px 5px;
        cursor: pointer;
        font-size: 0.9rem;
        transition: background-color 0.2s ease, transform 0.2s ease;
        text-align: center;
        white-space: nowrap;
    }
    .tab-button:hover {
        background-color: #00a8ff;
        color: #222;
    }
    .tab-button.active {
        background-color: #00a8ff;
        color: #222;
        font-weight: bold;
    }

    /* Tab content styling */
    .tab-content {
        display: none; /* Hide all tab content by default */
        flex-direction: column;
        width: 100%;
    }
    .tab-content.active {
        display: flex; /* Only show the active tab's content */
    }

@media (max-width: 480px) {
    .main-content-wrapper {
        padding-top: 5px;
        padding-bottom: 5px;
    }
}

#activityPeeperContainer {
    background-color: #222;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    border: 3px solid black;
    width: 95%;
    max-width: 1500px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    flex-grow: 1;
    min-height: 0;
    margin-bottom: 5px;
    margin-top: 5px
}

#topControlPanel {
    display: grid;
    grid-template-columns: 1.5fr 2fr 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 10px 20px;
    align-items: start;
    color: #eee;
    padding-bottom: 15px;
    border-bottom: 2px solid black;
    margin-bottom: 0;
    flex-shrink: 0;
}

.control-grid-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    white-space: nowrap;
    font-size: 0.95rem;
    box-sizing: border-box;
}
#compareUser1,
#compareUser2 {
    width: 250px;
    flex-grow: 0;
    min-width: unset;
    box-sizing: border-box;
}
#stopTimerGroup { 
    grid-column: 3; 
    grid-row: 1 / span 2; 
    align-items: flex-end;

}
#stopTimerHours {
    width: 80px; 
}
#countdownDisplay {
    position: relative;
    top: -10px;
}
#myFactionIDGroup { grid-column: 1; grid-row: 1; align-items: flex-start; max-width: 108px; }
#factionNameGroup {
    grid-column: 2;
    grid-row: 1;
    align-items: center;
    margin-left: -160px;
    margin-top: -5px;
}
#compareIndividualsGroup {
    grid-column: 3;
    grid-row: 3 / span 2;
    align-items: flex-end;
    justify-content: flex-end;
    margin-top: -25px;
}

#enemyFactionIDGroup { grid-column: 1; grid-row: 2; align-items: flex-start; max-width: 130px; margin-top: -7px; }
#totalMembersGroup {
    grid-column: 2;
    grid-row: 2;
    align-items: center;
    margin-left: -160px;
    margin-top: -18px;
}
#actionButtonsGroup { grid-column: 2; grid-row: 3; align-items: center; margin-left: -160px; margin-top: -24px; }

#activityIntervalGroup { grid-column: 1; grid-row: 3; align-items: flex-start; max-width: 165px; margin-top: -7px; }
#statusGroup {
    grid-column: 1;
    grid-row: 4;
    align-items: flex-start;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    margin-top: -5px;
}
#lastRefreshGroup { grid-column: 2; grid-row: 4; align-items: center; margin-left: -160px; margin-top: -45px; }
#statusDisplay {
    background-color: transparent !important;
}

/* Find the old .faction-display-container and replace it with ALL of this */

#factionDisplayParent {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: center;
    margin-left: -160px; /* This is the line that pulls it into the center */
	margin-top: -65px; 
}

.faction-display-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px; /* Adds a little space between the two lines */
}

.faction-display-label {
    color: #00a8ff;
    font-weight: bold;
}

#factionDataDisplay {
    color: #ffffff;
    font-weight: bold;
    font-size: 1.1em;
}
    

.control-grid-item label {
    font-weight: bold;
    color: #00a8ff;
    flex-shrink: 0;
    text-align: left;
}

.control-grid-item input[type="text"],
.control-grid-item select {
    background-color: #1a1a1a;
    border: 1px solid black;
    border-radius: 4px;
    padding: 4px 8px;
    color: #eee;
    font-size: 0.9rem;
    flex-grow: 1;
    box-sizing: border-box;
    width: 100%;
    min-width: 100px;
}

.control-grid-item select {
    padding-right: 25px;
}

.control-grid-item span {
    color: #fff;
    font-weight: bold;
    flex-grow: 1;
    text-align: left;
}

#totalMembersGroup .control-grid-item { flex-direction: row; justify-content: space-between; }
#totalMembersGroup label { text-align: left; flex-grow: 0; }
#totalMembersGroup span { text-align: right; flex-grow: 0; }

#factionNameGroup label { text-align: center; margin-left: -6px;  }
#factionNameGroup #factionNameDisplay { text-align: center; margin-left: -5px; }

#actionButtonsGroup {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.action-btn {
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    border: none;
    color: #000;
    flex-grow: 1;
    min-width: 100px;
    max-width: 150px;
    border: 2px solid black;
	margin-top: -20px;
}
.action-btn.start-btn { background-color: #28a745; }
.action-btn.start-btn:hover { background-color: #218838; }
.action-btn.stop-btn { background-color: #dc3545; color: #000; }
.action-btn.stop-btn:hover { background-color: #c82333; }
.action-btn.clear-btn { background-color: #ffc107; color: #000; }
.action-btn.clear-btn:hover { background-color: #e0a800; }

#chartsGridArea {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    flex-grow: 1;
    min-height: 0;
}

.chart-panel {
    background-color: #222;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    border: 2px solid black;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    height: auto;
}

.chart-panel {
    position: relative;
    z-index: 1;
    transition: transform 0.2s ease-in-out;
}

.chart-panel:hover {
    transform: scale(1.2);
    z-index: 10;
    overflow: hidden;
}

.chart-panel h3 {
    color: #00a8ff;
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.1em;
    padding-top: 5px;
    margin-top: -15px;
}

@media (max-width: 1200px) {
    #activityPeeperContainer {
        padding: 15px;
    }
    #topControlPanel {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 15px;
        padding-bottom: 15px;
        margin-bottom: 15px;
    }
    
    .control-grid-item {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .control-grid-item label { text-align: center; }
    .control-grid-item input[type="text"],
    .control-grid-item select {
        width: 80%;
        max-width: 300px;
        text-align: center;
    }
    #actionButtonsGroup {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    .action-btn { width: 100%; flex-grow: 0; }

    #chartsGridArea {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 15px;
    }
    .chart-panel {
        height: 250px;
    }
}

@media (max-width: 768px) {
    body { padding-top: 0; padding-bottom: 0; }
    header { position: static; height: auto; min-height: 70px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; justify-content: center; border-bottom: 3px solid #00a8ff; }
    .header-left, .header-center, .header-right-controls { flex-basis: auto; width: 100%; justify-content: center; margin-bottom: 5px; }
    #headerMainLogo { max-height: 50px; margin-top: 0; }
    .header-left h1 { font-size: 1.4rem; }
    .tagline { font-size: 0.7rem; }
    .header-text-link, .btn.header-btn { padding: 6px 10px; font-size: 0.85rem; height: auto; }
    main { margin: 20px 15px; padding: 25px 20px; width: auto; }
    footer.footer { position: static; height: auto; min-height: 70px; padding-top: 10px; padding-bottom: 10px; }
    footer.footer .footer-links { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 5px 10px; margin-bottom: 8px; }

  header #headerEditProfileBtn {
    display: none !important;
  }


    .main-content-wrapper {
        padding-top: 10px;
        padding-bottom: 10px;
        height: auto;
        min-height: unset;
    }
}


.script-title {
    font-size: 2.2rem;
    font-weight: bold;
    position: relative;
    margin-top: 0;
    margin-bottom: 20px;
    color: #00a8ff;
    -webkit-text-stroke: 1px black;
    text-shadow: 0px 0px 5px #00a8ff, 0px 0px 4px #0077cc;
}

@media (max-width: 600px) {
    #topControlPanel { gap: 10px; }
    .action-btn { font-size: 0.9rem; padding: 6px 12px; }
}

@media (max-width: 480px) {
    .main-content-wrapper { padding-top: 75px; }
    #activityPeeperContainer { padding: 5px; gap: 10px; }
    #topControlPanel { padding: 10px; gap: 8px; }
    .control-grid-item { font-size: 0.85rem; }
    .control-grid-item input[type="text"],
    .control-grid-item select { font-size: 0.85rem; padding: 3px 6px; }
    .chart-panel { padding: 10px; }
    .chart-panel h3 { font-size: 1em; }
}