@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('/assets/AtkinsonHyperlegible-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
/* --- Base Styles --- */
html {
    font-size: 16px;
}
body {
    font-family: 'Atkinson Hyperlegible', sans-serif;
    background-color: #f7fafc;
    color: #2d3748;
    margin: 0;
    display: flex;
    flex-direction: row; /* Default to side-by-side layout for desktop */
    height: 100vh;
    height: 100svh;
}
header, footer {
    background-color: #594a69; /* Dusty Purple */
    color: #ffffff;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
    flex-shrink: 0; /* Prevent header/footer from shrinking */
}
header h1 { margin: 0; font-size: 1.75rem; }
header p { margin: 5px 0 15px; color: #e2e8f0; font-size: 1rem; }

/* --- New Main Layout --- */
.chat-column {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* This column takes up all remaining space */
    overflow: hidden; /* Important for child scrolling */
}

/* ... (Slider styles are unchanged) ... */
.settings-container { max-width: 300px; margin: 0 auto; }
.settings-container label { font-size: 0.875rem; font-weight: bold; }
.slider-wrapper { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.font-size-icon.small { font-size: 0.8rem; }
.font-size-icon.large { font-size: 1.2rem; }
#font-size-slider { flex-grow: 1; -webkit-appearance: none; appearance: none; width: 100%; height: 8px; background: #827397; border-radius: 5px; outline: none; opacity: 0.9; transition: opacity .2s; }
#font-size-slider:hover { opacity: 1; }
#font-size-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; background: #ffffff; cursor: pointer; border-radius: 50%; border: 2px solid #a395b4; }
#font-size-slider::-moz-range-thumb { width: 20px; height: 20px; background: #ffffff; cursor: pointer; border-radius: 50%; border: 2px solid #a395b4; }


/* --- Chat Area --- */
#chat-container {
    flex-grow: 1; /* This now makes it fill the space inside .chat-column */
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.chat-message { padding: 15px; border-radius: 12px; max-width: 85%; line-height: 1.5; font-size: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.user-message { background-color: #e0e8e1; color: #334b49; align-self: flex-end; border-bottom-right-radius: 2px; }
.gemini-message { background-color: #ffffff; align-self: flex-start; border: 1px solid #e2e8f0; border-bottom-left-radius: 2px; position: relative; margin-left: 30px; }
.gemini-message::before { content: ''; position: absolute; left: -45px; bottom: 0; width: 35px; height: 35px; background-image: url('assets/ethel.png'); background-size: cover; border-radius: 50%; border: 2px solid #e2e8f0; }
.gemini-message.loading { color: #718096; font-style: italic; }

/* --- Aside Section (Full Height) --- */
#ethels-corner {
    flex-basis: 320px; /* Slightly wider for better text flow */
    flex-shrink: 0;
    padding: 25px;
    border-left: 1px solid #e2e8f0;
    background-color: #fdfdfd;
    overflow-y: auto;
    text-align: center;
}
.ethel-portrait { max-width: 150px; border-radius: 50%; margin-bottom: 15px; border: 4px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
#ethels-corner h2 { margin-top: 0; color: #594a69; }
#ethels-corner p { font-size: 0.95rem; line-height: 1.6; color: #4a5568; }
.aside-buttons { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.aside-buttons button { padding: 12px; border: 1px solid #827397; background-color: transparent; color: #594a69; border-radius: 8px; font-weight: bold; cursor: pointer; transition: all 0.2s; }
.aside-buttons button:hover { background-color: #e9e6ed; color: #2d3748; }

/* ... (Input form styles are unchanged) ... */
#chat-form { display: flex; gap: 10px; }
#chat-input { flex-grow: 1; padding: 15px; border: 1px solid #cbd5e0; border-radius: 30px; font-size: 1rem; font-family: 'Atkinson Hyperlegible', sans-serif; background: #ffffff; color: #2d3748; }
#chat-input:focus { outline: none; border-color: #5aa09d; box-shadow: 0 0 0 2px #c1d7d6; }
#chat-form button { padding: 15px 25px; border: none; background-color: #4a8a87; color: white; font-size: 1rem; font-weight: bold; border-radius: 30px; cursor: pointer; -webkit-tap-highlight-color: transparent; background-image: linear-gradient(to right, #f6ad55 50%, #4a8a87 50%); background-size: 200% 100%; background-position: 100% 0; transition: background-position 1s linear, background-color 0.2s; }
#chat-form button:hover { background-color: #5aa09d; }
#chat-form button.charging { background-position: 0 0; }

/* --- Responsive styles for smaller screens --- */
@media (max-width: 800px) {
    body {
        flex-direction: column; /* Stack everything vertically */
    }

    #ethels-corner {
        order: -1; /* Move aside to the top on mobile */
        border-left: none;
        border-bottom: 1px solid #e2e8f0;
        flex-basis: auto; /* Let it size itself vertically */
        max-height: 220px; /* Give it a reasonable max height */
    }

    /* Hide some elements on mobile to save precious screen space */
    .ethel-portrait { display: none; } 
    #ethels-corner h2 { display: none; }
    
    .aside-buttons { flex-direction: row; }
    .aside-buttons button { flex-grow: 1; }
}