:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4f;
  --text: #e8edf4;
  --muted: #8b9cb3;
  --accent: #3d8bfd;
  --accent-hover: #5a9dff;
  --ok: #3dd68c;
  --warn: #f5a623;
  --err: #f87171;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header,
main,
footer {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

header {
  padding-bottom: 0.5rem;
}

h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 650;
}

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

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}

.panel p {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel p:last-child {
  margin-bottom: 0;
}

code {
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.12em 0.35em;
  border-radius: 4px;
}

.hidden {
  display: none !important;
}

.file-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
}

.file-label input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.file-button {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}

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

.file-name {
  color: var(--muted);
  font-size: 0.88rem;
}

.status {
  margin-top: 0.75rem;
  font-size: 0.88rem;
}

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

.status.ok {
  color: var(--ok);
}

.status.warn {
  color: var(--warn);
}

.status.err {
  color: var(--err);
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
}

select,
input[type="text"] {
  width: 100%;
  max-width: 24rem;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.summary {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.summary.ok {
  background: rgba(61, 214, 140, 0.12);
  color: var(--ok);
}

.summary.err {
  background: rgba(248, 113, 113, 0.12);
  color: var(--err);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

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

th,
td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: rgba(0, 0, 0, 0.2);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

td.num {
  color: var(--muted);
  width: 2.5rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge.ok {
  background: rgba(61, 214, 140, 0.2);
  color: var(--ok);
}

.badge.err {
  background: rgba(248, 113, 113, 0.2);
  color: var(--err);
}

#download-btn {
  padding: 0.6rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

#download-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

#download-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

footer {
  padding-top: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

footer p {
  margin: 0;
}
