:root {
    --bg-1: #09060f;
    --bg-2: #170a1b;
    --card-border: rgba(255, 255, 255, 0.14);
    --text-main: #f2eaf1;
    --text-soft: rgba(242, 234, 241, 0.78);
    --text-muted: rgba(242, 234, 241, 0.58);
    --accent: #920c6a;
    --accent-2: #c01d8e;
    --ok: #2dc98d;
    --warn: #f0b84f;
    --error: #ef5a72;
    --info: #63b8ff;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
    --font-main: "Manrope", "Segoe UI", "Arial", sans-serif;
}

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

html,
body {
    min-height: 100%;
}

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background: radial-gradient(circle at 15% 20%, #2a1235 0%, transparent 40%),
                radial-gradient(circle at 88% 85%, #3e1c4a 0%, transparent 38%),
                linear-gradient(140deg, var(--bg-1) 0%, var(--bg-2) 56%, #130819 100%);
    overflow-x: hidden;
}

[hidden] {
    display: none !important;
}

.aurora {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.45;
    animation: drift 18s ease-in-out infinite alternate;
}

.blob.a {
    width: 300px;
    height: 300px;
    background: rgba(146, 12, 106, 0.8);
    top: -70px;
    left: -60px;
}

.blob.b {
    width: 280px;
    height: 280px;
    background: rgba(192, 29, 142, 0.7);
    right: -40px;
    top: 20%;
    animation-delay: 2s;
}

.blob.c {
    width: 360px;
    height: 360px;
    background: rgba(92, 38, 133, 0.56);
    left: 30%;
    bottom: -170px;
    animation-delay: 5s;
}

@keyframes drift {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(30px, -25px, 0) scale(1.08);
    }
    100% {
        transform: translate3d(-15px, 28px, 0) scale(0.94);
    }
}

.page {
    width: min(920px, 100%);
    margin: 0 auto;
    padding: 18px 14px 40px;
}

.card {
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(160deg, rgba(38, 20, 49, 0.78) 0%, rgba(16, 11, 22, 0.78) 100%);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    padding: 16px;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid rgba(192, 29, 142, 0.45);
    background: rgba(146, 12, 106, 0.22);
    color: #ffd7f3;
    white-space: nowrap;
}

.top-header h1 {
    font-size: clamp(22px, 3vw, 30px);
    line-height: 1.15;
    margin-bottom: 5px;
}

.top-header p {
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.4;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.06);
    color: #f3e8f5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.icon-btn:hover {
    transform: translateY(-1px);
    background: rgba(146, 12, 106, 0.24);
    border-color: rgba(192, 29, 142, 0.62);
}

.alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 14px;
    line-height: 1.45;
    display: none;
    animation: fade-up 0.2s ease;
}

.alert.show {
    display: block;
}

.alert-success {
    border-color: rgba(45, 201, 141, 0.55);
    color: #bbffe6;
    background: rgba(45, 201, 141, 0.16);
}

.alert-error {
    border-color: rgba(239, 90, 114, 0.55);
    color: #ffd4db;
    background: rgba(239, 90, 114, 0.16);
}

.alert-warning {
    border-color: rgba(240, 184, 79, 0.6);
    color: #ffe6bb;
    background: rgba(240, 184, 79, 0.17);
}

.alert-info {
    border-color: rgba(99, 184, 255, 0.58);
    color: #d6edff;
    background: rgba(99, 184, 255, 0.16);
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-shell {
    display: grid;
    gap: 16px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.card-head h2 {
    font-size: 19px;
    line-height: 1.2;
}

.card-head.compact h2 {
    font-size: 17px;
}

.status-chip {
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.03);
    white-space: nowrap;
}

.status-chip.ok {
    border-color: rgba(45, 201, 141, 0.55);
    color: #bcffe6;
    background: rgba(45, 201, 141, 0.16);
}

.status-chip.wait {
    border-color: rgba(99, 184, 255, 0.58);
    color: #d3eaff;
    background: rgba(99, 184, 255, 0.15);
}

.status-chip.warn {
    border-color: rgba(240, 184, 79, 0.58);
    color: #ffe2af;
    background: rgba(240, 184, 79, 0.16);
}

.status-chip.error {
    border-color: rgba(239, 90, 114, 0.58);
    color: #ffd4dc;
    background: rgba(239, 90, 114, 0.18);
}

.steps {
    list-style: none;
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-soft);
    font-size: 13px;
    transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease, opacity 0.25s ease;
}

.steps li .dot {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.steps li.is-active {
    border-color: rgba(192, 29, 142, 0.6);
    color: #ffe2f8;
    background: rgba(146, 12, 106, 0.2);
}

.steps li.is-done {
    border-color: rgba(45, 201, 141, 0.42);
    color: #d3ffef;
    background: rgba(45, 201, 141, 0.12);
}

.steps li.is-locked {
    opacity: 0.55;
    filter: blur(0.2px);
}

.step-pane {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.035);
    padding: 14px;
    animation: fade-up 0.22s ease;
}

.step-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.step-row h3 {
    font-size: 16px;
    line-height: 1.2;
}

.field {
    margin-bottom: 10px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-soft);
}

.field input,
.field textarea,
.field select {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.17);
    background: rgba(15, 9, 20, 0.65);
    color: var(--text-main);
    padding: 11px 12px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
    min-height: 132px;
    resize: vertical;
    line-height: 1.4;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: rgba(192, 29, 142, 0.8);
    box-shadow: 0 0 0 3px rgba(192, 29, 142, 0.2);
}

.field input:disabled,
.field textarea:disabled,
.field select:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.38;
}

.inline-link {
    color: #ffc8ef;
    text-decoration: underline;
}

.btn-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 8px;
}

.btn-row.single {
    grid-template-columns: 1fr;
}

.btn {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 11px 13px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #fff;
    background: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-large {
    padding: 13px 14px;
    font-size: 15px;
}

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

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

.btn-primary {
    background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
    box-shadow: 0 9px 24px rgba(192, 29, 142, 0.28);
}

.btn-secondary {
    border-color: rgba(255, 255, 255, 0.25);
    color: #f4e7f6;
    background: rgba(255, 255, 255, 0.06);
}

.btn-ghost {
    border-color: rgba(255, 255, 255, 0.2);
    color: #f3deef;
    background: rgba(12, 8, 17, 0.45);
}

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

.btn.is-loading .btn-spinner {
    display: inline-block;
}

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

.processing-panel {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
}

.processing-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.processing-top h3 {
    font-size: 16px;
    line-height: 1.2;
}

.processing-spinner {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.24);
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    flex: 0 0 auto;
}

.status-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    flex: 0 0 auto;
}

.status-icon.success {
    background: rgba(45, 201, 141, 0.2);
    color: #c4ffe8;
    border: 1px solid rgba(45, 201, 141, 0.55);
}

.status-icon.error {
    background: rgba(239, 90, 114, 0.2);
    color: #ffd4dc;
    border: 1px solid rgba(239, 90, 114, 0.55);
}

.processing-meta {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    padding: 9px 10px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
}

.help-card h3 {
    font-size: 16px;
    margin-bottom: 9px;
}

.help-list {
    margin-left: 16px;
    display: grid;
    gap: 6px;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.help-accordion {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
}

.help-accordion summary {
    cursor: pointer;
    padding: 10px 12px;
    list-style: none;
    font-size: 14px;
    font-weight: 700;
}

.help-accordion summary::-webkit-details-marker {
    display: none;
}

.help-content {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px 12px;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.45;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(11, 7, 15, 0.58);
}

table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    text-align: left;
}

th {
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.04);
    font-weight: 700;
}

td {
    color: #eee6ed;
    vertical-align: top;
}

.code {
    font-family: "JetBrains Mono", "Consolas", monospace;
    letter-spacing: 0.02em;
    color: #ffd8f3;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}

.badge-0 {
    color: #c4ffe7;
    background: rgba(45, 201, 141, 0.16);
    border-color: rgba(45, 201, 141, 0.42);
}

.badge-1 {
    color: #ffe5b8;
    background: rgba(240, 184, 79, 0.17);
    border-color: rgba(240, 184, 79, 0.5);
}

.badge-2 {
    color: #ffd4dc;
    background: rgba(239, 90, 114, 0.16);
    border-color: rgba(239, 90, 114, 0.5);
}

.badge-3 {
    color: #dfd8e8;
    background: rgba(192, 201, 222, 0.12);
    border-color: rgba(192, 201, 222, 0.35);
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.stat {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 9px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-soft);
}

.batch-warning {
    border-radius: 10px;
    border: 1px solid rgba(240, 184, 79, 0.68);
    background: rgba(240, 184, 79, 0.18);
    color: #ffe4b0;
    padding: 9px 10px;
    font-size: 13px;
    line-height: 1.4;
}

.muted {
    color: var(--text-muted);
    font-size: 12px;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(5, 4, 8, 0.76);
    z-index: 30;
    padding: 14px;
}

.modal.open {
    display: flex;
    animation: fade-modal 0.22s ease;
}

@keyframes fade-modal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-card {
    width: min(460px, 100%);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(170deg, rgba(39, 21, 50, 0.95), rgba(15, 10, 21, 0.95));
    box-shadow: var(--shadow);
    padding: 16px;
    animation: zoom-up 0.24s ease;
}

@keyframes zoom-up {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.modal-card p {
    font-size: 14px;
    color: var(--text-soft);
    line-height: 1.45;
    margin-bottom: 12px;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

@media (min-width: 700px) {
    .steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .btn-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .btn-row.single {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
