:root {
    --bg-color: #0d1117; /* Very dark blue/black */
    --card-bg: #161b22;
    --primary: #4dade8; /* Light blue */
    --accent: #d291ff; /* Purple-ish */
    --text-main: #e6edf3;
    --text-muted: #8b949e;
    --border: #30363d;
    --gradient: linear-gradient(135deg, #4dade8 0%, #d291ff 100%);
    --glass: rgba(22, 27, 34, 0.8);
}

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

body {
    background-color: #000;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Mobile Frame Simulation */
.app-container {
    width: 100%;
    max-width: 412px; /* Pixel 7/8 width approx */
    height: 100vh;
    max-height: 915px;
    background-color: var(--bg-color);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Optional: Border if on desktop */
    border: 1px solid var(--border);
}

/* Status Bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.status-icons span {
    font-size: 16px;
    margin-left: 4px;
}

/* Header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    z-index: 10;
}

header h1 {
    font-size: 18px;
    font-weight: 500;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Main Content */
main {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
}

.context-card {
    background: linear-gradient(180deg, rgba(77, 173, 232, 0.1) 0%, rgba(22, 27, 34, 0) 100%);
    border: 1px solid rgba(77, 173, 232, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.card-header h2 {
    font-size: 16px;
    font-weight: 500;
}

.icon-sparkle {
    color: var(--primary);
}

#active-context-display {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Chat */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

.message.system {
    align-self: flex-start;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.message.user {
    align-self: flex-end;
    background: var(--primary); /* Fallback */
    background: var(--gradient);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.thought {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-family: monospace;
    font-size: 12px;
    border: 1px dashed var(--border);
}

/* Suggestions/Prompts */
.suggestions-rail {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.suggestions-rail::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome */
}

.chip {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-main);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

/* Input Area */
.input-area {
    padding: 16px 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    align-items: center;
}

input[type="text"], textarea {
    flex: 1;
    background: var(--bg-color);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 24px;
    color: var(--text-main);
    outline: none;
    font-family: inherit;
}

input:focus, textarea:focus {
    border-color: var(--primary);
}

.fab {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--text-main);
    color: var(--bg-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.fab:hover {
    transform: scale(1.05);
}

/* Overlay/Modal */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: flex-end; /* Slide up from bottom */
    transition: opacity 0.3s;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    background: var(--card-bg);
    width: 100%;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 24px;
    animation: slideUp 0.3s ease;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.primary-btn {
    width: 100%;
    padding: 14px;
    background: var(--gradient);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
