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

body {
    background: #2E3440;
    font-family: 'Courier New', monospace;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Nord Dark scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #2E3440;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: #434C5E;
    border-radius: 6px;
    border: 2px solid #2E3440;
}

::-webkit-scrollbar-thumb:hover {
    background: #4C566A;
}

::-webkit-scrollbar-thumb:active {
    background: #88C0D0;
}

/* Firefox scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: #434C5E #2E3440;
}

#header {
    background: #3B4252;
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid #88C0D0;
}

#header h1 {
    color: #88C0D0;
    font-size: 24px;
    letter-spacing: 2px;
}

#status {
    color: #A3BE8C;
    font-size: 12px;
    margin-top: 5px;
}

#main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

#terminal-container {
    flex: 1;
    padding: 20px;
    overflow: hidden;
}

#terminal {
    height: 100%;
    width: 100%;
}

aside {
    width: 400px;
    min-width: 300px;
    max-width: 800px;
    background: #3B4252;
    border-left: 2px solid #88C0D0;
    display: flex;
    flex-direction: column;
    position: relative;
}

#resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: ew-resize;
    background: transparent;
    z-index: 10;
    transform: translateX(-3px);
}

#resize-handle:hover {
    background: #88C0D0;
    opacity: 0.5;
}

#resize-handle.dragging {
    background: #88C0D0;
    opacity: 0.8;
}

#chat-header {
    background: #434C5E;
    border-bottom: 2px solid #88C0D0;
    display: flex;
}

.tab {
    flex: 1;
    padding: 15px;
    color: #88C0D0;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    background: #3B4252;
    border-right: 1px solid #2E3440;
    transition: background 0.2s;
}

.tab:last-child {
    border-right: none;
}

.tab:hover {
    background: #434C5E;
}

.tab.active {
    background: #5E81AC;
    color: #ECEFF4;
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: none;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

#chat-log {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#raw-log {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
}

.raw-message {
    padding: 8px;
    background: #2E3440;
    border-left: 3px solid #88C0D0;
    color: #ECEFF4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.raw-message.user {
    border-left-color: #5E81AC;
}

.raw-message.agent {
    border-left-color: #A3BE8C;
}

.chat-message {
    padding: 10px;
    border-radius: 5px;
    max-width: 90%;
    word-wrap: break-word;
}

.chat-message.user {
    background: #5E81AC;
    color: #ECEFF4;
    align-self: flex-end;
    margin-left: auto;
}

.chat-message.agent {
    background: #4C566A;
    color: #ECEFF4;
    align-self: flex-start;
}

.chat-message-sender {
    font-size: 11px;
    color: #88C0D0;
    margin-bottom: 4px;
    font-weight: bold;
}

.chat-message-text {
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.chat-message.typing .chat-message-text {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

#chat-input-container {
    padding: 15px;
    background: #434C5E;
    border-top: 2px solid #88C0D0;
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    background: #2E3440;
    border: 1px solid #88C0D0;
    color: #ECEFF4;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    border-radius: 3px;
}

#chat-input:focus {
    outline: none;
    border-color: #A3BE8C;
}

#chat-send-btn {
    background: #88C0D0;
    color: #2E3440;
    border: none;
    padding: 10px 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.2s;
}

#chat-send-btn:hover {
    background: #A3BE8C;
}

#chat-send-btn:active {
    background: #5E81AC;
}

.tab-content::-webkit-scrollbar {
    width: 8px;
}

.tab-content::-webkit-scrollbar-track {
    background: #2E3440;
}

.tab-content::-webkit-scrollbar-thumb {
    background: #88C0D0;
    border-radius: 4px;
}

.tab-content::-webkit-scrollbar-thumb:hover {
    background: #A3BE8C;
}

/* Code block and SQL syntax highlighting styles */
.code-block {
    background: #2E3440;
    border: 1px solid #88C0D0;
    border-radius: 4px;
    padding: 12px;
    margin: 10px 0;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.code-block code {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

/* Inline code */
code {
    background: #3B4252;
    color: #EBCB8B;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

/* SQL syntax highlighting - Nord colors */
.sql-keyword {
    color: #81A1C1;  /* Nord blue for keywords */
    font-weight: bold;
}

.sql-string {
    color: #A3BE8C;  /* Nord green for strings */
}

.sql-comment {
    color: #616E88;  /* Muted gray for comments */
    font-style: italic;
}

.sql-number {
    color: #B48EAD;  /* Nord purple for numbers */
}

/* Python syntax highlighting - Nord colors */
.py-keyword {
    color: #81A1C1;  /* Nord blue for keywords */
    font-weight: bold;
}

.py-builtin {
    color: #88C0D0;  /* Nord cyan for built-in functions */
    font-weight: bold;
}

.py-string {
    color: #A3BE8C;  /* Nord green for strings */
}

.py-comment {
    color: #616E88;  /* Muted gray for comments */
    font-style: italic;
}

.py-number {
    color: #B48EAD;  /* Nord purple for numbers */
}

/* Markdown text styles */
.chat-message-text p {
    margin: 8px 0;
}

.chat-message-text strong {
    color: #88C0D0;
    font-weight: bold;
}

.chat-message-text em {
    color: #EBCB8B;
    font-style: italic;
}

.chat-message-text ul,
.chat-message-text ol {
    margin: 8px 0;
    padding-left: 20px;
}

.chat-message-text li {
    margin: 4px 0;
}

.chat-message-text h1,
.chat-message-text h2,
.chat-message-text h3,
.chat-message-text h4,
.chat-message-text h5,
.chat-message-text h6 {
    color: #88C0D0;
    margin: 12px 0 8px 0;
