* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    background: #f6f7f9;
    color: #1f2328;
}
header {
    background: #1f2937;
    color: #fff;
    padding: 1rem 2rem;
}
header h1 { margin: 0; font-size: 1.25rem; }
header h1 a { color: #fff; text-decoration: none; }
main {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.card h2 { margin-top: 0; }
form { display: flex; flex-direction: column; gap: 1rem; max-width: 400px; }
label { display: flex; flex-direction: column; gap: .25rem; font-weight: 500; }
label.checkbox { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
select, input[type="number"] {
    padding: .5rem;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 1rem;
}
button {
    padding: .6rem 1.2rem;
    background: #2563eb;
    color: #fff;
    border: 0;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
}
button:hover { background: #1d4ed8; }
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: .5rem .75rem;
    text-align: left;
    border-bottom: 1px solid #eaecef;
}
th { font-weight: 600; color: #57606a; font-size: .875rem; text-transform: uppercase; }
.status {
    display: inline-block;
    padding: .15rem .6rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-pending { background: #fff8c5; color: #6a4c00; }
.status-running { background: #ddf4ff; color: #0969da; }
.status-succeeded { background: #dafbe1; color: #1a7f37; }
.status-failed { background: #ffebe9; color: #cf222e; }
.status-cancelled { background: #eaeef2; color: #57606a; }
dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; }
dl.meta dt { color: #57606a; font-weight: 500; }
dl.meta dd { margin: 0; }
.log {
    background: #0d1117;
    color: #c9d1d9;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    max-height: 400px;
    font-size: .875rem;
}
.pdf-list { list-style: none; padding: 0; margin: 0; }
.pdf-list li { padding: .25rem 0; border-bottom: 1px solid #eaecef; }
.empty { color: #57606a; font-style: italic; }
.hint { color: #57606a; font-size: .85rem; font-weight: 400; }
.error { color: #cf222e; }
a { color: #2563eb; }

/* Run-page action bar — pinned above the status card so a long PDF list
   doesn't force users to scroll for the back / stop buttons. */
.run-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.run-actions .back-link {
    font-weight: 500;
    text-decoration: none;
    padding: .35rem .75rem;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #d0d7de;
}
.run-actions .back-link:hover { background: #f6f8fa; }
.inline-form { margin: 0; display: inline; }
.btn-danger {
    padding: .35rem .75rem;
    background: #cf222e;
    color: #fff;
    border: 0;
    border-radius: 6px;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-danger:hover { background: #a40e26; }

.btn-secondary {
    background: #f6f8fa !important;
    color: #1f2328 !important;
    border: 1px solid #d0d7de !important;
}
.btn-secondary:hover { background: #eaeef2 !important; }

.form-actions { display: flex; gap: .5rem; align-items: center; }
.confirm-form { margin-top: 1rem; display: flex; flex-direction: column; gap: 1rem; max-width: 400px; }

.test-banner {
    background: #fff8c5;
    color: #6a4c00;
    border-bottom: 1px solid #d4a72c;
    padding: .75rem 2rem;
    font-size: .9rem;
}
.test-banner strong { color: #1f2328; }
.test-banner code {
    background: rgba(0,0,0,.06);
    padding: .05rem .35rem;
    border-radius: 4px;
    font-size: .85em;
}

.sample-frame {
    width: 100%;
    height: 600px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: #fff;
}

.test-mode {
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: .75rem 1rem;
    margin: .25rem 0;
}
.test-mode > summary {
    cursor: pointer;
    font-weight: 600;
    color: #1f6feb;
    user-select: none;
}
.test-mode[open] > summary { margin-bottom: .75rem; }
.test-mode label { display: flex; flex-direction: column; gap: .25rem; margin: .5rem 0; }
.test-mode input[type="email"], .test-mode select {
    padding: .5rem;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 1rem;
}
