/* ============================================================
   Paint by Number Generator — design system
   ============================================================ */

:root {
    --accent: #9B046F;
    --accent-dark: #7d0359;
    --accent-soft: #f6e6f0;
    --ink: #1c2433;
    --ink-soft: #5a6473;
    --muted: #8a93a2;
    --line: #e4e7ec;
    --line-strong: #cdd3dc;
    --bg: #f4f5f7;
    --card: #ffffff;
    --field-bg: #ffffff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px rgba(16, 24, 40, .08);
    --focus: 0 0 0 3px rgba(155, 4, 111, .35);
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.page {
    max-width: 1160px;
    margin: 0 auto;
    padding: 32px 24px 56px;
}

/* ---------------- Header ---------------- */
.app-header {
    margin-bottom: 20px;
}

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

.brand-mark {
    color: var(--accent);
    display: inline-flex;
}

.app-header h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -.02em;
}

.subtitle {
    margin: 2px 0 0;
    color: var(--ink-soft);
    font-size: 15px;
}

/* ---------------- Card ---------------- */
.app-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-section {
    padding: 22px 26px;
    border-bottom: 1px solid var(--line);
}

.card-section:last-child {
    border-bottom: 0;
}

/* ---------------- Tabs ---------------- */
.tabs {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    position: relative;
    border-bottom: 1px solid var(--line);
}

.tabs .tab {
    margin: 0;
}

.tabs .tab a {
    display: block;
    padding: 10px 16px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
    cursor: pointer;
}

.tabs .tab a:hover {
    color: var(--ink);
}

.tabs .tab a.active {
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
}

.tabs .indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: var(--accent);
    display: none;
}

.tab-pane {
    animation: fade .2s ease;
}

@keyframes fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ---------------- Upload ---------------- */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 18px;
    margin-bottom: 18px;
}

.dropzone {
    border: 2px dashed var(--line-strong);
    border-radius: var(--radius);
    background: #fbfcfd;
    padding: 30px 20px;
    text-align: center;
    transition: border-color .15s, background .15s;
}

.dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.dropzone-icon {
    color: var(--accent);
}

.dropzone-title {
    margin: 10px 0 4px;
    font-size: 15px;
    font-weight: 500;
}

.dropzone-hint {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.link-btn {
    background: none;
    border: 0;
    padding: 0;
    color: var(--accent-dark);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.examples-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin-bottom: 8px;
}

.example-chips {
    display: flex;
    gap: 10px;
}

.example-chip {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 12px;
    background: var(--card);
    transition: border-color .15s, transform .1s;
}

.example-chip:hover {
    border-color: var(--accent);
    color: var(--ink);
    transform: translateY(-1px);
}

.example-chip img {
    width: 100%;
    height: 56px;
    object-fit: cover;
    border-radius: 5px;
    background: var(--bg);
}

.canvas-wrap {
    overflow: auto;
    max-width: 100%;
    max-height: 520px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background:
        repeating-conic-gradient(#f0f1f3 0% 25%, #fff 0% 50%) 50% / 20px 20px;
}

.canvas-wrap canvas {
    display: block;
    max-width: 100%;
}

/* ---------------- Options ---------------- */
.opt-group {
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.opt-group:first-child {
    padding-top: 0;
    border-top: 0;
}

.opt-heading {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
}

.opt-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 6px;
}

.opt-row:last-child {
    margin-bottom: 0;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
    flex: 1;
}

.field-wide {
    flex-basis: 100%;
}

.field label,
.opt-row > label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

input[type="number"],
input[type="text"],
textarea {
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    background: var(--field-bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}

input[type="number"]:focus,
input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--focus);
}

textarea {
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
}

.field-hint {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
}

.field-hint code,
code {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* checkbox */
.check {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    min-width: 180px;
    flex: 1;
}

.check input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    accent-color: var(--accent);
    flex-shrink: 0;
}

/* segmented control */
.segmented {
    display: inline-flex;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg);
    width: fit-content;
}

.segmented label {
    margin: 0;
}

.segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented span {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
    border-right: 1px solid var(--line-strong);
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.segmented label:last-child span {
    border-right: 0;
}

.segmented input:checked + span {
    background: var(--accent);
    color: #fff;
}

.segmented input:focus-visible + span {
    box-shadow: inset var(--focus);
}

/* help tooltip trigger */
.help {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    cursor: help;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.help:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
}

/* materialize-injected tooltip */
.material-tooltip {
    position: absolute;
    max-width: 280px;
    background: var(--ink);
    color: #fff;
    border-radius: 6px;
    padding: 8px 11px;
    font-size: 12.5px;
    line-height: 1.45;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    box-shadow: 0 6px 18px rgba(16, 24, 40, .25);
}

.material-tooltip.active {
    opacity: 1;
}

.material-tooltip .tooltip-content {
    color: #fff;
}

/* ---------------- Buttons ---------------- */
.action-bar {
    padding: 18px 26px;
    display: flex;
    justify-content: flex-end;
    background: #fbfcfd;
    border-bottom: 1px solid var(--line);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--accent);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 13px 28px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 4px 14px rgba(155, 4, 111, .35);
    transition: background .15s, transform .08s, box-shadow .15s;
}

.btn-primary:hover {
    background: var(--accent-dark);
    box-shadow: 0 6px 18px rgba(155, 4, 111, .45);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--card);
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    padding: 9px 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s, background .15s;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: var(--accent-soft);
}

/* ---------------- Stepper ---------------- */
.stepper {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.step {
    flex: 1;
    position: relative;
    text-align: center;
    min-width: 0;
}

.step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 16px;
    left: calc(50% + 18px);
    right: calc(-50% + 18px);
    height: 2px;
    background: var(--line);
    z-index: 0;
}

.status {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 0 4px;
}

.step-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--line-strong);
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, border-color .2s, color .2s;
}

.step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-soft);
    line-height: 1.3;
}

.status .progress {
    width: 70%;
    height: 3px;
    background: var(--line);
    border-radius: 3px;
    overflow: hidden;
}

.status .progress .determinate {
    height: 100%;
    background: var(--accent);
    transition: width .2s ease;
}

/* active step */
.status.active .step-num {
    border-color: var(--accent);
    color: var(--accent-dark);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.status.active .step-num::after {
    content: "";
    position: absolute;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--accent);
    animation: spin .7s linear infinite;
}

.status.active .step-label {
    color: var(--accent-dark);
    font-weight: 600;
}

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

/* completed step */
.status.complete .step-num {
    background: var(--accent);
    border-color: var(--accent);
    color: transparent;
}

.status.complete .step-num::before {
    content: "✓";
    position: absolute;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.status.complete + * .step-label,
.status.complete .step-label {
    color: var(--ink);
}

.step:has(.status.complete)::after {
    background: var(--accent);
}

/* ---------------- Results ---------------- */
.results-heading {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 600;
}

.render-opts {
    align-items: center;
    padding: 12px 14px;
    background: #fbfcfd;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.render-opts-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}

.render-opts .check {
    flex: 0 0 auto;
    min-width: 0;
}

.svg-container {
    overflow: auto;
    max-width: 100%;
    max-height: 520px;
    margin: 16px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background:
        repeating-conic-gradient(#f0f1f3 0% 25%, #fff 0% 50%) 50% / 20px 20px;
}

.svg-container svg {
    display: block;
    max-width: 100%;
    height: auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 320px;
    color: var(--muted);
    text-align: center;
}

.empty-state svg {
    color: var(--line-strong);
    margin-bottom: 6px;
}

.empty-state p {
    margin: 0;
    font-size: 15px;
    color: var(--ink-soft);
}

.empty-state .empty-sub {
    font-size: 13px;
    color: var(--muted);
}

.palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0;
}

.palette .color {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    text-align: center;
    line-height: 30px;
    padding: 5px 0;
    font-weight: 600;
    text-shadow: #fff 0 0 5px;
    cursor: default;
}

.download-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.log {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: var(--ink-soft);
    background: #fbfcfd;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
    max-height: 360px;
    overflow: auto;
}

/* ---------------- Footer ---------------- */
.app-footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    padding: 0 4px;
    font-size: 13px;
    color: var(--muted);
}

.app-footer a {
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: 600;
}

.app-footer a:hover {
    text-decoration: underline;
}

/* ---------------- Accessibility ---------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
    outline: none;
    box-shadow: var(--focus);
    border-radius: var(--radius-sm);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
    .upload-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .page {
        padding: 20px 14px 40px;
    }

    .card-section {
        padding: 18px 16px;
    }

    .app-header h1 {
        font-size: 24px;
    }

    /* stepper stays horizontal, compact on mobile */
    .stepper {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0;
    }

    .step {
        text-align: center;
    }

    .step-num {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .step-label {
        font-size: 9px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .status .progress {
        width: 100%;
        height: 3px;
    }

    .step:not(:last-child)::after {
        display: none;
    }

    .status {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 6px 0;
    }

    .status .progress {
        width: 80px;
        margin-left: auto;
    }

    .action-bar {
        justify-content: stretch;
    }

    .btn-primary {
        flex: 1;
        justify-content: center;
    }
}

/* ============================================================
   Slim UI overrides — compact one-purpose interface
   (appended; original design-system rules above stay intact)
   ============================================================ */

/* engine internals are never shown */
.pbn-hidden {
    display: none !important;
}

/* narrower, tighter page */
.page {
    max-width: 720px;
    padding: 18px 14px 40px;
}

.app-header {
    margin-bottom: 14px;
}

.app-header h1 {
    font-size: 22px;
    letter-spacing: -.01em;
}

.brand-mark svg {
    width: 30px;
    height: 30px;
}

.subtitle {
    font-size: 13px;
}

.app-card {
    border-radius: 10px;
}

.card-section {
    padding: 16px 18px;
}

/* ---- upload ---- */
.dropzone {
    padding: 20px 14px;
}

.dropzone-icon {
    width: 34px;
    height: 34px;
}

.dropzone-title {
    font-size: 14px;
    margin: 8px 0 3px;
}

.dropzone-hint {
    font-size: 12px;
}

.examples {
    margin-top: 12px;
}

.example-chips {
    gap: 8px;
}

.example-chip img {
    height: 42px;
}

/* ---- colors preset + generate ---- */
.mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.mini-col {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-preset-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.preset-group {
    display: inline-flex;
    gap: 6px;
    background: var(--bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.preset-btn {
    border: 0;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.preset-btn:hover {
    color: var(--ink);
}

.preset-btn.active {
    background: var(--accent);
    color: #fff;
}

.mini-row .btn-primary {
    font-size: 15px;
    padding: 11px 30px;
}

/* ---- progress ---- */
.stepper {
    gap: 2px;
}

.step-label {
    font-size: 11px;
}

.step-num {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

.status .progress {
    width: 64%;
    height: 3px;
}

/* ---- result ---- */
.results-heading {
    font-size: 16px;
    margin-bottom: 10px;
}

.svg-container {
    max-height: 460px;
    margin: 12px 0;
}

.empty-state {
    min-height: 220px;
}

.download-bar {
    justify-content: center;
}

.btn-download {
    flex: 1;
    justify-content: center;
    padding: 11px 18px;
    font-size: 15px;
}

/* ---- footer ---- */
.app-footer {
    font-size: 12px;
    margin-top: 14px;
}

/* ---- responsive ---- */
@media (max-width: 560px) {
    .mini-row {
        flex-direction: column;
        align-items: stretch;
    }

    .mini-col {
        justify-content: center;
    }

    .mini-row .btn-primary {
        width: 100%;
        justify-content: center;
    }
}
/* dropzone is now a <label> (whole area opens the file picker) */
.dropzone {
    display: block;
    cursor: pointer;
}
/* ---- spacing: upload zone vs. image preview ---- */
.canvas-wrap {
    margin-top: 18px;
}

/* ---- result heading shows the color count ---- */
.results-count {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}

.results-count::before {
    content: "· ";
}

/* ---- Download PNG: colored text by default ---- */
.btn-download {
    color: #ffffff;
    border-color: #000000;
    background: #000000;
}

.btn-download:hover {
    background: #9B046F;
    border-color: #9B046F;
    color: #ffffff;
}
/* ---- image preview is now a <label> (click to pick again) ---- */
.canvas-wrap {
    display: block;
    cursor: pointer;
}
/* ---- image preview: center the canvas, keep aspect ratio ---- */
.canvas-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-wrap canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ---- remove-image button (top-right of the preview) ---- */
.canvas-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, .92);
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .15s, color .15s, border-color .15s;
}

.canvas-remove:hover {
    background: #fdecec;
    color: #c0392b;
    border-color: #e3b8b8;
}

/* ---- disabled state (download / generate) ---- */
.is-disabled {
    opacity: .5;
    pointer-events: none;
    cursor: default;
    box-shadow: none;
}
/* ---- desktop stepper: no hard squeeze, wrap gracefully ---- */
.stepper {
    flex-wrap: wrap;
    gap: 8px 4px;
}

.step {
    flex: 1 1 130px;
    min-width: 0;
}

.step-label {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}
/* ---- mobile stepper: wrap into rows (3 per row), no hard squeeze ---- */
@media (max-width: 760px) {
    .stepper {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px 4px;
    }

    .step {
        flex: 1 1 30%;
        text-align: center;
    }

    .step-num {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .step-label {
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .status .progress {
        width: 100%;
        height: 3px;
    }

    .step:not(:last-child)::after {
        display: none;
    }
}
/* ---- keep step circles round (no flex squish) ---- */
.step-num {
    flex: 0 0 auto;
    aspect-ratio: 1;
}
/* ---- unified compact progress style (desktop + mobile) ----
   smaller number dot, readable full labels, slim full-width bar */
.step-num {
    width: 22px;
    height: 22px;
    font-size: 11px;
    flex: 0 0 auto;
    aspect-ratio: 1;
}

.step-label {
    font-size: 12px;
}

.status .progress {
    width: 100%;
    height: 4px;
}

/* mobile: 4 steps per row, labels stay readable */
@media (max-width: 760px) {
    .step {
        flex: 1 1 25%;
    }

    .step-num {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }

    .step-label {
        font-size: 11px;
    }
}
/* ---- text ON the progress bar (remove dots) ---- */
.status {
    position: relative;
    display: block;
    padding: 0;
}

.step-num {
    display: none;
}

.step-label {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    text-align: center;
    z-index: 2;
    color: #2b2926;
    text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 2px #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status .progress {
    width: 100%;
    height: 22px;
    position: relative;
    background: #e9e4d9;
    border-radius: 11px;
    overflow: hidden;
}

.status .progress .determinate {
    height: 100%;
    background: var(--accent);
    border-radius: 11px;
}
/* ============================================================
   Balanced, clean progress style (final)
   each step = label (top) + thin progress bar (bottom)
   desktop: 7 in a row | mobile: 2 columns, readable labels
   ============================================================ */
.step {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.step-num {
    display: none;
}

.step-label {
    position: static;
    transform: none;
    text-shadow: none;
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-soft);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    pointer-events: auto;
}

.status {
    position: static;
    display: block;
    padding: 0;
}

.status .progress {
    width: 100%;
    height: 6px;
    background: var(--line);
    border-radius: 3px;
    overflow: hidden;
}

.status .progress .determinate {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width .25s ease;
}

.stepper {
    flex-wrap: wrap;
    gap: 8px 4px;
}

.step {
    flex: 1 1 120px;
}

/* mobile: 2 columns, generous label space */
@media (max-width: 760px) {
    .stepper {
        flex-wrap: wrap;
        gap: 8px 6px;
    }

    .step {
        flex: 1 1 45%;
    }

    .step-label {
        font-size: 12px;
    }
}
/* ============================================================
   Final: label · bottom line progress
   each step = name (top) · dot separator · thin bottom line
   filled left→right with accent color
   ============================================================ */
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.step-num {
    display: none;
}

.step-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-soft);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* dot separator between name and line */
.step-label::after {
    content: "\2022";
    display: block;
    font-size: 9px;
    line-height: 1;
    margin-top: 2px;
    color: var(--accent);
}

.status {
    display: block;
    padding: 0;
}

.status .progress {
    width: 100%;
    height: 3px;
    background: var(--line);
    border-radius: 0;
    overflow: hidden;
}

.status .progress .determinate {
    height: 100%;
    background: var(--accent);
    border-radius: 0;
    transition: width .25s ease;
}

.stepper {
    flex-wrap: wrap;
    gap: 10px 6px;
}

.step {
    flex: 1 1 120px;
}

@media (max-width: 760px) {
    .stepper {
        flex-wrap: wrap;
        gap: 10px 8px;
    }

    .step {
        flex: 1 1 45%;
    }

    .step-label {
        font-size: 12px;
    }
}
/* ============================================================
   FINAL per reference screenshot:
   horizontal steps, gray label on top, BLACK line below,
   progress fills the line with accent from left to right.
   ============================================================ */
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.step-num {
    display: none;
}

.step-label {
    font-size: 11px;
    font-weight: 400;
    color: #666666;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* dot separator between label and line */
.step-label::after {
    content: "\2022";
    display: block;
    font-size: 10px;
    line-height: 1;
    margin-top: 2px;
    color: var(--accent);
}

.status {
    display: block;
    padding: 0;
}

/* magenta line = progress track; accent fills left→right */
.status .progress {
    width: 100%;
    height: 3px;
    background: rgba(155, 4, 111, 0.25);
    border-radius: 0;
    overflow: hidden;
}

.status .progress .determinate {
    height: 100%;
    background: var(--accent);
    border-radius: 0;
    transition: width .25s ease;
}

/* horizontal layout: desktop 7 in a row, mobile 3 per row */
.stepper {
    flex-wrap: wrap;
    gap: 12px 10px;
}

.step {
    flex: 1 1 120px;
}

@media (max-width: 760px) {
    .stepper {
        flex-wrap: wrap;
        gap: 12px 8px;
    }

    .step {
        flex: 1 1 30%;
    }

    .step-label {
        font-size: 12px;
    }
}

/* ============================================================
   Processing progress - final responsive treatment
   ============================================================ */
#progressSection {
    background: #fbfcfd;
}

#progressSection .stepper {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}

#progressSection .step {
    display: block;
    min-width: 0;
    text-align: left;
}

#progressSection .step::after,
#progressSection .step-label::after {
    display: none;
}

#progressSection .status {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 8px 9px;
    min-height: 78px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

#progressSection .step-num {
    display: inline-flex;
    grid-column: 1;
    grid-row: 1;
    width: 24px;
    height: 24px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: #f4f5f7;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

#progressSection .step-label {
    position: static;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    color: var(--ink);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.25;
    text-align: left;
    text-shadow: none;
    transform: none;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

#progressSection .status .progress {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    height: 7px;
    margin: 0;
    border-radius: 999px;
    background: #e7ebf0;
    overflow: hidden;
}

#progressSection .status .progress .determinate {
    height: 100%;
    min-width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #0f9d8f);
    transition: width .25s ease;
}

#progressSection .status.active {
    border-color: rgba(155, 4, 111, .55);
    background: #fffafd;
    box-shadow: 0 0 0 3px rgba(155, 4, 111, .08);
}

#progressSection .status.active .step-num {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

#progressSection .status.active .step-num::after {
    content: "";
    position: absolute;
    inset: -4px;
    border: 2px solid transparent;
    border-top-color: rgba(155, 4, 111, .7);
    border-radius: inherit;
    animation: spin .8s linear infinite;
}

#progressSection .status.active .step-label {
    color: var(--accent-dark);
}

#progressSection .status.complete {
    border-color: rgba(15, 157, 143, .45);
    background: #fbfffe;
}

#progressSection .status.complete .step-num {
    border-color: #0f9d8f;
    background: #0f9d8f;
    color: transparent;
}

#progressSection .status.complete .step-num::before {
    content: "\2713";
    position: absolute;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
}

#progressSection .status.complete .step-label {
    color: var(--ink);
}

@media (max-width: 980px) {
    #progressSection .stepper {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    #progressSection .stepper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    #progressSection .status {
        min-height: 72px;
        padding: 11px;
    }
}

@media (max-width: 420px) {
    #progressSection .stepper {
        grid-template-columns: 1fr;
    }

    #progressSection .status {
        grid-template-columns: 26px minmax(0, 1fr) minmax(86px, 30%);
        grid-template-rows: auto;
        min-height: 50px;
        gap: 10px;
    }

    #progressSection .status .progress {
        grid-column: 3;
        grid-row: 1;
    }
}

/* ============================================================
   Progress layout refinement
   Desktop: one horizontal row. Mobile: readable vertical list.
   ============================================================ */
@media (min-width: 761px) {
    #progressSection .stepper {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 8px;
    }

    #progressSection .status {
        grid-template-columns: 24px minmax(0, 1fr);
        min-height: 72px;
        padding: 10px 9px;
    }

    #progressSection .step-label {
        font-size: 11px;
        white-space: nowrap;
    }
}

@media (max-width: 760px) {
    #progressSection {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    #progressSection .stepper {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    #progressSection .status {
        grid-template-columns: 28px minmax(0, 1fr) minmax(92px, 32%);
        grid-template-rows: auto;
        min-height: 52px;
        padding: 10px 12px;
        gap: 10px;
    }

    #progressSection .step-num {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    #progressSection .step-label {
        grid-column: 2;
        grid-row: 1;
        font-size: 14px;
        line-height: 1.2;
        white-space: nowrap;
    }

    #progressSection .status .progress {
        grid-column: 3;
        grid-row: 1;
        height: 8px;
    }
}

/* Final mobile compacting and spinner alignment */
#progressSection .step-num {
    position: relative;
}

#progressSection .status.active .step-num::after {
    inset: -4px;
    width: auto;
    height: auto;
}

@media (max-width: 760px) {
    #progressSection {
        padding-top: 12px;
        padding-bottom: 12px;
    }

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

    #progressSection .step:last-child {
        grid-column: 1 / -1;
    }

    #progressSection .status {
        grid-template-columns: 24px minmax(0, 1fr);
        grid-template-rows: auto auto;
        min-height: 48px;
        padding: 8px 9px;
        gap: 6px 7px;
    }

    #progressSection .step-num {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    #progressSection .step-label {
        grid-column: 2;
        grid-row: 1;
        font-size: 12px;
        line-height: 1.15;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #progressSection .status .progress {
        grid-column: 1 / -1;
        grid-row: 2;
        height: 6px;
    }
}
