.codulon-step-viewer {
    position: relative;
    width: 100%;
    min-height: 180px;
    border-radius: 8px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
}

.codulon-step-viewer .csv-canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
}

.codulon-step-viewer:not(.is-measuring) .csv-canvas {
    cursor: grab;
}

.codulon-step-viewer:not(.is-measuring) .csv-canvas:active {
    cursor: grabbing;
}

.codulon-step-viewer .csv-toolbar {
    position: absolute;
    z-index: 3;
    top: 12px;
    left: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: calc(100% - 24px);
    padding: 6px;
    box-sizing: border-box;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(226, 232, 240, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.codulon-step-viewer .csv-toolbar button {
    appearance: none;
    border: 1px solid rgba(226, 232, 240, 0.24);
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.codulon-step-viewer .csv-toolbar button:hover,
.codulon-step-viewer .csv-toolbar button:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(226, 232, 240, 0.42);
}

.codulon-step-viewer .csv-full-version-link {
    position: absolute;
    z-index: 3;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.78);
    color: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.18);
    font-size: 13px;
    line-height: 1;
    text-decoration: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.codulon-step-viewer .csv-full-version-link:hover,
.codulon-step-viewer .csv-full-version-link:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(226, 232, 240, 0.42);
}

.codulon-step-viewer .csv-status {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: min(520px, calc(100% - 32px));
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.84);
    color: #f8fafc;
    font-size: 14px;
    text-align: center;
    border: 1px solid rgba(226, 232, 240, 0.16);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.codulon-step-viewer .csv-status.is-error {
    background: rgba(127, 29, 29, 0.9);
    border-color: rgba(254, 202, 202, 0.35);
}

.codulon-step-viewer .csv-progress {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: calc(50% + 52px);
    transform: translateX(-50%);
    width: min(420px, calc(100% - 44px));
    height: 12px;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.2);
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.18);
}

.codulon-step-viewer .csv-progress[hidden] {
    display: none;
}

.codulon-step-viewer .csv-progress__bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: #38bdf8;
    transition: width 0.18s ease;
}

.codulon-step-viewer .csv-progress__label {
    position: absolute;
    inset: -22px 0 auto 0;
    color: #e2e8f0;
    font-size: 11px;
    text-align: center;
}

.codulon-step-viewer .csv-progress.is-indeterminate .csv-progress__bar {
    width: 42% !important;
    animation: csv-progress-slide 1.05s linear infinite;
}

@keyframes csv-progress-slide {
    0% {
        transform: translateX(-110%);
    }
    100% {
        transform: translateX(260%);
    }
}

.codulon-step-viewer-error {
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff7ed;
    color: #7c2d12;
    border: 1px solid #fed7aa;
}

.codulon-step-viewer-lite-block-placeholder {
    position: relative;
    border: 1px dashed #94a3b8;
    border-radius: 8px;
    padding: 12px;
}

.codulon-step-viewer-lite-editor-actions {
    margin: 8px 0 12px;
}

.codulon-step-viewer-lite-direct-upload-control {
    margin-top: 12px;
}

.codulon-step-viewer-lite-direct-upload-control input[type="file"] {
    max-width: 100%;
}

.codulon-step-viewer-lite-selected-file,
.codulon-step-viewer-lite-shortcode-preview {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.codulon-step-viewer-lite-selected-file code,
.codulon-step-viewer-lite-shortcode-preview {
    display: block;
    padding: 8px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #f6f7f7;
}

.codulon-step-viewer-lite-upload-progress {
    position: relative;
    height: 12px;
    margin-top: 8px;
    border-radius: 999px;
    background: #dcdcde;
    overflow: hidden;
}

.codulon-step-viewer-lite-upload-progress__bar {
    height: 100%;
    background: #2271b1;
}

.codulon-step-viewer-lite-upload-progress span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
}

@media (max-width: 640px) {
    .codulon-step-viewer .csv-toolbar {
        top: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }

    .codulon-step-viewer .csv-toolbar button {
        padding: 7px 9px;
        font-size: 12px;
    }

    .codulon-step-viewer .csv-full-version-link {
        top: auto;
        right: 10px;
        bottom: 10px;
    }
}
