:root {
    --cream: #fbf8f2;
    --paper: #ffffff;
    --blush: #f3e4e1;
    --blush-deep: #c78f88;
    --sage: #71806a;
    --sage-soft: #e8eee4;
    --sage-dark: #4d5b48;
    --charcoal: #302e2b;
    --muted: #6f6a64;
    --border: #e8e1d8;
    --shadow: 0 18px 50px rgba(48, 46, 43, 0.08);
    --radius: 18px;
}

* { box-sizing: border-box; }

html { background: var(--cream); }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 8%, rgba(243, 228, 225, 0.65), transparent 24rem),
        var(--cream);
    color: var(--charcoal);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}

.site-header {
    width: min(920px, calc(100% - 40px));
    margin: 0 auto;
    padding: 36px 0 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--sage-soft);
    color: var(--sage-dark);
    font-size: 23px;
}

.site-header h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.45rem, 3vw, 1.9rem);
    font-weight: 600;
}

.eyebrow, .kicker {
    margin: 0 0 4px;
    color: var(--sage-dark);
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.shell {
    width: min(920px, calc(100% - 40px));
    margin: 0 auto;
    padding-bottom: 48px;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

.hero {
    padding: clamp(26px, 5vw, 48px);
}

.hero h2, .status-card h2 {
    margin: 6px 0 12px;
    max-width: 720px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.08;
    font-weight: 600;
}

.lede {
    max-width: 740px;
    margin: 0 0 30px;
    color: var(--muted);
    font-size: 1.04rem;
}

form {
    border-top: 1px solid var(--border);
    padding-top: 28px;
}

.input-block label {
    display: block;
    margin-bottom: 3px;
    font-weight: 750;
    font-size: 1.02rem;
}

.help {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

input[type="file"] {
    width: 100%;
    padding: 14px;
    border: 1px dashed #cfc7bc;
    border-radius: 12px;
    background: #fcfbf8;
}

textarea {
    width: 100%;
    min-height: 210px;
    resize: vertical;
    padding: 16px;
    border: 1px solid #cfc7bc;
    border-radius: 12px;
    background: #fff;
    color: var(--charcoal);
    font: inherit;
    outline: none;
}

textarea:focus, input[type="file"]:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(113, 128, 106, 0.14);
}

.or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--muted);
    font-size: 0.83rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.or::before, .or::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--border);
}

.primary {
    margin-top: 20px;
    border: 0;
    border-radius: 10px;
    padding: 13px 20px;
    background: var(--sage-dark);
    color: #fff;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.primary:hover { background: #3f4c3b; }

.architecture {
    margin: 22px 0 12px;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1.15fr auto 1.15fr;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,0.62);
}

.architecture div {
    min-width: 0;
}

.architecture strong, .architecture span {
    display: block;
}

.architecture strong {
    font-size: 0.86rem;
}

.architecture div span {
    color: var(--muted);
    font-size: 0.77rem;
}

.architecture .arrow {
    color: var(--blush-deep);
}

.privacy-note {
    margin: 14px 4px 0;
    color: var(--muted);
    font-size: 0.82rem;
    text-align: center;
}

.status-card {
    padding: clamp(28px, 6vw, 54px);
}

.spinner {
    width: 42px;
    height: 42px;
    margin-bottom: 22px;
    border: 4px solid var(--sage-soft);
    border-top-color: var(--sage-dark);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.success-mark {
    width: 42px;
    height: 42px;
    margin-bottom: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--sage-soft);
    color: var(--sage-dark);
    font-weight: 900;
    font-size: 1.25rem;
}

.progress-list {
    display: grid;
    gap: 10px;
    margin: 26px 0 8px;
}

.progress-row {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 8px;
    color: #8a857f;
}

.progress-row.done { color: var(--sage-dark); }
.progress-row.active { color: var(--charcoal); font-weight: 650; }

.result-area {
    margin-top: 30px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.completion-note {
    padding: 16px 18px;
    border-left: 4px solid var(--sage);
    border-radius: 8px;
    background: var(--sage-soft);
}

.completion-note p { margin: 4px 0 0; }

.run-id {
    margin: 24px 0 12px;
    color: var(--muted);
}

code {
    overflow-wrap: anywhere;
    color: var(--charcoal);
}

.artifact-list {
    display: grid;
    gap: 10px;
}

.artifact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    color: var(--charcoal);
    text-decoration: none;
}

.artifact:hover {
    border-color: #b9c2b4;
    background: #fcfdfb;
}

.artifact span:first-child {
    min-width: 0;
}

.artifact strong, .artifact small {
    display: block;
}

.artifact strong {
    overflow-wrap: anywhere;
}

.artifact small {
    margin-top: 2px;
    color: var(--muted);
}

.artifact-action {
    flex: 0 0 auto;
    color: var(--sage-dark);
    font-weight: 750;
}

.long-wait {
    margin-top: 24px;
    padding: 12px 14px;
    border-radius: 9px;
    background: var(--blush);
    color: #5b4b48;
    font-size: 0.9rem;
}

.back-link {
    margin: 18px 4px;
}

.back-link a {
    color: var(--sage-dark);
}

@media (max-width: 720px) {
    .architecture {
        grid-template-columns: 1fr;
    }

    .architecture .arrow {
        transform: rotate(90deg);
        justify-self: start;
        margin-left: 16px;
    }

    .artifact {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
}
