/* Generated from public/panel/styles/*.css. Do not edit public/panel-styles.css directly. */
/* ========================================
   BOTFORGE PANEL - ADDITIONAL STYLES
   UTF-8 Encoding
   ======================================== */

/* ========================================
   LOGO SIZE FIX FOR PANEL
   ======================================== */
.panel-body .logo-icon-img {
    width: 34px !important;
    height: 34px !important;
    border-radius: 9px !important;
}

/* Panel Body */
.panel-body {
    background: var(--background);
    min-height: 100vh;
}

/* Panel Layout */
.panel-layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* ========================================
   SIDEBAR
   ======================================== */

.panel-sidebar {
    width: 320px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.btn-refresh {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-refresh:hover {
    background: var(--surface-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: rotate(180deg);
}

/* ========================================
   SERVER CARDS
   ======================================== */

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

.server-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-light);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.server-card:hover {
    background: var(--background);
    border-color: var(--primary);
    transform: translateX(4px);
}

.server-card.active {
    background: var(--background);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.10);
}

.server-icon-wrapper {
    position: relative;
    flex-shrink: 0;
}

.server-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.server-status {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid var(--surface-light);
    transition: border-color 0.3s ease;
}

.server-card:hover .server-status,
.server-card.active .server-status {
    border-color: var(--background);
}

.server-status.online {
    background: var(--success);
}

.server-info {
    flex: 1;
    min-width: 0;
}

.server-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.badge-owner {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #ffffff, #cfcfcf);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
}

.server-arrow {
    flex-shrink: 0;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.server-card:hover .server-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* ========================================
   EMPTY & LOADING STATES
   ======================================== */

.empty-state,
.loading-state,
.error-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--surface-light);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
}

.empty-icon,
.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3,
.error-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.empty-state p,
.error-state p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========================================
   MAIN CONTENT
   ======================================== */

.panel-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.welcome-content {
    text-align: center;
    max-width: 600px;
}

.welcome-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
}

.welcome-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.welcome-content p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.welcome-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-info {
    text-align: left;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ========================================
   CONFIG SCREEN
   ======================================== */

.config-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.config-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.server-badges {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.server-id-badge {
    padding: 0.25rem 0.75rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* ========================================
   SCAN STATUS
   ======================================== */

.scan-status {
    margin-bottom: 2rem;
}

#serverContextPanel {
    display: none !important;
}

.onboarding-flow {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(15, 15, 30, 0.96) 100%);
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: var(--radius-lg);
}

.onboarding-flow-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.onboarding-flow-header.is-compact h2 {
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.onboarding-flow-header.is-compact p {
    font-size: 0.9rem;
}

.onboarding-steps.is-hidden,
.is-hidden {
    display: none !important;
}

.onboarding-flow-header h2 {
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
}

.onboarding-flow-header p {
    color: var(--text-muted);
    max-width: 760px;
}

.onboarding-progress-pill {
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #d8b4fe;
    font-size: 0.85rem;
    white-space: nowrap;
}

.onboarding-progress-track {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.flow-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    min-width: 0;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.flow-step:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.30);
}

.flow-step:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

.flow-step-dot {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.flow-step-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flow-step-done {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.10);
}

.flow-step-done .flow-step-dot {
    background: rgba(255, 255, 255, 0.26);
    border-color: rgba(255, 255, 255, 0.45);
    color: #ecfdf5;
}

.flow-step-done .flow-step-label {
    color: #a7f3d0;
}

.flow-step-active {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.12);
}

.flow-step-active .flow-step-dot {
    background: rgba(255, 255, 255, 0.32);
    border-color: rgba(255, 255, 255, 0.55);
    color: #f5f3ff;
}

.flow-step-active .flow-step-label {
    color: #e5e7eb;
}

.flow-step-locked {
    opacity: 0.7;
}

.is-locked-action,
.is-locked-action:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    filter: saturate(0.85);
}

.onboarding-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.onboarding-step {
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.onboarding-step.is-active {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.10);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.onboarding-step.is-done {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
}

.onboarding-step.is-locked {
    opacity: 0.55;
}

.onboarding-step-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.onboarding-step-index {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.875rem;
}

.onboarding-step.is-active .onboarding-step-index {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.onboarding-step.is-done .onboarding-step-index {
    background: var(--success);
    border-color: var(--success);
    color: #ffffff;
}

.onboarding-step-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.onboarding-step h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.onboarding-step p {
    color: var(--text-muted);
    font-size: 0.9rem;
    min-height: 4.5em;
}

.onboarding-step-actions {
    margin-top: 0.85rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.btn-onboarding-link,
.btn-onboarding-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 40px;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-onboarding-link {
    background: var(--gradient-primary);
    color: #ffffff;
    border: none;
}

.btn-onboarding-ghost {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-onboarding-link:hover,
.btn-onboarding-ghost:hover {
    transform: translateY(-1px);
}

.onboarding-ai-reveal {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    background: rgba(11, 18, 32, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.onboarding-ai-avatar {
    width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #d4d4d8, #ffffff);
    color: #ffffff;
    font-weight: 700;
    flex-shrink: 0;
}

.onboarding-ai-copy strong {
    display: block;
    margin-bottom: 0.35rem;
}

.onboarding-ai-copy p {
    color: var(--text-muted);
    margin: 0;
}

.scan-checking,
.scan-success,
.scan-needed,
.scan-error,
.scan-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
}

.scan-checking {
    background: var(--surface);
    border: 1px solid var(--border);
}

.scan-success {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--success);
}

.scan-needed {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--warning);
}

.scan-error {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--error);
}

.scan-info {
    flex: 1;
}

.scan-info strong {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.scan-info small {
    font-size: 0.875rem;
    opacity: 0.8;
}

.scan-progress {
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--border);
}

.scan-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.scan-steps {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.scan-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    opacity: 0.4;
    transition: all 0.3s ease;
}

.scan-step.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.10);
}

.step-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.scan-step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.step-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.scan-step.active .step-text {
    color: var(--text);
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: var(--radius-sm);
    color: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ========================================
   TABS
   ======================================== */

.tabs-navigation {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0;
    background: transparent;
    border-radius: 0;
    overflow-x: auto;
    width: fit-content;
    max-width: 100%;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    background: color-mix(in srgb, var(--surface-0) 82%, transparent);
    color: var(--text-0);
    border-color: var(--border-strong);
}

.tab-btn.active {
    background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface-0));
    color: var(--text-0);
    border-color: color-mix(in srgb, var(--primary) 55%, var(--border-strong));
}

/* Dodanie marginesu dla zakładki AI Generatora */
.tab-btn.ai-generator-tab-btn { margin-right: 0; position: relative; }

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.ai-generator-gate {
    position: relative;
    margin-bottom: 1rem;
}

.ai-generator-gate-box {
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface-0));
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
}

.ai-generator-gate-box strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--primary);
}

.ai-generator-gate-box p {
    margin: 0;
    color: var(--text-muted);
}

#tab-ai-generator.is-locked-panel {
    position: relative;
}

#tab-ai-generator.is-locked-panel .chat-panel,
#tab-ai-generator.is-locked-panel .ai-generator-status-bar {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.15);
}

.tabs-navigation.is-locked .tab-btn,
.tab-btn.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

/* ========================================
   SECTIONS
   ======================================== */

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-muted);
}

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

/* ========================================
   MODULES GRID
   ======================================== */

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.module-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.module-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.module-card.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.04));
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.10);
}

.module-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.module-content {
    flex: 1;
    min-width: 0;
}

.module-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.module-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.module-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.module-toggle {
    flex-shrink: 0;
}

/* ========================================
   TOGGLE SWITCH (Z !IMPORTANT - FIX)
   ======================================== */

.module-toggle {
    flex-shrink: 0 !important;
}

.toggle-switch {
    position: relative !important;
    width: 52px !important;
    height: 28px !important;
    background: #2a2a40 !important;
    border-radius: 14px !important;
    cursor: pointer !important;
    transition: background 0.3s ease !important;
    border: none !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: inline-block !important;
    box-sizing: border-box !important;
}

.toggle-switch.active {
    background: #ffffff !important;
}

.toggle-slider {
    position: absolute !important;
    top: 3px !important;
    left: 3px !important;
    width: 22px !important;
    height: 22px !important;
    background: white !important;
    border-radius: 50% !important;
    transition: transform 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    display: block !important;
    box-sizing: border-box !important;
}

.toggle-switch.active .toggle-slider {
    transform: translateX(24px) !important;
}

.toggle-switch:hover {
    opacity: 0.9 !important;
}

.toggle-switch:active .toggle-slider {
    width: 26px !important;
}
/* Tier Badge */
.tier-badge {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-badge.pro {
    background: linear-gradient(135deg, #ffffff, #cfcfcf);
    color: white;
}

.tier-badge.business {
    background: linear-gradient(135deg, #cfcfcf, #a1a1aa);
    color: white;
}

/* ========================================
   FORMS
   ======================================== */

.module-config {
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}

.form-control,
select.form-control,
textarea.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.10);
    background: var(--surface);
}

.form-control:hover {
    border-color: var(--primary-light);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-control-color {
    width: 80px;
    height: 40px;
    padding: 0.25rem;
    cursor: pointer;
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

/* Role Checkboxes */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.role-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-checkbox:hover {
    background: var(--surface);
    border-color: var(--primary);
}

.role-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.role-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.role-name {
    font-size: 0.875rem;
    font-weight: 500;
}

/* ========================================
   DEPLOYMENT
   ======================================== */

/* Header */
.deploy-header {
    margin-bottom: 2rem;
}
.deploy-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.deploy-eyebrow::before {
    content: '';
    width: 20px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
    display: inline-block;
}
.deploy-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}

.deploy-choice-stage {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1.1rem 1.2rem;
    border-radius: 16px;
    background:
        radial-gradient(circle at left top, rgba(255, 255, 255, 0.14) 0%, transparent 35%),
        radial-gradient(circle at right bottom, rgba(255, 255, 255, 0.12) 0%, transparent 35%),
        linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.015) 100%);
    border: 1px solid rgba(255,255,255,0.06);
}

.deploy-choice-copy h3 {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
}

.deploy-choice-copy p {
    color: var(--text-muted);
    max-width: 720px;
}

.deploy-choice-kicker {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #d8b4fe;
    margin-bottom: 0.45rem;
}

.deploy-choice-proof {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.deploy-proof-pill {
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
}

/* Grid */
.deploy-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Card base */
.deploy-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.1rem 1rem;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
    text-align: left;
}
.deploy-card--blue {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.deploy-card--red {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.deploy-card:hover {
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}
.deploy-card--featured {
    border-color: rgba(255, 255, 255, 0.45);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(10, 10, 10, 1));
}
.deploy-card--featured::before {
    display: none;
}

/* Accent top line */
.deploy-card-accent {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.deploy-card-accent--free { background: linear-gradient(90deg, #374151, #4b5563); }
.deploy-card-accent--paid { background: var(--gradient-primary); }

/* Recommended badge */
.deploy-recommended-badge {
    position: absolute;
    top: 1rem; right: 1rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.2);
    color: #e9d5ff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Icon */
.deploy-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.6rem;
}
.deploy-card-icon--free {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.deploy-card-icon--paid {
    background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.15));
    border: 1px solid rgba(255,255,255,0.25);
    color: var(--primary-light);
}

/* Label & title */
.deploy-card-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.deploy-card h3 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

/* Price */
.deploy-price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 0.55rem;
}
.deploy-price-free {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.deploy-price-amount {
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.deploy-price-unit {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Description */
.deploy-card > p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 0.7rem;
}

/* Specs grid */
.deploy-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 0.8rem;
}
.deploy-spec-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.deploy-spec-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.deploy-spec-val {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
}

/* Features list */
.deploy-features {
    list-style: none;
    padding: 0;
    margin: 0 0 0.8rem 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.deploy-features li {
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}
.deploy-feat-icon {
    width: 17px;
    height: 17px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 700;
}
.deploy-feat-icon--yes { background: rgba(255,255,255,0.15); color: #cfcfcf; }
.deploy-feat-icon--no  { background: rgba(255, 255, 255, 0.12);  color: #a1a1aa; }

/* Divider */
.deploy-card-divider {
    height: 1px;
    background: var(--border);
    margin-bottom: 0.8rem;
}

/* Buttons */
.deploy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s, transform 0.15s;
    letter-spacing: 0.01em;
}
.deploy-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.deploy-btn--outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.deploy-btn--grad {
    background: var(--forge-accent-gradient, linear-gradient(135deg, #f5f5f5 0%, #e5e7eb 40%, #cfcfcf 100%));
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(78, 58, 190, 0.45);
}
.deploy-btn-hint {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.deploy-faq {
    margin-top: 1rem;
    display: grid;
    gap: 0.55rem;
}

.deploy-faq h3 {
    margin-bottom: 0.3rem;
    font-size: 1.02rem;
}

.deploy-faq details {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    overflow: hidden;
}

.deploy-faq summary {
    list-style: none;
    cursor: pointer;
    padding: 0.85rem 1rem;
    font-weight: 600;
    position: relative;
}

.deploy-faq summary::-webkit-details-marker {
    display: none;
}

.deploy-faq summary::after {
    content: '+';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.deploy-faq details[open] summary::after {
    content: '−';
}

.deploy-faq details p {
    padding: 0 1rem 0.9rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

/* Info strip */
.deploy-info-strip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}
.deploy-info-strip-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ========================================
   MODAL
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

/* screen-specific override: project modals are wider than the shared modal base */
.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--surface-light);
    color: var(--text);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--surface-light);
    border-radius: var(--radius-md);
}

.modal-info h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.modal-info ol {
    padding-left: 1.5rem;
}

.modal-info li {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.modal-info code {
    padding: 0.25rem 0.5rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--primary);
}

/* File List */
.files-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.file-item:hover {
    background: var(--surface);
    border-color: var(--primary);
}

.file-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

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

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(255, 255, 255, 0.4);
}

/* ========================================
   NOTIFICATIONS
   ======================================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-color: var(--success);
    color: var(--success);
}

.notification-error {
    border-color: var(--error);
    color: var(--error);
}

.notification-info {
    border-color: #d4d4d8;
    color: #d4d4d8;
}

.notification svg {
    flex-shrink: 0;
}

/* ========================================
   USER DROPDOWN
   ======================================== */

.user-dropdown {
    position: relative;
}

.user-avatar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-avatar:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar img {
    width: 32px;
    height: 32px;
    border: 2px solid var(--primary);
    border-radius: 50%;
}

.user-avatar svg {
    opacity: 0.5;
    transition: transform 0.3s ease;
}

.user-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s ease;
}

.user-menu a:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.user-menu a:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.user-menu a:hover {
    background: var(--surface-light);
}

/* ========================================
   BUTTONS (DODATKOWE)
   ======================================== */

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-back:hover {
    background: var(--surface-light);
    color: var(--text);
    border-color: var(--primary);
}

.btn-back svg {
    flex-shrink: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .panel-sidebar {
        width: 280px;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .panel-layout {
        flex-direction: column;
    }

    .panel-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 400px;
    }

    .panel-content {
        padding: 1rem;
    }

    .config-header {
        flex-direction: column;
        gap: 1rem;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .header-actions button {
        width: 100%;
    }

    .onboarding-flow-header,
    .onboarding-steps {
        grid-template-columns: 1fr;
        display: grid;
    }

    .onboarding-progress-track {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.2rem;
    }

    .flow-step {
        min-width: max-content;
    }

    .onboarding-flow-header {
        display: flex;
        flex-direction: column;
    }

    .tabs-navigation {
        overflow-x: auto;
    }

    .welcome-stats {
        grid-template-columns: 1fr;
    }

    .deploy-choice-stage {
        flex-direction: column;
    }

    .deploy-options {
        grid-template-columns: 1fr;
    }

    .roles-grid {
        grid-template-columns: 1fr;
    }
}
/* ============================================
   V2 ADDITIONS - PROJECT MENU & MODALS
   ======================================== */

.project-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.btn-more {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    padding: 0.25rem;
    color: var(--text-muted);
    flex-shrink: 0;
    line-height: 1;
}

.project-item:hover .btn-more {
    opacity: 1;
}

.btn-more:hover {
    color: var(--text);
    transform: scale(1.1);
}

.project-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.25rem);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    min-width: 200px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.project-menu.active {
    display: block;
    animation: menuSlideIn 0.2s ease;
}

@keyframes menuSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-menu-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

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

.project-menu-item:hover {
    background: var(--surface-light);
}

.project-menu-item.danger {
    color: var(--danger);
}

.project-menu-item.danger:hover {
    background: rgba(255, 255, 255, 0.10);
}

.project-menu-item span:first-child {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.simple-modal-input {
    width: 100%;
    padding: 0.875rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.simple-modal-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--background);
}

.simple-modal-input::placeholder {
    color: var(--text-muted);
}

.server-select-list {
    max-height: 400px;
    overflow-y: auto;
}

.modal-field-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.modal-concept-input {
    resize: vertical;
    min-height: 128px;
}

.modal-actions-spaced {
    margin-top: 1.5rem;
}

.payment-modal-content-wide {
    max-width: 560px;
}

.server-select-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-light);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.server-select-item:hover {
    background: var(--background);
    border-left: 3px solid var(--primary);
}

.server-select-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.server-select-info {
    flex: 1;
    min-width: 0;
}

.server-select-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-select-info p,
.server-select-id {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.server-select-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
}

.deployment-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    backdrop-filter: blur(12px);
    background: rgba(0, 0, 0, 0.82);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.deployment-overlay-card {
    background: #0f0f1a;
    border: 1px solid #2a2a4a;
    border-radius: 24px;
    width: 560px;
    max-width: calc(100% - 2rem);
    padding: 2.5rem 2.25rem;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}

.deployment-overlay-icon {
    font-size: 3.2rem;
    margin-bottom: 1rem;
}

.deployment-overlay-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #d4d4d8;
    margin-bottom: 10px;
}

.deployment-overlay-title {
    color: #ffffff;
    margin: 0 0 0.75rem;
    font-size: 1.65rem;
    font-weight: 800;
}

.deployment-overlay-status {
    color: #e5e7eb;
    margin: 0 0 0.55rem;
    font-size: 1rem;
    font-weight: 700;
}

.deployment-overlay-narrative {
    color: #9ca3af;
    margin: 0 0 1.4rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

.deployment-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.deployment-step {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #9ca3af;
    font-size: 12px;
}

.deployment-step.is-active {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.24);
    color: #e5e7eb;
}

.deployment-log-line {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #d1d5db;
    font-size: 13px;
    line-height: 1.65;
    margin: 0 0 1.5rem;
    text-align: left;
}

.deployment-continue-btn {
    background: linear-gradient(135deg, #ffffff, #e5e7eb);
    color: #ffffff;
    border: none;
    padding: 0.875rem 2.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.45;
}

/* ========================================
   HOTFIX: SIMPLE CHAT + SIMPLE DEPLOY
   ======================================== */
.panel-body {
    height: 100vh;
    overflow: hidden;
}

.panel-layout {
    height: calc(100vh - var(--top-nav-h));
    min-height: 0;
}

.panel-content {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#configScreen {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.tabs-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#tab-ai-generator.active,

.ai-workspace {
    height: 100%;
    min-height: 0;
    border-radius: 12px;
}

.ai-workspace__feed {
    flex: 1;
    min-height: 0;
}

#tab-ai-generator .messages {
    height: 100%;
    max-height: none;
    overflow-y: auto;
}

.deploy-simple {
    max-width: 680px;
    margin: 0 auto;
    padding: 1rem 0.25rem;
}

.deploy-simple h2 {
    margin-bottom: 0.35rem;
}

.deploy-simple .deploy-choice-proof {
    justify-content: flex-start;
    margin: 0.75rem 0 1rem 0;
}

.deploy-btn-main {
    margin-top: 0.2rem;
}

.deploy-btn-secondary {
    margin-top: 0.9rem;
}

/* ========================================
   HOTFIX: AI-ONLY VIEW (restore simple UX)
   ======================================== */
#configScreen .config-header,
#configScreen #scanStatus,
#configScreen #serverContextPanel,
#configScreen #onboardingFlow {
    display: none !important;
}

#configScreen .tabs-content {
    display: block !important;
    height: 100% !important;
    overflow: hidden !important;
}

#configScreen #tab-ai-generator {
    display: block !important;
    height: 100% !important;
}

#configScreen #tab-ai-generator .ai-workspace {
    height: 100% !important;
    min-height: 0 !important;
}

.modal {
    padding: clamp(0.75rem, 2vw, 2rem);
}

/* screen-specific override: mobile panel reduces modal height and radius only on smaller screens */
.modal-content {
    max-height: min(90dvh, 860px);
}

.server-select-list {
    max-height: min(46dvh, 400px);
}

@media (max-width: 768px) {
    .modal {
        padding: 0.75rem;
    }

    .modal-content {
        max-height: calc(100dvh - 1.5rem);
        border-radius: 18px;
    }

    .modal-header {
        padding: 1rem 1.1rem;
    }

    .modal-body {
        padding: 1rem 1.1rem;
    }

    .modal-actions {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .modal-actions .btn-primary,
    .modal-actions .btn-secondary,
    .modal-actions .btn-danger {
        width: 100%;
    }

    .server-select-list {
        max-height: min(42dvh, 320px);
    }

    .project-dropdown {
        min-width: 180px;
        max-width: calc(100vw - 24px);
    }

    .project-menu-wrapper > .btn-assign-server {
        font-size: 0.75rem;
        padding: 0.44rem 0.56rem;
    }

    .deployment-overlay-card {
        width: min(100%, 520px);
        padding: 1.25rem;
        border-radius: 20px;
    }

    .deployment-overlay-title {
        font-size: 1.3rem;
    }

    .deployment-overlay-status {
        font-size: 0.95rem;
    }
}

/* Przyciski w slocie serwera */
.server-select-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-invite-bot {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.75rem;
    background: rgba(88, 101, 242, 0.15);
    color: #7289da;
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-invite-bot:hover {
    background: rgba(88, 101, 242, 0.3);
    border-color: #7289da;
    color: #ffffff;
}

.btn-create-project {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-create-project:hover {
    background: var(--primary-dark, #cfcfcf);
    transform: translateX(2px);
}

.project-unassigned {
    opacity: 0.7;
}

.project-unassigned .project-name::after {
    content: " (nie przypisany)";
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

@media (max-width: 640px) {
    .project-menu {
        left: 0;
        right: 0;
        min-width: auto;
    }

    .server-select-item {
        padding: 0.75rem;
    }

    .server-select-icon {
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   SIMPLIFIED SIDEBAR V2 - ZAOKRĄGLONE ROGI I KOLORY
   ======================================== */

.sidebar-header-simple {
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header-simple h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}

.projects-list-simple {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    min-height: 200px;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
}

.project-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--surface-light);
    border-radius: 12px;  /* ZAOKRĄGLONE ROGI */
    border-left: 4px solid transparent;  /* Kolor statusu */
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.project-item:hover {
    background: var(--background);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.project-item.active {
    background: var(--background);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.project-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.9375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

.btn-add-project {
    width: 100%;
    padding: 0.875rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-add-project:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.4);
}

.btn-add-project:active {
    transform: translateY(0);
}

.empty-state-simple {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Project delete button (kosz) */
.project-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.btn-delete-project {
    background: none;
    border: none;
    font-size: 1.125rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    padding: 0.25rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.project-item:hover .btn-delete-project {
    opacity: 1;
}

.btn-delete-project:hover {
    color: var(--error);
    transform: scale(1.15);
}

/* Loading state for projects */
.projects-list-simple .loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 1rem;
}

.projects-list-simple .loading-state .spinner {
    width: 32px;
    height: 32px;
}


/* ============================================
   FIX HORIZONTAL SCROLLBAR
   ======================================== */

body, html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}


/* ============================================
   AI GENERATOR - NEW STYLES FROM KOKOTESTY
   ======================================== */

.chat-header-eyebrow {
  font-size:0.78rem;
  font-weight:700;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:#d8b4fe;
  margin-bottom:0.45rem;
}

.ai-vision-preview,
.ai-scan-snapshot {
  display:flex;
  flex-direction:column;
  gap:0.75rem;
}

.ai-vision-placeholder,
.ai-scan-snapshot-empty {
  color:var(--text-muted);
  line-height:1.6;
  font-size:0.92rem;
}

.ai-preview-bot-name {
  font-size:1.05rem;
  font-weight:700;
  color:var(--text);
}

.ai-preview-bot-desc {
  color:var(--text-muted);
  font-size:0.92rem;
  line-height:1.6;
}

.ai-preview-pill-row,
.ai-scan-stat-row {
  display:flex;
  gap:0.5rem;
  flex-wrap:wrap;
}

.ai-preview-pill,
.ai-scan-stat {
  display:inline-flex;
  align-items:center;
  padding:0.45rem 0.7rem;
  border-radius:999px;
  font-size:0.8rem;
  border:1px solid var(--border);
  background:rgba(255,255,255,0.03);
  color:var(--text-muted);
}

.ai-preview-feature-list {
  display:flex;
  flex-direction:column;
  gap:0.55rem;
}

.ai-preview-feature {
  display:flex;
  gap:0.55rem;
  color:var(--text);
  font-size:0.9rem;
}

.ai-preview-feature::before {
  content:'•';
  color:#cfcfcf;
}

.ai-workspace.is-generating .ai-workspace__feed,
.ai-workspace.is-generating .ai-workspace__quick-prompts,
.ai-workspace.is-generating .ai-workspace__composer,
.ai-workspace.is-generating .ai-workspace__actions {
  display: none;
}

.ai-generator-busy-screen {
  flex: 1;
  min-height: 420px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.8rem;
  background: linear-gradient(180deg, rgba(116, 122, 139, 0.18), rgba(89, 96, 116, 0.3));
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid var(--forge-overlay-white-08);
}

.ai-workspace.is-generating .ai-generator-busy-screen {
  display: flex !important;
}

.ai-generator-busy-gif {
  width: min(280px, 62%);
  max-height: 220px;
  object-fit: contain;
  border-radius: 12px;
}

.ai-generator-busy-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--forge-text-strong);
}

.ai-generator-busy-detail {
  font-size: 0.9rem;
  color: #d4d8e3;
  text-align: center;
  max-width: 620px;
  line-height: 1.5;
  padding: 0 1rem;
}

.chat-header {
  padding:1.1rem 1.25rem 1rem;
  border-bottom:1px solid var(--border);
  flex-shrink:0;
}

.chat-header--studio {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
}

.chat-header h2 { font-size:1.3rem; font-weight:700; color:var(--text); margin-bottom:0.3rem; }
.chat-header p { font-size:0.92rem; color:var(--text-muted); line-height:1.55; }

.chat-header-badges {
  display:flex;
  gap:0.5rem;
  flex-wrap:wrap;
}

.chat-badge {
  display:inline-flex;
  align-items:center;
  padding:0.42rem 0.7rem;
  border-radius:999px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.06);
  color:var(--text-muted);
  font-size:0.78rem;
  white-space:nowrap;
}

.chat-body {
  position:relative;
  flex:1;
  min-height:0;
  overflow:hidden;
  background:
    radial-gradient(circle at top center, rgba(255,255,255,0.06) 0%, transparent 35%),
    linear-gradient(180deg, rgba(11,11,19,0.35) 0%, transparent 100%);
}

.ai-empty-state {
  height: 100%;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 1.25rem;
}

.ai-empty-state h3 {
  font-size: 1.28rem;
  margin: 0;
  color: var(--forge-text-strong);
}

.ai-empty-state p {
  margin: 0;
  max-width: 620px;
  color: var(--text-muted);
  line-height: 1.55;
}

.messages {
  flex:1;
  height:100%;
  overflow-y:auto;
  padding:1rem 1rem 7.5rem;
  display:flex;
  flex-direction:column;
  gap:0.8rem;
  scroll-behavior:smooth;
}
.messages::-webkit-scrollbar { width:3px; }
.messages::-webkit-scrollbar-thumb { background:var(--border); border-radius:4px; }

.msg { display:flex; gap:0.55rem; animation:fadeIn 0.2s ease; }
.msg.user { flex-direction:row-reverse; }
@keyframes fadeIn { from { opacity:0; transform:translateY(3px); } to { opacity:1; transform:none; } }

.msg-avatar {
  width:34px; height:34px;
  border-radius:50%;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:0.78rem;
  font-weight:700;
  margin-top:2px;
  background:var(--forge-accent-gradient);
  color:white;
}
.msg.user .msg-avatar { background:var(--surface-light); color:var(--text-muted); }

.msg-bubble {
  max-width:85%;
  padding:0.8rem 1rem;
  border-radius:14px;
  font-size:0.92rem;
  line-height:1.6;
}
.msg.ai .msg-bubble { background:rgba(255,255,255,0.04); border:1px solid rgba(255,255,255,0.07); color:var(--text); border-bottom-left-radius:4px; }
.msg.user .msg-bubble { background:linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.08)); border:1px solid rgba(255,255,255,0.14); color:var(--forge-text-strong); border-bottom-right-radius:4px; }

.typing-dots {
  display:flex; gap:4px; align-items:center; padding:6px 0;
}
.typing-dots span {
  width:6px; height:6px;
  border-radius:50%;
  background:var(--text-muted);
  animation:bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay:0.2s; }
.typing-dots span:nth-child(3) { animation-delay:0.4s; }
@keyframes bounce { 0%,60%,100% { transform:translateY(0); } 30% { transform:translateY(-5px); } }

.concept-card {
  background:rgba(255, 255, 255, 0.08);
  border:1px solid rgba(255, 255, 255, 0.32);
  border-radius:14px;
  padding:1rem;
  font-size:0.9rem;
  line-height:1.6;
  margin:0.45rem 0;
}
.concept-card-title { color:var(--success); font-weight:700; font-size:1rem; margin-bottom:0.75rem; }
.concept-card-name { color:var(--text); font-size:1rem; font-weight:700; margin-bottom:0.35rem; }
.concept-card-desc { color:var(--text-muted); font-size:0.88rem; margin-bottom:0.75rem; }
.concept-feature { display:flex; gap:0.4rem; margin-bottom:0.25rem; font-size:0.88rem; color:var(--text); }
.concept-feature::before { content:'✓'; color:var(--success); font-size:0.8rem; flex-shrink:0; margin-top:1px; }
.concept-card-actions { margin-top: 1rem; display: flex; justify-content: flex-start; }
.concept-card-actions .deploy-btn { min-height: 44px; }
.concept-approve-btn {
  display:block;
  width:100%;
  margin-top:1rem;
  padding:0.78rem 0.9rem;
  background:linear-gradient(135deg, #cfcfcf, #a1a1aa);
  border:none;
  border-radius:10px;
  color:#fff;
  font-size:0.92rem;
  font-weight:700;
  cursor:pointer;
  transition:opacity 0.2s;
}
.concept-approve-btn:hover { opacity:0.88; }
.concept-approve-btn:disabled { opacity:0.35; cursor:default; }

.missing-card {
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255, 255, 255, 0.28);
  border-radius:14px;
  padding:1rem;
  font-size:0.9rem;
  margin:0.45rem 0;
}
.missing-card-title { color:var(--error); font-weight:700; margin-bottom:0.6rem; font-size:0.96rem; }
.missing-item { color:var(--text); font-size:0.86rem; margin-bottom:0.25rem; }
.missing-item::before { content:'• '; color:var(--error); margin-right:5px; }

.chat-input-wrap {
  position:absolute;
  left:0.85rem;
  right:0.85rem;
  bottom:0.85rem;
  z-index:2;
  padding:0.9rem;
  display:flex;
  align-items:flex-end;
  gap:0.55rem;
  border:1px solid rgba(167,139,250,0.24);
  border-radius:18px;
  background:rgba(13,13,24,0.88);
  backdrop-filter:blur(18px);
  box-shadow:0 18px 40px rgba(0,0,0,0.32);
}
.chat-panel textarea {
  flex:1;
  background:transparent;
  border:none;
  border-radius:0;
  color:var(--text);
  font-family:inherit;
  font-size:0.92rem;
  padding:0.55rem 0.25rem 0.55rem 0.4rem;
  resize:none;
  outline:none;
  max-height:150px;
  min-height:62px;
  line-height: 1.45;
}
.chat-panel textarea:focus { border-color:transparent; }
.chat-panel textarea::placeholder { color:var(--text-muted); }
.send-btn {
  background:var(--forge-accent-gradient);
  border:none;
  border-radius:12px;
  color:#fff;
  width:48px;
  height:48px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  transition:opacity 0.2s;
}
.send-btn:hover { opacity:0.88; }
.send-btn:disabled { opacity:0.3; cursor:default; }
.send-btn svg { width:18px; height:18px; }

.chat-footer {
  padding:0.75rem 0.85rem 0.9rem;
  border-top:1px solid var(--border);
  display:flex;
  align-items:center;
  gap:0.75rem;
  flex-shrink:0;
  background:rgba(255,255,255,0.02);
}
.msg-counter {
  font-size:0.82rem;
  color:var(--text-muted);
  flex-shrink:0;
}
.msg-counter span { color:var(--primary-light); font-weight:700; }
.finalize-btn {
  flex:1;
  padding:0.78rem 1rem;
  background: rgba(29, 28, 40, 0.85);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:10px;
  color:#c5c7d3;
  font-size:0.88rem;
  font-weight:700;
  cursor:pointer;
  transition:all 0.2s;
}
.finalize-btn:not(:disabled):hover { background:var(--primary); color:white; }
.finalize-btn:not(:disabled) {
  background: var(--forge-accent-gradient);
  border-color: rgba(167,139,250,0.42);
  color: #f5f3ff;
}
.finalize-btn:disabled { opacity:1; cursor:not-allowed; filter: grayscale(0.12); }

.ai-generator-status-bar {
  padding:0.95rem 1.1rem 1rem;
  background: color-mix(in srgb, var(--accent-soft) 56%, var(--surface-0));
  border-bottom:1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  display:flex;
  flex-direction:column;
  gap:0.8rem;
}

.ai-generator-status-bar .phases {
  width:100%;
  justify-content:flex-start;
  flex-wrap:wrap;
}

.ai-status-live {
  display:flex;
  flex-direction:column;
  gap:0.2rem;
}

.ai-status-live-copy {
  color: var(--text-0);
  font-size:0.92rem;
  font-weight:700;
}

.ai-status-live-meta {
  color:var(--text-muted);
  font-size:0.82rem;
  line-height:1.5;
}

#tab-ai-generator {
  padding:2rem;
  display:flex;
  flex-direction:column;
  gap:1.5rem;
}

/* General pipeline phases (copied from kokotesty.html topbar) */
.phases {
  display:flex;
  align-items:center;
  gap:0.35rem;
  font-size:0.72rem;
}
.phase-item {
  display:flex;
  align-items:center;
  gap:0.3rem;
  color:#374151;
  transition:color 0.3s;
}
.phase-item.active { color:var(--primary); }
.phase-item.done   { color:var(--success); }
.phase-dot {
  width:7px; height:7px;
  border-radius:50%;
  background:var(--border);
  transition:all 0.3s;
  flex-shrink:0;
}
.phase-item.active .phase-dot { background:var(--primary); box-shadow:0 0 5px color-mix(in srgb, var(--primary-light) 72%, transparent); }
.phase-item.done   .phase-dot { background:var(--success); }
.phase-sep { color:var(--border); font-size:0.6rem; }

#tab-ai-generator .chat-panel {
  width: 100%;
  min-height: 400px;
}

#tab-ai-generator .messages {
  flex: 1;
  min-height: 220px;
}

#tab-ai-generator .chat-input-wrap {
  margin-top:0;
}

#tab-ai-generator .msg-bubble code {
    background: rgba(var(--primary-rgb), 0.1);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.9em;
    color: var(--primary-light);
}

#tab-ai-generator .concept-card-title, #tab-ai-generator .missing-card-title {
    font-size: 1rem; /* Adjust font size */
}

#tab-ai-generator .concept-card {
    border-color: rgba(var(--success-rgb), 0.4);
}

#tab-ai-generator .missing-card {
    border-color: rgba(var(--error-rgb), 0.4);
}

@media (max-width: 1100px) {
  .ai-studio {
    grid-template-columns:1fr;
  }

  .chat-panel {
    height:min(78vh, 760px);
    min-height:560px;
  }
}

@media (max-width: 768px) {
  #tab-ai-generator {
    padding:1rem;
  }

  .chat-header--studio {
    flex-direction:column;
  }

  .chat-header-badges {
    width:100%;
  }

  .chat-panel {
    height:72vh;
    min-height:520px;
  }

  .messages {
    padding:0.9rem 0.9rem 8.5rem;
  }

  .chat-input-wrap {
    left:0.7rem;
    right:0.7rem;
    bottom:0.7rem;
    padding:0.65rem;
  }

  .chat-footer {
    flex-direction:column;
    align-items:stretch;
  }

  .msg-counter {
    text-align:center;
  }
}

/* ========================================
   CONFIG PANEL REDESIGN - MATCH HOSTING
   ======================================== */

body.panel-body {
  background:
    var(--forge-scene-radial-top-left),
    var(--forge-scene-radial-top-right),
    var(--forge-scene-radial-bottom),
    var(--forge-scene-bg-gradient);
  color: var(--text);
}

body.panel-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--forge-scene-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--forge-scene-grid-line) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: var(--forge-scene-grid-mask);
  z-index: 0;
}

.panel-layout,
.panel-sidebar,
.panel-content,
.config-screen,
.choice-screen,
.welcome-screen {
  position: relative;
  z-index: 1;
}

.panel-layout {
  max-width: 1600px;
  margin: 20px auto 0;
  padding: 0 24px 28px;
  gap: 20px;
  align-items: flex-start;
}

.panel-sidebar {
  width: 332px;
  border-radius: 28px;
  border: 1px solid var(--forge-border-base);
  background:
    var(--forge-glass-surface-strong),
    var(--forge-glass-accent-wash);
  box-shadow:
    0 28px 80px var(--forge-overlay-black-40),
    inset 0 1px 0 var(--forge-overlay-white-05);
  backdrop-filter: blur(18px);
  padding: 22px;
}

.sidebar-header-simple {
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--forge-overlay-white-08);
}

.sidebar-header-simple h2 {
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--forge-text-strong);
}

.projects-list-simple {
  gap: 10px;
  padding-right: 4px;
  overflow-x: hidden;
}

.projects-list-simple::-webkit-scrollbar {
  width: 8px;
}

.projects-list-simple::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
}

.project-item {
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.05);
  border-left: none;
  background:
    var(--forge-glass-card-bg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
  min-height: 64px;
}

.project-item:hover {
  background:
    var(--forge-glass-card-hover);
  transform: translateX(0) translateY(-1px);
  border-color: rgba(255,255,255,0.08);
  box-shadow:
    0 12px 24px rgba(0,0,0,0.22),
    inset 0 1px 0 var(--forge-overlay-white-05);
}

.project-item.active {
  background:
    var(--forge-glass-card-active);
  border-color: rgba(196,181,253,0.18);
  box-shadow:
    0 16px 34px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.07);
}

.project-name {
  color: var(--forge-text-base);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.project-side-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
}

.project-insight-wrap {
    position: relative;
}

.btn-project-insight {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #ffffff;
    color: #71717a;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-project-insight:hover {
    border-color: #ffffff;
    color: #cfcfcf;
}

.project-insight-popover {
    position: fixed;
    left: 0;
    top: 0;
    width: 290px;
    max-width: min(290px, 65vw);
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
    z-index: 2147483647;
    padding: 10px;
}

#serverInsightLayer {
    position: fixed !important;
    z-index: 2147483647 !important;
    pointer-events: auto;
}

.project-insight-loading {
    font-size: 0.82rem;
    color: #a1a1aa;
}

.insight-title {
    font-weight: 700;
    color: #111111;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.insight-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 0.8rem;
    color: #52525b;
}

.insight-label {
    color: #a1a1aa;
}

.insight-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.insight-facts span {
    font-size: 0.73rem;
    padding: 3px 7px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #71717a;
}

.insight-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.insight-chip {
    font-size: 0.72rem;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(91, 54, 218, 0.08);
    border: 1px solid rgba(91, 54, 218, 0.18);
    color: #4c1d95;
}

.insight-muted {
    font-size: 0.75rem;
    color: #a1a1aa;
}

.insight-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.insight-btn {
    font-size: 0.74rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #ffffff;
    color: #52525b;
    padding: 5px 10px;
    text-decoration: none;
    cursor: pointer;
}

.insight-btn-primary {
    border-color: rgba(91, 54, 218, 0.35);
    background: rgba(91, 54, 218, 0.09);
    color: #4c1d95;
}

.project-text {
  min-width: 0;
  flex: 1;
}

.project-guild-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.26);
}

.project-guild-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-guild-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #e9d5ff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.4));
}

.project-name {
  font-size: 0.98rem;
  line-height: 1.2;
}

.project-status-line {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.72);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-menu-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.btn-project-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--forge-text-soft);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-project-menu:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.project-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  left: auto;
  min-width: 220px;
  max-width: min(280px, calc(100vw - 32px));
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #1b2235;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  z-index: 60;
}

.project-dropdown.active {
  display: block;
}

.project-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.72rem 0.92rem;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  opacity: 1;
}

.project-dropdown button:last-child {
  border-bottom: 0;
}

.project-dropdown button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.project-dropdown button.danger {
  color: #fca5a5;
}

.project-dropdown button.danger:hover {
  color: #fecaca;
  background: rgba(255, 255, 255, 0.14);
}

.project-dropdown .btn-delete-project,
.project-dropdown .btn-rename-project,
.project-dropdown .btn-assign-server {
  opacity: 1;
  transform: none;
  margin: 0;
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.72rem 0.92rem;
  text-align: left;
  justify-content: flex-start;
  gap: 0.55rem;
}

.project-menu-wrapper > .btn-assign-server {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--cfg-border, rgba(255, 255, 255, 0.14));
  background: var(--cfg-surface-2, rgba(255, 255, 255, 0.06));
  color: var(--cfg-text, #e5e7eb);
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.1;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.project-menu-wrapper > .btn-assign-server:hover {
  background: var(--cfg-accent-soft, rgba(255, 255, 255, 0.2));
  border-color: var(--cfg-accent, #e5e7eb);
  color: var(--cfg-text, #e5e7eb);
}


.btn-add-project {
  border-radius: 16px;
  background: var(--forge-accent-gradient, linear-gradient(135deg, #f5f5f5 0%, #e5e7eb 40%, #cfcfcf 100%));
  box-shadow: 0 18px 38px rgba(78, 58, 190, 0.26);
}

.btn-add-project:hover {
  box-shadow: 0 20px 42px rgba(255,255,255,0.24);
}


#welcomeScreen,
#choiceScreen,
#configScreen {
  border-radius: 28px;
  border: 1px solid var(--forge-border-base);
  background:
    var(--forge-glass-surface-strong);
  box-shadow:
    0 28px 82px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 var(--forge-overlay-white-05);
  backdrop-filter: blur(18px);
}

.welcome-screen,
.choice-screen {
  min-height: 720px;
}

.welcome-content,
.choice-content {
  max-width: 760px;
  padding: 28px;
}

.welcome-content h1,
.choice-content h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  letter-spacing: -0.04em;
}

.welcome-content p,
.choice-description {
  color: var(--text-muted);
  font-size: 1.02rem;
}

.choice-card {
  border-radius: 24px;
  border: 1px solid rgba(191,170,255,0.1);
  background:
    var(--forge-glass-card-bg);
  box-shadow:
    0 22px 48px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.choice-card:hover {
  transform: translateY(-3px);
  border-color: rgba(196,181,253,0.26);
}


.config-header {
  padding: 24px 26px;
  border-radius: 24px;
  border: 1px solid rgba(191,170,255,0.1);
  background:
    var(--forge-glass-header-bg),
    var(--forge-glass-header-accent);
  box-shadow:
    0 24px 56px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 var(--forge-overlay-white-05);
  margin-bottom: 18px;
}

.config-title h1 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  letter-spacing: -0.03em;
}

.server-badges,
#serverInfo {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.server-badges > *,
#serverInfo > * {
  border-radius: 999px;
  border: 1px solid rgba(191,170,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--forge-brand-100);
  padding: 8px 12px;
}

.header-actions {
  padding: 8px;
  border-radius: 18px;
  background: rgba(255,255,255,0.028);
  border: 1px solid rgba(191,170,255,0.08);
}

/* screen-specific override: panel header/config buttons use denser padding and glass CTA treatment */
.header-actions .btn-primary,
.header-actions .btn-secondary {
  border-radius: 14px;
  padding: 12px 18px;
}

.header-actions .btn-primary {
  background: var(--forge-accent-gradient, linear-gradient(135deg, #f5f5f5 0%, #e5e7eb 40%, #cfcfcf 100%));
  box-shadow: 0 16px 34px rgba(255,255,255,0.18);
}

.header-actions .btn-secondary {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(191,170,255,0.12);
  color: var(--forge-text-base);
}

.config-screen .btn-primary,
.config-header .btn-primary,
.modal-actions .btn-primary {
  background: var(--forge-accent-gradient, linear-gradient(135deg, #f5f5f5 0%, #e5e7eb 40%, #cfcfcf 100%));
  box-shadow: 0 16px 34px rgba(255,255,255,0.18);
}

.config-screen .btn-primary:hover,
.config-header .btn-primary:hover,
.modal-actions .btn-primary:hover {
  box-shadow: 0 20px 42px rgba(78, 58, 190, 0.3);
}

.scan-status,
.onboarding-flow,
.tabs-navigation,
.ai-vision-header,
.ai-vision-card,
.chat-panel,
.ai-generator-status-bar,
.deploy-choice-stage,
.deploy-card,
.deploy-info-strip,
.deploy-faq details {
  border-color: rgba(191,170,255,0.08);
  box-shadow:
    0 20px 52px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.onboarding-flow {
  border-radius: 24px;
  background:
    var(--forge-glass-surface-soft);
}

.onboarding-step {
  border-radius: 18px;
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.onboarding-step.is-active {
  background: linear-gradient(135deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
}

.tabs-navigation {
  padding: 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: none;
}

.tab-btn {
  border-radius: 10px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--forge-ink-300);
  font-weight: 500;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--forge-text-soft);
  box-shadow: none;
}

.tab-btn:hover {
  background: rgba(255,255,255,0.04);
  color: var(--forge-text-soft);
}

.ai-vision-header,
.ai-vision-card,
.chat-panel {
  border-radius: 24px;
}

.ai-vision-header {
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.12) 0%, transparent 36%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.08) 0%, transparent 40%),
    linear-gradient(180deg, var(--forge-overlay-white-04), var(--forge-overlay-white-02));
  border: 1px solid rgba(255,255,255,0.08);
}

.ai-vision-card,
.deploy-card,
.deploy-info-strip,
.deploy-faq details {
  background:
    var(--forge-glass-surface-soft);
}

.chat-panel {
  background:
    var(--forge-glass-surface-hero);
}

.chat-header {
  border-bottom-color: rgba(255,255,255,0.08);
}

.chat-body {
  background:
    radial-gradient(circle at top center, rgba(255,255,255,0.06) 0%, transparent 35%),
    radial-gradient(circle at bottom right, rgba(255,255,255,0.04) 0%, transparent 40%),
    linear-gradient(180deg, rgba(11,11,19,0.35) 0%, transparent 100%);
}

.chat-input-wrap {
  background:
    linear-gradient(180deg, rgba(11, 14, 25, 0), rgba(11, 14, 25, 0.78) 18%, rgba(11,14,25,0.96) 100%);
}

#aiGeneratorChatInput {
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.send-btn,
.finalize-btn,
.deploy-btn--grad {
  background: var(--forge-accent-gradient, linear-gradient(135deg, #f5f5f5 0%, #e5e7eb 40%, #cfcfcf 100%));
  box-shadow: 0 16px 34px rgba(255,255,255,0.18);
}

.deploy-header h2,
.choice-card h3,
.config-title h1,
.ai-vision-header h2,
.chat-header h2 {
  letter-spacing: -0.03em;
}

.deploy-choice-stage,
.deploy-info-strip {
  border-radius: 20px;
}

.deploy-card {
  border-radius: 24px;
}

.deploy-card:hover {
  transform: translateY(-3px);
}

.deploy-card--featured::before {
  background: linear-gradient(135deg, rgba(255,255,255,0.07) 0%, rgba(255, 255, 255, 0.08) 100%);
}

.deploy-btn--outline {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.08);
}

/* screen-specific override: panel modals and payment modal share the glass surface treatment */
.modal-content,
.payment-modal-content {
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(18, 22, 38, 0.96), rgba(13, 17, 32, 0.98));
  box-shadow:
    0 28px 80px rgba(2, 8, 22, 0.44),
    inset 0 1px 0 var(--forge-overlay-white-05);
}

.modal-header,
.payment-modal-header,
.payment-modal-footer {
  border-color: rgba(255,255,255,0.08);
}

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

#tab-ai-generator {
  display: block;
}

.ai-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 640px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--forge-ink-775);
  padding: 16px;
  box-shadow: 0 10px 22px rgba(2, 8, 22, 0.3);
}

.ai-workspace__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-workspace__header h2 {
  margin: 0;
  color: var(--forge-text-base);
  font-size: 1.12rem;
}

.ai-workspace__statusline {
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--forge-ink-725);
  border-radius: 12px;
  padding: 8px 10px;
  display: grid;
  gap: 2px;
}

.ai-conversation-step {
  color: #c9d0ee;
  font-size: 0.8rem;
}

.ai-workspace__feed {
  flex: 1 1 auto;
  min-height: 360px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--forge-ink-725);
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.ai-inline-concept-preview {
  margin-top: 8px;
}

.ai-inline-preview-card {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--forge-ink-775);
  padding: 10px 12px;
}

.ai-inline-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.ai-inline-action-row .deploy-btn {
  flex: 1 1 220px;
  margin-top: 0;
}

.ai-workspace__quick-prompts {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ai-workspace__chip {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: var(--forge-ink-725);
  color: var(--forge-ink-225);
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.ai-workspace__chip:hover {
  border-color: rgba(139,92,246,0.55);
  background: rgba(139,92,246,0.14);
}

.ai-workspace__composer {
  flex: 0 0 auto;
  min-height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--forge-ink-725);
  padding: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: end;
}

#aiGeneratorChatInput {
  min-height: 56px;
  max-height: 140px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--forge-text-base);
  padding: 10px 12px;
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: var(--forge-brand-500);
  color: #ffffff;
  cursor: pointer;
}

.ai-workspace__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
}

.msg-counter {
  color: var(--forge-text-muted);
  font-size: 0.82rem;
}

.finalize-btn {
  min-height: 44px;
  border-radius: 10px;
  border: none;
  padding: 8px 14px;
  background: var(--forge-brand-500);
  color: #ffffff;
}

.ai-empty-examples {
  display: grid;
  gap: 8px;
  margin: 8px 0;
}

.ai-empty-hint {
  color: var(--forge-text-muted);
  font-size: 0.79rem;
}

.ai-retry-btn {
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--forge-ink-775);
  color: #e9ecff;
  border-radius: 10px;
  padding: 6px 10px;
}

/* Guided configuration workspace */


.configuration-project-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cfg-text);
}

.configuration-project-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.2rem;
  color: var(--cfg-muted);
  font-size: 0.86rem;
}


.configuration-workspace-grid {
  display: block;
}

.configuration-main-workspace {
  min-width: 0;
}

.configuration-context-badge {
  border-radius: 999px;
  border: 1px solid var(--cfg-border);
  padding: 0.16rem 0.5rem;
  font-size: 0.74rem;
  color: var(--cfg-muted);
}

.configuration-context-badge.is-ok {
  color: #a7f3d0;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
}

.configuration-context-badge.is-warn {
  color: #fde68a;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.10);
}

.configuration-inline-progress {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
  color: var(--cfg-muted);
  font-size: 0.74rem;
}

.configuration-inline-step {
  border-radius: 999px;
  padding: 0.12rem 0.42rem;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}

.configuration-inline-step.is-done {
  color: #a7f3d0;
  border-color: rgba(255, 255, 255, 0.35);
}

.configuration-inline-step.is-current {
  color: #e5e7eb;
  border-color: rgba(255,255,255,0.48);
  background: rgba(255,255,255,0.16);
}

.configuration-advanced-body {
  overflow: auto;
  max-height: calc(100vh - 120px);
  padding: 0.85rem;
}


.configuration-advanced-drawer {
  width: min(560px, 100%);
  height: 100%;
  background: linear-gradient(180deg, rgba(19, 23, 42, 0.98), rgba(10, 14, 28, 1));
  border-left: 1px solid rgba(255,255,255,0.08);
  padding: 0.8rem 0.8rem 1rem;
}

.configuration-advanced-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.configuration-advanced-drawer-header h3 {
  margin: 0;
  color: #ece8ff;
}

.legacy-config-block {
  margin: 0.85rem;
}

.legacy-config-block.config-header {
  margin-top: 0.25rem;
}

/* Simplified configuration workspace */


.configuration-action-bar {
  position: static;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--forge-glass-surface-strong);
  border: 1px solid var(--forge-overlay-white-08);
  display: grid;
  gap: 10px;
  box-shadow: 0 10px 28px rgba(3, 6, 14, 0.28);
}

.configuration-simple-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.configuration-action-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.configuration-primary-cta {
  min-width: 200px;
}

.configuration-simple-header h2 {
  margin: 0;
  color: var(--forge-text-strong);
  font-size: 22px;
  line-height: 1.2;
}

.configuration-simple-header p {
  margin: 6px 0 0;
  color: var(--forge-text-muted);
  font-size: 14px;
}

.configuration-simplified {
  max-width: 720px;
  display: grid;
  gap: 12px;
}

.config-simple-card {
  background: var(--forge-ink-825);
  border: 1px solid var(--forge-overlay-white-08);
  border-radius: 14px;
  padding: 14px;
}

.config-vision-starter {
  display: grid;
  gap: 14px;
}

.config-vision-starter-copy h3 {
  margin-bottom: 8px;
}

.config-vision-main {
  display: grid;
  gap: 14px;
}

.config-vision-input {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--forge-surface-input);
  color: var(--forge-ink-175);
  padding: 12px 14px;
  line-height: 1.5;
}

.config-vision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

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

.config-vision-preset {
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--forge-overlay-white-08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(17, 22, 42, 0.88));
  color: var(--forge-ink-225);
  display: grid;
  gap: 6px;
  cursor: pointer;
}

.config-vision-preset strong {
  font-size: 15px;
}

.config-vision-preset span {
  color: var(--forge-text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.config-vision-eyebrow {
  color: var(--forge-brand-300);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.configuration-context-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 6px;
}

.configuration-inline-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.configuration-inline-step {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--forge-ink-350);
  font-size: 13px;
  border: 1px solid var(--forge-overlay-white-08);
}

.configuration-inline-step.is-done {
  background: rgba(255, 255, 255, 0.14);
  color: var(--forge-emerald-300);
  border-color: rgba(255, 255, 255, 0.3);
}

.configuration-inline-step.is-current {
  background: rgba(255, 255, 255, 0.16);
  color: var(--forge-ink-250);
  border-color: rgba(255, 255, 255, 0.35);
}

.configuration-advanced-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.76);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1100;
}

.configuration-advanced-drawer {
  width: min(100%, 560px);
  background: var(--forge-ink-800);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
}

.configuration-advanced-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.configuration-advanced-drawer-header h3 {
  margin: 0;
  color: var(--forge-text-strong);
}

.configuration-advanced-body {
  display: grid;
  gap: 14px;
}

.configuration-advanced-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.config-simple-card h3 {
  margin: 0 0 10px;
  color: var(--forge-ink-200);
  font-size: 16px;
}

.config-simple-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.config-simple-grid label {
  display: grid;
  gap: 6px;
  color: #c6d2ef;
  font-size: 13px;
}

.config-simple-grid input,
.config-simple-grid select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--forge-surface-input);
  color: var(--forge-ink-175);
  border-radius: 10px;
  padding: 10px 12px;
}

.config-simple-muted {
  color: var(--forge-text-muted);
  font-size: 14px;
  margin: 0 0 10px;
}

.config-simple-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d3ddf4;
  font-size: 14px;
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .configuration-simple-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .configuration-simple-header h2 {
    font-size: 19px;
  }

  .configuration-action-cta,
  .config-vision-actions {
    width: 100%;
  }

  .configuration-primary-cta,
  .config-vision-actions .btn-primary,
  .config-vision-actions .btn-secondary,
  .config-vision-actions a {
    width: 100%;
    justify-content: center;
  }

  .config-vision-grid {
    grid-template-columns: 1fr;
  }

  .configuration-advanced-drawer {
    padding: 14px;
  }
}

@media (max-width: 1200px) {
  .panel-layout {
    padding: 0 18px 24px;
  }
}

@media (max-width: 1024px) {
  .panel-layout {
    flex-direction: column;
  }

  .panel-sidebar {
    width: 100%;
  }

  .projects-list-simple {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .ai-workspace {
    min-height: calc(100vh - 120px);
    padding: 12px;
  }

  body.panel-body #configScreen #tab-ai-generator .ai-studio-minimal,
  body.panel-body #configScreen #tab-ai-generator .ai-workspace {
    min-height: auto !important;
    height: auto !important;
  }

  .configuration-action-bar {
    padding: 0.75rem 0.85rem;
    border-radius: 12px;
  }

  .configuration-project-name {
    font-size: 0.92rem;
  }

  .configuration-project-status {
    font-size: 0.78rem;
  }

  .configuration-action-cta {
    width: 100%;
  }

  .configuration-primary-cta {
    flex: 1;
  }

  .configuration-secondary-cta {
    display: none;
  }

  .configuration-action-cta .btn-primary,
  .configuration-action-cta .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .configuration-workspace-grid {
    grid-template-columns: 1fr;
  }

  .configuration-inline-progress {
    display: none;
  }

  .configuration-context-badges {
    gap: 6px;
  }

  .config-screen {
    padding: 18px;
  }

  .config-header {
    padding: 18px;
  }

  .header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .header-actions .btn-primary,
  .header-actions .btn-secondary {
    flex: 1;
    justify-content: center;
  }

  .onboarding-flow {
    padding: 1rem;
    border-radius: 18px;
  }

  .onboarding-flow-header h2 {
    font-size: 1.12rem;
    line-height: 1.25;
  }

  .onboarding-flow-header p {
    font-size: 0.88rem;
  }

  .onboarding-progress-track {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 0.4rem;
  }

  .flow-step {
    scroll-snap-align: start;
    min-height: 40px;
    padding: 0.5rem 0.7rem;
  }

  .flow-step-label {
    font-size: 0.76rem;
  }

  .tabs-navigation {
    padding: 8px;
  }

  .tab-btn {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .project-item {
    padding: 0.78rem 0.9rem;
    gap: 0.55rem;
  }

  .project-main {
    gap: 9px;
  }

  .project-guild-avatar {
    width: 30px;
    height: 30px;
  }

  .project-name {
    font-size: 0.92rem;
  }

  .project-status-line {
    font-size: 11px;
    max-width: 170px;
  }

  .project-unassigned .project-name::after {
    content: "";
  }

  .deploy-options {
    gap: 0.85rem;
  }

  .deploy-btn {
    min-height: 44px;
  }

  .deploy-btn-hint {
    font-size: 0.76rem;
    line-height: 1.35;
  }
}

@media (max-width: 480px) {
  .config-screen {
    padding: 14px;
  }

  .config-header {
    padding: 14px;
    border-radius: 16px;
  }

  .onboarding-step p {
    min-height: auto;
    font-size: 0.84rem;
    line-height: 1.45;
  }

  .project-status-line {
    max-width: 135px;
  }

  .btn-project-menu {
    min-width: 34px;
    min-height: 34px;
  }
}

/* ===== Premium lightweight cleanup overrides ===== */
:root {
  --cfg-bg-base: #0c0f1a;
  --cfg-surface: #121626;
  --cfg-elevated: #191e31;
  --cfg-accent: #e5e7eb;
  --cfg-text: #eff2ff;
  --cfg-muted: #9aa3bf;
  --cfg-border-soft: rgba(255, 255, 255, 0.08);
}

.panel-content {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0;
  overflow: visible;
}

.config-screen {
  padding: 14px;
}



.configuration-action-bar {
  border-radius: 14px;
  background: rgba(18, 22, 38, 0.96);
  border: 1px solid var(--cfg-border-soft);
  box-shadow: 0 8px 22px rgba(3, 6, 14, 0.32);
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}

.configuration-project-name {
  color: var(--cfg-text);
}

.configuration-project-status,
.configuration-inline-progress {
  color: var(--cfg-muted);
}

.configuration-secondary-cta {
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* CANONICAL CONFIGURATION SYSTEM
   Unified with landing theme tokens for both light and dark modes.
   ========================================================= */
body.panel-body.theme-light,
body.panel-body.theme-dark {
  --cfg-bg: var(--background);
  --cfg-surface: var(--surface);
  --cfg-surface-2: var(--surface-light);
  --cfg-layer-1: var(--surface);
  --cfg-layer-2: var(--surface-light);
  --cfg-panel: var(--surface);
  --cfg-panel-soft: var(--surface-light);
  --cfg-border: var(--border);
  --cfg-border-strong: var(--border-strong);
  --cfg-text: var(--text);
  --cfg-text-muted: var(--text-muted);
  --cfg-accent: var(--primary);
  --cfg-accent-soft: var(--accent-soft);
  --cfg-accent-gradient: var(--forge-accent-gradient);
  --cfg-accent-shadow: var(--forge-accent-shadow);
  --cfg-shadow: 0 12px 28px color-mix(in srgb, var(--shadow-color) 24%, transparent);
  --cfg-focus: var(--focus-ring);
}

body.panel-body.theme-light,
body.panel-body.theme-dark {
  background: var(--cfg-bg) !important;
  color: var(--cfg-text) !important;
}

body.panel-body .panel-layout.panel-layout-start {
  display: grid !important;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr) !important;
  gap: 1rem !important;
  height: calc(100vh - 60px) !important;
  overflow: hidden !important;
}

body.panel-body .panel-content.panel-content-start {
  height: calc(100vh - 60px) !important;
  overflow: hidden !important;
  padding: 1rem !important;
}

body.panel-body .panel-start-shell {
  display: grid !important;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr) !important;
  grid-template-areas: 'switcher config' !important;
  gap: 1rem !important;
  align-items: start !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 1680px !important;
  margin: 0 auto !important;
}

body.panel-body .project-switcher-shell {
  grid-area: switcher !important;
  position: sticky !important;
  top: 1rem !important;
  z-index: 5 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.9rem !important;
  padding: 1rem !important;
  max-height: calc(100vh - 82px) !important;
  overflow: hidden !important;
  border: 1px solid var(--cfg-border) !important;
  border-radius: 28px !important;
  background: var(--cfg-layer-1) !important;
  box-shadow: var(--cfg-shadow) !important;
}

body.panel-body .project-switcher-copy {
  display: grid !important;
  gap: 0.45rem !important;
  color: var(--cfg-text) !important;
}

body.panel-body .project-switcher-copy .eyebrow,
body.panel-body .project-switcher-copy p,
body.panel-body .project-switcher-copy .project-switcher-headline h1 {
  color: inherit !important;
}

body.panel-body .project-switcher-headline {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 1rem !important;
}

body.panel-body .btn-add-project {
  width: auto !important;
  min-height: 40px !important;
  padding: 0.62rem 0.92rem !important;
  border-radius: 999px !important;
  background: var(--cfg-accent-gradient) !important;
  border: 1px solid color-mix(in srgb, var(--cfg-accent) 22%, transparent) !important;
  box-shadow: var(--cfg-accent-shadow) !important;
  color: var(--primary-contrast) !important;
  white-space: nowrap !important;
}

body.panel-body .projects-list-simple {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0.6rem !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: min(62vh, calc(100vh - 280px)) !important;
  padding-right: 0.25rem !important;
  margin: 0 !important;
  scroll-snap-type: none !important;
  scrollbar-width: none !important;
}

body.panel-body .projects-list-simple::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
}

body.panel-body .project-item {
  position: relative !important;
  isolation: isolate !important;
  overflow: hidden !important;
  width: 100% !important;
  flex: 0 0 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 56px !important;
  padding: 0.65rem 0.75rem !important;
  border-radius: 20px !important;
  border: 1px solid var(--cfg-border) !important;
  background: var(--cfg-layer-2) !important;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--shadow-color) 10%, transparent) !important;
}

body.panel-body .project-item:hover,
body.panel-body .project-item.active {
  transform: translateY(-1px) !important;
  border-color: color-mix(in srgb, var(--cfg-accent) 34%, var(--cfg-border)) !important;
  background: var(--cfg-layer-1) !important;
}

body.panel-body .project-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  z-index: 0;
  border-radius: 999px;
  background: var(--cfg-accent);
}

body.panel-body .project-main {
  display: flex !important;
  align-items: center !important;
  gap: 0.8rem !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  position: relative !important;
  z-index: 1 !important;
}

body.panel-body .project-text {
  min-width: 0 !important;
  display: grid !important;
  gap: 2px !important;
}

body.panel-body .project-name,
body.panel-body .project-meta,
body.panel-body .sidebar-header-simple h2 {
  color: var(--cfg-text) !important;
}

body.panel-body .project-status-line {
  display: none !important;
}

body.panel-body .project-side-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
  position: relative !important;
  z-index: 3 !important;
}

body.panel-body .project-guild-avatar {
  width: 34px !important;
  height: 34px !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  border: 1px solid color-mix(in srgb, var(--cfg-border) 86%, transparent) !important;
  background: var(--cfg-surface-2) !important;
}

body.panel-body .project-guild-avatar-fallback,
body.panel-body .item-icon-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cfg-accent-gradient);
  color: var(--primary-contrast);
  font-weight: 800;
}

body.panel-body .btn-project-insight,
body.panel-body .btn-project-menu {
  width: 30px !important;
  height: 30px !important;
  border-radius: 10px !important;
  border: 1px solid var(--cfg-border) !important;
  background: var(--cfg-layer-1) !important;
  color: var(--cfg-text) !important;
  position: relative !important;
  z-index: 4 !important;
}

body.panel-body .project-menu-wrapper,
body.panel-body .project-insight-wrap {
  position: relative !important;
  z-index: 4 !important;
}

body.panel-body .project-dropdown,
body.panel-body .project-insight-popover {
  z-index: 20 !important;
}

body.panel-body #configScreen,
body.panel-body .config-screen {
  grid-area: config !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 1px solid var(--cfg-border) !important;
  border-radius: 28px !important;
  background: var(--cfg-panel) !important;
  box-shadow: var(--cfg-shadow) !important;
  overflow: hidden !important;
}

body.panel-body #configScreen .tabs-content {
  display: flex !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 1rem !important;
}

body.panel-body #configScreen .tab-content {
  display: none !important;
  min-height: 0 !important;
}

body.panel-body #configScreen .tab-content.active {
  display: flex !important;
}
body.panel-body #configScreen #tab-ai-generator .ai-studio-briefing {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  min-width: 0 !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-brief-card {
  display: grid !important;
  gap: 8px !important;
  min-width: 0 !important;
  padding: 14px 15px !important;
  border: 1px solid color-mix(in srgb, var(--cfg-border) 90%, transparent) !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cfg-layer-2) 88%, transparent), color-mix(in srgb, var(--cfg-layer-1) 96%, transparent)) !important;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--shadow-color) 10%, transparent) !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-brief-label {
  color: var(--cfg-text-muted) !important;
  font-size: 0.72rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.12em !important;
  font-weight: 700 !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-brief-title {
  color: var(--cfg-text) !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-brief-copy,
body.panel-body #configScreen #tab-ai-generator .ai-studio-brief-pill {
  color: var(--cfg-text-muted) !important;
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-brief-pill {
  justify-self: start !important;
  display: inline-flex !important;
  align-items: center !important;
  min-height: 30px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  border: 1px solid color-mix(in srgb, var(--cfg-accent) 18%, var(--cfg-border)) !important;
  background: color-mix(in srgb, var(--cfg-accent-soft) 34%, var(--cfg-layer-1)) !important;
  color: var(--cfg-text) !important;
  font-weight: 600 !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-brief-copy:empty,
body.panel-body #configScreen #tab-ai-generator .ai-studio-brief-pill:empty,
body.panel-body #configScreen #tab-ai-generator .ai-vision-preview:empty,
body.panel-body #configScreen #tab-ai-generator .ai-selected-resources:empty,
body.panel-body #configScreen #tab-ai-generator .ai-scan-snapshot:empty,
body.panel-body #configScreen #tab-ai-generator .ai-preview-pill-row:empty,
body.panel-body #configScreen #tab-ai-generator .ai-preview-feature-list:empty {
  display: none !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-selected-resources {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-selected-resources:empty {
  display: none !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-selected-resources .ai-resource-chip,
body.panel-body #configScreen #tab-ai-generator .ai-selected-resources .ai-quick-choice {
  min-height: 32px !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-vision-preview {
  display: grid !important;
  gap: 8px !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-scan-snapshot {
  display: grid !important;
  gap: 10px !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-scan-stat-row,
body.panel-body #configScreen #tab-ai-generator .ai-preview-pill-row {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-scan-stat,
body.panel-body #configScreen #tab-ai-generator .ai-preview-pill {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 30px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  border: 1px solid var(--cfg-border) !important;
  background: var(--cfg-layer-1) !important;
  color: var(--cfg-text) !important;
  font-size: 0.82rem !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-preview-feature-list {
  display: grid !important;
  gap: 8px !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-preview-feature {
  display: flex !important;
  gap: 0.5rem !important;
  align-items: flex-start !important;
  color: var(--cfg-text) !important;
  font-size: 0.92rem !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-preview-feature::before {
  content: '•' !important;
  color: var(--cfg-accent) !important;
  font-size: 1rem !important;
  line-height: 1.3 !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-vision-placeholder,
body.panel-body #configScreen #tab-ai-generator .ai-scan-snapshot-empty,
body.panel-body #configScreen #tab-ai-generator .ai-empty-hint {
  color: var(--cfg-text-muted) !important;
  line-height: 1.55 !important;
}


body.panel-body #configScreen #tab-ai-generator {
  flex: 1 1 auto !important;
  flex-direction: column !important;
  gap: 14px !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-minimal,
body.panel-body #configScreen #tab-ai-generator .ai-workspace {
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) auto !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  padding: 16px !important;
  border: 1px solid var(--cfg-border) !important;
  border-radius: 20px !important;
  background: var(--cfg-layer-2) !important;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--shadow-color) 12%, transparent) !important;
  overflow: hidden !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-minimal-header,
body.panel-body #configScreen #tab-ai-generator .ai-workspace__header {
  position: relative !important;
  padding: 2px 2px 8px !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-chat-clear-btn {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  border: 1px solid var(--cfg-border) !important;
  background: var(--cfg-layer-1) !important;
  color: var(--cfg-text) !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-minimal-title,
body.panel-body #configScreen #tab-ai-generator .ai-workspace__header h2 {
  margin: 0 !important;
  font-size: 1.2rem !important;
  font-weight: 800 !important;
  color: var(--cfg-text) !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-minimal-subtitle,
body.panel-body #configScreen #tab-ai-generator .chat-header-eyebrow,
body.panel-body #configScreen #tab-ai-generator .ai-status-live-meta,
body.panel-body #configScreen #tab-ai-generator .ai-conversation-step {
  color: var(--cfg-text-muted) !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-guide {
  display: grid !important;
  gap: 12px !important;
  margin: 4px 0 14px !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-guide__card {
  display: grid !important;
  gap: 8px !important;
  padding: 16px 18px !important;
  border: 1px solid color-mix(in srgb, var(--cfg-accent) 18%, var(--cfg-border)) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--cfg-accent-soft) 38%, transparent), transparent 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--cfg-layer-2) 96%, transparent), color-mix(in srgb, var(--cfg-layer-1) 98%, transparent)) !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-guide__label,
body.panel-body #configScreen #tab-ai-generator .ai-studio-composer-label {
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: var(--cfg-text-muted) !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-guide__card h3 {
  margin: 0 !important;
  color: var(--cfg-text) !important;
  font-size: 1rem !important;
  line-height: 1.35 !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-guide__card p {
  margin: 0 !important;
  color: var(--cfg-text-muted) !important;
  font-size: 0.94rem !important;
  line-height: 1.55 !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-guide__steps {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-guide__step {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 34px !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
  border: 1px solid var(--cfg-border) !important;
  background: var(--cfg-layer-1) !important;
  color: var(--cfg-text) !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-minimal-feed,
body.panel-body #configScreen #tab-ai-generator .ai-workspace__feed {
  min-height: 0 !important;
  display: flex !important;
  flex: 1 1 auto !important;
  padding: 16px !important;
  border: 1px solid var(--cfg-border) !important;
  border-radius: 18px !important;
  background: var(--cfg-layer-1) !important;
  overflow: hidden !important;
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 42%, transparent) !important;
}

body.panel-body #configScreen #tab-ai-generator .messages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: none !important;
  padding: 2px 2px 4px !important;
  scrollbar-gutter: stable both-edges;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-minimal-composer,
body.panel-body #configScreen #tab-ai-generator .ai-workspace__actions {
  margin-top: auto !important;
  padding: 14px 0 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  background: transparent !important;
  border-top: 1px solid var(--cfg-border) !important;
  min-height: 0 !important;
  position: static !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-composer-wrap {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  position: relative !important;
  overflow: visible !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-mention-autocomplete {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: calc(100% + 8px) !important;
  z-index: 50 !important;
  margin: 0 !important;
  max-height: 220px !important;
  overflow-y: auto !important;
  border: 1px solid var(--cfg-border) !important;
  border-radius: 14px !important;
  background: var(--cfg-surface) !important;
  box-shadow: var(--cfg-shadow) !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-minimal-form,
body.panel-body #configScreen #tab-ai-generator #aiChatComposerForm {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  grid-template-areas: 'input send' !important;
  align-items: end !important;
  gap: 10px !important;
  padding: 12px !important;
  border: 1px solid color-mix(in srgb, var(--cfg-border) 88%, transparent) !important;
  border-radius: 20px !important;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cfg-layer-2) 92%, transparent), color-mix(in srgb, var(--cfg-layer-1) 98%, transparent)) !important;
  box-shadow: 0 10px 20px color-mix(in srgb, var(--shadow-color) 8%, transparent) !important;
}

body.panel-body #configScreen #tab-ai-generator #aiGeneratorChatInput {
  grid-area: input !important;
  width: 100% !important;
  min-width: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--cfg-text) !important;
}

body.panel-body #configScreen #tab-ai-generator #aiGeneratorChatInput::placeholder {
  color: var(--cfg-text-muted) !important;
}

body.panel-body #configScreen #tab-ai-generator #aiGeneratorSendBtn,
body.panel-body #configScreen .send-btn,
body.panel-body #configScreen .btn-primary,
body.panel-body #configScreen .deploy-btn--grad {
  background: var(--cfg-accent-gradient) !important;
  border: 1px solid color-mix(in srgb, var(--cfg-accent) 22%, transparent) !important;
  box-shadow: var(--cfg-accent-shadow) !important;
  color: var(--primary-contrast) !important;
}

body.panel-body #configScreen #tab-ai-generator #aiGeneratorSendBtn {
  grid-area: send !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 999px !important;
}

body.panel-body #configScreen #tab-ai-generator #aiDoneBtn,
body.panel-body #configScreen .btn-secondary,
body.panel-body #configScreen .deploy-btn--outline,
body.panel-body #configScreen .tab-btn {
  background: var(--cfg-layer-1) !important;
  border: 1px solid var(--cfg-border) !important;
  color: var(--cfg-text) !important;
}

body.panel-body #configScreen #tab-ai-generator #aiDoneBtn {
  width: 100% !important;
  margin-top: 0 !important;
}

body.panel-body #configScreen .tab-btn.active,
body.panel-body #configScreen .tab-btn:hover,
body.panel-body #configScreen .btn-primary:hover,
body.panel-body #configScreen .send-btn:hover,
body.panel-body #configScreen .btn-secondary:hover,
body.panel-body #configScreen .deploy-btn--outline:hover,
body.panel-body .project-item:hover,
body.panel-body .btn-project-insight:hover,
body.panel-body .btn-project-menu:hover,
body.panel-body #configScreen #tab-ai-generator .ai-chat-clear-btn:hover {
  transform: translateY(-1px) !important;
}

body.panel-body #configScreen #tab-ai-generator .ai-studio-minimal-feed,
body.panel-body #configScreen #tab-ai-generator .ai-workspace__feed {
  border-radius: 20px !important;
}

body.panel-body #configScreen .ai-mention-autocomplete,
body.panel-body #configScreen .ai-resource-chip,
body.panel-body #configScreen .ai-quick-choice {
  border-color: var(--cfg-border) !important;
  color: var(--cfg-text) !important;
}

body.panel-body #configScreen .ai-resource-chip,
body.panel-body #configScreen .ai-quick-choice {
  background: var(--cfg-surface) !important;
}

body.panel-body #configScreen .ai-quick-choice.is-recommended,
body.panel-body #configScreen .ai-quick-choice:hover:not(:disabled),
body.panel-body #configScreen .ai-resource-chip:hover {
  background: var(--cfg-surface-2) !important;
  border-color: color-mix(in srgb, var(--cfg-accent) 24%, var(--cfg-border)) !important;
}

body.panel-body #configScreen #serverInfo,
body.panel-body #configScreen .server-badges,
body.panel-body #configScreen .configuration-project-status,
body.panel-body #configScreen .configuration-inline-progress,
body.panel-body #configScreen #projectsCount,
body.panel-body #configScreen #hostedCount {
  display: none !important;
}

body.panel-body #configScreen .project-main {
  gap: 8px !important;
  align-items: center !important;
}

body.panel-body #configScreen .project-side-actions {
  gap: 0.25rem !important;
}

body.panel-body .sidebar-header-simple {
  padding-bottom: 1.1rem !important;
  margin-bottom: 1.1rem !important;
  border-bottom: 1px solid color-mix(in srgb, white 10%, var(--border)) !important;
}

body.panel-body .sidebar-header-simple h2 {
  font-size: 1.2rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
}

body.panel-body .projects-list-simple {
  gap: 0.9rem !important;
}

body.panel-body .project-item {
  padding: 1rem !important;
  border: 1px solid color-mix(in srgb, white 8%, transparent) !important;
  border-left-width: 4px !important;
  background: linear-gradient(180deg, color-mix(in srgb, white 7%, var(--surface-light)), var(--surface-light)) !important;
}

body.panel-body .project-item.active {
  border-color: color-mix(in srgb, var(--cfg-accent) 22%, var(--cfg-border)) !important;
  background: linear-gradient(180deg, color-mix(in srgb, white 10%, var(--background)), var(--background)) !important;
}

body.panel-body .project-name {
  font-size: 0.98rem !important;
  font-weight: 700 !important;
}

body.panel-body .btn-add-project {
  min-height: 48px !important;
  font-weight: 700 !important;
  box-shadow: 0 14px 28px color-mix(in srgb, var(--shadow-color) 18%, transparent) !important;
}

body.panel-body #configScreen .msg,
body.panel-body #configScreen .msg.ai,
body.panel-body #configScreen .msg.user {
  display: flex !important;
  align-items: flex-end !important;
  gap: 10px !important;
  margin-bottom: 12px !important;
}

body.panel-body #configScreen .msg-bubble {
  max-width: 74% !important;
  border-radius: 18px !important;
  line-height: 1.58 !important;
  padding: 14px 16px !important;
  font-size: 0.96rem !important;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--shadow-color) 8%, transparent) !important;
}

body.panel-body #configScreen .msg.ai .msg-bubble {
  background: linear-gradient(180deg, color-mix(in srgb, white 10%, var(--cfg-layer-1)), var(--cfg-layer-1)) !important;
  border: 1px solid color-mix(in srgb, white 16%, var(--cfg-border)) !important;
  color: var(--cfg-text) !important;
}

body.panel-body #configScreen .msg.user .msg-bubble {
  background: var(--cfg-accent-gradient) !important;
  border: 1px solid color-mix(in srgb, var(--cfg-accent) 24%, transparent) !important;
  color: var(--primary-contrast) !important;
}

body.panel-body #configScreen .msg-bubble strong {
  color: inherit !important;
}

body.panel-body #configScreen .msg-bubble code {
  display: inline-block !important;
  margin: 0 2px !important;
  padding: 2px 6px !important;
  border-radius: 8px !important;
  background: color-mix(in srgb, var(--cfg-accent-soft) 28%, var(--cfg-layer-1)) !important;
  color: var(--cfg-text) !important;
}

body.panel-body #configScreen #tab-ai-generator .concept-card,
body.panel-body #configScreen #tab-ai-generator .missing-card {
  background: linear-gradient(180deg, color-mix(in srgb, white 10%, var(--cfg-layer-1)), var(--cfg-layer-1)) !important;
  border: 1px solid var(--cfg-border) !important;
  color: var(--cfg-text) !important;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--shadow-color) 8%, transparent) !important;
}

body.panel-body #configScreen #tab-ai-generator .concept-card-title {
  color: var(--success) !important;
}

body.panel-body #configScreen #tab-ai-generator .concept-card-name,
body.panel-body #configScreen #tab-ai-generator .concept-feature,
body.panel-body #configScreen #tab-ai-generator .missing-item {
  color: var(--cfg-text) !important;
}

body.panel-body #configScreen #tab-ai-generator .concept-card-desc {
  color: var(--cfg-text-muted) !important;
}

body.panel-body #configScreen #tab-ai-generator .missing-card {
  border-color: color-mix(in srgb, var(--error) 34%, var(--cfg-border)) !important;
}

body.panel-body #configScreen #tab-ai-generator .missing-card-title,
body.panel-body #configScreen #tab-ai-generator .missing-item::before {
  color: var(--error) !important;
}

body.panel-body #configScreen #tab-ai-generator .missing-item strong {
  color: inherit !important;
}

body.panel-body #configScreen .tab-btn:focus-visible,
body.panel-body #configScreen .btn-primary:focus-visible,
body.panel-body #configScreen .btn-secondary:focus-visible,
body.panel-body #configScreen .deploy-btn--outline:focus-visible,
body.panel-body #configScreen .send-btn:focus-visible,
body.panel-body #configScreen input:focus-visible,
body.panel-body #configScreen textarea:focus-visible,
body.panel-body #configScreen select:focus-visible,
body.panel-body #configScreen .ai-workspace button:focus-visible,
body.panel-body .btn-project-insight:focus-visible,
body.panel-body .btn-project-menu:focus-visible {
  outline: 2px solid var(--cfg-focus) !important;
  outline-offset: 2px !important;
}

body.panel-body.theme-light {
  --cfg-bg: #eef2f7;
  --cfg-surface: #ffffff;
  --cfg-surface-2: #f7f9fc;
  --cfg-layer-1: #ffffff;
  --cfg-layer-2: #f7f9fc;
  --cfg-panel: #ffffff;
  --cfg-panel-soft: #f7f9fc;
  --cfg-border: rgba(15, 23, 42, 0.12);
  --cfg-border-strong: rgba(15, 23, 42, 0.18);
  --cfg-text: #111827;
  --cfg-text-muted: #5b6474;
  --cfg-accent: #1f2937;
  --cfg-accent-soft: rgba(31, 41, 55, 0.08);
  --cfg-accent-gradient: linear-gradient(135deg, #334155 0%, #111827 100%);
  --cfg-accent-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
  --cfg-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  --cfg-focus: #111827;
}

body.panel-body.theme-light .project-switcher-shell {
  background: linear-gradient(180deg, #171717 0%, #0f1115 100%) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

body.panel-body.theme-light .project-switcher-copy,
body.panel-body.theme-light .project-switcher-copy .eyebrow,
body.panel-body.theme-light .project-switcher-copy p,
body.panel-body.theme-light .project-switcher-copy .project-switcher-headline h1,
body.panel-body.theme-light .sidebar-header-simple h2 {
  color: #f8fafc !important;
}

body.panel-body.theme-light .project-item {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08) !important;
}

body.panel-body.theme-light .project-item:hover,
body.panel-body.theme-light .project-item.active {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.24) !important;
}

body.panel-body.theme-light .project-name,
body.panel-body.theme-light .project-meta,
body.panel-body.theme-light .btn-project-menu,
body.panel-body.theme-light .btn-project-insight {
  color: #111827 !important;
}

body.panel-body.theme-light #configScreen #tab-ai-generator .ai-studio-minimal,
body.panel-body.theme-light #configScreen #tab-ai-generator .ai-workspace,
body.panel-body.theme-light #configScreen #tab-ai-generator .ai-studio-minimal-feed,
body.panel-body.theme-light #configScreen #tab-ai-generator .ai-workspace__feed,
body.panel-body.theme-light #configScreen #tab-ai-generator #aiChatComposerForm {
  border-color: rgba(15, 23, 42, 0.12) !important;
}

body.panel-body.theme-light #configScreen #tab-ai-generator .msg.ai .msg-bubble {
  background: #ffffff !important;
  color: #111827 !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
}

body.panel-body.theme-light #configScreen #tab-ai-generator .msg.user .msg-bubble {
  color: #ffffff !important;
}

body.panel-body.theme-light #configScreen #tab-ai-generator #aiGeneratorChatInput {
  color: #111827 !important;
}

body.panel-body.theme-light #configScreen #tab-ai-generator #aiGeneratorChatInput::placeholder,
body.panel-body.theme-light #configScreen #tab-ai-generator .ai-studio-minimal-subtitle,
body.panel-body.theme-light #configScreen #tab-ai-generator .chat-header-eyebrow,
body.panel-body.theme-light #configScreen #tab-ai-generator .ai-status-live-meta,
body.panel-body.theme-light #configScreen #tab-ai-generator .ai-conversation-step {
  color: #5b6474 !important;
}

@media (max-width: 1100px) {
  body.panel-body .panel-layout.panel-layout-start {
    grid-template-columns: 1fr !important;
    height: auto !important;
  }

  body.panel-body .panel-content.panel-content-start {
    height: auto !important;
  }

  body.panel-body .panel-start-shell {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      'switcher'
      'config' !important;
    height: auto !important;
  }

  body.panel-body .project-switcher-shell,
  body.panel-body #configScreen,
  body.panel-body .config-screen {
    position: static !important;
    max-height: none !important;
  }

  body.panel-body #configScreen #tab-ai-generator .ai-studio-minimal,
  body.panel-body #configScreen #tab-ai-generator .ai-workspace {
    min-height: 620px !important;
  }

  body.panel-body #configScreen #tab-ai-generator .ai-studio-briefing {
    grid-template-columns: 1fr !important;
  }
}

/* ========================================
   PROJECT AVATAR + THEME REFINEMENTS
   ======================================== */
body.panel-body .project-main {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  flex: 1 1 auto;
}

body.panel-body .project-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.panel-body .project-side-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  margin-left: auto;
}

body.panel-body .project-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

body.panel-body .project-guild-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

body.panel-body .project-guild-avatar-img,
body.panel-body .item-icon-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

body.panel-body .project-guild-avatar-fallback,
body.panel-body .item-icon-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--forge-accent-gradient);
  color: var(--primary-contrast);
  font-weight: 800;
}

body.panel-body .project-status-line {
  color: var(--text-muted);
}

body.panel-body.theme-dark .project-status-line {
  color: rgba(226, 232, 240, 0.72) !important;
}

body.panel-body.theme-light .project-status-line {
  color: rgba(17, 24, 39, 0.66) !important;
}

body.panel-body.theme-dark .project-guild-avatar {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.26);
}

body.panel-body.theme-light .project-guild-avatar {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

body.panel-body.theme-light .project-guild-avatar-fallback,
body.panel-body.theme-light .item-icon-fallback {
  color: #ffffff !important;
}

body.panel-body.theme-light .btn-delete-project {
  color: #374151 !important;
}

body.panel-body.theme-light .btn-delete-project:hover {
  color: #a1a1aa !important;
}

body.panel-body.theme-dark .btn-delete-project {
  color: var(--text-muted) !important;
}

body.panel-body.theme-dark .btn-delete-project:hover {
  color: #fca5a5 !important;
}

body.panel-body .bot-dropdown-item .item-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.panel-body .bot-dropdown-item .item-icon-img,
body.panel-body .bot-dropdown-item .item-icon-fallback {
  width: 100%;
  height: 100%;
}

/* Final fix: keep config card action buttons above all card internals */
body.panel-body .project-item {
  min-height: 68px !important;
  padding-right: 5.75rem !important;
}

body.panel-body .project-main,
body.panel-body .project-text,
body.panel-body .project-guild-avatar {
  position: relative !important;
  z-index: 1 !important;
}

body.panel-body .project-side-actions {
  position: absolute !important;
  top: 50% !important;
  right: 0.75rem !important;
  transform: translateY(-50%) !important;
  margin-left: 0 !important;
  z-index: 30 !important;
}

body.panel-body .project-insight-wrap,
body.panel-body .project-menu-wrapper,
body.panel-body .btn-project-insight,
body.panel-body .btn-project-menu,
body.panel-body .project-dropdown,
body.panel-body .project-insight-popover {
  position: relative !important;
  z-index: 31 !important;
}


/* Final fix: restore visible server scan UI above AI Studio */
body.panel-body #configScreen {
  overflow-y: auto !important;
}

body.panel-body #configScreen #serverContextPanel,
body.panel-body #configScreen #scanStatus,
body.panel-body #configScreen #onboardingFlow {
  display: block !important;
  flex: 0 0 auto !important;
}

body.panel-body #configScreen #serverContextPanel:empty,
body.panel-body #configScreen #scanStatus:empty,
body.panel-body #configScreen #onboardingFlow:empty {
  display: none !important;
}

body.panel-body #configScreen .tabs-content {
  display: block !important;
  flex: 1 1 auto !important;
  min-height: 720px !important;
  height: auto !important;
  overflow: visible !important;
}


/* Final fix: restore scan info to bot card and keep AI composer usable */
body.panel-body #configScreen {
  overflow: hidden !important;
}

body.panel-body #configScreen #serverContextPanel,
body.panel-body #configScreen #scanStatus,
body.panel-body #configScreen #onboardingFlow {
  display: none !important;
}

body.panel-body #configScreen .tabs-content {
  display: block !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
}

body.panel-body .project-status-line {
  display: block !important;
}
