/* ==================== VARIABLES ==================== */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #252542;
    --bg-hover: #2d2d5a;
    --text-primary: #e0e0ff;
    --text-secondary: #a0a0cc;
    --text-muted: #8282aa;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --border-color: #2a2a4a;
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* The main site's global style.css (also loaded on every /ai page via the
   shared root layout) carries its own `h1, h2, h3, h4, h5, h6 { color:
   var(--dark) }` rule for its light-background pages. That rule's bare
   element-list selector has higher specificity than this file's plain
   `body` color above, so it silently won on every heading here that didn't
   set its own explicit color — rendering near-black text on this page's
   dark background, i.e. invisible. `body h1`/etc. (two element selectors)
   outranks a bare `h1,h2,...` list regardless of stylesheet load order,
   closing the leak without touching style.css or any individual heading. */
body h1, body h2, body h3, body h4, body h5, body h6 {
    color: var(--text-primary);
}

html {
    width: 100%;
    max-width: 100%;
    -webkit-text-size-adjust: 100%;
}

img,
svg,
canvas,
video {
    max-width: 100%;
}

button,
input,
select,
textarea {
    max-width: 100%;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* ==================== APP CONTAINER ==================== */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

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

.brand-logo-img {
    display: inline-block;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 8px;
    background: #fff;
}

.brand-logo-img-sm {
    width: 36px;
    height: 36px;
}

.brand-logo-img-xs {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.brand-logo-img-lg {
    width: 92px;
    height: 92px;
    border-radius: 16px;
}

.brand-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    vertical-align: middle;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.new-chat-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.new-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.agent-selector {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.agent-selector h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.agent-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.agent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.agent-item:hover {
    background: var(--bg-hover);
}

.agent-item.active {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid var(--accent-purple);
}

.agent-item .agent-icon {
    font-size: 18px;
}

.agent-item .agent-info {
    flex: 1;
}

.agent-item .agent-name {
    font-weight: 500;
    display: block;
}

.agent-item .agent-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.conversation-list h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    margin-bottom: 4px;
    position: relative;
}

.conversation-item:hover {
    background: var(--bg-hover);
}

.conversation-item.active {
    background: var(--bg-tertiary);
}

.conversation-item .conv-icon {
    font-size: 16px;
}

.conversation-item .conv-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-item .pin-icon {
    font-size: 12px;
    color: var(--accent-purple);
    opacity: 0;
    transition: var(--transition);
}

.conversation-item:hover .pin-icon,
.conversation-item.pinned .pin-icon {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.user-menu:hover {
    background: var(--bg-hover);
}

.user-avatar {
    font-size: 24px;
}

.user-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.user-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px;
    display: none;
    box-shadow: var(--shadow);
    margin-bottom: 8px;
}

.user-menu:hover .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
}

.user-dropdown a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.user-dropdown hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 8px 0;
}

/* ==================== SIDEBAR TOGGLE ==================== */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 18px;
}

/* ==================== CHAT MAIN ==================== */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 15, 26, 0.8);
    backdrop-filter: blur(10px);
}

.current-agent {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.current-agent .agent-icon {
    font-size: 24px;
}

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

.header-actions button {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.header-actions button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ==================== CHAT MESSAGES ==================== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

/* ==================== WELCOME SCREEN ==================== */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.welcome-content {
    text-align: center;
    max-width: 800px;
    width: 100%;
}

.welcome-content h1 {
    font-size: 42px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.quick-prompts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 12px;
    padding: 0 20px;
}

.prompt-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px 20px;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 14px;
}

.prompt-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2);
}

.prompt-card i {
    font-size: 20px;
    color: var(--accent-purple);
    flex-shrink: 0;
}

/* ==================== MESSAGE BUBBLES ==================== */
.message {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    max-width: 900px;
    width: 100%;
    align-self: center;
    animation: fadeInUp 0.3s ease;
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
}

.message-content {
    flex: 1;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 16px 20px;
    border: 1px solid var(--border-color);
}

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

.message-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.message-author {
    font-weight: 600;
    font-size: 14px;
}

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

.message-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.message-text code {
    background: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: var(--accent-cyan);
}

.message-text pre {
    background: var(--bg-primary);
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid var(--border-color);
}

.message-text pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.message-text strong {
    color: var(--accent-cyan);
}

.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    opacity: 0;
    transition: var(--transition);
}

.message:hover .message-actions {
    opacity: 1;
}

.message-actions button {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.message-actions button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.message-actions button.liked {
    color: var(--accent-pink);
    border-color: var(--accent-pink);
}

/* ==================== TYPING INDICATOR ==================== */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 16px 20px;
    align-self: center;
    max-width: 900px;
    width: 100%;
}

.typing-indicator .dot {
    width: 8px;
    height: 8px;
    background: var(--accent-purple);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ==================== CHAT INPUT ==================== */
.chat-input-area {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 12px 16px;
    transition: var(--transition);
}

.input-container:focus-within {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.input-container textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    resize: none;
    max-height: min(55dvh, 620px);
    outline: none;
    font-family: inherit;
    line-height: 1.5;
}

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

.send-btn {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.disclaimer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ==================== AUTH PAGES ==================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1030 100%);
}

.auth-container {
    display: flex;
    width: 100%;
    max-width: 1200px;
    min-height: 600px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.auth-left {
    flex: 1;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.auth-logo {
    position: relative;
    z-index: 1;
    text-align: center;
}

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

.auth-logo h1 {
    font-size: 32px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-tagline {
    position: relative;
    z-index: 1;
    font-size: 18px;
    color: var(--text-secondary);
    margin-top: 12px;
}

.auth-illustration {
    position: relative;
    z-index: 1;
    margin-top: 40px;
    display: flex;
    gap: 20px;
}

.floating-icon {
    font-size: 40px;
    animation: float 3s ease-in-out infinite;
}

.floating-icon:nth-child(2) {
    animation-delay: 1s;
}

.floating-icon:nth-child(3) {
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
}

.auth-form-container h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.auth-form-container > p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 24px;
    padding: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.auth-tab {
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab.active,
.auth-tab:hover {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    color: white;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-group label i {
    margin-right: 6px;
    color: var(--accent-purple);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.subject-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.subject-tags .tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.subject-tags .tag:hover {
    border-color: var(--accent-purple);
}

.subject-tags .tag input {
    width: auto;
    accent-color: var(--accent-purple);
}

.subject-tags .tag:has(input:checked) {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.auth-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    padding: 0 16px;
}

.google-btn {
    width: 100%;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.google-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-purple);
}

.google-btn i {
    color: #ea4335;
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent-purple);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ==================== AUTH V2 (new clean design) ==================== */
.auth-v2-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: #0a0a0f;
    display: flex;
    align-items: stretch;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.auth-v2-wrap {
    display: flex;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    min-width: 0;
}

/* Left brand panel */
.auth-v2-panel {
    width: 44%;
    flex-shrink: 0;
    background: linear-gradient(145deg, #0f1117 0%, #111827 50%, #0f1117 100%);
    border-right: 1px solid #1e2229;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 52px;
    position: relative;
    overflow: hidden;
}

.auth-v2-panel::before {
    content: '';
    position: absolute;
    top: -120px; left: -120px;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16,163,127,.18) 0%, transparent 70%);
    pointer-events: none;
}

.auth-v2-panel::after {
    content: '';
    position: absolute;
    bottom: -80px; right: -80px;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,.12) 0%, transparent 70%);
    pointer-events: none;
}

.auth-v2-panel-inner { position: relative; z-index: 1; max-width: 380px; }

.auth-v2-brand {
    display: flex; align-items: center; gap: 10px;
    font-size: 18px; font-weight: 700; color: #f5f5f7;
    margin-bottom: 48px;
}

.auth-v2-brand-mark {
    width: 36px; height: 36px; border-radius: 9px;
    background: #10a37f; color: white;
    font-size: 13px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.auth-v2-brand-mark.sm { width: 28px; height: 28px; font-size: 11px; border-radius: 7px; }

.auth-v2-panel-heading {
    font-size: 30px; font-weight: 800;
    line-height: 1.18; color: #f5f5f7;
    margin-bottom: 14px; letter-spacing: -.02em;
}

.auth-v2-panel-sub {
    color: #8b949e; font-size: 15px; line-height: 1.6; margin-bottom: 36px;
}

.auth-v2-features {
    list-style: none; display: flex; flex-direction: column; gap: 14px; margin-bottom: 40px;
}

.auth-v2-features li {
    display: flex; align-items: center; gap: 10px;
    color: #c9d1d9; font-size: 14px;
}

.auth-v2-features li i { color: #10a37f; font-size: 13px; flex-shrink: 0; }

.auth-v2-panel-stat {
    display: flex; align-items: center; gap: 10px;
    font-size: 12px; color: #6e7681;
}

/* Right form side */
.auth-v2-form-side {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 60px 40px; background: #0d0f12;
    min-width: 0;
    overflow-y: auto;
}

.auth-v2-form-box {
    width: 100%; max-width: min(400px, 100%);
    min-width: 0;
}

.auth-v2-form-logo {
    margin-bottom: 28px;
}

.auth-v2-form-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #f5f5f7;
    font-size: 18px;
    font-weight: 700;
}

.auth-v2-form-box h1 {
    font-size: 26px; font-weight: 800; color: #f5f5f7;
    margin-bottom: 6px; letter-spacing: -.02em;
}

.auth-v2-sub {
    color: #8b949e; font-size: 14px; margin-bottom: 32px;
}

/* Form fields */
.auth-v2-form { display: flex; flex-direction: column; gap: 18px; }

.auth-v2-field { display: flex; flex-direction: column; gap: 6px; }

.auth-v2-field label {
    font-size: 13px; font-weight: 600; color: #c9d1d9; letter-spacing: .01em;
}

.auth-v2-label-hint { color: #6e7681; font-weight: 400; }

.auth-v2-input-wrap {
    position: relative; display: flex; align-items: center;
    min-width: 0;
}

.auth-v2-input-wrap i {
    position: absolute; left: 14px;
    color: #6e7681; font-size: 13px; pointer-events: none;
}

.auth-v2-input-wrap input,
.auth-v2-input-wrap select {
    width: 100%; padding: 11px 14px 11px 38px;
    background: #161b22; border: 1px solid #30363d;
    border-radius: 10px; color: #e6edf3; font-size: 14px;
    font-family: inherit; outline: none;
    transition: border-color .2s, box-shadow .2s;
    appearance: none; -webkit-appearance: none;
}

.auth-v2-input-wrap input::placeholder { color: #484f58; }

.auth-v2-input-wrap input:focus,
.auth-v2-input-wrap select:focus {
    border-color: #10a37f;
    box-shadow: 0 0 0 3px rgba(16,163,127,.12);
    background: #1c2128;
}

.auth-v2-btn {
    width: 100%; padding: 12px 20px; margin-top: 4px;
    background: #0d8467; border: none; border-radius: 10px;
    color: white; font-size: 15px; font-weight: 700;
    font-family: inherit; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: background .2s, transform .15s, box-shadow .2s;
}

.auth-v2-btn:hover {
    background: #0d9068;
    box-shadow: 0 4px 20px rgba(16,163,127,.3);
    transform: translateY(-1px);
}

.auth-v2-btn:active { transform: translateY(0); }

.auth-v2-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 22px 0; color: #484f58; font-size: 13px;
}

.auth-v2-divider::before,
.auth-v2-divider::after {
    content: ''; flex: 1; height: 1px; background: #21262d;
}

.auth-v2-google {
    width: 100%; padding: 11px 20px;
    background: #161b22; border: 1px solid #30363d;
    border-radius: 10px; color: #c9d1d9;
    font-size: 14px; font-weight: 600; font-family: inherit;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: background .2s, border-color .2s;
}

.auth-v2-google:hover { background: #1c2128; border-color: #484f58; }
.auth-v2-google i { color: #ea4335; }

.auth-v2-switch {
    text-align: center; margin-top: 24px;
    font-size: 13px; color: #8b949e;
}

.auth-v2-switch a { color: #10a37f; text-decoration: none; font-weight: 600; }
.auth-v2-switch a:hover { text-decoration: underline; }

.auth-v2-alert {
    padding: 11px 14px;
    background: rgba(239, 68, 68, .1);
    border: 1px solid rgba(239, 68, 68, .35);
    border-radius: 10px;
    color: #f87171;
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 8px;
}
.auth-v2-alert::before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    flex-shrink: 0;
}

@media (max-width: 740px) {
    .auth-v2-panel { display: none; }
    .auth-v2-page,
    .auth-v2-wrap,
    .auth-v2-form-side,
    .auth-v2-form-box,
    .auth-v2-form {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .auth-v2-form-side {
        align-items: flex-start;
        padding: 40px 24px;
    }

    .auth-v2-input-wrap input,
    .auth-v2-input-wrap select {
        min-width: 0;
    }
}

@media (max-width: 420px) {
    .auth-v2-page,
    .auth-v2-wrap,
    .auth-v2-form-side,
    .auth-v2-form-box,
    .auth-v2-form {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .auth-v2-form-side {
        padding: 28px 16px;
    }

    .auth-v2-input-wrap input,
    .auth-v2-input-wrap select {
        min-width: 0;
    }

    .auth-v2-form-logo {
        margin-bottom: 22px;
    }

    .auth-v2-form-box h1 {
        font-size: 24px;
    }

    .auth-v2-sub {
        margin-bottom: 24px;
    }

    .subject-tags .tag {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
    }
}

/* ==================== AUTH V2 END ==================== */

/* ==================== LANDING PAGE ==================== */
.landing-page {
    background: var(--bg-primary);
    overflow-x: hidden;
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 40px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 15, 26, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    min-width: 0;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-logo span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.nav-logo .logo-icon {
    font-size: 28px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
    flex-shrink: 0;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.nav-btn.primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border: none;
    color: white !important;
    font-weight: 600;
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 120px 60px 80px;
    min-height: 100vh;
    min-height: 100svh;
    gap: 60px;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    min-width: 0;
}

.hero-content h1 {
    font-size: 56px;
    line-height: 1.1;
    margin-bottom: 24px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content > p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
}

.btn-primary {
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    padding: 14px 32px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-purple);
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat span:last-child {
    font-size: 14px;
    color: var(--text-muted);
}

.hero-visual {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.chat-preview {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
    min-width: 0;
}

.chat-bubble {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 14px;
    animation: fadeInUp 0.5s ease;
    overflow-wrap: anywhere;
}

.chat-bubble.ai {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-purple);
}

.chat-bubble.user {
    background: rgba(139, 92, 246, 0.1);
    border-right: 3px solid var(--accent-pink);
    margin-left: 20px;
}

/* Features Section */
.features {
    padding: 80px 60px;
    text-align: center;
}

.features h2 {
    font-size: 36px;
    margin-bottom: 48px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    min-width: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px 24px;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-purple);
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.2);
}

.feature-icon {
    font-size: 36px;
    margin-bottom: 16px;
    width: 60px; height: 60px; border-radius: 14px;
    background: linear-gradient(135deg, rgba(139,92,246,.15), rgba(236,72,153,.15));
    border: 1px solid rgba(139,92,246,.25);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent-purple);
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* How It Works */
.how-it-works {
    padding: 80px 60px;
    text-align: center;
    background: var(--bg-secondary);
}

.how-it-works h2 {
    font-size: 36px;
    margin-bottom: 48px;
}

.steps {
    display: flex;
    justify-content: center;
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.step {
    flex: 1;
    text-align: center;
}

.step-num {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 20px;
}

.step h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.step p {
    color: var(--text-secondary);
}

/* Agents Showcase */
.agents-showcase {
    padding: 80px 60px;
    text-align: center;
}

.agents-showcase h2 {
    font-size: 36px;
    margin-bottom: 48px;
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.agent-card {
    min-width: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.agent-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-purple);
}

.agent-emoji {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

.agent-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.agent-card p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Footer */
.landing-footer {
    padding: 40px 60px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.footer-content > p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-purple);
}

.copyright {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        height: 100vh;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .hero {
        flex-direction: column;
        padding: 100px 24px 60px;
        text-align: center;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .hero-content,
    .hero-visual {
        width: 100%;
        max-width: 100%;
    }

    .hero-content h1 {
        font-size: 36px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons a,
    .btn-primary,
    .btn-secondary {
        max-width: 100%;
    }

    .hero-stats {
        justify-content: center;
    }

    .steps {
        flex-direction: column;
    }

    .features,
    .how-it-works,
    .agents-showcase {
        padding: 60px 24px;
    }

    .auth-container {
        flex-direction: column;
    }

    .auth-left {
        display: none;
    }

    .landing-nav {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 16px 24px;
        gap: 12px;
        overflow: hidden;
    }

    .nav-logo {
        min-width: 0;
    }

    .nav-logo span {
        max-width: min(40vw, 180px);
    }

    .nav-links a:not(.nav-btn) {
        display: none;
    }

    .nav-links {
        min-width: 0;
        justify-content: flex-end;
        gap: 10px;
    }

    .nav-btn {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .quick-prompts {
        grid-template-columns: 1fr;
    }

    .chat-preview {
        max-width: 100%;
    }
}

@media (max-width: 520px) {
    .landing-nav {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 12px 14px;
        gap: 10px;
    }

    .nav-logo {
        font-size: 16px;
        flex: 1 1 auto;
    }

    .nav-logo span {
        max-width: min(38vw, 118px);
    }

    .nav-logo .brand-logo-img-sm {
        width: 30px;
        height: 30px;
    }

    .nav-links {
        gap: 8px;
        min-width: 0;
        flex: initial;
        justify-content: flex-end;
    }

    .nav-links a:not(.primary) {
        display: none;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
        max-width: 126px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hero {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        padding: 86px 16px 48px;
        gap: 28px;
        min-height: auto;
    }

    .hero-content,
    .hero-visual {
        flex: none;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .hero-content h1 {
        font-size: clamp(32px, 12vw, 42px);
        overflow-wrap: anywhere;
    }

    .hero-content > p {
        font-size: 15px;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .hero-buttons a,
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .hero-stats {
        gap: 18px;
    }

    .stat-num {
        font-size: 26px;
    }

    .features,
    .how-it-works,
    .agents-showcase {
        padding: 44px 16px;
    }

    .features h2,
    .how-it-works h2,
    .agents-showcase h2 {
        font-size: 28px;
        line-height: 1.2;
    }

    .feature-card {
        padding: 22px 18px;
    }

    .chat-preview {
        padding: 16px;
        max-width: 100%;
    }

    .landing-footer {
        padding: 32px 16px;
    }
}

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

.fade-in {
    animation: fadeInUp 0.3s ease;
}

/* ==================== CHATGPT-LIKE WORKSPACE ==================== */
body.chat-body {
    overflow: hidden;
    background: #212121;
    color: #ececec;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    width: 100%;
    min-width: 0;
}

.pro-app {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: #212121;
}

.pro-sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #171717;
    border-right: 1px solid #2b2b2b;
    max-width: 100vw;
}

.pro-sidebar-top,
.pro-sidebar-footer,
.pro-topbar {
    display: flex;
    align-items: center;
}

.pro-sidebar-top {
    justify-content: space-between;
    padding: 16px;
}

.pro-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f5f5f7;
    text-decoration: none;
    font-weight: 700;
    min-width: 0;
}

.pro-brand span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pro-user-avatar,
.pro-agent-orb,
.pro-message-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pro-new-chat {
    margin: 0 12px 12px;
    height: 40px;
    border: 1px solid #3f3f3f;
    border-radius: 10px;
    background: #202020;
    color: #f4f4f5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.pro-new-chat:hover,
.pro-icon-btn:hover,
.pro-ghost-btn:hover,
.pro-footer-links a:hover,
.pro-footer-links button:hover,
.pro-agent-item:hover,
.pro-conversation:hover,
.pro-tool-strip button:hover,
.pro-prompt-grid button:hover {
    background: #2f2f2f;
    border-color: transparent;
}

.pro-sidebar-section {
    padding: 0 8px 12px;
}

.pro-sidebar-section.collapsed .pro-agent-list {
    display: none;
}

.pro-history-section {
    min-height: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-top: 4px;
}

.pro-section-title {
    padding: 6px 8px 6px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .03em;
    text-transform: none;
    color: #8e8ea0;
}

.pro-section-toggle {
    width: 100%;
    padding: 6px 8px;
    border: 0;
    background: transparent;
    color: #8e8ea0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font: inherit;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .03em;
    cursor: pointer;
}

.pro-section-toggle:hover {
    color: #ececec;
}

.pro-section-toggle i {
    font-size: 10px;
    transition: transform .15s ease;
}

.pro-sidebar-section.collapsed .pro-section-toggle i {
    transform: rotate(-90deg);
}

.pro-agent-list,
.pro-conversation-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pro-conversation-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
}

.pro-agent-item,
.pro-conversation,
.pro-tool-strip button,
.pro-prompt-grid button,
.pro-tool-card,
.pro-ghost-btn,
.pro-icon-btn,
.pro-footer-links button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.pro-agent-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    min-width: 0;
}

.pro-agent-item.active {
    background: #2f2f2f;
    border-color: transparent;
}

.pro-agent-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 4px;
    background: transparent;
    color: #8e8ea0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.pro-agent-copy {
    min-width: 0;
}

.pro-agent-copy strong,
.pro-agent-copy small {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pro-agent-copy strong {
    font-size: 13px;
    font-weight: 400;
}

.pro-agent-copy small {
    display: none;
}

.pro-conversation {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    border-radius: 10px;
    border: 1px solid transparent;
}

.pro-conversation.active {
    background: #262f2b;
    border-color: rgba(16, 163, 127, .25);
}

.pro-conv-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 9px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.pro-conv-main span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
}

.pro-conv-main i {
    color: #8b949e;
    width: 16px;
}

.pro-conv-actions {
    display: none;
    gap: 2px;
    padding-right: 6px;
}

.pro-conversation:hover .pro-conv-actions,
.pro-conversation.active .pro-conv-actions {
    display: flex;
}

.pro-conv-group {
    margin-bottom: 4px;
}

.pro-conv-group-label {
    padding: 8px 8px 4px;
    font-size: 11px;
    font-weight: 500;
    color: #8e8ea0;
    letter-spacing: .02em;
}

.pro-conv-group + .pro-conv-group .pro-conv-group-label {
    border-top: 1px solid #2f2f2f;
    margin-top: 4px;
    padding-top: 12px;
}

.pro-pin-icon {
    color: #f59e0b !important;
}

/* Pencil icon shown on desktop too */
.pro-new-chat-icon {
    display: inline-flex !important;
}

/* ── Welcome greeting style ──────────────── */
.pro-welcome h1 {
    max-width: 780px;
    font-size: clamp(28px, 5vw, 48px);
    line-height: 1.1;
    letter-spacing: -.01em;
    color: #f5f5f7;
}

.pro-welcome-sub {
    max-width: 620px;
    color: #aeb6c2;
    font-size: 16px;
    line-height: 1.6;
}

.pro-conv-actions button {
    width: 28px;
    height: 28px;
    border: 1px solid transparent;
    background: transparent;
    color: #aeb6c2;
    border-radius: 8px;
}

.pro-empty {
    color: #8b949e;
    font-size: 13px;
    padding: 8px;
}

.pro-conv-skeleton {
    height: 36px;
    margin: 4px 8px;
    border-radius: 8px;
    background: linear-gradient(90deg, #252525, #303030, #252525);
    background-size: 200% 100%;
    animation: proSkeleton 1.2s ease-in-out infinite;
}

.pro-conv-skeleton.short {
    width: 74%;
}

@keyframes proSkeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.pro-sidebar-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-top: 1px solid #2f2f2f;
}

.pro-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.pro-user > div {
    min-width: 0;
}

.pro-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #10a37f;
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.pro-user-name {
    font-size: 14px;
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pro-user-meta {
    color: #8b949e;
    font-size: 12px;
}

.pro-footer-links {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.pro-footer-links a,
.pro-footer-links button {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #aeb6c2;
    text-decoration: none;
}

.pro-main {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #212121;
    max-width: 100%;
}

.pro-topbar {
    min-height: 60px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 10px 18px;
    border-bottom: 1px solid #2f2f2f;
    background: rgba(33, 33, 33, .94);
    backdrop-filter: blur(14px);
    position: relative;
    z-index: 100;
}

.pro-icon-btn {
    width: 38px;
    height: 38px;
    display: none;
    align-items: center;
    justify-content: center;
}

.mobile-close {
    display: none;
}

.pro-current-agent {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.pro-agent-orb {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #18221f;
    color: #10a37f;
}

.pro-agent-kicker {
    display: block;
    color: #8b949e;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.pro-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: end;
    min-width: 0;
}

.pro-model-menu-wrap {
    position: relative;
    justify-self: center;
    width: min(420px, 100%);
    min-width: 0;
}

.pro-model-pill {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #3d3d3d;
    border-radius: 999px;
    background: #252525;
    color: #ececec;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s;
    justify-self: center;
    width: 100%;
    min-width: 0;
}

.pro-model-pill span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.pro-model-pill:hover { background: #2f2f2f; }

.pro-model-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: rgba(16, 163, 127, .14);
    color: #10a37f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
}

.pro-model-pill i {
    font-size: 9px;
    color: #8e8ea0;
}

.pro-model-pill.live {
    border-color: rgba(16, 163, 127, .45);
    background: transparent;
    color: #10a37f;
}

.pro-model-pill.live i {
    color: #10a37f;
}

.pro-model-pill.demo,
.pro-model-pill.warning {
    border-color: rgba(245, 158, 11, .4);
    background: transparent;
    color: #fbbf24;
}

.pro-model-pill.demo i,
.pro-model-pill.warning i {
    color: #f59e0b;
}

.pro-agent-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    transform: none;
    width: min(560px, calc(100vw - 32px));
    max-height: min(520px, calc(100vh - 88px));
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #3f3f3f;
    border-radius: 14px;
    background: #181818;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
    z-index: 200;
}

.pro-agent-menu.open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.pro-agent-menu-title {
    grid-column: 1 / -1;
    padding: 6px 8px 10px;
    color: #8e8ea0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pro-agent-menu-title small {
    color: #6f6f78;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.pro-agent-menu .pro-agent-item {
    padding: 11px;
    border: 1px solid transparent;
    background: #202020;
}

.pro-agent-menu .pro-agent-item:hover {
    background: #292929;
    border-color: #3a3a3a;
}

.pro-agent-menu .pro-agent-item.active {
    background: #1b2d26;
    border-color: rgba(16, 163, 127, .35);
}

.pro-agent-menu .pro-agent-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(255,255,255,.06);
    color: #10a37f;
    font-size: 14px;
}

.pro-agent-menu .pro-agent-copy small {
    display: block;
    white-space: normal;
    line-height: 1.35;
}

.pro-agent-check {
    margin-left: auto;
    color: #10a37f;
    font-size: 12px;
}

.pro-ghost-btn {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #3f3f3f;
    border-radius: 999px;
    background: transparent;
    color: #b4b4b4;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, color .15s;
}
.pro-ghost-btn:hover { background: #2f2f2f; color: #ececec; border-color: #4f4f4f; }

.pro-messages {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px 20px 18px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

.pro-welcome {
    width: min(920px, 100%);
    min-height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 18px;
    padding: 24px 16px 28px;
}

.pro-welcome h1 {
    max-width: 760px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.15;
    letter-spacing: -.02em;
    color: #ececec;
    font-weight: 700;
    text-align: center;
}

.pro-welcome-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .32);
    margin: 0 auto;
}

.pro-welcome-sub {
    max-width: 620px;
    color: #9b9b9b;
    font-size: 16px;
    line-height: 1.6;
    margin-top: -14px;
}

.pro-welcome-badge {
    display: none;
}

.pro-welcome p:not(.pro-welcome-sub) {
    display: none;
}

.pro-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
    gap: 10px;
}

.pro-tool-card {
    min-height: 74px;
    border: 1px solid #3c3c3c;
    border-radius: 8px;
    background: #292929;
    color: #ececec;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 16px;
    font-size: 14px;
    font-weight: 500;
    gap: 10px;
    transition: background .15s, border-color .15s;
}

.pro-tool-card i,
.pro-tool-strip button i {
    color: #9b9b9b;
    font-size: 15px;
}

.pro-tool-card:hover {
    background: #333333;
    border-color: #555;
    transform: translateY(-1px);
}

.pro-tool-card.active {
    border-color: rgba(16, 163, 127, .7);
    background: #1a2f26;
    box-shadow: inset 0 0 0 1px rgba(16, 163, 127, .18);
}

.pro-prompt-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.pro-prompt-grid button {
    min-height: 64px;
    padding: 12px 16px;
    border: 1px solid #3c3c3c;
    border-radius: 8px;
    background: #292929;
    color: #ececec;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13.5px;
    line-height: 1.4;
    transition: background .15s, border-color .15s;
}

.pro-prompt-grid button:hover {
    background: #333333;
    border-color: #555;
    transform: translateY(-1px);
}

.pro-prompt-grid span { min-width: 0; }
.pro-prompt-grid button i { color: #10a37f; flex-shrink: 0; }

.pro-media-artifact {
    margin-top: 14px;
    border: 1px solid #3f3f3f;
    border-radius: 14px;
    background: #252525;
    overflow: hidden;
}

.pro-media-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #3a3a3a;
}

.pro-media-head > div {
    min-width: 0;
}

.pro-media-head strong,
.pro-media-head span {
    display: block;
}

.pro-media-head strong {
    color: #ececec;
    font-size: 14px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.pro-media-head span {
    margin-top: 2px;
    color: #9b9b9b;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.pro-media-head i {
    color: #10a37f;
}

.pro-media-preview {
    padding: 12px;
    background: #171717;
}

.pro-generated-svg,
.pro-video-canvas {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
}

.pro-generated-svg {
    height: auto;
    background: #fff;
}

.pro-video-canvas {
    background: #111;
}

.pro-video-scenes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px 0;
}

.pro-video-scenes span {
    padding: 5px 9px;
    border-radius: 999px;
    background: #303030;
    color: #c7c7c7;
    font-size: 12px;
}

.pro-media-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
}

.pro-media-actions button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #3f3f3f;
    border-radius: 9px;
    background: #2f2f2f;
    color: #ececec;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.pro-media-actions button:hover {
    background: #3a3a3a;
}

.pro-media-actions button:disabled {
    opacity: .7;
    cursor: not-allowed;
}

/* ── ChatGPT-style messages ───────────────────── */
.pro-message {
    width: min(780px, 96%);
    margin: 0 auto;
    padding: 12px 0;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.pro-message.user {
    flex-direction: row-reverse;
}

.pro-message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #10a37f;
    color: white;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}

.pro-message.user .pro-message-avatar {
    display: none;
}

.pro-message.assistant .pro-message-avatar {
    background: #fff;
    color: #0d1117;
    border: 1px solid #3f3f3f;
    overflow: hidden;
}

.pro-message-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* User bubble */
.pro-message.user .pro-message-body {
    max-width: 72%;
    background: #303030;
    border: 1px solid #424242;
    border-radius: 18px 4px 18px 18px;
    padding: 12px 16px;
}

/* AI body: full-width, no background */
.pro-message.assistant .pro-message-body {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    flex: 1;
    min-width: 0;
}

.pro-message-body {
    min-width: 0;
    max-width: 100%;
}

.pro-message-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #6e6e80;
    font-size: 12px;
    margin-bottom: 6px;
}

.pro-message.user .pro-message-meta {
    justify-content: flex-end;
}

.pro-message-meta strong {
    color: #ececec;
    font-size: 13px;
    font-weight: 600;
}

.pro-message-text {
    color: #ececec;
    font-size: 15px;
    line-height: 1.72;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pro-message-text strong {
    color: #ececec;
    font-weight: 600;
}

.pro-message-text code {
    background: #2f2f2f;
    border: 1px solid #3f3f3f;
    border-radius: 5px;
    padding: 2px 6px;
    color: #e9b96e;
    font-size: 13px;
    white-space: normal;
}

.pro-message-text pre {
    max-width: 100%;
    overflow-x: auto;
    background: #1a1a1a;
    border: 1px solid #3f3f3f;
    border-radius: 12px;
    padding: 16px;
    margin: 10px 0;
}

.pro-list-line { margin: 4px 0; }

/* Markdown headings rendered in messages */
.pro-md-heading {
    font-size: 15px;
    font-weight: 600;
    color: #ececec;
    margin: 12px 0 4px;
    line-height: 1.4;
}

/* Markdown tables rendered in messages */
.pro-md-table {
    border-collapse: collapse;
    width: 100%;
    max-width: 100%;
    display: block;
    overflow-x: auto;
    margin: 10px 0;
    font-size: 13.5px;
    -webkit-overflow-scrolling: touch;
}
.pro-md-table td, .pro-md-table th {
    border: 1px solid #3f3f3f;
    padding: 7px 12px;
    text-align: left;
    vertical-align: top;
}
.pro-md-table th {
    background: #2a2a2a;
    font-weight: 600;
}

.pro-message-sources {
    margin-top: 12px;
    padding: 10px;
    border: 1px solid #3f3f3f;
    border-radius: 10px;
    background: #252525;
    display: grid;
    gap: 6px;
}

.pro-sources-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #aeb6c2;
    font-size: 12px;
    font-weight: 600;
}

.pro-message-sources a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 8px;
    color: #dbeafe;
    text-decoration: none;
    font-size: 13px;
}

.pro-message-sources a:hover {
    text-decoration: underline;
}

.pro-message-sources small {
    grid-column: 2;
    color: #8e8ea0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pro-message-sources p {
    grid-column: 2 / -1;
    color: #8e8ea0;
    font-size: 12px;
    line-height: 1.35;
    margin: 0;
    overflow-wrap: anywhere;
}

.pro-message-actions {
    display: flex;
    gap: 4px;
    margin-top: 10px;
    opacity: 0;
    transition: opacity .2s;
}

.pro-message:hover .pro-message-actions {
    opacity: 1;
}

.pro-message-actions button {
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #6e6e80;
    padding: 5px 9px;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.pro-message-actions button:hover {
    background: #2f2f2f;
    color: #ececec;
    border-color: #3f3f3f;
}

.pro-message-actions button.liked {
    color: #10a37f;
}

/* ── Message entry animation ───────────────── */
@keyframes msgFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pro-message { animation: msgFadeIn .25s ease; }

/* ── Code block with copy button ───────────── */
.code-block {
    max-width: 100%;
    margin: 14px 0;
    border: 1px solid #3f3f3f;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a1a;
}

.code-block-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 14px;
    background: #252525;
    border-bottom: 1px solid #3f3f3f;
}

.code-lang {
    font-size: 11px; font-weight: 600;
    color: #9b9b9b; text-transform: uppercase; letter-spacing: .06em;
}

.code-copy-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 6px;
    border: 1px solid #3f3f3f; background: transparent;
    color: #9b9b9b; font-size: 12px; cursor: pointer;
    transition: all .15s; font-family: inherit;
}

.code-copy-btn:hover { color: #ececec; border-color: #4f4f4f; background: #2f2f2f; }
.code-copy-btn.copied { color: #10a37f; }

.code-block pre {
    max-width: 100%;
    margin: 0; padding: 16px 18px; overflow-x: auto;
    background: transparent; border: none; border-radius: 0;
}

.code-block code { color: #abb2bf; font-size: 13.5px; line-height: 1.65; }

/* ── User message avatar (initials) ─────────── */
.pro-message.user .pro-message-avatar {
    display: none;
}

.pro-message.assistant .pro-message-avatar {
    font-size: 13px;
}

/* ── Improved send button ──────────────────── */
.pro-send-btn {
    transition: background .18s, transform .12s;
}
.pro-send-btn:not(:disabled):hover {
    background: #0d9068;
    transform: scale(1.06);
}


.pro-typing {
    display: flex;
    gap: 5px;
    padding: 4px 0;
}

.pro-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10a37f;
    animation: proTyping 1.2s infinite ease-in-out;
}

.pro-typing span:nth-child(2) {
    animation-delay: .16s;
}

.pro-typing span:nth-child(3) {
    animation-delay: .32s;
}

@keyframes proTyping {
    0%, 80%, 100% { opacity: .35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-4px); }
}

.pro-composer-wrap {
    width: min(780px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 18px;
}

.pro-composer {
    display: flex;
    flex-direction: column;
    min-height: 60px;
    padding: 13px 14px 9px;
    border: 1px solid #444;
    border-radius: 18px;
    background: #2b2b2b;
    box-shadow: 0 10px 34px rgba(0,0,0,.26);
    transition: border-color .2s;
}

.pro-composer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding-top: 6px;
}

.pro-tool-strip {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1 1 0;
    width: 0;
    min-width: 0;
}
.pro-tool-strip::-webkit-scrollbar { display: none; }

.pro-tool-strip button {
    white-space: nowrap;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #262626;
    color: #8e8ea0;
    padding: 6px 11px;
    font-size: 13px;
    transition: background .15s, color .15s;
}

.pro-tool-strip button:hover {
    background: rgba(255,255,255,.09);
    color: #ececec;
}

.pro-tool-strip button.active {
    color: #ececec;
    background: #18352c;
    border-color: rgba(16, 163, 127, .45);
}

.pro-composer:focus-within {
    border-color: rgba(16, 163, 127, .52);
    box-shadow: 0 0 0 3px rgba(16,163,127,.08), 0 10px 34px rgba(0,0,0,.26);
}

.pro-composer textarea {
    width: 100%;
    max-height: min(55dvh, 620px);
    min-height: 36px;
    resize: none;
    border: 0;
    outline: 0;
    background: transparent;
    color: #ececec;
    font: inherit;
    font-size: 15px;
    line-height: 1.5;
    padding: 4px 4px 4px;
}

.pro-composer textarea::placeholder { color: #6e6e80; }

.pro-send-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: #10a37f;
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .12s;
    flex-shrink: 0;
}

.pro-send-btn:not(:disabled):hover {
    background: #0d9068;
    transform: scale(1.05);
}

.pro-send-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none;
}

.pro-disclaimer {
    margin-top: 8px;
    color: #6e6e80;
    text-align: center;
    font-size: 12px;
}

.pro-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    max-width: min(420px, calc(100vw - 24px));
    transform: translate(-50%, 16px);
    opacity: 0;
    pointer-events: none;
    background: #3a3a3a;
    color: #ececec;
    border: 1px solid #4f4f4f;
    border-radius: 10px;
    padding: 10px 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
    transition: opacity .2s ease, transform .2s ease;
    z-index: 5000;
    font-size: 14px;
    text-align: center;
}

.pro-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ==================== CHAT WORKSPACE RESPONSIVE ==================== */

/* Sidebar backdrop (mobile only) */
.pro-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 2999;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .22s ease;
    pointer-events: none;
}
.pro-sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

/* ── Tablet / small desktop (960px) ──────────── */
@media (max-width: 960px) {
    .pro-app {
        grid-template-columns: 1fr;
    }

    .pro-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(304px, calc(100vw - 20px));
        height: 100dvh;
        transform: translateX(-100%);
        transition: transform .22s cubic-bezier(.4, 0, .2, 1);
        z-index: 3000;
        box-shadow: 4px 0 32px rgba(0, 0, 0, .5);
    }

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

    .pro-sidebar-backdrop {
        display: block;
    }

    .pro-icon-btn {
        display: inline-flex !important;
    }

    .mobile-close {
        display: inline-flex !important;
    }

    .pro-new-chat-icon {
        display: none !important;
    }

    .pro-tool-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pro-prompt-grid {
        grid-template-columns: 1fr;
    }

    .pro-message {
        width: 100%;
    }

    .pro-message.user .pro-message-body {
        max-width: 85%;
    }

    .pro-message-actions {
        opacity: 1;
    }

    .pro-messages {
        padding: 20px 16px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .pro-composer-wrap {
        width: calc(100% - 24px);
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }

    .pro-model-menu-wrap {
        width: min(390px, 100%);
    }

    .pro-top-actions .pro-ghost-btn span { display: none; }
}

/* ── Mobile (560px) ──────────────────────────── */
@media (max-width: 560px) {
    body.chat-body {
        width: 100vw;
        max-width: 100vw;
    }

    .pro-main {
        width: 100vw;
        max-width: 100vw;
    }

    .pro-topbar {
        padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px;
        min-height: calc(52px + env(safe-area-inset-top, 0px));
        grid-template-columns: 38px minmax(0, 1fr) auto;
        gap: 8px;
    }

    .pro-top-actions {
        display: none;
    }

    .pro-model-menu-wrap {
        width: 100%;
    }

    .pro-model-pill {
        min-height: 36px;
        padding: 0 9px;
        max-width: 100%;
    }

    .pro-model-icon {
        width: 22px;
        height: 22px;
        border-radius: 7px;
    }

    .pro-model-pill span {
        font-size: 13px;
        min-width: 0;
    }

    .pro-agent-menu {
        position: fixed;
        left: max(10px, env(safe-area-inset-left, 0px));
        right: max(10px, env(safe-area-inset-right, 0px));
        top: calc(58px + env(safe-area-inset-top, 0px));
        transform: none;
        width: auto;
        max-height: min(520px, calc(100dvh - 76px - env(safe-area-inset-top, 0px)));
        border-radius: 16px;
    }

    .pro-agent-menu.open {
        grid-template-columns: 1fr;
    }

    .pro-agent-menu-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .pro-messages {
        padding: 16px 10px 12px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .pro-message {
        gap: 8px;
        padding: 10px 0;
    }

    .pro-message-avatar {
        width: 24px;
        height: 24px;
        margin-top: 3px;
    }

    .pro-message-meta {
        flex-wrap: wrap;
        gap: 4px 10px;
    }

    .pro-message-text {
        font-size: 14.5px;
        line-height: 1.65;
    }

    .pro-message-actions {
        flex-wrap: wrap;
    }

    .pro-welcome h1 {
        font-size: clamp(24px, 8vw, 34px);
        text-align: left;
        max-width: 100%;
        width: 100%;
        line-height: 1.12;
    }

    .pro-welcome {
        gap: 18px;
        padding: 0;
        width: 100%;
        max-width: 100%;
        min-height: auto;
        justify-content: flex-start;
    }

    .pro-welcome-logo {
        display: none;
    }

    .pro-tool-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .pro-tool-card {
        min-height: 56px;
        padding: 12px 14px;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
    }

    .pro-prompt-grid { gap: 8px; }

    .pro-prompt-grid button {
        min-height: 52px;
        padding: 10px 12px;
        font-size: 13px;
        overflow-wrap: anywhere;
    }

    .pro-media-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .pro-media-preview {
        padding: 8px;
    }

    .pro-video-scenes {
        padding: 8px 8px 0;
    }

    .pro-video-scenes span {
        font-size: 11px;
    }

    .pro-media-actions {
        padding: 10px 8px;
    }

    .pro-media-actions button {
        flex: 1 1 110px;
        justify-content: center;
    }

    .pro-composer-wrap {
        width: calc(100% - 16px);
        padding: 0 0 calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .pro-composer {
        padding: 10px 10px 8px;
        border-radius: 14px;
        min-height: 50px;
    }

    .pro-composer textarea {
        font-size: 15px;
        max-height: min(45dvh, 420px);
    }

    .pro-send-btn { width: 36px; height: 36px; }

    .pro-message.user .pro-message-body {
        max-width: 90%;
        border-radius: 14px 4px 14px 14px;
    }

    .pro-tool-strip {
        padding-bottom: 8px;
        scroll-snap-type: x proximity;
    }

    .pro-tool-strip button {
        scroll-snap-align: start;
        min-height: 32px;
    }

    .pro-disclaimer {
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 8px;
    }

    .pro-toast {
        left: max(12px, env(safe-area-inset-left, 0px));
        right: max(12px, env(safe-area-inset-right, 0px));
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
        max-width: none;
        transform: translateY(16px);
    }

    .pro-toast.show {
        transform: translateY(0);
    }
}

/* ── Very small phones (380px) ───────────────── */
@media (max-width: 380px) {
    .pro-agent-copy small { display: none; }

    .pro-sidebar-footer {
        gap: 8px;
        padding: 10px 8px;
    }

    .pro-user-meta {
        display: none;
    }

    .pro-footer-links {
        gap: 2px;
    }

    .pro-footer-links a,
    .pro-footer-links button {
        width: 28px;
        height: 28px;
    }

    .pro-topbar {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .pro-model-pill {
        padding: 0 8px;
    }

    .pro-model-icon {
        width: 20px;
        height: 20px;
    }

    .pro-tool-strip button {
        font-size: 12px;
        padding: 5px 8px;
    }

    .pro-send-btn {
        width: 34px;
        height: 34px;
    }
}

/* ── Added for the /ai React port (2026-08-03) — same reasoning as
   developers.css's equivalent addition: a couple of generic utility
   classes the new pages reach for that the source app's own templates
   never needed, matching the rest of the site's real values. */
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.section { padding: 60px 0; }

/* -------------------------------------------------------------------------
   Cookie-consent banner (injected sitewide by /assets/js/main.js).
   Its real styles live in style.css, which the root layout loads inside
   the low-priority `legacy` cascade layer — so on /ai this unlayered file's
   generic p/button rules won regardless of specificity, squashing the
   banner into a thin strip with "Accept All" cut off. Same look as the
   main site, at unlayered priority. Literal colours: this app's own
   --primary/--dark mean different things.
   ------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 16px 20px; background: #1A1A2E; color: #E2E8F0;
  box-shadow: 0 -4px 24px rgba(0,0,0,.2);
  transform: translateY(100%); transition: transform .4s ease;
  font-family: inherit; box-sizing: border-box;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner p { flex: 1; min-width: 200px; margin: 0; font-size: .85rem; line-height: 1.5; color: #E2E8F0; }
.cookie-banner p a { color: #8B85FF; text-decoration: underline; }
.cookie-banner .cookie-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-banner .cookie-accept,
.cookie-banner .cookie-decline {
  padding: 8px 18px; border-radius: 12px; cursor: pointer;
  font-family: inherit; font-size: .85rem; font-weight: 600; line-height: 1.2;
  width: auto; height: auto; min-height: 0; transition: background .2s ease, color .2s ease;
}
.cookie-banner .cookie-accept { background: #6C63FF; color: #fff; border: none; }
.cookie-banner .cookie-accept:hover { background: #5A52D5; }
.cookie-banner .cookie-decline { background: transparent; color: #94A3B8; border: 1px solid #334155; font-weight: 500; }
.cookie-banner .cookie-decline:hover { color: #E2E8F0; border-color: #94A3B8; }
/* Sign-out button beside the user's name in the chat sidebar footer. */
.pro-user-meta { flex: 1; }
.pro-user-logout {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #8b949e;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.pro-user-logout:hover { background: rgba(255,255,255,.06); color: #f0f6fc; border-color: rgba(255,255,255,.1); }
.pro-user-logout:focus-visible { outline: 2px solid #10a37f; outline-offset: 2px; }
/* ── AI Tutor answers: formatted Markdown, sources, suggestions, web toggle ── */
.pro-md .md > :first-child { margin-top: 0; }
.pro-md .md > :last-child { margin-bottom: 0; }
.pro-md .md-p { margin: 0 0 .75em; line-height: 1.7; }
.pro-md .md-h { margin: 1.1em 0 .5em; font-weight: 700; line-height: 1.3; color: inherit; }
.pro-md h3.md-h { font-size: 1.12rem; }
.pro-md h4.md-h { font-size: 1rem; }
.pro-md .md-list { margin: 0 0 .8em; padding-left: 1.35em; line-height: 1.7; }
.pro-md ul.md-list { list-style: disc; }
.pro-md ol.md-list { list-style: decimal; }
.pro-md .md-list li { margin: .2em 0; }
.pro-md .md-list li::marker { color: #a78bfa; }
.pro-md strong { font-weight: 700; color: #f5f3ff; }
.pro-md a { color: #a5b4fc; text-decoration: underline; text-underline-offset: 2px; }
.pro-md .md-code { font-family: "JetBrains Mono", Consolas, monospace; font-size: .88em; background: rgba(148,163,184,.16); padding: .12em .4em; border-radius: 5px; }
.pro-md .md-cite { font-size: .72em; color: #a5b4fc; margin-left: 1px; }
.pro-md .md-quote { margin: 0 0 .8em; padding: .5em .9em; border-left: 3px solid #7c3aed; background: rgba(124,58,237,.08); border-radius: 0 8px 8px 0; }
.pro-md .md-hr { border: 0; border-top: 1px solid rgba(148,163,184,.25); margin: 1em 0; }
.pro-md .md-pre-wrap { margin: 0 0 .9em; border: 1px solid rgba(148,163,184,.22); border-radius: 10px; overflow: hidden; background: #0b1020; }
.pro-md .md-pre-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; font-size: .75rem; color: #cbd5e1; background: rgba(148,163,184,.1); text-transform: lowercase; }
.pro-md .md-pre-head button { background: none; border: 0; color: #cbd5e1; cursor: pointer; font-size: .75rem; display: inline-flex; gap: 5px; align-items: center; }
.pro-md .md-pre-head button:hover { color: #fff; }
.pro-md .md-pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-family: "JetBrains Mono", Consolas, monospace; font-size: .85rem; line-height: 1.6; color: #e2e8f0; white-space: pre; }
.pro-md .md-table-wrap { overflow-x: auto; margin: 0 0 .9em; border: 1px solid rgba(148,163,184,.22); border-radius: 10px; }
.pro-md .md-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.pro-md .md-table th, .pro-md .md-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid rgba(148,163,184,.15); vertical-align: top; }
.pro-md .md-table th { background: rgba(124,58,237,.14); font-weight: 700; }
.pro-md .md-table tr:last-child td { border-bottom: 0; }

.pro-sources { margin-top: 12px; }
.pro-sources-title { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #a5b4fc; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.pro-sources-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pro-source { display: flex; align-items: center; gap: 8px; max-width: 260px; padding: 7px 10px; border: 1px solid rgba(148,163,184,.22); border-radius: 10px; background: rgba(255,255,255,.04); color: inherit; text-decoration: none; transition: border-color .15s, background .15s; }
a.pro-source:hover { border-color: #a78bfa; background: rgba(124,58,237,.12); }
.pro-source-n { flex: 0 0 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: .72rem; font-weight: 700; background: rgba(124,58,237,.3); color: #ede9fe; }
.pro-source-body { display: flex; flex-direction: column; min-width: 0; }
.pro-source-title { font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pro-source-site { font-size: .72rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pro-answer-meta { margin-top: 8px; font-size: .74rem; color: #94a3b8; }

.pro-suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; max-width: 720px; }
.pro-suggest-chip { padding: 9px 14px; border-radius: 999px; border: 1px solid rgba(148,163,184,.28); background: rgba(255,255,255,.04); color: inherit; font-size: .86rem; cursor: pointer; transition: border-color .15s, background .15s; }
.pro-suggest-chip:hover:not(:disabled) { border-color: #a78bfa; background: rgba(124,58,237,.14); }
.pro-web-toggle.on { background: #7c3aed !important; border-color: #7c3aed !important; color: #fff !important; }

/* Display maths (LaTeX tutors write, shown as readable text) */
.pro-md .md-math { margin: 0 0 .9em; padding: 10px 14px; text-align: center; font-family: 'Cambria Math', 'STIX Two Math', Georgia, serif; font-size: 1.1rem; background: rgba(124,58,237,.08); border-radius: 10px; overflow-x: auto; white-space: nowrap; }
