:root {
    --bg: #f7f7fb;
    --card: #fff;
    --text: #101828;
    --muted: #667085;
    --border: #e5e7eb;
    --primary: #ed7a32;
    --primary-soft: #fff3ea;
    --success: #027a48;
    --danger: #b42318;
}

* { box-sizing: border-box; }

body.public-body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

.public-shell {
    width: min(980px, calc(100% - 32px));
    margin: 40px auto;
}

.public-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 18px 50px rgba(16, 24, 40, 0.06);
}

.public-card.wide {
    width: min(1100px, 100%);
}

.public-card h1 {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 42px);
}

.public-card p {
    color: var(--muted);
    line-height: 1.6;
}

.step-label {
    display: inline-flex;
    border-radius: 999px;
    padding: 6px 10px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 14px;
}

.public-form,
.code-form {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.public-form label,
.code-form label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.public-form input,
.code-form input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    font: inherit;
}

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

.btn-public {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 1px solid var(--primary);
    border-radius: 14px;
    background: var(--primary);
    color: #fff;
    padding: 11px 16px;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

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

.btn-public.disabled,
.btn-public:disabled {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

.document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0;
}

.document-meta span {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--muted);
}

.document-scroll {
    max-height: 520px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    background: #fff;
}

.document-preview {
    line-height: 1.65;
}

.public-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.attachment-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 12px;
}

.attachment-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
}

.attachment-list span,
.attachment-list small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.code-box {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    margin: 18px 0;
    background: #fafafa;
}

.inline-form {
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
}

.public-checkbox {
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: flex-start;
    gap: 10px !important;
    font-weight: 600 !important;
}

.public-checkbox input {
    width: auto;
    margin-top: 3px;
}

.alert {
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 16px;
    font-weight: 700;
}

.alert-error {
    background: #fff1f1;
    color: var(--danger);
}

.alert-success,
.success-text {
    background: #ecfdf3;
    color: var(--success) !important;
    border-radius: 12px;
    padding: 10px 12px;
}

.muted { color: var(--muted); }

code {
    font-size: 12px;
    word-break: break-all;
}

@media (max-width: 760px) {
    .public-grid,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .attachment-list li,
    .inline-form {
        display: grid;
    }
}
.process-state {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    margin: 18px 0;
    background: #fff;
}

.process-state ul {
    display: grid;
    gap: 8px;
    margin: 10px 0 0;
    padding-left: 0;
    list-style: none;
}

.public-checkbox-row {
    display: grid;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    background: #fff;
}

.public-checkbox-downloads {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-left: 28px;
    flex-wrap: wrap;
}

.public-checkbox-document-name {
    color: var(--muted);
    font-size: 14px;
}

.public-checkbox-download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border: 1px solid var(--primary);
    border-radius: 999px;
    padding: 6px 12px;
    color: var(--primary);
    background: #fff;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.public-checkbox-download-link:hover {
    background: var(--primary-soft);
}


.creator-welcome-card {
    max-width: 760px;
    margin: 80px auto;
    text-align: center;
}

.creator-welcome-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 14px;
    margin-bottom: 18px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.creator-welcome-card h1 {
    margin-bottom: 16px;
}

.creator-welcome-lead {
    font-size: 18px;
    color: var(--text) !important;
}

.creator-welcome-lead strong {
    color: var(--primary);
}


@media (max-width: 760px) {
    .public-shell {
        width: 100%;
        margin: 0;
        padding: 10px;
    }

    .public-card {
        border-radius: 18px;
        padding: 16px;
        box-shadow: 0 10px 28px rgba(16, 24, 40, 0.05);
    }

    .public-card.wide {
        width: 100%;
    }

    .public-card h1 {
        font-size: 26px;
        line-height: 1.15;
    }

    .public-card p {
        font-size: 15px;
        line-height: 1.55;
    }

    .document-meta {
        margin: 12px 0;
    }

    .document-scroll {
        height: calc(100dvh - 260px);
        min-height: 58dvh;
        max-height: none;
        padding: 15px;
        border-radius: 14px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .document-preview {
        font-size: 16px;
        line-height: 1.75;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .document-preview p,
    .document-preview li,
    .document-preview td,
    .document-preview th,
    .document-preview div {
        line-height: 1.75;
    }

    .document-preview img {
        max-width: 100%;
        height: auto;
    }

    .document-preview table {
        display: block;
        width: 100% !important;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-collapse: collapse;
    }

    .document-preview td,
    .document-preview th {
        min-width: 120px;
        padding: 6px;
        vertical-align: top;
    }

    .public-actions {
        display: grid;
        gap: 10px;
    }

    .public-actions .btn-public {
        width: 100%;
        min-height: 50px;
        text-align: center;
    }
}


.accept-progress {
    position: relative;
    margin: 2px 0 22px;
    padding: 0;
}

.accept-progress ol {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.accept-progress-step {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 7px;
    min-width: 0;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

.accept-progress-step::before {
    content: "";
    position: absolute;
    top: 13px;
    left: calc(-50% + 18px);
    width: calc(100% - 28px);
    height: 2px;
    background: var(--border);
    z-index: 0;
}

.accept-progress-step:first-child::before {
    display: none;
}

.accept-progress-step span {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.accept-progress-step strong {
    display: block;
    max-width: 100%;
    color: inherit;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.accept-progress-step.is-done {
    color: var(--success);
}

.accept-progress-step.is-done::before {
    background: rgba(2, 122, 72, 0.28);
}

.accept-progress-step.is-done span {
    border-color: rgba(2, 122, 72, 0.35);
    background: #ecfdf3;
    color: var(--success);
}

.accept-progress-step.is-active {
    color: var(--primary);
}

.accept-progress-step.is-active::before {
    background: rgba(237, 122, 50, 0.32);
}

.accept-progress-step.is-active span {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 5px var(--primary-soft);
}

@media (max-width: 760px) {
    .accept-progress {
        margin: 0 0 14px;
        overflow: visible;
    }

    .accept-progress ol {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 2px;
        width: 100%;
        min-width: 0;
        padding: 2px 0 6px;
    }

    .accept-progress-step {
        width: auto;
        min-width: 0;
        gap: 3px;
        font-size: 8px;
    }

    .accept-progress-step::before {
        top: 9px;
        left: calc(-50% + 9px);
        width: calc(100% - 6px);
        height: 1px;
    }

    .accept-progress-step span {
        width: 19px;
        height: 19px;
        font-size: 9px;
        border-width: 1px;
    }

    .accept-progress-step strong {
        display: block;
        max-width: 100%;
        font-size: 7.5px;
        font-weight: 800;
        line-height: 1.05;
        letter-spacing: -0.03em;
        text-align: center;
        overflow-wrap: normal;
        word-break: normal;
        hyphens: none;
    }

    .accept-progress-step.is-active span {
        box-shadow: 0 0 0 2px var(--primary-soft);
    }
}