:root {
    --bg: #0d0f12;
    --panel: #14171c;
    --text: #e6e6e6;
    --accent: #d4a64a;
    --err: #e06c75;
    --user-bg: #2a2e37;
    --bot-bg: #1d2128;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--panel);
    border-bottom: 1px solid #222;
}

.logo {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--accent);
}

select, input[type="text"], input[type="password"], textarea {
    background-color: var(--bg);
    color: var(--text);
    border: 1px solid #333;
    padding: 5px 10px;
    border-radius: 4px;
    font-family: monospace;
}

select {
    font-family: system-ui, sans-serif;
    font-size: 0.9rem;
}

button {
    background-color: var(--panel);
    color: var(--text);
    border: 1px solid #333;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-family: system-ui, sans-serif;
}

button:hover {
    background-color: #222;
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.left-rail {
    width: 260px;
    background-color: var(--panel);
    border-right: 1px solid #222;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.rhythm-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 40px;
}

.rhythm-buttons button {
    text-align: left;
    padding: 10px 15px;
    font-size: 0.95rem;
}

.priorities-panel h3 {
    margin-top: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 0.05em;
    margin-bottom: 15px;
}

.error-msg {
    color: var(--err);
    font-size: 0.8rem;
    margin-bottom: 10px;
    min-height: 1.2em;
}

.priority-item {
    background-color: var(--bg);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    border: 1px solid #222;
}

.priority-item strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
}

.priority-item .actions {
    display: flex;
    gap: 8px;
}

.priority-item .actions button {
    font-size: 0.8rem;
    padding: 4px;
    flex: 1;
    background-color: var(--panel);
}

.add-priority {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.add-priority input {
    flex: 1;
    width: 100%;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: var(--bg);
}

.messages {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    max-width: 75%;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 1rem;
}

.message.user {
    align-self: flex-end;
    background-color: var(--user-bg);
}

.message.assistant {
    align-self: flex-start;
    background-color: var(--bot-bg);
    border: 1px solid #222;
}

.message p:first-child { margin-top: 0; }
.message p:last-child { margin-bottom: 0; }

.message pre {
    background-color: #000;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
}

.message code {
    font-family: monospace;
    font-size: 0.9em;
}

.bottom-input-bar {
    padding: 20px 30px;
    background-color: var(--panel);
    border-top: 1px solid #222;
    display: flex;
    align-items: flex-end;
    gap: 15px;
}

#chat-input {
    flex: 1;
    resize: none;
    max-height: 200px;
    min-height: 48px;
    padding: 12px;
    font-family: inherit;
    font-size: 1rem;
}

.bottom-input-bar button {
    height: 48px;
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

#btn-mic.active-mic {
    color: #fff;
    background-color: var(--err);
    animation: pulse 1.5s infinite;
}

#btn-speak.active-speak {
    color: var(--bg);
    background-color: var(--accent);
}

#status-indicator {
    position: absolute;
    bottom: 95px;
    right: 30px;
    font-size: 0.75rem;
    color: #888;
    background-color: rgba(0,0,0,0.6);
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(224, 108, 117, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(224, 108, 117, 0); }
    100% { box-shadow: 0 0 0 0 rgba(224, 108, 117, 0); }
}
