* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=EB+Garamond:ital,wght@0,400;0,600;1,400;1,600&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background: #0a0a0f;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: #141a10;
}
::-webkit-scrollbar-thumb {
    background: #4a6b3a;
    border-radius: 10px;
}

/* ===== LOGIN SCREEN ===== */
.lounge-screen {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.lounge-screen.hidden {
    display: none;
}

.lounge-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, #0d1a0d 0%, #050a05 100%);
}
.matrix-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 40%, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
}
.lounge-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(10, 10, 15, 0.2) 0%, rgba(10, 10, 15, 0.85) 100%);
}

.lounge-card {
    position: relative;
    z-index: 2;
    background: rgba(10, 15, 10, 0.85);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(74, 107, 58, 0.15);
    border-radius: 32px;
    padding: 40px 36px 32px;
    max-width: 420px;
    width: 92%;
    box-shadow: 0 60px 120px rgba(0, 0, 0, 0.8);
}

.lounge-header {
    text-align: center;
    margin-bottom: 4px;
}
.lounge-header h1 {
    font-size: 30px;
    font-weight: 300;
    letter-spacing: 8px;
    color: #e8f0d8;
}
.lounge-sub {
    color: #5a6a4a;
    font-size: 11px;
    letter-spacing: 4px;
    font-style: italic;
    margin-top: 2px;
}
.lounge-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(74, 107, 58, 0.2), transparent);
    margin: 18px 0 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 10px;
}
.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: #e8f0d8;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.3s;
}
.form-group input:focus {
    border-color: #4a6b3a;
    box-shadow: 0 0 30px rgba(74, 107, 58, 0.05);
}
.form-group input::placeholder {
    color: #4a5a3a;
    font-style: italic;
}
.login-btn {
    padding: 14px;
    background: linear-gradient(135deg, #3a5a2a, #2a4a1a);
    border: none;
    border-radius: 14px;
    color: #e8f0d8;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
    margin-top: 4px;
}
.login-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(74, 107, 58, 0.2);
}
.login-error {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 6px;
    display: none;
    text-align: center;
}
.lounge-footer {
    text-align: center;
    font-size: 11px;
    color: #3a4a3a;
    margin-top: 18px;
    letter-spacing: 2px;
    font-style: italic;
}

/* ===== APP ===== */
.app {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    position: fixed;
    inset: 0;
}

.left-panel {
    width: 36%;
    min-width: 300px;
    background: linear-gradient(160deg, #0c0e0a 0%, #141a10 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    border-right: 1px solid rgba(74, 107, 58, 0.15);
    overflow-y: auto;
}
.baby-card {
    text-align: center;
    max-width: 400px;
    width: 100%;
}
.baby-full {
    width: 100%;
    max-width: 340px;
    border-radius: 30px;
    border: 2px solid rgba(74, 107, 58, 0.25);
}
.poem-box {
    margin-top: 12px;
    padding: 12px 6px;
    border-top: 1px solid rgba(74, 107, 58, 0.15);
    border-bottom: 1px solid rgba(74, 107, 58, 0.15);
}
.poem-line {
    font-family: 'Playfair Display', 'EB Garamond', serif;
    font-size: 17px;
    line-height: 2;
    color: #b8c8a8;
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.3px;
    text-shadow: 0 0 20px rgba(74, 107, 58, 0.05);
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.poem-line:first-child {
    font-weight: 400;
}
.poem-line:last-child {
    font-weight: 400;
}

/* ===== CHART CONTAINER ===== */
.chart-container {
    background: rgba(12, 14, 10, 0.6);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(74, 107, 58, 0.1);
    margin-top: 16px;
    position: relative;
}
.tradingview-widget-container iframe {
    border-radius: 16px;
}

/* Fullscreen chart button */
.chart-fullscreen-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(10, 15, 10, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 107, 58, 0.2);
    border-radius: 8px;
    color: #8aaa7a;
    padding: 4px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    font-family: 'Inter', sans-serif;
}
.chart-fullscreen-btn:hover {
    background: rgba(74, 107, 58, 0.2);
    border-color: #6a8a5a;
    color: #c5d0b5;
    transform: scale(1.05);
}

/* Fullscreen overlay for chart */
.chart-fullscreen-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0a0a0f;
    display: none;
    flex-direction: column;
    padding: 20px;
}
.chart-fullscreen-overlay.active {
    display: flex;
}
.chart-fullscreen-overlay .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 16px 0;
    border-bottom: 1px solid rgba(74, 107, 58, 0.15);
}
.chart-fullscreen-overlay .chart-header h2 {
    color: #c5d0b5;
    font-weight: 400;
    font-size: 18px;
}
.chart-fullscreen-overlay .chart-header .close-fullscreen {
    background: transparent;
    border: 1px solid rgba(74, 107, 58, 0.2);
    border-radius: 8px;
    color: #8aaa7a;
    padding: 6px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}
.chart-fullscreen-overlay .chart-header .close-fullscreen:hover {
    background: rgba(74, 107, 58, 0.1);
    border-color: #6a8a5a;
    color: #c5d0b5;
}
.chart-fullscreen-overlay .chart-body {
    flex: 1;
    min-height: 0;
    padding-top: 16px;
}
.chart-fullscreen-overlay .chart-body .tradingview-widget-container {
    width: 100%;
    height: 100%;
}
.chart-fullscreen-overlay .chart-body .tradingview-widget-container iframe {
    width: 100% !important;
    height: 100% !important;
}

.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0c0e0a;
    min-width: 0;
}
.chat-header {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(12, 14, 10, 0.8);
    flex-shrink: 0;
}
.header-left h2 {
    font-size: 16px;
    font-weight: 400;
    color: #c5d0b5;
}
.header-left h2 span {
    color: #8aaa7a;
}
.logout-btn {
    background: transparent;
    border: 1px solid rgba(74, 107, 58, 0.2);
    color: #8aaa7a;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}
.logout-btn:hover {
    background: rgba(74, 107, 58, 0.1);
    border-color: #6a8a5a;
    color: #c5d0b5;
}

.messages {
    flex: 1;
    padding: 16px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.msg {
    display: flex;
    gap: 10px;
    max-width: 85%;
}
.msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(74, 107, 58, 0.15);
}
.msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bubble {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 16px;
    border-radius: 18px;
    border-top-left-radius: 4px;
    font-size: 14px;
    line-height: 1.7;
    border: 1px solid rgba(255, 255, 255, 0.02);
}
.msg.user .bubble {
    background: rgba(74, 107, 58, 0.08);
    border: 1px solid rgba(74, 107, 58, 0.15);
    border-top-left-radius: 18px;
    border-top-right-radius: 4px;
}
.bubble p {
    margin: 0;
    font-family: 'EB Garamond', serif;
}
.time {
    font-size: 9px;
    color: #4a5a3a;
    display: block;
    margin-top: 4px;
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}
.typing-dots span {
    width: 6px;
    height: 6px;
    background: #4a6b3a;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}
.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes typingBounce {
    0%,
    60%,
    100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

.input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 14px;
    background: rgba(12, 14, 10, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}
.input-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #6a7a5a;
}
.input-btn:hover {
    background: rgba(74, 107, 58, 0.08);
    color: #a4b892;
}
.input-bar input[type="text"] {
    flex: 1;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 30px;
    color: #c5d0b5;
    font-size: 14px;
    outline: none;
    font-family: 'Inter', sans-serif;
}
.input-bar input[type="text"]:focus {
    border-color: #4a6b3a;
}
.input-bar input[type="text"]::placeholder {
    color: #4a5a3a;
    font-style: italic;
}
.send-btn {
    background: linear-gradient(135deg, #3a5a2a, #2a4a1a);
    color: #e8f0d8;
}
.send-btn:hover {
    transform: scale(1.05);
}
.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.file-preview {
    padding: 4px 16px 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: rgba(12, 14, 10, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.02);
}
.file-preview .file-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(74, 107, 58, 0.1);
    border: 1px solid rgba(74, 107, 58, 0.2);
    border-radius: 20px;
    padding: 2px 10px 2px 8px;
    font-size: 11px;
    color: #a4b892;
}
.file-preview .file-chip .remove-file {
    cursor: pointer;
    color: #6a7a5a;
}
.file-preview .file-chip .remove-file:hover {
    color: #c5d0b5;
}

/* ===== RESPONSIVE ===== */

/* Tablets and smaller laptops */
@media (max-width: 1024px) {
    .left-panel {
        min-width: 240px;
        width: 30%;
    }
    .baby-full {
        max-width: 240px;
    }
    .poem-line {
        font-size: 15px;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    .app {
        flex-direction: column;
    }
    .left-panel {
        width: 100%;
        min-width: unset;
        height: 45vh;
        max-height: 400px;
        border-right: none;
        border-bottom: 1px solid rgba(74, 107, 58, 0.15);
        padding: 12px;
        overflow-y: auto;
    }
    .baby-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 16px;
        max-width: 100%;
        flex-wrap: wrap;
    }
    .baby-full {
        max-width: 120px;
        width: 120px;
        height: 120px;
        border-radius: 50%;
        object-fit: cover;
    }
    .poem-box {
        margin-top: 0;
        padding: 8px 12px;
        border-top: none;
        border-bottom: none;
        border-left: 1px solid rgba(74, 107, 58, 0.15);
        max-width: 200px;
        text-align: left;
        flex: 1;
    }
    .poem-line {
        font-size: 12px;
        line-height: 1.6;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        display: block;
    }
    .chart-container {
        display: block;
        margin-top: 8px;
        width: 100%;
    }
    .chart-container .tradingview-widget-container {
        height: 120px !important;
    }
    .chart-container .tradingview-widget-container iframe {
        height: 120px !important;
    }
    .chart-fullscreen-btn {
        font-size: 10px;
        padding: 2px 8px;
    }
    .right-panel {
        height: 55vh;
        min-height: 300px;
    }
    .chat-header {
        padding: 10px 14px;
    }
    .header-left h2 {
        font-size: 14px;
    }
    .logout-btn {
        font-size: 10px;
        padding: 4px 10px;
    }
    .messages {
        padding: 12px 14px;
        gap: 10px;
    }
    .msg {
        max-width: 90%;
    }
    .bubble {
        font-size: 13px;
        padding: 8px 14px;
    }
    .input-bar {
        padding: 6px 12px 10px;
        gap: 6px;
    }
    .input-bar input[type="text"] {
        font-size: 13px;
        padding: 6px 12px;
    }
    .input-btn {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    .lounge-card {
        padding: 28px 20px 24px;
        border-radius: 24px;
        width: 94%;
    }
    .lounge-header h1 {
        font-size: 24px;
        letter-spacing: 6px;
    }
    .lounge-sub {
        font-size: 10px;
        letter-spacing: 3px;
    }
    .login-btn {
        font-size: 14px;
        padding: 12px;
    }
    .form-group input {
        font-size: 14px;
        padding: 12px 14px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .left-panel {
        height: 40vh;
        max-height: 320px;
        padding: 8px;
    }
    .baby-card {
        flex-direction: column;
        gap: 8px;
    }
    .baby-full {
        width: 90px;
        height: 90px;
        max-width: 90px;
    }
    .poem-box {
        border-left: none;
        border-top: 1px solid rgba(74, 107, 58, 0.15);
        border-bottom: 1px solid rgba(74, 107, 58, 0.15);
        max-width: 100%;
        text-align: center;
        padding: 6px 0;
        width: 100%;
    }
    .poem-line {
        font-size: 12px;
        white-space: normal;
        line-height: 1.6;
        display: block;
        overflow: visible;
        text-overflow: unset;
    }
    .chart-container {
        display: none;
    }
    .right-panel {
        height: 60vh;
        min-height: 250px;
    }
    .chat-header {
        padding: 8px 10px;
        flex-wrap: wrap;
        gap: 6px;
    }
    .header-left h2 {
        font-size: 12px;
    }
    .logout-btn {
        font-size: 9px;
        padding: 3px 8px;
    }
    .messages {
        padding: 10px 10px;
        gap: 8px;
    }
    .msg {
        max-width: 95%;
        gap: 6px;
    }
    .msg-avatar {
        width: 24px;
        height: 24px;
    }
    .bubble {
        font-size: 12px;
        padding: 6px 10px;
        border-radius: 14px;
    }
    .time {
        font-size: 8px;
    }
    .input-bar {
        padding: 4px 8px 8px;
        gap: 4px;
    }
    .input-bar input[type="text"] {
        font-size: 12px;
        padding: 5px 10px;
        border-radius: 20px;
    }
    .input-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    .send-btn {
        font-size: 12px;
    }
    .lounge-card {
        padding: 20px 16px 18px;
        border-radius: 20px;
        width: 96%;
    }
    .lounge-header h1 {
        font-size: 20px;
        letter-spacing: 4px;
    }
    .lounge-sub {
        font-size: 9px;
        letter-spacing: 2px;
    }
    .lounge-divider {
        margin: 12px 0 14px;
    }
    .login-form {
        gap: 8px;
    }
    .login-btn {
        font-size: 13px;
        padding: 10px;
        border-radius: 12px;
    }
    .form-group input {
        font-size: 13px;
        padding: 10px 12px;
        border-radius: 12px;
    }
    .lounge-footer {
        font-size: 9px;
        margin-top: 12px;
    }
}

/* Very small mobile devices */
@media (max-width: 380px) {
    .left-panel {
        height: 35vh;
        max-height: 280px;
        padding: 6px;
    }
    .baby-full {
        width: 70px;
        height: 70px;
        max-width: 70px;
    }
    .poem-line {
        font-size: 11px;
        line-height: 1.5;
    }
    .right-panel {
        height: 65vh;
        min-height: 200px;
    }
    .header-left h2 {
        font-size: 11px;
    }
    .logout-btn {
        font-size: 8px;
        padding: 2px 6px;
    }
    .messages {
        padding: 6px 8px;
        gap: 6px;
    }
    .bubble {
        font-size: 11px;
        padding: 5px 8px;
        border-radius: 12px;
    }
    .input-bar input[type="text"] {
        font-size: 11px;
        padding: 4px 8px;
    }
    .input-btn {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }
    .lounge-card {
        padding: 16px 12px 14px;
        border-radius: 16px;
        width: 98%;
    }
    .lounge-header h1 {
        font-size: 17px;
        letter-spacing: 3px;
    }
    .lounge-sub {
        font-size: 8px;
        letter-spacing: 2px;
    }
    .login-btn {
        font-size: 12px;
        padding: 8px;
        border-radius: 10px;
    }
    .form-group input {
        font-size: 12px;
        padding: 8px 10px;
        border-radius: 10px;
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .app {
        flex-direction: row;
    }
    .left-panel {
        width: 35%;
        height: 100vh;
        max-height: 100vh;
        border-right: 1px solid rgba(74, 107, 58, 0.15);
        border-bottom: none;
        overflow-y: auto;
    }
    .baby-card {
        flex-direction: column;
        gap: 4px;
    }
    .baby-full {
        width: 80px;
        height: 80px;
        max-width: 80px;
    }
    .poem-box {
        border-left: none;
        border-top: 1px solid rgba(74, 107, 58, 0.15);
        border-bottom: none;
        max-width: 100%;
        text-align: center;
        padding: 4px 0;
        width: 100%;
    }
    .poem-line {
        font-size: 10px;
        white-space: normal;
        line-height: 1.4;
    }
    .chart-container {
        display: none;
    }
    .right-panel {
        height: 100vh;
        width: 65%;
    }
}

/* Prevent zoom on input focus for iOS */
@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* ===== CHART TOGGLE BUTTON (Mobile) ===== */
.chart-toggle-btn {
    background: transparent;
    border: 1px solid rgba(74, 107, 58, 0.2);
    color: #8aaa7a;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    display: none;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}
.chart-toggle-btn:hover {
    background: rgba(74, 107, 58, 0.1);
    border-color: #6a8a5a;
    color: #c5d0b5;
}

/* ===== CHART DRAWER (Mobile Slide-out) ===== */
.chart-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: #0c0e0a;
    border-left: 1px solid rgba(74, 107, 58, 0.15);
    z-index: 9998;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
}
.chart-drawer.active {
    right: 0;
}

.chart-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(74, 107, 58, 0.15);
    flex-shrink: 0;
}
.chart-drawer-header h3 {
    color: #c5d0b5;
    font-weight: 400;
    font-size: 16px;
    margin: 0;
}
.chart-drawer-close {
    background: transparent;
    border: 1px solid rgba(74, 107, 58, 0.2);
    border-radius: 8px;
    color: #8aaa7a;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}
.chart-drawer-close:hover {
    background: rgba(74, 107, 58, 0.1);
    border-color: #6a8a5a;
    color: #c5d0b5;
}

.chart-drawer-body {
    flex: 1;
    padding: 16px;
    min-height: 0;
}
.chart-drawer-body .tradingview-widget-container {
    width: 100%;
    height: 100%;
}
.chart-drawer-body .tradingview-widget-container iframe {
    width: 100% !important;
    height: 100% !important;
}

/* ===== CHART DRAWER OVERLAY ===== */
.chart-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9997;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.chart-drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===== RESPONSIVE UPDATES ===== */

/* Mobile devices */
@media (max-width: 768px) {
    /* Show chart toggle button */
    .chart-toggle-btn {
        display: inline-flex !important;
    }
    
    /* Hide mini chart on mobile */
    .chart-container {
        display: none !important;
    }
    
    /* Adjust header for mobile */
    .header-right {
        display: flex;
        align-items: center;
        gap: 4px;
    }
    
    /* Drawer width for smaller screens */
    .chart-drawer {
        width: 90%;
        max-width: 350px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .chart-drawer {
        width: 95%;
        max-width: 320px;
    }
    
    .chart-drawer-header h3 {
        font-size: 14px;
    }
    
    .chart-drawer-header {
        padding: 12px 16px;
    }
    
    .chart-drawer-body {
        padding: 10px;
    }
}

/* Very small mobile devices */
@media (max-width: 380px) {
    .chart-drawer {
        width: 98%;
        max-width: 280px;
    }
    
    .chart-toggle-btn {
        font-size: 14px;
        padding: 4px 8px;
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .chart-drawer {
        width: 60%;
        max-width: 500px;
    }
}

/* ===== FIX FOR NOKIA G20 AND SIMILAR DEVICES ===== */

/* Ensure app fills the entire viewport height correctly */
.app {
    height: 100vh;
    height: 100dvh; /* Use dynamic viewport height for mobile */
    max-height: 100vh;
    max-height: 100dvh;
}

/* Ensure right panel doesn't overflow */
.right-panel {
    height: 100%;
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Make messages area flexible and input bar stay at bottom */
.messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.input-bar {
    flex-shrink: 0;
    padding: 10px 16px 14px;
    padding-bottom: max(14px, env(safe-area-inset-bottom, 14px));
}

/* Specific fix for left panel on mobile to prevent overflow */
@media (max-width: 768px) {
    .app {
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        overflow: hidden;
    }
    
    .left-panel {
        height: 40vh;
        height: 40dvh;
        max-height: 400px;
        max-height: 40dvh;
        flex-shrink: 0;
        overflow-y: auto;
    }
    
    .right-panel {
        height: 60vh;
        height: 60dvh;
        min-height: 0;
        flex: 1;
    }
    
    /* Ensure messages scroll properly */
    .messages {
        flex: 1 1 auto;
        min-height: 50px;
        max-height: calc(60dvh - 120px);
        overflow-y: auto;
    }
    
    /* Keep input bar at bottom */
    .input-bar {
        flex-shrink: 0;
        padding: 6px 12px 10px;
        padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
    }
}

@media (max-width: 480px) {
    .left-panel {
        height: 35vh;
        height: 35dvh;
        max-height: 320px;
        max-height: 35dvh;
    }
    
    .right-panel {
        height: 65vh;
        height: 65dvh;
        min-height: 200px;
    }
    
    .messages {
        max-height: calc(65dvh - 100px);
    }
}

@media (max-width: 380px) {
    .left-panel {
        height: 30vh;
        height: 30dvh;
        max-height: 280px;
        max-height: 30dvh;
    }
    
    .right-panel {
        height: 70vh;
        height: 70dvh;
        min-height: 180px;
    }
    
    .messages {
        max-height: calc(70dvh - 90px);
    }
}