:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #5f6b7a;
  --line: #d8dee6;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.brand, .admin-header, .section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

h1, h2, p { margin-top: 0; }
h1 { font-size: 28px; margin-bottom: 8px; }
h2 { font-size: 18px; margin-bottom: 16px; }
p { color: var(--muted); line-height: 1.6; }

.admin-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.form, .grid-form {
  display: grid;
  gap: 16px;
}

.grid-form {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  align-items: end;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: #354052;
  font-size: 14px;
  font-weight: 650;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 13px;
  color: var(--text);
  font: inherit;
  background: #fff;
}

input:focus, textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

.dropzone {
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 170px;
  border: 1px dashed #9aa7b5;
  border-radius: 8px;
  padding: 28px;
  background: #fbfcfd;
  cursor: pointer;
  text-align: center;
}

.dropzone input { display: none; }
.dropzone strong { font-size: 18px; }
.dropzone small { color: var(--muted); }

button, .download {
  border: 0;
  border-radius: 6px;
  padding: 12px 16px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

button:hover, .download:hover { background: var(--accent-dark); }
button:disabled { opacity: .65; cursor: wait; }
.secondary {
  background: #eef2f6;
  color: #263241;
}
.secondary:hover { background: #dfe6ee; }
.small { padding: 7px 10px; font-size: 13px; }

.message { min-height: 24px; margin: 0; }
.error { color: var(--danger); }
.hidden { display: none; }

.status-box {
  display: grid;
  gap: 16px;
}

.pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 11px;
  background: #eef2f6;
  color: #263241;
  font-weight: 700;
}
.pill.running { background: #e0f2fe; color: #075985; }
.pill.succeeded { background: #dcfce7; color: #166534; }
.pill.failed { background: #fee2e2; color: #991b1b; }

.progress {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e7edf3;
}
.progress span {
  display: block;
  width: 35%;
  height: 100%;
  background: var(--accent);
  transition: width .3s ease;
}

.download { display: inline-block; margin-top: 20px; }
.download.hidden { display: none; }

.admin-header { margin-bottom: 18px; }
.admin-header h1 { margin-bottom: 4px; }
.admin-shell .panel { margin-bottom: 18px; }
.codes-output { min-height: 130px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td {
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th { color: #4b5868; font-size: 13px; }
.error-cell { max-width: 320px; color: var(--danger); word-break: break-word; }

@media (max-width: 760px) {
  .shell { padding: 24px 0; }
  .panel { padding: 18px; }
  .brand, .admin-header, .section-head { display: grid; }
  .grid-form { grid-template-columns: 1fr; }
}

.file-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}
.file-list.hidden { display: none; }
.file-item {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  word-break: break-all;
  color: #4b5868;
}
.file-item.running { color: #075985; }
.file-item.succeeded { color: #166534; }
.file-item.failed { color: #991b1b; }
