* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: #0c1520;
  color: #e7edf5;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.page.narrow {
  max-width: 560px;
}

.panel {
  background: #132131;
  border: 1px solid #24384e;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}

.lede {
  color: #b8c6d7;
}

.toolbar,
.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand {
  justify-content: flex-start;
  gap: 24px;
}

.brand h1 {
  margin: 0 0 6px;
}

.logo {
  width: 120px;
  height: auto;
  flex: none;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.22));
}

@media (max-width: 820px) {
  .toolbar {
    align-items: flex-start;
  }

  .brand {
    align-items: flex-start;
  }

  .logo {
    width: 88px;
  }
}

.form {
  display: grid;
  gap: 16px;
}

fieldset {
  border: 1px solid #2b4159;
  border-radius: 10px;
  padding: 14px;
}

label {
  display: grid;
  gap: 8px;
}

input[type="url"],
input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  border: 1px solid #35506d;
  border-radius: 10px;
  background: #0e1a27;
  color: #eef5fb;
  padding: 12px;
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 10px;
  padding: 14px 20px;
  background: #ff295e;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

.secondary,
.download-link {
  background: #213549;
  color: white;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 10px;
}

.nav-button {
  border: 1px solid #35506d;
  font-weight: 600;
}

.download-link-primary {
  background: #18a957;
  border: 1px solid #36cf77;
  font-weight: 700;
  font-size: 18px;
  min-width: 220px;
  box-shadow: 0 10px 24px rgba(24, 169, 87, 0.28);
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.check-all {
  font-weight: 700;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: auto;
}

.error {
  background: #4a1624;
  border: 1px solid #923147;
  color: #ffd8df;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.hidden,
.crawl-status.hidden,
.spinner.hidden {
  display: none !important;
}

.progress-list {
  display: grid;
  gap: 12px;
}

.crawl-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid #2b4159;
  border-radius: 12px;
  background: #0e1a27;
}

.crawl-status-text {
  margin: 6px 0 0;
  color: #b8c6d7;
}

.run-status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.run-activity {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #0e1a27;
  border: 1px solid #2b4159;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(231, 237, 245, 0.22);
  border-top-color: #2fe3a8;
  animation: spin 0.85s linear infinite;
}

.spinner.is-idle {
  animation: none;
  border-color: #2b4159;
  border-top-color: #36cf77;
}

.overall-progress {
  margin: 16px 0;
}

.overall-progress-head,
.progress-row-head,
.progress-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.overall-progress-head {
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #0a131d;
  border: 1px solid #24384e;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #2fe3a8);
  transition: width 0.3s ease;
}

.progress-fill.state-failed {
  background: linear-gradient(90deg, #c93a59, #ff6b8c);
}

.progress-fill.state-retrying {
  background: linear-gradient(90deg, #f59e0b, #facc15);
}

.progress-fill.state-queued {
  background: linear-gradient(90deg, #35506d, #4f6f92);
}

.progress-row {
  padding: 10px 12px;
  border: 1px solid #2b4159;
  border-radius: 10px;
  background: #0e1a27;
  display: grid;
  gap: 10px;
}

.progress-row-meta {
  color: #b8c6d7;
  font-size: 14px;
}

.progress-row.state-failed {
  border-color: #923147;
  background: #24121a;
}

.progress-row.state-completed {
  border-color: #1f7f48;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid #2b4159;
  border-radius: 12px;
  background: #0e1a27;
  color: #e7edf5;
  text-decoration: none;
}

.history-item:hover,
.history-item:focus {
  border-color: #36cf77;
  box-shadow: 0 0 0 1px rgba(54, 207, 119, 0.2);
}

.history-item span,
.empty-state {
  color: #b8c6d7;
}

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

pre {
  white-space: pre-wrap;
  word-break: break-word;
}
