:root {
  color-scheme: light;
  --ink: #132026;
  --muted: #68757d;
  --line: #d7e0e4;
  --accent: #0b6b5b;
  --accent-dark: #084e43;
  --surface: #ffffff;
  --page: #f4f7f8;
  --danger: #a22222;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--page);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

h1, h2, p { margin-top: 0; }
h1 { font-size: 26px; margin-bottom: 4px; }
h2 { font-size: 18px; }
.topbar p, .muted { color: var(--muted); margin-bottom: 0; }

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

.panel, .wide, .login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.wide { grid-column: 1 / -1; }
.results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 13px;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
}

button, .download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button:hover, .download:hover { background: var(--accent-dark); }
.secondary { background: #51626a; }
.captcha { color: var(--accent-dark); font-weight: 800; }
.flash, .error { color: var(--danger); }
.sample-title {
  margin: -2px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.sample-box {
  margin: 0 0 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfb;
  color: var(--ink);
  font: 13px/1.5 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
}
.result {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.progress-box {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfb;
}

.progress-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.progress-line strong { color: var(--accent-dark); }

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe6e8;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  font-size: 13px;
}

.status-grid b { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { border-bottom: 1px solid var(--line); padding: 9px; text-align: left; white-space: nowrap; }
th { background: #eef3f4; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.login-panel { width: min(420px, calc(100vw - 28px)); }
.login-panel button { width: 100%; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
}
