.cvl-app,
.cvl-app * {
    box-sizing: border-box;
}

.cvl-app {
    --cvl-primary: #2563eb;
    --cvl-primary-dark: #1d4ed8;
    --cvl-text: #172033;
    --cvl-muted: #687386;
    --cvl-border: #dce3ee;
    --cvl-surface: #ffffff;
    --cvl-soft: #f6f8fc;
    --cvl-red: #ef4444;
    --cvl-orange: #f59e0b;
    --cvl-blue: #2563eb;
    --cvl-green: #16a34a;
    width: 100%;
    max-width: 980px;
    margin: 28px auto;
    padding: clamp(18px, 3vw, 32px);
    color: var(--cvl-text);
    background: var(--cvl-surface);
    border: 1px solid var(--cvl-border);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(23, 32, 51, .10);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cvl-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.cvl-header-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    flex: 0 0 58px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .25);
}

.cvl-header-icon svg,
.cvl-drop-icon svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.cvl-header h2 {
    margin: 0 0 5px;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.1;
    letter-spacing: -.03em;
}

.cvl-header p {
    margin: 0;
    color: var(--cvl-muted);
    line-height: 1.55;
}

.cvl-security-note {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0 0 20px;
    padding: 12px 15px;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    font-size: 14px;
}

.cvl-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.cvl-field,
.cvl-item-options label {
    display: grid;
    gap: 7px;
    color: var(--cvl-text);
    font-size: 13px;
    font-weight: 700;
}

.cvl-app input,
.cvl-app select {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    color: var(--cvl-text);
    background: #fff;
    border: 1px solid var(--cvl-border);
    border-radius: 10px;
    outline: none;
    font: inherit;
    transition: border-color .2s, box-shadow .2s;
}

.cvl-app input:focus,
.cvl-app select:focus {
    border-color: var(--cvl-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.cvl-input-unit {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--cvl-border);
    border-radius: 10px;
}

.cvl-input-unit input {
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
}

.cvl-input-unit > span {
    padding: 0 13px;
    color: var(--cvl-muted);
    font-size: 13px;
    font-weight: 800;
}

.cvl-dropzone {
    display: grid;
    place-items: center;
    min-height: 230px;
    padding: 28px;
    text-align: center;
    cursor: pointer;
    background: var(--cvl-soft);
    border: 2px dashed #b8c5d8;
    border-radius: 18px;
    transition: transform .2s, border-color .2s, background .2s;
}

.cvl-dropzone:hover,
.cvl-dropzone:focus,
.cvl-dropzone.is-dragging {
    transform: translateY(-2px);
    background: #eff6ff;
    border-color: var(--cvl-primary);
    outline: none;
}

.cvl-drop-icon {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    color: var(--cvl-primary);
    background: #dbeafe;
    border-radius: 50%;
}

.cvl-dropzone strong {
    display: block;
    margin-bottom: 4px;
    font-size: 20px;
}

.cvl-dropzone > span {
    color: var(--cvl-muted);
}

.cvl-dropzone small {
    display: block;
    margin-top: 10px;
    color: #8993a4;
}

.cvl-toolbar {
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0 10px;
    padding: 12px 0;
}

.cvl-toolbar:not([hidden]) {
    display: flex;
}

.cvl-toolbar-actions,
.cvl-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.cvl-btn {
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    transition: transform .15s, opacity .15s, background .15s;
}

.cvl-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.cvl-btn:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.cvl-btn-primary {
    color: #fff;
    background: var(--cvl-primary);
}

.cvl-btn-primary:hover:not(:disabled) {
    background: var(--cvl-primary-dark);
}

.cvl-btn-secondary {
    color: var(--cvl-text);
    background: #e9eef6;
}

.cvl-btn-danger {
    color: #fff;
    background: var(--cvl-red);
}

.cvl-btn-success {
    color: #fff;
    background: var(--cvl-green);
}

.cvl-engine-status {
    min-height: 22px;
    margin: 4px 0 8px;
    color: var(--cvl-muted);
    font-size: 14px;
}

.cvl-list {
    display: grid;
    gap: 14px;
}

.cvl-item {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--cvl-border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(23, 32, 51, .06);
}

.cvl-progress-wrap {
    position: relative;
    width: 82px;
    height: 82px;
    align-self: center;
}

.cvl-progress-ring {
    width: 82px;
    height: 82px;
    transform: rotate(-90deg);
}

.cvl-ring-bg,
.cvl-ring-value {
    fill: none;
    stroke-width: 7;
}

.cvl-ring-bg {
    stroke: #e7ebf2;
}

.cvl-ring-value {
    stroke: var(--cvl-red);
    stroke-linecap: round;
    stroke-dasharray: 188.4956;
    stroke-dashoffset: 188.4956;
    transition: stroke-dashoffset .25s ease, stroke .25s ease;
}

.cvl-progress-text {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 900;
}

.cvl-item-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.cvl-file-info {
    min-width: 0;
}

.cvl-file-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
}

.cvl-file-meta {
    display: block;
    margin-top: 4px;
    color: var(--cvl-muted);
    font-size: 13px;
}

.cvl-remove {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    color: #667085;
    background: #f1f4f8;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font-size: 23px;
    line-height: 1;
}

.cvl-item-options {
    display: grid;
    grid-template-columns: minmax(150px, 210px) minmax(150px, 210px);
    gap: 12px;
    margin: 14px 0;
}

.cvl-small-input {
    min-width: 0;
}

.cvl-status-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    min-height: 24px;
    margin-bottom: 12px;
    color: var(--cvl-muted);
    font-size: 13px;
}

.cvl-status.is-error {
    color: #b91c1c;
    font-weight: 700;
}

.cvl-status.is-success {
    color: #15803d;
    font-weight: 800;
}

.cvl-result-size {
    font-weight: 800;
}

.cvl-item.is-processing {
    border-color: #93c5fd;
    box-shadow: 0 10px 30px rgba(37, 99, 235, .12);
}

.cvl-item.is-complete {
    border-color: #86efac;
}

@media (max-width: 700px) {
    .cvl-app {
        margin: 14px auto;
        border-radius: 17px;
    }

    .cvl-controls,
    .cvl-item-options {
        grid-template-columns: 1fr;
    }

    .cvl-toolbar:not([hidden]) {
        align-items: stretch;
        flex-direction: column;
    }

    .cvl-toolbar-actions .cvl-btn {
        flex: 1;
    }

    .cvl-item {
        grid-template-columns: 1fr;
    }

    .cvl-progress-wrap {
        justify-self: center;
    }

    .cvl-status-row {
        flex-direction: column;
    }
}
