* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

.hidden {
    display: none !important;
}

/* Login Page with Background */
.login-page {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    background-color: #0a0e27;
}

.login-page.hidden {
    display: none;
}

/* Left Section - Background Image */
.login-image-section {
    flex: 0 0 75%;
    background-image: url("assets/ChatGPT Image Jan 23, 2026, 02_07_30 PM.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-width: 0;
}

/* Right Section - Login Form */
.login-form-section {
    flex: 0 0 25%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    min-width: 0;
}

.login-form-panel {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    /* Login Page - Mobile */
    .login-page {
        flex-direction: column;
    }
    
    .login-image-section {
        display: none;
    }
    
    .login-form-section {
        flex: 1;
        width: 100%;
        padding: 1rem;
        background-image: url("assets/ChatGPT Image Jan 23, 2026, 02_07_30 PM.png");
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        position: relative;
    }
    
    .login-form-section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(10, 14, 39, 0.75);
        z-index: 0;
    }
    
    .login-form-panel {
        position: relative;
        z-index: 1;
        padding: 2rem 1.5rem;
    }
    
    .login-welcome {
        font-size: 1.5rem;
    }
    
    .login-subtitle {
        font-size: 0.9rem;
    }
    
    /* Main App - Mobile */
    header {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    header h1 {
        font-size: 1.25rem;
    }
    
    .header-actions {
        margin-top: 0.5rem;
        width: 100%;
        justify-content: space-between;
    }
    
    .folder-tabs-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .folder-tabs {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        gap: 0.25rem;
        flex-wrap: nowrap;
        width: 100%;
        padding-bottom: 0.5rem;
    }
    
    .folder-tabs::-webkit-scrollbar {
        height: 4px;
    }
    
    .folder-tabs::-webkit-scrollbar-track {
        background: var(--border-color);
        border-radius: 2px;
    }
    
    .folder-tabs::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 2px;
    }
    
    .folder-tab {
        white-space: nowrap;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        flex-shrink: 0;
        min-width: fit-content;
    }
    
    .btn-fly {
        width: 100%;
        margin-top: 0;
    }
    
    /* Update folder tabs for left panel layout */
    .folder-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .folder-tab {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .file-content {
        padding: 1rem;
    }
    
    .file-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .file-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    /* History Page - Mobile */
    .history-page-header,
    .fly-page-header,
    .build-page-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .history-page-header h2,
    .fly-page-header h2,
    .build-page-header h2 {
        font-size: 1.25rem;
    }
    
    .history-page-content,
    .fly-page-content,
    .build-page-content {
        padding: 1rem;
    }
    
    .build-form-section .form-row {
        grid-template-columns: 1fr;
    }
    
    .history-table {
        font-size: 0.85rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .history-table thead {
        display: none;
    }
    
    .history-table tbody {
        display: block;
    }
    
    .history-table tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 0.75rem;
        background-color: var(--card-bg);
    }
    
    .history-table td {
        padding: 0.5rem 0;
        display: block;
        text-align: left;
        border: none;
    }
    
    .history-table td:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        display: inline-block;
        min-width: 80px;
        color: var(--text-secondary);
    }
    
    /* Modal - Mobile */
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .modal-large {
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
    }
    
    /* Profile Dropdown - Mobile */
    .profile-dropdown {
        width: 100%;
        position: relative;
        z-index: 1001;
    }
    
    .dropdown-menu {
        right: 0;
        left: 0;
        width: 100%;
        z-index: 1002 !important;
        max-height: none;
        overflow: visible;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
    }
    
    /* Ensure header doesn't clip dropdown on mobile */
    header {
        overflow: visible !important;
        z-index: 1000;
    }
    
    .header-actions {
        overflow: visible !important;
        position: relative;
        z-index: 1001;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .login-image-section {
        flex: 0 0 60%;
    }
    
    .login-form-section {
        flex: 0 0 40%;
    }
    
    .folder-tabs-container {
        flex-wrap: wrap;
    }
}

/* Modal Styles (for other modals) */
.modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
}

/* Form Styles for Login Page */
.form-group-icon {
    position: relative;
    margin-bottom: 1.25rem;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    z-index: 2;
    pointer-events: none;
    width: 1.5rem;
    text-align: center;
}

.form-group-icon input {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form-group-icon input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group-icon input:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: rgba(30, 41, 59, 0.9);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Password visibility toggle on login */
.form-group-password input {
    padding-right: 2.75rem;
}

.password-toggle-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.password-toggle-btn:hover {
    color: rgba(255, 255, 255, 0.95);
}

.password-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* When input has autofill (grey/white background), use dark icon so it stays visible */
.form-group-password:has(input:-webkit-autofill) .password-toggle-btn,
.form-group-password:has(input:autofill) .password-toggle-btn {
    color: #1e293b;
}

.form-group-password:has(input:-webkit-autofill) .password-toggle-btn:hover,
.form-group-password:has(input:autofill) .password-toggle-btn:hover {
    color: #0f172a;
}

.password-toggle-icon .icon-eye,
.password-toggle-icon .icon-eye-off {
    display: block;
}

.password-toggle-icon .icon-eye-off.hidden,
.password-toggle-icon .icon-eye.hidden {
    display: none !important;
}

.form-group-forgot {
    text-align: right;
    margin-bottom: 1.5rem;
}

.forgot-password-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.forgot-password-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.btn-login {
    width: 100%;
    padding: 0.875rem;
    background-color: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1.5rem;
}

.btn-login:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

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

.register-submit-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.register-loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: register-spin 0.8s linear infinite;
}

.register-loading-spinner.hidden {
    display: none;
}

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


.create-account-link {
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

.create-account-link a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.create-account-link a:hover {
    text-decoration: underline;
}

.error-message {
    color: #ef4444;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    margin-bottom: 0;
    font-size: 0.875rem;
    border: none;
    min-height: 0;
}

.error-message:empty {
    display: none;
}

.success-message {
    color: #10b981;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    margin-bottom: 0;
    font-size: 0.875rem;
    border: none;
    min-height: 0;
}

.success-message:empty {
    display: none;
}

.form-hint {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    margin-top: 1rem;
    text-align: center;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 2rem;
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.auth-tab:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

.auth-tab.active {
    color: #ffffff;
    border-bottom-color: #3b82f6;
    background-color: rgba(255, 255, 255, 0.05);
}

.auth-tab-content {
    display: none;
    padding: 0;
}

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

.login-welcome {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
    text-align: left;
}

.login-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    text-align: left;
}

.auth-tab-content h2 {
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-align: left;
    font-size: 1.5rem;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.profile-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.profile-tab:hover {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.profile-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

.profile-tab-content {
    display: none;
    padding-top: 1.5rem;
}

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

.modal-large {
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
    text-align: center;
    flex: 1;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    width: auto;
    min-width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    flex-shrink: 0;
    z-index: 1;
}

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

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

.register-success-modal-message {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    line-height: 1.5;
}

.org-exists-request-wrap {
    margin-top: 1rem;
}
.org-exists-prompt {
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
}
.org-exists-request-wrap .btn {
    margin-right: 0.5rem;
}
.org-exists-success-wrap .org-exists-success-msg {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

#profileModal .modal-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.profile-readonly-value {
    padding: 0.5rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

/* Profile: Flight animation toggle (on/off switch) */
.profile-preference-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.profile-preference-label {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.profile-toggle-wrap {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.profile-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.profile-toggle-slider {
    display: inline-block;
    width: 2.75rem;
    height: 1.4rem;
    background: var(--border-color);
    border-radius: 1.4rem;
    transition: background 0.2s ease;
}

.profile-toggle-slider::after {
    content: '';
    display: block;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0.15rem;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.profile-toggle-input:checked + .profile-toggle-slider {
    background: var(--primary-color, #2563eb);
}

.profile-toggle-input:checked + .profile-toggle-slider::after {
    transform: translateX(1.35rem);
}

.profile-toggle-input:focus-visible + .profile-toggle-slider {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.organizations-section .organizations-subtitle {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.organizations-list .organization-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.org-default-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color, #2563eb);
    background: rgba(37, 99, 235, 0.12);
    border-radius: 4px;
}

.btn-small {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
}

.btn-set-default {
    margin-left: auto;
}

.btn-view-org {
    margin-left: 0.5rem;
}

.invite-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.invite-row input {
    flex: 1;
    min-width: 120px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.invite-by-org-row {
    margin-bottom: 1.25rem;
}

.invite-by-org-row .invite-row {
    margin-top: 0.5rem;
}

.command-display {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.command-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.command-display code {
    display: block;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
    background-color: white;
    padding: 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.output-container {
    margin-top: 1rem;
    position: relative;
}

.output-container.status-running,
.output-container.status-completed,
.output-container.status-failed {
    padding: 3px;
    border-radius: 10px;
    background: transparent;
}

.output-container .output-label {
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

/* Animated gradient border for running status (Blue) */
.output-container.status-running {
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
    background-size: 200% 100%;
    animation: gradient-border-running 3s ease infinite;
}

@keyframes gradient-border-running {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Animated gradient border for completed status (Green) */
.output-container.status-completed {
    background: linear-gradient(90deg, #10b981, #34d399, #10b981);
    background-size: 200% 100%;
    animation: gradient-border-completed 2s ease infinite;
}

@keyframes gradient-border-completed {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Animated gradient border for failed status (Red) */
.output-container.status-failed {
    background: linear-gradient(90deg, #ef4444, #f87171, #ef4444);
    background-size: 200% 100%;
    animation: gradient-border-failed 2s ease infinite;
}

@keyframes gradient-border-failed {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Inner content wrapper to maintain dark background */
.output-container .output-content-wrapper {
    background-color: #1e293b;
    border-radius: 7px;
    padding: 0;
    overflow: hidden;
}

.output-container .output-content {
    margin: 0;
    border: none;
}

.output-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.output-content {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid #334155;
}

/* Raw YAML Content */
#rawContentWrapper {
    display: flex;
    flex-direction: column;
}

.raw-content-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

#rawContent {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
    color: var(--text-primary);
    margin: 0;
}

#rawContent.hidden {
    display: none;
}

.raw-content-edit {
    width: 100%;
    min-height: 400px;
    max-height: 600px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
    background-color: #ffffff;
    color: var(--text-primary);
    box-sizing: border-box;
    display: none;
}

.raw-content-edit:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.raw-save-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.raw-content-edit.hidden {
    display: none !important;
}

#rawSaveSection.hidden {
    display: none !important;
}

/* Full page output (for fly page) */
.fly-page-content .output-content {
    max-height: calc(100vh - 300px);
    min-height: 400px;
}

.output-content::-webkit-scrollbar {
    width: 8px;
}

.output-content::-webkit-scrollbar-track {
    background: #1e293b;
}

.output-content::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.output-content::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Flight Execution Page (Full Page) */
#flyPage {
    min-height: 100vh;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
}

.fly-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background-color: var(--card-bg);
    border-bottom: 2px solid var(--border-color);
    box-shadow: var(--shadow);
}

.fly-page-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.fly-page-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
}

.fly-page-content .output-content {
    max-height: calc(100vh - 350px);
    min-height: 400px;
}

.fly-page-footer {
    padding: 1rem 2rem;
    text-align: center;
    background-color: var(--card-bg);
    border-top: 2px solid var(--border-color);
}

/* Flight execution status: heading left, flight path to end of screen; extra top/bottom padding so arc isn't clipped */
.fly-execution-status {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 1.25rem 2rem 1.25rem 2rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    overflow: visible;
}

.fly-status-heading {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* Purple gradient animation on "Test in Progress" text when running */
.fly-execution-status--running .fly-status-heading {
    background: linear-gradient(90deg, #7c3aed, #a78bfa, #c4b5fd, #a78bfa, #7c3aed);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: heading-gradient 3s ease infinite;
}

@keyframes heading-gradient {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.fly-execution-status--completed .fly-status-heading,
.fly-execution-status--failed .fly-status-heading {
    color: var(--text-primary);
}

/* Flight path container: starts at end of heading text, extends to right edge of screen */
.fly-status-animation-wrap {
    flex: 1;
    min-width: 200px;
    margin-left: 0;
    overflow: visible;
}

/* Hide flight animation when user has turned it off in profile (default off) */
.fly-execution-status--animation-off .fly-status-animation-wrap {
    display: none;
}

.fly-status-animation {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 64px;
    overflow: visible;
    padding-top: 28px;
    padding-bottom: 8px;
}

.fly-execution-status .plane-icon {
    font-size: 2.5rem;
    line-height: 1;
    opacity: 0.95;
}

/* Flying: plane follows a parabolic path from left to right (arc up then down) */
.fly-execution-status--running .plane-icon {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: plane-flying 3s ease-in-out infinite;
}

/* Second plane starts when the first is near the right (~75% through its path) */
.fly-execution-status--running .plane-icon-2 {
    animation-delay: 2.25s;
}

@keyframes plane-flying {
    0% {
        left: 0;
        transform: translate(-50%, -50%) rotate(-8deg);
        opacity: 0.85;
    }
    25% {
        left: 25%;
        transform: translate(-50%, calc(-50% - 18px)) rotate(0deg);
        opacity: 1;
    }
    50% {
        left: 50%;
        transform: translate(-50%, calc(-50% - 28px)) rotate(5deg);
        opacity: 1;
    }
    75% {
        left: 75%;
        transform: translate(-50%, calc(-50% - 18px)) rotate(0deg);
        opacity: 1;
    }
    100% {
        left: 100%;
        transform: translate(-50%, -50%) rotate(-8deg);
        opacity: 0.85;
    }
}

/* Landing: plane descends and settles */
.fly-execution-status--completed .plane-icon,
.fly-execution-status--failed .plane-icon {
    animation: plane-landing 1.2s ease-out forwards;
}

@keyframes plane-landing {
    0% {
        transform: translateY(-30px) rotate(-8deg);
        opacity: 0.9;
    }
    60% {
        transform: translateY(4px) rotate(2deg) scale(1.05);
        opacity: 1;
    }
    100% {
        transform: translateY(0) rotate(0) scale(1);
        opacity: 1;
    }
}

/* History Page */
#historyPage {
    min-height: 100vh;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
}

.history-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background-color: #000000;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow);
}

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

.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.tooltip-wrapper button:disabled {
    pointer-events: none;
}

.history-page-header h2 {
    margin: 0;
    color: #ffffff;
}

.history-page-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
}

/* Organization page (full screen) */
#organizationPage {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-color);
}

.organization-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background-color: #000000;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow);
}

.organization-page-header h2 {
    margin: 0;
    color: #ffffff;
}

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

.organization-page-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
}

.organization-details-section,
.organization-members-section,
.organization-env-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.organization-details-section h3,
.organization-members-section h3,
.organization-env-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.organization-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.organization-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.organization-detail-item label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.organization-detail-item span {
    font-weight: 500;
}

.organization-table-wrap {
    overflow-x: auto;
}

.organization-members-table {
    width: 100%;
    border-collapse: collapse;
}

.organization-members-table th,
.organization-members-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.organization-members-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.organization-members-table td select.role-select {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: var(--input-bg);
    color: var(--text-primary);
}

.organization-env-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.organization-env-fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.organization-env-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.organization-env-row label {
    flex-shrink: 0;
    min-width: 220px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.organization-env-colon {
    flex-shrink: 0;
    color: var(--text-muted);
    font-weight: 500;
}

.organization-env-row input {
    flex: 1;
    min-width: 0;
    max-width: 480px;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: var(--input-bg);
    color: var(--text-primary);
}

.organization-env-row input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
}

.organization-env-row input:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.organization-env-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.organization-env-actions .error-message,
.organization-env-actions .success-message {
    flex: 1;
    min-width: 0;
}

.org-role-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.org-role-owner { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.org-role-developer { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.org-role-user { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }

/* Build Your Own page */
#buildYourOwnPage {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-color);
}

.build-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background-color: #000000;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow);
}

.build-page-header h2 {
    margin: 0;
    color: #ffffff;
}

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

.build-page-content {
    flex: 1;
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
}

.build-flightplan-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.build-form-section {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.build-form-section h3 {
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.1rem;
}

.build-subsection-title {
    margin: 1.25rem 0 0.75rem 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.build-form-section .form-group {
    margin-bottom: 1rem;
}

.build-form-section .form-group:last-child {
    margin-bottom: 0;
}

.build-form-section .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.build-form-section .form-row-multi {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.build-form-actions {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 0.5rem;
    box-shadow: var(--shadow);
}

.build-form-actions .form-group {
    margin-bottom: 1rem;
}

.btn-build {
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.btn-build:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.history-table thead {
    background-color: var(--primary-color);
    color: white;
}

.history-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

.history-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.history-table th.sortable::after {
    content: '';
    display: inline-block;
    margin-left: 0.5rem;
    width: 0;
    height: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.history-table th.sortable:hover::after {
    opacity: 0.5;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid rgba(255, 255, 255, 0.7);
    border-bottom: none;
}

.history-table th.sortable[data-sort-direction="asc"]::after {
    opacity: 1;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 6px solid white;
    border-top: none;
}

.history-table th.sortable[data-sort-direction="desc"]::after {
    opacity: 1;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid white;
    border-bottom: none;
}

.history-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.history-table tbody tr:hover {
    background-color: #f8fafc;
}

.history-table tbody tr:last-child td {
    border-bottom: none;
}

.history-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.history-actions .btn {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

.history-actions .btn-danger {
    background-color: #ef4444;
    color: white;
    border: none;
}

.history-actions .btn-danger:hover {
    background-color: #dc2626;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-running {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-completed {
    background-color: #d1fae5;
    color: #065f46;
}

.status-failed {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-stopped {
    background-color: #fef3c7;
    color: #92400e;
}

.btn-blackbox {
    background-color: #4a5568 !important;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-blackbox:hover {
    background-color: #374151 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.loading-message,
.empty-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--danger-color);
}

/* Console Output */
.console-info {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    margin-bottom: 0.5rem;
    align-items: center;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 100px;
}

.console-output {
    background-color: #1e293b;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
}

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

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
}

/* Header */
header {
    background-color: #000000;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

header h1 {
    color: #ffffff;
    font-size: 1.75rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-divider {
    width: 1px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.3);
    margin: 0 0.5rem;
}

/* Divider for black headers (history and results pages) */
.history-page-header .header-divider,
.results-page-header .header-divider {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.profile-button {
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    padding: 0.625rem 1rem;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.profile-button:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background-color: rgba(255, 255, 255, 0.08);
}

.dropdown-arrow {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.2s;
}

.profile-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--border-color);
}

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

.dropdown-item:hover {
    background-color: #f8fafc;
}

.dropdown-item:first-child:hover {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child:hover {
    border-radius: 0 0 8px 8px;
}

.dropdown-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.btn-fly,
.btn-history {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff !important;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.btn-fly:hover:not(:disabled),
.btn-history:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
    color: #ffffff !important;
}

.btn-fly:disabled,
.btn-history:disabled {
    opacity: 1 !important;
    cursor: not-allowed;
    box-shadow: none;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.5) 0%, rgba(118, 75, 162, 0.5) 100%) !important;
    color: #ffffff !important;
}

.btn-fly:disabled *,
.btn-fly:disabled .plane-icon,
.btn-fly:disabled span,
.btn-history:disabled * {
    color: #ffffff !important;
}

.plane-icon {
    font-size: 1.2rem;
}

/* Main Container */
main {
    padding: 0;
    background-color: #ffffff;
    display: flex;
    flex: 1;
    overflow: hidden;
}

.main-layout {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 120px);
}

/* Left Panel */
.left-panel {
    width: 280px;
    background-color: #000000;
    padding: 1.5rem 1.5rem 1.5rem 1.5rem;
    overflow-y: auto;
    flex-shrink: 0;
}

.left-panel[aria-hidden="true"] {
    /* Hidden state only applies on mobile via media query */
}

.left-panel-section {
    margin-bottom: 2rem;
}

.left-panel-section:last-child {
    margin-bottom: 0;
}

.left-panel-title {
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bubble-level-label-root {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0.25rem 0 0.5rem 0;
}

/* Right Content Area */
.right-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background-color: #ffffff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Selection Panel */
.selection-panel {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    padding: 2rem;
    border: 2px solid #667eea;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    margin-bottom: 2rem;
}

.fly-action-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

/* Folder Tabs */
.folder-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.folder-tab {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-radius: 4px;
}

.folder-tab:last-child {
    border-bottom: none;
}

.folder-tab:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

.folder-tab.active {
    color: #ffffff;
    border-left-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.2);
}

.folder-tab.loading {
    opacity: 0.6;
    cursor: wait;
}

/* Subfolder Tabs Container (Right Panel) */
.subfolder-tabs-container {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.subfolder-section-title {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

/* Nested subfolder-tabs-container inside rows (for next-level folders) */
.subfolder-tabs-row .subfolder-tabs-container {
    margin-bottom: 0;
    padding: 0;
    background-color: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Subfolder Tabs - Inside the container in right panel */
.subfolder-tabs-container .subfolder-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: -1rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.subfolder-tabs-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    width: 100%;
    position: relative;
}

.bubble-level-label {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.subfolder-tabs-row.collapsed {
    justify-content: center;
    position: relative;
}

.subfolder-tabs-row.collapsed .subfolder-tab:not(.active) {
    display: none;
}

.subfolder-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    position: relative;
    width: 100%;
}

.subfolder-breadcrumb-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
}

.subfolder-crumb {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-style: italic;
}

.subfolder-crumb.active {
    color: var(--primary-color);
    cursor: default;
}

.subfolder-crumb-separator {
    color: var(--text-secondary);
    opacity: 0.6;
    font-style: italic;
}

.subfolder-back-container {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.subfolder-back-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subfolder-back-btn:hover {
    background: var(--primary-color-dark, #0056b3);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

.subfolder-tabs-row.next-level {
    opacity: 0.85;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    width: 100%;
}

.subfolder-tabs-row.next-level .subfolder-tab {
    border-style: dashed;
}

/* Nested subfolder-tabs-container inside rows (for next-level folders) - keep existing flex layout */
.subfolder-tabs-row .subfolder-tabs-container {
    margin-bottom: 0;
    padding: 0;
    background-color: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.subfolder-tab {
    padding: 0.5rem 1rem;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 999px;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.2s;
}

.subfolder-tab:hover {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.35);
}

.subfolder-tab.active {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(37, 99, 235, 0.45);
    color: var(--primary-color);
    cursor: default;
}

/* Last bubble (file tab) when selected: green and centered row */
.subfolder-tab.file-tab.active {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.6);
    color: #16a34a;
    border-style: solid;
}

.subfolder-tabs-row.file-tabs-row:has(.file-tab.active) {
    justify-content: center;
}

.subfolder-tabs-row.file-tabs-row:has(.file-tab.active) .subfolder-tabs-container {
    justify-content: center;
}

/* File Selection Container */
.file-selection-container {
    margin-top: 1.5rem;
}

.fly-action-column,
.fly-action-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    flex-shrink: 0;
}

.fly-button-text {
    display: inline;
}

.fly-disabled-text {
    color: #ffffff !important;
    font-size: 0.875rem;
    font-style: italic;
    margin-left: 0.5rem;
    display: none;
}

.btn-fly:disabled .fly-button-text {
    display: none;
}

.btn-fly:disabled .fly-disabled-text {
    display: inline;
}

.btn-fly:not(:disabled) .fly-disabled-text {
    display: none;
}

.fly-run-status-wrapper {
    margin-bottom: 0.75rem;
}

.fly-run-status-wrapper:has(.fly-run-status.hidden) {
    display: none;
}

.fly-run-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 500;
}

.fly-run-view-execution {
    margin-left: 0.25rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-color);
    background: transparent;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
}

.fly-run-view-execution:hover {
    background: rgba(59, 130, 246, 0.1);
}

.fly-run-status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: fly-run-status-pulse 1.2s ease-in-out infinite;
}

@keyframes fly-run-status-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.selected-plan-message {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: bold;
    font-style: italic;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
}

.selected-plan-message.hidden {
    display: none;
}

.selected-plan-message #selectedPlanName {
    color: var(--primary-color);
    font-weight: 600;
}

.folder-tabs-container .btn-fly {
    flex-shrink: 0;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

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

.file-select-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.file-select-header label {
    margin-bottom: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.select-large {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.select-large:hover {
    border-color: var(--primary-color);
}

.select-large:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* File Content */
.file-content {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.file-header h2 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.content-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    gap: 0.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.content-display {
    padding: 2rem;
    max-height: 600px;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

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

/* Raw YAML tab content wrapper */
#rawContentWrapper {
    display: none;
    flex-direction: column;
    padding: 0;
    background: none;
    border: none;
}

#rawContentWrapper.active {
    display: flex;
}

/* Edit Form tab content */
#editForm {
    display: none;
    white-space: normal;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#editForm.active {
    display: block;
}
    background-color: var(--card-bg);
    padding: 0;
}

#editForm.active {
    display: block;
}

#yamlForm {
    padding: 0;
}

#formFields {
    margin-bottom: 2rem;
}

.form-section {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    text-transform: capitalize;
}

.form-field {
    margin-bottom: 1rem;
}

.form-field:last-child {
    margin-bottom: 0;
}

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

.form-field input[type="text"],
.form-field input[type="number"],
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: inherit;
}

.form-field input[type="text"]:focus,
.form-field input[type="number"]:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-field textarea {
    min-height: 80px;
    resize: vertical;
}

.form-field small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.save-section {
    background-color: #f0f9ff;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.upload-section {
    margin-top: 0.5rem;
}

.file-input {
    width: 100%;
}

.file-input::file-selector-button {
    background-color: #e2e8f0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 0.9rem;
    margin-right: 0.75rem;
    transition: all 0.2s;
}

.file-input::file-selector-button:hover {
    background-color: #cbd5f5;
    border-color: var(--primary-color);
}

#rawSaveSection {
    margin-top: 1.5rem;
    display: none;
}

.save-section .form-group {
    margin-bottom: 1rem;
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.success-message {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    min-height: 1.25rem;
    font-weight: 500;
}

.nested-field {
    margin-left: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
    margin-top: 0.75rem;
}

.array-item {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.array-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.array-item-header h4 {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.btn-remove {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove:hover {
    background-color: #dc2626;
}

.btn-add {
    background-color: var(--success-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.btn-add:hover {
    background-color: #059669;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--secondary-hover);
}

.btn:disabled,
.btn-secondary:disabled {
    background-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    pointer-events: none;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background-color: var(--success-color);
    color: white;
}

.btn-small:hover {
    background-color: #059669;
}

.btn-tiny {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Form Styles */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.error-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    min-height: 1.25rem;
}

.forgot-password-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
    display: inline-block;
}

.forgot-password-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Results Page */
#resultsPage {
    min-height: 100vh;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
}

/* Compare Results full page */
#comparePage {
    min-height: 100vh;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
}

.compare-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background-color: #000000;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow);
}

.compare-page-header h2 {
    margin: 0;
    color: #ffffff;
}

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

.compare-page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
}

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

/* Input Parameters accordion (collapsed by default) */
.compare-params-accordion {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
}

.compare-params-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    user-select: none;
}

.compare-params-accordion-summary::-webkit-details-marker,
.compare-params-accordion-summary::marker {
    display: none;
}

.compare-params-accordion-icon {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
}

.compare-params-accordion[open] .compare-params-accordion-icon {
    transform: rotate(-135deg);
}

.compare-params-accordion-summary:hover {
    background: rgba(0, 0, 0, 0.03);
}

.compare-params-accordion .compare-params-table-wrap {
    border-top: 1px solid var(--border-color);
}

/* Match View Results input-params-section heading */
.compare-section.compare-section-params h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.compare-params-table-wrap {
    overflow-x: auto;
    margin-bottom: 1rem;
}

/* Common (same-value) rows hidden by default; shown when "Show all" is active */
.compare-params-table-wrap .compare-params-row-common {
    display: none;
}

.compare-params-table-wrap.showing-all .compare-params-row-common {
    display: table-row;
}

/* Common param rows: keep green/red background by RunIQ, but use black text */
.compare-params-table .compare-params-row-common td.param-value {
    color: #000;
}

.compare-params-show-all-wrap {
    margin-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
}

.compare-params-show-all-wrap.hidden {
    display: none;
}

/* Compare Input Parameters: tabular grid with dividers; param name left, Run 1 / Run 2 grouped right */
.compare-params-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.compare-params-table th,
.compare-params-table td {
    padding: 0.5rem 0.75rem;
    text-align: center;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.compare-params-table th:last-child,
.compare-params-table td:last-child {
    border-right: none;
}

/* Strong divider after param-name column so Run 1 / Run 2 read as a pair */
.compare-params-table td.param-name {
    border-right: 2px solid var(--border-color);
}

.compare-params-table tbody tr:last-child td {
    border-bottom: none;
}

.compare-params-table td.param-name,
.compare-params-table td.param-value {
    font-family: inherit;
    font-size: inherit;
}

.compare-params-table .param-name {
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    width: 1%;
    min-width: 8rem;
}

.compare-params-table .param-value {
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
}

/* All params: color by RunIQ — green = higher RunIQ, red = lower RunIQ */
.compare-params-table .param-value.compare-param-value--better {
    background-color: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.compare-params-table .param-value.compare-param-value--worse {
    background-color: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

/* Run 1 and Run 2 value columns */
.compare-params-table td.param-value {
    min-width: 6rem;
}

.compare-params-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.03);
}

.compare-params-table .no-params {
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem;
}

.compare-results-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.compare-result-column {
    min-width: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: var(--shadow);
}

.compare-column-title {
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
    color: var(--text-primary);
}

.compare-result-column-content {
    min-height: 120px;
}

@media (max-width: 900px) {
    .compare-results-columns {
        grid-template-columns: 1fr;
    }
}

.results-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background-color: #000000;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow);
}

.results-page-header h2 {
    margin: 0;
    color: #ffffff;
}

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

.results-page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
}

.results-layout {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    align-items: stretch;
    min-height: 0;
}

/* Full-width Detailed Results section below Input | Results (spans whole screen) */
.detailed-results-fullwidth {
    width: 100vw;
    max-width: 100%;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: 1.5rem;
    padding: 1.5rem 2rem;
    border-top: 2px solid var(--border-color);
    background: var(--bg-color);
    min-height: 0;
}

.detailed-results-fullwidth:empty {
    display: none;
}

.results-section-panel {
    flex: 1 1 0;
    min-width: 0;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.results-section-panel:first-child {
    flex: 0 1 42%;
}

.input-params-panel {
    display: flex;
    flex-direction: row;
    padding: 0;
    overflow: visible;
}

.input-params-panel.collapsed {
    flex: 0 0 48px;
    min-width: 48px;
    max-width: 48px;
}

.input-params-panel:not(.collapsed) {
    flex: 0 1 42%;
    min-width: 200px;
}

.input-params-panel.collapsed .input-params-accordion-body {
    display: none;
}

.input-params-accordion-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    min-width: 48px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.input-params-accordion-header:hover {
    background: var(--bg-color);
}

.input-params-panel .input-params-accordion-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    line-height: 1.2;
}

.input-params-accordion-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem;
}

.input-params-accordion-toggle:hover {
    color: var(--primary-color);
}

.input-params-panel.collapsed .input-params-accordion-toggle {
    transform: rotate(0deg);
}

.input-params-accordion-body {
    flex: 1;
    min-width: 0;
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 180px);
}

.input-params-accordion-body .results-header-info {
    margin-top: 0;
}

.results-section-panel:last-child {
    flex: 0 1 58%;
}

.input-params-panel:not(.collapsed) + .results-section-panel {
    flex: 0 1 58%;
}

.input-params-panel.collapsed + .results-section-panel {
    flex: 1 1 0;
}

.results-section-panel h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.results-header-info {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.input-params-section {
    margin-top: 1rem;
}

.input-params-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

/* Left Panel Accordion Toggle Button */
.left-panel-toggle {
    display: none; /* Hidden on desktop */
}

/* Ensure toggle is never hidden by any rule */
.left-panel-toggle.hidden {
    display: flex !important;
}

@media (max-width: 768px) {
    .left-panel-toggle.hidden {
        display: flex !important;
    }
}

/* Desktop: Left panel always visible */
@media (min-width: 769px) {
    .left-panel {
        display: block !important;
        max-height: none !important;
        opacity: 1 !important;
    }
    
    .left-panel[aria-hidden] {
        display: block !important;
        max-height: none !important;
        opacity: 1 !important;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Main Layout - Stack vertically on mobile */
    .main-layout {
        flex-direction: column;
        min-height: auto;
        position: relative;
    }
    
    /* Force toggle button to always be visible on mobile - highest priority */
    #leftPanelToggle.left-panel-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    /* Accordion Toggle Button - Show on mobile, always visible */
    .left-panel-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        align-items: center;
        justify-content: space-between;
        width: 100% !important;
        padding: 1rem !important;
        background-color: #000000 !important;
        color: #ffffff !important;
        border: none !important;
        border-bottom: 2px solid rgba(255, 255, 255, 0.2) !important;
        cursor: pointer !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        text-transform: uppercase;
        letter-spacing: 1px;
        transition: all 0.2s;
        z-index: 1000 !important;
        position: relative !important;
        margin: 0 !important;
        flex-shrink: 0;
        order: -1; /* Ensure it appears before the panel */
        min-height: 50px !important;
        height: auto !important;
    }
    
    /* Override any hidden class or any other rule that might hide it */
    .left-panel-toggle.hidden,
    .left-panel-toggle[hidden],
    .hidden .left-panel-toggle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Ensure toggle is never covered by panel */
    .main-layout {
        position: relative;
    }
    
    .left-panel {
        position: relative;
        z-index: 1;
    }
    
    .left-panel-toggle:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .left-panel-toggle span:first-child {
        font-size: 1.5rem;
        margin-right: 0.5rem;
        transition: transform 0.2s;
    }
    
    .left-panel-toggle[aria-expanded="true"] span:first-child {
        transform: rotate(90deg);
    }
    
    .left-panel-toggle[aria-expanded="false"] span:first-child {
        transform: rotate(0deg);
    }
    
    /* Left Panel - Expanded by default, collapsed when accordion is closed */
    .left-panel {
        width: 100%;
        max-height: 400px;
        overflow-y: auto;
        padding: 1rem;
        border-bottom: 2px solid rgba(255, 255, 255, 0.2);
        transition: max-height 0.3s ease-out, padding 0.3s ease-out, border 0.3s ease-out;
        display: block;
        flex-shrink: 0;
    }
    
    .left-panel[aria-hidden="true"] {
        max-height: 0 !important;
        min-height: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        border-bottom: none !important;
        overflow: hidden;
        display: block;
        flex-shrink: 0;
        position: relative;
        z-index: 1;
    }
    
    /* Ensure toggle button is never hidden, even when panel is collapsed */
    .left-panel[aria-hidden="true"] ~ .right-content,
    .left-panel[aria-hidden="true"] + .right-content {
        margin-top: 0;
    }
    
    .left-panel[aria-hidden="true"] .left-panel-section {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Right Content - Full width on mobile, remove top padding and add gradient */
    .right-content {
        padding: 0 1rem 1rem 1rem !important;
        width: 100%;
        padding-top: 0 !important;
        margin-top: 0 !important;
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%) !important;
    }
    
    /* Selection Panel - Remove top margin to eliminate white space */
    .selection-panel {
        padding: 1.5rem;
        margin-bottom: 1rem;
        margin-top: 0 !important;
    }
    
    /* File Selection Container */
    .file-selection-container {
        margin-top: 0;
    }
    
    /* File Select Header - Stack on mobile */
    .file-select-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .file-select-header label {
        font-size: 1.1rem;
    }
    
    /* Fly Action Container - Full width button */
    .fly-action-container {
        margin-top: 1rem;
    }
    
    .btn-fly {
        width: 100%;
    }
    
    /* Header - Stack on mobile */
    header {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    header h1 {
        font-size: 1.25rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
    }
    
    .header-divider {
        height: 24px;
    }
    
    /* History Page - Mobile adjustments */
    .history-page-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .history-header-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .history-page-content {
        padding: 1rem;
    }
    
    .history-table {
        font-size: 0.8rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .history-table thead {
        display: none;
    }
    
    .history-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 0.75rem;
    }
    
    .history-table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .history-table tbody td:last-child {
        border-bottom: none;
    }
    
    .history-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 1rem;
    }
    
    .history-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Results Page - Mobile adjustments */
    .results-page-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .results-header-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .results-page-content {
        padding: 1rem;
    }
    
    .results-layout {
        flex-direction: column;
    }
    
    .results-section-panel {
        flex: none;
        max-height: none;
        padding: 1rem;
    }
    
    .results-section-panel:first-child,
    .results-section-panel:last-child {
        flex: none;
    }
    
    /* Buttons - Adjust sizes for mobile */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-history,
    .btn-fly {
        width: 100%;
        justify-content: center;
    }
    
    /* Modal - Full screen on mobile */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem auto;
        max-height: 90vh;
    }
    
    .modal-large {
        width: 95%;
        max-width: 95%;
    }
    
    /* Params Container - Stack chips on mobile */
    .params-container {
        flex-direction: column;
    }
    
    .param-chip {
        width: 100%;
        max-width: 100%;
    }
    
    .param-chip-value {
        max-width: none;
    }
    
    /* Metrics Grid - Single column on mobile */
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    /* File Content - Mobile adjustments */
    .file-content {
        padding: 1rem;
    }
    
    .file-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .file-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Subfolder tabs - Mobile adjustments */
    .subfolder-tabs {
        gap: 0.25rem;
    }
    
    .subfolder-tab {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
    
    /* Console Modal - Mobile adjustments */
    .console-output {
        font-size: 0.8rem;
        max-height: 60vh;
    }
    
    /* Results Page - Mobile adjustments */
    .results-header-info {
        margin-bottom: 1rem;
    }
    
    .result-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Compare Modal - Mobile adjustments */
    .compare-results-list {
        max-height: 50vh;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    header h1 {
        font-size: 1.1rem;
    }
    
    .left-panel-toggle {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .toggle-text {
        font-size: 0.9rem;
    }
    
    .left-panel {
        max-height: 300px;
    }
    
    .left-panel[aria-hidden="true"] {
        max-height: 0;
        padding: 0;
        margin: 0;
    }
    
    .left-panel-title {
        font-size: 0.75rem;
    }
    
    .folder-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .selection-panel {
        padding: 1rem;
    }
    
    .file-select-header label {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .history-page-header h2,
    .results-page-header h2 {
        font-size: 1.1rem;
    }
}

/* Results View Styles */
.results-controls {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
}

.results-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.results-header h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.result-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.results-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.results-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Results summary – blue theme (dark blue background, lighter panels) */
.results-section.checkride-summary {
    background: linear-gradient(90deg, #0a1a5e 0%, #0a1b60 100%);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e8eef5;
}
.results-section.checkride-summary .metric-label,
.results-section.checkride-summary .metric-value,
.results-section.checkride-summary .summary-bar-label,
.results-section.checkride-summary .tile-label,
.results-section.checkride-summary .instance-pricing-row {
    color: inherit;
}
.results-section.checkride-summary .tile-value,
.results-section.checkride-summary .runiq-pie-value,
.results-section.checkride-summary .runiq-value,
.results-section.checkride-summary .summary-bar-value {
    color: #fff;
}
.results-section.checkride-summary .results-top-tile {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}
.results-section.checkride-summary .summary-footer {
    border-top-color: rgba(255, 255, 255, 0.2);
    color: #c5d4e8;
}
.results-section.checkride-summary .runiq-score-caption .metric-label {
    color: rgba(255, 255, 255, 0.85);
}
.results-section.checkride-summary .runiq-pie::before {
    background: #0a1b60;
}
.results-section.checkride-summary .summary-bar-track {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.15);
}
.results-section.checkride-summary .summary-bars {
    border: none;
}

.results-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.metrics-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 6px;
}

.metric-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.metric-value {
    font-weight: 600;
    color: var(--text-primary);
}

.params-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Configuration Parameters table (replaces chips) */
.params-container.params-table-wrap {
    display: block;
    overflow-x: auto;
}
.params-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.params-table th,
.params-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.params-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-color);
}
.params-table td.param-name,
.params-table td.param-value {
    font-family: inherit;
    font-size: inherit;
}
.params-table td.param-name {
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    width: 1%;
}
.params-table td.param-value {
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
}
.params-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.03);
}
.params-table .no-params {
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem;
}

.param-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    white-space: nowrap;
    max-width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.param-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    background: var(--primary-hover);
}

.param-chip-key {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.param-chip-value {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* Legacy styles for backward compatibility */
.param-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 6px;
}

.param-key {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 150px;
}

.param-value {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

.no-params {
    color: var(--text-secondary);
    font-style: italic;
    padding: 1rem;
    text-align: center;
}

/* Detailed Results modal and Checkride summary */
.detailed-results-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.detailed-results-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 6px;
}

.detailed-results-tab:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.detailed-results-tab.active {
    background: var(--primary-color);
    color: white;
}

.detailed-results-content {
    min-height: 200px;
}

.detailed-results-pane.hidden {
    display: none;
}

.detailed-results-pane {
    padding: 0.5rem 0;
}

.runiq-score-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-size: 1.1rem;
}

.runiq-score-heading .metric-label {
    color: rgba(255, 255, 255, 0.95);
}

.runiq-value {
    font-size: 1.25rem;
}

.results-section.checkride-summary .runiq-score-heading {
    margin-top: 0;
}

/* Top area above RunIQ score – headings + 3 tiles: POWER | PERFORMANCE | COST */
.results-top-tiles-wrap {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.results-top-tiles-headings {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.results-top-tiles-headings .tile-heading {
    flex: 1;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}
.results-top-tiles {
    display: flex;
    gap: 1rem;
}
.results-top-tile {
    flex: 1;
    min-height: 80px;
    padding: 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
/* Standard size and font for all 3 tiles above RunIQ Score */
.results-top-tile .tile-label {
    display: block;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    text-transform: none;
}
.results-top-tile .tile-value {
    display: block;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
}
.results-top-tile-center {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
}
.tile-center-part {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 0.75rem;
}
.tile-center-part .tile-label {
    margin-bottom: 0.35rem;
}
.tile-center-divider {
    width: 1px;
    background-color: var(--text-secondary);
    opacity: 0.5;
    align-self: stretch;
    flex-shrink: 0;
}

/* RunIQ pie chart (out of 100) – centered */
.runiq-pie-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.5rem;
}

.runiq-score-chart-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.runiq-pie-wrap {
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}

.runiq-pie {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(
        var(--pie-color, #2e7d32) 0deg,
        var(--pie-color, #2e7d32) calc(var(--pct, 0) * 3.6deg),
        var(--bg-color) calc(var(--pct, 0) * 3.6deg),
        var(--bg-color) 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.runiq-pie::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: inset 0 0 0 2px var(--border-color);
}

.runiq-pie-value {
    position: relative;
    z-index: 1;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.runiq-score-caption .metric-label {
    display: block;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.runiq-score-caption .runiq-value {
    font-size: 1.5rem;
    color: var(--text-primary);
}

/* Summary bars (0–100) – reduced height, value outside bar to the right */
.summary-bars {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.summary-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 420px;
    justify-content: center;
}

.summary-bar-label {
    flex: 0 0 120px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: right;
}

.summary-bar-track-wrap {
    flex: 1 1 auto;
    min-width: 80px;
    max-width: 200px;
}

.summary-bar-track {
    width: 100%;
    height: 12px;
    min-width: 60px;
    background: var(--bg-color);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.summary-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.4s ease;
}

.summary-bar-value-wrap {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-width: 2.5rem;
}

.summary-bar-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

/* Compare view: step-up (green) / step-down (red) icons next to summary values */
.summary-compare-icon {
    display: inline-block;
    margin-left: 0.2rem;
    font-size: 0.85em;
    vertical-align: middle;
    line-height: 1;
}
.summary-compare-icon.summary-compare-up {
    color: #22c55e;
}
.summary-compare-icon.summary-compare-down {
    color: #ef4444;
}

.summary-footer {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.summary-footer-instance-pricing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.summary-footer .instance-pricing-row {
    font-weight: 500;
    line-height: 1.5;
}

.summary-footer .metric-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.summary-footer .metric-value {
    font-weight: 600;
    color: var(--text-primary);
}

.results-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-detailed-results {
    margin-top: 0.25rem;
}

/* Detailed Results inline (below summary, same screen) */
.detailed-results-inline {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
    outline: none;
}

.detailed-results-inline:empty {
    display: none;
}

.detailed-results-inline-heading {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
}

.detailed-results-inline-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.detailed-results-inline-tab {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.detailed-results-inline-tab:hover {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.detailed-results-inline-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.detailed-results-inline-panes {
    min-height: 120px;
}

.detailed-results-inline-pane {
    padding: 0.5rem 0;
}

.detailed-results-inline-pane.hidden {
    display: none;
}

.detail-pane-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.detail-section-box {
    margin-top: 0;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    width: fit-content;
    max-width: 100%;
}

.detail-pane-center .detail-params-nested,
.detail-pane-center .detail-nested-section {
    width: fit-content;
    max-width: 100%;
}

/* Show All tab: horizontal scroll of all section boxes */
.detail-show-all-row {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem 0 1rem 0;
    scroll-behavior: smooth;
}

.detail-show-all-card {
    flex: 0 0 auto;
    min-width: 320px;
    max-width: 380px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}

.detail-show-all-card-heading {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0;
}

.detail-show-all-card-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.detail-params-grid,
.detail-params-nested {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.detail-param-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    max-width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-color);
    border-radius: 6px;
    font-size: 1rem;
}

.detail-param-key {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 1rem;
}

.detail-param-val {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.detail-nested-section {
    margin-top: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
}

.detail-nested-section h5 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.raw-json {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 60vh;
    overflow-y: auto;
}

/* Comparison Styles */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.comparison-table th,
.comparison-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    left: 0;
}

.comparison-table tr:hover {
    background: var(--bg-color);
}

.comparison-table td:first-child {
    font-weight: 500;
    background: var(--bg-color);
    position: sticky;
    left: 0;
    z-index: 1;
}

/* Compare Results Modal */
.compare-results-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.compare-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.compare-result-item:hover {
    border-color: var(--primary-color);
    background: var(--bg-color);
}

.compare-result-item.selected {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.compare-result-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.compare-result-info {
    flex: 1;
}

.compare-result-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.compare-result-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-results {
    background-color: #10b981;
    color: white;
    border: none;
}

.btn-results:hover {
    background-color: #059669;
}

