/* ============================================================
   ROOT VARIABLES (Dark Theme - default)
   ============================================================ */
:root {
    --bg-deep: #050505;
    --bg-sidebar: #090909;
    --bg-card: #101010;
    --bg-input: #121212;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --accent-glow: #00f2fe;
    --accent-glow-pro: #8b5cf6;
    --accent-glow-designer: #f43f5e;
    --accent-secondary: #10b981;
    --border-muted: rgba(255, 255, 255, 0.06);
    --text-on-accent: #000;
    --sidebar-width: 320px;
    --shadow-color: rgba(0,0,0,0.5);

    /* Logo colors */
    --logo-stroke-primary: #ffffff;
    --logo-fill-primary: rgba(255,255,255,0.05);
    --logo-stroke-secondary: #ffffff;
}

/* Light Theme */
body.light-theme {
    --bg-deep: #f5f5f5;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f0f0f0;
    --text-main: #1a1a1a;
    --text-muted: #6b7280;
    --border-muted: rgba(0, 0, 0, 0.08);
    --shadow-color: rgba(0,0,0,0.1);
    --text-on-accent: #000;

    --logo-stroke-primary: #000000;
    --logo-fill-primary: rgba(0,0,0,0.05);
    --logo-stroke-secondary: #000000;
}
body.light-theme .user-bubble {
    background: #e5e7eb;
    color: #000;
    border-color: #d1d5db;
}
body.light-theme .nexus-bubble {
    background: #f9fafb;
    border-color: #d1d5db;
}
body.light-theme .workspace-header {
    background: rgba(255,255,255,0.8);
    border-bottom-color: var(--border-muted);
}
body.light-theme #sidebar-container-node {
    background: #ffffff;
}
body.light-theme .sidebar-footer {
    background: #ffffff;
}
body.light-theme .history-item:hover {
    background: rgba(0,0,0,0.02);
}
body.light-theme .input-frame {
    background: #ffffff;
}
body.light-theme textarea::placeholder {
    color: #9ca3af;
}
body.light-theme .command-wrapper {
    background: linear-gradient(to top, var(--bg-deep) 70%, transparent);
}
body.light-theme .modal-card {
    background: #ffffff;
}
body.light-theme .tier-card {
    background: #fafafa;
}
body.light-theme .profile-stat-value {
    color: #000;
}
body.light-theme .dropdown-email {
    color: #4b5563;
}
body.light-theme .sub-box-title {
    color: #000;
}
body.light-theme .modal-input {
    background: #f0f0f0;
    color: #000;
}
body.light-theme .settings-item {
    background: #f9fafb;
    border-color: #e5e7eb;
}
body.light-theme .settings-item:hover {
    background: #f3f4f6;
}
body.light-theme .axelr-quota-box {
    background: #f9fafb;
}
body.light-theme .quota-label {
    color: #6b7280;
}
body.light-theme .quota-count {
    color: #000;
}
body.light-theme .tier-card .price-output {
    color: #000;
}
body.light-theme .tier-card .price-output span {
    color: #555;
}
body.light-theme .tier-card h3 {
    color: #000;
}
body.light-theme .tier-card p.sub-desc {
    color: #555;
}
body.light-theme .tier-card .options-group label .opt-content .opt-row .opt-name {
    color: #000;
}
body.light-theme .tier-card .options-group label .opt-content .opt-desc {
    color: #666;
}
body.light-theme .tier-card .options-group label {
    background: rgba(0,0,0,0.02);
    border-color: rgba(0,0,0,0.08);
}
body.light-theme .tier-card {
    background: #f5f5f5;
}
body.light-theme .axelr-pricing-container .tier-card.pro-premium {
    border-color: rgba(16,185,129,0.3);
}
body.light-theme .axelr-pricing-container .tier-card.business-premium {
    border-color: rgba(239,68,68,0.3);
}
body.light-theme .accent-glow {
    color: #0ea5e9;
}
body.light-theme .accent-glow-pro {
    color: #7c3aed;
}
body.light-theme .accent-glow-designer {
    color: #dc2626;
}
body.light-theme .workspace-data .brand-logo {
    color: #0d9488;
    text-shadow: 0 0 20px rgba(13,148,136,0.3);
}
body.light-theme .workspace-design .brand-logo {
    color: #dc2626;
    text-shadow: 0 0 20px rgba(220,38,38,0.3);
}
body.light-theme .input-frame:focus-within {
    border-color: #0d9488 !important;
    box-shadow: 0 0 30px rgba(13,148,136,0.15) !important;
}
body.light-theme .workspace-design .input-frame:focus-within {
    border-color: #dc2626 !important;
    box-shadow: 0 0 30px rgba(220,38,38,0.15) !important;
}
body.light-theme .auth-logo span,
body.light-theme .brand-logo span {
    color: #000 !important;
}
:root {
    --logo-text-color: #ffffff;
}
body.light-theme {
    --logo-text-color: #000000;
}
body.light-theme #workspace-selector h2 {
    color: #000;
}
body.light-theme .workspace-card .ws-title {
    color: #000;
}
body.light-theme .workspace-card .ws-desc {
    color: #555;
}
body.light-theme .workspace-card {
    background: #f5f5f5;
    border-color: #ddd;
}
body.light-theme .axelr-quota-box .quota-track {
    background: #ddd;
}
body.light-theme .axelr-quota-box .quota-fill {
    background: linear-gradient(90deg, #0d9488, #0ea5e9);
}
body.light-theme .axelr-quota-box .quota-count {
    color: #000;
}
body.light-theme .axelr-quota-box .quota-label {
    color: #555;
}
body.light-theme .brand-logo {
    color: #0d9488 !important;
}
body.light-theme .brand-logo svg path:first-child {
    stroke: #000;
}
body.light-theme .brand-logo svg path:last-child {
    stroke: #000;
}

.theme-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border-muted);
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    font-family: 'Inter', sans-serif;
}
.theme-option:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}
.theme-option.active {
    background: var(--bg-card);
    color: var(--text-main);
    border-color: var(--accent-glow);
    box-shadow: 0 0 12px rgba(0,242,254,0.15);
}
body.light-theme .theme-option.active {
    background: #e5e7eb;
    border-color: var(--accent-glow);
    color: #000;
}
body.light-theme .theme-option:hover {
    background: rgba(0,0,0,0.05);
    color: #000;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    display: flex;
    overflow: hidden;
    background-image: radial-gradient(circle at 50% 30%, rgba(0, 242, 254, 0.02), transparent 60%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s, color 0.3s;
}

/* ============================================================
   AUTH WALL
   ============================================================ */
#auth-wall {
    position: fixed;
    inset: 0;
    background: var(--bg-deep);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.auth-card {
    background: var(--bg-card);
    padding: 40px 32px;
    border-radius: 24px;
    border: 1px solid var(--border-muted);
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px var(--shadow-color);
}
.auth-logo {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.auth-sub {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* ============================================================
   WORKSPACE SELECTOR
   ============================================================ */
#workspace-selector {
    position: fixed;
    inset: 0;
    background: var(--bg-deep);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 20px;
}
#workspace-selector h2 {
    color: #fff;
    margin-bottom: 30px;
    font-size: 28px;
    text-align: center;
}
.ws-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    width: 100%;
    max-width: 800px;
    justify-items: center;
}
.workspace-card {
    background: var(--bg-card);
    padding: 40px 24px;
    border-radius: 24px;
    border: 1px solid var(--border-muted);
    cursor: pointer;
    width: 100%;
    max-width: 340px;
    text-align: center;
    transition: 0.3s ease;
    position: relative;
    overflow: hidden;
}
.workspace-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px var(--shadow-color);
}
.workspace-card.data:hover {
    border-color: var(--accent-glow);
}
.workspace-card.design:hover {
    border-color: var(--accent-glow-designer);
}
.ws-icon {
    font-size: 48px;
    margin-bottom: 20px;
}
.ws-title {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}
.ws-desc {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    display: flex;
    opacity: 1;
}
.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-muted);
    width: 90%;
    max-width: 700px;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 25px 50px var(--shadow-color);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-overlay.active .modal-card {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-muted);
    padding-bottom: 15px;
}
.modal-title {
    color: var(--text-main);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    font-size: 18px;
    padding: 4px;
    border-radius: 6px;
    line-height: 1;
}
.close-modal-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}
.modal-input {
    background: var(--bg-input);
    border: 1px solid var(--border-muted);
    color: var(--text-main);
    padding: 12px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    width: 100%;
    resize: vertical;
    min-height: 100px;
}
.modal-input:focus {
    border-color: var(--accent-glow);
}
.modal-input::placeholder {
    color: #4b5563;
}
.modal-submit-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 10px;
    width: 100%;
    font-family: 'Inter', sans-serif;
}
.modal-submit-btn:hover {
    opacity: 0.9;
}
.modal-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.profile-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-muted);
    font-size: 14px;
}
.profile-stat-label {
    color: var(--text-muted);
}
.profile-stat-value {
    color: var(--text-main);
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
    flex: 1;
    display: none;
    flex-direction: column;
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.main-wrapper.visible {
    display: flex;
    opacity: 1;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar-trigger-area {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 32px;
    z-index: 199;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid var(--border-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}
#sidebar-trigger-area:hover {
    background: rgba(255, 255, 255, 0.05);
    width: 40px;
    box-shadow: 2px 0 15px var(--shadow-color);
}
.trigger-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 3px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    transition: 0.3s;
    white-space: nowrap;
}
#sidebar-trigger-area:hover .trigger-text {
    color: var(--text-main);
}

#sidebar-container-node {
    position: absolute;
    left: calc(var(--sidebar-width) * -1);
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    transition: left 0.3s ease;
    z-index: 200;
    border-right: 1px solid var(--border-muted);
    height: 100dvh;
    overflow-y: auto;
    touch-action: pan-y;
}
#sidebar-container-node.open {
    left: 0;
}

.sidebar-header {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-muted);
    flex-shrink: 0;
}
.brand-logo {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}
body.workspace-data .brand-logo {
    color: var(--accent-glow);
    text-shadow: 0 0 15px var(--accent-glow);
}
body.workspace-design .brand-logo {
    color: var(--accent-glow-designer);
    text-shadow: 0 0 15px var(--accent-glow-designer);
}
.new-chat-btn {
    background: transparent;
    border: 1px solid var(--border-muted);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    font-family: 'Inter', sans-serif;
}
.new-chat-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.sidebar-tabs {
    display: flex;
    gap: 5px;
    margin: 0 15px 5px 15px;
    background: var(--bg-deep);
    padding: 4px;
    border-radius: 8px;
    flex-shrink: 0;
}
.tab-btn {
    flex: 1;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: 6px;
    padding: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-family: 'Inter', sans-serif;
}
.tab-btn.active {
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: 0 2px 4px var(--shadow-color);
}
.tab-btn:hover {
    color: var(--text-main);
}

.sidebar-search-box {
    margin: 10px 15px;
    background: var(--bg-input);
    border: 1px solid var(--border-muted);
    border-radius: 10px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    transition: 0.2s;
    flex-shrink: 0;
    cursor: pointer;
}
.sidebar-search-box:focus-within {
    border-color: var(--text-muted);
}
.sidebar-search-box input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 13px;
    width: 100%;
    outline: none;
    font-family: 'Inter', sans-serif;
}
.sidebar-search-box input::placeholder {
    color: var(--text-muted);
}

#sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 15px 15px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}
.sidebar-section-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #4b5563;
    font-weight: 600;
    letter-spacing: 1px;
    margin: 10px 5px 5px 5px;
}

.history-item {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
.history-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}
.history-info {
    flex: 1;
    overflow: hidden;
}
.history-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}
.history-options-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    opacity: 0;
    cursor: pointer;
    padding: 5px;
    transition: 0.2s;
    border-radius: 6px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.history-item:hover .history-options-btn {
    opacity: 1;
}
.history-options-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}
.actions-dropdown-list {
    position: absolute;
    right: 10px;
    top: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 250;
    box-shadow: 0 10px 30px var(--shadow-color);
    min-width: 150px;
}
.actions-dropdown-list.active {
    display: flex;
}
.action-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: 0.2s;
    border: none;
    background: transparent;
    text-align: left;
    font-family: 'Inter', sans-serif;
    width: 100%;
}
.action-list-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}
.action-list-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}
.action-list-item .spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
}

@keyframes spin {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--border-muted);
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: var(--bg-sidebar);
    z-index: 10;
    min-height: 80px;
    padding-bottom: calc(env(safe-area-inset-bottom) + 15px);
}
.footer-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    font-family: 'Inter', sans-serif;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}
.footer-opt:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.sidebar-sub-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: 0.2s;
}
.sidebar-sub-box:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}
.sub-box-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sub-box-desc {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================================
   HEADER
   ============================================================ */
.workspace-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0 50px;
    border-bottom: 1px solid var(--border-muted);
    z-index: 150;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.model-hub {
    position: relative;
}
#model-selector {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: 0.2s;
    font-family: 'Inter', sans-serif;
}
#model-selector:hover {
    background: rgba(255, 255, 255, 0.05);
}
#model-selector .badge {
    color: var(--accent-glow);
    font-size: 11px;
    font-weight: 700;
    background: rgba(0, 242, 254, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}
body.pro-tier #model-selector .badge {
    color: var(--accent-glow-pro);
    background: rgba(139, 92, 246, 0.1);
}
body.designer-tier #model-selector .badge {
    color: var(--accent-glow-designer);
    background: rgba(244, 63, 94, 0.1);
}

#model-dropdown-card {
    position: absolute;
    top: 45px;
    left: 0;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 210;
    box-shadow: 0 10px 30px var(--shadow-color);
}
.model-option {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1px solid transparent;
}
.model-option:hover {
    background: rgba(255, 255, 255, 0.03);
}
.model-option.active {
    background: rgba(0, 242, 254, 0.05);
    border-color: rgba(0, 242, 254, 0.2);
}
.model-option.pro {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.2);
}
.model-option.pro:hover {
    background: rgba(139, 92, 246, 0.1);
}
.model-option.designer {
    background: rgba(244, 63, 94, 0.05);
    border-color: rgba(244, 63, 94, 0.2);
}
.model-option.designer:hover {
    background: rgba(244, 63, 94, 0.1);
}
.model-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.model-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
}
.model-option.designer .model-title span {
    font-size: 8px !important;
    padding: 2px 5px !important;
    white-space: nowrap;
    line-height: 1.4;
}
.model-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.account-hub {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-muted);
    cursor: pointer;
    display: none;
    object-fit: cover;
}
#account-dropdown-card {
    position: absolute;
    top: 45px;
    right: 0;
    width: 260px;
    background: var(--bg-card);
    border: 1px solid var(--border-muted);
    border-radius: 16px;
    padding: 15px;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 210;
    box-shadow: 0 10px 30px var(--shadow-color);
}
.dropdown-email {
    color: var(--text-muted);
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tier-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-on-accent);
    background: var(--text-muted);
    padding: 3px 8px;
    border-radius: 4px;
    align-self: flex-start;
}
.logout-btn {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: 0.2s;
    margin-top: 5px;
    font-family: 'Inter', sans-serif;
}
.logout-btn:hover {
    opacity: 0.9;
}

/* ============================================================
   VIEWPORT
   ============================================================ */
#viewport {
    flex: 1;
    overflow-y: auto;
    padding: 100px 20px 160px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    scroll-behavior: smooth;
}
.hero-text {
    text-align: center;
    margin-top: 20vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-text h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.hero-text p {
    color: var(--text-muted);
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}

/* ============================================================
   CHAT BUBBLES
   ============================================================ */
.chat-bubble {
    max-width: 85%;
    padding: 16px 20px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
    transition: 0.2s;
    word-wrap: break-word;
}
.user-bubble {
    align-self: flex-end;
    background: #fff;
    color: #000;
    border-bottom-right-radius: 4px;
    border: 1px solid #fff;
    font-weight: 500;
}
.nexus-bubble {
    align-self: flex-start;
    background: var(--bg-sidebar);
    color: var(--text-main);
    border-top-left-radius: 4px;
    border: 1px solid var(--border-muted);
    width: 100%;
    display: flex;
    gap: 12px;
}
.file-chip {
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.15);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.nexus-bubble pre {
    position: relative;
    background: #000000;
    padding: 35px 14px 14px 14px;
    border-radius: 10px;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 12px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}
.copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    z-index: 10;
    font-family: 'Inter', sans-serif;
}
.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}
.nexus-bubble code {
    font-family: 'JetBrains Mono', monospace;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}
.nexus-bubble pre code {
    color: #e5e7eb;
    background: transparent;
    padding: 0;
}
.nexus-bubble p {
    margin-bottom: 12px;
}
.nexus-bubble p:last-child {
    margin-bottom: 0;
}
.ai-avatar-bubble {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-top: 4px;
}

/* ============================================================
   ACTION BAR
   ============================================================ */
.bubble-action-bar {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-muted);
    flex-wrap: wrap;
}
.action-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    transition: 0.2s;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}
.action-icon-btn svg {
    width: 16px;
    height: 16px;
    transition: 0.2s;
}
.action-icon-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}
.action-icon-btn:active {
    transform: scale(0.95);
}
.action-icon-btn.regen-active {
    color: var(--accent-glow);
    border: 1px solid var(--border-muted);
}
.action-icon-btn.regen-active:hover {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--accent-glow);
}
.regen-countdown {
    margin-left: 4px;
    font-size: 10px;
    color: var(--text-muted);
}

/* ============================================================
   LOADING ANIMATION
   ============================================================ */
.matrix-loader {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 0;
}
.matrix-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-glow);
    animation: pulseDot 1.4s infinite ease-in-out both;
}
.matrix-dot:nth-child(1) { animation-delay: -0.32s; }
.matrix-dot:nth-child(2) { animation-delay: -0.16s; }
.matrix-dot:nth-child(3) { animation-delay: 0s; }
@keyframes pulseDot {
    0%, 80%, 100% { transform: scale(0.4); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

.thinking-extended {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 8px;
    animation: fadePulse 2s ease-in-out infinite;
}
@keyframes fadePulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ============================================================
   SEARCH OVERLAY
   ============================================================ */
#search-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px 20px 20px;
    overflow-y: auto;
}
#search-overlay.active {
    display: flex;
}
#search-overlay .close-search {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: 0.2s;
    line-height: 1;
}
#search-overlay .close-search:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}
#search-overlay .search-results {
    width: 100%;
    max-width: 700px;
    margin-top: 20px;
}
#search-overlay .search-result-item {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: 0.2s;
}
#search-overlay .search-result-item:hover {
    background: rgba(255, 255, 255, 0.05);
}
#search-overlay .search-result-item .title {
    color: var(--text-main);
    font-weight: 600;
}
#search-overlay .search-result-item .preview {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}
#search-overlay .search-input-box {
    width: 100%;
    max-width: 700px;
    background: var(--bg-input);
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-main);
    font-size: 18px;
    outline: none;
    font-family: 'Inter', sans-serif;
}
#search-overlay .search-input-box:focus {
    border-color: var(--accent-glow);
}
#search-overlay .search-input-box::placeholder {
    color: #4b5563;
}

/* ============================================================
   COMMAND WRAPPER - FIXED MOBILE
   ============================================================ */
.command-wrapper {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 780px;
    padding: 20px 20px 30px 20px;
    z-index: 100;
    background: linear-gradient(to top, var(--bg-deep) 70%, transparent);
    transition: bottom 0.2s ease;
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    overflow-y: auto;
}
#file-staging-container {
    width: 100%;
    min-height: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-muted);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: var(--bg-deep);
    z-index: 5;
}
#file-staging-container:empty {
    display: none;
    min-height: 0;
}
.input-frame {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-muted);
    border-radius: 24px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    transition: 0.3s;
    box-shadow: 0 10px 30px var(--shadow-color);
}
.input-frame:focus-within {
    border-color: var(--text-muted);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.05);
}
.input-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
}
textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 14px;
    padding: 8px 5px;
    resize: none;
    max-height: 180px;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
}
textarea::placeholder {
    color: #4b5563;
}
textarea::-webkit-scrollbar {
    width: 4px;
}
textarea::-webkit-scrollbar-thumb {
    background: var(--border-muted);
    border-radius: 2px;
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    flex-shrink: 0;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
}
.action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}
.enhance-btn {
    color: var(--accent-glow-pro);
}
.enhance-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    color: #fff;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}
.enhance-btn.loading {
    animation: pulse 1s infinite;
    opacity: 0.5;
    cursor: not-allowed;
}
@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
.attach-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}
.mic-btn.listening {
    color: #ef4444;
    animation: pulse 1.5s infinite;
    background: rgba(239, 68, 68, 0.1);
}
.send-btn {
    background: #fff;
    color: #000;
}
.send-btn:hover {
    opacity: 0.8;
}
.send-btn:disabled {
    background: var(--bg-card);
    color: #4b5563;
    cursor: not-allowed;
}

/* STOP BUTTON */
.send-btn.btn-stop-active {
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-muted) !important;
    width: auto !important;
    padding: 0 12px !important;
    border-radius: 12px !important;
}
body.workspace-data .send-btn.btn-stop-active {
    background: rgba(0, 255, 136, 0.15) !important;
    color: #00ff88 !important;
    border-color: #00ff88 !important;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4) !important;
}
body.workspace-design .send-btn.btn-stop-active {
    background: rgba(255, 26, 74, 0.15) !important;
    color: #ff1a4a !important;
    border-color: #ff1a4a !important;
    box-shadow: 0 0 20px rgba(255, 26, 74, 0.4) !important;
}

.download-btn-bubble {
    background: var(--accent-glow);
    color: #000;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    font-family: 'Inter', sans-serif;
}
.download-btn-bubble:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

#offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #ef4444;
    color: #fff;
    text-align: center;
    padding: 10px;
    z-index: 99999;
    font-weight: 600;
    font-size: 14px;
    display: none;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    font-family: 'Inter', sans-serif;
}

/* ============================================================
   WORKSPACE THEMES
   ============================================================ */
body.workspace-data {
    --accent-glow: #10b981 !important;
    --accent-secondary: #059669 !important;
    --border-muted: rgba(16, 185, 129, 0.3) !important;
}
body.workspace-data .input-frame:focus-within {
    border-color: #10b981 !important;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.2) !important;
}
body.workspace-data .ai-avatar-bubble svg path:nth-child(2) {
    stroke: #10b981 !important;
}
body.workspace-design {
    --accent-glow: #ef4444 !important;
    --accent-glow-designer: #ef4444 !important;
    --accent-secondary: #18ad7b !important;
    --border-muted: rgba(239, 68, 68, 0.3) !important;
}
body.workspace-design .input-frame:focus-within {
    border-color: #ef4444 !important;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.2) !important;
}
body.workspace-design .ai-avatar-bubble svg path:nth-child(2) {
    stroke: #ef4444 !important;
}

/* ============================================================
   UPGRADE MODAL
   ============================================================ */
.axelr-pricing-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}
.axelr-pricing-container > div {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    width: 100%;
}
.tier-card {
    background: #0A0F0D;
    border-radius: 16px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 8px 32px var(--shadow-color);
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
.tier-card.pro-premium {
    border: 1px solid rgba(16, 185, 129, 0.15);
}
.tier-card.business-premium {
    border: 1px solid rgba(239, 68, 68, 0.15);
}
.tier-card .tier-badge-pos {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 1px;
    z-index: 2;
}
.pro-premium .tier-badge-pos {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}
.business-premium .tier-badge-pos {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}
.tier-card h3 {
    margin: 0 0 4px 0;
    font-size: 22px;
    color: #FFF;
    font-weight: 700;
    padding-right: 90px;
}
.tier-card p.sub-desc {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: #888;
    line-height: 1.5;
}
.tier-card .price-output {
    font-size: 36px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 24px;
}
.tier-card .price-output span {
    font-size: 14px;
    color: #555;
    font-weight: 400;
}
.tier-card .options-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}
.tier-card .options-group label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.pro-premium .options-group label:has(input:checked) {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.05);
}
.business-premium .options-group label:has(input:checked) {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.05);
}
.tier-card .options-group label input[type="radio"] {
    margin-top: 3px;
    flex-shrink: 0;
}
.pro-premium .options-group label input[type="radio"] {
    accent-color: #10B981;
}
.business-premium .options-group label input[type="radio"] {
    accent-color: #EF4444;
}
.tier-card .options-group label .opt-content {
    flex: 1;
    min-width: 0;
}
.tier-card .options-group label .opt-content .opt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
    flex-wrap: wrap;
    gap: 4px;
}
.tier-card .options-group label .opt-content .opt-row .opt-name {
    color: #FFF;
    font-size: 14px;
    font-weight: 600;
}
.tier-card .options-group label .opt-content .opt-row .opt-price {
    font-size: 14px;
    font-weight: 700;
}
.pro-premium .options-group label .opt-content .opt-row .opt-price {
    color: #10B981;
}
.business-premium .options-group label .opt-content .opt-row .opt-price {
    color: #EF4444;
}
.tier-card .options-group label .opt-content .opt-desc {
    color: #888;
    font-size: 12px;
    line-height: 1.4;
}
.tier-card .upgrade-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease;
    margin-top: auto;
    color: #000;
    font-family: 'Inter', sans-serif;
}
.pro-premium .upgrade-btn {
    background: #10B981;
}
.business-premium .upgrade-btn {
    background: #EF4444;
    color: #FFF;
}
.tier-card .upgrade-btn:hover {
    opacity: 0.9;
}

/* ============================================================
   SETTINGS MODAL
   ============================================================ */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.settings-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
    text-align: left;
    font-family: 'Inter', sans-serif;
    border: 1px solid var(--border-muted);
}
.settings-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}
.settings-item .icon {
    color: var(--text-muted);
    font-size: 22px;
    flex-shrink: 0;
}
.settings-item .content {
    flex: 1;
}
.settings-item .title {
    color: var(--text-main);
    font-weight: 500;
    font-size: 14px;
}
.settings-item .desc {
    color: var(--text-muted);
    font-size: 12px;
}
.settings-item .arrow {
    color: var(--text-muted);
    font-size: 20px;
    flex-shrink: 0;
}
.axelr-quota-box {
    display: flex !important;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 0;
}
.axelr-quota-box .quota-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}
.axelr-quota-box .quota-label {
    color: #888;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.5px;
}
.axelr-quota-box .quota-count {
    color: var(--text-main);
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}
.axelr-quota-box .quota-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}
.axelr-quota-box .quota-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-glow), #FFF);
    transition: width 0.4s ease;
}

/* ============================================================
   SECURITY ALERT
   ============================================================ */
.security-alert-banner {
    background: rgba(239, 68, 68, 0.15);
    border-left: 4px solid #ef4444;
    padding: 16px 20px;
    border-radius: 8px;
    color: #fca5a5;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    width: 100%;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}
.security-alert-banner .material-symbols-rounded {
    color: #ef4444;
    font-size: 28px;
}
.security-alert-banner span:last-child {
    flex: 1;
}
.security-alert-banner.warning {
    background: rgba(234, 179, 8, 0.15);
    border-left-color: #eab308;
    color: #fde047;
}
.security-alert-banner.warning .material-symbols-rounded {
    color: #eab308;
}
.security-alert-banner.critical {
    background: rgba(239, 68, 68, 0.25);
    border-left-color: #ef4444;
    color: #fca5a5;
    animation: pulseAlert 1.5s infinite;
}
@keyframes pulseAlert {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.deploy-retry-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.2s;
    font-family: 'Inter', sans-serif;
}
.deploy-retry-btn:hover {
    opacity: 0.8;
}
.deploy-debug-btn {
    background: transparent;
    border: 1px solid var(--border-muted);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 8px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
}
.deploy-debug-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}
.deploy-error-details {
    background: var(--bg-input);
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    white-space: pre-wrap;
    word-break: break-all;
    display: none;
}
.deploy-error-details.show {
    display: block;
}

/* ============================================================
   UTILITY
   ============================================================ */
.material-symbols-rounded {
    font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    font-size: 24px;
}
.action-icon-btn span,
.action-list-item span,
.footer-opt span,
.sidebar-sub-box span {
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle !important;
}

/* ============================================================
   RESPONSIVE - FIXED MOBILE COMMAND BAR
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 85%;
    }
    body {
        height: 100dvh;
        overflow: hidden;
    }
    #sidebar-container-node {
        left: calc(var(--sidebar-width) * -1);
        width: var(--sidebar-width);
    }
    #sidebar-container-node.open {
        left: 0;
        box-shadow: 10px 0 30px var(--shadow-color);
    }
    #viewport {
        padding: 80px 15px 140px 15px !important;
        height: 100dvh;
    }
    .swipe-handle {
        position: absolute;
        top: 0;
        left: 0;
        width: 20px;
        height: 100%;
        background: transparent;
        z-index: 201;
        cursor: ew-resize;
    }
    .workspace-header {
        padding-left: 40px !important;
    }
    .brand-logo {
        font-size: 16px;
    }
    .chat-bubble {
        max-width: 95% !important;
        padding: 12px 14px !important;
    }
    .hero-text {
        padding-left: 42px !important;
        padding-right: 15px !important;
        margin-top: 15vh !important;
    }
    .hero-text h1 {
        font-size: 24px !important;
    }
    .hero-text p {
        font-size: 13px !important;
        padding: 0;
    }
    .command-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 42px !important;
        padding-right: 15px !important;
        padding-bottom: 20px !important;
        left: 0 !important;
        transform: none !important;
        position: fixed !important;
        bottom: env(safe-area-inset-bottom) !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
    .input-row {
        flex-wrap: nowrap !important;
        align-items: flex-end !important;
        gap: 6px !important;
    }
    textarea {
        font-size: 16px !important;
        padding: 6px 4px !important;
        max-height: 35vh !important;
        margin-bottom: 0 !important;
    }
    .action-btn {
        width: 36px !important;
        height: 36px !important;
    }
    .input-frame:not(.has-text) #send-trigger:not(.btn-stop-active) {
        display: none !important;
    }
    .input-frame.has-text #mic-trigger {
        display: none !important;
    }
    .input-frame:has(#send-trigger.btn-stop-active) #mic-trigger {
        display: none !important;
    }
    #model-dropdown-card {
        right: 10px;
        left: 10px;
        width: auto;
        max-width: 100%;
    }
    .sidebar-footer {
        margin-top: auto;
        flex-shrink: 0;
        padding: 10px 15px;
        min-height: 70px;
    }
    .sidebar-footer .footer-opt {
        font-size: 12px;
        padding: 8px;
    }
    .sidebar-footer .sidebar-sub-box {
        padding: 8px;
    }
    .axelr-pricing-container > div {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .tier-card {
        padding: 24px 18px;
    }
    .tier-card h3 {
        font-size: 20px;
        padding-right: 80px;
    }
    .tier-card .price-output {
        font-size: 30px;
        margin-bottom: 18px;
    }
    .tier-card .options-group label {
        padding: 12px;
    }
    .tier-card .options-group label .opt-content .opt-row .opt-name {
        font-size: 13px;
    }
    .tier-card .options-group label .opt-content .opt-row .opt-price {
        font-size: 13px;
    }
    .tier-card .options-group label .opt-content .opt-desc {
        font-size: 11px;
    }
    .tier-card .tier-badge-pos {
        top: 14px;
        right: 14px;
        font-size: 9px;
        padding: 3px 8px;
    }
    #search-overlay {
        padding: 60px 20px 20px 20px;
    }
    #search-overlay .search-input-box {
        font-size: 18px;
    }
    .workspace-card {
        padding: 24px 16px;
    }
    .ws-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .tier-card {
        padding: 18px 14px;
    }
    .tier-card h3 {
        font-size: 18px;
        padding-right: 70px;
    }
    .tier-card .price-output {
        font-size: 26px;
        margin-bottom: 14px;
    }
    .tier-card .options-group label {
        padding: 10px;
    }
    .tier-card .options-group label .opt-content .opt-row .opt-name {
        font-size: 12px;
    }
    .tier-card .options-group label .opt-content .opt-row .opt-price {
        font-size: 12px;
    }
    .tier-card .options-group label .opt-content .opt-desc {
        font-size: 10px;
    }
    .tier-card .tier-badge-pos {
        top: 12px;
        right: 12px;
        font-size: 8px;
        padding: 2px 6px;
    }
    #search-overlay {
        padding: 60px 20px 20px 20px;
    }
    #search-overlay .search-input-box {
        font-size: 18px;
    }
    .command-wrapper {
        padding-left: 38px !important;
        padding-right: 10px !important;
        padding-bottom: 15px !important;
    }
    .input-frame {
        padding: 6px 8px !important;
    }
    .action-btn {
        width: 32px !important;
        height: 32px !important;
    }
    .hero-text h1 {
        font-size: 20px !important;
    }
    .hero-text p {
        font-size: 11px !important;
    }
    .workspace-header {
        padding-left: 35px !important;
    }
}

@media (max-width: 320px) {
    .hero-text h1 {
        font-size: 18px !important;
    }
    .hero-text p {
        font-size: 10px !important;
    }
    #search-overlay {
        padding: 60px 20px 20px 20px;
    }
    #search-overlay .search-input-box {
        font-size: 18px;
    }
}

/* additional fixes */
.theme-option {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .theme-option {
    font-size: 10px;
    padding: 4px 6px;
  }
}
.theme-option {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
@media (max-width: 480px) {
  .theme-option {
    font-size: 10px;
    padding: 4px 6px;
  }
}
body.workspace-design {
  --accent-glow: #ef4444 !important;
  --accent-glow-designer: #ef4444 !important;
  --accent-secondary: #18ad7b !important;
  --border-muted: rgba(239, 68, 68, 0.3) !important;
}
body.workspace-design .brand-logo {
  color: var(--accent-glow) !important;
}
body.workspace-design .input-frame:focus-within {
  border-color: #ef4444 !important;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.2) !important;
}
body.workspace-data { --accent-glow: #10b981; }
body.workspace-design { --accent-glow: #ef4444; }

body.light-theme .sidebar-tabs {
    background: #e5e7eb !important;
    border-radius: 8px;
    padding: 4px;
}
body.light-theme .tab-btn {
    color: #4b5563 !important;
    background: transparent !important;
    border: none;
    padding: 6px;
    font-size: 11px;
    font-weight: 600;
}
body.light-theme .tab-btn.active {
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
}
.back-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}
.back-btn:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}
body.light-theme .back-btn:hover {
    background: rgba(0,0,0,0.05);
}
:root {
    --logo-stroke-primary: #ffffff;
    --logo-fill-primary: rgba(255,255,255,0.05);
    --logo-stroke-secondary: #ffffff;
}

body.light-theme {
    --logo-stroke-primary: #000000;
    --logo-fill-primary: rgba(0,0,0,0.05);
    --logo-stroke-secondary: #000000;
}
body.light-theme .ai-avatar-bubble svg path:first-child {
    stroke: #000000 !important;
}
body.light-theme .ai-avatar-bubble svg path:last-child {
    stroke: #000000 !important;
}
.action-icon-btn {
    color: var(--text-muted);
    transition: all 0.2s ease;
}
.action-icon-btn:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.08);
    transform: scale(1.05);
}
.action-icon-btn.regen-active {
    color: var(--accent-glow);
    border: 1px solid var(--border-muted);
    background: rgba(0,242,254,0.05);
}
.action-icon-btn.regen-active:hover {
    background: rgba(0,242,254,0.15);
    border-color: var(--accent-glow);
    box-shadow: 0 0 12px var(--accent-glow);
}
.action-icon-btn svg {
    stroke: currentColor;
    fill: none;
}
.command-wrapper {
    overflow-y: auto;
    max-height: 90vh;
}
#file-staging-container {
    flex-shrink: 0;
    max-height: 80px;
    overflow-y: auto;
}
.bubble-action-bar {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-muted);
    flex-wrap: wrap;
    opacity: 1 !important;
    visibility: visible !important;
}

.action-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    opacity: 1 !important;
    visibility: visible !important;
    min-width: 32px;
    min-height: 32px;
}

.action-icon-btn svg {
    width: 16px;
    height: 16px;
    transition: 0.2s;
    opacity: 1 !important;
}

.action-icon-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}

.action-icon-btn:active {
    transform: scale(0.95);
}

.action-icon-btn.regen-active {
    color: var(--accent-glow);
    border: 1px solid var(--border-muted);
    background: rgba(0,242,254,0.08);
    position: relative;
    padding: 6px 14px;
    font-weight: 600;
}

.action-icon-btn.regen-active:hover {
    background: rgba(0,242,254,0.18);
    border-color: var(--accent-glow);
    box-shadow: 0 0 20px rgba(0,242,254,0.15);
}

.action-icon-btn.regen-active .regen-countdown {
    margin-left: 6px;
    font-size: 10px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.1);
    padding: 1px 8px;
    border-radius: 10px;
}

.action-icon-btn svg {
    opacity: 1 !important;
    fill: none !important;
}

.action-icon-btn:hover svg {
    opacity: 1 !important;
}

body.light-theme .action-icon-btn {
    color: #6b7280;
}

body.light-theme .action-icon-btn:hover {
    color: #1a1a1a;
    background: rgba(0,0,0,0.05);
}

body.light-theme .action-icon-btn.regen-active {
    color: #0ea5e9;
    border-color: rgba(14,165,233,0.3);
}
/* Improve like/dislike buttons visibility */
.action-icon-btn {
    color: var(--text-muted);
    transition: all 0.2s ease;
}
.action-icon-btn:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.08);
    transform: scale(1.05);
}
.action-icon-btn svg {
    stroke: currentColor;
    fill: none;
}

/* For light theme, ensure they are visible */
body.light-theme .action-icon-btn {
    color: #6b7280;
}
body.light-theme .action-icon-btn:hover {
    color: #1a1a1a;
    background: rgba(0,0,0,0.05);
}

/* Plan name text uses theme variable */
#sub-plan-name {
    color: var(--text-main);
}
/* ============================================================
   FIXES FOR LIKE/DISLIKE VISIBILITY & SUBSCRIPTION TEXT
   ============================================================ */

/* Make like/dislike buttons more visible */
.action-icon-btn svg {
    opacity: 1 !important;
    fill: none !important;
    stroke: currentColor;
}
.action-icon-btn {
    color: var(--text-muted);
    transition: all 0.2s ease;
}
.action-icon-btn:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.08);
    transform: scale(1.05);
}
.action-icon-btn:active {
    transform: scale(0.95);
}

/* Ensure subscription modal text uses theme-aware color */
#subscription-modal .modal-card .profile-stat-value,
#subscription-modal .modal-card .sub-plan-name,
#subscription-modal .modal-card h3 {
    color: var(--text-main) !important;
}

/* Free tier message text color */
#free-tier-message {
    color: var(--text-main) !important;
}
#free-tier-message strong {
    color: var(--accent-glow) !important;
}
/* In the modal section */
#sub-plan-name {
    color: var(--text-main); /* instead of #fff */
}

/* Action buttons - ensure visibility */
.action-icon-btn {
    opacity: 1 !important;
    color: var(--text-muted);
    transition: all 0.2s ease;
}
.action-icon-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}
/* In the modal section */
#sub-plan-name {
    color: var(--text-main); /* instead of #fff */
}

/* Action buttons - ensure visibility */
.action-icon-btn {
    opacity: 1 !important;
    color: var(--text-muted);
    transition: all 0.2s ease;
}
.action-icon-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}
#viewport {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 120px; /* adjust as needed */
    scroll-behavior: smooth;
    max-height: calc(100vh - 200px); /* or use flex */
}

#sidebar-container-node {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 280px;
    overflow-y: auto;
    z-index: 100;
    background: var(--bg-sidebar);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

#sidebar-container-node.open {
    transform: translateX(0);
}
/* Make sidebar fixed and independently scrollable */
#sidebar-container-node {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
    border-right: 1px solid var(--border-muted);
    overflow-y: auto; /* scrollable */
}
#sidebar-container-node.open {
    transform: translateX(0);
}

/* Ensure viewport scrolls independently */
#viewport {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 160px; /* room for command wrapper */
    height: 100vh; /* fallback */
    max-height: calc(100vh - 60px); /* subtract header height */
    scroll-behavior: smooth;
}

/* Make main wrapper fill the viewport */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}
/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--accent-glow);
}
input:checked + .slider:before {
    transform: translateX(16px);
}
/* Admin modal provider list */
#admin-metrics-container .profile-stat-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-muted);
    font-size: 13px;
}
#admin-metrics-container .profile-stat-row .profile-stat-label {
    min-width: 120px;
    font-weight: 600;
    color: var(--text-muted);
}
#admin-metrics-container .profile-stat-row .profile-stat-value {
    font-weight: 500;
    color: var(--text-main);
    word-break: break-word;
    text-align: right;
}
@media (max-width: 600px) {
    #admin-metrics-container .profile-stat-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    #admin-metrics-container .profile-stat-row .profile-stat-value {
        text-align: left;
    }
}
#suggestions-container .suggestion-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-muted);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
}
#suggestions-container .suggestion-chip:hover {
    border-color: var(--accent-glow);
    color: var(--text-main);
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-muted);
    cursor: pointer;
    display: block; /* changed from none */
    object-fit: cover;
}