:root {
    --bg: #f3f5fb;
    --card: #ffffff;
    --text: #1f2533;
    --muted: #65708b;
    --accent: #d41317;
    --accent-hover: #a80f13;
    --success-bg: #e8f8ee;
    --success-text: #17693a;
    --error-bg: #ffeaea;
    --error-text: #8a1e1e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top right, #ffffff 0%, var(--bg) 45%);
}

.container {
    width: min(920px, 92vw);
    margin: 36px auto;
    display: grid;
    gap: 18px;
}

.hero {
    text-align: center;
    padding: 8px 0 4px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(1.7rem, 4vw, 2.4rem);
}

.hero p {
    margin-top: 8px;
    color: var(--muted);
}

.card {
    background: var(--card);
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 8px 22px rgba(28, 39, 64, 0.08);
    border: 1px solid #eef1f8;
}

h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.15rem;
}

.stack-form {
    display: grid;
    gap: 12px;
}

.inline-gap {
    margin-top: 10px;
}

label {
    font-size: 0.95rem;
    font-weight: 600;
}

input[type="file"] {
    border: 1px solid #d8deeb;
    border-radius: 10px;
    padding: 10px;
    background: #fafbff;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--muted);
}

button {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.2s ease;
}

button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

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

.small {
    font-size: 0.88rem;
}

#progress-container {
    margin: 12px 0 14px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
}

#progress-bar {
    width: 100%;
    height: 18px;
    border-radius: 999px;
}

#progress-bar::-webkit-progress-bar {
    background-color: #eceff7;
    border-radius: 999px;
}

#progress-bar::-webkit-progress-value {
    background: linear-gradient(90deg, #d41317, #ff595b);
    border-radius: 999px;
}

.alert {
    border-radius: 10px;
    padding: 12px 14px;
    font-weight: 600;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
}

#process-form {
    display: grid;
    gap: 10px;
}

button.secondary {
    background: #7f8aa3;
}

button.secondary:hover {
    background: #65708b;
}

.process-log {
    margin-top: 12px;
    border: 1px solid #e0e6f2;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fafbff;
}

.process-log summary {
    cursor: pointer;
    font-weight: 600;
}

#process-log-list {
    margin: 10px 0 0;
    padding-left: 18px;
    max-height: 180px;
    overflow: auto;
}

#process-log-list li {
    margin-bottom: 6px;
    color: #44516b;
    font-size: 0.9rem;
}

#process-log-list .log-entry {
    list-style: disc;
    margin-bottom: 12px;
}

.log-headline {
    font-weight: 600;
    color: #26324b;
}

.log-raw {
    margin-top: 4px;
    color: #44516b;
}

.log-trace {
    margin-top: 8px;
    display: grid;
    gap: 8px;
}

.trace-step {
    border: 1px solid #dde5f2;
    border-radius: 8px;
    padding: 8px;
    background: #ffffff;
}

.trace-step-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: #2a3b5f;
}

.trace-block strong {
    display: block;
    margin-bottom: 4px;
}

.trace-block pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.8rem;
    color: #243350;
    background: #f5f8ff;
    border-radius: 6px;
    padding: 8px;
}
