:root {
  --bg: #f7f9fc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --soft: #eff6ff;
  --ok: #047857;
  --err: #b91c1c;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --radius: 18px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 32%),
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 28%),
    var(--bg);
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 18px 48px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.brand {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.brand:hover { color: var(--primary); }

.badge {
  background: var(--soft);
  color: var(--primary);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 32px 28px;
}

.hero-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #3b82f6, #4f46e5);
  font-size: 30px;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.28);
}

h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(28px, 5vw, 34px);
  letter-spacing: -0.03em;
}

.lead {
  margin: 12px auto 28px;
  max-width: 34rem;
  text-align: center;
  color: var(--muted);
  line-height: 1.55;
  font-size: 16px;
}

.dropzone {
  border: 1.5px dashed #93c5fd;
  background: linear-gradient(180deg, #f8fbff, #eef6ff);
  border-radius: var(--radius);
  padding: 28px 18px;
  text-align: center;
  cursor: pointer;
  transition: 0.18s ease;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragover {
  border-color: var(--primary);
  background: #eaf2ff;
  transform: translateY(-1px);
}
.dropzone.has-file {
  border-style: solid;
  border-color: #86efac;
  background: #f0fdf4;
}
.drop-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  word-break: break-word;
}
.drop-sub {
  margin-top: 8px;
  color: #64748b;
  font-size: 13px;
}

.field-label {
  display: block;
  margin: 24px 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.targets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.target {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 8px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: 0.15s ease;
}
.target:hover { border-color: #93c5fd; color: var(--primary); }
.target.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.primary {
  width: 100%;
  margin-top: 22px;
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 16px;
  cursor: pointer;
  transition: 0.15s ease;
}
.primary:hover:not(:disabled) { background: var(--primary-dark); }
.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #334155;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.status.ok {
  border-color: #86efac;
  background: #f0fdf4;
  color: var(--ok);
}
.status.err {
  border-color: #fca5a5;
  background: #fef2f2;
  color: var(--err);
}
.status.busy {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.preview {
  margin: 14px 0 0;
  max-height: 220px;
  overflow: auto;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.hidden { display: none; }

.foot {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
  color: #64748b;
  font-size: 13px;
}
.foot a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.foot a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .card { padding: 24px 16px; }
  .targets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot { flex-direction: column; }
}