/* Consica AI — Clean Minimalist Theme */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Solid Dark Theme Base (Obsidian) */
    --bg-primary: #0d0e12;
    --bg-secondary: #14161d;
    --bg-tertiary: #1c1f2b;
    --bg-glass: rgba(20, 22, 29, 0.92);
    --border-color: rgba(255, 255, 255, 0.12);
    --border-color-hover: rgba(255, 255, 255, 0.28);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-color: #ffffff;
    --accent-bg: #ffffff;
    --accent-text: #0d0e12;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-solid: 0 10px 30px rgba(0, 0, 0, 0.4);
    --transition-clean: 0.18s ease-out;
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-primary: #f5f7fb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    --bg-glass: rgba(255, 255, 255, 0.94);
    --border-color: rgba(15, 23, 42, 0.14);
    --border-color-hover: rgba(15, 23, 42, 0.3);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --accent-color: #0f172a;
    --accent-bg: #0f172a;
    --accent-text: #ffffff;
    
    --shadow-solid: 0 10px 30px rgba(0, 0, 0, 0.06);
}

/* Theme visibility switching */
body[data-theme="dark"] .dark-only { display: block !important; }
body[data-theme="dark"] .light-only { display: none !important; }

body[data-theme="light"] .dark-only { display: none !important; }
body[data-theme="light"] .light-only { display: block !important; }

/* Reset & Global Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color var(--transition-clean), color var(--transition-clean);
}

/* Background Topographic Contour Canvas */
#contour-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    opacity: 0.25;
}

.site-wrapper {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Navigation Header */
.top-header {
    position: sticky;
    top: 0;
    z-index: 90;
    padding: 16px 40px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.brand-icon {
    width: 38px;
    height: 38px;
    display: block;
    flex-shrink: 0;
    text-decoration: none;
}

.brand-logo-img {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

/* FLOATING LEFT NAVIGATION DOCK */
.left-dock {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.dock-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    padding: 14px 9px;
    width: 58px;
    box-shadow: var(--shadow-solid);
    overflow: hidden;
    transition: width var(--transition-clean), padding var(--transition-clean), border-color var(--transition-clean);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

/* Expanding Sidebar on Hover/Focus */
.left-dock:hover .dock-card,
.dock-card.expanded {
    width: 230px;
    padding: 18px 16px;
    border-color: var(--border-color-hover);
    align-items: stretch;
}

.dock-brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    width: 100%;
}

.dock-brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-clean);
}

.left-dock:hover .dock-brand-name,
.dock-card.expanded .dock-brand-name {
    opacity: 1;
    visibility: visible;
}

.dock-divider {
    height: 1px;
    width: 100%;
    background: var(--border-color);
    margin: 4px 0;
}

/* BOTTOM ACTIONS INSIDE DOCK */
.dock-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    align-items: center;
}

.left-dock:hover .dock-actions,
.dock-card.expanded .dock-actions {
    align-items: stretch;
}

.dock-pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: width var(--transition-clean), border-radius var(--transition-clean), background-color var(--transition-clean);
}

.left-dock:hover .dock-pill-btn,
.dock-card.expanded .dock-pill-btn {
    width: 100%;
    height: auto;
    padding: 10px 16px;
    border-radius: var(--radius-full);
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
}

.dock-pill-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dock-pill-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-color-hover);
}

.dock-pill-text, .dock-pill-arrow {
    opacity: 0;
    visibility: hidden;
    display: none;
    transition: opacity var(--transition-clean);
}

.left-dock:hover .dock-pill-text,
.left-dock:hover .dock-pill-arrow,
.dock-card.expanded .dock-pill-text,
.dock-card.expanded .dock-pill-arrow {
    opacity: 1;
    visibility: visible;
    display: inline;
}

/* Page Layout Container */
.page-container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 40px;
    width: 100%;
}

/* HERO SECTION */
.hero-section {
    padding: 150px 0 60px 80px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    align-items: center;
    min-height: calc(100vh - 120px);
}

.hero-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.eyebrow-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.eyebrow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-primary);
}

.hero-title {
    font-size: clamp(3rem, 5.2vw, 5rem);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -0.04em;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.hero-lead {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 580px;
    margin-bottom: 36px;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 6px 6px 6px 20px;
    border-radius: var(--radius-full);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--transition-clean), border-color var(--transition-clean), color var(--transition-clean);
    cursor: pointer;
    border: 1px solid transparent;
}

.btn-pill-icon-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.14);
    color: currentColor;
    transition: background-color var(--transition-clean);
}

.btn-pill-primary {
    background: var(--accent-bg);
    color: var(--accent-text);
}

.btn-pill-primary .btn-pill-icon-circle {
    background: rgba(13, 14, 18, 0.12);
    color: var(--accent-text);
}

.btn-pill-primary:hover .btn-pill-icon-circle {
    background: rgba(13, 14, 18, 0.22);
}

.btn-pill-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-pill-secondary .btn-pill-icon-circle {
    background: rgba(255, 255, 255, 0.14);
    color: var(--text-primary);
}

.btn-pill-secondary:hover {
    border-color: var(--border-color-hover);
    background: rgba(255, 255, 255, 0.08);
}

.btn-pill-secondary:hover .btn-pill-icon-circle {
    background: rgba(255, 255, 255, 0.25);
}

[data-theme="light"] .btn-pill-secondary .btn-pill-icon-circle {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

/* Official Google Sign-In Button (High Contrast Obsidian Theme) */
.btn-google {
    background: var(--bg-glass) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
}

.btn-google .btn-pill-icon-circle {
    background: #ffffff !important;
    border: none !important;
}

.btn-google:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--border-color-hover) !important;
    box-shadow: none !important;
}

.btn-google:hover .btn-pill-icon-circle {
    background: #ffffff !important;
    transform: scale(1.04);
}

[data-theme="light"] .btn-google {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid rgba(15, 23, 42, 0.16) !important;
    box-shadow: none !important;
}

[data-theme="light"] .btn-google .btn-pill-icon-circle {
    background: #f1f5f9 !important;
}

/* HERO RIGHT - Clean Canvas Visualizer */
.hero-right {
    position: relative;
    width: 100%;
    height: 480px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-solid);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.canvas-3d-wrapper {
    position: absolute;
    inset: 0;
    z-index: 1;
}

#hero-3d-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.hero-asset-note {
    position: absolute;
    bottom: 16px;
    left: 24px;
    z-index: 10;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* HERO BOTTOM METADATA SPEC BAR */
.hero-meta-bar {
    grid-column: 1 / -1;
    margin-top: 40px;
    padding-top: 24px;
    border-top: none !important;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.meta-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.meta-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* SECTION COMMON STYLES */
.section-wrapper {
    padding: 90px 0 50px 80px;
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    margin-bottom: 40px;
}

.section-num {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

.section-title {
    font-size: clamp(2rem, 3.2vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.section-sub {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 660px;
}

/* SECTION 01: AGENT CARDS GRID */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.agent-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color var(--transition-clean);
    text-decoration: none;
    color: inherit;
}

.agent-card:hover {
    border-color: var(--border-color-hover);
    background: rgba(255, 255, 255, 0.03);
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.badge-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

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

.card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* SECTION 02: COMPARISON CARDS */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.comp-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.comp-title {
    font-size: 1.3rem;
    font-weight: 700;
}

.comp-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comp-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* SECTION 03: PIPELINE BOX */
.pipeline-box {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 36px;
}

.pipeline-nodes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    overflow-x: auto;
}

.node-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.node-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent-text);
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.node-title {
    font-size: 0.92rem;
    font-weight: 700;
}

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

.pipeline-arrow {
    color: var(--text-muted);
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* SECTION 04: METRICS */
.benchmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.metric-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.metric-score {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--text-primary);
    border-radius: 3px;
}

/* SECTION 05: STUDIO CARD */
.builder-studio-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color-hover);
    border-radius: 28px;
    padding: 36px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
}

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

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.92rem;
    outline: none;
    transition: border-color var(--transition-clean);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--border-color-hover);
    background: rgba(255, 255, 255, 0.08);
}

.builder-preview-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed var(--border-color);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    justify-content: space-between;
}

.preview-header {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* FOOTER */
.site-footer {
    padding: 40px 0 40px 80px;
    border-top: none !important;
    background: var(--bg-glass);
    font-size: 0.88rem;
    color: var(--text-muted);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
    .hero-section {
        grid-template-columns: 1fr;
        padding-left: 0;
        padding-top: 30px;
    }
    
    .left-dock {
        position: fixed;
        bottom: 20px;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .dock-card {
        flex-direction: row;
        width: auto;
        height: 52px;
    }
    
    .left-dock:hover .dock-card {
        width: auto;
    }
    
    .dock-nav-list {
        flex-direction: row;
    }
    
    .section-wrapper {
        padding-left: 0;
    }
    
    .builder-studio-card, .comparison-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   APP-WIDE OBSIDIAN THEME OVERRIDES (Chat, Marketplace, Forms, Profile, Builder)
   ========================================================================== */

.page-header, .page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0 16px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1, .page-title h1, h1, h2, h3, h4 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.lead, .subhead, .small.muted, .muted {
    color: var(--text-secondary);
}

.card, .panel, .account-card, .market-filter, .profile-banner, .empty {
    background: var(--bg-glass) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-solid);
}

.card:hover, .panel:hover {
    border-color: var(--border-color-hover) !important;
}

/* Eradicate browser default checkboxes globally */
input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    width: 20px !important;
    height: 20px !important;
    border: 1.5px solid var(--border-color) !important;
    border-radius: 6px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    cursor: pointer !important;
    position: relative !important;
    outline: none !important;
    transition: all var(--transition-clean) !important;
    vertical-align: middle !important;
    margin: 0 !important;
    display: inline-block !important;
}

input[type="checkbox"]:hover {
    border-color: var(--border-color-hover) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

input[type="checkbox"]:checked {
    background: var(--text-primary) !important;
    border-color: var(--text-primary) !important;
}

input[type="checkbox"]:checked::after {
    content: '' !important;
    position: absolute !important;
    left: 6px !important;
    top: 2px !important;
    width: 5px !important;
    height: 10px !important;
    border: solid var(--bg-primary) !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
}

[data-theme="light"] input[type="checkbox"] {
    background: #ffffff !important;
}

[data-theme="light"] input[type="checkbox"]:checked {
    background: #0f172a !important;
    border-color: #0f172a !important;
}

/* Ensure hidden checkboxes in custom UI primitives do not render or take up space */
.custom-checkbox-input,
.m3-switch input[type="checkbox"] {
    display: none !important;
}

[data-theme="light"] input[type="checkbox"]:checked::after {
    border-color: #ffffff !important;
}

/* Eradicate browser default select dropdowns globally */
select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: var(--bg-glass) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath fill='%2394a3b8' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 16px 16px !important;
    padding-right: 40px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-sans) !important;
    font-size: 0.92rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: border-color var(--transition-clean), background-color var(--transition-clean) !important;
}

select:hover {
    border-color: var(--border-color-hover) !important;
}

select:focus {
    border-color: var(--border-color-hover) !important;
    outline: none !important;
}

select option {
    background: #14161d !important;
    color: #f8fafc !important;
    padding: 10px 14px !important;
}

[data-theme="light"] select option {
    background: #ffffff !important;
    color: #0f172a !important;
}

input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], input[type="number"], textarea, .form-control, .form-input, .form-select, .form-textarea {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 0.92rem;
    transition: border-color var(--transition-clean), background-color var(--transition-clean);
}

[data-theme="light"] input[type="text"], [data-theme="light"] input[type="email"], [data-theme="light"] input[type="password"], [data-theme="light"] input[type="search"], [data-theme="light"] input[type="url"], [data-theme="light"] input[type="number"], [data-theme="light"] textarea, [data-theme="light"] .form-control {
    background: #ffffff !important;
}

input:focus, textarea:focus {
    border-color: var(--border-color-hover) !important;
    outline: none !important;
}

.btn-dark, .btn-primary {
    background: var(--accent-bg) !important;
    color: var(--accent-text) !important;
    border: 1px solid transparent !important;
    border-radius: var(--radius-full) !important;
    font-weight: 600;
}

.btn-sky, .btn-secondary, .btn-outline {
    background: var(--bg-glass) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-full) !important;
    font-weight: 600;
}

.btn-sky:hover, .btn-secondary:hover, .btn-outline:hover {
    border-color: var(--border-color-hover) !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.badge, .badge-public, .badge-private {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-full) !important;
}

[data-theme="light"] .badge, [data-theme="light"] .badge-public, [data-theme="light"] .badge-private {
    background: rgba(15, 23, 42, 0.06) !important;
}

/* ASTROWEB CHAT SCREEN STYLING OVERRIDES */
.chat-shell-astroweb {
    background: var(--bg-primary) !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: hidden;
}

.astroweb-sidebar {
    background: var(--bg-secondary) !important;
    border-right: 1px solid var(--border-color) !important;
}

.astroweb-main {
    background: var(--bg-primary) !important;
}

.astroweb-topbar {
    background: var(--bg-glass) !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.astroweb-agent-title {
    color: var(--text-primary) !important;
}

.sidebar-chat-item {
    color: var(--text-secondary) !important;
    border-radius: var(--radius-md) !important;
}

.sidebar-chat-item:hover, .sidebar-chat-item.active {
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--text-primary) !important;
}

.chat-bubble {
    border-radius: var(--radius-lg) !important;
}

.chat-row.user .chat-bubble {
    background: var(--accent-bg) !important;
    color: var(--accent-text) !important;
}

.chat-row.assistant .chat-bubble {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.astroweb-input-container {
    background: var(--bg-glass) !important;
    border: 1px solid var(--border-color) !important;
}

#chat-input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: var(--text-primary) !important;
    padding: 6px 0 !important;
}

.astroweb-send-btn {
    background: var(--accent-bg) !important;
    color: var(--accent-text) !important;
    border-radius: 50% !important;
}

/* Sidebar Bottom Border Fix */
.sidebar-bottom {
    border-top: 1px solid var(--border-color) !important;
}

/* AUTHENTICATION PAGES (Login / Signup) OVERRIDES */
.auth-shell {
    min-height: calc(100vh - 80px);
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    background: var(--bg-primary) !important;
}

.auth-intro {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    padding: clamp(30px, 5vw, 64px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--border-color) !important;
    border-top: none !important;
}

.auth-intro h1 {
    color: var(--text-primary) !important;
}

.auth-intro .lead {
    color: var(--text-secondary) !important;
}

.auth-form-wrap {
    display: grid;
    place-items: center;
    padding: 36px 24px;
    background: var(--bg-primary) !important;
}

.auth-card {
    width: min(480px, 100%);
    background: var(--bg-glass) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 24px !important;
    padding: clamp(24px, 4vw, 40px) !important;
    box-shadow: var(--shadow-solid);
    color: var(--text-primary) !important;
}

.auth-card h1 {
    color: var(--text-primary) !important;
}

.auth-primary {
    padding: 20px;
    border: 1px solid var(--border-color) !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border-radius: 16px !important;
}

[data-theme="light"] .auth-primary {
    background: rgba(15, 23, 42, 0.03) !important;
}

.auth-separator {
    color: var(--text-muted) !important;
}

.auth-separator::before, .auth-separator::after {
    background: var(--border-color) !important;
}

.checkbox-line {
    border: 1px solid var(--border-color) !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-primary) !important;
    padding: 14px;
}

[data-theme="light"] .checkbox-line {
    background: #ffffff !important;
}

/* ==========================================================================
   CUSTOM REUSABLE UI PRIMITIVES (Checkboxes, Select Dropdowns, Dialog Modals)
   ========================================================================== */

/* CUSTOM CHECKBOX */
.custom-checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.custom-checkbox-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.custom-checkbox-box {
    width: 22px;
    height: 22px;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    color: transparent;
    transition: all var(--transition-clean);
    flex-shrink: 0;
}

.custom-checkbox-wrapper:hover .custom-checkbox-box {
    border-color: var(--border-color-hover);
    background: rgba(255, 255, 255, 0.08);
}

.custom-checkbox-input:checked + .custom-checkbox-box {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-primary);
}

[data-theme="light"] .custom-checkbox-box {
    background: #ffffff;
}

/* CUSTOM SELECT DROPDOWN */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color var(--transition-clean);
}

.custom-select-trigger:hover {
    border-color: var(--border-color-hover);
}

.custom-select-wrapper.open .select-arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-solid);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 1000;
}

.custom-select-wrapper.open .custom-select-dropdown {
    display: flex;
}

.custom-select-option {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color var(--transition-clean), color var(--transition-clean);
}

.custom-select-option:hover, .custom-select-option.selected {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

[data-theme="light"] .custom-select-option:hover, [data-theme="light"] .custom-select-option.selected {
    background: rgba(15, 23, 42, 0.06);
}

/* CUSTOM MODAL DIALOG */
.custom-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.custom-dialog-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.custom-dialog-card {
    width: min(520px, calc(100% - 32px));
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 28px;
    box-shadow: var(--shadow-solid);
    transform: scale(0.94);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.custom-dialog-overlay.active .custom-dialog-card {
    transform: scale(1);
}

.custom-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dialog-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: border-color var(--transition-clean);
}

.dialog-close-btn:hover {
    border-color: var(--border-color-hover);
}

.custom-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* CUSTOM MODAL DIALOG FIXES */
.custom-dialog-card .btn-pill-primary {
    background: var(--accent-bg) !important;
    color: var(--accent-text) !important;
}

.custom-dialog-card .btn-pill-primary:hover {
    opacity: 0.9;
}

.custom-dialog-card .btn-pill-outline {
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.custom-dialog-card .btn-pill-outline:hover {
    border-color: var(--border-color-hover) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

/* Theme Toggle Button Icons */
#header-theme-toggle-btn, #theme-toggle-btn {
    color: var(--text-primary) !important;
}

#header-theme-icon, #theme-icon {
    color: var(--text-primary) !important;
    font-size: 1rem !important;
    display: inline-block !important;
}

/* Restored btn-pill-outline classes */
.btn-pill-outline {
    background: transparent !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

.btn-pill-outline:hover {
    border-color: var(--border-color-hover) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

[data-theme="light"] .btn-pill-outline:hover {
    background: rgba(15, 23, 42, 0.04) !important;
}

/* Chat Action Buttons (Listen/Copy/etc.) Theme Overrides */
.chat-action-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-full) !important;
    padding: 6px 14px !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    transition: all var(--transition-clean) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.chat-action-btn:hover {
    background: rgba(255, 255, 255, 0.09) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color-hover) !important;
}

[data-theme="light"] .chat-action-btn {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: rgba(15, 23, 42, 0.14) !important;
}

[data-theme="light"] .chat-action-btn:hover {
    background: #f8fafc !important;
    border-color: rgba(15, 23, 42, 0.25) !important;
}

/* Chat Main Layout Obsidian Overrides */
.chat-history {
    background: var(--bg-primary) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="light"] .chat-history {
    background: #ffffff !important;
}

.astroweb-empty-state {
    background: transparent !important;
    color: var(--text-primary) !important;
}

.astroweb-empty-title {
    color: var(--text-primary) !important;
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.04em !important;
}

.astroweb-empty-subtitle {
    color: var(--text-secondary) !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
}

.chat-mode-switch {
    border: 1px solid var(--border-color) !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

.chat-mode-btn {
    color: var(--text-secondary) !important;
}

.chat-mode-btn:hover {
    color: var(--text-primary) !important;
}

.chat-mode-btn.active {
    background: var(--text-primary) !important;
    color: var(--bg-primary) !important;
    box-shadow: none !important;
}

[data-theme="light"] .chat-mode-btn.active {
    background: #0f172a !important;
    color: #ffffff !important;
}

.chat-agent-prompt-toggle {
    color: var(--text-secondary) !important;
    transition: color var(--transition-clean) !important;
}

.chat-agent-prompt-toggle:hover {
    color: var(--text-primary) !important;
}

.chat-prompt-collapse {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-secondary) !important;
    padding: 12px 16px !important;
}

/* Standardize all topbar buttons in chat and sandbox to match 32px height */
.astroweb-topbar .btn-pill,
.sandbox-header .btn-pill {
    height: 32px !important;
    padding: 0 4px 0 12px !important;
    font-size: 0.78rem !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.astroweb-topbar .btn-pill-icon-circle,
.sandbox-header .btn-pill-icon-circle {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.75rem !important;
}

.astroweb-topbar a.btn-pill-outline {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.chat-mode-switch {
    height: 32px !important;
    padding: 2px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.chat-mode-btn {
    height: 26px !important;
    padding: 0 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.78rem !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

/* Sidebar Usage Progress Bar Styles */
.usage-label-row {
    color: var(--text-secondary) !important;
}

.usage-bar-track {
    background: rgba(255, 255, 255, 0.08) !important;
    height: 6px !important;
    border-radius: var(--radius-full) !important;
}

.usage-bar-fill {
    background: var(--text-primary) !important;
    border-radius: var(--radius-full) !important;
}

[data-theme="light"] .usage-bar-track {
    background: rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .usage-bar-fill {
    background: #0f172a !important;
}

/* Center theme switcher icon globally */
#header-theme-toggle-btn {
    justify-content: center !important;
    padding: 0 !important;
}

/* Mobile responsive view optimizations for topbar headers */
@media (max-width: 680px) {
    /* Hide the text span on small screens, converting pill buttons into icon-only circle buttons */
    .astroweb-topbar .btn-pill > span:first-child,
    .sandbox-header .btn-pill > span:first-child {
        display: none !important;
    }
    
    /* Adjust button padding and width to make it a perfect 32x32px circle */
    .astroweb-topbar .btn-pill,
    .sandbox-header .btn-pill {
        width: 32px !important;
        height: 32px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        justify-content: center !important;
    }
    
    .astroweb-topbar .btn-pill-icon-circle,
    .sandbox-header .btn-pill-icon-circle {
        margin: 0 !important;
        background: transparent !important;
        color: inherit !important;
        width: 100% !important;
        height: 100% !important;
    }

    /* Hide the text inside mode switch buttons on mobile (icon-only mode switcher) */
    .chat-mode-btn {
        font-size: 0 !important;
        width: 32px !important;
        height: 26px !important;
        padding: 0 !important;
        justify-content: center !important;
        display: inline-flex !important;
        align-items: center !important;
    }
    
    .chat-mode-btn i {
        font-size: 1rem !important;
        margin: 0 !important;
    }

    /* Hide the Persona Info toggle entirely on mobile to save critical space */
    .chat-agent-prompt-toggle {
        display: none !important;
    }
    
    /* Hide public/personal badge inside header on mobile to save space */
    .astroweb-topbar-left .badge {
        display: none !important;
    }

    /* Reduce gaps in topbar header */
    .astroweb-topbar {
        padding: 10px 12px !important;
    }
    
    .astroweb-topbar-left {
        gap: 6px !important;
    }
    
    .astroweb-topbar > div[style*="display:flex"] {
        gap: 6px !important;
    }
    
    .astroweb-agent-title {
        font-size: 1.1rem !important;
    }
}
