:root {
  --bg: #0f1115;
  --panel: #171a21;
  --border: #262b36;
  --text: #e6e8ee;
  --muted: #98a0b3;
  --accent: #f97316;
  --ok: #34d399;
  --err: #f87171;
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  max-width: 1100px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

h1 {
  margin: 0;
  font-size: 1.6rem;
}

h2 {
  font-size: 1.1rem;
  margin: 2rem 0 0.75rem;
}

.sub,
.hint,
.status {
  color: var(--muted);
  font-size: 0.9rem;
}

code,
.mono,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.panel {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.field.small {
  min-width: 8rem;
}

.field.check {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  align-self: end;
  padding-bottom: 0.5rem;
}

input,
select,
button {
  font: inherit;
  color: var(--text);
  background: #0d1016;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
}

button {
  cursor: pointer;
  background: var(--accent);
  color: #1a1206;
  border: 0;
  font-weight: 600;
}

button:hover {
  filter: brightness(1.08);
}

.drop {
  margin-top: 1.25rem;
  padding: 2.5rem 1rem;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.drop.over {
  border-color: var(--accent);
  background: #1a1512;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child,
th:nth-child(3),
td:nth-child(3),
th:nth-child(4),
td:nth-child(4) {
  text-align: left;
}

tbody tr:hover {
  background: #14171e;
}

td.err {
  color: var(--err);
  text-align: left;
}

.engine-worker {
  color: var(--accent);
}

.engine-browser {
  color: var(--ok);
}

.table-scroll {
  overflow-x: auto;
}

.actions {
  display: flex;
  gap: 0.35rem;
}

.actions button {
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
}

.detail-row td {
  background: #12151c;
  white-space: normal;
}

dl.metrics {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.15rem 1rem;
  margin: 0.25rem 0 0.75rem;
  font-size: 0.82rem;
}

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

dl.metrics dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.raw-json {
  max-height: 16rem;
  font-size: 0.75rem;
}

.compare p {
  margin: 0.35rem 0;
  font-size: 0.86rem;
  color: var(--ok);
}

#log {
  max-height: 18rem;
  font-size: 0.76rem;
}

pre {
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 26rem;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 0.82rem;
}

.preview-tools {
  margin-bottom: 0.5rem;
}

#download-csv {
  margin-top: 1rem;
}
