/* Core Reset & Daytime Sanctuary Theme Tokens */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    background-color: #F4F0EB; /* Soft Ivory Background */
    color: #344C3D; /* Deep Charcoal Text */
    height: 100%;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 480px; /* Forces a beautiful mobile layout even on desktops */
    margin: 0 auto;
    background-color: #F4F0EB;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.03);
    position: relative;
}

/* 1. Header Styling */
.app-header {
    background-color: #F4F0EB;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #E5DEC9;
    z-index: 10;
}

.app-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #344C3D;
    letter-spacing: -0.5px;
}

.emdr-btn {
    background-color: #E6EDE5; /* Very soft sage tint */
    border: 1px solid #8EA58C;
    color: #344C3D;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.emdr-btn.active {
    background-color: #8EA58C; /* Active Sage Green */
    color: #FFFFFF;
    box-shadow: 0 0 10px rgba(142, 165, 140, 0.4);
}

.header-spacer { width: 110px; } /* Balances the header alignment */

/* 2. Conversation Stream */
.chat-stream {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.message {
    max-width: 85%;
    padding: 14px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: fadeIn 0.3s ease-out;
}

.emma-message {
    background-color: #8EA58C; /* Sage Green */
    color: #FFFFFF;
    align-self: flex-start;
    border-top-left-radius: 4px;
}

.user-message {
    background-color: #DCCFBF; /* Warm Sand */
    color: #344C3D;
    align-self: flex-end;
    border-top-right-radius: 4px;
}

.timestamp {
    font-size: 0.7rem;
    opacity: 0.7;
    align-self: flex-end;
}

/* 3. Input Utility Bar */
.app-input-bar {
    padding: 16px;
    background-color: #F4F0EB;
    border-top: 1px solid #E5DEC9;
}

.input-container {
    display: flex;
    background-color: #FFFFFF;
    border: 1px solid #DCCFBF;
    border-radius: 25px;
    padding: 4px 6px 4px 16px;
    align-items: center;
}

#user-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: #344C3D;
    padding: 10px 0;
    background: transparent;
}

#user-input::placeholder {
    color: #A0968A;
}

.send-btn {
    background-color: #8EA58C;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.send-btn:hover { background-color: #7A9178; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}