:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --text: #1d2433;
  --muted: #657085;
  --line: #d9dee7;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --warn: #b45309;
  --bad: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

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

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

h1 {
  margin: 0 0 6px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

p {
  margin: 0;
  color: var(--muted);
}

.panel,
.table-wrap,
.log,
.error {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: 22px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.upload {
  min-height: 164px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px dashed #a9b3c4;
  border-radius: 8px;
  background: #fbfcfe;
}

.label,
.settings span {
  font-weight: 650;
}

small {
  color: var(--muted);
  line-height: 1.5;
}

input[type="file"],
input[type="text"],
input[type="number"],
input:not([type]) {
  width: 100%;
  min-height: 40px;
}

.settings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.settings label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings input {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--text);
  background: #fff;
}

.actions,
.options,
.downloads {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.actions {
  justify-content: space-between;
}

.options {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

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

button,
.button,
.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 7px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

button,
.button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

button:hover,
.button:hover {
  background: var(--accent-dark);
}

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.token {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
}

.token span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bad);
}

.token.ready span {
  background: var(--accent);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metrics div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metrics strong {
  display: block;
  font-size: 28px;
}

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

.downloads {
  justify-content: flex-start;
  margin-bottom: 18px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  background: #eef2f6;
  font-weight: 700;
}

.log {
  margin-top: 18px;
  padding: 16px;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  color: #2f3848;
}

.error {
  padding: 16px;
  border-color: #fecaca;
  color: var(--bad);
  background: #fff7f7;
}

@media (max-width: 820px) {
  .topbar,
  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .grid,
  .settings,
  .metrics {
    grid-template-columns: 1fr;
  }
}
