:root {
  color-scheme: light;
  --bg: #f3f5f1;
  --panel: #ffffff;
  --ink: #20251f;
  --muted: #626b62;
  --line: #cbd2c7;
  --accent: #2e6f73;
  --accent-strong: #17494c;
  --danger: #a13c32;
  --shadow: 0 16px 40px rgba(32, 37, 31, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  font-size: 15px;
  line-height: 1.2;
}

.topbar p {
  margin-top: 5px;
  color: var(--muted);
}

.badge {
  min-width: 112px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #e8f0ec;
  color: var(--accent-strong);
  padding: 7px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.badge.failed {
  background: #f7e7e4;
  color: var(--danger);
}

.workspace,
.details,
.logpanel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(300px, 0.9fr);
  gap: 18px;
  padding: 18px;
}

.dropzone {
  position: relative;
  min-height: 148px;
  border: 1px dashed #9aab9b;
  border-radius: 8px;
  background: #fbfcfa;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone input:disabled {
  cursor: not-allowed;
}

.dropcopy {
  display: grid;
  gap: 6px;
  padding: 24px;
  text-align: center;
  pointer-events: none;
}

.dropcopy strong {
  font-size: 18px;
}

.dropcopy span,
.summary dt,
.summary dd,
td,
th,
pre {
  font-size: 13px;
}

.dropcopy span,
.summary dt {
  color: var(--muted);
}

.controls {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: start;
  gap: 10px;
}

.controls label {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 700;
}

select {
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

button,
.download {
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

button {
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

button:disabled,
select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.download {
  grid-column: 1 / -1;
  background: #edf3ef;
  border-color: var(--line);
  color: var(--accent-strong);
}

.download.disabled {
  pointer-events: none;
  color: var(--muted);
}

.summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.summary div {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}

.summary dd {
  margin: 4px 0 0;
  font-weight: 800;
}

.details,
.logpanel {
  margin-top: 18px;
  padding: 16px;
}

.details h2,
.logpanel h2 {
  margin-bottom: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-weight: 800;
}

pre {
  min-height: 42px;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

@media (max-width: 780px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .topbar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .summary {
    grid-template-columns: 1fr;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    border-top: 1px solid var(--line);
    padding: 8px 0;
  }

  td {
    border: 0;
    padding: 5px 0;
  }
}
