    :root {
        /* Theme 1: System 7 (Default) */
        --bg-color: #2b1e2f;
        --text-color: #d0a85c;
        --header-bg: #1a111c;
        --btn-bg: #3d2b42;
        --btn-hover: #523a59;
        --border-color: #d0a85c;
        --main-font: 'Kode Mono', monospace;
    }

    body.theme-hercules {
        /* Theme 2: Hercules */
        --bg-color: #000000;
        --text-color: #ffb000;
        --header-bg: #111111;
        --btn-bg: #222222;
        --btn-hover: #333333;
        --border-color: #ffb000;
        --main-font: 'Datatype', monospace;
    }

    * {
        box-sizing: border-box;
    }

    body {
        margin: 0;
        padding: 0;
        width: 100vw;
        height: 100vh;
        display: flex;
        flex-direction: column;
        background-color: var(--bg-color);
        color: var(--text-color);
        font-family: var(--main-font); 
        font-weight: 400;
        overflow: hidden;
        
        /* Mandatory touch/selection prevention for app-like feel */
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
        
        transition: background-color 0.3s, color 0.3s;
    }

    /* Header Styles */
    header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: clamp(0.5rem, 2vw, 1rem) clamp(1rem, 4vw, 2rem);
        background-color: var(--header-bg);
        border-bottom: 2px solid var(--border-color);
        flex-shrink: 0;
    }

    .header-title {
        /* Early 90s futuristic font stack */
        display: flex;
        align-items: center;
        gap: 0.5rem; /* Space between the logo and text */
        
        font-size: clamp(1.2rem, 3vw, 1.8rem);
        letter-spacing: -0.04em;
        font-family: 'Source Code Pro', monospace;
        font-weight: 900;
        font-style: italic;
        font-variant: small-caps;
        text-shadow: 2px 2px 0px rgba(0,0,0,0.5);
    }

    .header-logo {
        height: 1.5em; /* Using 'em' makes the image scale perfectly with your clamped font size */
        width: auto;
        border-radius: 4px; /* Optional: smooths the corners of your square icon slightly */
    }

    .controls {
        display: flex;
        gap: clamp(0.5rem, 2vw, 1rem);
    }

    .btn {
        background-color: var(--btn-bg);
        color: var(--text-color);
        border: 1px solid var(--border-color);
        padding: 0.4rem 0.8rem;
        font-family: var(--main-font);
        font-size: clamp(0.8rem, 2vw, 1rem);
        font-weight: bold;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        border-radius: 2px;
        transition: background-color 0.2s;
        text-transform: uppercase;
    }

    .btn:hover, .btn:active {
        background-color: var(--btn-hover);
    }

    /* Hide the actual file input */
    #file-upload {
        display: none;
    }

    /* Terminal Workspace Styles */
    main {
        flex: 1;
        overflow-y: auto;
        padding: clamp(1rem, 4vw, 2rem);
        display: flex;
        justify-content: center;
        align-items: flex-start;
        
        /* Allow text selection inside the terminal */
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }

    #terminal-container {
        width: 100%;
        max-width: 120ch; /* Constrain width for readability */
        display: flex;
        flex-direction: column;
        min-height: 100%;
    }

    #output-history {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
    }

    .log-line {
        white-space: pre-wrap;
        word-wrap: break-word;
        line-height: 1.4;
        font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    }

    .log-input {
        opacity: 0.8;
    }

    /* Input Line Styles */
    #input-line {
        display: flex;
        align-items: center;
        margin-top: 0.5rem;
        padding-bottom: 2rem; /* Extra padding at bottom for scrolling */
    }

    .prompt {
        font-size: clamp(0.9rem, 2.5vw, 1.1rem);
        margin-right: 0.5rem;
        font-weight: bold;
    }

    #cmd-input {
        flex: 1;
        background: transparent;
        border: none;
        outline: none;
        color: inherit;
        font-family: inherit;
        font-size: clamp(0.9rem, 2.5vw, 1.1rem);
        padding: 0;
        margin: 0;
        caret-color: var(--text-color);
    }

    /* Scrollbar styling for webkit */
    ::-webkit-scrollbar {
        width: 10px;
    }
    ::-webkit-scrollbar-track {
        background: var(--header-bg);
    }
    ::-webkit-scrollbar-thumb {
        background: var(--btn-bg);
        border: 1px solid var(--border-color);
    }
    ::-webkit-scrollbar-thumb:hover {
        background: var(--btn-hover);
    }

/* ── s7 Editor ─────────────────────────────────────────────────────── */
#s7-editor-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9000;
    background: rgba(0,0,0,0.75);
    align-items: center;
    justify-content: center;
}
#s7-editor-overlay.active { display: flex; }
#s7-editor-window {
    display: flex;
    flex-direction: column;
    width: min(92vw, 88ch);
    height: min(92vh, 34rem);
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    font-family: var(--main-font);
    color: var(--text-color);
}
#s7-editor-titlebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0.8rem;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
#s7-editor-filename {
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    opacity: 0.9;
}
#s7-editor-menu-wrap { position: relative; }
#s7-menu-btn {
    background: var(--btn-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-family: var(--main-font);
    font-size: 0.85rem;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
#s7-menu-btn:hover { background: var(--btn-hover); }
#s7-menu-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 2px);
    background: var(--header-bg);
    border: 1px solid var(--border-color);
    z-index: 9100;
    min-width: 11rem;
}
.s7-menu-item {
    display: flex;
    justify-content: space-between;
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}
.s7-menu-item:hover { background: var(--btn-bg); }
.s7-shortcut { opacity: 0.6; margin-left: 1.5rem; }
#s7-editor-textarea {
    flex: 1;
    resize: none;
    background: var(--bg-color);
    color: var(--text-color);
    border: none;
    outline: none;
    font-family: var(--main-font);
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    line-height: 1.4;
    padding: 0.6rem 0.8rem;
    caret-color: var(--text-color);
    tab-size: 4;
    -webkit-user-select: auto;
    user-select: auto;
}

#s7-editor-statusbar {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0.8rem;
    background: var(--header-bg);
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    opacity: 0.8;
    flex-shrink: 0;
}

#s7-password-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7); /* Dim the background */
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

#s7-password-overlay[hidden] {
    display: none;
}

#s7-password-modal {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    padding: 1.5rem;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

#s7-password-message {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

#s7-password-input {
    width: 100%;
    background: var(--header-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-family: var(--main-font);
    padding: 0.5rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    outline: none;
    text-align: center;
    letter-spacing: 2px; /* Makes the asterisks look better */
}

#s7-password-input:focus {
    background: var(--btn-bg);
}

#s7-password-buttons {
    display: flex;
    justify-content: space-around;
}

#s7-password-buttons button {
    background: var(--btn-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-family: var(--main-font);
    padding: 0.4rem 1rem;
    cursor: pointer;
    text-transform: uppercase;
}

#s7-password-buttons button:hover {
    background: var(--btn-hover);
}

.ssh-prompt { color: #00ffcc; font-weight: bold; }