* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #f5f5f5;
    overflow: hidden;
}

/* ── Top navigation ── */
.top-nav {
    display: flex;
    align-items: center;
    height: 48px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 16px;
    gap: 4px;
    z-index: 100;
    flex-shrink: 0;
}

.top-nav .tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 14px;
    height: 48px;
    font-size: 14px;
    color: #555;
    text-decoration: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s;
    white-space: nowrap;
}

.top-nav .tab:hover { color: #1a73e8; }
.top-nav .tab.active { color: #1a73e8; border-bottom-color: #1a73e8; font-weight: 500; }
.top-nav .tab svg { width: 14px; height: 14px; opacity: 0.6; }

/* ── Main layout below nav ── */
.layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* ── Sidebar toggle button (visible when sidebar is closed) ── */
.sidebar-toggle {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    transition: opacity 0.2s;
}

.sidebar-toggle svg { width: 14px; height: 14px; color: #555; }
.sidebar-toggle.hidden { opacity: 0; pointer-events: none; }

/* ── Left sidebar ── */
.sidebar {
    width: 300px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transform: translateX(-300px);
    transition: transform 0.25s ease;
}

.sidebar.open { transform: translateX(0); }

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 0 14px;
    height: 48px;
    border-bottom: 1px solid #e0e0e0;
    gap: 8px;
    flex-shrink: 0;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34a853;
    flex-shrink: 0;
}

.sidebar-header span {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #888;
    display: flex;
    align-items: center;
}

.close-btn:hover { color: #333; }
.close-btn svg { width: 16px; height: 16px; }

/* ── Chat messages area ── */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user {
    align-self: flex-end;
    background: #1a73e8;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.assistant {
    align-self: flex-start;
    background: #f1f3f4;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message.typing {
    align-self: flex-start;
    background: #f1f3f4;
    color: #888;
    font-style: italic;
}

/* ── Chat input area ── */
.chat-input {
    padding: 12px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}

.chat-input textarea {
    flex: 1;
    resize: none;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.4;
    max-height: 100px;
    outline: none;
    font-family: inherit;
}

.chat-input textarea:focus { border-color: #1a73e8; }

.send-btn {
    width: 36px;
    height: 36px;
    background: #1a73e8;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.send-btn:hover { background: #1557b0; }
.send-btn svg { width: 16px; height: 16px; color: #fff; }
.send-btn:disabled { background: #ccc; cursor: not-allowed; }

/* ── Main content area ── */
.content {
    flex: 1;
    overflow: auto;
}
