:root {
  --bg: #f5f1e8;
  --panel: rgba(255, 251, 244, 0.92);
  --panel-border: rgba(70, 54, 35, 0.12);
  --text: #2e241a;
  --muted: #726451;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warm: #c36a2d;
  --danger: #9f1239;
  --shadow: 0 24px 60px rgba(46, 36, 26, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(195, 106, 45, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.2), transparent 28%),
    linear-gradient(180deg, #f8f4ec 0%, var(--bg) 54%, #efe8da 100%);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}
.app-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 48px; }
.hero { display: grid; grid-template-columns: 1.25fr 0.95fr; gap: 20px; align-items: stretch; margin-bottom: 24px; }
.hero h1, .panel h2, .recent-jobs h3 { font-family: "Iowan Old Style", "Palatino Linotype", serif; letter-spacing: -0.02em; margin: 0; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); line-height: 0.94; max-width: 12ch; }
.hero-copy { max-width: 58ch; color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.eyebrow { margin: 0 0 8px; color: var(--accent-strong); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.78rem; font-weight: 700; }
.hero-card, .panel { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 24px; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.hero-card { padding: 20px; display: grid; gap: 14px; align-content: start; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.panel { padding: 20px; }
.panel:nth-child(1), .panel:nth-child(2) { grid-column: span 6; }
.panel-progress, .panel-upload, .panel-logs { grid-column: span 12; }
.panel-header, .progress-summary, .hero-actions { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.panel-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.stat-grid, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.stat-card { background: rgba(255, 255, 255, 0.6); border-radius: 18px; padding: 14px; border: 1px solid rgba(70, 54, 35, 0.08); }
.stat-label, label span { display: block; color: var(--muted); font-size: 0.88rem; margin-bottom: 6px; }
strong { font-size: 1rem; }
label, input, select, button, pre { font: inherit; }
input, select { width: 100%; border: 1px solid rgba(70, 54, 35, 0.16); background: rgba(255, 255, 255, 0.85); color: var(--text); border-radius: 14px; padding: 12px 14px; }
.checkbox-row { grid-column: span 2; display: flex; align-items: center; gap: 10px; }
.checkbox-row input { width: auto; }
button { border: none; border-radius: 999px; padding: 11px 18px; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: white; cursor: pointer; font-weight: 700; transition: transform 160ms ease, opacity 160ms ease; }
button.secondary { background: rgba(17, 94, 89, 0.12); color: var(--accent-strong); }
button:hover { transform: translateY(-1px); }
button:disabled { cursor: wait; opacity: 0.55; transform: none; }
.status-line { margin: 0; color: var(--muted); min-height: 1.3em; }
.badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 8px 12px; background: rgba(15, 118, 110, 0.12); color: var(--accent-strong); font-weight: 700; min-width: 84px; }
.progress-bar { width: 100%; height: 16px; background: rgba(70, 54, 35, 0.1); border-radius: 999px; overflow: hidden; margin-top: 18px; }
#progressFill { width: 0%; height: 100%; background: linear-gradient(90deg, var(--warm), var(--accent)); transition: width 320ms ease; }
.progress-metrics { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; color: var(--muted); }
.recent-jobs ul { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.recent-jobs li { padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(70, 54, 35, 0.08); }
.upload-form { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.upload-form input[type="file"] { flex: 1 1 320px; padding: 11px 14px; }
.logs-output { margin: 18px 0 0; padding: 16px; min-height: 360px; max-height: 620px; overflow: auto; background: #211a13; color: #f7e6c7; border-radius: 18px; line-height: 1.45; font-family: "SFMono-Regular", "Menlo", monospace; font-size: 0.86rem; }
@media (max-width: 920px) {
  .hero, .panel:nth-child(1), .panel:nth-child(2) { grid-template-columns: 1fr; grid-column: span 12; }
  .stat-grid, .form-grid { grid-template-columns: 1fr; }
  .checkbox-row { grid-column: span 1; }
  .panel-header, .progress-summary, .hero-actions, .panel-actions { align-items: flex-start; flex-direction: column; }
}
