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

body {
    font-family: 'Space Grotesk', sans-serif;
    background: #f5f5f5;
    color: #1a1a1a;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #1a1a1a;
}

header .subtitle {
    font-size: 1rem;
    color: #666;
    margin-top: 0.25rem;
}

main {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
}

/* Chat Panel */
.chat-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.transcript {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    max-height: 400px;
}

.transcript .empty-state {
    color: #999;
    text-align: center;
    padding: 2rem;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.message .role {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.25rem;
}

.message p {
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

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

.chat-link {
    color: #0066cc;
    text-decoration: underline;
    word-break: break-all;
}

.chat-link:hover {
    color: #0052a3;
}

.message.user {
    background: #e8f4ff;
}

.message.user .role {
    color: #0066cc;
}

.message.assistant {
    background: #f0f0f0;
}

.message.assistant .role {
    color: #333;
}

.message.system {
    background: #fff8e6;
    font-size: 0.875rem;
}

.message.system .role {
    color: #996600;
}

/* Controls */
.controls {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.connect-btn {
    background: #0066cc;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.connect-btn:hover {
    background: #0052a3;
}

.connect-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.connect-btn.connected {
    background: #cc3333;
}

.connect-btn.connected:hover {
    background: #aa2222;
}

.status {
    color: #666;
    font-size: 0.875rem;
}

/* State Panel */
.state-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    height: fit-content;
}

.state-panel h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
}

.state-display {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.state-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.state-item:last-child {
    border-bottom: none;
}

.state-label {
    font-size: 0.875rem;
    color: #666;
}

.state-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1a1a1a;
}

.state-value.empty {
    color: #ccc;
}

/* Checklist */
.checklist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.checklist-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #0066cc;
}

.checklist-item span {
    color: #333;
}

.checklist-item input:checked + span {
    text-decoration: line-through;
    color: #999;
}

/* Document Links */
.document-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.doc-link {
    display: block;
    padding: 0.5rem 0.75rem;
    background: #f5f5f5;
    border-radius: 6px;
    color: #0066cc;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.doc-link:hover {
    background: #e8f4ff;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 0.5rem;
}

.mode-btn {
    background: #f0f0f0;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.mode-btn.active {
    background: #0066cc;
    color: white;
}

.mode-btn:hover:not(.active) {
    background: #e0e0e0;
}

/* Input Controls */
.input-controls {
    padding: 1rem 1.5rem 1.5rem;
}

.input-controls.hidden {
    display: none;
}

/* Text Form */
.text-form {
    display: flex;
    gap: 0.5rem;
}

.text-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
}

.text-form input:focus {
    outline: none;
    border-color: #0066cc;
}

.text-form input:disabled {
    background: #f5f5f5;
}

.send-btn {
    background: #0066cc;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.send-btn:hover {
    background: #0052a3;
}

.hidden {
    display: none;
}


/* Footer */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
    border-top: 1px solid #e0e0e0;
    font-size: 0.875rem;
    color: #666;
}

.site-footer a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: #0066cc;
}

.footer-separator {
    margin: 0 0.75rem;
    color: #ccc;
}

.footer-cta {
    color: #0066cc !important;
    font-weight: 500;
}
