html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: linear-gradient(to right, #f2f6fc, #e9eafc);
    font-family: 'Inter', 'Open Sans', Arial, sans-serif;
    color: #232946;
    display: flex;
    flex-direction: column;
}

header {
    text-align: left;
    padding: 20px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 1;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    flex-wrap: wrap;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

#system-select {
    padding: 8px;
    font-size: 1em;
    border-radius: 6px;
    border: 1px solid #b8c0db;
    background: white;
    cursor: pointer;
}

#new-chat-button {
    background: #fff;
    color: #507be8;
    border: 2px solid #507be8;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

#new-chat-button:hover,
#new-chat-button:focus {
    background: #507be8;
    color: white;
}

header h1 {
    margin: 0;
    font-size: 2em;
    font-weight: 600;
    color: #3553ad;
}

h2 {
    color: #507be8;
    margin: 0 0 8px 0; /* reduced bottom margin */
    font-weight: 600;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #667;
    font-size: 1em;
    margin-top: 6px;
}

.interface-row {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Left panel: scrollable GUI */
#assistant-gui-section {
    flex: 2;
    padding: 24px;
    background-color: #ffffff;
    border-right: 1px solid #dce3f0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#assistant-gui {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background-color: #f8faff;
    border: 1px solid #dce3f0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(56,56,105,0.09);
}

/* Right panel: Chat */
#chat-interface {
    flex: 1;
    padding: 24px;
    background-color: #f8faff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-panels {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

#assistant-speech {
    flex: 2; /* Takes up 2/3 of the vertical space */
    overflow-y: auto;
    margin-bottom: 8px;
}

#user-input-display {
    flex: 1; /* Takes up 1/3 of the vertical space */
    overflow-y: auto;
    margin-bottom: 8px;
}

.chat-box {
    background: #f8faff;
    border: 1px solid #dce3f0;
    border-radius: 10px;
    padding: 14px;
    font-size: 1em;
    overflow-y: auto;
}

/* Message bubbles */
.speech-msg, .user-msg, .thought-msg {
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    max-width: 90%;
    word-wrap: break-word;
}

.speech-msg {
    background: #e4eafe;
    color: #233a66;
}

.user-msg {
    background: #d3f8d3;
    color: #246634;
    margin-left: auto;
}

.thought-msg {
    background: #fff3cd;
    color: #98732c;
}

/* Unified submit section */
footer {
    padding: 16px 24px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
}

#user-input-section {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

textarea {
    flex: 1;
    min-height: 48px;
    max-height: 120px;
    padding: 10px 13px;
    border: 1px solid #b8c0db;
    border-radius: 8px;
    font-size: 1em;
    resize: vertical;
    font-family: inherit;
    background: #ffffff;
}

#send-button {
    padding: 12px 24px;
    font-weight: bold;
    background: linear-gradient(90deg, #507be8 60%, #233a66 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    box-shadow: 0 2px 6px rgba(80,123,232,0.10);
}

#send-button:hover, #send-button:focus {
    background: linear-gradient(90deg, #3553ad 70%, #3553ad 100%);
    box-shadow: 0 4px 12px rgba(80,123,232,0.17);
    transform: translateY(-1px) scale(1.04);
}

@media (max-width: 900px) {
    .interface-row {
        flex-direction: column;
    }

    #assistant-gui-section, #chat-interface {
        width: 100%;
        height: auto;
    }

    #user-input-section {
        flex-direction: column;
        align-items: stretch;
    }

    textarea, #send-button {
        width: 100%;
    }
}
