:root {
  --bg: #f0f9ff;
  --card: rgba(255, 255, 255, 0.86);
  --ink: #0b1b2b;
  --muted: rgba(11, 27, 43, 0.68);
  --stroke: rgba(11, 27, 43, 0.14);
  --stroke-2: rgba(11, 27, 43, 0.10);

  --primary: #0ea5e9;
  --primary-2: #38bdf8;
  --cta: #f97316;

  --shadow: 0 20px 70px rgba(2, 132, 199, 0.10);
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.45;
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.bg__blob {
  position: absolute;
  width: 68vmax;
  height: 68vmax;
  filter: blur(32px);
  opacity: 0.55;
  border-radius: 999px;
}
.bg__blob--a {
  left: -28vmax;
  top: -32vmax;
  background: radial-gradient(circle at 35% 35%, var(--primary-2), transparent 60%),
    radial-gradient(circle at 70% 60%, rgba(249, 115, 22, 0.85), transparent 55%);
}
.bg__blob--b {
  right: -30vmax;
  bottom: -36vmax;
  background: radial-gradient(circle at 35% 35%, rgba(14, 165, 233, 0.9), transparent 60%),
    radial-gradient(circle at 70% 60%, rgba(56, 189, 248, 0.65), transparent 55%);
}

.wrap {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.top {
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, rgba(240, 249, 255, 0.92), rgba(240, 249, 255, 0.70));
  border-bottom: 1px solid var(--stroke-2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
}

.brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--cta));
  box-shadow: 0 16px 40px rgba(14, 165, 233, 0.18);
}

.brand__title {
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand__sub {
  color: var(--muted);
  font-size: 13px;
}

.main {
  padding: 22px 0 42px;
}

.card {
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 22px;
}

.h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.lead {
  margin: 12px 0 18px;
  color: var(--muted);
  max-width: 70ch;
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

@media (min-width: 920px) {
  .grid { grid-template-columns: 1.2fr 0.8fr; }
}

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

.field {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke-2);
  background: rgba(255, 255, 255, 0.66);
}

.label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.row--between { justify-content: space-between; }

.input,
.textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
  font: inherit;
}

.textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.35;
}

.input:focus,
.textarea:focus {
  border-color: rgba(14, 165, 233, 0.55);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.22);
}

.seg {
  display: inline-flex;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
}

.seg__btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.seg__btn[aria-selected="true"] {
  color: var(--ink);
  background: rgba(14, 165, 233, 0.12);
}

.pane { margin-top: 10px; }
.pane--hidden { display: none; }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn {
  border: 1px solid rgba(249, 115, 22, 0.25);
  background: linear-gradient(135deg, var(--cta), rgba(249, 115, 22, 0.78));
  color: #ffffff;
  border-radius: 14px;
  padding: 11px 12px;
  font: inherit;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: filter 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.btn:hover { filter: brightness(1.03); }
.btn:active { transform: translateY(1px); }

.btn--ghost {
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke-2);
  background: rgba(255, 255, 255, 0.62);
  padding: 14px;
}

.status__title {
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.status--compact { padding: 12px 14px; }

.log {
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  color: rgba(11, 27, 43, 0.76);
}

.summary {
  font-size: 13px;
  color: rgba(11, 27, 43, 0.76);
}

.foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--stroke-2);
  color: var(--muted);
  font-size: 12px;
  display: grid;
  gap: 6px;
}

.loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.20);
  backdrop-filter: blur(10px);
  z-index: 50;
}

.loader[hidden] {
  display: none;
}

.loader__panel {
  width: min(560px, calc(100% - 28px));
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 30px 90px rgba(2, 132, 199, 0.22);
  padding: 18px;
}

.loader__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 10px;
}

.loader__spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 3px solid rgba(14, 165, 233, 0.22);
  border-top-color: var(--primary);
  animation: spin 900ms linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .loader__spinner { animation: none; }
  .btn { transition: none; }
}

.loader__title {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.loader__sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.steps {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--stroke-2);
  background: rgba(255, 255, 255, 0.68);
  color: rgba(11, 27, 43, 0.72);
}

.step__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(11, 27, 43, 0.16);
}

.step.is-active { color: var(--ink); }
.step.is-active .step__dot { background: var(--primary); }
.step.is-done .step__dot { background: rgba(34, 197, 94, 0.95); }
