:root {
  --bg: #eef2f7;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d6dbe4;
  --accent: #0f766e;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top right, #e0f2fe, var(--bg) 45%);
}

.wrap {
  max-width: 1040px;
  margin: 36px auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}

h1 { margin-top: 0; }
.muted { color: var(--muted); }

label { display: block; font-weight: 600; font-size: 14px; }
input, select {
  width: 100%;
  margin-top: 6px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.buttons {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

.csv-link {
  margin-left: auto;
  color: var(--accent);
  text-decoration: none;
}

.status {
  margin-top: 14px;
  min-height: 24px;
  color: var(--muted);
}

.loader {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #c7d2fe;
  border-top-color: var(--accent);
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.results {
  margin-top: 16px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 8px;
  font-size: 14px;
  text-align: left;
}

@media (max-width: 880px) {
  .row { grid-template-columns: 1fr; }
  .csv-link { margin-left: 0; }
}
