/* ===== CSS Variables & Theme ===== */
:root {
    /* Colors - Light Theme (Default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f4;
    --bg-chat-user: #e3f2fd;
    --bg-chat-ai: #f5f5f5;
    --text-primary: #1a1a2e;
    --text-secondary: #5f6368;
    --text-muted: #80868b;
    --accent-primary: #4f46e5;
    --accent-secondary: #7c3aed;
    --accent-cyan: #06b6d4;
    --accent-amber: #f59e0b;
    --accent-green: #10b981;
    --accent-pink: #ec4899;
    --border-color: #e0e0e0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.2s ease;
    
    /* Step Colors */
    --step-1-color: #4f46e5;
    --step-2-color: #7c3aed;
    --step-3-color: #06b6d4;
    --step-4-color: #f59e0b;
    --step-5-color: #10b981;
    --step-6-color: #ec4899;
}

[data-theme="dark"] {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #252542;
    --bg-chat-user: #1e3a5f;
    --bg-chat-ai: #252538;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --text-muted: #707080;
    --border-color: #2a2a40;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    transition: var(--transition);
    overflow: hidden;
}

/* ===== Utility Classes ===== */
.hidden {
    display: none !important;
}

/* ===== Login Screen ===== */
.login-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s ease;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-logo p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input {
    padding: 16px;
    font-size: 1.125rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
    min-height: 56px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    min-height: 48px;
    touch-action: manipulation;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-large {
    padding: 18px 28px;
    font-size: 1.0625rem;
    min-height: 56px;
}

.btn-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition);
    touch-action: manipulation;
}

.btn-icon:hover {
    background: var(--border-color);
}

.btn-icon:active {
    transform: scale(0.95);
}

.btn-send {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: white;
    transition: var(--transition);
    flex-shrink: 0;
    touch-action: manipulation;
}

.btn-send:hover {
    background: var(--accent-secondary);
    transform: scale(1.05);
}

.btn-send:active {
    transform: scale(0.95);
}

/* ===== Main App Layout (Tablet First) ===== */
.main-app {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== Top Bar ===== */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    gap: 12px;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.logo-small {
    font-size: 28px;
}

.app-name {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.top-bar-center {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.participant-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Step Progress */
.step-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    max-width: 100%;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

.step-progress.step-1 { box-shadow: inset 3px 0 0 var(--step-1-color); }
.step-progress.step-2 { box-shadow: inset 3px 0 0 var(--step-2-color); }
.step-progress.step-3 { box-shadow: inset 3px 0 0 var(--step-3-color); }
.step-progress.step-4 { box-shadow: inset 3px 0 0 var(--step-4-color); }
.step-progress.step-5 { box-shadow: inset 3px 0 0 var(--step-5-color); }
.step-progress.step-6 { box-shadow: inset 3px 0 0 var(--step-6-color); }

.step-progress-title {
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    max-width: 170px;
    white-space: nowrap;
    flex-shrink: 0;
}

.step-progress-track {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: max-content;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

/* ===== Content Wrapper ===== */
.content-wrapper {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 300px;
    min-width: 300px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-section {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.sidebar-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.context-grid {
    display: grid;
    gap: 8px;
}

.context-grid input {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.context-grid input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.step-nav-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-width: 118px;
    max-width: 156px;
    min-height: 42px;
    padding: 6px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    touch-action: manipulation;
    justify-content: center;
}

.step-nav-btn:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.step-nav-btn:active {
    transform: scale(0.95);
}

.step-nav-btn.active {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.step-nav-btn.in-progress {
    border-color: rgba(79, 70, 229, 0.45);
    background: rgba(79, 70, 229, 0.06);
}

.step-nav-btn.ready {
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
}

.step-nav-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    font-size: 0.75rem;
    font-weight: 700;
    color: inherit;
    flex-shrink: 0;
}

.step-nav-btn.active .step-nav-num {
    background: rgba(255, 255, 255, 0.2);
}

.step-nav-btn.ready .step-nav-num {
    background: var(--accent-green);
    color: white;
}

.step-nav-btn.active.ready,
.step-nav-btn.active.in-progress {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.step-nav-name {
    font-size: 0.6875rem;
    line-height: 1.15;
    font-weight: 600;
    text-transform: uppercase;
    color: inherit;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
}

.step-arrow {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 700;
    flex: 0 0 auto;
}

/* Prompt Lists */
.prompt-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prompt-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
    touch-action: manipulation;
}

.prompt-btn:hover {
    border-color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.05);
    transform: translateX(2px);
}

.prompt-btn:active {
    transform: scale(0.98);
}

.prompt-code {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.1);
    padding: 3px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.prompt-label {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.new-chat-btn {
    margin-top: 8px;
}

.step-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.step-section-heading .sidebar-title,
.step-section-heading .sidebar-desc {
    margin-bottom: 0;
}

.step-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 10px;
    background: var(--accent-primary);
    color: white;
    font-weight: 800;
}

.step-goal {
    margin: 0 0 14px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.evidence-panel {
    background: var(--bg-tertiary);
}

.evidence-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.evidence-status {
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 700;
    white-space: nowrap;
}

.evidence-status.ready {
    color: var(--accent-green);
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.08);
}

.evidence-list {
    display: grid;
    gap: 7px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
}

.evidence-list li {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.35;
}

.evidence-list .evidence-met {
    color: var(--text-primary);
}

.evidence-list .evidence-met span {
    color: var(--accent-green);
}

.evidence-list .evidence-partial span {
    color: var(--accent-primary);
}

.evidence-count {
    color: var(--text-muted);
    font-size: 0.6875rem;
    line-height: 1.4;
}

.evidence-suggestion {
    width: 100%;
    margin-top: 10px;
    padding: 9px 10px;
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: var(--radius-sm);
    background: rgba(79, 70, 229, 0.08);
    color: var(--accent-primary);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 650;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.evidence-suggestion:hover {
    border-color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.14);
}

/* ===== Chat Area ===== */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    min-width: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Chat Message Bubbles */
.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

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

.message-ai {
    align-self: flex-start;
}

.message-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.message-ai .message-avatar {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
}

.message-user .message-avatar {
    background: var(--bg-tertiary);
}

.message-content {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    line-height: 1.6;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    margin: 0 0 10px;
    line-height: 1.3;
}

.message-content p {
    margin: 0 0 12px;
}

.message-content p:last-child,
.message-content ul:last-child,
.message-content ol:last-child,
.message-content table:last-child {
    margin-bottom: 0;
}

.message-content ul,
.message-content ol {
    margin: 0 0 12px 20px;
    padding: 0;
}

.message-content li + li {
    margin-top: 4px;
}

.message-content code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.92em;
    background: rgba(15, 23, 42, 0.08);
    padding: 2px 5px;
    border-radius: 4px;
}

.message-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 12px;
    font-size: 0.95rem;
}

.message-table th,
.message-table td {
    text-align: left;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    vertical-align: top;
}

.message-table th {
    background: var(--bg-secondary);
    font-weight: 700;
}

.message-ai .message-content {
    background: var(--bg-chat-ai);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-user .message-content {
    background: var(--bg-chat-user);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.message-step {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--accent-primary);
    background: rgba(79, 70, 229, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ===== Chat Input ===== */
.chat-input-area {
    padding: 12px 16px 16px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    transition: var(--transition);
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.chat-input-wrapper textarea {
    flex: 1;
    background: transparent;
    border: none;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    max-height: 120px;
    line-height: 1.5;
    padding: 6px 0;
}

.chat-input-wrapper textarea:focus {
    outline: none;
}

.chat-input-wrapper textarea::placeholder {
    color: var(--text-muted);
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== Responsive Design - Mobile ===== */
@media (max-width: 1180px) {
    .step-progress-title {
        display: none;
    }

    .step-nav-btn {
        min-width: 118px;
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 32px 24px;
    }
    
    .top-bar {
        padding: 10px 12px;
        flex-wrap: wrap;
    }

    .top-bar-center {
        order: 3;
        flex-basis: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
    }
    
    .app-name {
        display: none;
    }
    
    .participant-badge {
        padding: 6px 10px;
        font-size: 0.8125rem;
    }
    
    .step-progress {
        max-width: none;
        width: max-content;
        min-width: 100%;
        padding: 6px;
    }
    
    .step-progress-title {
        font-size: 0.8125rem;
        max-width: 128px;
    }

    .step-nav-btn {
        min-width: 118px;
        min-height: 40px;
        padding: 0 6px;
    }

    .step-arrow {
        font-size: 0.75rem;
    }
    
    /* Sidebar takes full width on mobile */
    .sidebar {
        width: 100%;
        min-width: auto;
        position: absolute;
        left: -100%;
        top: 0;
        height: 100%;
        z-index: 200;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .message {
        max-width: 92%;
    }
    
    .message-avatar {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .message-content {
        padding: 12px 14px;
        font-size: 0.9375rem;
    }
}

/* ===== Loading Animation ===== */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ===== System Message ===== */
.message-system {
    align-self: center;
    max-width: 90%;
    text-align: center;
}

.message-system .message-content {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 10px 16px;
    border-radius: var(--radius-xl);
}

/* ===== Chat list + Dialogs ===== */
.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.conversation-item {
    width: 100%;
    text-align: left;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 10px;
    cursor: pointer;
}

.conversation-item.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 999;
}

.modal-card {
    width: 100%;
    max-width: 520px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0 0 6px;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.modal-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.45;
}

.modal-form {
    display: grid;
    gap: 14px;
}

.form-field {
    display: grid;
    gap: 7px;
}

.form-field label {
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 650;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
    line-height: 1.45;
    resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.top-action-btn {
    min-height: 44px;
    padding: 10px 14px;
    white-space: nowrap;
}

.top-action-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .top-action-btn span {
        display: none;
    }

    .top-action-btn {
        width: 44px;
        padding: 0;
    }
}
/* Language choice remains beside the brand, including narrow screens. */
.brand-language { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.language-toggle { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; padding: 3px; border: 1px solid var(--border-color, #cbd5e1); border-radius: 9px; }
.language-toggle button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 48px; min-height: 36px; padding: 5px 7px; border: 2px solid transparent; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; font: 600 11px Inter, sans-serif; }
.language-toggle svg { width: 22px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px #80808060; }
.language-toggle button[aria-pressed="true"] { border-color: #6366f1; background: #6366f11a; }
.language-toggle button:focus-visible { outline: 3px solid #818cf8; outline-offset: 2px; }
.language-toggle button:disabled { cursor: wait; }
.top-bar-left { flex-wrap: wrap; }
@media (max-width: 600px) { .top-bar-left .app-name { font-size: 13px; } .language-toggle button { min-width: 40px; padding: 4px; } .top-bar-left .language-toggle { margin-left: 0; } }
