﻿#theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: left;
}

.build-info {
    font-size: 12px;
}

    .build-info a {
        color: #ffffff !important;
        text-decoration: none;
        opacity: 1;
    }

        .build-info a:hover {
            color: #ffffff !important;
            text-decoration: underline;
        }

/* -------------------------------------------------
    Report Build Error button
------------------------------------------------- */

.btn-report-build {
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-help {
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-report-build:active {
    transform: translateY(1px);
}

/* Hide on small screens */
@media (max-width: 720px) {
    .btn-report-build {
        display: none;
    }
}

/* FIX BUILD BUTTON */
/* Build error action buttons */
.fix-build-btn,
.upgrade-model-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    min-width: 170px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

.fix-build-btn {
    background: #2563eb;
    border: 1px solid #1d4ed8;
    color: #fff;
}

    .fix-build-btn:hover {
        background: #1d4ed8;
    }

    .fix-build-btn:active {
        transform: translateY(1px);
    }

.build-error-block {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.message,
.assistant-content,
pre {
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 940px) {
    .btn-help {
        display: none;
    }

    .about-link {
        display: none;
    }
}

@media (max-width: 950px) {
    .update-link {
        display: none;
    }
}

@media (max-width: 1300px) {
    .hide-1300-link {
        display: none;
    }
}

@media (max-width: 800px) {
    .hide-800-link {
        display: none;
    }
}

@media (max-width: 550px) {
    .cp-btn--primary-workflow {
        display: none;
    }
}

@media (max-width: 600px) {
    .btn-topup {
        display: none;
    }
}

.account-link {
    text-decoration: none;
    margin-right: 12px;
}

#prompt {
    width: 100%;
    min-width: 0;
    padding: 8px 12px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    white-space: pre-wrap;
    line-height: 1.3;
    resize: none; /* required */
    flex: 0 0 auto; /* do NOT use flex: 1 */
    height: auto;
    overflow-y: hidden; /* required */
    max-width: 1000px;
    min-height: 48px;
    max-height: 50vh;
    width: 100%;
    resize: none;
    min-width: 0;
    box-sizing: border-box;
    border-radius: 12px;
}

    #prompt:hover {
        border: 1px solid #1f6feb;
    }

.assistant-content {
    margin-top: 30px;
    margin-bottom: 30px;
}

.platform-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background-color: #062c73;
    border-bottom: 1px solid #2a2f3a;
    color: #e5e7eb;
}

    .platform-status.hidden {
        display: none;
    }

.platform-status-content {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

    .platform-status-content strong {
        font-weight: 600;
        color: #ffffff;
    }

.platform-status button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

    .platform-status button:hover {
        color: #ffffff;
        font-weight: 700;
    }

.model-selector {
    display: flex;
    align-items: center;
    gap: 6px;
}

.model-select {
    background: #111827;
    border: 1px solid #5695e5;
    color: #e5e7eb;
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    margin-left: 45px;
}

    .model-select:hover {
        border-color: #4b5563;
    }

    .model-select:focus {
        outline: none;
        border-color: #60a5fa;
    }

.cp-btn-api {
    border-color: rgba(180, 180, 180, 0.45);
    background: rgba(255, 255, 255, 0.05);
}

.cp-model-bar {
    display: flex;
    align-items: center;
    gap: 14px; /* real breathing room */
}

.cp-inline-help {
    margin-left: 25px; /* hard separation from control */
    margin-right: 4px;
    font-size: 0.75rem;
    color: #8fd3ff;
    text-decoration: none;
    white-space: nowrap;
}

    .cp-inline-help:hover {
        text-decoration: underline;
    }

.cp-inline-version {
    margin-left: 5px;
    font-size: 0.7rem;
    text-decoration: none;
    white-space: nowrap;
}

    .cp-inline-version::after {
        margin-left: 5px;
        padding: 1px 6px;
        border-radius: 999px;
        font-size: 0.6rem;
    }

.cp-model-info-link {
    color: #3b82f6;
    opacity: 0.75;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

    .cp-model-info-link:hover {
        color: #2563eb;
    }

    .cp-model-info-link:focus {
        outline: 2px solid #93c5fd;
        outline-offset: 2px;
        border-radius: 4px;
    }

    .cp-model-info-link:active {
        color: #1d4ed8;
    }

.input-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-right {
    margin-left: auto;
    display: flex;
    align-items: center;
}

/* Primary header workflow button */
.cp-btn--primary-workflow {
    background: radial-gradient(1200px 600px at 50% -200px, #7001d3 0%, #470b7d 60%);
    border: 1px solid #2f80ed;
    color: #ffffff;
    font-weight: 600;
    padding: 8px 18px;
    font-size: 12px;
    letter-spacing: 0.3px;
    transition: all 0.15s ease-in-out;
}

    .cp-btn--primary-workflow:hover {
        background: linear-gradient(135deg, #3b8bfd, #2456e6);
        box-shadow: 0 0 10px rgba(47, 128, 237, 0.35);
        transform: translateY(-1px);
    }

    .cp-btn--primary-workflow:active {
        transform: translateY(0);
        box-shadow: none;
    }

.cp-toolbar-sep {
    width: 1px;
    height: 28px;
    background: #3e3a3a;
    margin: 0 6px;
}

/*------------------------------------*/
/* Toggle button - SAVE HISTORY PANEL */
/*------------------------------------*/
.cp-history-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .cp-history-toggle:active {
        transform: translateY(1px);
    }

/* Open state */
.cp-history-panel.open {
    transform: translateX(0);
}

/* Panel content */
.cp-history-header {
    padding: 16px;
    border-bottom: 1px solid #1e293b;
}

    .cp-history-header h3 {
        margin: 0;
        font-size: 16px;
    }

.cp-history-content {
    padding: 16px;
    font-size: 14px;
    line-height: 1.5;
}

/* Desktop only */
@media (max-width: 900px) {
    .cp-history-panel,
    .cp-history-toggle {
        display: none;
    }
}

/* Conversation History Panel */
.cp-history-panel {
    position: fixed;
    overflow: hidden;
    top: 56px;
    left: 0;
    width: 400px;
    height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1000;
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.04), 2px 0 12px rgba(0,0,0,0.5);
}

.cp-history-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 16px;
    box-sizing: border-box;
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

.cp-history-empty {
    font-size: 13px;
    color: #9ca3af;
}

.cp-history-footer {
    padding: 12px;
    border-top: 1px solid #1e293b;
}

.cp-history-save {
    padding: 8px;
    border: none;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
    width: 95%;
}

    /* Disabled state */
    .cp-history-save:disabled {
        background: #1f2937;
        color: #9ca3af;
        cursor: not-allowed;
        opacity: 0.6;
    }

    /* Enabled state */
    .cp-history-save:not(:disabled) {
        background: #2563eb;
        color: #ffffff;
        cursor: pointer;
    }

        /* Hover (enabled only) */
        .cp-history-save:not(:disabled):hover {
            background: #1d4ed8;
        }

/* ------------------------------------
   History save form
------------------------------------ */

.cp-history-form {
    padding: 12px;
    border-top: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    /* Labels */
    .cp-history-form label {
        font-size: 12px;
        margin-top: 4px;
    }

/* Title input */
#cp-history-title {
    width: 91%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #67696c;
    font-size: 14px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    #cp-history-title::placeholder {
        color: #6b7280;
    }

    #cp-history-title:focus {
        outline: none;
        border-color: #2563eb;
    }

/* Summary textarea */
#cp-history-summary {
    width: 91%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #6c6e73;
    font-size: 13px;
    resize: vertical;
    min-height: 70px;
}

    #cp-history-summary::placeholder {
        color: #6b7280;
    }

    #cp-history-summary:focus {
        outline: none;
        border-color: #2563eb;
    }

/* ------------------------------------
   Saved conversation list
------------------------------------ */

.cp-history-saved {
    padding: 10px 12px 12px;
    border-top: 1px solid #1e293b;
    gap: 6px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}


.cp-history-saved-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
    margin-top: 25px;
}

/* Conversation row */
.cp-history-item {
    padding: 14px 44px 14px 16px;
    border-radius: 14px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    margin-top: 10px;
    margin-left: 5px;
}

    .cp-history-item:hover {
        border: 1px solid #10e3d2;
    }

    .cp-history-item.active {
        border-color: #10e3d2;
        box-shadow: 0 0 0 1px rgba(59,130,246,0.35);
    }

.cp-history-delete {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(111 45 45 / 94%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.cp-history-row:hover .cp-history-delete {
    opacity: 1;
}

.cp-history-delete:hover {
    background: rgb(165 48 48 / 94%);
    color: #fff;
}

.cp-history-row {
    position: relative;
    margin-bottom: 12px;
}

.cp-history-item:hover {
    background: linear-gradient(180deg, #020617, #020617cc);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35), 0 4px 14px rgba(56, 189, 248, 0.15);
    transform: translateY(-1px);
}

/* Empty state */
.cp-history-empty {
    font-size: 12px;
    color: #6b7280;
}

.cp-history-saved-notice {
    margin-top: 8px;
    font-size: 12px;
    color: #22c55e;
    opacity: 1;
    transition: opacity 0.3s ease;
}

    .cp-history-saved-notice.hide {
        opacity: 0;
    }

.cp-icon-trash {
    width: 16px;
    height: 16px;
    fill: currentColor;
    pointer-events: none; /* click stays on button */
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

.app__main {
    height: 100vh;
}

#chat {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    min-height: 0;
    padding-bottom: 60px;
    scroll-behavior: smooth;
    max-width: 1000px;
    margin: 0 auto;
    padding-right: 24px;
    padding-left: 24px;
}

    #chat::-webkit-scrollbar {
        width: 4px;
    }

    #chat::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.25);
        border-radius: 6px;
    }

.cp-welcome {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 24px 24px
}

.cp-grid {
    width: 100%;
    box-sizing: border-box;
    padding: 0 10px;
}


/* =========================================
   Xen Sidebar (Standalone Version)
========================================= */
/* Layout wrapper */
.app {
    display: flex;
    width: 100%;
    min-height: 100%;
}

/* Container */
.app__container {
    display: flex;
    width: 100%;
}

/* Main content area */
.app__main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 1650px;
    margin: 0 auto;
}

.app__aside {
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    background: linear-gradient(180deg, #1a1d2e 0%, #2e313f 100%);
    display: flex;
    flex-direction: column;
    color: #ffffff;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* -----------------------------------------
   Header
----------------------------------------- */

.app__aside-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px;
}

.ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2b2a3c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.sidebar-toggle {
    display: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 6px 10px;
}

@media (max-width: 1100px) {
    .sidebar-toggle {
        display: block;
    }
}

/* -----------------------------------------
   Body
----------------------------------------- */

.app__aside-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 12px 18px 12px;
    overflow: hidden;
    /*background: linear-gradient(180deg, #121426 0%, #0e1020 100%);*/
}

/* -----------------------------------------
   Model List
----------------------------------------- */

.app__aside-ai-list {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-top: 10px;
}

    .app__aside-ai-list li {
        margin-bottom: 12px;
    }

.app__aside-ai-link {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgb(255 255 255 / 23%);
    background: rgba(255, 255, 255, .05);
    border-radius: 6px;
    color: #fff !important;
    font-family: Manrope;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 140%;
    padding: 6px 14px;
    margin-bottom: 20px;
    transition: all .3s ease 0s;
    text-decoration: none;
}

.app__aside-toggle:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff !important
}

.app__aside-ai-link:not(.active):hover {
    border-color: #fff;
    color: #fff !important
}

.app__aside-ai-link img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* -----------------------------------------
   Footer
----------------------------------------- */

.app__aside-footer {
    display: flex;
    flex-direction: column;
    margin-top: auto;
    padding-bottom: 5px;
    gap: 6px;
}

.app__aside-user,
.app__aside-settings {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    text-align: left;
    transition: color 0.2s ease;
}

    .app__aside-user:hover,
    .app__aside-settings:hover {
        color: #10fb06;
    }

.app__aside-user-icon,
.app__aside-settings-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app__aside-user-name,
.app__aside-settings-name {
    font-size: 12px;
    font-weight: 500;
}

/* -----------------------------------------
   Responsive Behaviour
----------------------------------------- */

@media (max-width: 1100px) {
    .app__aside {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100vh;
        z-index: 2000; /* higher than content */
        transition: left 0.3s ease;
    }

        .app__aside.open {
            left: 0;
        }
}

.app__aside-user-email {
    font-size: 12px;
    opacity: 0.55;
    margin-top: 18px;
    text-align: center;
    letter-spacing: 0.2px;
}

.app__aside-user-email {
    border-top: 1px solid rgb(196 101 214 / 71%);
    padding-top: 14px;
}

.model-tier {
    font-size: 12px;
    opacity: 0.65;
    margin-left: 6px;
}

/*Feedback buttons*/

.feedback-controls {
    margin-top: 6px;
    display: flex;
    gap: 8px;
}

.thumb-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    /*opacity: 0.7;*/
    transition: 0.15s ease;
}

    .thumb-btn:disabled {
        opacity: 0.4;
        cursor: default;
    }

/*Verify Build Button*/

.verify-success {
    background: #0f5132 !important;
    border-color: #198754 !important;
    color: #d1e7dd !important;
}

.verify-failed {
    background: #58151c !important;
    border-color: #dc3545 !important;
    color: #f8d7da !important;
}

.verify-building {
    background: #3b82f6;
    border-color: #2563eb;
    animation: verifyPulseMedium 1.3s ease-in-out infinite;
    transform-origin: center;
}

@keyframes verifyPulseMedium {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.6), 0 0 8px 3px rgba(59, 130, 246, 0.35);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 14px 5px rgba(59, 130, 246, 0.45), 0 0 22px 8px rgba(37, 99, 235, 0.25);
        transform: scale(1.02);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.6), 0 0 8px 3px rgba(59, 130, 246, 0.35);
        transform: scale(1);
    }
}

.build-error-block {
    margin-top: 14px;
    padding: 16px 18px 18px;
    border-radius: 10px;
}

.build-error-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #f87171;
}

.build-error-content {
    font-size: 12px;
    white-space: pre-wrap;
}

.code-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
    margin-bottom: 30px;
}

.convert-open-file-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 6px 0 12px 0;
}

.convert-open-file-btn {
    background: #6F42D9;
    border: 1px solid #5b36b3;
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s ease;
    margin-top: 20px
}

    .convert-open-file-btn:hover {
        background: #5b36b3;
    }

/* Clear Button */

.clear-btn {
    height: 36px;
    padding: 0 16px;
    border-radius: 6px;
    border: 1px solid #7c7e81;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

    .clear-btn:hover {
        background: #374151;
        border-color: #475569;
    }

    .clear-btn:active {
        transform: translateY(1px);
    }

/* Light theme */

body.light .clear-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    color: #111827;
}

    body.light .clear-btn:hover {
        background: #e5e7eb;
    }

/* Chat Drop Highlight */

#prompt.chat-drop-active {
    outline: 2px dashed #2563eb !important;
    outline-offset: -4px;
    background: rgba(37, 99, 235, 0.08) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3) inset;
}

/* video guides */
.xen-video-guide {
    font-size: 12px;
    text-decoration: none;
    margin-right: 12px;
    transition: color 0.15s ease;
}

.model-group-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 18px 0 6px 6px;
    opacity: 0.65;
}

.convert-open-file-btn {
    background: linear-gradient(135deg,#6f42d9,#8b5cf6);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
    transition: background .15s ease, transform .05s ease;
}

    .convert-open-file-btn:hover {
        background: linear-gradient(135deg,#7c55e3,#9b6bff);
    }

    .convert-open-file-btn:active {
        transform: translateY(1px);
    }

.image-upload-preview {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px dashed rgba(255,255,255,0.35);
    background: rgba(15,23,42,0.65);
    display: inline-block;
    position: relative;
}


.image-upload-label {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 6px;
}


.image-upload-preview img {
    max-width: 100%;
    max-height: 260px;
    border-radius: 6px;
    display: block;
}

.image-upload-preview img {
    object-fit: contain;
}

/* feedback comments textbox.*/
.feedback-comment {
    margin-top: 8px;
    margin-top: 10px;
    max-width: 420px;
}

    .feedback-comment textarea {
        min-height: 70px;
        resize: vertical;
        font-size: 13px;
        padding: 8px 10px;
        border-radius: 6px;
        border: 1px solid #475569;
        box-sizing: border-box;
        width: 400px;
        padding-right: 40px;
    }

        .feedback-comment textarea::placeholder {
            color: #6b7280;
        }

        .feedback-comment textarea:focus {
            outline: none;
            border-color: #2563eb;
        }

.feedback-submit {
    margin-top: 6px;
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid #1d4ed8;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.15s ease;
}

    .feedback-submit:hover {
        background: #1d4ed8;
    }

.feedback-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.feedback-buttons {
    display: flex;
    gap: 8px;
}

.feedback-thanks {
    font-size: 12px;
    color: #22c55e;
    margin-top: 4px;
}

/* remove image */
.remove-image-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 14px;
    line-height: 22px;
    cursor: pointer;
    padding: 0;
}

    .remove-image-btn:hover {
        background: rgba(255,0,0,0.8);
    }

.input-locked {
    background: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.1);
}

    .input-locked::placeholder {
        color: #6b7280;
    }

.upgrade-model-btn {
    border: 1px solid rgb(47 231 11 / 39%);
    background: linear-gradient(180deg, #182235 0%, #111827 100%);
    color: #f3f4f6;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

    .upgrade-model-btn:hover {
        border-color: rgb(255 255 255 / 56%);
        background: linear-gradient(180deg, #1d2940 0%, #162033 100%);
    }

    .upgrade-model-btn:active {
        transform: translateY(1px);
        background: #0f172a;
    }

    .fix-build-btn:focus-visible,
    .upgrade-model-btn:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
    }

.build-error-actions {
    display: flex;
    gap: 14px;
    align-items: stretch;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-wrap: wrap;
}

.badge-low {
    background: rgb(168 176 169 / 30%);
    color: #17d039;
    font-size: 8px;
    padding: 2px 5px;
    border-radius: 5px;
    margin-left: 6px;
    font-weight: 600;
}

/* developer mode */
.mode-toggle {
    display: flex;
    align-items: center;
    height: 100%;
    margin-left: 12px;
}

/* wrapper keeps everything aligned */
.switch-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* text */
.mode-text {
    font-size: 13px;
    line-height: 1;
}

/* switch */
.switch {
    position: relative;
    width: 42px;
    height: 22px;
    display: inline-block;
}

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    inset: 0;
    background-color: #2c3e50;
    border-radius: 20px;
    transition: 0.25s;
}

    .slider::before {
        content: "";
        position: absolute;
        width: 16px;
        height: 16px;
        left: 3px;
        top: 3px;
        background: #fff;
        border-radius: 50%;
        transition: 0.25s;
    }

.switch input:checked + .slider {
    background: linear-gradient(135deg, #7b61ff, #5c7cff);
}

    .switch input:checked + .slider::before {
        transform: translateX(20px);
    }

/* feedback escalation */
.feedback-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.feedback-dev-link {
    font-size: 13px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

    .feedback-dev-link:hover {
        text-decoration: underline;
    }

.feedback-thanks {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.45;
    color: #d1d5db;
}

.feedback-escalation-text {
    margin-top: 8px;
    color: #b1b4b9;
}

.feedback-escalation-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border: none;
    transition: background 0.2s ease, transform 0.05s ease;
}

    .feedback-escalation-btn:hover {
        background: #1d4ed8;
    }

    .feedback-escalation-btn:active {
        transform: scale(0.98);
    }

.cp-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.backtest-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.backtest-modal-content {
    width: 100%;
    max-width: 520px;
    background: linear-gradient(180deg, #171717 0%, #111111 100%);
    border: 1px solid rgba(255, 255, 255, 0.33);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    padding: 24px;
    color: #f3f4f6;
}

    .backtest-modal-content h3 {
        margin: 0 0 10px 0;
        font-size: 24px;
        line-height: 1.2;
        font-weight: 700;
        color: #ffffff;
    }

    .backtest-modal-content p {
        font-size: 14px;
        line-height: 1.55;
        color: #c7cbd1;
    }

.backtest-upload-group {
    margin-bottom: 16px;
}

    .backtest-upload-group label {
        display: block;
        margin-bottom: 8px;
        font-size: 13px;
        font-weight: 600;
        color: #e5e7eb;
    }

    .backtest-upload-group input[type="file"] {
        display: block;
        width: 100%;
        font-size: 13px;
        color: #cbd5e1;
        background: #0d1117;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        padding: 10px 12px;
        box-sizing: border-box;
    }

        .backtest-upload-group input[type="file"]::file-selector-button {
            margin-right: 12px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            background: #1f2937;
            color: #f9fafb;
            padding: 8px 12px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 600;
            transition: background 0.15s ease, border-color 0.15s ease;
        }

            .backtest-upload-group input[type="file"]::file-selector-button:hover {
                background: #273244;
                border-color: rgba(255, 255, 255, 0.18);
            }

.backtest-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

    .backtest-modal-actions button {
        min-width: 100px;
        height: 40px;
        border-radius: 9px;
        border: 1px solid transparent;
        padding: 0 16px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    }

    .backtest-modal-actions .bt-close {
        background: transparent;
        color: #d1d5db;
        border-color: rgba(255, 255, 255, 0.12);
    }

        .backtest-modal-actions .bt-close:hover {
            background: rgba(255, 255, 255, 0.04);
        }

    .backtest-modal-actions .bt-analyse {
        background: #0f766e;
        color: #ffffff;
    }

        .backtest-modal-actions .bt-analyse:hover {
            background: #115e59;
        }

.backtest-help {
    margin-bottom: 12px;
}

.backtest-help-link {
    font-size: 13px;
    color: #60a5fa;
    text-decoration: none;
}

    .backtest-help-link:hover {
        text-decoration: underline;
    }

.backtest-analysis-message {
    margin-top: 32px !important;
    background: #2b3030 !important;
    font-size: 14px !important;
}

.backtest-analysis-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 16px;
}

.bt-analyse.is-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bt-btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    display: inline-block;
    animation: bt-spin 0.7s linear infinite;
    flex: 0 0 auto;
}

@keyframes bt-spin {
    to {
        transform: rotate(360deg);
    }
}

.backtest-analysis-note {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

.backtest-guidance {
    margin: 30px 0 30px;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    background: rgba(255,255,255,0.10);
}

    .backtest-guidance strong {
        display: block;
        margin-bottom: 8px;
        font-size: 14px;
        font-weight: 600;
    }

    .backtest-guidance p {
        margin: 0 0 10px;
        line-height: 1.5;
        font-size: 13px;
    }

        .backtest-guidance p:last-child {
            margin-bottom: 0;
        }

.link-icon {
    margin-right: 6px;
    font-size: 12px;
    opacity: 0.7;
}

.btn-analyse {
    margin-left: auto;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.report-action-btn {
    appearance: none;
    border: 1px solid rgba(255,255,255,0.18);
    background: transparent;
    color: #d7dde8;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.report-action-btn:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.28);
    color: #ffffff;
}

.print-report-btn {
    margin-right: 10px;
}

.primary-btn {
    background: #2d7ef7;
    color: #fff;
    border: none;
}

.selected-model-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    margin: 0 0 10px 4px;
    color: #d1d5db;
    background: rgb(61 180 200 / 33%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    letter-spacing: 0.2px;
}

.selected-model-label span {
    color: #ffffff;
    font-weight: 700;
}

.model-name-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.model-badge-below {
    margin-left: 0;
    width: fit-content;
}