.cdb-app {
    color: #e2e8f0;
    font-family: "Segoe UI", Arial, sans-serif;
    display: block;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: clamp(28px, 4vw, 56px) 0;
    background:
        radial-gradient(circle at 20% 15%, rgba(61, 213, 152, 0.14), transparent 24%),
        radial-gradient(circle at 80% 0%, rgba(56, 189, 248, 0.15), transparent 28%),
        linear-gradient(180deg, #0b1222 0%, #111a2f 48%, #0a1120 100%);
    overflow: hidden;
    position: relative;
    isolation: isolate;
}

.cdb-app *,
.cdb-app *::before,
.cdb-app *::after {
    box-sizing: border-box;
}

.cdb-container {
    width: min(1520px, calc(100vw - 40px));
    max-width: none;
    margin: 0 auto;
    padding: 0 20px;
}

.cdb-header {
    margin-bottom: 22px;
    padding: 12px 4px 6px;
}

.cdb-header h1 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(30px, 4vw, 52px);
    line-height: 1.02;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.cdb-subtitle {
    margin: 10px 0 0;
    color: rgba(226, 232, 240, 0.88);
    font-size: clamp(15px, 1.6vw, 20px);
    max-width: 860px;
}

.cdb-card {
    background: radial-gradient(circle at top left, rgba(31, 42, 68, 0.9), rgba(5, 10, 22, 0.96));
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 24px 70px rgba(2, 6, 23, 0.34);
}

.cdb-layout {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 24px;
    align-items: start;
}

.cdb-form-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cdb-app label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 600;
    color: #f8fafc;
}

.cdb-app input[type="file"],
.cdb-app select,
.cdb-app input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.cdb-app input[type="file"]:focus,
.cdb-app select:focus,
.cdb-app input[type="number"]:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.24);
}

.cdb-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.cdb-checkbox input[type="checkbox"] {
    margin: 0;
}

.cdb-app button {
    width: 100%;
    margin-top: 20px;
    padding: 12px 16px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(120deg, #3dd598, #14b8a6);
    color: #041019;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease, filter 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cdb-app button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 40px rgba(20, 184, 166, 0.32);
    filter: brightness(1.04);
}

.cdb-app button:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cdb-secondary-button {
    background: rgba(148, 163, 184, 0.12) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    margin-top: 0 !important;
}

.cdb-footer-row {
    display: flex;
}

.cdb-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: cdb-spin 0.8s linear infinite;
    display: none;
}

.cdb-loading .cdb-loader {
    display: inline-block;
}

@keyframes cdb-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.cdb-alert,
.cdb-success {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
}

.cdb-alert {
    background: rgba(127, 29, 29, 0.9);
    border: 1px solid rgba(248, 113, 113, 0.75);
    color: #fff1f2;
}

.cdb-success {
    background: rgba(6, 95, 70, 0.9);
    border: 1px solid rgba(52, 211, 153, 0.6);
    color: #ecfdf5;
}

.cdb-hidden {
    display: none !important;
}

.cdb-hint {
    color: #94a3b8;
    font-size: 13px;
    margin-top: 6px;
}

.cdb-file-pill {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #e2e8f0;
}

.cdb-advanced {
    margin-top: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px;
}

.cdb-advanced summary {
    cursor: pointer;
    font-weight: 700;
    color: #f8fafc;
}

.cdb-advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.cdb-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.cdb-preview-item {
    text-align: left;
}

.cdb-preview-label {
    margin-bottom: 6px;
    font-weight: 700;
    color: #cbd5e1;
    font-size: 14px;
}

.cdb-preview-box {
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 260px;
}

.cdb-preview-box img {
    max-width: 95%;
    max-height: 95%;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #ffffff;
    padding: 16px;
    border-radius: 10px;
}

.cdb-status-card h2,
.cdb-preview-card h2 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #f8fafc;
}

.cdb-status-card a {
    color: #7dd3fc;
}

@media (min-width: 1200px) {
    .cdb-layout {
        grid-template-columns: minmax(0, 1.45fr) minmax(420px, 0.9fr);
    }
}

@media (max-width: 900px) {
    .cdb-app {
        width: auto;
        max-width: none;
        margin-left: -20px;
        margin-right: -20px;
        padding: 20px 0 28px;
    }

    .cdb-layout {
        grid-template-columns: 1fr;
    }

    .cdb-container {
        width: 100%;
        padding: 0 18px;
    }

    .cdb-card {
        padding: 18px;
    }
}
